PageSourceSearch

https://cdn.meshy.ai/webapp-build-assets/production/_next/static/chunks/061139_yjcy6f.js

js meshy.ai collected 2026-09-24 08:41:40 UTC 96,911 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,631939,e=>{"use strict";var t=e.i(843476),i=e.i(219995),a=e.i(225913),r=e.i(530589),s=e.i(562263),l=e.i(271645),n=e.i(975505),o=e.i(30737),d=e.i(758922);let c=(0,a.cva)("grid h-full auto-cols-fr grid-flow-col items-stretch",{variants:{size:{xs:"p-0.5 h-7",sm:"p-1 h-9",md:"p-1 h-10",lg:"p-1 h-12"},variant:{primary:"bg-bg-base",secondary:"bg-bg-translucent-strong rounded-full",gradient:"rounded-full",accent:"rounded-full"}},compoundVariants:[{size:"xs",variant:"primary",className:"rounded-lg"},{size:"sm",variant:"primary",className:"rounded-[10px]"},{size:"md",variant:"primary",className:"rounded-xl"},{size:"lg",variant:"primary",className:"rounded-[14px]"}],defaultVariants:{size:"md",variant:"primary"}}),u=l.createContext(null);function h(e){let{className:a,size:r,variant:n,children:d,defaultValue:h,value:m,onValueChange:p,onChange:f,...x}=e,g=(0,l.useId)(),[w,v]=(0,i.useControllableValue)({...e,onChange:e=>{f?.(e),p?.(e)}});return(0,t.jsx)(u,{value:{value:w,size:r,variant:n,layoutId:g},children:(0,t.jsx)(s.RadioGroup.Root,{"data-slot":"radio-group",className:(0,o.cn)(c({size:r,variant:n,className:a})),value:w,onValueChange:v,...x,children:d})})}let m=(0,a.cva)("absolute z-[-1] inset-0 pointer-events-none",{variants:{size:{xs:"",sm:"",md:"",lg:""},variant:{primary:"bg-accent-bg",secondary:"bg-bg-translucent-strongest rounded-full",gradient:"rounded-full bg-gradient-to-r from-accent-base to-accent-support-highlight",accent:"rounded-full bg-accent-base"}},compoundVariants:[{size:"xs",variant:"primary",className:"rounded-md"},{size:"sm",variant:"primary",className:"rounded-lg"},{size:"md",variant:"primary",className:"rounded-[10px]"},{size:"lg",variant:"primary",className:"rounded-xl"}],defaultVariants:{size:"md",variant:"primary"}}),p=(0,a.cva)("relative flex grow items-center gap-1 justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0 cursor-pointer group-data-disabled/item:cursor-not-allowed transition-colors min-w-0",{variants:{size:{xs:"text-xs px-2 py-1",sm:"text-xs-plus px-2 py-1.5",md:"text-sm-plus px-2 py-1.5",lg:"text-base font-medium px-4 py-2"},highlight:{true:"text-gradient-credit",false:""},variant:{primary:"text-label-muted group-[[data-state='checked']:not([disabled])]/item:text-accent-base group-[[data-state='checked'][disabled]]/item:text-accent-base group-[[data-state='checked'][disabled]]/item:opacity-40 group-[[data-state='unchecked']:not([disabled]):hover]/item:text-label-title group-[[data-state='unchecked'][disabled]]/item:text-label-faint",secondary:"text-label-base rounded-full group-[[data-state='unchecked']:not([disabled]):hover]/item:bg-bg-translucent-strong group-[[data-state='unchecked'][disabled]]/item:text-label-muted",gradient:"rounded-full text-label-muted group-[[data-state='checked']:not([disabled])]/item:text-accent-label group-[[data-state='unchecked']:not([disabled]):hover]/item:text-label-title group-[[data-state='unchecked'][disabled]]/item:text-label-faint",accent:"rounded-full text-label-muted group-[[data-state='checked']:not([disabled])]/item:text-accent-label group-[[data-state='unchecked']:not([disabled]):hover]/item:text-label-title group-[[data-state='unchecked'][disabled]]/item:text-label-faint"}},defaultVariants:{size:"md",variant:"primary",highlight:!1}});function f({className:e,children:i,value:a,proProps:c,tooltipProps:h,disabled:x,badge:g,...w}){let{size:v,variant:b,value:S,layoutId:y}=(()=>{let e=l.useContext(u);if(!e)throw Error("useSegmentedControl must be used within a SegmentedControlRoot");return e})();return(0,t.jsxs)(s.RadioGroup.Item,{"data-slot":"radio-group-item",className:(0,o.cn)("peer/item group/item relative isolate flex items-stretch select-none",e),value:a,disabled:x,...w,children:[S===a&&(0,t.jsx)(r.motion.span,{layoutId:y,layoutDependency:S,className:(0,o.cn)(m({size:v,variant:b}),x&&"opacity-40"),transition:{type:"spring",stiffness:500,damping:40}}),c&&!x?(0,t.jsx)(n.ProRoot,{asChild:!0,children:e=>(0,t.jsx)(n.ProTrigger,{position:c.position,tooltipProps:!e&&h?{disabled:!1,title:void 0,...h}:c.tooltipProps,properties:c.properties,asChild:!0,children:(0,t.jsxs)("span",{className:p({size:v,variant:b,highlight:"highlight"===c.variant&&e}),children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:i}),("icon"===c.variant||void 0===c.variant)&&(0,t.jsx)(n.ProTag,{variant:"icon"})]})})}):(0,t.jsx)(d.default,{disabled:!h,unstyled:!0,asChild:!0,...h,children:(0,t.jsxs)("span",{className:p({size:v,variant:b}),children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:i}),g]})}),(0,t.jsx)("span",{className:(0,o.cn)("isolate z-[-2] h-5 w-px self-center rounded-[1px] bg-[#3F3F3F] opacity-100 transition-opacity group-last-of-type/item:opacity-0 group-focus-visible/item:opacity-0 group-data-[state=checked]/item:opacity-0 group-[&:has(+_[data-state='checked'])]/item:opacity-0 group-[&:has(+_input_+_[data-state='checked'])]/item:opacity-0","xs"===v&&"h-4")})]})}e.s(["SegmentedControl",0,function({options:e,...i}){return(0,t.jsx)(h,{...i,children:e.filter(e=>!e.hidden).map(e=>(0,t.jsx)(f,{...e,children:e.label},e.value))})},"SegmentedControlItem",0,f,"SegmentedControlRoot",0,h])},415944,e=>{"use strict";var t=(0,e.i(33550).default)("outline","rotate-clockwise","IconRotateClockwise",[["path",{d:"M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5",key:"svg-0"}]]);e.s(["IconRotateClockwise",0,t],415944)},680407,e=>{"use strict";var t=e.i(732009);class i extends t.DataTextureLoader{constructor(e){super(e),this.type=t.HalfFloatType}parse(e){let i,a,r,s=function(e,t){switch(e){case 1:throw Error("THREE.RGBELoader: Read Error: "+(t||""));case 2:throw Error("THREE.RGBELoader: Write Error: "+(t||""));case 3:throw Error("THREE.RGBELoader: Bad File Format: "+(t||""));default:throw Error("THREE.RGBELoader: Memory Error: "+(t||""))}},l=function(e,t,i){t=t||1024;let a=e.pos,r=-1,s=0,l="",n=String.fromCharCode.apply(null,new Uint16Array(e.subarray(a,a+128)));for(;0>(r=n.indexOf("\n"))&&s<t&&a<e.byteLength;)l+=n,s+=n.length,a+=128,n+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(a,a+128)));return -1<r&&(!1!==i&&(e.pos+=s+r+1),l+n.slice(0,r))},n=new Uint8Array(e);n.pos=0;let o=function(e){let t,i,a=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,r=/^\s*EXPOSURE\s*=\s
1*(\d+(\.\d+)?)\s*$/,n=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,d={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};for(!(e.pos>=e.byteLength)&&(t=l(e))||s(1,"no header found"),(i=t.match(/^#\?(\S+)/))||s(3,"bad initial token"),d.valid|=1,d.programtype=i[1],d.string+=t+"\n";!1!==(t=l(e));){if(d.string+=t+"\n","#"===t.charAt(0)){d.comments+=t+"\n";continue}if((i=t.match(a))&&(d.gamma=parseFloat(i[1])),(i=t.match(r))&&(d.exposure=parseFloat(i[1])),(i=t.match(n))&&(d.valid|=2,d.format=i[1]),(i=t.match(o))&&(d.valid|=4,d.height=parseInt(i[1],10),d.width=parseInt(i[2],10)),2&d.valid&&4&d.valid)break}return 2&d.valid||s(3,"missing format specifier"),4&d.valid||s(3,"missing image size specifier"),d}(n),d=o.width,c=o.height,u=function(e,t,i){if(t<8||t>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);t!==(e[2]<<8|e[3])&&s(3,"wrong scanline width");let a=new Uint8Array(4*t*i);a.length||s(4,"unable to allocate buffer space");let r=0,l=0,n=4*t,o=new Uint8Array(4),d=new Uint8Array(n),c=i;for(;c>0&&l<e.byteLength;){l+4>e.byteLength&&s(1),o[0]=e[l++],o[1]=e[l++],o[2]=e[l++],o[3]=e[l++],(2!=o[0]||2!=o[1]||(o[2]<<8|o[3])!=t)&&s(3,"bad rgbe scanline format");let i=0,u;for(;i<n&&l<e.byteLength;){let t=(u=e[l++])>128;if(t&&(u-=128),(0===u||i+u>n)&&s(3,"bad scanline data"),t){let t=e[l++];for(let e=0;e<u;e++)d[i++]=t}else d.set(e.subarray(l,l+u),i),i+=u,l+=u}for(let e=0;e<t;e++){let i=0;a[r]=d[e+i],i+=t,a[r+1]=d[e+i],i+=t,a[r+2]=d[e+i],i+=t,a[r+3]=d[e+i],r+=4}c--}return a}(n.subarray(n.pos),d,c);switch(this.type){case t.FloatType:let h=new Float32Array(4*(r=u.length/4));for(let e=0;e<r;e++)!function(e,t,i,a){let r=Math.pow(2,e[t+3]-128)/255;i[a+0]=e[t+0]*r,i[a+1]=e[t+1]*r,i[a+2]=e[t+2]*r,i[a+3]=1}(u,4*e,h,4*e);i=h,a=t.FloatType;break;case t.HalfFloatType:let m=new Uint16Array(4*(r=u.length/4));for(let e=0;e<r;e++)!function(e,i,a,r){let s=Math.pow(2,e[i+3]-128)/255;a[r+0]=t.DataUtils.toHalfFloat(Math.min(e[i+0]*s,65504)),a[r+1]=t.DataUtils.toHalfFloat(Math.min(e[i+1]*s,65504)),a[r+2]=t.DataUtils.toHalfFloat(Math.min(e[i+2]*s,65504)),a[r+3]=t.DataUtils.toHalfFloat(1)}(u,4*e,m,4*e);i=m,a=t.HalfFloatType;break;default:throw Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:d,height:c,data:i,header:o.string,gamma:o.gamma,exposure:o.exposure,type:a}}setDataType(e){return this.type=e,this}load(e,i,a,r){return super.load(e,function(e,a){switch(e.type){case t.FloatType:case t.HalfFloatType:e.colorSpace=t.LinearSRGBColorSpace,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}i&&i(e,a)},a,r)}}e.s(["RGBELoader",0,i])},188249,936379,e=>{"use strict";var t,i,a,r,s=e.i(271645);function l(){return(l=Object.assign.bind()).apply(null,arguments)}function n(){return(n=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return s.createElement("svg",l({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=s.createElement("g",{clipPath:"url(#clip0_2475_5423)",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"},s.createElement("path",{d:"M12 21.69c5.352 0 9.69-4.338 9.69-9.69 0-5.352-4.338-9.69-9.69-9.69-5.352 0-9.69 4.338-9.69 9.69 0 5.352 4.338 9.69 9.69 9.69Zm0 1.71c6.296 0 11.4-5.104 11.4-11.4S18.296.6 12 .6.6 5.704.6 12 5.704 23.4 12 23.4Z"}),s.createElement("path",{d:"M12.29 5.344a.9.9 0 0 1-.76 1.022 6.098 6.098 0 0 0-3.435 1.73 6.1 6.1 0 0 0-1.48 2.389.9.9 0 1 1-1.708-.57 7.9 7.9 0 0 1 1.915-3.093 7.898 7.898 0 0 1 4.447-2.237.9.9 0 0 1 1.021.76Z"}))),i||(i=s.createElement("defs",null,s.createElement("clipPath",{id:"clip0_2475_5423"},s.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))}],188249),e.s(["default",0,function(e){return s.createElement("svg",n({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=s.createElement("path",{opacity:.4,d:"M23.4 12c0 6.296-5.104 11.4-11.4 11.4S.6 18.296.6 12 5.704.6 12 .6 23.4 5.704 23.4 12Z",fill:"currentColor"})),r||(r=s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 21.9
16c5.5 0 9.96-4.46 9.96-9.96 0-5.5-4.46-9.96-9.96-9.96-5.5 0-9.96 4.46-9.96 9.96 0 5.5 4.46 9.96 9.96 9.96Zm0 1.44c6.296 0 11.4-5.104 11.4-11.4S18.296.6 12 .6.6 5.704.6 12 5.704 23.4 12 23.4Z",fill:"currentColor"})))}],936379)},217778,e=>{"use strict";var t=e.i(8585);e.s(["useAnimationPlayback",0,function(){let{animation:e}=(0,t.useViewerCore)();return{isPlaying:e.state.isPlaying,currentClipName:e.state.currentClipName,clips:e.state.clips,playbackSpeed:e.state.playbackSpeed,currentTime:e.state.currentTime,hasAnimations:e.state.clips.length>0,animationType:e.state.animationType,play:e.play,pause:e.pause,toggle:e.toggle,selectClip:e.selectClip,setSpeed:e.setSpeed,seek:e.seek,setAnimationType:e.setAnimationType,getMixer:e.getMixer}}])},45982,e=>{"use strict";var t=e.i(271645);let i=(0,t.createContext)(!1),a=i.Provider;e.s(["MobileViewerRedesignProvider",0,a,"useMobileViewerRedesign",0,()=>(0,t.use)(i)])},862978,e=>{"use strict";e.i(210730);var t=e.i(589805),i=e.i(8585);e.s(["AO_INTENSITY_MAX",0,2,"AO_INTENSITY_MIN",0,0,"AO_INTENSITY_STEP",0,.05,"useViewerAmbientOcclusionSettings",0,function(){let{settings:e,setSettings:a}=(0,i.useViewerCore)(),{aoEnabled:r,aoIntensity:s}=e;return{aoEnabled:r,aoIntensity:s,setAoEnabled:e=>{a({aoEnabled:e})},setAoIntensity:e=>{a({aoIntensity:Number.isFinite(e)?Math.min(2,Math.max(0,e)):t.defaultViewerSettings.aoIntensity})}}}])},721755,e=>{"use strict";e.i(210730);var t=e.i(589805),i=e.i(8585);e.s(["useViewerBloomSettings",0,function(){let{settings:e,setSettings:a}=(0,i.useViewerCore)(),{isBloomEnabled:r,bloomIntensity:s}=e;return{isBloomEnabled:r,bloomIntensity:s,setBloomIntensity:e=>{a({bloomIntensity:e})},setBloomEnabled:e=>{a(i=>({isBloomEnabled:e,...e&&0===i.bloomIntensity?{bloomIntensity:t.defaultViewerSettings.bloomIntensity}:{}}))}}}])},576659,e=>{"use strict";var t=e.i(8585);e.s(["useViewerEnvironmentSettings",0,function(){let{settings:e,setSettings:i}=(0,t.useViewerCore)(),{environmentStrength:a,backgroundRotation:r,isShowBackground:s,isAutoRotateBackground:l,hdriKey:n}=e;return{environmentStrength:a,backgroundRotation:r,isShowBackground:s,isAutoRotateBackground:l,hdriKey:n,setEnvironmentStrength:e=>{i({environmentStrength:e})},setBackgroundRotation:e=>{i({backgroundRotation:e})},setShowBackground:e=>{i({isShowBackground:e})},setAutoRotateBackground:e=>{i({isAutoRotateBackground:e})},setHDRIKey:e=>{i({hdriKey:e})}}}])},532426,e=>{"use strict";var t=e.i(8585);e.s(["useViewerRiggingSettings",0,function(){let{settings:e,setSettings:i}=(0,t.useViewerCore)(),{isDisplaySkeletal:a,isDisplayAnimation:r}=e;return{isDisplaySkeletal:a,isDisplayAnimation:r,setDisplaySkeletal:e=>{i({isDisplaySkeletal:e})},setDisplayAnimation:e=>{i({isDisplayAnimation:e})}}}])},647348,e=>{"use strict";var t=e.i(8585);e.s(["useViewerViewSwitcher",0,function(){let{settings:e,setSettings:i}=(0,t.useViewerCore)(),{viewSwitcherViewId:a}=e;return{viewSwitcherViewId:a,setViewSwitcherViewId:e=>{i({viewSwitcherViewId:e})}}}])},624262,e=>{"use strict";var t=e.i(843476),i=e.i(315080),a=e.i(271645),r=e.i(732009),s=e.i(8585);let l=[0,8,3],n=[0,0,0];e.s(["DirectionalTopLightLayer",0,function({enabled:e=!0,lightType:o="directional",color:d="#ffffff",intensity:c=2.2,position:u=l,target:h,distance:m,decay:p,angle:f=Math.PI/5,penumbra:x=.65,shadowMapSize:g=2048,shadowIntensity:w=1,shadowOpacity:v=.2,showShadowCatcher:b=!0,modelReceivesShadow:S=!0}){let{modelRoots:y}=(0,s.useViewerCore)(),{invalidate:M}=(0,i.useThree)(),[j,E]=(0,a.useState)(null),[C,V,I]=h??j?.target??n,N=(0,a.useMemo)(()=>new r.Object3D,[]);(0,a.useEffect)(()=>{if(!e)return;let t=new Map;return y.forEach(e=>{e.traverse(e=>{e instanceof r.Mesh&&(t.set(e,{castShadow:e.castShadow,receiveShadow:e.receiveShadow}),e.castShadow=!0,e.receiveShadow=S)})}),E(function(e){let t=new r.Box3;if(e.forEach(e=>t.expandByObject(e)),t.isEmpty())return null;let i=new r.Vector3,a=new r.Vector3;t.getSize(i),t.getCenter(a);let s=Math.max(i.x,i.z,1);return{center:[a.x,t.min.y-.015,a.z],target:[a.x,a.y,a.z],planeSize:Math.max(2.4*s,3),shadowExtent:Math.max(1.8*s,4),shadowFar:Math.max(i.y+14,20)}}(y)),M(),()=>{t.forEach((e,t)=>{t.castShadow=e.castShadow,t.receiveShadow=e.receiveShadow}),M()}},[e,M,S,y]),(0,a.useEffect)(()=>{N.position.set(C,V,I),N.updateMatrixWorld(),M()},[M,N,C,V,I]);let T=(0,a.useMemo)(()=>({near:.1,far:j?.shadowFar??20,left:-(j?.shadowExtent??4),right:j?.shadowExtent??4,top:j?.shadowExtent??4,bottom:-(j?.shadowExtent??4)}),[j]);return e?(0,t.jsxs)(t.Fragment,{children:["directional"===o||"spot"===o?(0,t.jsx)("primitive",{object:N}):null,"directional"===o?(0,t.jsx)("directionalLight",{castShadow:!0,color:d,intensity:c,position:u,target:N,"shadow-bias":-8e-5,"shadow-normalBias":.025,"shadow-intensity":w,"shadow-mapSize-width":g,"shadow-mapSize-height":g,"shadow-camera-near":T.near,"shadow-camera-far":T.far,"shadow-camera-left":T.left,"shadow-camera-right":T.right,"shadow-camera-top":T.top,"shadow-camera-bottom":T.bottom}):null,"point"===o?(0,t.jsx)("pointLight",{castShadow:!0,color:d,decay:p,distance:m,intensity:c,position:u,"shadow-bias":-8e-5,"shadow-normalBias":.025,"shadow-intensity":w,"shadow-mapSize-width":g,"shadow-mapSize-height":g,"shadow-camera-near":T.near,"shadow-camera-far":m??T.far}
1):null,"spot"===o?(0,t.jsx)("spotLight",{castShadow:!0,angle:f,color:d,decay:p,distance:m,intensity:c,penumbra:x,position:u,target:N,"shadow-bias":-8e-5,"shadow-normalBias":.025,"shadow-intensity":w,"shadow-mapSize-width":g,"shadow-mapSize-height":g,"shadow-camera-near":T.near,"shadow-camera-far":m??T.far}):null,j&&b&&v>0?(0,t.jsxs)("mesh",{receiveShadow:!0,position:j.center,rotation:[-Math.PI/2,0,0],renderOrder:-1,children:[(0,t.jsx)("planeGeometry",{args:[j.planeSize,j.planeSize]}),(0,t.jsx)("shadowMaterial",{transparent:!0,opacity:v})]}):null]}):null}])},882777,e=>{"use strict";var t=e.i(843476),i=e.i(613711),a=e.i(860211);e.s(["GizmoLayer",0,function(){return(0,t.jsx)(i.GizmoHelper,{margin:[60,60],children:(0,t.jsx)(a.GizmoViewport,{axisHeadScale:.8,axisColors:["#e07070","#70b870","#7090e0"]})})}])},725596,e=>{"use strict";var t,i,a,r=e.i(271645);function s(){return(s=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return r.createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m5.76 7.609-.788.646a1.067 1.067 0 0 0-.1 1.52c.399.447 1.089.49 1.542.098l.968-.79L5.76 7.609Zm5.361 1.627c.223-.327.456-.617.665-.859.136-.157.268-.3.39-.428a9.07 9.07 0 0 0-1.834-.521 9.933 9.933 0 0 0-.797-.11l-.282.23L7.634 6.07l.81-.665c.204-.176.467-.272.739-.267H9.225l.093.004a12.004 12.004 0 0 1 1.412.166c.877.156 2.059.464 3.184 1.08 1.09.597 2.206 1.494 3.022 2.207.308.27.58.519.802.727l2.624-1.494a1.1 1.1 0 0 1 1.492.394 1.069 1.069 0 0 1-.4 1.47l-3.344 1.905a1.103 1.103 0 0 1-1.33-.184l-.004-.004-.017-.017a14.083 14.083 0 0 0-.332-.325c-.23-.22-.555-.524-.94-.86-.42-.367-.895-.76-1.38-1.118a9.26 9.26 0 0 0-.66.686 6.68 6.68 0 0 0-.693.944l-1.633-1.483Zm-.956 2.374a8.064 8.064 0 0 0-.047 1.874c.013.149.028.288.045.415l-.01.01-2.672 2.768c-.366.379-.955.444-1.397.153l-3.386-2.226a1.101 1.101 0 0 0-1.514.299 1.068 1.068 0 0 0 .302 1.493l3.387 2.226a3.31 3.31 0 0 0 4.19-.46l2.438-2.526 3.484 1.372c.7.276 1.282.782 1.649 1.431l1.974 3.506a1.1 1.1 0 0 0 1.485.419 1.07 1.07 0 0 0 .508-1.278l-8.14-7.391-.13-.05a7.267 7.267 0 0 1-.009-.076l-2.157-1.96Z",fill:"currentColor"})),i||(i=r.createElement("path",{d:"M16.287 1.5a2.2 2.2 0 0 0-1.544.63 2.14 2.14 0 0 0-.64 1.524c0 .571.23 1.119.64 1.523a2.2 2.2 0 0 0 1.544.63 2.2 2.2 0 0 0 1.545-.63c.41-.404.64-.952.64-1.523s-.23-1.12-.64-1.523a2.2 2.2 0 0 0-1.545-.631Z",fill:"currentColor"})),a||(a=r.createElement("path",{d:"M22.2 19.2 4.8 3.6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round"})))}])},124875,e=>{"use strict";var t=e.i(843476),i=e.i(814273),a=e.i(553641),r=e.i(758922),s=e.i(30737),l=(0,e.i(33550).default)("outline","device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]),n=e.i(530589),o=e.i(948148),d=e.i(127923),c=e.i(271645),u=e.i(476514),h=e.i(589805),m=e.i(79336),p=e.i(415944);function f({value:e,defaultValue:a,onChange:r,onReset:s}){let l=(0,o.useTranslations)(),n=l("Workspace.Shared.WorkspaceToolbar.DisplaySettings.ResetFOVToDefault");return(0,t.jsxs)("div",{className:"gap-sm flex w-full flex-col",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:l("Workspace.Shared.WorkspaceToolbar.DisplaySettings.VerticalFOV")}),(0,t.jsxs)("div",{className:"flex w-full min-w-0 gap-2",children:[(0,t.jsx)(m.default,{className:"min-w-0 flex-1",min:h.MIN_VIEWER_CAMERA_FOV,max:h.MAX_VIEWER_CAMERA_FOV,step:1,value:[e],onChange:t=>{r(t[0]??e)},name:"vertical-fov",side:"top"}),(0,t.jsx)(i.default,{type:"icon-secondary",size:"sm",label:n,className:"flex-none",icon:(0,t.jsx)(p.IconRotateClockwise,{stroke:1.5}),disabled:e===a,onClick:s})]})]})}e.s(["DisplaySettingsItem",0,function({enableStatisticsSettings:e=!1,enablePreserveCameraViewSetting:m=!1,defaultCameraFov:p=h.DEFAULT_VIEWER_CAMERA_FOV}={}){let x=(0,o.useTranslations)(),{isShowGrid:g,isShowStatistics:w,isAutoRotate:v,isPreserveCameraView:b,cameraFov:S,setShowGrid:y,setShowStatistics:M,setAutoRotate:j,setPreserveCameraView:E,setCameraFov:C,resetCameraFov:V}=(0,u.useViewerDisplaySettings)(),[I,N]=(0,c.useState)(!1);return(0,t.jsxs)(d.Popover.Root,{onOpenChange:e=>
1N(e),children:[(0,t.jsx)(r.default,{title:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.Title"),asChild:!0,sideOffset:8,side:"bottom",className:"z-300",children:(0,t.jsx)(d.Popover.Trigger,{asChild:!0,children:(0,t.jsx)(i.default,{type:"icon-tertiary",size:"sm",className:(0,s.cn)(I&&"text-label-title bg-white/5"),icon:(0,t.jsx)(l,{stroke:1.5})})})}),(0,t.jsx)(d.Popover.Portal,{children:(0,t.jsx)(d.Popover.Content,{className:"relative z-50",sideOffset:16,onOpenAutoFocus:e=>e.preventDefault(),side:"bottom",align:"end",tabIndex:-1,children:(0,t.jsxs)(n.motion.div,{className:"bg-bg-base-hover flex w-[280px] flex-col rounded-2xl shadow-lg",initial:{opacity:0,scale:.95,x:-8},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.95,x:-8},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-start",children:[(0,t.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.Title")}),(0,t.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,t.jsx)("div",{className:"gap-md p-md flex w-full flex-col",children:(0,t.jsxs)("div",{className:"gap-md flex w-full flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.Grid")}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(a.default,{checked:g,onChange:e=>{y(e)}})})]}),e&&(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.Statistics")}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(a.default,{checked:w,onChange:e=>{M(e)}})})]}),(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.AutoRotate")}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(a.default,{checked:v,onChange:e=>{j(e)}})})]}),m&&(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:x("Workspace.Shared.WorkspaceToolbar.DisplaySettings.PreserveCameraView")}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(a.default,{checked:b,onChange:e=>{E(e)}})})]}),(0,t.jsx)(f,{value:S,defaultValue:p,onChange:C,onReset:()=>{V(p)}})]})})]})})})]})}],124875)},503918,977668,e=>{"use strict";var t=e.i(33550),i=(0,t.default)("outline","shadow","IconShadow",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M13 12h5",key:"svg-1"}],["path",{d:"M13 15h4",key:"svg-2"}],["path",{d:"M13 18h1",key:"svg-3"}],["path",{d:"M13 9h4",key:"svg-4"}],["path",{d:"M13 6h1",key:"svg-5"}]]);e.s(["IconShadow",0,i],503918);var a=(0,t.default)("outline","shadow-off","IconShadowOff",[["path",{d:"M5.634 5.638a9 9 0 0 0 12.728 12.727m1.68 -2.32a9 9 0 0 0 -12.086 -12.088",key:"svg-0"}],["path",{d:"M16 12h2",key:"svg-1"}],["path",{d:"M13 15h2",key:"svg-2"}],["path",{d:"M13 18h1",key:"svg-3"}],["path",{d:"M13 9h4",key:"svg-4"}],["path",{d:"M13 6h1",key:"svg-5"}],["path",{d:"M3 3l18 18",key:"svg-6"}]]);e.s(["IconShadowOff",0,a],977668)},942666,353572,201856,e=>{"use strict";var t,i,a,r=e.i(843476),s=e.i(503918),l=e.i(977668),n=e.i(948148),o=e.i(271645),d=e.i(537608),c=e.i(814273),u=e.i(851369),h=e.i(79336),m=e.i(513395),p=e.i(758922),f=e.i(30737),x=e.i(862978);function g(){return(g=Object.assign.bind()).apply(null,arguments)}function w(){return(w=Object.assign.bind()).apply(null,arguments)}e.s(["AmbientOcclusionSettingsItem",0,function(){let e=(0,n.useTranslations)(),t=(0,d.useTrack)(),{aoEnabled:i,aoIntensity:a,setAoEnabled:g,setAoIntensity:w}=(0,x.useViewerAmbientOcclusionSettings)(),[v,b]=(0,o.useState)(!1);return(0,r.jsxs)(u.Popover,{open:v,onOpenChange:b,side:"bottom",align:"end",sideOffset:16,className:"bg-bg-base-hover w-[280px] border-0",trigger:(0,r.jsx)(p.default,{title:e("Components.ViewerCore.AmbientOcclusion.Title"),asChild:!0,side:"bottom",sideOffset:8,className:"z-300",children:(0,r.jsx)(c.default,{type:"icon-tertiary",size:"sm",className:(0,f.cn)(v&&"text-label-title bg-white/5"),"aria-label":e("Components.ViewerCore.AmbientOcclusion.Title"),icon:i?(0,r.jsx)(s.IconShadow,{className:"size-4",stroke:1.5}):(0,r.jsx)(l.IconShadowOff,{className:"size-4",stroke:1.5})})}),children:[(0,r.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-between",children:[(0,r.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:e("Components.ViewerCore.AmbientOcclusion.Title")}),(0,r.jsx)(m.Switch,{size:"sm",checked:i,onCheckedChange:e=>{g(e),t("ambient_occlusion_toggled",{enabled:e})},"aria-label":e("Components.ViewerCore.AmbientOcclusion.Enable")}),(0,r.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,r.jsx)("div",{className:"p-md flex w-full flex-col",children:(0,r.jsxs)("div",{className:"gap-sm flex w-full flex-col",children:[(0,r.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Components.ViewerCore.AmbientOcclusion.Strength")}),(0,r.jsx)(h.default,{min:x.AO_INTENSITY_MIN,max:x.AO_INTENSITY_MAX,step:x.AO_INTENSITY_STEP,value:[a],disabled:!i,onChange:e=>{w(e[0]??a)},onCommit:e=>{t("ambient_occlusion_strength_changed",{strength:e[0]??a})}})]})})]})}],942666),e.s(["default",0,function(e){return o.createElement("svg",g({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=o.createElement("path",{d:"M3.98 1.622v-.008c0-.339.259-.614.58-.614.32 0 .58.275.58.614v.008c0 .34-.26.615-.58.615-.321 0-.58-.275-.58-.615ZM.5 8.004v-.008c0-.34.26-.614.58-.614.32 0 .58.275.58.614v.008c0 .34-.26.614-.58.614-.32 0-.58-.275-.58-.614ZM3.98 14.386v-.008c0-.34.259-.615.58-.615.32 0 .58.275.58.615v.008c0 .339-.26.614-.58.614-.321 0-.58-.275-.58-.614ZM10.938 14.386v-.008c0-.34.26-.615.58-.615.32 0 .58.275.58.615v.008c0 .339-.26.614-.58.614-.32 0-.58-.275-.58-.614ZM14.417 8.004v-.008c0-.34.26-.614.58-.614.32 0 .58.275.58.614v.008c0 .34-.26.614-.58.614-.32 0-.58-.275-.58-.614ZM10.938 1.622v-.008c0-.339.26-.614.58-.614.32 0 .58.275.58.614v.008c0 .34-.26.615-.58.615-.32 0-.58-.275-.58-.615ZM7.5 5.36V2a.5.5 0 0 1 1 0v3.36a.5.5 0 0 1-1 0ZM13.09 4.563a.5.5 0 1 1 .487.874l-3 1.667a.5.5 0 1 1-.486-.874l3-1.667ZM9.897 9.09a.5.5 0 0 1 .68-.194l3 1.667a.5.5 0 1 1-.486.874l-3-1.667a.5.5 0 0 1-.194-.68ZM7.5 14v-3.36a.5.5 0 0 1 1 0V14a.5.5 0 1 1-1 0ZM5.424 8.896a.5.5 0 1 1 .486.874l-3 1.667a.5.5 0 1 1-.486-.874l3-1.667ZM2.23 4.753a.5.5 0 0 1 .68-.193l3 1.67a.5.5 0 0 1-.486.873l-3-1.67a.5.5 0 0 1-.194-.68Z",fill:"#DEDEDE"})))}],353572),e.s(["default",0,function(e){return o.createElement("svg",w({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=o.createElement("g",{clipPath:"url(#clip0_28790_28619)",fill:"#fff"},o.createElement("path",{d:"M7.556.97c.268-.215.732-.238 1 0 .268.237-.5 4.943-.5 4.943S7.29 1.184 7.557.97ZM.675 4.8c-.052-.339.16-.753.5-.866.34-.113 4.031 2.904 4.031 2.904S.728 5.138.676 4.8ZM15.309 4.8c.052-.339-.16-.753-.5-.866-.34-.113-4.031 2.904-4.031 2.904s4.479-1.7 4.531-2.038ZM7.556 15.15c.268.215.732.238 1 0 .268-.237-.5-4.943-.5-4.943s-.767 4.729-.5 4.943ZM.675 11.32c-.052.34.16.753.5.866.34.114 4.031-2.904 4.031-2.904s-4.478 1.7-4.53 2.038ZM15.309 11.32c.052.34-.16.753-.5.866-.34.114-4.031-2.904-4.031-2.904s4.479 1.7 4.531 2.038Z"}),o.createElement("circle",{cx:11,cy:3.3,r:.5}),o.createElement("path",{d:"M8.5 8.3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}),o.createElement("circle",{cx:11,cy:13.3,r:.5}),o.createElement("circle",{cx:5,cy:3.3,r:.5}),o.createElement("circle",{cx:3,cy:8.3,r:.5}),o.createElement("circle",{cx:13,cy:8.3,r:.5}),o.createElement("circle",{cx:5,cy:13.3,r:.5}))),a||(a=o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_28790_28619"},o.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"})))))}],201856)},125933,e=>{"use strict";var t=e.i(843476),i=e.i(353572),a=e.i(201856),r=e.i(814273),s=e.i(79336),l=e.i(513395),n=e.i(758922),o=e.i(30737),d=e.i(530589),c=e.i(948148),u=e.i(127923),h=e.i(271645),m=e.i(721755);e.s(["BloomSettingsItem",0,function(){let e=(0,c.useTranslations)(),{isBloomEnabled:p,bloomIntensity:f,setBloomIntensity:x,setBloomEnabled:g}=(0,m.useViewerBloomSettings)(),[w,v]=(0,h.useState)(!1),b=p?a.default:i.default;return(0,t.jsxs)(u.Popover.Root,{onOpenChange:e=>v(e),children:[(0,t.jsx)(n.default,{title:e("Components.ViewerCore.Bloom.Label"),asChild:!0,side:"bottom",sideOffset:8,className:"z-300",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(u.Popover.Trigger,{asChild:!0,children:(0,t.jsx)(r.default,{type:"icon-tertiary",size:"sm",className:(0,o.cn)(w&&"bg-white/5"),icon:(0,t.jsx)(b,{})})})})}),(0,t.jsx)(u.Popover.Portal,{children:(0,t.jsx)(u.Popover.Content,{className:"relative z-50",sideOffset:16,onOpenAutoFocus:e=>
1e.preventDefault(),align:"end",side:"bottom",tabIndex:-1,children:(0,t.jsxs)(d.motion.div,{className:"bg-bg-base-hover flex w-[280px] flex-col rounded-2xl shadow-lg",initial:{opacity:0,scale:.95,x:-8},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.95,x:-8},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:e("Components.ViewerCore.Bloom.Title")}),(0,t.jsx)(l.Switch,{size:"sm",checked:p,onCheckedChange:g,"aria-label":e("Components.ViewerCore.Bloom.Enable")}),(0,t.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,t.jsx)("div",{className:"p-md flex w-full flex-col",children:(0,t.jsxs)("div",{className:"gap-sm flex w-full flex-col",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Components.ViewerCore.Bloom.Strength")}),(0,t.jsx)(s.default,{min:0,max:100,step:.01,value:[f],disabled:!p,onChange:e=>{x(e[0]??f)}})]})})]})})})]})}])},82816,459857,e=>{"use strict";var t=(0,e.i(33550).default)("outline","sun-high","IconSunHigh",[["path",{d:"M14.828 14.828a4 4 0 1 0 -5.656 -5.656a4 4 0 0 0 5.656 5.656z",key:"svg-0"}],["path",{d:"M6.343 17.657l-1.414 1.414",key:"svg-1"}],["path",{d:"M6.343 6.343l-1.414 -1.414",key:"svg-2"}],["path",{d:"M17.657 6.343l1.414 -1.414",key:"svg-3"}],["path",{d:"M17.657 17.657l1.414 1.414",key:"svg-4"}],["path",{d:"M4 12h-2",key:"svg-5"}],["path",{d:"M12 4v-2",key:"svg-6"}],["path",{d:"M20 12h2",key:"svg-7"}],["path",{d:"M12 20v2",key:"svg-8"}]]);e.s(["IconSunHigh",0,t],82816);var i=e.i(433660),a=e.i(173805),r=e.i(948148),s=e.i(271645),l=e.i(732009),n=e.i(859674),o=e.i(680407),d=e.i(8585);let c=async e=>{let t=e.name.toLowerCase(),i=t.endsWith(".exr"),a=t.endsWith(".hdr");if(!i&&!a)return{valid:!1,error:"Invalid file extension"};try{let t=await e.slice(0,16).arrayBuffer();if(i){if(e.size<100)return{valid:!1,error:"File is too small to be a valid EXR file"}}else if(a){let e=new TextDecoder("utf-8",{fatal:!1}).decode(t);e.includes("#?")||e.includes("RADIANCE")||e.includes("RGBE")}return{valid:!0}}catch(e){return{valid:!1,error:"Failed to read file header"}}},u=async e=>{let t,i=e.name.toLowerCase().endsWith(".exr")?".exr":".hdr";try{t=await e.arrayBuffer()}catch(e){return{success:!1,error:"Failed to read file"}}try{let e,a,r,s,d=".exr"===i?new n.EXRLoader:new o.RGBELoader().setDataType(l.FloatType);try{e=d.parse(t)}catch(e){return console.error("HDRI parse error:",e),{success:!1,error:".exr"===i?"Invalid EXR file format. Please ensure the file is a valid EXR image.":"Invalid HDR file format. Please ensure the file is a valid HDR (Radiance RGBE) image."}}if(!e)return{success:!1,error:"Failed to parse HDRI file"};let c=e;if(c?.image){let e=c.image;e.data&&(e.width||c.width)&&(e.height||c.height)&&(a=e.data,r=e.width||c.width,s=e.height||c.height)}if((!a||!r||!s)&&c?.data&&c?.width&&c?.height&&(a=c.data,r=c.width,s=c.height),!a||!r||!s)return{success:!1,error:"Failed to extract image data from HDRI file"};if(r<=0||s<=0||!a||0===a.length)return{success:!1,error:"Invalid image dimensions in HDRI file"};let u=Math.min(1,256/r),h=Math.max(1,Math.round(r*u)),m=Math.max(1,Math.round(s*u)),p=r*s,f=p>0?Math.floor(a.length/p):3,x=a instanceof Uint8Array&&f>=4,g=document.createElement("canvas");g.width=h,g.height=m;let w=g.getContext("2d");if(!w)return{success:!1,error:"Failed to create canvas context"};let v=w.createImageData(h,m),b=v.data,S=e=>e/(1+e),y=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;for(let e=0;e<m;e+=1){let t=Math.floor(e/m*s);for(let i=0;i<h;i+=1){let s=Math.floor(i/h*r),l=(t*r+s)*f,n=0,o=0,d=0;if(x&&a instanceof Uint8Array){let e=a[l+3];if(void 0!==e&&e>0){let t=Math.pow(2,e-128)/255;n=(a[l]??0)*t,o=(a[l+1]??0)*t,d=(a[l+2]??0)*t}}else Float32Array,n=a[l]??0,o=a[l+1]??0,d=a[l+2]??0;n=y(S(n)),o=y(S(o)),d=y(S(d));let c=(e*h+i)*4;b[c]=Math.round(255*Math.min(1,Math.max(0,n))),b[c+1]=Math.round(255*Math.min(1,Math.max(0,o))),b[c+2]=Math.round(255*Math.min(1,Math.max(0,d))),b[c+3]=255}}return w.putImageData(v,0,0),{success:!0,previewUrl:g.toDataURL("image/png")}}catch(e){return console.error("HDRI preview generation error:",e),{success:!1,error:"Failed to generate preview. The file may not be a valid HDRI format."}}};e.s(["useViewerCustomHdri",0,function(){let{settings:e,setSettings:t}=(0,d.useViewerCore)(),{customHdriInfo:l}
1=e,n=(0,s.useRef)(null),[o,h]=(0,s.useState)(!1),m=(0,s.useRef)(0),p=(0,r.useTranslations)(),f=(0,s.useCallback)(async r=>{let s=r.name.toLowerCase();if(!s.endsWith(".hdr")&&!s.endsWith(".exr"))return void i.toast.error(p("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.InvalidFileExtension")||"Invalid file format. Please upload a .hdr or .exr file.");if(!(await c(r)).valid)return void i.toast.error(p("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.InvalidFileFormat")||"Invalid HDRI file format. Please ensure the file is a valid .hdr or .exr image.");let{objectUrl:l,loaderUrl:n}=(0,a.createLocalHdriObjectUrl)(r);t({hdriKey:"custom",customHdriInfo:{fileName:r.name,fileSize:r.size,previewUrl:"",file:r,objectUrl:l,loaderUrl:n}});let o={name:r.name,size:r.size,lastModified:r.lastModified},d=await u(r);if(!d.success){t({hdriKey:"custom"===e.hdriKey?0:e.hdriKey,customHdriInfo:void 0}),i.toast.error(d.error||p("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.InvalidFileFormat")||"Invalid HDRI file format. Please ensure the file is a valid .hdr or .exr image.");return}t(e=>{let t=e.customHdriInfo;return t&&t.file.name===o.name&&t.file.size===o.size&&t.file.lastModified===o.lastModified?{customHdriInfo:{...t,previewUrl:d.previewUrl||""}}:{}})},[e,t,p]),x=(0,s.useCallback)(e=>{let t=e.target.files;t&&t[0]&&(f(t[0]),n.current&&(n.current.value=""))},[f]),g=(0,s.useCallback)(()=>{n.current?.click()},[]),w=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),m.current+=1,1===m.current&&h(!0)},[]),v=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),b=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),m.current-=1,0===m.current&&h(!1)},[]),S=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),m.current=0,h(!1);let t=e.dataTransfer.files;t&&t[0]&&f(t[0])},[f]),y=(0,s.useCallback)(()=>{l?.objectUrl?.startsWith("blob:")&&URL.revokeObjectURL(l.objectUrl),t({customHdriInfo:void 0})},[l,t]);return{customHdriInfo:l,fileInputRef:n,handleUpload:x,triggerFileSelect:g,isDragging:o,handleDragEnter:w,handleDragOver:v,handleDragLeave:b,handleDrop:S,clearCustomHdri:y}}],459857)},202764,127702,e=>{"use strict";var t=e.i(843476),i=e.i(30737),a=e.i(814273),r=e.i(619436),s=e.i(79336),l=e.i(553641),n=e.i(758922),o=e.i(173805),d=e.i(82816),c=e.i(530589),u=e.i(948148),h=e.i(127923),m=e.i(271645),p=e.i(459857),f=e.i(576659),x=e.i(333884),g=e.i(691067),w=e.i(102305);function v({customHdriInfo:e,onReUpload:i,fileInputRef:r,isDragging:s,handleDragEnter:l,handleDragOver:n,handleDragLeave:o,handleDrop:d,handleUpload:c}){let h=(0,u.useTranslations)();return e?(0,t.jsxs)("div",{className:"border-bg-border bg-bg-base-hover group relative flex min-h-32 w-full flex-col items-center justify-center gap-3 rounded-lg border p-4",onDragEnter:l,onDragOver:n,onDragLeave:o,onDrop:d,children:[(0,t.jsx)("input",{type:"file",ref:r,className:"hidden",accept:".hdr,.exr",onChange:c}),(0,t.jsxs)("div",{className:"text-label-base text-xs font-normal",children:[h("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.FileName"),": ",e.fileName]}),(0,t.jsx)(a.default,{type:"secondary",size:"sm",onClick:i,icon:(0,t.jsx)(g.default,{className:"size-4"}),children:h("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.ReUpload")})]}):(0,t.jsxs)("div",{className:(0,w.default)("group relative flex h-32 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-lg border border-dashed p-4 transition duration-100 ease-out select-none",s?"border-accent-base bg-accent-bg":"border-bg-border bg-bg-base-hover hover:border-bg-border-strong hover:bg-bg-shade active:opacity-70"),onDragEnter:l,onDragOver:n,onDragLeave:o,onDrop:d,onClick:()=>r.current?.click(),children:[(0,t.jsx)("input",{type:"file",ref:r,className:"hidden",accept:".hdr,.exr",onChange:c}),(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-3",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1",children:[(0,t.jsx)("div",{className:(0,w.default)("text-sm-plus text-center transition duration-100 ease-out",s?"text-accent-base":"text-label-base group-hover:text-label-title"),children:h("Worksp
1ace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.ClickOrDrag")}),(0,t.jsx)("div",{className:(0,w.default)("text-center text-xs transition duration-100 ease-out",s?"text-accent-secondary":"text-label-muted"),children:h("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.CustomHDRI.SupportedFormats")})]})})]})}e.s(["EnvironmentSettingsItem",0,function(){let e=(0,u.useTranslations)(),{isPBRShadingMode:g}=(0,x.useViewerRenderMode)(),{environmentStrength:w,backgroundRotation:b,isAutoRotateBackground:S,isShowBackground:y,hdriKey:M,setEnvironmentStrength:j,setBackgroundRotation:E,setAutoRotateBackground:C,setShowBackground:V,setHDRIKey:I}=(0,f.useViewerEnvironmentSettings)(),{customHdriInfo:N,fileInputRef:T,handleUpload:k,triggerFileSelect:R,isDragging:O,handleDragEnter:A,handleDragOver:L,handleDragLeave:P,handleDrop:D}=(0,p.useViewerCustomHdri)(),[_,U]=(0,m.useState)(!1),W="custom"===M;return(0,t.jsxs)(h.Popover.Root,{onOpenChange:e=>U(e),children:[(0,t.jsx)(n.default,{title:g?e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Title.Default"):e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Title.NeedPBRMode"),asChild:!0,side:"bottom",sideOffset:8,className:"z-300",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(h.Popover.Trigger,{asChild:!0,disabled:!g,children:(0,t.jsx)(a.default,{type:"icon-tertiary",size:"sm",className:(0,i.cn)(_&&"text-label-title bg-white/5"),icon:(0,t.jsx)(d.IconSunHigh,{stroke:1.5}),disabled:!g})})})}),(0,t.jsx)(h.Popover.Portal,{children:(0,t.jsx)(h.Popover.Content,{className:"relative z-50",sideOffset:16,onOpenAutoFocus:e=>e.preventDefault(),align:"end",side:"bottom",tabIndex:-1,children:(0,t.jsxs)(c.motion.div,{className:"bg-bg-base-hover flex w-[280px] flex-col rounded-2xl shadow-lg",initial:{opacity:0,scale:.95,x:-8},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.95,x:-8},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-start",children:[(0,t.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Title.Default")}),(0,t.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,t.jsx)("div",{className:"gap-md p-md flex w-full flex-col",children:(0,t.jsxs)("div",{className:"gap-md flex w-full flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.Default")}
1),(0,t.jsx)(r.Select,{size:"sm",value:W?"custom":String(M),options:[...Object.entries(o.HDRIList).map(([t])=>{var i;return{value:t,label:(i=Number(t),({[o.EHDRIKey.DEFAULT]:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.IndoorLighting"),[o.EHDRIKey.OUTDOOR]:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.OutdoorLighting"),[o.EHDRIKey.STUDIO]:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.StudioLighting"),[o.EHDRIKey.SOFT]:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.SoftLighting")})[i]||o.HDRIList[i]?.name||"")}}),{value:"custom",label:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.HDRI.Custom")}],onChange:e=>{"custom"===e?(I("custom"),N||setTimeout(()=>{R()},0)):I(Number(e))}})]}),W&&(0,t.jsx)(v,{customHdriInfo:N,onReUpload:R,fileInputRef:T,isDragging:O,handleDragEnter:A,handleDragOver:L,handleDragLeave:P,handleDrop:D,handleUpload:k}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Strength")}),(0,t.jsx)(s.default,{min:0,max:4,step:.01,value:[w],onChange:e=>{j(e[0]??w)}})]}),(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:(0,i.cn)("text-xs font-medium select-none",{"text-label-base":!S,"text-label-muted":S}),children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Rotation.Default")}),(0,t.jsx)("div",{className:"text-label-muted text-[10px] select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Rotation.Tips")})]}),(0,t.jsx)(s.default,{min:0,max:360,step:1,disabled:S,value:[b],onChange:e=>{E(e[0]??b)}}),(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Backgroun
1d.AutoRotate")}),(0,t.jsx)(l.default,{checked:S,onChange:e=>{C(e)}})]}),(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e("Workspace.Shared.WorkspaceToolbar.EnvironmentSettings.Background.Default")}),(0,t.jsx)(l.default,{checked:y,onChange:e=>{V(e)}})]})]})})]})})})]})}],202764);var b=e.i(631939),S=e.i(8585);function y({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsxs)("g",{clipPath:"url(#ma_clip)",children:[(0,t.jsx)("path",{d:"M12 7.00032C12.2017 7.00032 12.4024 7.04398 12.5859 7.12922C12.7656 7.21279 12.9249 7.33599 13.0518 7.49055L13.0527 7.48958L15.96 10.9456C16.2266 11.2631 16.3359 11.6771 16.3359 12.0511C16.3359 12.4249 16.227 12.8389 15.959 13.1556L15.958 13.1546L13.0527 16.6107L13.0518 16.6097C12.9249 16.7643 12.7656 16.8875 12.5859 16.971C12.4024 17.0563 12.2017 17.0999 12 17.0999C11.7983 17.0999 11.5976 17.0563 11.4141 16.971C11.2342 16.8874 11.0741 16.7645 10.9473 16.6097L8.04004 13.1546C7.77344 12.8371 7.66406 12.4232 7.66406 12.0491C7.66408 11.6754 7.77302 11.2613 8.04102 10.9447L10.9473 7.48958C11.0741 7.33479 11.2342 7.21288 11.4141 7.12922C11.5976 7.04398 11.7983 7.00032 12 7.00032ZM12 8.09993C11.956 8.09993 11.914 8.10956 11.8779 8.12629C11.8419 8.14301 11.8145 8.16573 11.7959 8.18879L11.7891 8.19758L8.88184 11.6546L8.87988 11.6556C8.81915 11.7276 8.76369 11.8681 8.76367 12.0491C8.76367 12.2302 8.81961 12.3725 8.88184 12.4466L11.7891 15.9027L11.7959 15.9115C11.8145 15.9345 11.8419 15.9572 11.8779 15.974C11.914 15.9907 11.956 16.0003 12 16.0003C12.044 16.0003 12.086 15.9907 12.1221 15.974C12.1581 15.9572 12.1855 15.9345 12.2041 15.9115L12.2109 15.9027L15.1182 12.4456L15.1201 12.4447C15.1808 12.3727 15.2363 12.2321 15.2363 12.0511C15.2363 11.9152 15.205 11.8008 15.1631 11.721L15.1182 11.6536L12.2109 8.19758L12.2041 8.18879C12.1855 8.16573 12.158 8.14301 12.1221 8.12629C12.086 8.10956 12.044 8.09993 12 8.09993Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M11.001 1.84585V1.83227C11.001 1.25612 11.471 0.789062 12.0508 0.789062C12.6305 0.789062 13.1005 1.25612 13.1005 1.83227V1.84585C13.100
15 2.422 12.6305 2.88906 12.0508 2.88906C11.471 2.88906 11.001 2.422 11.001 1.84585Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M21.2061 12.0573V12.0437C21.2061 11.4675 21.6761 11.0005 22.2558 11.0005C22.8356 11.0005 23.3056 11.4675 23.3056 12.0437V12.0573C23.3056 12.6334 22.8356 13.1005 22.2558 13.1005C21.6761 13.1005 21.2061 12.6334 21.2061 12.0573Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M0.794922 12.0573V12.0437C0.794922 11.4675 1.26493 11.0005 1.84471 11.0005C2.42449 11.0005 2.89449 11.4675 2.89449 12.0437V12.0573C2.89449 12.6334 2.42449 13.1005 1.84471 13.1005C1.26493 13.1005 0.794922 12.6334 0.794922 12.0573Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M18.5939 5.42659L18.5843 5.41698C18.1769 5.00958 18.179 4.34698 18.589 3.93701C18.999 3.52704 19.6616 3.52496 20.069 3.93236L20.0786 3.94196C20.486 4.34936 20.4839 5.01197 20.0739 5.42194C19.6639 5.8319 19.0013 5.83398 18.5939 5.42659Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M4.16133 19.8594L4.15172 19.8498C3.74432 19.4424 3.74641 18.7798 4.15637 18.3699C4.56634 17.9599 5.22895 17.9578 5.63634 18.3652L5.64595 18.3748C6.05335 18.7822 6.05126 19.4448 5.6413 19.8548C5.23133 20.2648 4.56873 20.2668 4.16133 19.8594Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M18.365 18.5931L18.3746 18.5835C18.782 18.1761 19.4446 18.1782 19.8546 18.5881C20.2646 18.9981 20.2667 19.6607 19.8593 20.0681L19.8497 20.0777C19.4423 20.4851 18.7797 20.483 18.3697 20.0731C17.9597 19.6631 17.9576 19.0005 18.365 18.5931Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M3.93242 4.16023L3.94203 4.15062C4.34943 3.74323 5.01203 3.74531 5.422 4.15527C5.83196 4.56524 5.83405 5.22785 5.42665 5.63524L5.41704 5.64485C5.00965 6.05225 4.34704 6.05016 3.93707 5.6402C3.52711 5.23023 3.52502 4.56763 3.93242 4.16023Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M11.001 22.268V22.2544C11.001 21.6782 11.471 21.2112 12.0508 21.2112C12.6305 21.2112 13.1005 21.6782 13.1005 22.2544V22.268C13.1005 22.8441 12.6305 23.3112 12.0508 23.3112C11.471 23.3112 11.001 22.8441 11.001 22.268Z",fill:"currentColor"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"ma_clip",children:(0,t.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})}function M({label:e,value:i,min:a,max:r,step:l,onChange:n}){return(0,t.jsxs)("div",{className:"gap-sm flex w-full flex-col",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:e}),(0,t.jsx)(s.default,{min:a,max:r,step:l,value:[i],onChange:e=>{void 0!==e[0]&&n(e[0])}})]})}e.s(["MaterialAdjustmentSettingsItem",0,function(){let e=(0,u.useTranslations)(),{settings:r,setSettings:s}=(0,S.useViewerCore)(),[l,o]=(0,m.useState)(!1),[d,p]=(0,m.useState)("metalness"),f=(0,m.useCallback)((e,t)=>{s({[e]:t})},[s]),x="metalness"===d?"metalnessIntensity":"roughnessIntensity",g="metalness"===d?"metalnessContrast":"roughnessContrast";return(0,t.jsxs)(h.Popover.Root,{onOpenChange:o,children:[(0,t.jsx)(n.default,{title:e("Components.ViewerCore.MaterialAdjustment.Title"),asChild:!0,side:"bottom",sideOffset:8,className:"z-300",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(h.Popover.Trigger,{asChild:!0,children:(0,t.jsx)(a.default,{type:"icon-tertiary",size:"sm",label:e("Components.ViewerCore.MaterialAdjustment.Title"),className:(0,i.cn)(l&&"text-label-title bg-white/5"),icon:(0,t.jsx)(y,{})})})})}),(0,t.jsx)(h.Popover.Portal,{children:(0,t.jsx)(h.Popover.Content,{className:"relative z-50",sideOffset:16,onOpenAutoFocus:e=>e.preventDefault(),align:"end",side:"bottom",tabIndex:-1,children:(0,t.jsxs)(c.motion.div,{className:"bg-bg-base-hover flex w-[280px] flex-col rounded-2xl shadow-lg",initial:{opacity:0,scale:.95,x:-8},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.95,x:-8},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-start",children:[(0,t.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:e("Components.ViewerCore.MaterialAdjustment.Title")}),(0,t.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,t.jsxs)("div",{className:"p-md gap-md flex w-full flex-col",children:[(0,t.jsx)(b.SegmentedControl,{size:"sm",value:d,onChange:e=>p(e),options:[{value:"metalness",label:e("Components.ViewerCore.MaterialAdjustment.Metalness")},{value:"roughness",label:e("Components.ViewerCore.MaterialAdjustment.Roughness")}]}),(0,t.jsx)(M,{label:e("Components.ViewerCore.MaterialAdjustment.Intensity"),value:r[x],min:0,max:2,step:.01,onChange:e=>f(x,e)}),(0,t.jsx)(M,{label:e("Components.ViewerCore.MaterialAdjustment.Contrast"),value:r[g],min:0,max:2,step:.01,onChange:e=>f(g,e)})]})]})})})]})}],127702)},129621,530284,e=>{"use strict";var t,i,a,r,s=e.i(271645);function l(){return(l=Object.assign.bind()).apply(null,arguments)}function n(){return(n=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return s.createElement("svg",l({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=s.createElement("g",{opacity:.4,fill:"#DEDEDE"},s.createElement("path",{d:"m8.497 12.813 5.018-1.344-.588-.34a.5.5 0 1 1 .5-.865l1.633.942.043.028a.5.5 0 0 1 .14.655l-.943 1.633a.5.5 0 1 1-.866-.5l.34-.587-5.018 1.344a.5.5 0 1 1-.259-.966ZM3.83 8.146 5.175 3.13l.339.587a.5.5 0 1 0 .866-.5l-.943-1.633-.028-.043a.5.5 0 0 0-.655-.14l-1.633.943a.5.5 0 1 0 .5.866l.588-.34-1.345 5.018a.5.5 0 0 0 .966.26ZM7.715 9.777l4.15-2.397-.655-.176a.5.5 0 0 1 .26-.965l1.82.488a.5.5 0 0 1 .354.612l-.488 1.821a.5.5 0 1 1-.966-.258l.176-.656-4.151 2.397a.5.5 0 0 1-.5-.866ZM6.79 8.884l2.396-4.15.176.655a.5.5 0 1 0 .966-.259L9.84 3.31a.5.5 0 0 0-.613-.354l-1.821.488a.5.5 0 1 0 .259.966l.655-.175-2.396 4.15a.5.5 0 0 0 .866.5Z"}))),i||(i=s.createElement("path",{d:"M7.308 9.087c1.353 1.354 1.733 3.532 1.035 6.105a.5.5 0 1 1-.965-.261c.643-2.372.232-4.127-.777-5.137-1.01-1.009-2.765-1.42-5.137-.778a.5.5 0 1 1-.261-.965c2.573-.697 4.752-.317 6.105 1.036Z",fill:"#DEDEDE"})))}],129621),e.s(["default",0,function(e){return s.createElement("svg",n({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=s.createElement("path",{d:"m8.497 12.813 5.018-1.344-.588-.34a.5.5 0 1 1 .5-.865l1.633.942.043.028a.5.5 0 0 1 .14.655l-.943 1.633a.5.5 0 1 1-.866-.5l.34-.587-5.018 1.344a.5.5 0 1 1-.26-.966ZM3.83 8.146 5.174 3.13l.34.587a.5.5 0 1 0 .866-.5l-.943-1.633-.028-.043a.5.5 0 0 0-.655-.14l-1.633.943a.5.5 0 1 0 .5.866l.588-.34-1.345 5.018a.5.5 0 0 0 .966.26ZM7.715 9.777l4.15-2.397-.655-.176a.5.5 0 0 1 .259-.965l1.821.488a.5.5 0 0 1 .354.612l-.488 1.821a.5.5 0 1 1-.966-.258l.176-.656-4.151 2.397a.5.5 0 0 1-.5-.866ZM6.79 8.884l2.396-4.15.176.655a.5.5 0 1 0 .965-.259L9.84 3.31a.5.5 0 0 0-.612-.354l-1.821.488a.5.5 0 1 0 .259.966l.655-.175-2.397 4.15a.5.5 0 0 0 .866.5Z",fill:"#DEDEDE"})),r||(r=s.createElement("path",{d:"M7.308 9.087C8.66 10.44 9.04 12.62 8.343 15.192a.5.5 0 1 1-.965-.262c.643-2.371.232-4.127-.777-5.136-1.01-1.009-2.765-1.42-5.137-.778a.5.5 0 1 1-.261-.965c2.573-.697 4.752-.317 6.105 1.036Z",fill:"#DEDEDE"})))}],530284)},775054,e=>{"use strict";var t,i,a=e.i(843476),r=e.i(188249),s=e.i(271645);function l(){return(l=Object.assign.bind()).apply(null,arguments)}let n=function(e){return s.createElement("svg",l({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=s.createElement("g",{clipPath:"url(#clip0_2561_4593)",fill:"currentColor"},s.createElement("path",{opacity:.4,d:"M18.716 11.716c1.224 1.224.65 3.783-1.284 5.716-1.933 1.933-4.492 2.508-5.716 1.284C10.492 17.492 11.067 14.933 13 13c1.933-1.933 4.492-2.508 5.716-1.284Z"}),s.createElement("path",{opacity:.8,d:"M10.583 5.583c.874.874.463 2.702-.917 4.083-1.381 1.38-3.209 1.791-4.083.917-.874-.874-.464-2.702.917-4.083 1.38-1.38 3.209-1.791 4.083-.917Z"}),s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 21.9
16c5.5 0 9.96-4.46 9.96-9.96 0-5.5-4.46-9.96-9.96-9.96-5.5 0-9.96 4.46-9.96 9.96 0 5.5 4.46 9.96 9.96 9.96Zm0 1.44c6.296 0 11.4-5.104 11.4-11.4S18.296.6 12 .6.6 5.704.6 12 5.704 23.4 12 23.4Z"}))),i||(i=s.createElement("defs",null,s.createElement("clipPath",{id:"clip0_2561_4593"},s.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))))};var o=e.i(936379),d=e.i(814273),c=e.i(758922),u=e.i(30737),h=e.i(948148),m=e.i(631976),p=e.i(663528),f=e.i(139902),x=e.i(333884);let g=({title:e,icon:t,isActive:i,onClick:r})=>(0,a.jsx)(c.default,{title:e,asChild:!0,sideOffset:8,side:"bottom",children:(0,a.jsx)(d.default,{type:"icon-tertiary",size:"sm",icon:t,onClick:r,className:(0,u.cn)({"text-accent-base hover:text-accent-base":i})})});e.s(["RenderModeToggleItem",0,function({textureUrls:e,allowPBRMode:t=!0}={}){let i=(0,h.useTranslations)(),{isSolidMode:s,isAlbedoMode:l,isPBRShadingMode:d,switchToSolidMode:c,switchToAlbedoMode:u,switchToPBRShadingMode:w}=(0,x.useViewerRenderMode)(),v=!!e?.[0]?.colorMapUrl,b=(0,m.useModelHasTexture)(),S=(0,f.useModelHasVertexColors)(),y=(0,p.useModelHasUV)(),M=v&&y||b||S,j=(b||S)&&t;return M||j?(0,a.jsxs)("div",{className:"flex items-center gap-x-1.5",children:[(0,a.jsx)(g,{title:i("Worksp
1ace.Shared.WorkspaceToolbar.DisplaySettings.SolidMode"),icon:(0,a.jsx)(o.default,{}),isActive:s,onClick:c}),M&&(0,a.jsx)(g,{title:i("Workspace.Shared.WorkspaceToolbar.DisplaySettings.BaseColor"),icon:(0,a.jsx)(r.default,{}),isActive:l,onClick:u}),j&&(0,a.jsx)(g,{title:i("Workspace.Shared.ViewSwitcher.PBRPreview"),icon:(0,a.jsx)(n,{}),isActive:d,onClick:w})]}):null}],775054)},802693,e=>{"use strict";var t,i,a=e.i(271645);function r(){return(r=Object.assign.bind()).apply(null,arguments)}e.s(["default",0,function(e){return a.createElement("svg",r({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 3.5c0 1.174-.81 2.159-1.9 2.428V8.06l4.772 1.313a.4.4 0 0 0 .474-.229l1.294-3.04a1.75 1.75 0 1 1 1.135.397L18.45 9.613a1.6 1.6 0 0 1-1.897.916L12.1 9.305v3.434l-1.2-1.085v-2.68L6.639 7.803 5.586 6.85a1.598 1.598 0 0 1 1.322-.218L10.9 7.73V5.928A2.501 2.501 0 1 1 14 3.5ZM4.575 8.632l-.752 1.87a1.75 1.75 0 1 0 1.11.458l.59-1.47-.948-.858Zm5.494 4.967c-.251.256-.434.58-.518.94l-4.428.484a1.6 1.6 0 0 0-1.36 2.044l.963 3.264a1.75 1.75 0 1 0 1.155-.326l-.967-3.278a.4.4 0 0 1 .34-.51l4.392-.481a2 2 0 0 0 1.854 1.243 2 2 0 0 0 1.528-.706L10.069 13.6Zm8.28 4.788.742-3.147a.4.4 0 0 0-.433-.49l-3.865.423-1.191-1.077 4.926-.539a1.6 1.6 0 0 1 1.731 1.958l-.894 3.79-1.016-.918Zm-1.262 1.555a1.75 1.75 0 1 0 2.581 2.333l-2.581-2.332Z",fill:"currentColor"})),i||(i=a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.49 4.025a.6.6 0 0 1 .849-.034l19.36 17.86a.6.6 0 1 1-.814.882L2.525 4.873a.6.6 0 0 1-.034-.848Z",fill:"currentColor"})))}])},894568,e=>{"use strict";var t=e.i(843476),i=e.i(725596),a=e.i(889329),r=e.i(802693),s=e.i(682763),l=e.i(814273),n=e.i(758922),o=e.i(948148),d=e.i(217778),c=e.i(532426);e.s(["RiggingDisplaySettingsItem",0,function({side:e="bottom"}){let u=(0,o.useTranslations)(),{isDisplaySkeletal:h,isDisplayAnimation:m,setDisplaySkeletal:p,setDisplayAnimation:f}=(0,c.useViewerRiggingSettings)(),{hasAnimations:x}=(0,d.useAnimationPlayback)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{title:`${u("Workspace.Rigging.Skeleton")} - ${u(h?"Workspace.Shared.WorkspaceToolbar.On":"Workspace.Shared.WorkspaceToolbar.Off")}`,asChild:!0,sideOffset:8,side:e,className:"z-300",children:(0,t.jsx)(l.default,{type:"icon-tertiary",size:"sm",icon:h?(0,t.jsx)(s.default,{}):(0,t.jsx)(r.default,{}),onClick:()=>{p(!h)}})}),x&&(0,t.jsx)(n.default,{title:`${u("Workspace.Rigging.Animation")} - ${u(m?"Workspace.Shared.WorkspaceToolbar.On":"Workspace.Shared.WorkspaceToolbar.Off")}`,asChild:!0,sideOffset:8,side:e,className:"z-300",children:(0,t.jsx)(l.default,{type:"icon-tertiary",size:"sm",icon:m?(0,t.jsx)(a.default,{}):(0,t.jsx)(i.default,{}),onClick:()=>{f(!m)}})})]})}])},264460,99162,764042,938369,733703,371110,622232,e=>{"use strict";var t,i,a,r,s,l,n,o,d,c=e.i(843476),u=e.i(513932),h=e.i(948148),m=e.i(271645);function p(){return(p=Object.assign.bind()).apply(null,arguments)}let f=function(e){return m.createElement("svg",p({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=m.createElement("g",{opacity:.4,fill:"#DEDEDE"},m.createElement("path",{d:"m14.254 4.179 4.09-4.09c.767.2 1.367.8 1.578 1.567l-4.532 4.53a7.164 7.164 0 0 0-1.136-2.006ZM11.09 1.922 13.01 0H9.867L8.36 1.507a7.164 7.164 0 0 1 2.73.415ZM1.922 11.09a7.166 7.166 0 0 1-.415-2.73L0 9.867v3.144l1.922-1.922ZM4.179 14.254a7.165 7.165 0 0 0 2.002 1.135L1.656 19.91c-.378-.1-.723-.3-1-.567a2.302 2.302 0 0 1-.567-1l4.09-4.09ZM11.727 15.262 6.989 20h3.144l3.166-3.166-.12-.12-1.22-1.219-.232-.233ZM16.834 13.299 20 10.133V6.99l-4.738 4.738 1.572 1.572ZM0 3.175C0 1.507 1.5 0 3.175 0h1.27L0 4.444v-1.27ZM20 16.825C20 18.345 18.344 20 16.825 20h-1.27L20 15.556v1.27Z"}))),i||(i=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.69 3.893a5.167 5.167 0 1 1 3.954 9.547 5.167 5.167 0 0 1-3.955-9.547Zm1.977.607a4.167 4.167 0 1 0 0 8.333 4.167 4.167 0 0 0 0-8.333Z",fill:"#DEDEDE"})),a||(a=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.16
17 8.667a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5Z",fill:"#DEDEDE"})),r||(r=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.667 6.167a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 1 .5-.5ZM11.646 11.646a.5.5 0 0 1 .708 0l4 4a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708Z",fill:"#DEDEDE"})))};e.s(["default",0,f],99162);var x=e.i(814273),g=e.i(758922),w=e.i(349178),v=e.i(370388),b=e.i(459667),S=e.i(732009),y=e.i(819784),M=e.i(933162),j=e.i(8585);function E(e,t){return!!e&&!!t&&(e===t||null!=e.source&&e.source===t.source||null!=e.image&&e.image===t.image)}function C(){let{modelRoots:e}=(0,j.useViewerCore)();return(0,m.useMemo)(()=>{let t=[],i=new Set;return e.forEach(e=>{e.traverse(e=>{if(!(e instanceof S.Mesh)||!e.material)return;let a=(0,M.readOriginalMaterial)(e)??e.material;for(let e of Array.isArray(a)?a:[a]){if(!e||i.has(e.uuid))continue;i.add(e.uuid);let a=function(e){let t=[],i=(0,y.readMaterialMap)(e);if(i&&!(0,y.isUvTransformPlaceholderMap)(i)&&t.push({id:b.EViewSwitcherViewId.COLOR_MAP,texture:i,needsOrmExtract:!1}),!(e instanceof S.MeshStandardMaterial))return t;let{roughnessMap:a,metalnessMap:r,emissiveMap:s,normalMap:l,aoMap:n}=e,o=E(a,r);return a&&t.push({id:b.EViewSwitcherViewId.ROUGHNESS_MAP,texture:a,needsOrmExtract:o}),r&&t.push({id:b.EViewSwitcherViewId.METALLIC_MAP,texture:r,needsOrmExtract:o}),s&&t.push({id:b.EViewSwitcherViewId.EMISSION_MAP,texture:s,needsOrmExtract:!1}),l&&t.push({id:b.EViewSwitcherViewId.NORMAL_MAP,texture:l,needsOrmExtract:!1}),n&&t.push({id:b.EViewSwitcherViewId.AO_MAP,texture:n,needsOrmExtract:E(n,a)||E(n,r)}),t}(e);a.length>0&&t.push({material:e,views:a})}})}),t},[e])}function V(){let e=(0,h.useTranslations)();return(0,m.useMemo)(()=>({[b.EViewSwitcherViewId.BAKED_MAP]:e("Workspace.Shared.ViewSwitcher.ShadingPreview"),[b.EViewSwitcherViewId.COLOR_MAP]:e("Workspace.Shared.ViewSwitcher.BaseColor"),[b.EViewSwitcherViewId.ROUGHNESS_MAP]:e("Workspace.Shared.ViewSwitcher.Roughness"),[b.EViewSwitcherViewId.METALLIC_MAP]:e("Workspace.Shared.ViewSwitcher.Metallic"),[b.EViewSwitcherViewId.EMISSION_MAP]:e("Workspace.Shared.ViewSwitcher.Emission"),[b.EViewSwitcherViewId.NORMAL_MAP]:e("Workspace.Shared.ViewSwitcher.Normal"),[b.EViewSwitcherViewId.HEIGHT_MAP]:e("Workspace.Shared.ViewSwitcher.Height"),[b.EViewSwitcherViewId.CURVATURE_MAP]:e("Workspace.Shared.ViewSwitcher.Curvature"),[b.EViewSwitcherViewId.AO_MAP]:e("Workspace.Shared.ViewSwitcher.AO"),[b.EViewSwitcherViewId.POSITION_MAP]:e("Workspace.Shared.ViewSwitcher.Position")}),[e])}e.s(["useGLBTextureViews",0,C],764042),e.s(["useTextureConfig",0,function(e){let t=V();return[{id:b.EViewSwitcherViewId.BAKED_MAP,getUrl:e=>e.meshy5BakedColorMapUrl},{id:b.EViewSwitcherViewId.COLOR_MAP,getUrl:e=>e.colorMapUrl},{id:b.EViewSwitcherViewId.ROUGHNESS_MAP,getUrl:e=>e.roughnessMapUrl},{id:b.EViewSwitcherViewId.METALLIC_MAP,getUrl:e=>e.metallicMapUrl},{id:b.EViewSwitcherViewId.EMISSION_MAP,getUrl:e=>e.emissionMapUrl},{id:b.EViewSwitcherViewId.NORMAL_MAP,getUrl:e=>e.normalMapUrl},{id:b.EViewSwitcherViewId.HEIGHT_MAP,getUrl:e=>e.heightMapUrl},{id:b.EViewSwitcherViewId.CURVATURE_MAP,getUrl:e=>e.curvatureMapUrl},{id:b.EViewSwitcherViewId.AO_MAP,getUrl:e=>e.aoMapUrl},{id:b.EViewSwitcherViewId.POSITION_MAP,getUrl:e=>e.positionMapUrl}].map(e=>({...e,title:t[e.id]??e.id})).filter(t=>!(e?.excludeNormalMap&&t.id===b.EViewSwitcherViewId.NORMAL_MAP||e?.excludeEmission&&t.id===b.EViewSwitcherViewId.EMISSION_MAP))},"useTextureViewTitles",0,V],938369);var I=e.i(977154);async function N(e,t,i){let a=e.image;if(!("u">typeof HTMLImageElement&&a instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&a instanceof ImageBitmap||"u">typeof OffscreenCanvas&&a instanceof OffscreenCanvas))return null;let{width:r,height:s}="u">typeof HTMLImageElement&&a instanceof HTMLImageElement?{width:a.naturalWidth,height:a.naturalHeight}:{width:a.width,height:a.height};if(!r||!s)return null;let l=Math.min(1,t/Math.max(r,s)),n=Math.max(1,Math.round(r*l)),o=Math.max(1,Math.round(s*l));try{let e=document.createElement("canvas");e.width=n,e.height=o;let t=e.getContext("2d");if(!t)return null;if(t.drawImage(a,0,0,n,o),null!=i){let e=t.getImageData(0,0,n,o),a=e.data;for(let e=0;e<a.length;e+=4){let t=a[e+i];a[e]=t,a[e+1]=t,a[e+2]=t}t.putImageData(e,0,0)}return await new Promise(t=>e.toBlob(t,"image/png"))}catch{return null}}let T={};function k(e,t){let[i,a]=(0,m.useState)({forViews:e,thumbnails:T}),r=(0,m.useRef)([]),s=(0,m.useRef)([]);return(0,m.useEffect)(()=>{let i=!1;return(async()=>{let l={},n=[];for(let a of e){let e=await N(a.texture,t,a.needsOrmExtract?(0,I.getOrmChannelByViewId)(a.id):null);if(i)break;if(e){let t=URL.createObjectURL(e);n.push(t),l[a.id]=t}}if(i){for(let e of n)URL.revokeObjectURL(e);return}s.current.push(...r.current),r.current=n,a({forViews:e,thumbnails:l})})(),()=>{i=!0}},[e,t]),(0,m.useEffect)(()=>
1{if(0===s.current.length)return;let e=s.current;for(let t of(s.current=[],e))URL.revokeObjectURL(t)},[i]),(0,m.useEffect)(()=>()=>{for(let e of s.current)URL.revokeObjectURL(e);for(let e of r.current)URL.revokeObjectURL(e);s.current=[],r.current=[]},[]),i.forViews===e?i.thumbnails:T}e.s(["useTextureViewThumbnails",0,k],733703);let R=[],O=[{id:b.EViewSwitcherViewId.COLOR_MAP,urlKey:"colorMapUrl"},{id:b.EViewSwitcherViewId.ROUGHNESS_MAP,urlKey:"roughnessMapUrl"},{id:b.EViewSwitcherViewId.METALLIC_MAP,urlKey:"metallicMapUrl"},{id:b.EViewSwitcherViewId.EMISSION_MAP,urlKey:"emissionMapUrl"},{id:b.EViewSwitcherViewId.NORMAL_MAP,urlKey:"normalMapUrl"},{id:b.EViewSwitcherViewId.HEIGHT_MAP,urlKey:"heightMapUrl"},{id:b.EViewSwitcherViewId.CURVATURE_MAP,urlKey:"curvatureMapUrl"},{id:b.EViewSwitcherViewId.AO_MAP,urlKey:"aoMapUrl"},{id:b.EViewSwitcherViewId.POSITION_MAP,urlKey:"positionMapUrl"}];function A({textureUrl:e,excludeNormalMap:t,excludeEmission:i,source:a="glb",open:r,onOpenChange:s}){let[l,n]=(0,m.useState)(!1),[o,d]=(0,m.useState)(r);r!==o&&(d(r),r&&n(!0)),(0,m.useEffect)(()=>{if(r)return;let e=window.setTimeout(()=>n(!1),400);return()=>window.clearTimeout(e)},[r]);let[p,f]=(0,m.useState)(null),x=(0,h.useTranslations)("Common"),g=V(),S="glb"===a,y=C(),M=S?y.find(e=>e.views.some(e=>{let a;return a=e.id,(!t||a!==b.EViewSwitcherViewId.NORMAL_MAP)&&(!i||a!==b.EViewSwitcherViewId.EMISSION_MAP)})):void 0,j=k(S&&(r||l)?M?.views??R:R,2048),E=(S?(M?.views??R).map(e=>({id:e.id,title:g[e.id]??e.id,imgUrl:j[e.id]})):O.map(({id:t,urlKey:i})=>({id:t,title:g[t]??t,imgUrl:e?.[i]}))).filter(e=>!!e.imgUrl&&!(t&&e.id===b.EViewSwitcherViewId.NORMAL_MAP)&&!(i&&e.id===b.EViewSwitcherViewId.EMISSION_MAP)),I=E.find(e=>e.id===p)??E[0];return(S?M:e)?(0,c.jsx)(w.PreviewPanel,{open:r,onOpenChange:s,title:x("TexturePreview"),items:E.map(e=>({id:e.id,tooltip:e.title,thumbnail:(0,c.jsx)(v.default,{crossOrigin:"anonymous",src:e.imgUrl,alt:e.title,fill:!0,draggable:!1,className:"object-cover"})})),activeId:I?.id,onActiveIdChange:e=>f(e),children:I?(0,c.jsx)(w.PreviewImage,{crossOrigin:"anonymous",src:I.imgUrl,alt:"texture-preview"}):S&&(0,c.jsx)("div",{className:"flex size-full items-center justify-center",children:(0,c.jsx)(u.IconLoader2,{className:"text-label-base size-6 animate-spin"})})}):null}function L(){return(L=Object.assign.bind()).apply(null,arguments)}e.s(["TexturePreviewDialog",0,A,"TexturePreviewItem",0,function({textureUrl:e,excludeNormalMap:t,excludeEmission:i,source:a="glb"}){let[r,s]=(0,m.useState)(!1),l=(0,h.useTranslations)(),n="glb"===a,o=C();return(n?o.some(e=>e.views.some(e=>{let a;return a=e.id,(!t||a!==b.EViewSwitcherViewId.NORMAL_MAP)&&(!i||a!==b.EViewSwitcherViewId.EMISSION_MAP)})):!!e)?(0,c.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,c.jsx)(g.default,{title:l("Viewer.Shared.ViewerToolbar.Vie
1wTexture"),side:"bottom",asChild:!0,children:(0,c.jsx)(x.default,{type:"icon-tertiary",size:"sm",icon:(0,c.jsx)(f,{className:"size-full"}),className:"hover:bg-bg-base relative border border-solid !border-white/5 transition-opacity",onClick:()=>{s(!0)}})}),(0,c.jsx)(A,{textureUrl:e,excludeNormalMap:t,excludeEmission:i,source:a,open:r,onOpenChange:s})]}):null}],264460),e.s(["ToolbarDivider",0,function(){return(0,c.jsx)("div",{className:"bg-bg-border h-[12px] w-0.5 shrink-0 rounded-full",role:"separator","aria-hidden":!0})}],371110);let P=function(e){return m.createElement("svg",L({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 21.96c5.5 0 9.96-4.46 9.96-9.96 0-5.5-4.46-9.96-9.96-9.96-5.5 0-9.96 4.46-9.96 9.96 0 5.5 4.46 9.96 9.96 9.96Zm0 1.44c6.296 0 11.4-5.104 11.4-11.4S18.296.6 12 .6.6 5.704.6 12 5.704 23.4 12 23.4Z",fill:"currentColor"})),l||(l=m.createElement("g",{opacity:.4,fill:"currentColor"},m.createElement("path",{d:"M2 8h20v1.5H2V8ZM2 14.5h20V16H2v-1.5Z"}),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.874 4.697C9.19 6.529 8.75 9.11 8.75 12c0 2.889.439 5.47 1.124 7.303.344.92.735 1.611 1.131 2.06.397.449.735.587.995.587V23c-.845 0-1.559-.01-2.119-.644-.56-.635-1.032-1.51-1.412-2.527C7.706 17.789 7.25 15.02 7.25 12c0-3.02.456-5.789 1.22-7.829.38-1.017.85-1.892 1.411-2.527C10.441 1.011 11.155 1 12 1v1.05c-.26 0-.598.138-.995.588-.396.448-.787 1.14-1.13 2.059Z"}))))};function D(){return(D=Object.assign.bind()).apply(null,arguments)}let _=function(e){return m.createElement("svg",D({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 21.96c5.5 0 9.96-4.46 9.96-9.96 0-5.5-4.46-9.96-9.96-9.96-5.5 0-9.96 4.46-9.96 9.96 0 5.5 4.46 9.96 9.96 9.96Zm0 1.44c6.296 0 11.4-5.104 11.4-11.4S18.296.6 12 .6c-.178 0-.355.004-.531.012C5.419.89.6 5.882.6 12s4.82 11.11 10.868 11.388c.177.008.354.012.532.012Z",fill:"currentColor"})),o||(o=m.createElement("path",{d:"M2 8h20v1.5H2V8ZM2 14.5h20V16H2v-1.5Z",fill:"currentColor"})),d||(d=m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.874 4.697C9.19 6.529 8.75 9.11 8.75 12c0 2.889.439 5.47 1.124 7.303.344.92.735 1.611 1.131 2.06.397.449.735.587.995.587v1.45c-.178 0-.355-.004-.532-.012-.616-.146-1.149-.536-1.587-1.032-.56-.635-1.032-1.51-1.412-2.527C7.706 17.789 7.25 15.02 7.25 12c0-3.02.456-5.789 1.22-7.829.38-1.017.85-1.892 1.411-2.527.438-.496.971-.886 1.588-1.032C11.645.604 11.822.6 12 .6v1.45c-.26 0-.598.138-.995.588l-.027.03c-.387.45-.768 1.13-1.104 2.029Z",fill:"currentColor"})))};var U=e.i(371369);let W=(0,m.forwardRef)(function({children:e,...t},i){return(0,c.jsx)("div",{ref:i,...t,className:"inline-flex",children:e})});e.s(["WireframeToggleItem",0,function(){let[e,t]=(0,U.useWireframeState)();return(0,c.jsx)(g.default,{title:`Wireframe - ${e?"On":"Off"}`,side:"bottom",asChild:!0,unstyled:!0,children:(0,c.jsx)(W,{children:(0,c.jsx)(x.default,{type:"icon-tertiary",size:"sm",icon:e?(0,c.jsx)(_,{}):(0,c.jsx)(P,{}),onClick:()=>t(!e)})})})}],622232)},92977,e=>{"use strict";var t=e.i(843476),i=e.i(948148),a=e.i(271645),r=e.i(619436),s=e.i(459667),l=e.i(764042),n=e.i(333884),o=e.i(647348),d=e.i(8585),c=e.i(938369),u=e.i(733703),h=e.i(11942),m=e.i(513932),p=e.i(289768),f=e.i(530589),x=e.i(758922),g=e.i(370388),w=e.i(30737);function v({id:e,title:i,imgUrl:a,active:r,crossOrigin:s,onClick:l,isLoading:n=!1}){return(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(x.default,{title:i,asChild:!0,sideOffset:8,side:"bottom",className:"z-300",children:(0,t.jsxs)("button",{onClick:l,onMouseDown:e=>e.preventDefault(),className:(0,w.cn)("bg-bg-base-hover relative flex size-7 flex-col items-center justify-center overflow-hidden rounded-lg border border-solid p-2 transition duration-100 ease-out active:opacity-70",r?"border-accent-base":"hover:border-accent-bg-hover border-white/5"),children:[a&&(0,t.jsx)(g.default,{crossOrigin:s,src:a,alt:i,className:"pointer-events-none absolute inset-0 size-full object-cover",width:100,height:100},a),(0,t.jsx)("div",{className:"group/eye absolute flex size-full items-center justify-center bg-black/60 opacity-0 transition-opacity duration-100 ease-out hover:opacity-100",children:(0,t.jsx)(h.IconEye,{className:"text-label-base size-4"})})]},e)}),(0,t.jsx)(p.AnimatePresence,{children:n&&(0,t.jsx)(f.motion.div,{className:"pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-lg bg-black/40",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeOut"},children:(0,t.jsx)(m.IconLoader2,{className:"text-label-base size-3 animate-spin"})})})]})}let b=[];e.s(["ViewSwitcher",0,function({textureUrls:e,excludeNormalMap:h,excludeEmission:m,source:p="glb"}){let f=(0,i.useTranslations)(),[x,g]=(0,a.useState)(0),{renderMode:w,setViewSwitcherViewId:S}=(0,n.useViewerRenderMode)(),{viewSwitcherViewId:y}=(0,o.useViewerViewSwitcher)(),{settings:M,setSettings:j}=(0,d.useViewerCore)(),E=(0,c.useTextureConfig)({excludeNormalMap:h,excludeEmission:m}),C=(0,c.useTextureViewTitles)(),V="glb"===p,I=(0,l.useGLBTextureViews)(),N=(0,a.useMemo)(()=>I.filter(e=>e.views.some(e=>!(h&&e.id===s.EViewSwitcherViewId.NORMAL_MAP)&&!(m&&e.id===s.EViewSwitcherViewId.EMISSION_MAP))),[I,h,m]),T=V?N:e;(0,a.useEffect)(()=>{g(0)},[T]);let k=V?N.length:e?.length??0,R=(0,a.useMemo)(()=>V?N[x]?.views??b:b,[V,N,x]),O=(0,u.useTextureViewThumbnails)(R,96),A=e?.[x],L=(0,a.useMemo)(()=>V?R.filter(e=>!(h&&e.id===s.EViewSwitcherViewId.NORMAL_MAP)&&!(m&&e.id===s.EViewSwitcherViewId.EMISSION_MAP)).map(e=>({id:e.id,title:C[e.id]??e.id,imgUrl:O[e.id]})):A?E.filter(e=>!!e.getUrl(A)).map(e=>({id:e.id,title:e.title,imgUrl:e.getUrl(A)})):[],[V,R,h,m,C,O,A,E]);return(0,a.useEffect)(()=>{if("color"===w&&L.length>0){let e=L.map(e=>e.id);e.includes(y)||S(e[0])}},[w,L,y,S]),(0,t.jsxs)(t.Fragment,{children:[k>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Select,{value:x+"",options:Array.from({length:k},(e,t)=>({label:`${f("Workspace.Shared.ViewSwitcher.Materials.Prefix")} ${t+1}`,value:t+""})),onChange:e=>{g(Number(e))}}),(0,t.jsx)("div",{className:"bg-bg-border h-[12px] w-0.5 rounded-full"})]}),L.length>0&&(0,t.jsx)("div",{className:"relative -mx-1 my-1 h-full min-w-0 flex-col overflow-x-auto p-1",children:(0,t.jsx)("div",{className:"flex gap-1.5 whitespace-nowrap focus:outline-hidden sm:flex-wrap",children:L.map((e,i)=>(0,t.jsx)(v,{crossOrigin:"anonymous",id:e.id,title:e.title,imgUrl:e.imgUrl,active:y===e.id&&("color"===w||M.pendingColorMode),isLoading:M.externalTextureLoadingViewId===e.id||V&&!e.imgUrl,onClick:()=>{"color"===w?S(e.id):j({viewSwitcherViewId:e.id,pendingColorMode:!0})}},`texture-${x}-channel-${i}`))})})]})}],92977)},387466,e=>{"use strict";var t=e.i(843476),i=e.i(271645),a=e.i(732009),r=e.i(476514),s=e.i(8585);e.s(["GridLayer",0,function({divisions:e=10,size:l,sizeMultiplier:n=2,minSize:o=2}){let{isShowGrid:d}=(0,r.useViewerDisplaySettings)(),{modelRoots:c}=(0,s.useViewerCore)(),u=(0,i.useRef)(null),[h,m]=(0,i.useState)(0),[p,f]=(0,i.useState)(4);return(0,i.useEffect)(()=>{let e;if(0===c.length){m(0),f(4);return}let t=i=>{e=requestAnimationFrame(()=>{if(i>0)t(i-1);else{let e=new a.Box3,t=!1;for(let i of c)if(i){let r=new a.Box3().setFromObject(i);r.isEmpty()||(e.union(r),t=!0)}if(t){m(e.min.y);let t=new a.Vector3;e.getSize(t),f(Math.max(Math.max(t.x,t.z)*n,o))}}})};return t(3),()=>{cancelAnimationFrame(e)}},[c,n,o]),(0,t.jsx)("gridHelper",{ref:u,visible:d,args:[l??p,e,"#585858","#3f3f3f"],position:[0,h,0]})}])},711749,590381,891751,e=>{"use strict";var t=e.i(330247);e.s(["usePBRExternalNormalMapEnabled",0,function(e){return(0,t.useGateValue)("lit_external_normal_map")}],711749);var i=e.i(315080),a=e.i(271645),r=e.i(732009),s=e.i(476514);e.s(["CameraFovController",0,function(){let e=(0,i.useThree)(e=>e.get),t=(0,i.useThree)(e=>e.invalidate),{cameraFov:l}=(0,s.useViewerDisplaySettings)();return(0,a.useEffect)(()=>{let i=e().camera;i instanceof r.PerspectiveCamera&&i.fov!==l&&(i.fov=l,i.updateProjectionMatrix(),t())},[l,e,t]),null}],590381),e.s(["CameraFovResetController",0,function({defaultFov:e,resetKey:t}){let{isPreserveCameraView:i,resetCameraFov:r}=(0,s.useViewerDisplaySettings)(),l=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let a=l.current;if(a&&a.resetKey===t&&a.defaultFov===e)return;let s=null!==a;l.current={defaultFov:e,resetKey:t},i&&s||r(e)},[e,i,r,t]),null}],891751)},532050,e=>{"use strict";e.i(210730);var t=e.i(589805),i=e.i(703862);let a=t.LIT_LOOK.keyLight,r="Spot",s="Shadow",l={angleDeg:r,penumbra:r,distance:r,decay:r,shadowOpacity:s,shadowIntensity:s,shadowMapSize:s,modelReceivesSh
1adow:s},n=Object.keys(a);function o(e){let t=l[e];return t?`${i.LIGHTS_FOLDER}.${t}.${e}`:`${i.LIGHTS_FOLDER}.${e}`}e.s(["DEBUG_TOP_LIGHT_DEFAULTS",0,a,"DEBUG_TOP_LIGHT_KEYS",0,n,"DEBUG_TOP_LIGHT_SHADOW_FOLDER",0,s,"DEBUG_TOP_LIGHT_SPOT_FOLDER",0,r,"debugTopLightPath",0,o,"debugTopLightStorePatch",0,function(e,t){let i={};for(let a of n){let r=e[a];if(void 0===r)continue;let s=o(a);t(s)&&(i[s]=r)}return i},"keyLightRigToLayerProps",0,function(e,t){let i,r,s,l=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,n="object"==typeof(i=e.position)&&null!==i&&"number"==typeof i.x&&"number"==typeof i.y&&"number"==typeof i.z?e.position:a.position,o=l(e.shadowOpacity,a.shadowOpacity),d="directional"===(r=e.lightType)||"spot"===r||"point"===r?e.lightType:a.lightType;return{enabled:t&&("boolean"==typeof e.enabled?e.enabled:a.enabled),lightType:d,intensity:l(e.intensity,a.intensity),..."directional"===d?{}:{...l(e.distance,a.distance)>0?{distance:l(e.distance,a.distance)}:{},decay:l(e.decay,a.decay)},color:"string"==typeof e.color?e.color:a.color,position:[n.x,n.y,n.z],angle:l(e.angleDeg,a.angleDeg)*Math.PI/180,penumbra:l(e.penumbra,a.penumbra),shadowMapSize:512===(s=e.shadowMapSize)||1024===s||2048===s?e.shadowMapSize:a.shadowMapSize,shadowIntensity:l(e.shadowIntensity,a.shadowIntensity),shadowOpacity:o,showShadowCatcher:o>0,modelReceivesShadow:"boolean"==typeof e.modelReceivesShadow?e.modelReceivesShadow:a.modelReceivesShadow}},"readDebugTopLightParams",0,function(e){if(void 0===e(o("enabled")))return null;let t={...a};for(let i of n){let a=e(o(i));void 0!==a&&(t[i]=a)}return t}])},366198,375043,685783,e=>{"use strict";var t=e.i(843476);e.i(210730);var i=e.i(589805),a=e.i(532050),r=e.i(8585),s=e.i(624262);e.s(["LitKeyLightLayer",0,function(){let{settings:e}=(0,r.useViewerCore)(),l="pbr"===e.renderMode&&!e.isEffectiveSolidMode;return(0,t.jsx)(s.DirectionalTopLightLayer,{...(0,a.keyLightRigToLayerProps)(i.LIT_LOOK.keyLight,l)})}],366198),e.i(141414),e.i(133277),e.s([],375043);var l=e.i(948148),n=e.i(371369);e.s(["QuadWireframeNote",0,function({quadJsonUrl:e,topology:i}){let a=(0,l.useTranslations)(),[r]=(0,n.useWireframeState)();return r&&!e?(0,t.jsx)("div",{className:"pointer-events-auto absolute top-10 left-1/2 z-10 -translate-x-1/2",children:(0,t.jsx)("div",{className:"bg-bg-depth-2 text-label-muted rounded-lg border border-yellow-500/20 px-3 py-2 text-xs shadow-lg backdrop-blur-sm",children:"quad"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-center text-yellow-500",children:"⚠️ ⚠️ ⚠️"}),(0,t.jsx)("div",{children:a("Common.GLBPreviewShowsTriangulatedWireframe")}),(0,t.jsx)("div",{children:a("Common.DownloadOBJOrFBXToView")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-center text-yellow-500",children:"ℹ ℹ ℹ"}),(0,t.jsx)("div",{children:a("Common.GLBPreviewShowsTriangulatedWireframe")}),(0,t.jsx)("div",{children:a("Common.IfYourModelIsQuadDownload")})]})})}):null}],685783)},5566,e=>{"use strict";var t=e.i(843476),i=e.i(170634),a=(0,e.i(33550).default)("outline","palette-off","IconPaletteOff",[["path",{d:"M15 15h-1a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25a9 9 0 0 1 -6.372 -15.356",key:"svg-0"}],["path",{d:"M8 4c1.236 -.623 2.569 -1 4 -1c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828a4.516 4.516 0 0 1 -1.127 .73",key:"svg-1"}],["path",{d:"M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M3 3l18 18",key:"svg-5"}]]),r=e.i(948148),s=e.i(537608),l=e.i(814273),n=e.i(758922),o=e.i(164669),d=e.i(878347),c=e.i(461248);e.s(["ComponentColorsToggleItem",0,function(){let e=(0,r.useTranslations)(),u=(0,s.useTrack)(),{isSolidModeWithComponentColors:h,setSolidModeWithComponentColors:m}=(0,d.useViewerComponentColorsSettings)(),p=((0,o.useModelTriangleCount)(c.isComponentColorMesh)??0)>c.MAX_COMPONENT_COLOR_TRIANGLES,f=p?e("Workspace.Shared.WorkspaceToolbar.ComponentColors.TooComplex"):`${e("Workspace.Shared.WorkspaceToolbar.ComponentColors.Title")} - ${e(h?"Workspace.Shared.WorkspaceToolbar.On":"Workspace.Shared.WorkspaceToolbar.Off")}`;return(0,t.jsx)(n.default,{title:f,asChild:!0,sideOffset:8,side:"bottom",children:(0,t.jsx)("span",{className:"inline-flex",children:(0,t.jsx)(l.default,{type:"icon-tertiary",size:"sm",disabled:p,icon:h?(0,t.jsx)(i.IconPalette,{className:"size-4",stroke:1.5}):(0,t.jsx)(a,{className:"size-4",stroke:1.5}),onClick:()=>{let e=!h;m(e),u("component_colors_toggled",{enabled:e})}})})})}],5566)},763405,e=>{"use strict";var t=e.i(843476),i=e.i(513932),a=e.i(530589),r=e.i(948148),s=e.i(127923),l=e.i(271645),n=e.i(129621),o=e.i(530284),d=e.i(537608),c=e.i(814273),u=e.i(131127),h=e.i(513395),m=e.i(758922),p=e.i(30737),f=e.i(343859),x=e.i(933716),g=e.i(580591),w=e.i(8585);function v(e){return e.isSolidView&&e.isSolidModeWithNormalMap}e.s(["ShadingNormalSettingsItem",0,function({showNormalMap:e=!1,showShadingMode:b=!1,hints:S,isSolidView:y=!0}){let M=(0,r.useTranslations)(),j=(0,d.useTrack)(),[E,C]=(0,l.useState)(!1),{settings:V,setSettings:I,isGeometryComputing:N}=(0,w.useViewerCore)(),{shadingMode:T,shadingModeSource:k}=V,{setFlat:R,setFullSmooth:O}=(0,g.useViewerShadingMode)(),{isSolidModeWithNormalMap:A,setSolidModeWithNormalMap:L}=(0,x.useViewerNormalMapSettings)(),P=A&&!(0,f.shouldDisableNormalMapView)(S),D=v({isSolidView:y,isSolidModeWithNormalMap:P}),_=(0,f.isHighPolyShadingHint)(S),U=!!S?.isMeshy7&&(0,f.isHighPolyShadingHint)(S),W=function(e){if(v(e))return e.isHighPoly?"auto":"fullSmooth";let{shadingMode:t,shadingModeSource:i,isSolidView:a}=e;return"auto"!==i&&("initial"!==i||a)?"flat"===t?"flat":"fullSmooth"===t?"fullSmooth":void 0:"auto"}({shadingMode:T,shadingModeSource:k,isSolidView:y,isSolidModeWithNormalMap:P,isHighPoly:_});return(0,t.jsxs)(s.Popover.Root,{onOpenChange:C,children:[(0,t.jsx)(m.default,{title:M("Worksp
1ace.Shared.WorkspaceToolbar.Shading.Title"),asChild:!0,sideOffset:8,side:"bottom",className:"z-300",children:(0,t.jsx)(s.Popover.Trigger,{asChild:!0,children:(0,t.jsx)(c.default,{type:"icon-tertiary",size:"sm",className:(0,p.cn)(E&&"text-label-title bg-white/5"),icon:D?(0,t.jsx)(o.default,{}):(0,t.jsx)(n.default,{})})})}),(0,t.jsx)(s.Popover.Portal,{children:(0,t.jsx)(s.Popover.Content,{className:"relative z-50",sideOffset:16,onOpenAutoFocus:e=>e.preventDefault(),side:"bottom",align:"end",tabIndex:-1,children:(0,t.jsxs)(a.motion.div,{className:"bg-bg-base-hover flex w-[280px] flex-col rounded-2xl shadow-lg",initial:{opacity:0,scale:.95,x:-8},animate:{opacity:1,scale:1,x:0},exit:{opacity:0,scale:.95,x:-8},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsxs)("div",{className:"px-md py-md relative flex h-12 items-center justify-start",children:[(0,t.jsx)("div",{className:"text-label-title text-base-plus pl-xs select-none",children:M("Workspace.Shared.WorkspaceToolbar.Shading.Title")}),(0,t.jsx)("div",{className:"bg-bg-border absolute bottom-0 left-1/2 h-px w-64 -translate-x-1/2"})]}),(0,t.jsxs)("div",{className:"gap-md p-md flex w-full flex-col",children:[e&&(0,t.jsxs)("div",{className:"gap-sm flex w-full items-center justify-between",children:[(0,t.jsxs)("div",{className:"gap-xs flex items-center",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:M("Workspace.Shared.WorkspaceToolbar.DisplaySettings.NormalMap")}),N&&(0,t.jsx)(i.IconLoader2,{className:"text-label-base size-3 animate-spin"})]}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(m.default,{title:M("Workspace.Shared.WorkspaceToolbar.Shading.NormalMapComputingTooltip"),asChild:!0,disabled:!N,className:"z-300",children:(0,t.jsx)("span",{className:"inline-flex",children:(0,t.jsx)(h.Switch,{checked:A,disabled:N,onChange:e=>{L(e)}})})})})]}),b&&(0,t.jsxs)("div",{className:"gap-sm flex w-full flex-col",children:[(0,t.jsx)("div",{className:"text-label-base text-xs font-medium select-none",children:M("Workspace.Shared.WorkspaceToolbar.Shading.FlatSmoothTitle")}),(0,t.jsx)(u.RadioGroup,{size:"xs",disabled:D,value:W,onChange:e=>{"auto"===e?I({shadingMode:(0,f.getRecommendedShadingMode)(S??{}),shadingModeSource:"auto"}):"flat"===e?R():"fullSmooth"===e&&O(),j("shading_mode_selected",{mode:e,view:y?"solid":"lit",highPoly:_})},options:[{value:"auto",label:M("Workspace.Shared.WorkspaceToolbar.Shading.AutoSmooth")},{value:"flat",label:M("Workspace.Shared.WorkspaceToolbar.Shading.Flat")},...U?[]:[{value:"fullSmooth",label:M("Workspace.Shared.WorkspaceToolbar.Shading.FullSmooth")}]]})]})]})]})})})]})}],763405)},982703,e=>{"use strict";var t=e.i(843476),i=e.i(802315),a=e.i(530589),r=e.i(948148),s=e.i(127923),l=e.i(271645),n=e.i(99162),o=e.i(370388),d=e.i(459667),c=e.i(30737),u=e.i(764042),h=e.i(333884),m=e.i(647348),p=e.i(8585),f=e.i(264460),x=e.i(938369),g=e.i(733703);let w=[];e.s(["MobileTextureMapMenu",0,function({textureUrls:e,excludeNormalMap:v,excludeEmission:b,source:S="glb"}){let y=(0,r.useTranslations)(),[M,j]=(0,l.useState)(!1),[E,C]=(0,l.useState)(!1),{renderMode:V,setViewSwitcherViewId:I}=(0,h.useViewerRenderMode)(),{viewSwitcherViewId:N}=(0,m.useViewerViewSwitcher)(),{settings:T,setSettings:k}=(0,p.useViewerCore)(),R=(0,x.useTextureConfig)({excludeNormalMap:v,excludeEmission:b}),O=(0,x.useTextureViewTitles)(),A="glb"===S,L=(0,u.useGLBTextureViews)(),P=A?L.find(e=>e.views.some(e=>!(v&&e.id===d.EViewSwitcherViewId.NORMAL_MAP)&&!(b&&e.id===d.EViewSwitcherViewId.EMISSION_MAP))):void 0,D=P?.views??w,_=(0,g.useTextureViewThumbnails)(A?D:w,96),U=e?.[0],W=(0,l.useMemo)(()=>A?D.filter(e=>!(v&&e.id===d.EViewSwitcherViewId.NORMAL_MAP)&&!(b&&e.id===d.EViewSwitcherViewId.EMISSION_MAP)).map(e=>({id:e.id,title:O[e.id]??e.id,imgUrl:_[e.id]})):U?R.filter(e=>!!e.getUrl(U)).map(e=>({id:e.id,title:e.title,imgUrl:e.getUrl(U)})):[],[A,D,v,b,O,_,U,R]);if(A?!P:!U||0===W.length)return null;let z="color"===V||!!T.pendingColorMode,H=z&&W.find(e=>e.id===N)||W[0];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.Popover.Root,{open:M,onOpenChange:j,children:[(0,t.jsx)(s.Popover.Trigger,{asChild:!0,children:(0,t.jsxs)("button",{className:(0,
1c.cn)("bg-bg-base-hover flex h-7 items-center gap-0.5 rounded-lg border border-solid py-0.5 pr-0.5 pl-1 transition duration-100 ease-out active:opacity-70",M||z?"border-accent-base":"border-white/5"),"aria-label":y("Viewer.Shared.ViewerToolbar.ViewTexture"),children:[H.imgUrl?(0,t.jsx)(o.default,{crossOrigin:"anonymous",src:H.imgUrl,alt:H.title,className:"pointer-events-none size-5 rounded-md object-cover",width:100,height:100},H.imgUrl):(0,t.jsx)("div",{className:"bg-bg-shade size-5 animate-pulse rounded-md"}),(0,t.jsx)(a.motion.div,{className:"text-label-muted",animate:{rotate:180*!!M},transition:{type:"spring",stiffness:500,damping:40},children:(0,t.jsx)(i.IconChevronDown,{size:14})})]})}),(0,t.jsx)(s.Popover.Portal,{children:(0,t.jsx)(s.Popover.Content,{className:"relative z-50",sideOffset:8,align:"end",side:"bottom",onOpenAutoFocus:e=>e.preventDefault(),tabIndex:-1,children:(0,t.jsxs)(a.motion.div,{className:"bg-bg-base-hover flex w-44 flex-col gap-0.5 rounded-xl p-1 shadow-lg",initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0},transition:{duration:.15,ease:"easeOut"},children:[W.map(e=>{let i=z&&N===e.id;return(0,t.jsxs)("button",{className:(0,c.cn)("flex items-center gap-2 rounded-lg p-1.5 text-left transition-colors active:bg-white/10",i&&"bg-white/5"),onClick:()=>{"color"===V?I(e.id):k({viewSwitcherViewId:e.id,pendingColorMode:!0})},children:[e.imgUrl?(0,t.jsx)(o.default,{crossOrigin:"anonymous",src:e.imgUrl,alt:e.title,className:(0,c.cn)("size-6 rounded-md border border-solid object-cover",i?"border-accent-base":"border-white/5"),width:100,height:100}):(0,t.jsx)("div",{className:(0,c.cn)("bg-bg-shade size-6 animate-pulse rounded-md border border-solid",i?"border-accent-base":"border-white/5")}),(0,t.jsx)("span",{className:(0,c.cn)("min-w-0 truncate text-xs",i?"text-label-title":"text-label-base"),children:e.title})]},e.id)}),(0,t.jsx)("div",{className:"bg-bg-border mx-1.5 my-0.5 h-px"}),(0,t.jsxs)("button",{className:"flex items-center gap-2 rounded-lg p-1.5 text-left transition-colors active:bg-white/10",onClick:()=>{j(!1),C(!0)},children:[(0,t.jsx)("div",{className:"text-label-base size-6 p-0.5",children:(0,t.jsx)(n.default,{})}),(0,t.jsx)("span",{className:"text-label-base min-w-0 truncate text-xs",children:y("Viewer.Shared.ViewerToolbar.Vie
1wTexture")})]})]})})})]}),(0,t.jsx)(f.TexturePreviewDialog,{textureUrl:U,excludeNormalMap:v,excludeEmission:b,source:S,open:E,onOpenChange:C})]})}])},364549,987118,e=>{"use strict";var t=e.i(843476),i=e.i(251789),a=e.i(20110),r=e.i(711749),s=e.i(632477),l=e.i(113574),n=e.i(102408);e.i(971609);var o=e.i(353016),d=e.i(590381),c=e.i(891751);e.i(210493);var u=e.i(847673),h=e.i(882777),m=e.i(366198),p=e.i(20190),f=e.i(839567);e.i(715903);var x=e.i(18167);e.i(375043);var g=e.i(141414),w=e.i(333869),v=e.i(173060);e.i(210730);var b=e.i(589805),S=e.i(685783),y=e.i(803068),M=e.i(8585),j=e.i(442357),E=e.i(692305),C=e.i(387466),V=e.i(14543),I=e.i(45982),N=e.i(942666),T=e.i(125933),k=e.i(5566),R=e.i(124875),O=e.i(202764),A=e.i(127702),L=e.i(775054),P=e.i(894568),D=e.i(763405),_=e.i(264460),U=e.i(371110),W=e.i(622232),z=e.i(982703),H=e.i(92977),F=e.i(436890),B=e.i(459667),Z=e.i(343859),G=e.i(849368),K=e.i(764042),$=e.i(906724),X=e.i(995011),Y=e.i(631976),q=e.i(663528),J=e.i(139902),Q=e.i(164669),ee=e.i(330247),et=e.i(333884);function ei(e={}){let{enableDisplaySettings:i=!0,enableStatisticsSettings:a=!1,enablePreserveCameraViewSetting:r=!1,defaultCameraFov:s=b.DEFAULT_VIEWER_CAMERA_FOV,allowPBRMode:l=!0,hideWhenEmpty:n=!1,toolbarExtra:o}=e,d=function({textureUrls:e,aiModel:t,allowRenderMode:i=!0,allowEnvironment:a=!1,allowWireframe:r=!0,allowNormalMap:s=!0,allowMaterialAdjustment:l=!0,allowBloom:n=!0,allowRigging:o=!1,allowViewSwitcher:d=!0,allowTexturePreview:c=!0,texturePanelSource:u="glb",hints:h,allowShadingMode:m=!0,allowHighPolyShading:p=!1,allowComponentColors:f=!0,allowAmbientOcclusion:x=!0}={}){let{isSolidMode:g,isPBRShadingMode:w}=(0,et.useViewerRenderMode)(),{modelRoots:v,settings:b}=(0,M.useViewerCore)(),S=(0,Y.useModelHasTexture)(),y=(0,J.useModelHasVertexColors)(),j=(0,X.useModelHasNormalMap)(),E=(0,$.useModelHasEmission)(),C=(0,q.useModelHasUV)(),V=t===F.AIModelEnum.Meshy6,I=(0,ee.useGateValue)("internal_users"),N=!!e?.[0]?.colorMapUrl,T=!!e?.[0]?.normalMapUrl,k=N&&C,R=k||S||y,O=v.length>0,A=O&&!R,L=g||A,P=L&&(T&&C||j)&&!A&&!(0,Z.shouldDisableNormalMapView)(h),D=(0,Q.useModelTriangleCount)(),_=(0,Z.isLowPolyLikeShadingHint)(h)||!!h?.isUserUpload&&(D??1/0)<=2e4,U=(D??1/0)<=G.MAX_HIGH_POLY_SHADING_TRIANGLES,W=p&&(0,Z.isHighPolyShadingHint)(h)&&U,z=(0,Z.canReceiveMeshy7SolidFlat)(h??{})||(0,Z.isMeshy71SolidTarget)(h??{}),H={shouldRender:m&&(_||W||z)&&(L||w&&(!!h?.isVenus||W))&&O&&!h?.isAnimated},ei={shouldRender:f&&_&&L&&O&&!h?.isAnimated},ea={shouldRender:x&&I&&!!b.isEffectiveSolidMode&&O},er=(0,K.useGLBTextureViews)().some(e=>e.views.some(e=>!(!s&&e.id===B.EViewSwitcherViewId.NORMAL_MAP)&&!(!V&&e.id===B.EViewSwitcherViewId.EMISSION_MAP))),es="glb"===u?er&&C:k,el={shouldRender:d&&es},en={shouldRender:c&&es,textureUrl:e?.[0]},eo=el.shouldRender&&en.shouldRender;return{renderMode:{shouldRender:i&&R},environment:{shouldRender:a&&R&&w},wireframe:{shouldRender:r},normalMap:{shouldRender:s&&P},shadingMode:H,componentColors:ei,isSolidView:L,ambientOcclusion:ea,materialAdjustment:{shouldRender:l&&w&&!A&&R&&O},bloom:{shouldRender:n&&E&&w&&!A},rigging:{shouldRender:o},viewSwitcher:el,texturePreview:en,texturePanelSource:u,showRightDivider:eo,excludeNormalMap:!s,excludeEmission:!V}}(e),c=(0,I.useMobileViewerRedesign)(),u=[i&&(0,t.jsx)(R.DisplaySettingsItem,{enableStatisticsSettings:a,enablePreserveCameraViewSetting:r,defaultCameraFov:s},"display"),d.wireframe.shouldRender&&(0,t.jsx)(W.WireframeToggleItem,{},"wireframe")].filter(Boolean),h=[d.renderMode.shouldRender&&(0,t.jsx)(L.RenderModeToggleItem,{textureUrls:e.textureUrls,allowPBRMode:l},"render-mode")].filter(Boolean),m=[!c&&(d.normalMap.shouldRender||d.shadingMode.shouldRender)&&(0,t.jsx)(D.ShadingNormalSettingsItem,{showNormalMap:d.normalMap.shouldRender,showShadingMode:d.shadingMode.shouldRender,hints:e.hints,isSolidView:d.isSolidView},"shading-normal"),!c&&d.ambientOcclusion.shouldRender&&(0,t.jsx)(N.AmbientOcclusionSettingsItem,{},"ambient-occlusion"),d.componentColors.shouldRender&&(0,t.jsx)(k.ComponentColorsToggleItem,{},"component-colors")].filter(Boolean),p=[d.materialAdjustment.shouldRender&&(0,t.jsx)(A.MaterialAdjustmentSettingsItem,{}
1,"material-adjustment")].filter(Boolean),f=[d.bloom.shouldRender&&(0,t.jsx)(T.BloomSettingsItem,{},"bloom")].filter(Boolean),x=[d.environment.shouldRender&&(0,t.jsx)(O.EnvironmentSettingsItem,{},"environment")].filter(Boolean),g=[d.rigging.shouldRender&&(0,t.jsx)(P.RiggingDisplaySettingsItem,{side:"bottom"},"rigging")].filter(Boolean),w=c?[]:[...p,...f,...x],v=[u,h,m,w.length>0?[(0,t.jsx)("div",{className:"flex items-center gap-2",children:w},"lit-mode")]:[],g].filter(e=>e.length>0).flatMap((e,i)=>i>0?[(0,t.jsx)(U.ToolbarDivider,{},`divider-${i}`),...e]:e),S=(c?[(d.viewSwitcher.shouldRender||d.texturePreview.shouldRender)&&(0,t.jsx)(z.MobileTextureMapMenu,{textureUrls:e.textureUrls,excludeNormalMap:d.excludeNormalMap,excludeEmission:d.excludeEmission,source:d.texturePanelSource},"mobile-texture-map-menu")]:[d.viewSwitcher.shouldRender&&(0,t.jsx)(H.ViewSwitcher,{textureUrls:e.textureUrls,excludeNormalMap:d.excludeNormalMap,excludeEmission:d.excludeEmission,source:d.texturePanelSource},"view-switcher"),d.showRightDivider&&(0,t.jsx)(U.ToolbarDivider,{},"right-divider"),d.texturePreview.shouldRender&&(0,t.jsx)(_.TexturePreviewItem,{textureUrl:d.texturePreview.textureUrl,excludeNormalMap:d.excludeNormalMap,excludeEmission:d.excludeEmission,source:d.texturePanelSource},"texture-preview")]).filter(Boolean);if(n&&0===v.length&&0===S.length&&!o?.left&&!o?.right)return{};let y={left:(0,t.jsx)(t.Fragment,{children:v}),right:(0,t.jsx)(t.Fragment,{children:S})};return o?.left||o?.right?{left:(0,t.jsxs)(t.Fragment,{children:[y.left,o?.left]}),right:(0,t.jsxs)(t.Fragment,{children:[o?.right,y.right]})}:y}function ea({toolbar:e}){return e.left||e.right?(0,t.jsxs)("div",{className:"flex items-center gap-x-2",children:[e.left&&(0,t.jsx)("div",{className:"flex items-center gap-x-2",children:e.left}),e.right&&(0,t.jsx)("div",{className:"flex items-center gap-x-2",children:e.right})]}):null}function er({modelUrl:e,modelType:c="glb",quadJsonUrl:V,textureUrls:I,mtlUrl:N,topology:T,shadingHints:k,enableSplitResultLayer:R=!1,skeletonModelUrl:O,animationActions:A,animationType:L,forceSolidMode:P=!1,isPBR:D=!0,aiModel:_,originBottom:U=!1,slots:W,enableAnimation:z=!0,animationDuration:H=.5,toolbarExtra:F,onReady:B,onError:Z}){let G=!!(O||A?.length),{settings:K}=(0,M.useViewerCore)(),$=G&&K.isEffectiveSolidMode,X=G?E.ANIMATION_CAMERA_FOV:b.DEFAULT_VIEWER_CAMERA_FOV;(0,s.useProgressGeneration)(e);let Y=G?(0,E.getAnimationCameraConfig)():z?{camera:{position:[10,10,20]}}:void 0,q=(0,r.usePBRExternalNormalMapEnabled)(_),J=(0,n.useViewerTextureSamplingConfigDEnabled)(),Q=(0,l.useViewerLitLookEnabled)(),ee=ei({textureUrls:I,aiModel:_,texturePanelSource:"urls",allowPBRMode:!G,allowEnvironment:!G,allowWireframe:!G&&!R,allowMaterialAdjustment:!G,allowBloom:!G,allowRigging:G,hints:G?{isAnimated:!0}:k,defaultCameraFov:X,toolbarExtra:F}),et=W?.toolbar??ee,es=(0,i.useDeveloperPlatformEnabled)()?{...W,toolbar:void 0,topLeft:(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,t.jsx)(ea,{toolbar:et}),W?.topLeft]}),overlay:W?.overlay??(0,t.jsx)(S.QuadWireframeNote,{quadJsonUrl:V,topology:T})}:{toolbar:ee,overlay:(0,t.jsx)(S.QuadWireframeNote,{quadJsonUrl:V,topology:T}),...W};return(0,t.jsx)(j.ViewerFrame,{slots:es,onReady:B,onError:Z,children:(0,t.jsxs)(y.ViewerCanvas,{config:Y,canvasProps:{frameloop:"demand",...R?{gl:{stencil:!0}}:{}},children:[(0,t.jsx)(d.CameraFovController,{}),(0,t.jsx)(f.OrbitControlsLayer,{...G?f.ORBIT_PRESETS.animation:{}}),(0,t.jsx)(h.GizmoLayer,{}),(0,t.jsx)(u.EnvironmentLayer,{defaultHdriRotation:Q?b.LIT_LOOK.hdriRotation:void 0,...G&&!$?{backdropPreset:"noToneMapping"}:{}}),(0,t.jsx)(p.LitLookGateLayer,{enabled:Q}),Q&&(0,t.jsx)(m.LitKeyLightLayer,{}),(0,t.jsx)(C.GridLayer,{...G?{size:E.ANIMATION_GRID_SIZE}:{}}),!G&&(0,t.jsx)(x.ShadingLayer,{textureUrls:I,hints:k,pbrExternalNormalMapEnabled:q,litExposureEnabled:Q}),G&&(0,t.jsx)(a.ModelContent,{url:e,animated:!0,skeletonModelUrl:O,animationActions:A,animationType:L,forceSolidMode:P,isPBR:D,textureSamplingConfigD:J},e),G&&(0,t.jsx)(x.ShadingLayer,{forceSolidMode:P,manageMaterials:!1,litExposureEnabled:Q,hints:{isAnimated:!0}}),!G&&(0,t.jsxs)(w.StageLayer,{disableBuiltInEnvironment:!0,originBottom:U,adjustCameraScale:U?1.7:1.4,enableAnimation:z,animationDuration:H,children:[(0,t.jsx)(a.ModelContent,{url:e,format:c,mtlUrl:N,textureUrl:I?.[0]?.colorMapUrl,textureSamplingConfigD:J},e),!R&&(0,t.jsx)(v.WireframeLayer,{quadJsonUrl:V}),(0,t.jsx)(g.SplitResultLayer,{enabled:R,modelUrl:e})]}),!G&&(0,t.jsx)(o.BloomLayer,{stencilBuffer:R}),$&&(0,t.jsx)(o.BloomLayer,{})]})})}e.s(["useDefaultViewerToolbar",0,ei],987118),e.s(["ApiPlaygroundViewerPreset",0,function(e){let i=!!(e.skeletonModelUrl||e.animationActions?.length),a=i?E.ANIMATION_CAMERA_FOV:b.DEFAULT_VIEWER_CAMERA_FOV,r=`${e.modelUrl}|${e.skeletonModelUrl??""}|${i?"animation":"static"}`;return(0,t.jsxs)(M.ViewerCore,{initialSettings:i?(0,V.getAnimationModeInitialSettings)():void 0,children:[(0,t.jsx)(c.CameraFovResetController,{defaultFov:a,resetKey:r}),(0,t.jsx)(er,{...e})]})}],364549)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.