AvatarCreatorsCreationFlowQueries.entrypointutils",["AvatarCreatorsCreationFlowDesign3DContentQuery$Parameters","AvatarCreatorsCreationFlowFantaStyleSelectionQuery$Parameters","AvatarCreatorsCreationFlowFantaUploadPanelQuery$Parameters","AvatarCreatorsCreationFlowTemplateSelectionQuery$Parameters","XFBAvatarAssetTemplateCategory.facebook"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a=a.routeParams;var b=a.item_type,d=a.step,e=a.template_category;a=a.template_id;var f={};d=d;if(d==null)switch(b){case"clothing":case null:d="template";break;case"fanta":d="fanta_template";break;default:d=""}if(d==="template"){f.templates={parameters:c("AvatarCreatorsCreationFlowTemplateSelectionQuery$Parameters"),variables:{category:[(b=c("XFBAvatarAssetTemplateCategory.facebook").cast(e))!=null?b:"TOP"],useCase:"CREATOR_3P"}}}else d==="fanta_template"?f.fanta_template_list={parameters:c("AvatarCreatorsCreationFlowFantaStyleSelectionQuery$Parameters"),variables:{category:["FANTA_BODY"],useCase:"CREATOR_3P"}}:d==="fanta_design"&&(f.fanta_template={parameters:c("AvatarCreatorsCreationFlowFantaUploadPanelQuery$Parameters"),variables:{category:["FANTA_BODY"],useCase:"CREATOR_3P"}});a!=null&&(f.renderer={parameters:c("AvatarCreatorsCreationFlowDesign3DContentQuery$Parameters"),variables:{templateID:a}});return f}g.getQueryParams=a}),98);
-----
AvatarCreatorsCreationFlowDesign3DContentQuery$Parameters",["AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsCreationFlowDesign3DContentQuery",operationKind:"query",text:null}};e.exports=a}),null);
-----
AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24260628363544265"}),null);
-----
AvatarCreatorsCreationFlowDesign3DContent.react",["fbt","ix","AvatarCreatorsCreationFlowActions","AvatarCreatorsCreationFlowConsts","AvatarCreatorsCreationFlowContext","AvatarCreatorsCreationFlowDesign3DBabylonCanvas","AvatarCreatorsCreationFlowDesign3DContentQuery.graphql","AvatarCreatorsCreationFlowDesign3DOutfitController","AvatarCreatorsCreationFlowDesign3DUtils","AvatarCreatorsCreationFlowUtils","AvatarCreatorsLogging","CometRelay","GeoButton.react","asyncToGeneratorRuntime","fbicon","nullthrows","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l=k||(k=d("react"));e=k;var m=e.useCallback,n=e.useEffect,o=e.useRef,p=j!==void 0?j:j=b("AvatarCreatorsCreationFlowDesign3DContentQuery.graphql");function a(a){var e=a.activeTextureIndex,f=a.showSeamGuides,g=a.showUVGrid,j=a.textureGenerationInProgress,k=a.textures,q=a.generate,r=a.onLoaded;a=a.queryRef;var s=d("AvatarCreatorsCreationFlowContext").useAvatarCreatorsCreationFlowDispatch(),t=o(!1),u=o(),v=o(null),w=o(),x=o(),y=o();a=d("CometRelay").usePreloadedQuery(p,a);a=a.avatars_retexture_template_config;var z=c("nullthrows")(a==null?void 0:a.template_uri),A=c("nullthrows")(a==null?void 0:a.category),B=e!=null?k[e]:null;n(function(){x.current=new Image(),x.current.src=d("AvatarCreatorsCreationFlowConsts").TEXTURE_SEAM_IMAGE_URL,w.current=new Image(),w.current.src=d("AvatarCreatorsCreationFlowConsts").TEXTURE_UV_IMAGE_URL},[]);n(function(){s(d("AvatarCreatorsCreationFlowActions").setModelCategory(A))},[s,A]);a=m(function(a){d("AvatarCreatorsCreationFlowDesign3DUtils").setupDefaultScene(a);function c(){return e.apply(this,arguments)}function e(){e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield window.fetch(z));b=(yield b.arrayBuffer());b=(yield d("AvatarCreatorsCreationFlowDesign3DOutfitController").OutfitController.FromTemplateModel(a,b));y.current=b;d("AvatarCreatorsCreationFlowDesign3DUtils").centerDefaultCamerasOnNode(a,b.getMesh());b=(yield b.getAlbedoTextureData());s(d("AvatarCreatorsCreationFlowActions").addDefaultTexture({imageData:b,isShapeAware:!1,isUserUploaded:!1}));v.current=a;r()});return e.apply(this,arguments)}c()["catch"](d("AvatarCreatorsLogging").logMustFix)},[s,z,r]);n(function(){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(v.current==null||w.current==null||x.current==null||B==null||e==null||(B==null?void 0:B.isLoading))return;var a=[];g&&a.push(c("nullthrows")(w.current));f&&a.push(c("nullthrows")(x.current));var b=c("nullthrows")(v.current),h=c("nullthrows")(y.current);a=B.isFailed?null:yield d("AvatarCreatorsCreationFlowUtils").createImageFromTexture(s,e,B,a);if(a!=null)h.setAlbedoTextureData(a);else if(e!==0){a=d("AvatarCreatorsCreationFlowUtils").createImageFromTexture(s,0,k[0],[]);a!=null&&h.setAlbedoTextureData(yield a)}b.cameras.forEach(function(a){a.restoreState()});d("AvatarCreatorsCreationFlowDesign3DUtils").createScreenshot(b,"thumbnailCamera",512,function(a){s(d("AvatarCreatorsCreationFlowActions").updateThumbnail(e,a))})});return h.apply(this,arguments)}if(t.current){u.current=a;return}t.current=!0;function i(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield a();while(u.current){var b=u.current;u.current=null;yield b()}});return j.apply(this,arguments)}i()["catch"](d("AvatarCreatorsLogging").logMustFix)["finally"](function(){t.current=!1})},[B,e,s,g,f,k]);n(function(){var a=y.current;if(!a)return;a.setLoadEffectEnabled(j)},[j]);return l.jsxs(l.Fragment,{children:[e!=null&&k[e].isFailed?l.jsx("div",{className:"x1nrll8i x10l6tqk xwa60dl x11lhmoz",children:l.jsx(c("GeoButton.react"),{icon:d("fbicon")._(i("1083459"),32),isLabelHidden:!0,label:h._(/*BTDS*/"Reload"),onClick:function(){var a;a=(a=k[e].modelOutputEnhancedPrompt)!=null?a:k[e].prompt;a!=null&&q(a,k[e].modelOutputSeed,!1,e)},variant:"primary"})}):null,l.jsx(c("AvatarCreatorsCreationFlowDesign3DBabylonCanvas"),{onSceneCreated:a})]})}a.displayName=a.name+" [from "+f.id+"]";e=d("AvatarCreatorsCreationFlowContext").withAvatarCreatorsCreationFlowState(a,function(a){return{activeTextureIndex:a.activeTextureIndex,showSeamGuides:a.showSeamGuides,showUVGrid:a.showUVGrid,textureGenerationInProgress:a.textureGenerationInProgress,textures:a.textures}});g["default"]=e}),226);
-----
AvatarCreatorsCreationFlowDesign3DContentQuery.graphql",["AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation","relay-runtime"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"templateID"}],c=[{alias:null,args:[{kind:"Variable",name:"template_config_id",variableName:"templateID"}],concreteType:"AvatarRetextureSingleTemplateResponse",kind:"LinkedField",name:"avatars_retexture_template_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"template_uri",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"category",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"AvatarCreatorsCreationFlowDesign3DContentQuery",selections:c,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"AvatarCreatorsCreationFlowDesign3DContentQuery",selections:c},params:{id:b("AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsCreationFlowDesign3DContentQuery",operationKind:"query",text:null}}}();b("relay-runtime").PreloadableQueryRegistry.set(a.params.id,a);e.exports=a}),null);
-----
-----
AvatarCreatorsCreationFlowDesign3DContentQuery$Parameters",["AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsCreationFlowDesign3DContentQuery",operationKind:"query",text:null}};e.exports=a}),null);
-----
AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24260628363544265"}),null);
-----
AvatarCreatorsCreationFlowDesign3DContent.react",["fbt","ix","AvatarCreatorsCreationFlowActions","AvatarCreatorsCreationFlowConsts","AvatarCreatorsCreationFlowContext","AvatarCreatorsCreationFlowDesign3DBabylonCanvas","AvatarCreatorsCreationFlowDesign3DContentQuery.graphql","AvatarCreatorsCreationFlowDesign3DOutfitController","AvatarCreatorsCreationFlowDesign3DUtils","AvatarCreatorsCreationFlowUtils","AvatarCreatorsLogging","CometRelay","GeoButton.react","asyncToGeneratorRuntime","fbicon","nullthrows","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l=k||(k=d("react"));e=k;var m=e.useCallback,n=e.useEffect,o=e.useRef,p=j!==void 0?j:j=b("AvatarCreatorsCreationFlowDesign3DContentQuery.graphql");function a(a){var e=a.activeTextureIndex,f=a.showSeamGuides,g=a.showUVGrid,j=a.textureGenerationInProgress,k=a.textures,q=a.generate,r=a.onLoaded;a=a.queryRef;var s=d("AvatarCreatorsCreationFlowContext").useAvatarCreatorsCreationFlowDispatch(),t=o(!1),u=o(),v=o(null),w=o(),x=o(),y=o();a=d("CometRelay").usePreloadedQuery(p,a);a=a.avatars_retexture_template_config;var z=c("nullthrows")(a==null?void 0:a.template_uri),A=c("nullthrows")(a==null?void 0:a.category),B=e!=null?k[e]:null;n(function(){x.current=new Image(),x.current.src=d("AvatarCreatorsCreationFlowConsts").TEXTURE_SEAM_IMAGE_URL,w.current=new Image(),w.current.src=d("AvatarCreatorsCreationFlowConsts").TEXTURE_UV_IMAGE_URL},[]);n(function(){s(d("AvatarCreatorsCreationFlowActions").setModelCategory(A))},[s,A]);a=m(function(a){d("AvatarCreatorsCreationFlowDesign3DUtils").setupDefaultScene(a);function c(){return e.apply(this,arguments)}function e(){e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield window.fetch(z));b=(yield b.arrayBuffer());b=(yield d("AvatarCreatorsCreationFlowDesign3DOutfitController").OutfitController.FromTemplateModel(a,b));y.current=b;d("AvatarCreatorsCreationFlowDesign3DUtils").centerDefaultCamerasOnNode(a,b.getMesh());b=(yield b.getAlbedoTextureData());s(d("AvatarCreatorsCreationFlowActions").addDefaultTexture({imageData:b,isShapeAware:!1,isUserUploaded:!1}));v.current=a;r()});return e.apply(this,arguments)}c()["catch"](d("AvatarCreatorsLogging").logMustFix)},[s,z,r]);n(function(){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(v.current==null||w.current==null||x.current==null||B==null||e==null||(B==null?void 0:B.isLoading))return;var a=[];g&&a.push(c("nullthrows")(w.current));f&&a.push(c("nullthrows")(x.current));var b=c("nullthrows")(v.current),h=c("nullthrows")(y.current);a=B.isFailed?null:yield d("AvatarCreatorsCreationFlowUtils").createImageFromTexture(s,e,B,a);if(a!=null)h.setAlbedoTextureData(a);else if(e!==0){a=d("AvatarCreatorsCreationFlowUtils").createImageFromTexture(s,0,k[0],[]);a!=null&&h.setAlbedoTextureData(yield a)}b.cameras.forEach(function(a){a.restoreState()});d("AvatarCreatorsCreationFlowDesign3DUtils").createScreenshot(b,"thumbnailCamera",512,function(a){s(d("AvatarCreatorsCreationFlowActions").updateThumbnail(e,a))})});return h.apply(this,arguments)}if(t.current){u.current=a;return}t.current=!0;function i(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield a();while(u.current){var b=u.current;u.current=null;yield b()}});return j.apply(this,arguments)}i()["catch"](d("AvatarCreatorsLogging").logMustFix)["finally"](function(){t.current=!1})},[B,e,s,g,f,k]);n(function(){var a=y.current;if(!a)return;a.setLoadEffectEnabled(j)},[j]);return l.jsxs(l.Fragment,{children:[e!=null&&k[e].isFailed?l.jsx("div",{className:"x1nrll8i x10l6tqk xwa60dl x11lhmoz",children:l.jsx(c("GeoButton.react"),{icon:d("fbicon")._(i("1083459"),32),isLabelHidden:!0,label:h._(/*BTDS*/"Reload"),onClick:function(){var a;a=(a=k[e].modelOutputEnhancedPrompt)!=null?a:k[e].prompt;a!=null&&q(a,k[e].modelOutputSeed,!1,e)},variant:"primary"})}):null,l.jsx(c("AvatarCreatorsCreationFlowDesign3DBabylonCanvas"),{onSceneCreated:a})]})}a.displayName=a.name+" [from "+f.id+"]";e=d("AvatarCreatorsCreationFlowContext").withAvatarCreatorsCreationFlowState(a,function(a){return{activeTextureIndex:a.activeTextureIndex,showSeamGuides:a.showSeamGuides,showUVGrid:a.showUVGrid,textureGenerationInProgress:a.textureGenerationInProgress,textures:a.textures}});g["default"]=e}),226);
-----
AvatarCreatorsCreationFlowDesign3DContentQuery.graphql",["AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation","relay-runtime"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"templateID"}],c=[{alias:null,args:[{kind:"Variable",name:"template_config_id",variableName:"templateID"}],concreteType:"AvatarRetextureSingleTemplateResponse",kind:"LinkedField",name:"avatars_retexture_template_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"template_uri",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"category",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"AvatarCreatorsCreationFlowDesign3DContentQuery",selections:c,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"AvatarCreatorsCreationFlowDesign3DContentQuery",selections:c},params:{id:b("AvatarCreatorsCreationFlowDesign3DContentQuery_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsCreationFlowDesign3DContentQuery",operationKind:"query",text:null}}}();b("relay-runtime").PreloadableQueryRegistry.set(a.params.id,a);e.exports=a}),null);
-----