@needle-tools/engine 5.0.0 → 5.1.0-experimental.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/components.needle.json +1 -1
  2. package/dist/generateMeshBVH.worker-DT9A2Hrc.js +1 -0
  3. package/dist/gltf-progressive-3BwW4ETO.min.js +10 -0
  4. package/dist/gltf-progressive-ByD1UX0A.umd.cjs +10 -0
  5. package/dist/{gltf-progressive-Cl167Vjx.js → gltf-progressive-DwWaVr0o.js} +412 -394
  6. package/dist/gltf-progressive.worker-DpfUjn1n.js +3 -0
  7. package/dist/{materialx-qPScBWhj.min.js → materialx-9KHBidZa.min.js} +1 -1
  8. package/dist/{materialx-4ApD6Vz5.js → materialx-BBDu8W5P.js} +1 -1
  9. package/dist/{materialx-D0XUnhBY.umd.cjs → materialx-hLP3E8AA.umd.cjs} +2 -2
  10. package/dist/{needle-engine.bundle-BAYLGumK.umd.cjs → needle-engine.bundle-BOAJ6UPK.umd.cjs} +123 -123
  11. package/dist/{needle-engine.bundle-CoEvMwYM.min.js → needle-engine.bundle-CVsBkUR2.min.js} +110 -110
  12. package/dist/{needle-engine.bundle-BDIyvCV6.js → needle-engine.bundle-TgPY0fGG.js} +2143 -2088
  13. package/dist/needle-engine.d.ts +80 -22
  14. package/dist/needle-engine.js +480 -476
  15. package/dist/needle-engine.min.js +1 -1
  16. package/dist/needle-engine.umd.cjs +1 -1
  17. package/dist/{postprocessing-B_9sKVU7.min.js → postprocessing-BZfyAdCY.min.js} +1 -1
  18. package/dist/{postprocessing-WDc9WwI3.js → postprocessing-CXlA3QA6.js} +1 -1
  19. package/dist/{postprocessing-B2wb6pzI.umd.cjs → postprocessing-Dwy7Hz_T.umd.cjs} +38 -38
  20. package/dist/three-examples.js +4760 -3641
  21. package/dist/three-examples.min.js +17 -35
  22. package/dist/three-examples.umd.cjs +16 -34
  23. package/dist/three.js +48533 -28562
  24. package/dist/three.min.js +716 -502
  25. package/dist/three.umd.cjs +720 -506
  26. package/dist/{vendor-CntUvmJu.umd.cjs → vendor-BI4TX0aC.umd.cjs} +9 -9
  27. package/dist/{vendor-DPbfJJ4d.min.js → vendor-BgzAK9of.min.js} +1 -1
  28. package/dist/{vendor-vHLk8sXu.js → vendor-CwL-uvVy.js} +1 -1
  29. package/lib/engine/engine_animation.js +1 -1
  30. package/lib/engine/engine_animation.js.map +1 -1
  31. package/lib/engine/engine_audio.js.map +1 -1
  32. package/lib/engine/engine_context.js +3 -6
  33. package/lib/engine/engine_context.js.map +1 -1
  34. package/lib/engine/engine_create_objects.js +0 -1
  35. package/lib/engine/engine_create_objects.js.map +1 -1
  36. package/lib/engine/engine_element.d.ts +113 -0
  37. package/lib/engine/engine_element.js +833 -0
  38. package/lib/engine/engine_element.js.map +1 -0
  39. package/lib/engine/engine_element_attributes.d.ts +72 -0
  40. package/lib/engine/engine_element_attributes.js +2 -0
  41. package/lib/engine/engine_element_attributes.js.map +1 -0
  42. package/lib/engine/engine_element_extras.d.ts +6 -0
  43. package/lib/engine/engine_element_extras.js +14 -0
  44. package/lib/engine/engine_element_extras.js.map +1 -0
  45. package/lib/engine/engine_element_loading.d.ts +44 -0
  46. package/lib/engine/engine_element_loading.js +350 -0
  47. package/lib/engine/engine_element_loading.js.map +1 -0
  48. package/lib/engine/engine_element_overlay.d.ts +21 -0
  49. package/lib/engine/engine_element_overlay.js +167 -0
  50. package/lib/engine/engine_element_overlay.js.map +1 -0
  51. package/lib/engine/engine_license.js.map +1 -1
  52. package/lib/engine/engine_pmrem.js +2 -2
  53. package/lib/engine/engine_pmrem.js.map +1 -1
  54. package/lib/engine/engine_scenetools.d.ts +62 -0
  55. package/lib/engine/engine_scenetools.js +337 -0
  56. package/lib/engine/engine_scenetools.js.map +1 -0
  57. package/lib/engine/engine_serialization_builtin_serializer.d.ts +1 -1
  58. package/lib/engine/engine_test_utils.d.ts +39 -0
  59. package/lib/engine/engine_test_utils.js +84 -0
  60. package/lib/engine/engine_test_utils.js.map +1 -0
  61. package/lib/engine/engine_three_utils.js.map +1 -1
  62. package/lib/engine/engine_time.js +4 -3
  63. package/lib/engine/engine_time.js.map +1 -1
  64. package/lib/engine/engine_ui.d.ts +25 -0
  65. package/lib/engine/engine_ui.dummy_canvas.d.ts +2 -0
  66. package/lib/engine/engine_ui.dummy_canvas.js +55 -0
  67. package/lib/engine/engine_ui.dummy_canvas.js.map +1 -0
  68. package/lib/engine/engine_ui.js +168 -0
  69. package/lib/engine/engine_ui.js.map +1 -0
  70. package/lib/engine/extensions/NEEDLE_lightmaps.js +2 -2
  71. package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
  72. package/lib/engine/extensions/NEEDLE_pmrem.d.ts +1 -1
  73. package/lib/engine/webcomponents/icons.js +3 -2
  74. package/lib/engine/webcomponents/icons.js.map +1 -1
  75. package/lib/engine/webcomponents/needle-engine.attributes.d.ts +69 -0
  76. package/lib/engine/webcomponents/needle-engine.attributes.js +2 -0
  77. package/lib/engine/webcomponents/needle-engine.attributes.js.map +1 -0
  78. package/lib/engine-components/AudioSource.js +1 -1
  79. package/lib/engine-components/AudioSource.js.map +1 -1
  80. package/lib/engine-components/Light.d.ts +3 -0
  81. package/lib/engine-components/Light.js +39 -31
  82. package/lib/engine-components/Light.js.map +1 -1
  83. package/lib/engine-components/OrbitControls.js +2 -1
  84. package/lib/engine-components/OrbitControls.js.map +1 -1
  85. package/lib/engine-components/SpriteRenderer.d.ts +1 -1
  86. package/lib/engine-components/VideoPlayer.d.ts +1 -1
  87. package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
  88. package/lib/engine-components/export/usdz/extensions/Animation.js +1 -0
  89. package/lib/engine-components/export/usdz/extensions/Animation.js.map +1 -1
  90. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +1 -1
  91. package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
  92. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -1
  93. package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +1 -1
  94. package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
  95. package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
  96. package/lib/engine-components/ui/BaseUIComponent_Uikit.d.ts +54 -0
  97. package/lib/engine-components/ui/BaseUIComponent_Uikit.js +114 -0
  98. package/lib/engine-components/ui/BaseUIComponent_Uikit.js.map +1 -0
  99. package/lib/engine-components/ui/BaseUikitComponent.d.ts +54 -0
  100. package/lib/engine-components/ui/BaseUikitComponent.js +114 -0
  101. package/lib/engine-components/ui/BaseUikitComponent.js.map +1 -0
  102. package/lib/engine-components/ui/Button.legacy.d.ts +68 -0
  103. package/lib/engine-components/ui/Button.legacy.js +320 -0
  104. package/lib/engine-components/ui/Button.legacy.js.map +1 -0
  105. package/lib/engine-components/ui/ButtonUikit.d.ts +51 -0
  106. package/lib/engine-components/ui/ButtonUikit.js +187 -0
  107. package/lib/engine-components/ui/ButtonUikit.js.map +1 -0
  108. package/lib/engine-components/ui/Canvas.js +2 -2
  109. package/lib/engine-components/ui/Canvas.js.map +1 -1
  110. package/lib/engine-components/ui/Canvas.legacy.d.ts +76 -0
  111. package/lib/engine-components/ui/Canvas.legacy.js +409 -0
  112. package/lib/engine-components/ui/Canvas.legacy.js.map +1 -0
  113. package/lib/engine-components/ui/CanvasUikit.d.ts +68 -0
  114. package/lib/engine-components/ui/CanvasUikit.js +289 -0
  115. package/lib/engine-components/ui/CanvasUikit.js.map +1 -0
  116. package/lib/engine-components/ui/Graphic.d.ts +3 -3
  117. package/lib/engine-components/ui/Graphic.js +6 -2
  118. package/lib/engine-components/ui/Graphic.js.map +1 -1
  119. package/lib/engine-components/ui/Graphic.legacy.d.ts +55 -0
  120. package/lib/engine-components/ui/Graphic.legacy.js +268 -0
  121. package/lib/engine-components/ui/Graphic.legacy.js.map +1 -0
  122. package/lib/engine-components/ui/GraphicUikit.d.ts +21 -0
  123. package/lib/engine-components/ui/GraphicUikit.js +65 -0
  124. package/lib/engine-components/ui/GraphicUikit.js.map +1 -0
  125. package/lib/engine-components/ui/Image.js.map +1 -1
  126. package/lib/engine-components/ui/Image.legacy.d.ts +39 -0
  127. package/lib/engine-components/ui/Image.legacy.js +121 -0
  128. package/lib/engine-components/ui/Image.legacy.js.map +1 -0
  129. package/lib/engine-components/ui/ImageUikit.d.ts +22 -0
  130. package/lib/engine-components/ui/ImageUikit.js +97 -0
  131. package/lib/engine-components/ui/ImageUikit.js.map +1 -0
  132. package/lib/engine-components/ui/RenderMode.d.ts +14 -0
  133. package/lib/engine-components/ui/RenderMode.js +16 -0
  134. package/lib/engine-components/ui/RenderMode.js.map +1 -0
  135. package/lib/engine-components/ui/Text.d.ts +64 -11
  136. package/lib/engine-components/ui/Text.js +154 -45
  137. package/lib/engine-components/ui/Text.js.map +1 -1
  138. package/lib/engine-components/ui/Text.legacy.d.ts +81 -0
  139. package/lib/engine-components/ui/Text.legacy.js +548 -0
  140. package/lib/engine-components/ui/Text.legacy.js.map +1 -0
  141. package/lib/engine-components/ui/TextUikit.d.ts +42 -0
  142. package/lib/engine-components/ui/TextUikit.js +164 -0
  143. package/lib/engine-components/ui/TextUikit.js.map +1 -0
  144. package/lib/engine-components/ui/index.d.ts +1 -0
  145. package/lib/engine-components/ui/index.js +1 -0
  146. package/lib/engine-components/ui/index.js.map +1 -1
  147. package/lib/engine-components/webxr/WebARCameraBackground.d.ts +1 -1
  148. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.d.ts +6 -0
  149. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js +46 -0
  150. package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js.map +1 -0
  151. package/package.json +4 -4
  152. package/plugins/common/buildinfo.d.ts +6 -0
  153. package/plugins/vite/ai.d.ts +7 -8
  154. package/plugins/vite/ai.js +95 -20
  155. package/plugins/vite/alias.js +6 -0
  156. package/plugins/vite/dependencies.js +7 -0
  157. package/src/engine/engine_animation.ts +1 -1
  158. package/src/engine/engine_audio.ts +1 -1
  159. package/src/engine/engine_context.ts +3 -6
  160. package/src/engine/engine_create_objects.ts +0 -1
  161. package/src/engine/engine_license.ts +0 -2
  162. package/src/engine/engine_pmrem.ts +3 -3
  163. package/src/engine/engine_three_utils.ts +2 -2
  164. package/src/engine/engine_time.ts +4 -3
  165. package/src/engine/extensions/NEEDLE_lightmaps.ts +3 -3
  166. package/src/engine/webcomponents/icons.ts +3 -2
  167. package/src/engine-components/AudioSource.ts +1 -1
  168. package/src/engine-components/Light.ts +39 -31
  169. package/src/engine-components/OrbitControls.ts +2 -2
  170. package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +2 -2
  171. package/src/engine-components/export/usdz/extensions/Animation.ts +6 -5
  172. package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +1 -1
  173. package/src/engine-components/postprocessing/PostProcessingHandler.ts +3 -3
  174. package/src/engine-components/timeline/TimelineTracks.ts +2 -2
  175. package/src/engine-components/ui/Canvas.ts +2 -2
  176. package/src/engine-components/ui/Graphic.ts +7 -3
  177. package/src/engine-components/ui/Image.ts +1 -1
  178. package/src/engine-components/ui/Text.ts +170 -52
  179. package/src/engine-components/ui/index.ts +2 -1
  180. package/dist/generateMeshBVH.worker-DiCnZlf3.js +0 -21
  181. package/dist/gltf-progressive-BryRjllq.min.js +0 -10
  182. package/dist/gltf-progressive-DJBMx-zB.umd.cjs +0 -10
  183. package/dist/gltf-progressive.worker-BqODMeeW.js +0 -23
@@ -1,11 +1,11 @@
1
- import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,TrianglesDrawMode as qo,TriangleFanDrawMode as ri,TriangleStripDrawMode as Cn,Loader as xt,LoaderUtils as qt,FileLoader as ht,MeshPhysicalMaterial as bt,Vector2 as _e,Color as Be,LinearSRGBColorSpace as Ve,SRGBColorSpace as ce,SpotLight as Bn,PointLight as Ai,DirectionalLight as wn,Matrix4 as le,InstancedMesh as zo,Quaternion as we,InstancedBufferAttribute as Yo,Object3D as It,TextureLoader as ci,ImageBitmapLoader as Ko,BufferAttribute as st,InterleavedBuffer as Jo,LinearMipmapLinearFilter as hs,NearestMipmapLinearFilter as Qn,LinearMipmapNearestFilter as yn,NearestMipmapNearestFilter as li,LinearFilter as it,NearestFilter as Ls,RepeatWrapping as zt,MirroredRepeatWrapping as vn,ClampToEdgeWrapping as Ns,PointsMaterial as gs,Material as ds,LineBasicMaterial as St,MeshStandardMaterial as hi,DoubleSide as gi,PropertyBinding as Dt,BufferGeometry as rt,SkinnedMesh as xn,LineSegments as Us,Line as gt,LineLoop as Vo,Points as Gs,Group as Yt,PerspectiveCamera as Ps,MathUtils as Ee,OrthographicCamera as Sn,Skeleton as Dn,AnimationClip as Rn,Bone as di,InterpolateDiscrete as Tn,InterpolateLinear as pi,InterleavedBufferAttribute as Kt,Texture as ui,VectorKeyframeTrack as fi,NumberKeyframeTrack as mi,QuaternionKeyframeTrack as bi,ColorManagement as We,FrontSide as kn,Interpolant as Wo,Box3 as Os,Sphere as Ii,CompressedCubeTexture as Xo,CompressedArrayTexture as Zo,CompressedTexture as ps,NoColorSpace as Hs,RGBA_BPTC_Format as Ei,RGBA_S3TC_DXT5_Format as Ci,RGBA_S3TC_DXT3_Format as Mn,RGB_S3TC_DXT1_Format as Fn,RGBA_S3TC_DXT1_Format as Bi,RGBA_ASTC_6x6_Format as _n,RGBA_ASTC_4x4_Format as js,RGBA_ETC2_EAC_Format as Ln,RGB_ETC2_Format as Nn,RGBFormat as wi,RedFormat as ts,RGFormat as us,RGBAFormat as Nt,UnsignedByteType as dt,HalfFloatType as Xe,UnsignedInt101111Type as Un,UnsignedInt5999Type as Gn,FloatType as pt,DataTexture as $o,Data3DTexture as er,RGB_PVRTC_4BPPV1_Format as tr,RGB_ETC1_Format as sr,RGBA_PVRTC_4BPPV1_Format as ir,RGB_BPTC_UNSIGNED_Format as nr,NodeFrame as ar,ShaderLib as Et,ExtrudeGeometry as or,ShapePath as rr,DataTextureLoader as Pn,DataUtils as ss,CylinderGeometry as Ze,BoxGeometry as Ye,Float32BufferAttribute as Te,OctahedronGeometry as qs,TorusGeometry as fs,Euler as Ut,Controls as On,Raycaster as Qi,PlaneGeometry as yi,MOUSE as is,TOUCH as ns,Spherical as Hn,Ray as Ar,Plane as cr,ShaderMaterial as jn,Uniform$1 as lr,Scene as vi,WebGLRenderer as hr,CanvasTexture as qn,REVISION as gr,Source as dr,InstancedBufferGeometry as pr,InstancedInterleavedBuffer as xi,WireframeGeometry as ur,UniformsUtils as zn,UniformsLib as zs,Vector4 as Rt,Line3 as fr,Matrix3 as Yn,Curve as mr,MeshPhongMaterial as ms,MeshLambertMaterial as br,EquirectangularReflectionMapping as Ir,AmbientLight as Er,Uint16BufferAttribute as Cr,ShapeUtils as Br,DefaultLoadingManager as wr}from"./three.min.js";class Qr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new oi(i,2*s,s);n.scale(1,1,-1);const a=n.getAttribute("position"),r=new N;for(let A=0;A<a.count;++A)if(r.fromBufferAttribute(a,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(a.array,3*A)}a.needsUpdate=!0,super(n,new mt({map:e,depthWrite:!1}))}}function yr(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},i=o.getIndex(),s=o.getAttribute("position"),n=i?i.count:s.count;let a=0;const r=Object.keys(o.attributes),A={},c={},l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let E=0,C=r.length;E<C;E++){const Q=r[E],w=o.attributes[Q];A[Q]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[Q];x&&(c[Q]||(c[Q]=[]),x.forEach((D,S)=>{const F=new D.array.constructor(D.count*D.itemSize);c[Q][S]=new D.constructor(F,D.itemSize,D.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),m=p*b;for(let E=0;E<n;E++){const C=i?i.getX(E):E;let Q="";for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),F=S.itemSize;for(let Y=0;Y<F;Y++)Q+=`${~~(S[h[Y]](C)*b+m)},`}if(Q in t)l.push(t[Q]);else{for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),F=o.morphAttributes[D],Y=S.itemSize,V=A[D],K=c[D];for(let W=0;W<Y;W++){const j=h[W],X=d[W];if(V[X](a,S[j](C)),F)for(let J=0,ee=F.length;J<ee;J++)K[J][X](a,F[J][j](C))}}t[Q]=a,l.push(a),a++}}const I=o.clone();for(const E in o.attributes){const C=A[E];if(I.setAttribute(E,new C.constructor(C.array.slice(0,a*C.itemSize),C.itemSize,C.normalized)),E in c)for(let Q=0;Q<c[E].length;Q++){const w=c[E][Q];I.morphAttributes[E][Q]=new w.constructor(w.array.slice(0,a*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function Kn(o,e){if(e===qo)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===ri||e===Cn){let t=o.getIndex();if(t===null){const a=[],r=o.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)a.push(A);o.setIndex(a),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const i=t.count-2,s=[];if(e===ri)for(let a=1;a<=i;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<i;a++)a%2===0?(s.push(t.getX(a)),s.push(t.getX(a+1)),s.push(t.getX(a+2))):(s.push(t.getX(a+2)),s.push(t.getX(a+1)),s.push(t.getX(a)));s.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const n=o.clone();return n.setIndex(s),n.clearGroups(),n}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class Si extends xt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Rr(t)}),this.register(function(t){return new Tr(t)}),this.register(function(t){return new Pr(t)}),this.register(function(t){return new Or(t)}),this.register(function(t){return new Hr(t)}),this.register(function(t){return new Mr(t)}),this.register(function(t){return new Fr(t)}),this.register(function(t){return new _r(t)}),this.register(function(t){return new Lr(t)}),this.register(function(t){return new Dr(t)}),this.register(function(t){return new Nr(t)}),this.register(function(t){return new kr(t)}),this.register(function(t){return new Gr(t)}),this.register(function(t){return new Ur(t)}),this.register(function(t){return new xr(t)}),this.register(function(t){return new jr(t)}),this.register(function(t){return new qr(t)})}load(e,t,i,s){const n=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=qt.extractUrlBase(e);a=qt.resolveURL(c,this.path)}else a=qt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){s?s(c):console.error(c),n.manager.itemError(e),n.manager.itemEnd(e)},A=new ht(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{n.parse(c,a,function(l){t(l),n.manager.itemEnd(e)},r)}catch(l){r(l)}},i,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let n,a;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{n=JSON.parse(e)}catch(h){a=e,s&&s(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===Jn){try{r[ne.KHR_BINARY_GLTF]=new zr(e)}catch(h){s&&s(h);return}try{n=JSON.parse(r[ne.KHR_BINARY_GLTF].content)}catch(h){a=r[ne.KHR_BINARY_GLTF].content,s&&s(h);return}}else try{n=JSON.parse(c.decode(e))}catch(h){a=c.decode(e),s&&s(h);return}else n=e;if(n.asset===void 0||n.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=n,this.jsonErrorData=a;const l=new nA(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const d=this.pluginCallbacks[h](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(n.extensionsUsed)for(let h=0;h<n.extensionsUsed.length;++h){const d=n.extensionsUsed[h],p=n.extensionsRequired||[];switch(d){case ne.KHR_MATERIALS_UNLIT:r[d]=new Sr;break;case ne.KHR_DRACO_MESH_COMPRESSION:r[d]=new Yr(n,this.dracoLoader);break;case ne.KHR_TEXTURE_TRANSFORM:r[d]=new Kr;break;case ne.KHR_MESH_QUANTIZATION:r[d]=new Jr;break;default:p.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(r),l.setPlugins(A),l.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,t,s,n)})}}function vr(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const ne={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class xr{constructor(e){this.parser=e,this.name=ne.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i<s;i++){const n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let s=t.cache.get(i);if(s)return s;const n=t.json,a=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e];let r;const A=new Be(16777215);a.color!==void 0&&A.setRGB(a.color[0],a.color[1],a.color[2],Ve);const c=a.range!==void 0?a.range:0;switch(a.type){case"directional":r=new wn(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new Ai(A),r.distance=c;break;case"spot":r=new Bn(A),r.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle!==void 0?a.spot.innerConeAngle:0,a.spot.outerConeAngle=a.spot.outerConeAngle!==void 0?a.spot.outerConeAngle:Math.PI/4,r.angle=a.spot.outerConeAngle,r.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return r.position.set(0,0,0),r.decay=2,Tt(r,a),a.intensity!==void 0&&(r.intensity=a.intensity),r.name=t.createUniqueName(a.name||"light_"+e),s=Promise.resolve(r),t.cache.add(i,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],n=(s.extensions&&s.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(a){return i._getNodeRef(t.cache,n,a)})}}let Sr=class{constructor(){this.name=ne.KHR_MATERIALS_UNLIT}getMaterialType(){return mt}extendParams(o,e,t){const i=[];o.color=new Be(1,1,1),o.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const n=s.baseColorFactor;o.color.setRGB(n[0],n[1],n[2],Ve),o.opacity=n[3]}s.baseColorTexture!==void 0&&i.push(t.assignTexture(o,"map",s.baseColorTexture,ce))}return Promise.all(i)}},Dr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name].emissiveStrength;return i!==void 0&&(e.emissiveIntensity=i),Promise.resolve()}},Rr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_CLEARCOAT}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];if(n.clearcoatFactor!==void 0&&(e.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(s.push(t.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){const a=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new _e(a,a)}return Promise.all(s)}},Tr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_DISPERSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name];return e.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},kr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IRIDESCENCE}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.iridescenceFactor!==void 0&&(e.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(e.iridescenceIOR=n.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(s)}},Mr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SHEEN}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new Be(0,0,0),e.sheenRoughness=0,e.sheen=1;const n=i.extensions[this.name];if(n.sheenColorFactor!==void 0){const a=n.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],Ve)}return n.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&s.push(t.assignTexture(e,"sheenColorMap",n.sheenColorTexture,ce)),n.sheenRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(s)}},Fr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_TRANSMISSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.transmissionFactor!==void 0&&(e.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&s.push(t.assignTexture(e,"transmissionMap",n.transmissionTexture)),Promise.all(s)}},_r=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_VOLUME}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&s.push(t.assignTexture(e,"thicknessMap",n.thicknessTexture)),e.attenuationDistance=n.attenuationDistance||1/0;const a=n.attenuationColor||[1,1,1];return e.attenuationColor=new Be().setRGB(a[0],a[1],a[2],Ve),Promise.all(s)}},Lr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IOR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name];return e.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},Nr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SPECULAR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&s.push(t.assignTexture(e,"specularIntensityMap",n.specularTexture));const a=n.specularColorFactor||[1,1,1];return e.specularColor=new Be().setRGB(a[0],a[1],a[2],Ve),n.specularColorTexture!==void 0&&s.push(t.assignTexture(e,"specularColorMap",n.specularColorTexture,ce)),Promise.all(s)}},Ur=class{constructor(o){this.parser=o,this.name=ne.EXT_MATERIALS_BUMP}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return e.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&s.push(t.assignTexture(e,"bumpMap",n.bumpTexture)),Promise.all(s)}},Gr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_ANISOTROPY}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.anisotropyStrength!==void 0&&(e.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(e.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&s.push(t.assignTexture(e,"anisotropyMap",n.anisotropyTexture)),Promise.all(s)}};class Pr{constructor(e){this.parser=e,this.name=ne.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const n=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,a)}}class Or{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Hr{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class jr{constructor(e){this.name=ne.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],n=this.parser.getDependency("buffer",s.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then(function(r){const A=s.byteOffset||0,c=s.byteLength||0,l=s.count,h=s.byteStride,d=new Uint8Array(r,A,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(l,h,d,s.mode,s.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(l*h);return a.decodeGltfBuffer(new Uint8Array(p),l,h,d,s.mode,s.filter),p})})}else return null}}let qr=class{constructor(o){this.name=ne.EXT_MESH_GPU_INSTANCING,this.parser=o}createNodeMesh(o){const e=this.parser.json,t=e.nodes[o];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const i=e.meshes[t.mesh];for(const r of i.primitives)if(r.mode!==At.TRIANGLES&&r.mode!==At.TRIANGLE_STRIP&&r.mode!==At.TRIANGLE_FAN&&r.mode!==void 0)return null;const s=t.extensions[this.name].attributes,n=[],a={};for(const r in s)n.push(this.parser.getDependency("accessor",s[r]).then(A=>(a[r]=A,a[r])));return n.length<1?null:(n.push(this.parser.createNodeMesh(o)),Promise.all(n).then(r=>{const A=r.pop(),c=A.isGroup?A.children:[A],l=r[0].count,h=[];for(const d of c){const p=new le,f=new N,b=new we,m=new N(1,1,1),I=new zo(d.geometry,d.material,l);for(let E=0;E<l;E++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,E),a.ROTATION&&b.fromBufferAttribute(a.ROTATION,E),a.SCALE&&m.fromBufferAttribute(a.SCALE,E),I.setMatrixAt(E,p.compose(f,b,m));for(const E in a)if(E==="_COLOR_0"){const C=a[E];I.instanceColor=new Yo(C.array,C.itemSize,C.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&d.geometry.setAttribute(E,a[E]);It.prototype.copy.call(I,d),this.parser.assignFinalMaterial(I),h.push(I)}return A.isGroup?(A.clear(),A.add(...h),A):h[0]}))}};const Jn="glTF",bs=12,Vn={JSON:1313821514,BIN:5130562};class zr{constructor(e){this.name=ne.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,bs),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Jn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-bs,n=new DataView(e,bs);let a=0;for(;a<s;){const r=n.getUint32(a,!0);a+=4;const A=n.getUint32(a,!0);if(a+=4,A===Vn.JSON){const c=new Uint8Array(e,bs+a,r);this.content=i.decode(c)}else if(A===Vn.BIN){const c=bs+a;this.body=e.slice(c,c+r)}a+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Yr{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ne.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,s=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,r={},A={},c={};for(const l in a){const h=Ri[l]||l.toLowerCase();r[h]=a[l]}for(const l in e.attributes){const h=Ri[l]||l.toLowerCase();if(a[l]!==void 0){const d=i.accessors[e.attributes[l]],p=as[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",n).then(function(l){return new Promise(function(h,d){s.decodeDracoFile(l,function(p){for(const f in p.attributes){const b=p.attributes[f],m=A[f];m!==void 0&&(b.normalized=m)}h(p)},r,c,Ve,d)})})}}class Kr{constructor(){this.name=ne.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Jr{constructor(){this.name=ne.KHR_MESH_QUANTIZATION}}class Wn extends Wo{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,n=e*s*3+s;for(let a=0;a!==s;a++)t[a]=i[n+a];return t}interpolate_(e,t,i,s){const n=this.resultBuffer,a=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=s-t,h=(i-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,m=-2*p+3*d,I=p-d,E=1-m,C=I-d+h;for(let Q=0;Q!==r;Q++){const w=a[b+Q+r],x=a[b+Q+A]*l,D=a[f+Q+r],S=a[f+Q]*l;n[Q]=E*w+C*x+m*D+I*S}return n}}const Vr=new we;class Wr extends Wn{interpolate_(e,t,i,s){const n=super.interpolate_(e,t,i,s);return Vr.fromArray(n).normalize().toArray(n),n}}const At={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},as={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Xn={9728:Ls,9729:it,9984:li,9985:yn,9986:Qn,9987:hs},Zn={33071:Ns,33648:vn,10497:zt},Di={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ri={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Xr={CUBICSPLINE:void 0,LINEAR:pi,STEP:Tn},Ti={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Zr(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new hi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:kn})),o.DefaultMaterial}function Jt(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Tt(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $r(o,e,t){let i=!1,s=!1,n=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(s=!0),h.COLOR_0!==void 0&&(n=!0),i&&s&&n)break}if(!i&&!s&&!n)return Promise.resolve(o);const a=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(i){const d=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):o.attributes.position;a.push(d)}if(s){const d=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):o.attributes.normal;r.push(d)}if(n){const d=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):o.attributes.color;A.push(d)}}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A)]).then(function(c){const l=c[0],h=c[1],d=c[2];return i&&(o.morphAttributes.position=l),s&&(o.morphAttributes.normal=h),n&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function eA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let i=0,s=t.length;i<s;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function tA(o){let e;const t=o.extensions&&o.extensions[ne.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+ki(t.attributes):e=o.indices+":"+ki(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,s=o.targets.length;i<s;i++)e+=":"+ki(o.targets[i]);return e}function ki(o){let e="";const t=Object.keys(o).sort();for(let i=0,s=t.length;i<s;i++)e+=t[i]+":"+o[t[i]]+";";return e}function Mi(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function sA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const iA=new le;class nA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new vr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,s=-1,n=!1,a=-1;if(typeof navigator<"u"){const r=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);s=i&&A?parseInt(A[1],10):-1,n=r.indexOf("Firefox")>-1,a=n?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||n&&a<98?this.textureLoader=new ci(this.options.manager):this.textureLoader=new Ko(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ht(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,s=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(a){const r={scene:a[0][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:i,userData:{}};return Jt(n,r,s),Tt(r,s),Promise.all(i._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,n=t.length;s<n;s++){const a=t[s].joints;for(let r=0,A=a.length;r<A;r++)e[a[r]].isBone=!0}for(let s=0,n=e.length;s<n;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(i[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const s=i.clone(),n=(a,r)=>{const A=this.associations.get(a);A!=null&&this.associations.set(r,A);for(const[c,l]of a.children.entries())n(l,r.children[c])};return n(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const s=e(t[i]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let s=0;s<t.length;s++){const n=e(t[s]);n&&i.push(n)}return i}getDependency(e,t){const i=e+":"+t;let s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":s=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(n,a){return i.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ne.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(n,a){i.load(qt.resolveURL(t.uri,s.path),n,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const s=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+s)})}loadAccessor(e){const t=this,i=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Di[s.type],r=as[s.componentType],A=s.normalized===!0,c=new r(s.count*a);return Promise.resolve(new st(c,a,A))}const n=[];return s.bufferView!==void 0?n.push(this.getDependency("bufferView",s.bufferView)):n.push(null),s.sparse!==void 0&&(n.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(n).then(function(a){const r=a[0],A=Di[s.type],c=as[s.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=s.byteOffset||0,p=s.bufferView!==void 0?i.bufferViews[s.bufferView].byteStride:void 0,f=s.normalized===!0;let b,m;if(p&&p!==h){const I=Math.floor(d/p),E="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+I+":"+s.count;let C=t.cache.get(E);C||(b=new c(r,I*p,s.count*p/l),C=new Jo(b,p/l),t.cache.add(E,C)),m=new Kt(C,A,d%p/l,f)}else r===null?b=new c(s.count*A):b=new c(r,d,s.count*A),m=new st(b,A,f);if(s.sparse!==void 0){const I=Di.SCALAR,E=as[s.sparse.indices.componentType],C=s.sparse.indices.byteOffset||0,Q=s.sparse.values.byteOffset||0,w=new E(a[1],C,s.sparse.count*I),x=new c(a[2],Q,s.sparse.count*A);r!==null&&(m=new st(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let D=0,S=w.length;D<S;D++){const F=w[D];if(m.setX(F,x[D*A]),A>=2&&m.setY(F,x[D*A+1]),A>=3&&m.setZ(F,x[D*A+2]),A>=4&&m.setW(F,x[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=f}return m})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,n=t.images[s];let a=this.textureLoader;if(n.uri){const r=i.manager.getHandler(n.uri);r!==null&&(a=r)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const s=this,n=this.json,a=n.textures[e],r=n.images[t],A=(r.uri||r.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,i).then(function(l){l.flipY=!1,l.name=a.name||r.name||"",l.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(l.name=r.uri);const h=(n.samplers||{})[a.sampler]||{};return l.magFilter=Xn[h.magFilter]||it,l.minFilter=Xn[h.minFilter]||hs,l.wrapS=Zn[h.wrapS]||zt,l.wrapT=Zn[h.wrapT]||zt,l.anisotropy=4,s.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const i=this,s=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const a=s.images[e],r=self.URL||self.webkitURL;let A=a.uri||"",c=!1;if(a.bufferView!==void 0)A=i.getDependency("bufferView",a.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:a.mimeType});return A=r.createObjectURL(d),A});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(A).then(function(h){return new Promise(function(d,p){let f=d;t.isImageBitmapLoader===!0&&(f=function(b){const m=new ui(b);m.needsUpdate=!0,d(m)}),t.load(qt.resolveURL(h,n.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),Tt(h,a),h.userData.mimeType=a.mimeType||sA(a.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),h});return this.sourceCache[e]=l,l}assignTexture(e,t,i,s){const n=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),n.extensions[ne.KHR_TEXTURE_TRANSFORM]){const r=i.extensions!==void 0?i.extensions[ne.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=n.associations.get(a);a=n.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(a,r),n.associations.set(a,A)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new gs,ds.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(r,A)),i=A}else if(e.isLine){const r="LineBasicMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new St,ds.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,this.cache.add(r,A)),i=A}if(s||n||a){let r="ClonedMaterial:"+i.uuid+":";s&&(r+="derivative-tangents:"),n&&(r+="vertex-colors:"),a&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=i.clone(),n&&(A.vertexColors=!0),a&&(A.flatShading=!0),s&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(i))),i=A}e.material=i}getMaterialType(){return hi}loadMaterial(e){const t=this,i=this.json,s=this.extensions,n=i.materials[e];let a;const r={},A=n.extensions||{},c=[];if(A[ne.KHR_MATERIALS_UNLIT]){const h=s[ne.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),c.push(h.extendParams(r,n,t))}else{const h=n.pbrMetallicRoughness||{};if(r.color=new Be(1,1,1),r.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],Ve),r.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(r,"map",h.baseColorTexture,ce)),r.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,r.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(r,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(r,"roughnessMap",h.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}n.doubleSided===!0&&(r.side=gi);const l=n.alphaMode||Ti.OPAQUE;if(l===Ti.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Ti.MASK&&(r.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&a!==mt&&(c.push(t.assignTexture(r,"normalMap",n.normalTexture)),r.normalScale=new _e(1,1),n.normalTexture.scale!==void 0)){const h=n.normalTexture.scale;r.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&a!==mt&&(c.push(t.assignTexture(r,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&a!==mt){const h=n.emissiveFactor;r.emissive=new Be().setRGB(h[0],h[1],h[2],Ve)}return n.emissiveTexture!==void 0&&a!==mt&&c.push(t.assignTexture(r,"emissiveMap",n.emissiveTexture,ce)),Promise.all(c).then(function(){const h=new a(r);return n.name&&(h.name=n.name),Tt(h,n),t.associations.set(h,{materials:e}),n.extensions&&Jt(s,h,n),h})}createUniqueName(e){const t=Dt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function n(r){return i[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return $n(A,r,t)})}const a=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=tA(c),h=s[l];if(h)a.push(h.promise);else{let d;c.extensions&&c.extensions[ne.KHR_DRACO_MESH_COMPRESSION]?d=n(c):d=$n(new rt,c,t),s[l]={primitive:c,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,i=this.json,s=this.extensions,n=i.meshes[e],a=n.primitives,r=[];for(let A=0,c=a.length;A<c;A++){const l=a[A].material===void 0?Zr(this.cache):this.getDependency("material",a[A].material);r.push(l)}return r.push(t.loadGeometries(a)),Promise.all(r).then(function(A){const c=A.slice(0,A.length-1),l=A[A.length-1],h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p],m=a[p];let I;const E=c[p];if(m.mode===At.TRIANGLES||m.mode===At.TRIANGLE_STRIP||m.mode===At.TRIANGLE_FAN||m.mode===void 0)I=n.isSkinnedMesh===!0?new xn(b,E):new O(b,E),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),m.mode===At.TRIANGLE_STRIP?I.geometry=Kn(I.geometry,Cn):m.mode===At.TRIANGLE_FAN&&(I.geometry=Kn(I.geometry,ri));else if(m.mode===At.LINES)I=new Us(b,E);else if(m.mode===At.LINE_STRIP)I=new gt(b,E);else if(m.mode===At.LINE_LOOP)I=new Vo(b,E);else if(m.mode===At.POINTS)I=new Gs(b,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(I.geometry.morphAttributes).length>0&&eA(I,n),I.name=t.createUniqueName(n.name||"mesh_"+e),Tt(I,n),m.extensions&&Jt(s,I,m),t.assignFinalMaterial(I),h.push(I)}for(let p=0,f=h.length;p<f;p++)t.associations.set(h[p],{meshes:e,primitives:p});if(h.length===1)return n.extensions&&Jt(s,h[0],n),h[0];const d=new Yt;n.extensions&&Jt(s,d,n),t.associations.set(d,{meshes:e});for(let p=0,f=h.length;p<f;p++)d.add(h[p]);return d})}loadCamera(e){let t;const i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Ps(Ee.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):i.type==="orthographic"&&(t=new Sn(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Tt(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let s=0,n=t.joints.length;s<n;s++)i.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(s){const n=s.pop(),a=s,r=[],A=[];for(let c=0,l=a.length;c<l;c++){const h=a[c];if(h){r.push(h);const d=new le;n!==null&&d.fromArray(n.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Dn(r,A)})}loadAnimation(e){const t=this.json,i=this,s=t.animations[e],n=s.name?s.name:"animation_"+e,a=[],r=[],A=[],c=[],l=[];let h=0,d=s.channels.length;for(h=0,d=s.channels.length;h<d;h++){const p=s.channels[h],f=s.samplers[p.sampler],b=p.target,m=b.node,I=s.parameters!==void 0?s.parameters[f.input]:f.input,E=s.parameters!==void 0?s.parameters[f.output]:f.output;b.node!==void 0&&(a.push(this.getDependency("node",m)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",E)),c.push(f),l.push(b))}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l)]).then(function(p){const f=p[0],b=p[1],m=p[2],I=p[3],E=p[4],C=[];for(h=0,d=f.length;h<d;h++){const Q=f[h],w=b[h],x=m[h],D=I[h],S=E[h];if(Q===void 0)continue;Q.updateMatrix&&Q.updateMatrix();const F=i._createAnimationTracks(Q,w,x,D,S);if(F)for(let Y=0;Y<F.length;Y++)C.push(F[Y])}return new Rn(n,void 0,C)})}createNodeMesh(e){const t=this.json,i=this,s=t.nodes[e];return s.mesh===void 0?null:i.getDependency("mesh",s.mesh).then(function(n){const a=i._getNodeRef(i.meshCache,s.mesh,n);return s.weights!==void 0&&a.traverse(function(r){if(r.isMesh)for(let A=0,c=s.weights.length;A<c;A++)r.morphTargetInfluences[A]=s.weights[A]}),a})}loadNode(e){const t=this.json,i=this,s=t.nodes[e],n=i._loadNodeShallow(e),a=[],r=s.children||[];for(let c=0,l=r.length;c<l;c++)a.push(i.getDependency("node",r[c]));const A=s.skin===void 0?Promise.resolve(null):i.getDependency("skin",s.skin);return Promise.all([n,Promise.all(a),A]).then(function(c){const l=c[0],h=c[1],d=c[2];d!==null&&l.traverse(function(p){p.isSkinnedMesh&&p.bind(d,iA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,i=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const n=t.nodes[e],a=n.name?s.createUniqueName(n.name):"",r=[],A=s._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),n.camera!==void 0&&r.push(s.getDependency("camera",n.camera).then(function(c){return s._getNodeRef(s.cameraCache,n.camera,c)})),s._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){r.push(c)}),this.nodeCache[e]=Promise.all(r).then(function(c){let l;if(n.isBone===!0?l=new di:c.length>1?l=new Yt:c.length===1?l=c[0]:l=new It,l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(n.name&&(l.userData.name=n.name,l.name=a),Tt(l,n),n.extensions&&Jt(i,l,n),n.matrix!==void 0){const h=new le;h.fromArray(n.matrix),l.applyMatrix4(h)}else n.translation!==void 0&&l.position.fromArray(n.translation),n.rotation!==void 0&&l.quaternion.fromArray(n.rotation),n.scale!==void 0&&l.scale.fromArray(n.scale);return s.associations.has(l)||s.associations.set(l,{}),s.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],s=this,n=new Yt;i.name&&(n.name=s.createUniqueName(i.name)),Tt(n,i),i.extensions&&Jt(t,n,i);const a=i.nodes||[],r=[];for(let A=0,c=a.length;A<c;A++)r.push(s.getDependency("node",a[A]));return Promise.all(r).then(function(A){for(let l=0,h=A.length;l<h;l++)n.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of s.associations)(d instanceof ds||d instanceof ui)&&h.set(d,p);return l.traverse(d=>{const p=s.associations.get(d);p!=null&&h.set(d,p)}),h};return s.associations=c(n),n})}_createAnimationTracks(e,t,i,s,n){const a=[],r=e.name?e.name:e.uuid,A=[];Gt[n.path]===Gt.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(Gt[n.path]){case Gt.weights:c=mi;break;case Gt.rotation:c=bi;break;case Gt.position:case Gt.scale:c=fi;break;default:i.itemSize===1?c=mi:c=fi;break}const l=s.interpolation!==void 0?Xr[s.interpolation]:pi,h=this._getArrayFromAccessor(i);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+Gt[n.path],t.array,h,l);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),a.push(f)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=Mi(t.constructor),s=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n++)s[n]=t[n]*i;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const i=this instanceof bi?Wr:Wn;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function aA(o,e,t){const i=e.attributes,s=new Os;if(i.POSITION!==void 0){const r=t.json.accessors[i.POSITION],A=r.min,c=r.max;if(A!==void 0&&c!==void 0){if(s.set(new N(A[0],A[1],A[2]),new N(c[0],c[1],c[2])),r.normalized){const l=Mi(as[r.componentType]);s.min.multiplyScalar(l),s.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const n=e.targets;if(n!==void 0){const r=new N,A=new N;for(let c=0,l=n.length;c<l;c++){const h=n[c];if(h.POSITION!==void 0){const d=t.json.accessors[h.POSITION],p=d.min,f=d.max;if(p!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(f[2]))),d.normalized){const b=Mi(as[d.componentType]);A.multiplyScalar(b)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(r)}o.boundingBox=s;const a=new Ii;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,o.boundingSphere=a}function $n(o,e,t){const i=e.attributes,s=[];function n(a,r){return t.getDependency("accessor",a).then(function(A){o.setAttribute(r,A)})}for(const a in i){const r=Ri[a]||a.toLowerCase();r in o.attributes||s.push(n(i[a],r))}if(e.indices!==void 0&&!o.index){const a=t.getDependency("accessor",e.indices).then(function(r){o.setIndex(r)});s.push(a)}return We.workingColorSpace!==Ve&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${We.workingColorSpace}" not supported.`),Tt(o,e),aA(o,e,t),Promise.all(s).then(function(){return e.targets!==void 0?$r(o,e.targets,t):o})}var oA=function(){var o="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:o,n,a=WebAssembly.instantiate(r(s),{}).then(function(I){n=I.instance,n.exports.__wasm_call_ctors()});function r(I){for(var E=new Uint8Array(I.length),C=0;C<I.length;++C){var Q=I.charCodeAt(C);E[C]=Q>96?Q-97:Q>64?Q-39:Q+4}for(var w=0,C=0;C<I.length;++C)E[w++]=E[C]<60?i[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,w)}function A(I,E,C,Q,w,x){var D=n.exports.sbrk,S=C+3&-4,F=D(S*Q),Y=D(w.length),V=new Uint8Array(n.exports.memory.buffer);V.set(w,Y);var K=I(F,C,Q,Y,w.length);if(K==0&&x&&x(F,S,Q),E.set(V.subarray(F,F+C*Q)),D(F-D(0)),K!=0)throw new Error("Malformed buffer data: "+K)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],d=0;function p(I){var E={object:new Worker(I),pending:0,requests:{}};return E.object.onmessage=function(C){var Q=C.data;E.pending-=Q.count,E.requests[Q.id][Q.action](Q.value),delete E.requests[Q.id]},E}function f(I){for(var E="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+m.toString(),C=new Blob([E],{type:"text/javascript"}),Q=URL.createObjectURL(C),w=0;w<I;++w)h[w]=p(Q);URL.revokeObjectURL(Q)}function b(I,E,C,Q,w){for(var x=h[0],D=1;D<h.length;++D)h[D].pending<x.pending&&(x=h[D]);return new Promise(function(S,F){var Y=new Uint8Array(C),V=d++;x.pending+=I,x.requests[V]={resolve:S,reject:F},x.object.postMessage({id:V,count:I,size:E,source:Y,mode:Q,filter:w},[Y.buffer])})}function m(I){a.then(function(){var E=I.data;try{var C=new Uint8Array(E.count*E.size);A(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(Q){self.postMessage({id:E.id,count:E.count,action:"reject",value:Q})}})}return{ready:a,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,E,C,Q,w){A(n.exports.meshopt_decodeVertexBuffer,I,E,C,Q,n.exports[c[w]])},decodeIndexBuffer:function(I,E,C,Q){A(n.exports.meshopt_decodeIndexBuffer,I,E,C,Q)},decodeIndexSequence:function(I,E,C,Q){A(n.exports.meshopt_decodeIndexSequence,I,E,C,Q)},decodeGltfBuffer:function(I,E,C,Q,w,x){A(n.exports[l[w]],I,E,C,Q,n.exports[c[x]])},decodeGltfBufferAsync:function(I,E,C,Q,w){return h.length>0?b(I,E,C,l[Q],c[w]):a.then(function(){var x=new Uint8Array(I*E);return A(n.exports[l[Q]],x,I,E,C,n.exports[c[w]]),x})}}}();const Fi=new WeakMap;class rA extends xt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,s){const n=new ht(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,ce,i).catch(i)}decodeDracoFile(e,t,i,s,n=Ve,a=()=>{}){const r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:n};return this.decodeGeometry(e,r).then(t).catch(a)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Fi.has(e)){const A=Fi.get(e);if(A.key===i)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const n=this.workerNextTaskID++,a=e.byteLength,r=this._getWorker(n,a).then(A=>(s=A,new Promise((c,l)=>{s._callbacks[n]={resolve:c,reject:l},s.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{s&&n&&this._releaseTask(s,n)}),Fi.set(e,{key:i,promise:r}),r}_createGeometry(e){const t=new rt;e.index&&t.setIndex(new st(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const s=e.attributes[i],n=s.name,a=s.array,r=s.itemSize,A=new st(a,r);n==="color"&&(this._assignVertexColorSpace(A,s.vertexColorSpace),A.normalized=!(a instanceof Float32Array)),t.setAttribute(n,A)}return t}_assignVertexColorSpace(e,t){if(t!==ce)return;const i=new Be;for(let s=0,n=e.count;s<n;s++)i.fromBufferAttribute(e,s),We.toWorkingColorSpace(i,ce),e.setXYZ(s,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new ht(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((s,n)=>{i.load(e,s,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const s=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const n=AA.toString(),a=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(`
2
- `);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(n){const a=n.data;switch(a.type){case"decode":s._callbacks[a.id].resolve(a);break;case"error":s._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,n){return s._taskLoad>n._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function AA(){let o,e;onmessage=function(a){const r=a.data;switch(r.type){case"init":o=r.decoderConfig,e=new Promise(function(l){o.onModuleLoaded=function(h){l({draco:h})},DracoDecoderModule(o)});break;case"decode":const A=r.buffer,c=r.taskConfig;e.then(l=>{const h=l.draco,d=new h.Decoder;try{const p=t(h,d,new Int8Array(A),c),f=p.attributes.map(b=>b.array.buffer);p.index&&f.push(p.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:p},f)}catch(p){console.error(p),self.postMessage({type:"error",id:r.id,error:p.message})}finally{h.destroy(d)}});break}};function t(a,r,A,c){const l=c.attributeIDs,h=c.attributeTypes;let d,p;const f=r.GetEncodedGeometryType(A);if(f===a.TRIANGULAR_MESH)d=new a.Mesh,p=r.DecodeArrayToMesh(A,A.byteLength,d);else if(f===a.POINT_CLOUD)d=new a.PointCloud,p=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const b={index:null,attributes:[]};for(const m in l){const I=self[h[m]];let E,C;if(c.useUniqueIDs)C=l[m],E=r.GetAttributeByUniqueId(d,C);else{if(C=r.GetAttributeId(d,a[l[m]]),C===-1)continue;E=r.GetAttribute(d,C)}const Q=s(a,r,d,m,I,E);m==="color"&&(Q.vertexColorSpace=c.vertexColorSpace),b.attributes.push(Q)}return f===a.TRIANGULAR_MESH&&(b.index=i(a,r,d)),a.destroy(d),b}function i(a,r,A){const c=A.num_faces()*3,l=c*4,h=a._malloc(l);r.GetTrianglesUInt32Array(A,l,h);const d=new Uint32Array(a.HEAPF32.buffer,h,c).slice();return a._free(h),{array:d,itemSize:1}}function s(a,r,A,c,l,h){const d=h.num_components(),p=A.num_points()*d,f=p*l.BYTES_PER_ELEMENT,b=n(a,l),m=a._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,m);const I=new l(a.HEAPF32.buffer,m,p).slice();return a._free(m),{name:c,array:I,itemSize:d}}function n(a,r){switch(r){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class cA{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:s,msg:n,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(n,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const lA=0,ea=2,hA=1,ta=2,gA=0,dA=1,pA=10,uA=0,sa=9,ia=15,na=16,aa=22,oa=37,ra=43,Aa=76,ca=83,la=97,ha=100,ga=103,da=109,pa=122,ua=123,fA=131,mA=132,bA=133,IA=134,EA=137,CA=138,BA=141,wA=142,QA=145,yA=146,fa=148,ma=152,vA=157,xA=158,ba=165,Ia=166,_i=1000066e3;class Is{constructor(e,t,i,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const i=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,s)}}const Ke=[171,75,84,88,32,50,48,187,13,10,26,10];function Ea(o){return new TextDecoder().decode(o)}function SA(o){const e=new Uint8Array(o.buffer,o.byteOffset,Ke.length);if(e[0]!==Ke[0]||e[1]!==Ke[1]||e[2]!==Ke[2]||e[3]!==Ke[3]||e[4]!==Ke[4]||e[5]!==Ke[5]||e[6]!==Ke[6]||e[7]!==Ke[7]||e[8]!==Ke[8]||e[9]!==Ke[9]||e[10]!==Ke[10]||e[11]!==Ke[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Is(o,Ke.length,i,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32(),t.levelCount=s._nextUint32(),t.supercompressionScheme=s._nextUint32();const n=s._nextUint32(),a=s._nextUint32(),r=s._nextUint32(),A=s._nextUint32(),c=s._nextUint64(),l=s._nextUint64(),h=3*Math.max(t.levelCount,1)*8,d=new Is(o,Ke.length+i,h,!0);for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Is(o,n,a,!0);p._skip(4);const f=p._nextUint16(),b=p._nextUint16(),m=p._nextUint16(),I=p._nextUint16(),E={vendorId:f,descriptorType:b,versionNumber:m,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},C=(I/4-6)/4;for(let se=0;se<C;se++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),E.samples[se]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const Q=new Is(o,r,A,!0);for(;Q._offset<A;){const se=Q._nextUint32(),oe=Q._scan(se),Ae=Ea(oe);if(t.keyValue[Ae]=Q._nextUint8Array(se-oe.byteLength-1),Ae.match(/^ktx/i)){const Se=Ea(t.keyValue[Ae]);t.keyValue[Ae]=Se.substring(0,Se.lastIndexOf("\0"))}Q._skip(se%4?4-se%4:0)}if(l<=0)return t;const w=new Is(o,c,l,!0),x=w._nextUint16(),D=w._nextUint16(),S=w._nextUint32(),F=w._nextUint32(),Y=w._nextUint32(),V=w._nextUint32(),K=[];for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)K.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const W=c+w._offset,j=W+S,X=j+F,J=X+Y,ee=new Uint8Array(o.buffer,o.byteOffset+W,S),$=new Uint8Array(o.buffer,o.byteOffset+j,F),ue=new Uint8Array(o.buffer,o.byteOffset+X,Y),De=new Uint8Array(o.buffer,o.byteOffset+J,V);return t.globalData={endpointCount:x,selectorCount:D,imageDescs:K,endpointsData:ee,selectorsData:$,tablesData:ue,extendedData:De},t}let Li,kt,Ni;const Ui={env:{emscripten_notify_memory_growth:function(o){Ni=new Uint8Array(kt.exports.memory.buffer)}}};class DA{init(){return Li||(Li=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Ca).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ui)).then(this._init):WebAssembly.instantiate(Buffer.from(Ca,"base64"),Ui).then(this._init),Li)}_init(e){kt=e.instance,Ui.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!kt)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,s=kt.exports.malloc(i);Ni.set(e,s),t=t||Number(kt.exports.ZSTD_findDecompressedSize(s,i));const n=kt.exports.malloc(t),a=kt.exports.ZSTD_decompress(n,t,s,i),r=Ni.slice(n,n+a);return kt.exports.free(s),kt.exports.free(n),r}}const Ca="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX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0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGai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yACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACG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FCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",RA="display-p3",TA="display-p3-linear",Gi=new WeakMap;let Pi=0,Oi;class lt extends xt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cA,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new ht(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new ht(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([n,a])=>{const r=lt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(lt.EngineFormat),"let _EngineType = "+JSON.stringify(lt.EngineType),"let _TranscoderFormat = "+JSON.stringify(lt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(lt.BasisFormat),"/* basis_transcoder.js */",n,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
3
- `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=a,this.workerPool.setWorkerCreator(()=>{const c=new Worker(this.workerSourceURL),l=this.transcoderBinary.slice(0);return c.postMessage({type:"init",config:this.workerConfig,transcoderBinary:l},[l]),c})}),Pi>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Pi++}return this.transcoderPending}load(e,t,i,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new ht(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setResponseType("arraybuffer"),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Gi.has(e))return Gi.get(e).promise.then(t).catch(i);this._createTexture(e).then(s=>t?t(s):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:s,data:{faces:n,width:a,height:r,format:A,type:c,dfdFlags:l}}=e;if(i==="error")return Promise.reject(s);let h;if(t.faceCount===6)h=new Xo(n,A,c);else{const d=n[0].mipmaps;h=t.layerCount>1?new Zo(d,a,r,t.layerCount,A,c):new ps(d,a,r,A,c)}return h.minFilter=n[0].mipmaps.length===1?it:hs,h.magFilter=it,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=Ba(t),h.premultiplyAlpha=!!(l&hA),h}async _createTexture(e,t={}){const i=SA(new Uint8Array(e)),s=i.vkFormat===_i&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===uA||s&&!this.workerConfig.astcHDRSupported))return MA(i);const n=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:n},[e])).then(r=>this._createTextureFrom(r.data,i));return Gi.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Pi--}}lt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},lt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},lt.EngineFormat={RGBAFormat:Nt,RGBA_ASTC_4x4_Format:js,RGB_BPTC_UNSIGNED_Format:nr,RGBA_BPTC_Format:Ei,RGBA_ETC2_EAC_Format:Ln,RGBA_PVRTC_4BPPV1_Format:ir,RGBA_S3TC_DXT5_Format:Ci,RGB_ETC1_Format:sr,RGB_ETC2_Format:Nn,RGB_PVRTC_4BPPV1_Format:tr,RGBA_S3TC_DXT1_Format:Bi},lt.EngineType={UnsignedByteType:dt,HalfFloatType:Xe,FloatType:pt},lt.BasisWorker=function(){let o,e,t;const i=_EngineFormat,s=_EngineType,n=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,r(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:I,width:E,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:D}=A(b.buffer);self.postMessage({type:"transcode",id:b.id,data:{faces:m,width:E,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:D}},I)}catch(m){console.error(m),self.postMessage({type:"error",id:b.id,error:m.message})}});break}});function r(f){e=new Promise(b=>{t={wasmBinary:f,onRuntimeInitialized:b},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(f){const b=new t.KTX2File(new Uint8Array(f));function m(){b.close(),b.delete()}if(!b.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let I;if(b.isUASTC())I=a.UASTC;else if(b.isETC1S())I=a.ETC1S;else if(b.isHDR())I=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const E=b.getWidth(),C=b.getHeight(),Q=b.getLayers()||1,w=b.getLevels(),x=b.getFaces(),D=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:F,engineFormat:Y,engineType:V}=h(I,E,C,D);if(!E||!C||!w)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],W=[];for(let j=0;j<x;j++){const X=[];for(let J=0;J<w;J++){const ee=[];let $,ue;for(let se=0;se<Q;se++){const oe=b.getImageLevelInfo(J,se,j);j===0&&J===0&&se===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?($=oe.origWidth,ue=oe.origHeight):($=oe.width,ue=oe.height);let Ae=new Uint8Array(b.getImageTranscodedSizeInBytes(J,se,0,F));const Se=b.transcodeImage(Ae,J,se,j,F,0,-1,-1);if(V===s.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Se)throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(Ae)}const De=p(ee);X.push({data:De,width:$,height:ue}),W.push(De.buffer)}K.push({mipmaps:X,width:E,height:C,format:Y,type:V})}return m(),{faces:K,buffers:W,width:E,height:C,hasAlpha:D,dfdFlags:S,format:Y,type:V}}const c=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[n.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.RGBA32,n.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[n.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[a.ETC1S]:c.filter(f=>f.basisFormat.includes(a.ETC1S)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC]:c.filter(f=>f.basisFormat.includes(a.UASTC)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC_HDR]:c.filter(f=>f.basisFormat.includes(a.UASTC_HDR)).sort((f,b)=>f.priorityHDR-b.priorityHDR)};function h(f,b,m,I){const E=l[f];for(let C=0;C<E.length;C++){const Q=E[C];if(Q.if&&!o[Q.if]||!Q.basisFormat.includes(f)||I&&Q.transcoderFormat.length<2||Q.needsPowerOfTwo&&!(d(b)&&d(m)))continue;const w=Q.transcoderFormat[I?1:0],x=Q.engineFormat[I?1:0],D=Q.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:D}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(f){return f<=2?!0:(f&f-1)===0&&f!==0}function p(f){if(f.length===1)return f[0];let b=0;for(let E=0;E<f.length;E++){const C=f[E];b+=C.byteLength}const m=new Uint8Array(b);let I=0;for(let E=0;E<f.length;E++){const C=f[E];m.set(C,I),I+=C.byteLength}return m}};const kA=new Set([Nt,wi,us,ts]),Hi={[da]:Nt,[la]:Nt,[oa]:Nt,[ra]:Nt,[ga]:us,[ca]:us,[na]:us,[aa]:us,[ha]:ts,[Aa]:ts,[ia]:ts,[sa]:ts,[ua]:wi,[pa]:wi,[fa]:Nn,[ma]:Ln,[_i]:js,[xA]:js,[vA]:js,[Ia]:_n,[ba]:_n,[bA]:Bi,[IA]:Bi,[fA]:Fn,[mA]:Fn,[CA]:Mn,[EA]:Mn,[wA]:Ci,[BA]:Ci,[yA]:Ei,[QA]:Ei},Es={[da]:pt,[la]:Xe,[oa]:dt,[ra]:dt,[ga]:pt,[ca]:Xe,[na]:dt,[aa]:dt,[ha]:pt,[Aa]:Xe,[ia]:dt,[sa]:dt,[ua]:Gn,[pa]:Un,[fa]:dt,[ma]:dt,[_i]:Xe,[Ia]:dt,[ba]:dt};async function MA(o){const{vkFormat:e}=o;if(Hi[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===ea&&(Oi||(Oi=new Promise(async a=>{const r=new DA;await r.init(),a(r)})),t=await Oi);const i=[];for(let a=0;a<o.levels.length;a++){const r=Math.max(1,o.pixelWidth>>a),A=Math.max(1,o.pixelHeight>>a),c=o.pixelDepth?Math.max(1,o.pixelDepth>>a):0,l=o.levels[a];let h;if(o.supercompressionScheme===lA)h=l.levelData;else if(o.supercompressionScheme===ea)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;Es[e]===pt?d=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):Es[e]===Xe?d=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):Es[e]===Gn||Es[e]===Un?d=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=h,i.push({data:d,width:r,height:A,depth:c})}const s=o.levelCount===0||i.length>1;let n;if(kA.has(Hi[e]))n=o.pixelDepth===0?new $o(i[0].data,o.pixelWidth,o.pixelHeight):new er(i[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),n.minFilter=s?li:Ls,n.magFilter=Ls,n.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new ps(i,o.pixelWidth,o.pixelHeight),n.minFilter=s?hs:it,n.magFilter=it}return n.mipmaps=i,n.type=Es[e],n.format=Hi[e],n.colorSpace=Ba(o),n.needsUpdate=!0,Promise.resolve(n)}function Ba(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===dA?e.transferFunction===ta?ce:Ve:e.colorPrimaries===pA?e.transferFunction===ta?RA:TA:e.colorPrimaries===gA?Hs:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Hs)}const wa=new ar;wa.camera=new Ps,Et.basic,Et.basic,Et.points,Et.standard,Et.physical,Et.phong;var Cs=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(l){l.preventDefault(),i(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function i(l){for(var h=0;h<e.children.length;h++)e.children[h].style.display=h===l?"block":"none";o=l}var s=(performance||Date).now(),n=s,a=0,r=t(new Cs.Panel("FPS","#0ff","#002")),A=t(new Cs.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new Cs.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){a++;var l=(performance||Date).now();if(A.update(l-s,200),l>=n+1e3&&(r.update(a*1e3/(l-n),100),n=l,a=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return l},update:function(){s=this.end()},domElement:e,setMode:i}};Cs.Panel=function(o,e,t){var i=1/0,s=0,n=Math.round,a=n(window.devicePixelRatio||1),r=80*a,A=48*a,c=3*a,l=2*a,h=3*a,d=15*a,p=74*a,f=30*a,b=document.createElement("canvas");b.width=r,b.height=A,b.style.cssText="width:80px;height:48px";var m=b.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,r,A),m.fillStyle=e,m.fillText(o,c,l),m.fillRect(h,d,p,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h,d,p,f),{dom:b,update:function(I,E){i=Math.min(i,I),s=Math.max(s,I),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,r,d),m.fillStyle=e,m.fillText(n(I)+" "+o+" ("+n(i)+"-"+n(s)+")",c,l),m.drawImage(b,h+a,d,p-a,f,h,d,p-a,f),m.fillRect(h+p-a,d,a,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h+p-a,d,a,n((1-I/E)*f))}}};class FA extends or{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const s=i.generateShapes(e,t.size);t.depth===void 0&&t.height!==void 0&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=t.depth!==void 0?t.depth:t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(s,t)}this.type="TextGeometry"}}class _A extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=new ht(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(r){const A=n.parse(JSON.parse(r));t&&t(A)},i,s)}parse(e){return new Qa(e)}}class Qa{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],s=LA(e,t,this.data);for(let n=0,a=s.length;n<a;n++)i.push(...s[n].toShapes());return i}}function LA(o,e,t){const i=Array.from(o),s=e/t.resolution,n=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,a=[];let r=0,A=0;for(let c=0;c<i.length;c++){const l=i[c];if(l===`
4
- `)r=0,A-=n;else{const h=NA(l,s,r,A,t);r+=h.offsetX,a.push(h.path)}}return a}function NA(o,e,t,i,s){const n=s.glyphs[o]||s.glyphs["?"];if(!n){console.error('THREE.Font: character "'+o+'" does not exists in font family '+s.familyName+".");return}const a=new rr;let r,A,c,l,h,d,p,f;if(n.o){const b=n._cachedOutline||(n._cachedOutline=n.o.split(" "));for(let m=0,I=b.length;m<I;)switch(b[m++]){case"m":r=b[m++]*e+t,A=b[m++]*e+i,a.moveTo(r,A);break;case"l":r=b[m++]*e+t,A=b[m++]*e+i,a.lineTo(r,A);break;case"q":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,a.quadraticCurveTo(h,d,c,l);break;case"b":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,p=b[m++]*e+t,f=b[m++]*e+i,a.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:n.ha*e,path:a}}var ve=Uint8Array,nt=Uint16Array,ji=Int32Array,Ys=new ve([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ks=new ve([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qi=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ya=function(o,e){for(var t=new nt(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var s=new ji(t[30]),i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return{b:t,r:s}},va=ya(Ys,2),xa=va.b,zi=va.r;xa[28]=258,zi[258]=28;for(var Sa=ya(Ks,0),UA=Sa.b,Da=Sa.r,Yi=new nt(32768),be=0;be<32768;++be){var Pt=(be&43690)>>1|(be&21845)<<1;Pt=(Pt&52428)>>2|(Pt&13107)<<2,Pt=(Pt&61680)>>4|(Pt&3855)<<4,Yi[be]=((Pt&65280)>>8|(Pt&255)<<8)>>1}for(var Ct=function(o,e,t){for(var i=o.length,s=0,n=new nt(e);s<i;++s)o[s]&&++n[o[s]-1];var a=new nt(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var r;if(t){r=new nt(1<<e);var A=15-e;for(s=0;s<i;++s)if(o[s])for(var c=s<<4|o[s],l=e-o[s],h=a[o[s]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)r[Yi[h]>>A]=c}else for(r=new nt(i),s=0;s<i;++s)o[s]&&(r[s]=Yi[a[o[s]-1]++]>>15-o[s]);return r},Ot=new ve(288),be=0;be<144;++be)Ot[be]=8;for(var be=144;be<256;++be)Ot[be]=9;for(var be=256;be<280;++be)Ot[be]=7;for(var be=280;be<288;++be)Ot[be]=8;for(var Bs=new ve(32),be=0;be<32;++be)Bs[be]=5;var GA=Ct(Ot,9,0),PA=Ct(Ot,9,1),OA=Ct(Bs,5,0),HA=Ct(Bs,5,1),Ki=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},ut=function(o,e,t){var i=e/8|0;return(o[i]|o[i+1]<<8)>>(e&7)&t},Ji=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Vi=function(o){return(o+7)/8|0},Wi=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new ve(o.subarray(e,t))},jA=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],$e=function(o,e,t){var i=new Error(e||jA[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,$e),!t)throw i;return i},qA=function(o,e,t,i){var s=o.length,n=0;if(!s||e.f&&!e.l)return t||new ve(0);var a=!t,r=a||e.i!=2,A=e.i;a&&(t=new ve(s*3));var c=function(Me){var Lt=t.length;if(Me>Lt){var ze=new ve(Math.max(Lt*2,Me));ze.set(t),t=ze}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,m=e.n,I=s*8;do{if(!p){l=ut(o,h,1);var E=ut(o,h+1,3);if(h+=3,E)if(E==1)p=PA,f=HA,b=9,m=5;else if(E==2){var C=ut(o,h,31)+257,Q=ut(o,h+10,15)+4,w=C+ut(o,h+5,31)+1;h+=14;for(var x=new ve(w),D=new ve(19),S=0;S<Q;++S)D[qi[S]]=ut(o,h+S*3,7);h+=Q*3;for(var F=Ki(D),Y=(1<<F)-1,V=Ct(D,F,1),S=0;S<w;){var K=V[ut(o,h,Y)];h+=K&15;var W=K>>4;if(W<16)x[S++]=W;else{var j=0,X=0;for(W==16?(X=3+ut(o,h,3),h+=2,j=x[S-1]):W==17?(X=3+ut(o,h,7),h+=3):W==18&&(X=11+ut(o,h,127),h+=7);X--;)x[S++]=j}}var J=x.subarray(0,C),ee=x.subarray(C);b=Ki(J),m=Ki(ee),p=Ct(J,b,1),f=Ct(ee,m,1)}else $e(1);else{var W=Vi(h)+4,$=o[W-4]|o[W-3]<<8,ue=W+$;if(ue>s){A&&$e(0);break}r&&c(d+$),t.set(o.subarray(W,ue),d),e.b=d+=$,e.p=h=ue*8,e.f=l;continue}if(h>I){A&&$e(0);break}}r&&c(d+131072);for(var De=(1<<b)-1,se=(1<<m)-1,oe=h;;oe=h){var j=p[Ji(o,h)&De],Ae=j>>4;if(h+=j&15,h>I){A&&$e(0);break}if(j||$e(2),Ae<256)t[d++]=Ae;else if(Ae==256){oe=h,p=null;break}else{var Se=Ae-254;if(Ae>264){var S=Ae-257,fe=Ys[S];Se=ut(o,h,(1<<fe)-1)+xa[S],h+=fe}var qe=f[Ji(o,h)&se],Ft=qe>>4;qe||$e(3),h+=qe&15;var ee=UA[Ft];if(Ft>3){var fe=Ks[Ft];ee+=Ji(o,h)&(1<<fe)-1,h+=fe}if(h>I){A&&$e(0);break}r&&c(d+131072);var _t=d+Se;if(d<ee){var $t=n-ee,Le=Math.min(ee,_t);for($t+d<0&&$e(3);d<Le;++d)t[d]=i[$t+d]}for(;d<_t;++d)t[d]=t[d-ee]}}e.l=p,e.p=oe,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=m)}while(!l);return d!=t.length&&a?Wi(t,0,d):t.subarray(0,d)},Mt=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},ws=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},Xi=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var s=t.length,n=t.slice();if(!s)return{t:Ma,l:0};if(s==1){var a=new ve(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(w,x){return w.f-x.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],c=0,l=1,h=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};l!=s-1;)r=t[t[c].f<t[h].f?c++:h++],A=t[c!=l&&t[c].f<t[h].f?c++:h++],t[l++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=n[0].s,i=1;i<s;++i)n[i].s>d&&(d=n[i].s);var p=new nt(d+1),f=Zi(t[l-1],p,0);if(f>e){var i=0,b=0,m=f-e,I=1<<m;for(n.sort(function(x,D){return p[D.s]-p[x.s]||x.f-D.f});i<s;++i){var E=n[i].s;if(p[E]>e)b+=I-(1<<f-p[E]),p[E]=e;else break}for(b>>=m;b>0;){var C=n[i].s;p[C]<e?b-=1<<e-p[C]++-1:++i}for(;i>=0&&b;--i){var Q=n[i].s;p[Q]==e&&(--p[Q],++b)}f=e}return{t:new ve(p),l:f}},Zi=function(o,e,t){return o.s==-1?Math.max(Zi(o.l,e,t+1),Zi(o.r,e,t+1)):e[o.s]=t},Ra=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new nt(++e),i=0,s=o[0],n=1,a=function(A){t[i++]=A},r=1;r<=e;++r)if(o[r]==s&&r!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=o[r]}return{c:t.subarray(0,i),n:e}},Qs=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},Ta=function(o,e,t){var i=t.length,s=Vi(e+2);o[s]=i&255,o[s+1]=i>>8,o[s+2]=o[s]^255,o[s+3]=o[s+1]^255;for(var n=0;n<i;++n)o[s+n+4]=t[n];return(s+4+i)*8},ka=function(o,e,t,i,s,n,a,r,A,c,l){Mt(e,l++,t),++s[256];for(var h=Xi(s,15),d=h.t,p=h.l,f=Xi(n,15),b=f.t,m=f.l,I=Ra(d),E=I.c,C=I.n,Q=Ra(b),w=Q.c,x=Q.n,D=new nt(19),S=0;S<E.length;++S)++D[E[S]&31];for(var S=0;S<w.length;++S)++D[w[S]&31];for(var F=Xi(D,7),Y=F.t,V=F.l,K=19;K>4&&!Y[qi[K-1]];--K);var W=c+5<<3,j=Qs(s,Ot)+Qs(n,Bs)+a,X=Qs(s,d)+Qs(n,b)+a+14+3*K+Qs(D,Y)+2*D[16]+3*D[17]+7*D[18];if(A>=0&&W<=j&&W<=X)return Ta(e,l,o.subarray(A,A+c));var J,ee,$,ue;if(Mt(e,l,1+(X<j)),l+=2,X<j){J=Ct(d,p,0),ee=d,$=Ct(b,m,0),ue=b;var De=Ct(Y,V,0);Mt(e,l,C-257),Mt(e,l+5,x-1),Mt(e,l+10,K-4),l+=14;for(var S=0;S<K;++S)Mt(e,l+3*S,Y[qi[S]]);l+=3*K;for(var se=[E,w],oe=0;oe<2;++oe)for(var Ae=se[oe],S=0;S<Ae.length;++S){var Se=Ae[S]&31;Mt(e,l,De[Se]),l+=Y[Se],Se>15&&(Mt(e,l,Ae[S]>>5&127),l+=Ae[S]>>12)}}else J=GA,ee=Ot,$=OA,ue=Bs;for(var S=0;S<r;++S){var fe=i[S];if(fe>255){var Se=fe>>18&31;ws(e,l,J[Se+257]),l+=ee[Se+257],Se>7&&(Mt(e,l,fe>>23&31),l+=Ys[Se]);var qe=fe&31;ws(e,l,$[qe]),l+=ue[qe],qe>3&&(ws(e,l,fe>>5&8191),l+=Ks[qe])}else ws(e,l,J[fe]),l+=ee[fe]}return ws(e,l,J[256]),l+ee[256]},zA=new ji([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ma=new ve(0),YA=function(o,e,t,i,s,n){var a=n.z||o.length,r=new ve(i+a+5*(1+Math.ceil(a/7e3))+s),A=r.subarray(i,r.length-s),c=n.l,l=(n.r||0)&7;if(e){l&&(A[0]=n.r>>3);for(var h=zA[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=n.p||new nt(32768),m=n.h||new nt(f+1),I=Math.ceil(t/3),E=2*I,C=function(Ne){return(o[Ne]^o[Ne+1]<<I^o[Ne+2]<<E)&f},Q=new ji(25e3),w=new nt(288),x=new nt(32),D=0,S=0,F=n.i||0,Y=0,V=n.w||0,K=0;F+2<a;++F){var W=C(F),j=F&32767,X=m[W];if(b[j]=X,m[W]=j,V<=F){var J=a-F;if((D>7e3||Y>24576)&&(J>423||!c)){l=ka(o,A,0,Q,w,x,S,Y,K,F-K,l),Y=D=S=0,K=F;for(var ee=0;ee<286;++ee)w[ee]=0;for(var ee=0;ee<30;++ee)x[ee]=0}var $=2,ue=0,De=p,se=j-X&32767;if(J>2&&W==C(F-se))for(var oe=Math.min(d,J)-1,Ae=Math.min(32767,F),Se=Math.min(258,J);se<=Ae&&--De&&j!=X;){if(o[F+$]==o[F+$-se]){for(var fe=0;fe<Se&&o[F+fe]==o[F+fe-se];++fe);if(fe>$){if($=fe,ue=se,fe>oe)break;for(var qe=Math.min(se,fe-2),Ft=0,ee=0;ee<qe;++ee){var _t=F-se+ee&32767,$t=b[_t],Le=_t-$t&32767;Le>Ft&&(Ft=Le,X=_t)}}}j=X,X=b[j],se+=j-X&32767}if(ue){Q[Y++]=268435456|zi[$]<<18|Da[ue];var Me=zi[$]&31,Lt=Da[ue]&31;S+=Ys[Me]+Ks[Lt],++w[257+Me],++x[Lt],V=F+$,++D}else Q[Y++]=o[F],++w[o[F]]}}for(F=Math.max(F,V);F<a;++F)Q[Y++]=o[F],++w[o[F]];l=ka(o,A,c,Q,w,x,S,Y,K,F-K,l),c||(n.r=l&7|A[l/8|0]<<3,l-=7,n.h=m,n.p=b,n.i=F,n.w=V)}else{for(var F=n.w||0;F<a+c;F+=65535){var ze=F+65535;ze>=a&&(A[l/8|0]=c,ze=a),l=Ta(A,l+1,o.subarray(F,ze))}n.i=a}return Wi(r,0,i+Vi(l)+s)},KA=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),JA=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=KA[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},VA=function(o,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),a=new ve(n.length+o.length);a.set(n),a.set(o,n.length),o=a,s.w=n.length}return YA(o,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,i,s)},Fa=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Ue=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},WA=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&$e(6,"invalid zlib data"),(o[1]>>5&1)==1&&$e(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function XA(o,e){return VA(o,e||{},0,0)}function ys(o,e){return qA(o.subarray(WA(o),-4),{i:2},e,e)}var _a=function(o,e,t,i){for(var s in o){var n=o[s],a=e+s,r=i;Array.isArray(n)&&(r=Fa(i,n[1]),n=n[0]),n instanceof ve?t[a]=[n,r]:(t[a+="/"]=[new ve(0),r],_a(n,a,t,i))}},La=typeof TextEncoder<"u"&&new TextEncoder,ZA=typeof TextDecoder<"u"&&new TextDecoder,$A=0;try{ZA.decode(Ma,{stream:!0}),$A=1}catch{}function $i(o,e){var t;if(La)return La.encode(o);for(var i=o.length,s=new ve(o.length+(o.length>>1)),n=0,a=function(l){s[n++]=l},t=0;t<i;++t){if(n+5>s.length){var r=new ve(n+8+(i-t<<1));r.set(s),s=r}var A=o.charCodeAt(t);A<128||e?a(A):A<2048?(a(192|A>>6),a(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|o.charCodeAt(++t)&1023,a(240|A>>18),a(128|A>>12&63),a(128|A>>6&63),a(128|A&63)):(a(224|A>>12),a(128|A>>6&63),a(128|A&63))}return Wi(s,0,n)}var en=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&$e(9),e+=i+4}return e},Na=function(o,e,t,i,s,n,a,r){var A=i.length,c=t.extra,l=r&&r.length,h=en(c);Ue(o,e,a!=null?33639248:67324752),e+=4,a!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(n<0&&8),o[e++]=s&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&$e(10),Ue(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,n!=-1&&(Ue(o,e,t.crc),Ue(o,e+4,n<0?-n-2:n),Ue(o,e+8,t.size)),Ue(o,e+12,A),Ue(o,e+14,h),e+=16,a!=null&&(Ue(o,e,l),Ue(o,e+6,t.attrs),Ue(o,e+10,a),e+=14),o.set(i,e),e+=A,h)for(var f in c){var b=c[f],m=b.length;Ue(o,e,+f),Ue(o,e+2,m),o.set(b,e+4),e+=4+m}return l&&(o.set(r,e),e+=l),e},ec=function(o,e,t,i,s){Ue(o,e,101010256),Ue(o,e+8,t),Ue(o,e+10,t),Ue(o,e+12,i),Ue(o,e+16,s)};function tc(o,e){e||(e={});var t={},i=[];_a(o,"",t,e);var s=0,n=0;for(var a in t){var r=t[a],A=r[0],c=r[1],l=c.level==0?0:8,h=$i(a),d=h.length,p=c.comment,f=p&&$i(p),b=f&&f.length,m=en(c.extra);d>65535&&$e(11);var I=l?XA(A,c):A,E=I.length,C=JA();C.p(A),i.push(Fa(c,{size:A.length,crc:C.d(),c:I,f:h,m:f,u:d!=a.length||f&&p.length!=b,o:s,compression:l})),s+=30+d+m+E,n+=76+2*(d+m)+(b||0)+E}for(var Q=new ve(n+22),w=s,x=n-s,D=0;D<i.length;++D){var h=i[D];Na(Q,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+en(h.extra);Q.set(h.c,h.o+S),Na(Q,s,h,h.f,h.u,h.c.length,h.o,h.m),s+=16+S+(h.m?h.m.length:0)}return ec(Q,s,i.length,x,w),Q}class sc extends Pn{constructor(e){super(e),this.type=Xe}parse(e){const t=Math.pow(2.7182818,2.2);function i(g,u){let B=0;for(let R=0;R<65536;++R)(R==0||g[R>>3]&1<<(R&7))&&(u[B++]=R);const y=B-1;for(;B<65536;)u[B++]=0;return y}function s(g){for(let u=0;u<16384;u++)g[u]={},g[u].len=0,g[u].lit=0,g[u].p=null}const n={l:0,c:0,lc:0};function a(g,u,B,y,R){for(;B<g;)u=u<<8|Lt(y,R),B+=8;B-=g,n.l=u>>B&(1<<g)-1,n.c=u,n.lc=B}const r=new Array(59);function A(g){for(let B=0;B<=58;++B)r[B]=0;for(let B=0;B<65537;++B)r[g[B]]+=1;let u=0;for(let B=58;B>0;--B){const y=u+r[B]>>1;r[B]=u,u=y}for(let B=0;B<65537;++B){const y=g[B];y>0&&(g[B]=y|r[y]++<<6)}}function c(g,u,B,y,R,v){const M=u;let L=0,_=0;for(;y<=R;y++){if(M.value-u.value>B)return!1;a(6,L,_,g,M);const k=n.l;if(L=n.c,_=n.lc,v[y]=k,k==63){if(M.value-u.value>B)throw new Error("Something wrong with hufUnpackEncTable");a(8,L,_,g,M);let T=n.l+6;if(L=n.c,_=n.lc,y+T>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;T--;)v[y++]=0;y--}else if(k>=59){let T=k-59+2;if(y+T>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;T--;)v[y++]=0;y--}}A(v)}function l(g){return g&63}function h(g){return g>>6}function d(g,u,B,y){for(;u<=B;u++){const R=h(g[u]),v=l(g[u]);if(R>>v)throw new Error("Invalid table entry");if(v>14){const M=y[R>>v-14];if(M.len)throw new Error("Invalid table entry");if(M.lit++,M.p){const L=M.p;M.p=new Array(M.lit);for(let _=0;_<M.lit-1;++_)M.p[_]=L[_]}else M.p=new Array(1);M.p[M.lit-1]=u}else if(v){let M=0;for(let L=1<<14-v;L>0;L--){const _=y[(R<<14-v)+M];if(_.len||_.p)throw new Error("Invalid table entry");_.len=v,_.lit=u,M++}}}return!0}const p={c:0,lc:0};function f(g,u,B,y){g=g<<8|Lt(B,y),u+=8,p.c=g,p.lc=u}const b={c:0,lc:0};function m(g,u,B,y,R,v,M,L,_){if(g==u){y<8&&(f(B,y,R,v),B=p.c,y=p.lc),y-=8;let k=B>>y;if(k=new Uint8Array([k])[0],L.value+k>_)return!1;const T=M[L.value-1];for(;k-- >0;)M[L.value++]=T}else if(L.value<_)M[L.value++]=g;else return!1;b.c=B,b.lc=y}function I(g){return g&65535}function E(g){const u=I(g);return u>32767?u-65536:u}const C={a:0,b:0};function Q(g,u){const B=E(g),y=E(u),R=B+(y&1)+(y>>1),v=R,M=R-y;C.a=v,C.b=M}function w(g,u){const B=I(g),y=I(u),R=B-(y>>1)&65535,v=y+R-32768&65535;C.a=v,C.b=R}function x(g,u,B,y,R,v,M){const L=M<16384,_=B>R?R:B;let k=1,T,G;for(;k<=_;)k<<=1;for(k>>=1,T=k,k>>=1;k>=1;){G=0;const U=G+v*(R-T),q=v*k,Z=v*T,P=y*k,z=y*T;let te,Ie,ye,tt;for(;G<=U;G+=Z){let me=G;const re=G+y*(B-T);for(;me<=re;me+=z){const Re=me+P,ot=me+q,Fe=ot+P;L?(Q(g[me+u],g[ot+u]),te=C.a,ye=C.b,Q(g[Re+u],g[Fe+u]),Ie=C.a,tt=C.b,Q(te,Ie),g[me+u]=C.a,g[Re+u]=C.b,Q(ye,tt),g[ot+u]=C.a,g[Fe+u]=C.b):(w(g[me+u],g[ot+u]),te=C.a,ye=C.b,w(g[Re+u],g[Fe+u]),Ie=C.a,tt=C.b,w(te,Ie),g[me+u]=C.a,g[Re+u]=C.b,w(ye,tt),g[ot+u]=C.a,g[Fe+u]=C.b)}if(B&k){const Re=me+q;L?Q(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}if(R&k){let me=G;const re=G+y*(B-T);for(;me<=re;me+=z){const Re=me+P;L?Q(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}T=k,k>>=1}return G}function D(g,u,B,y,R,v,M,L,_){let k=0,T=0;const G=M,U=Math.trunc(y.value+(R+7)/8);for(;y.value<U;)for(f(k,T,B,y),k=p.c,T=p.lc;T>=14;){const Z=k>>T-14&16383,P=u[Z];if(P.len)T-=P.len,m(P.lit,v,k,T,B,y,L,_,G),k=b.c,T=b.lc;else{if(!P.p)throw new Error("hufDecode issues");let z;for(z=0;z<P.lit;z++){const te=l(g[P.p[z]]);for(;T<te&&y.value<U;)f(k,T,B,y),k=p.c,T=p.lc;if(T>=te&&h(g[P.p[z]])==(k>>T-te&(1<<te)-1)){T-=te,m(P.p[z],v,k,T,B,y,L,_,G),k=b.c,T=b.lc;break}}if(z==P.lit)throw new Error("hufDecode issues")}}const q=8-R&7;for(k>>=q,T-=q;T>0;){const Z=u[k<<14-T&16383];if(Z.len)T-=Z.len,m(Z.lit,v,k,T,B,y,L,_,G),k=b.c,T=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,u,B,y,R,v){const M={value:0},L=B.value,_=Me(u,B),k=Me(u,B);B.value+=4;const T=Me(u,B);if(B.value+=4,_<0||_>=65537||k<0||k>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const G=new Array(65537),U=new Array(16384);s(U);const q=y-(B.value-L);if(c(g,B,q,_,k,G),T>8*(y-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,_,k,U),D(G,U,g,B,T,k,v,R,M)}function F(g,u,B){for(let y=0;y<B;++y)u[y]=g[u[y]]}function Y(g){for(let u=1;u<g.length;u++){const B=g[u-1]+g[u]-128;g[u]=B}}function V(g,u){let B=0,y=Math.floor((g.length+1)/2),R=0;const v=g.length-1;for(;!(R>v||(u[R++]=g[B++],R>v));)u[R++]=g[y++]}function K(g){let u=g.byteLength;const B=new Array;let y=0;const R=new DataView(g);for(;u>0;){const v=R.getInt8(y++);if(v<0){const M=-v;u-=M+1;for(let L=0;L<M;L++)B.push(R.getUint8(y++))}else{const M=v;u-=2;const L=R.getUint8(y++);for(let _=0;_<M+1;_++)B.push(L)}}return B}function W(g,u,B,y,R,v){let M=new DataView(v.buffer);const L=B[g.idx[0]].width,_=B[g.idx[0]].height,k=3,T=Math.floor(L/8),G=Math.ceil(L/8),U=Math.ceil(_/8),q=L-(G-1)*8,Z=_-(U-1)*8,P={value:0},z=new Array(k),te=new Array(k),Ie=new Array(k),ye=new Array(k),tt=new Array(k);for(let re=0;re<k;++re)tt[re]=u[g.idx[re]],z[re]=re<1?0:z[re-1]+G*U,te[re]=new Float32Array(64),Ie[re]=new Uint16Array(64),ye[re]=new Uint16Array(G*64);for(let re=0;re<U;++re){let Re=8;re==U-1&&(Re=Z);let ot=8;for(let ge=0;ge<G;++ge){ge==G-1&&(ot=q);for(let pe=0;pe<k;++pe)Ie[pe].fill(0),Ie[pe][0]=R[z[pe]++],j(P,y,Ie[pe]),X(Ie[pe],te[pe]),J(te[pe]);ee(te);for(let pe=0;pe<k;++pe)$(te[pe],ye[pe],ge*64)}let Fe=0;for(let ge=0;ge<k;++ge){const pe=B[g.idx[ge]].type;for(let vt=8*re;vt<8*re+Re;++vt){Fe=tt[ge][vt];for(let ls=0;ls<T;++ls){const ft=ls*64+(vt&7)*8;M.setUint16(Fe+0*pe,ye[ge][ft+0],!0),M.setUint16(Fe+2*pe,ye[ge][ft+1],!0),M.setUint16(Fe+4*pe,ye[ge][ft+2],!0),M.setUint16(Fe+6*pe,ye[ge][ft+3],!0),M.setUint16(Fe+8*pe,ye[ge][ft+4],!0),M.setUint16(Fe+10*pe,ye[ge][ft+5],!0),M.setUint16(Fe+12*pe,ye[ge][ft+6],!0),M.setUint16(Fe+14*pe,ye[ge][ft+7],!0),Fe+=16*pe}}if(T!=G)for(let vt=8*re;vt<8*re+Re;++vt){const ls=tt[ge][vt]+8*T*2*pe,ft=T*64+(vt&7)*8;for(let _s=0;_s<ot;++_s)M.setUint16(ls+_s*2*pe,ye[ge][ft+_s],!0)}}}const me=new Uint16Array(L);M=new DataView(v.buffer);for(let re=0;re<k;++re){B[g.idx[re]].decoded=!0;const Re=B[g.idx[re]].type;if(B[re].type==2)for(let ot=0;ot<_;++ot){const Fe=tt[re][ot];for(let ge=0;ge<L;++ge)me[ge]=M.getUint16(Fe+ge*2*Re,!0);for(let ge=0;ge<L;++ge)M.setFloat32(Fe+ge*2*Re,H(me[ge]),!0)}}}function j(g,u,B){let y,R=1;for(;R<64;)y=u[g.value],y==65280?R=64:y>>8==255?R+=y&255:(B[R]=y,R++),g.value++}function X(g,u){u[0]=H(g[0]),u[1]=H(g[1]),u[2]=H(g[5]),u[3]=H(g[6]),u[4]=H(g[14]),u[5]=H(g[15]),u[6]=H(g[27]),u[7]=H(g[28]),u[8]=H(g[2]),u[9]=H(g[4]),u[10]=H(g[7]),u[11]=H(g[13]),u[12]=H(g[16]),u[13]=H(g[26]),u[14]=H(g[29]),u[15]=H(g[42]),u[16]=H(g[3]),u[17]=H(g[8]),u[18]=H(g[12]),u[19]=H(g[17]),u[20]=H(g[25]),u[21]=H(g[30]),u[22]=H(g[41]),u[23]=H(g[43]),u[24]=H(g[9]),u[25]=H(g[11]),u[26]=H(g[18]),u[27]=H(g[24]),u[28]=H(g[31]),u[29]=H(g[40]),u[30]=H(g[44]),u[31]=H(g[53]),u[32]=H(g[10]),u[33]=H(g[19]),u[34]=H(g[23]),u[35]=H(g[32]),u[36]=H(g[39]),u[37]=H(g[45]),u[38]=H(g[52]),u[39]=H(g[54]),u[40]=H(g[20]),u[41]=H(g[22]),u[42]=H(g[33]),u[43]=H(g[38]),u[44]=H(g[46]),u[45]=H(g[51]),u[46]=H(g[55]),u[47]=H(g[60]),u[48]=H(g[21]),u[49]=H(g[34]),u[50]=H(g[37]),u[51]=H(g[47]),u[52]=H(g[50]),u[53]=H(g[56]),u[54]=H(g[59]),u[55]=H(g[61]),u[56]=H(g[35]),u[57]=H(g[36]),u[58]=H(g[48]),u[59]=H(g[49]),u[60]=H(g[57]),u[61]=H(g[58]),u[62]=H(g[62]),u[63]=H(g[63])}function J(g){const u=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),y=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),v=.5*Math.cos(5*3.14159/16),M=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),_=new Array(4),k=new Array(4),T=new Array(4),G=new Array(4);for(let U=0;U<8;++U){const q=U*8;_[0]=y*g[q+2],_[1]=M*g[q+2],_[2]=y*g[q+6],_[3]=M*g[q+6],k[0]=B*g[q+1]+R*g[q+3]+v*g[q+5]+L*g[q+7],k[1]=R*g[q+1]-L*g[q+3]-B*g[q+5]-v*g[q+7],k[2]=v*g[q+1]-B*g[q+3]+L*g[q+5]+R*g[q+7],k[3]=L*g[q+1]-v*g[q+3]+R*g[q+5]-B*g[q+7],T[0]=u*(g[q+0]+g[q+4]),T[3]=u*(g[q+0]-g[q+4]),T[1]=_[0]+_[3],T[2]=_[1]-_[2],G[0]=T[0]+T[1],G[1]=T[3]+T[2],G[2]=T[3]-T[2],G[3]=T[0]-T[1],g[q+0]=G[0]+k[0],g[q+1]=G[1]+k[1],g[q+2]=G[2]+k[2],g[q+3]=G[3]+k[3],g[q+4]=G[3]-k[3],g[q+5]=G[2]-k[2],g[q+6]=G[1]-k[1],g[q+7]=G[0]-k[0]}for(let U=0;U<8;++U)_[0]=y*g[16+U],_[1]=M*g[16+U],_[2]=y*g[48+U],_[3]=M*g[48+U],k[0]=B*g[8+U]+R*g[24+U]+v*g[40+U]+L*g[56+U],k[1]=R*g[8+U]-L*g[24+U]-B*g[40+U]-v*g[56+U],k[2]=v*g[8+U]-B*g[24+U]+L*g[40+U]+R*g[56+U],k[3]=L*g[8+U]-v*g[24+U]+R*g[40+U]-B*g[56+U],T[0]=u*(g[U]+g[32+U]),T[3]=u*(g[U]-g[32+U]),T[1]=_[0]+_[3],T[2]=_[1]-_[2],G[0]=T[0]+T[1],G[1]=T[3]+T[2],G[2]=T[3]-T[2],G[3]=T[0]-T[1],g[0+U]=G[0]+k[0],g[8+U]=G[1]+k[1],g[16+U]=G[2]+k[2],g[24+U]=G[3]+k[3],g[32+U]=G[3]-k[3],g[40+U]=G[2]-k[2],g[48+U]=G[1]-k[1],g[56+U]=G[0]-k[0]}function ee(g){for(let u=0;u<64;++u){const B=g[0][u],y=g[1][u],R=g[2][u];g[0][u]=B+1.5747*R,g[1][u]=B-.1873*y-.4682*R,g[2][u]=B+1.8556*y}}function $(g,u,B){for(let y=0;y<64;++y)u[B+y]=ss.toHalfFloat(ue(g[y]))}function ue(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(t,Math.abs(g)-1)}function De(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function se(g){const u=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(K(u)),y=new Uint8Array(B.length);return Y(B),V(B,y),new DataView(y.buffer)}function oe(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=ys(u),y=new Uint8Array(B.length);return Y(B),V(B,y),new DataView(y.buffer)}function Ae(g){const u=g.viewer,B={value:g.offset.value},y=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),R=new Uint8Array(8192);let v=0;const M=new Array(g.inputChannels.length);for(let Z=0,P=g.inputChannels.length;Z<P;Z++)M[Z]={},M[Z].start=v,M[Z].end=M[Z].start,M[Z].nx=g.columns,M[Z].ny=g.lines,M[Z].size=g.type,v+=M[Z].nx*M[Z].ny*M[Z].size;const L=cs(u,B),_=cs(u,B);if(_>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=_)for(let Z=0;Z<_-L+1;Z++)R[Z+L]=ze(u,B);const k=new Uint16Array(65536),T=i(R,k),G=Me(u,B);S(g.array,u,B,G,y,v);for(let Z=0;Z<g.inputChannels.length;++Z){const P=M[Z];for(let z=0;z<M[Z].size;++z)x(y,P.start+z,P.nx,P.size,P.ny,P.nx*P.size,T)}F(k,y,v);let U=0;const q=new Uint8Array(y.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let P=0;P<g.inputChannels.length;P++){const z=M[P],te=z.nx*z.size,Ie=new Uint8Array(y.buffer,z.end*2,te*2);q.set(Ie,U),U+=te*2,z.end+=te}return new DataView(q.buffer)}function Se(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=ys(u),y=g.inputChannels.length*g.lines*g.columns*g.totalBytes,R=new ArrayBuffer(y),v=new DataView(R);let M=0,L=0;const _=new Array(4);for(let k=0;k<g.lines;k++)for(let T=0;T<g.inputChannels.length;T++){let G=0;switch(g.inputChannels[T].pixelType){case 1:_[0]=M,_[1]=_[0]+g.columns,M=_[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[_[0]++]<<8|B[_[1]++];G+=q,v.setUint16(L,G,!0),L+=2}break;case 2:_[0]=M,_[1]=_[0]+g.columns,_[2]=_[1]+g.columns,M=_[2]+g.columns;for(let U=0;U<g.columns;++U){const q=B[_[0]++]<<24|B[_[1]++]<<16|B[_[2]++]<<8;G+=q,v.setUint32(L,G,!0),L+=4}break}}return v}function fe(g){const u=g.viewer,B={value:g.offset.value},y=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),R={version:Ne(u,B),unknownUncompressedSize:Ne(u,B),unknownCompressedSize:Ne(u,B),acCompressedSize:Ne(u,B),dcCompressedSize:Ne(u,B),rleCompressedSize:Ne(u,B),rleUncompressedSize:Ne(u,B),rleRawSize:Ne(u,B),totalAcUncompressedCount:Ne(u,B),totalDcUncompressedCount:Ne(u,B),acCompression:Ne(u,B)};if(R.version<2)throw new Error("EXRLoader.parse: "+jt.compression+" version "+R.version+" is unsupported");const v=new Array;let M=cs(u,B)-2;for(;M>0;){const P=qe(u.buffer,B),z=ze(u,B),te=z>>2&3,Ie=(z>>4)-1,ye=new Int8Array([Ie])[0],tt=ze(u,B);v.push({name:P,index:ye,type:tt,compression:te}),M-=P.length+3}const L=jt.channels,_=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const z=_[P]={},te=L[P];z.name=te.name,z.compression=0,z.decoded=!1,z.type=te.pixelType,z.pLinear=te.pLinear,z.width=g.columns,z.height=g.lines}const k={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const z=_[P];for(let te=0;te<v.length;++te){const Ie=v[te];z.name==Ie.name&&(z.compression=Ie.compression,Ie.index>=0&&(k.idx[Ie.index]=P),z.offset=P)}}let T,G,U;if(R.acCompressedSize>0)switch(R.acCompression){case 0:T=new Uint16Array(R.totalAcUncompressedCount),S(g.array,u,B,R.acCompressedSize,T,R.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+R.totalAcUncompressedCount),z=ys(P);T=new Uint16Array(z.buffer),B.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const P={array:g.array,offset:B,size:R.dcCompressedSize};G=new Uint16Array(oe(P).buffer),B.value+=R.dcCompressedSize}if(R.rleRawSize>0){const P=g.array.slice(B.value,B.value+R.rleCompressedSize),z=ys(P);U=K(z.buffer),B.value+=R.rleCompressedSize}let q=0;const Z=new Array(_.length);for(let P=0;P<Z.length;++P)Z[P]=new Array;for(let P=0;P<g.lines;++P)for(let z=0;z<_.length;++z)Z[z].push(q),q+=_[z].width*g.type*2;W(k,Z,_,T,G,y);for(let P=0;P<_.length;++P){const z=_[P];if(!z.decoded)switch(z.compression){case 2:let te=0,Ie=0;for(let ye=0;ye<g.lines;++ye){let tt=Z[P][te];for(let me=0;me<z.width;++me){for(let re=0;re<2*z.type;++re)y[tt++]=U[Ie+re*z.width*z.height];Ie++}te++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(y.buffer)}function qe(g,u){const B=new Uint8Array(g);let y=0;for(;B[u.value+y]!=0;)y+=1;const R=new TextDecoder().decode(B.slice(u.value,u.value+y));return u.value=u.value+y+1,R}function Ft(g,u,B){const y=new TextDecoder().decode(new Uint8Array(g).slice(u.value,u.value+B));return u.value=u.value+B,y}function _t(g,u){const B=Le(g,u),y=Me(g,u);return[B,y]}function $t(g,u){const B=Me(g,u),y=Me(g,u);return[B,y]}function Le(g,u){const B=g.getInt32(u.value,!0);return u.value=u.value+4,B}function Me(g,u){const B=g.getUint32(u.value,!0);return u.value=u.value+4,B}function Lt(g,u){const B=g[u.value];return u.value=u.value+1,B}function ze(g,u){const B=g.getUint8(u.value);return u.value=u.value+1,B}const Ne=function(g,u){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(u.value,!0)):B=g.getUint32(u.value+4,!0)+Number(g.getUint32(u.value,!0)<<32),u.value+=8,B};function He(g,u){const B=g.getFloat32(u.value,!0);return u.value+=4,B}function yo(g,u){return ss.toHalfFloat(He(g,u))}function H(g){const u=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(u?u===31?B?NaN:1/0:Math.pow(2,u-15)*(1+B/1024):6103515625e-14*(B/1024))}function cs(g,u){const B=g.getUint16(u.value,!0);return u.value+=2,B}function vo(g,u){return H(cs(g,u))}function xo(g,u,B,y){const R=B.value,v=[];for(;B.value<R+y-1;){const M=qe(u,B),L=Le(g,B),_=ze(g,B);B.value+=3;const k=Le(g,B),T=Le(g,B);v.push({name:M,pixelType:L,pLinear:_,xSampling:k,ySampling:T})}return B.value+=1,v}function So(g,u){const B=He(g,u),y=He(g,u),R=He(g,u),v=He(g,u),M=He(g,u),L=He(g,u),_=He(g,u),k=He(g,u);return{redX:B,redY:y,greenX:R,greenY:v,blueX:M,blueY:L,whiteX:_,whiteY:k}}function Do(g,u){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],y=ze(g,u);return B[y]}function Ro(g,u){const B=Le(g,u),y=Le(g,u),R=Le(g,u),v=Le(g,u);return{xMin:B,yMin:y,xMax:R,yMax:v}}function To(g,u){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],y=ze(g,u);return B[y]}function ko(g,u){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],y=ze(g,u);return B[y]}function Mo(g,u){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],y=["ROUND_DOWN","ROUND_UP"],R=Me(g,u),v=Me(g,u),M=ze(g,u);return{xSize:R,ySize:v,levelMode:B[M&15],roundingMode:y[M>>4]}}function Fo(g,u){const B=He(g,u),y=He(g,u);return[B,y]}function _o(g,u){const B=He(g,u),y=He(g,u),R=He(g,u);return[B,y,R]}function Lo(g,u,B,y,R){if(y==="string"||y==="stringvector"||y==="iccProfile")return Ft(u,B,R);if(y==="chlist")return xo(g,u,B,R);if(y==="chromaticities")return So(g,B);if(y==="compression")return Do(g,B);if(y==="box2i")return Ro(g,B);if(y==="envmap")return ko(g,B);if(y==="tiledesc")return Mo(g,B);if(y==="lineOrder")return To(g,B);if(y==="float")return He(g,B);if(y==="v2f")return Fo(g,B);if(y==="v3f")return _o(g,B);if(y==="int")return Le(g,B);if(y==="rational")return _t(g,B);if(y==="timecode")return $t(g,B);if(y==="preview")return B.value+=R,"skipped";B.value+=R}function No(g,u){const B=Math.log2(g);return u=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Uo(g,u,B){let y=0;switch(g.levelMode){case"ONE_LEVEL":y=1;break;case"MIPMAP_LEVELS":y=No(Math.max(u,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return y}function bn(g,u,B,y){const R=new Array(g);for(let v=0;v<g;v++){const M=1<<v;let L=u/M|0;y=="ROUND_UP"&&L*M<u&&(L+=1);const _=Math.max(L,1);R[v]=(_+B-1)/B|0}return R}function Go(){const g=this,u=g.offset,B={value:0};for(let y=0;y<g.tileCount;y++){const R=Le(g.viewer,u),v=Le(g.viewer,u);u.value+=8,g.size=Me(g.viewer,u);const M=R*g.blockWidth,L=v*g.blockHeight;g.columns=M+g.blockWidth>g.width?g.width-M:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const _=g.columns*g.totalBytes,k=g.size<g.lines*_?g.uncompress(g):De(g);u.value+=g.size;for(let T=0;T<g.lines;T++){const G=T*g.columns*g.totalBytes;for(let U=0;U<g.inputChannels.length;U++){const q=jt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P===void 0)continue;B.value=G+Z;const z=(g.height-(1+L+T))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ie=z+(te+M)*g.outputChannels+P;g.byteArray[Ie]=g.getter(k,B)}}}}}function Po(){const g=this,u=g.offset,B={value:0};for(let y=0;y<g.height/g.blockHeight;y++){const R=Le(g.viewer,u)-jt.dataWindow.yMin;g.size=Me(g.viewer,u),g.lines=R+g.blockHeight>g.height?g.height-R:g.blockHeight;const v=g.columns*g.totalBytes,M=g.size<g.lines*v?g.uncompress(g):De(g);u.value+=g.size;for(let L=0;L<g.blockHeight;L++){const _=y*g.blockHeight,k=L+g.scanOrder(_);if(k>=g.height)continue;const T=L*v,G=(g.height-1-k)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=jt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P!==void 0){B.value=T+Z;for(let z=0;z<g.columns;z++){const te=G+z*g.outputChannels+P;g.byteArray[te]=g.getter(M,B)}}}}}}function Oo(g,u,B){const y={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");y.version=g.getUint8(4);const R=g.getUint8(5);y.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},B.value=8;let v=!0;for(;v;){const M=qe(u,B);if(M==0)v=!1;else{const L=qe(u,B),_=Me(g,B),k=Lo(g,u,B,L,_);k===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):y[M]=k}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",y),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return y}function Ho(g,u,B,y,R){const v={size:0,viewer:u,array:B,offset:y,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:Ve};switch(g.compression){case"NO_COMPRESSION":v.blockHeight=1,v.uncompress=De;break;case"RLE_COMPRESSION":v.blockHeight=1,v.uncompress=se;break;case"ZIPS_COMPRESSION":v.blockHeight=1,v.uncompress=oe;break;case"ZIP_COMPRESSION":v.blockHeight=16,v.uncompress=oe;break;case"PIZ_COMPRESSION":v.blockHeight=32,v.uncompress=Ae;break;case"PXR24_COMPRESSION":v.blockHeight=16,v.uncompress=Se;break;case"DWAA_COMPRESSION":v.blockHeight=32,v.uncompress=fe;break;case"DWAB_COMPRESSION":v.blockHeight=256,v.uncompress=fe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const M={};for(const T of g.channels)switch(T.name){case"Y":case"R":case"G":case"B":case"A":M[T.name]=!0,v.type=T.pixelType}let L=!1;if(M.R&&M.G&&M.B)L=!M.A,v.outputChannels=4,v.decodeChannels={R:0,G:1,B:2,A:3};else if(M.Y)v.outputChannels=1,v.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(v.type==1)switch(R){case pt:v.getter=vo;break;case Xe:v.getter=cs;break}else if(v.type==2)switch(R){case pt:v.getter=He;break;case Xe:v.getter=yo}else throw new Error("EXRLoader.parse: unsupported pixelType "+v.type+" for "+g.compression+".");v.columns=v.width;const _=v.width*v.height*v.outputChannels;switch(R){case pt:v.byteArray=new Float32Array(_),L&&v.byteArray.fill(1,0,_);break;case Xe:v.byteArray=new Uint16Array(_),L&&v.byteArray.fill(15360,0,_);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let k=0;for(const T of g.channels)v.decodeChannels[T.name]!==void 0&&(v.channelByteOffsets[T.name]=k),k+=T.pixelType*2;if(v.totalBytes=k,v.outLineWidth=v.width*v.outputChannels,g.lineOrder==="INCREASING_Y"?v.scanOrder=T=>T:v.scanOrder=T=>v.height-1-T,v.outputChannels==4?(v.format=Nt,v.colorSpace=Ve):(v.format=ts,v.colorSpace=Hs),g.spec.singleTile){v.blockHeight=g.tiles.ySize,v.blockWidth=g.tiles.xSize;const T=Uo(g.tiles,v.width,v.height),G=bn(T,v.width,g.tiles.xSize,g.tiles.roundingMode),U=bn(T,v.height,g.tiles.ySize,g.tiles.roundingMode);v.tileCount=G[0]*U[0];for(let q=0;q<T;q++)for(let Z=0;Z<U[q];Z++)for(let P=0;P<G[q];P++)Ne(u,y);v.decode=Go.bind(v)}else{v.blockWidth=v.width;const T=Math.ceil(v.height/v.blockHeight);for(let G=0;G<T;G++)Ne(u,y);v.decode=Po.bind(v)}return v}const In={value:0},En=new DataView(e),jo=new Uint8Array(e),jt=Oo(En,e,In),es=Ho(jt,En,jo,In,this.type);return es.decode(),{header:jt,width:es.width,height:es.height,data:es.byteArray,format:es.format,colorSpace:es.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){a.colorSpace=r.colorSpace,a.minFilter=it,a.magFilter=it,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,r)}return super.load(e,n,i,s)}}class ic extends Pn{constructor(e){super(e),this.type=Xe}parse(e){const t=function(m,I){switch(m){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},i=function(m,I,E){I=I||1024;let C=m.pos,Q=-1,w=0,x="",D=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));for(;0>(Q=D.indexOf(`
5
- `))&&w<I&&C<m.byteLength;)x+=D,w+=D.length,C+=128,D+=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));return-1<Q?(m.pos+=w+Q+1,x+D.slice(0,Q)):!1},s=function(m){const I=/^#\?(\S+)/,E=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,C=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,Q=/^\s*FORMAT=(\S+)\s*$/,w=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,x={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,S;for((m.pos>=m.byteLength||!(D=i(m)))&&t(1,"no header found"),(S=D.match(I))||t(3,"bad initial token"),x.valid|=1,x.programtype=S[1],x.string+=D+`
6
- `;D=i(m),D!==!1;){if(x.string+=D+`
7
- `,D.charAt(0)==="#"){x.comments+=D+`
8
- `;continue}if((S=D.match(E))&&(x.gamma=parseFloat(S[1])),(S=D.match(C))&&(x.exposure=parseFloat(S[1])),(S=D.match(Q))&&(x.valid|=2,x.format=S[1]),(S=D.match(w))&&(x.valid|=4,x.height=parseInt(S[1],10),x.width=parseInt(S[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},n=function(m,I,E){const C=I;if(C<8||C>32767||m[0]!==2||m[1]!==2||m[2]&128)return new Uint8Array(m);C!==(m[2]<<8|m[3])&&t(3,"wrong scanline width");const Q=new Uint8Array(4*I*E);Q.length||t(4,"unable to allocate buffer space");let w=0,x=0;const D=4*C,S=new Uint8Array(4),F=new Uint8Array(D);let Y=E;for(;Y>0&&x<m.byteLength;){x+4>m.byteLength&&t(1),S[0]=m[x++],S[1]=m[x++],S[2]=m[x++],S[3]=m[x++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=C)&&t(3,"bad rgbe scanline format");let V=0,K;for(;V<D&&x<m.byteLength;){K=m[x++];const j=K>128;if(j&&(K-=128),(K===0||V+K>D)&&t(3,"bad scanline data"),j){const X=m[x++];for(let J=0;J<K;J++)F[V++]=X}else F.set(m.subarray(x,x+K),V),V+=K,x+=K}const W=C;for(let j=0;j<W;j++){let X=0;Q[w]=F[j+X],X+=C,Q[w+1]=F[j+X],X+=C,Q[w+2]=F[j+X],X+=C,Q[w+3]=F[j+X],w+=4}Y--}return Q},a=function(m,I,E,C){const Q=m[I+3],w=Math.pow(2,Q-128)/255;E[C+0]=m[I+0]*w,E[C+1]=m[I+1]*w,E[C+2]=m[I+2]*w,E[C+3]=1},r=function(m,I,E,C){const Q=m[I+3],w=Math.pow(2,Q-128)/255;E[C+0]=ss.toHalfFloat(Math.min(m[I+0]*w,65504)),E[C+1]=ss.toHalfFloat(Math.min(m[I+1]*w,65504)),E[C+2]=ss.toHalfFloat(Math.min(m[I+2]*w,65504)),E[C+3]=ss.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=s(A),l=c.width,h=c.height,d=n(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case pt:b=d.length/4;const m=new Float32Array(b*4);for(let E=0;E<b;E++)a(d,E*4,m,E*4);p=m,f=pt;break;case Xe:b=d.length/4;const I=new Uint16Array(b*4);for(let E=0;E<b;E++)r(d,E*4,I,E*4);p=I,f=Xe;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:l,height:h,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:f}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){switch(a.type){case pt:case Xe:a.colorSpace=Ve,a.minFilter=it,a.magFilter=it,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,r)}return super.load(e,n,i,s)}}const Vt=new Qi,je=new N,Ht=new N,Ce=new we,Ua={X:new N(1,0,0),Y:new N(0,1,0),Z:new N(0,0,1)},tn={type:"change"},Ga={type:"mouseDown",mode:null},Pa={type:"mouseUp",mode:null},Oa={type:"objectChange"};class nc extends On{constructor(e,t=null){super(void 0,t);const i=new lc(this);this._root=i;const s=new za;this._gizmo=s,i.add(s);const n=new hc;this._plane=n,i.add(n);const a=this;function r(C,Q){let w=Q;Object.defineProperty(a,C,{get:function(){return w!==void 0?w:Q},set:function(x){w!==x&&(w=x,n[C]=x,s[C]=x,a.dispatchEvent({type:C+"-changed",value:x}),a.dispatchEvent(tn))}}),a[C]=Q,n[C]=Q,s[C]=Q}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const A=new N,c=new N,l=new we,h=new we,d=new N,p=new we,f=new N,b=new N,m=new N,I=0,E=new N;r("worldPosition",A),r("worldPositionStart",c),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",d),r("cameraQuaternion",p),r("pointStart",f),r("pointEnd",b),r("rotationAxis",m),r("rotationAngle",I),r("eye",E),this._offset=new N,this._startNorm=new N,this._endNorm=new N,this._cameraScale=new N,this._parentPosition=new N,this._parentQuaternion=new we,this._parentQuaternionInv=new we,this._parentScale=new N,this._worldScaleStart=new N,this._worldQuaternionInv=new we,this._worldScale=new N,this._positionStart=new N,this._quaternionStart=new we,this._scaleStart=new N,this._getPointer=ac.bind(this),this._onPointerDown=rc.bind(this),this._onPointerHover=oc.bind(this),this._onPointerMove=Ac.bind(this),this._onPointerUp=cc.bind(this),t!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&Vt.setFromCamera(e,this.camera);const t=sn(this._gizmo.picker[this.mode],Vt);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&Vt.setFromCamera(e,this.camera);const t=sn(this._plane,Vt,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Ga.mode=this.mode,this.dispatchEvent(Ga)}}pointerMove(e){const t=this.axis,i=this.mode,s=this.object;let n=this.space;if(i==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&Vt.setFromCamera(e,this.camera);const a=sn(this._plane,Vt,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(s.position.applyQuaternion(Ce.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),n==="world"&&(s.parent&&s.position.add(je.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(je.setFromMatrixPosition(s.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),Ht.set(r,r,r)}else je.copy(this.pointStart),Ht.copy(this.pointEnd),je.applyQuaternion(this._worldQuaternionInv),Ht.applyQuaternion(this._worldQuaternionInv),Ht.divide(je),t.search("X")===-1&&(Ht.x=1),t.search("Y")===-1&&(Ht.y=1),t.search("Z")===-1&&(Ht.z=1);s.scale.copy(this._scaleStart).multiply(Ht),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(je.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(je.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Ua[t]),je.copy(Ua[t]),n==="local"&&je.applyQuaternion(this.worldQuaternion),je.cross(this.eye),je.length()===0?A=!0:this.rotationAngle=this._offset.dot(je.normalize())*r),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(tn),this.dispatchEvent(Oa)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Pa.mode=this.mode,this.dispatchEvent(Pa)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(tn),this.dispatchEvent(Oa),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Vt}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function ac(o){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:o.button};{const e=this.domElement.getBoundingClientRect();return{x:(o.clientX-e.left)/e.width*2-1,y:-(o.clientY-e.top)/e.height*2+1,button:o.button}}}function oc(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function rc(o){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(o)),this.pointerDown(this._getPointer(o)))}function Ac(o){this.enabled&&this.pointerMove(this._getPointer(o))}function cc(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function sn(o,e,t){const i=e.intersectObject(o,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||t)return i[s];return!1}const Js=new Ut,de=new N(0,1,0),Ha=new N(0,0,0),ja=new le,Vs=new we,Ws=new we,Bt=new N,qa=new le,vs=new N(1,0,0),Wt=new N(0,1,0),xs=new N(0,0,1),Xs=new N,Ss=new N,Ds=new N;class lc extends It{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}}class za extends It{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new mt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new St({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const s=t.clone();s.opacity=.5;const n=e.clone();n.color.setHex(16711680);const a=e.clone();a.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const l=e.clone();l.color.setHex(255),l.opacity=.5;const h=e.clone();h.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const p=e.clone();p.color.setHex(7895160);const f=new Ze(0,.04,.1,12);f.translate(0,.05,0);const b=new Ye(.08,.08,.08);b.translate(0,.04,0);const m=new rt;m.setAttribute("position",new Te([0,0,0,1,0,0],3));const I=new Ze(.0075,.0075,.5,3);I.translate(0,.25,0);function E(j,X){const J=new fs(j,.0075,3,64,X*Math.PI*2);return J.rotateY(Math.PI/2),J.rotateX(Math.PI/2),J}function C(){const j=new rt;return j.setAttribute("position",new Te([0,0,0,1,1,1],3)),j}const Q={X:[[new O(f,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,n),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new O(f,a),[0,.5,0]],[new O(f,a),[0,-.5,0],[Math.PI,0,0]],[new O(I,a)]],Z:[[new O(f,r),[0,0,.5],[Math.PI/2,0,0]],[new O(f,r),[0,0,-.5],[-Math.PI/2,0,0]],[new O(I,r),null,[Math.PI/2,0,0]]],XYZ:[[new O(new qs(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new Ze(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),i),[0,.3,0]],[new O(new Ze(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new qs(.2,0),i)]],XY:[[new O(new Ye(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new O(new qs(.01,2),s),null,null,null,"helper"]],END:[[new O(new qs(.01,2),s),null,null,null,"helper"]],DELTA:[[new gt(C(),s),null,null,null,"helper"]],X:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new O(E(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(E(.5,.5),n)]],Y:[[new O(E(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new O(E(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(E(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},F={XYZE:[[new O(new oi(.25,10,8),i)]],X:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new fs(.75,.1,2,24),i)]]},Y={X:[[new O(b,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]],[new O(b,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new O(b,a),[0,.5,0]],[new O(I,a)],[new O(b,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new O(b,r),[0,0,.5],[Math.PI/2,0,0]],[new O(I,r),[0,0,0],[Math.PI/2,0,0]],[new O(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.1,.1,.1),h.clone())]]},V={X:[[new O(new Ze(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),i),[0,.3,0]],[new O(new Ze(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.2,.2,.2),i),[0,0,0]]]},K={X:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function W(j){const X=new It;for(const J in j)for(let ee=j[J].length;ee--;){const $=j[J][ee][0].clone(),ue=j[J][ee][1],De=j[J][ee][2],se=j[J][ee][3],oe=j[J][ee][4];$.name=J,$.tag=oe,ue&&$.position.set(ue[0],ue[1],ue[2]),De&&$.rotation.set(De[0],De[1],De[2]),se&&$.scale.set(se[0],se[1],se[2]),$.updateMatrix();const Ae=$.geometry.clone();Ae.applyMatrix4($.matrix),$.geometry=Ae,$.renderOrder=1/0,$.position.set(0,0,0),$.rotation.set(0,0,0),$.scale.set(1,1,1),X.add($)}return X}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=W(Q)),this.add(this.gizmo.rotate=W(D)),this.add(this.gizmo.scale=W(Y)),this.add(this.picker.translate=W(w)),this.add(this.picker.rotate=W(F)),this.add(this.picker.scale=W(V)),this.add(this.helper.translate=W(x)),this.add(this.helper.rotate=W(S)),this.add(this.helper.scale=W(K)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Ws;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let s=0;s<i.length;s++){const n=i[s];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let a;if(this.camera.isOrthographicCamera?a=(this.camera.top-this.camera.bottom)/this.camera.zoom:a=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(a*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(Ce.setFromEuler(Js.set(0,0,0)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(Ce.setFromEuler(Js.set(0,0,Math.PI/2)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Ce.setFromEuler(Js.set(0,Math.PI/2,0)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Ce.setFromEuler(Js.set(0,Math.PI/2,0)),de.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ja.lookAt(Ha,de,Wt)),n.quaternion.multiply(Ce),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),je.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),je.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(je),n.visible=this.dragging):(n.quaternion.copy(t),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Vs.copy(t),de.copy(this.eye).applyQuaternion(Ce.copy(t).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ja.lookAt(this.eye,Ha,Wt)),n.name==="X"&&(Ce.setFromAxisAngle(vs,Math.atan2(-de.y,de.z)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce)),n.name==="Y"&&(Ce.setFromAxisAngle(Wt,Math.atan2(de.x,de.z)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce)),n.name==="Z"&&(Ce.setFromAxisAngle(xs,Math.atan2(de.y,de.x)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(e)}}class hc extends O{constructor(){super(new yi(1e5,1e5,2,2),new mt({visible:!1,wireframe:!0,side:gi,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Xs.copy(vs).applyQuaternion(t==="local"?this.worldQuaternion:Ws),Ss.copy(Wt).applyQuaternion(t==="local"?this.worldQuaternion:Ws),Ds.copy(xs).applyQuaternion(t==="local"?this.worldQuaternion:Ws),de.copy(Ss),this.mode){case"translate":case"scale":switch(this.axis){case"X":de.copy(this.eye).cross(Xs),Bt.copy(Xs).cross(de);break;case"Y":de.copy(this.eye).cross(Ss),Bt.copy(Ss).cross(de);break;case"Z":de.copy(this.eye).cross(Ds),Bt.copy(Ds).cross(de);break;case"XY":Bt.copy(Ds);break;case"YZ":Bt.copy(Xs);break;case"XZ":de.copy(Ds),Bt.copy(Ss);break;case"XYZ":case"E":Bt.set(0,0,0);break}break;default:Bt.set(0,0,0)}Bt.length()===0?this.quaternion.copy(this.cameraQuaternion):(qa.lookAt(je.set(0,0,0),Bt,de),this.quaternion.setFromRotationMatrix(qa)),super.updateMatrixWorld(e)}}const Ya={type:"change"},nn={type:"start"},Ka={type:"end"},gc={type:"endMovement"},Zs=new Ar,Ja=new cr,dc=Math.cos(70*Ee.DEG2RAD),ke=new N;new N;const et=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Xt=1e-6;let pc=class extends On{constructor(o,e=null){super(o,e),this.state=he.NONE,this.enabled=!0,this.target=new N,this.cursor=new N,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:is.ROTATE,MIDDLE:is.DOLLY,RIGHT:is.PAN},this.touches={ONE:ns.ROTATE,TWO:ns.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new N,this._lastQuaternion=new we,this._lastTargetPosition=new N,this._quat=new we().setFromUnitVectors(o.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Hn,this._sphericalDelta=new Hn,this._scale=1,this._currentScale=1,this._panOffset=new N,this._rotateStart=new _e,this._rotateEnd=new _e,this._rotateDelta=new _e,this._panStart=new _e,this._panEnd=new _e,this._panDelta=new _e,this._dollyStart=new _e,this._dollyEnd=new _e,this._dollyDelta=new _e,this._dollyDirection=new N,this._mouse=new _e,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=fc.bind(this),this._onPointerDown=uc.bind(this),this._onPointerUp=mc.bind(this),this._onContextMenu=Qc.bind(this),this._onMouseWheel=Ec.bind(this),this._onKeyDown=Cc.bind(this),this._onTouchStart=Bc.bind(this),this._onTouchMove=wc.bind(this),this._onMouseDown=bc.bind(this),this._onMouseMove=Ic.bind(this),this._interceptControlDown=yc.bind(this),this._interceptControlUp=vc.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Ya),this.update(),this.state=he.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);ke.copy(e).sub(this.target),ke.applyQuaternion(this._quat),this._spherical.setFromVector3(ke),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let t=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(t)&&isFinite(i)&&(t<-Math.PI?t+=et:t>Math.PI&&(t-=et),i<-Math.PI?i+=et:i>Math.PI&&(i-=et),t<=i?this._spherical.theta=Math.max(t,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+i)/2?Math.max(t,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.enableDamping?this._currentScale=Ee.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const n=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(n-this._spherical.radius)>Xt*100}if(ke.setFromSpherical(this._spherical),ke.applyQuaternion(this._quatInverse),e.copy(this.target).add(ke),this.object.parent?this.object.parent.worldToLocal(e):this.object.position.copy(e),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let n=null;if(this.object.isPerspectiveCamera){const a=ke.length();n=this._clampDistance(a*this._currentScale);const r=a-n;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),s=Math.abs(r)>Xt}else if(this.object.isOrthographicCamera){const a=new N(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const r=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),s=Math.abs(r-this.object.zoom)>Xt;const A=new N(this._mouse.x,this._mouse.y,0);A.unproject(this.object),this.object.position.sub(A).add(a),this.object.updateMatrixWorld(),n=ke.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;n!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position):(Zs.origin.copy(this.object.position),Zs.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Zs.direction))<dc?this.object.lookAt(this.target):(Ja.setFromNormalAndCoplanarPoint(this.object.up,this.target),Zs.intersectPlane(Ja,this.target))))}else if(this.object.isOrthographicCamera){const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(n-this.object.zoom)>Xt&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>Xt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xt||this._lastTargetPosition.distanceToSquared(this.target)>Xt?(this.dispatchEvent(Ya),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(gc)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?et/60*this.autoRotateSpeed*o:et/60/60*this.autoRotateSpeed}_getZoomScale(o){const e=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,e){ke.setFromMatrixColumn(e,0),ke.multiplyScalar(-o),this._panOffset.add(ke)}_panUp(o,e){this.screenSpacePanning===!0?ke.setFromMatrixColumn(e,1):(ke.setFromMatrixColumn(e,0),ke.crossVectors(this.object.up,ke)),ke.multiplyScalar(o),this._panOffset.add(ke)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(ke).sub(this.target);let i=ke.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*i/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*i/t.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/t.clientWidth,this.object.matrixWorld),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/t.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const t=this.domElement.getBoundingClientRect(),i=o-t.left,s=e-t.top,n=t.width,a=t.height;this._mouse.x=i/n*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(et*this._rotateDelta.x/e.clientHeight),this._rotateUp(et*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(o){this._panEnd.set(o.clientX,o.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let e=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(et*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(-et*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(et*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(-et*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._rotateStart.set(t,i)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._panStart.set(t,i)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const t=this._getSecondPointerPosition(o),i=.5*(o.pageX+t.x),s=.5*(o.pageY+t.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(et*this._rotateDelta.x/e.clientHeight),this._rotateUp(et*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._panEnd.set(t,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const n=(o.pageX+e.x)*.5,a=(o.pageY+e.y)*.5;this._updateZoomParameters(n,a)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(o){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId)return!0;return!1}_trackPointer(o){let e=this._pointerPositions[o.pointerId];e===void 0&&(e=new _e,this._pointerPositions[o.pointerId]=e),e.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const e=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(o){const e=o.deltaMode,t={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(e){case 1:t.deltaY*=16;break;case 2:t.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(t.deltaY*=10),t}};function uc(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o)))}function fc(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function mc(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Ka),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function bc(o){let e;switch(o.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case is.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=he.DOLLY;break;case is.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}break;case is.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(nn)}function Ic(o){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Ec(o){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(o.preventDefault(),this.dispatchEvent(nn),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(Ka))}function Cc(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function Bc(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case ns.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=he.TOUCH_ROTATE;break;case ns.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case ns.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=he.TOUCH_DOLLY_PAN;break;case ns.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(nn)}function wc(o){switch(this._trackPointer(o),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=he.NONE}}function Qc(o){this.enabled!==!1&&o.preventDefault()}function yc(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function vc(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class xc extends gt{constructor(e,t=1,i=16,s=2){const n=new rt,a=i+s*2,r=new Float32Array((a*3+3)*3);n.setAttribute("position",new st(r,3));const A=new St({color:65280}),c=new St({color:16776960});super(n,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=i,this.divisionsOuterAngle=s,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,n=Ee.degToRad(e.panner.coneInnerAngle),a=Ee.degToRad(e.panner.coneOuterAngle),r=n/2,A=a/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(m,I,E,C){const Q=(I-m)/E;for(f.setXYZ(c,0,0,0),l++,h=m;h<I;h+=Q)d=c+l,f.setXYZ(d,Math.sin(h)*t,0,Math.cos(h)*t),f.setXYZ(d+1,Math.sin(Math.min(h+Q,I))*t,0,Math.cos(Math.min(h+Q,I))*t),f.setXYZ(d+2,0,0,0),l+=3;p.addGroup(c,l,C),c+=l,l=0}b(-A,-r,s,0),b(-r,r,i,1),b(r,A,s,0),f.needsUpdate=!0,n===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Sc={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
1
+ import{Mesh as j,SphereGeometry as is,Vector3 as U,MeshBasicMaterial as It,TrianglesDrawMode as hr,TriangleFanDrawMode as ns,TriangleStripDrawMode as fi,Loader as Mt,LoaderUtils as Vt,FileLoader as ut,MeshPhysicalMaterial as Ct,Vector2 as Ge,Color as xe,LinearSRGBColorSpace as Me,SRGBColorSpace as ge,SpotLight as mi,PointLight as os,DirectionalLight as Ei,Matrix4 as de,InstancedMesh as gr,Quaternion as De,InstancedBufferAttribute as dr,Object3D as Bt,TextureLoader as rs,ImageBitmapLoader as pr,BufferAttribute as nt,InterleavedBuffer as Ii,LinearMipmapLinearFilter as ua,NearestMipmapLinearFilter as Ci,LinearMipmapNearestFilter as Bi,NearestMipmapNearestFilter as As,LinearFilter as $e,NearestFilter as ba,RepeatWrapping as Wt,MirroredRepeatWrapping as wi,ClampToEdgeWrapping as Ua,PointsMaterial as fa,Material as ma,LineBasicMaterial as _t,MeshStandardMaterial as cs,DoubleSide as ls,PropertyBinding as Lt,BufferGeometry as lt,SkinnedMesh as yi,LineSegments as Pa,Line as bt,LineLoop as ur,Points as Ga,Group as Zt,PerspectiveCamera as hs,MathUtils as we,OrthographicCamera as Qi,Skeleton as vi,AnimationClip as xi,Bone as gs,InterpolateDiscrete as Di,InterpolateLinear as ds,InterleavedBufferAttribute as qt,Texture as ps,VectorKeyframeTrack as us,NumberKeyframeTrack as bs,QuaternionKeyframeTrack as fs,ColorManagement as Ye,FrontSide as Si,Interpolant as br,Box3 as Oa,Sphere as ms,CompressedCubeTexture as fr,CompressedArrayTexture as mr,CompressedTexture as Ea,NoColorSpace as Es,RGBA_PVRTC_2BPPV1_Format as Ri,RGBA_PVRTC_4BPPV1_Format as Is,RGBA_BPTC_Format as Cs,RED_GREEN_RGTC2_Format as Er,SIGNED_RED_GREEN_RGTC2_Format as Ir,RED_RGTC1_Format as Cr,SIGNED_RED_RGTC1_Format as Br,RGBA_S3TC_DXT5_Format as Bs,RGB_S3TC_DXT1_Format as Ti,RGBA_S3TC_DXT1_Format as ws,RGBA_ASTC_6x6_Format as ys,RGBA_ASTC_4x4_Format as ja,SIGNED_RG11_EAC_Format as wr,RG11_EAC_Format as yr,SIGNED_R11_EAC_Format as Qr,R11_EAC_Format as vr,RGB_ETC2_Format as ki,RGBA_ETC2_EAC_Format as Fi,RGBFormat as Qs,RedFormat as Nt,RGFormat as wt,RGBAFormat as ot,UnsignedByteType as le,HalfFloatType as Xe,UnsignedInt101111Type as Mi,UnsignedInt5999Type as _i,FloatType as ft,DataTexture as xr,Data3DTexture as Dr,RGB_PVRTC_4BPPV1_Format as Sr,RGB_ETC1_Format as Rr,RGB_BPTC_UNSIGNED_Format as Tr,NodeFrame as kr,ShaderLib as yt,ExtrudeGeometry as Fr,ShapePath as Mr,DataTextureLoader as Li,DataUtils as oa,CylinderGeometry as et,BoxGeometry as Ve,Float32BufferAttribute as _e,OctahedronGeometry as qa,TorusGeometry as Ia,Euler as Ht,Controls as Ni,Raycaster as vs,PlaneGeometry as Ui,MOUSE as ra,TOUCH as Aa,Spherical as Pi,Ray as _r,Plane as Lr,REVISION as Nr,Source as Ur,ImageUtils as Pr,Scene as Gi,InstancedBufferGeometry as Gr,InstancedInterleavedBuffer as xs,WireframeGeometry as Or,ShaderMaterial as jr,UniformsUtils as Oi,UniformsLib as Ha,Vector4 as Qt,Line3 as qr,CanvasTexture as Hr,Matrix3 as ji,Curve as Kr,MeshPhongMaterial as Ca,MeshLambertMaterial as zr,EquirectangularReflectionMapping as Jr,AmbientLight as Yr,Uint16BufferAttribute as Xr,ShapeUtils as Vr,DefaultLoadingManager as Wr}from"./three.min.js";class Zr extends j{constructor(e,t,s,a=128){if(t<=0||s<=0||a<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new is(s,2*a,a);i.scale(1,1,-1);const n=i.getAttribute("position"),r=new U;for(let A=0;A<n.count;++A)if(r.fromBufferAttribute(n,A),r.y<0){const h=-t*3/2,c=r.y<h?-t/r.y:1-r.y*r.y/(3*h*h);r.multiplyScalar(c),r.toArray(n.array,3*A)}n.needsUpdate=!0,super(i,new It({map:e,depthWrite:!1}))}}function $r(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},s=o.getIndex(),a=o.getAttribute("position"),i=s?s.count:a.count;let n=0;const r=Object.keys(o.attributes),A={},h={},c=[],l=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let I=0,C=r.length;I<C;I++){const Q=r[I],w=o.attributes[Q];A[Q]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[Q];x&&(h[Q]||(h[Q]=[]),x.forEach((S,D)=>{const M=new S.array.constructor(S.count*S.itemSize);h[Q][D]=new S.constructor(M,S.itemSize,S.normalized)}))}const p=e*.5,b=Math.log10(1/e),m=Math.pow(10,b),f=p*m;for(let I=0;I<i;I++){const C=s?s.getX(I):I;let Q="";for(let w=0,x=r.length;w<x;w++){const S=r[w],D=o.getAttribute(S),M=D.itemSize;for(let O=0;O<M;O++)Q+=`${~~(D[l[O]](C)*m+f)},`}if(Q in t)c.push(t[Q]);else{for(let w=0,x=r.length;w<x;w++){const S=r[w],D=o.getAttribute(S),M=o.morphAttributes[S],O=D.itemSize,z=A[S],Y=h[S];for(let ee=0;ee<O;ee++){const J=l[ee],X=d[ee];if(z[X](n,D[J](C)),M)for(let V=0,W=M.length;V<W;V++)Y[V][X](n,M[V][J](C))}}t[Q]=n,c.push(n),n++}}const E=o.clone();for(const I in o.attributes){const C=A[I];if(E.setAttribute(I,new C.constructor(C.array.slice(0,n*C.itemSize),C.itemSize,C.normalized)),I in h)for(let Q=0;Q<h[I].length;Q++){const w=h[I][Q];E.morphAttributes[I][Q]=new w.constructor(w.array.slice(0,n*w.itemSize),w.itemSize,w.normalized)}}return E.setIndex(c),E}function qi(o,e){if(e===hr)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===ns||e===fi){let t=o.getIndex();if(t===null){const n=[],r=o.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)n.push(A);o.setIndex(n),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const s=t.count-2,a=[];if(e===ns)for(let n=1;n<=s;n++)a.push(t.getX(0)),a.push(t.getX(n)),a.push(t.getX(n+1));else for(let n=0;n<s;n++)n%2===0?(a.push(t.getX(n)),a.push(t.getX(n+1)),a.push(t.getX(n+2))):(a.push(t.getX(n+2)),a.push(t.getX(n+1)),a.push(t.getX(n)));a.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=o.clone();return i.setIndex(a),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}function eA(o){const e=new Map,t=new Map,s=o.clone();return Hi(o,s,function(a,i){e.set(i,a),t.set(a,i)}),s.traverse(function(a){if(!a.isSkinnedMesh)return;const i=a,n=e.get(a),r=n.skeleton.bones;i.skeleton=n.skeleton.clone(),i.bindMatrix.copy(n.bindMatrix),i.skeleton.bones=r.map(function(A){return t.get(A)}),i.bind(i.skeleton,i.bindMatrix)}),s}function Hi(o,e,t){t(o,e);for(let s=0;s<o.children.length;s++)Hi(o.children[s],e.children[s],t)}class Ds extends Mt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new nA(t)}),this.register(function(t){return new oA(t)}),this.register(function(t){return new uA(t)}),this.register(function(t){return new bA(t)}),this.register(function(t){return new fA(t)}),this.register(function(t){return new AA(t)}),this.register(function(t){return new cA(t)}),this.register(function(t){return new lA(t)}),this.register(function(t){return new hA(t)}),this.register(function(t){return new iA(t)}),this.register(function(t){return new gA(t)}),this.register(function(t){return new rA(t)}),this.register(function(t){return new pA(t)}),this.register(function(t){return new dA(t)}),this.register(function(t){return new aA(t)}),this.register(function(t){return new Ki(t,ie.EXT_MESHOPT_COMPRESSION)}),this.register(function(t){return new Ki(t,ie.KHR_MESHOPT_COMPRESSION)}),this.register(function(t){return new mA(t)})}load(e,t,s,a){const i=this;let n;if(this.resourcePath!=="")n=this.resourcePath;else if(this.path!==""){const h=Vt.extractUrlBase(e);n=Vt.resolveURL(h,this.path)}else n=Vt.extractUrlBase(e);this.manager.itemStart(e);const r=function(h){a?a(h):console.error(h),i.manager.itemError(e),i.manager.itemEnd(e)},A=new ut(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(h){try{i.parse(h,n,function(c){t(c),i.manager.itemEnd(e)},r)}catch(c){r(c)}},s,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,a){let i,n;const r={},A={},h=new TextDecoder;if(typeof e=="string")try{i=JSON.parse(e)}catch(l){n=e,a&&a(l);return}else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===zi){try{r[ie.KHR_BINARY_GLTF]=new EA(e)}catch(l){a&&a(l);return}try{i=JSON.parse(r[ie.KHR_BINARY_GLTF].content)}catch(l){n=r[ie.KHR_BINARY_GLTF].content,a&&a(l);return}}else try{i=JSON.parse(h.decode(e))}catch(l){n=h.decode(e),a&&a(l);return}else i=e;if(i.asset===void 0||i.asset.version[0]<2){a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=i,this.jsonErrorData=n;const c=new kA(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){const d=this.pluginCallbacks[l](c);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(i.extensionsUsed)for(let l=0;l<i.extensionsUsed.length;++l){const d=i.extensionsUsed[l],p=i.extensionsRequired||[];switch(d){case ie.KHR_MATERIALS_UNLIT:r[d]=new sA;break;case ie.KHR_DRACO_MESH_COMPRESSION:r[d]=new IA(i,this.dracoLoader);break;case ie.KHR_TEXTURE_TRANSFORM:r[d]=new CA;break;case ie.KHR_MESH_QUANTIZATION:r[d]=new BA;break;default:p.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(r),c.setPlugins(A),c.parse(s,a)}parseAsync(e,t){const s=this;return new Promise(function(a,i){s.parse(e,t,a,i)})}}function tA(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}function Re(o,e,t){const s=o.json.materials[e];return s.extensions&&s.extensions[t]?s.extensions[t]:null}const ie={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class aA{constructor(e){this.parser=e,this.name=ie.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,a=t.length;s<a;s++){const i=t[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let a=t.cache.get(s);if(a)return a;const i=t.json,n=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let r;const A=new xe(16777215);n.color!==void 0&&A.setRGB(n.color[0],n.color[1],n.color[2],Me);const h=n.range!==void 0?n.range:0;switch(n.type){case"directional":r=new Ei(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new os(A),r.distance=h;break;case"spot":r=new mi(A),r.distance=h,n.spot=n.spot||{},n.spot.innerConeAngle=n.spot.innerConeAngle!==void 0?n.spot.innerConeAngle:0,n.spot.outerConeAngle=n.spot.outerConeAngle!==void 0?n.spot.outerConeAngle:Math.PI/4,r.angle=n.spot.outerConeAngle,r.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+n.type)}return r.position.set(0,0,0),vt(r,n),n.intensity!==void 0&&(r.intensity=n.intensity),r.name=t.createUniqueName(n.name||"light_"+e),a=Promise.resolve(r),t.cache.add(s,a),a}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,a=s.json.nodes[e],i=(a.extensions&&a.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(n){return s._getNodeRef(t.cache,i,n)})}}let sA=class{constructor(){this.name=ie.KHR_MATERIALS_UNLIT}getMaterialType(){return It}extendParams(o,e,t){const s=[];o.color=new xe(1,1,1),o.opacity=1;const a=e.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const i=a.baseColorFactor;o.color.setRGB(i[0],i[1],i[2],Me),o.opacity=i[3]}a.baseColorTexture!==void 0&&s.push(t.assignTexture(o,"map",a.baseColorTexture,ge))}return Promise.all(s)}},iA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);return t===null||t.emissiveStrength!==void 0&&(e.emissiveIntensity=t.emissiveStrength),Promise.resolve()}},nA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_CLEARCOAT}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];if(t.clearcoatFactor!==void 0&&(e.clearcoat=t.clearcoatFactor),t.clearcoatTexture!==void 0&&s.push(this.parser.assignTexture(e,"clearcoatMap",t.clearcoatTexture)),t.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=t.clearcoatRoughnessFactor),t.clearcoatRoughnessTexture!==void 0&&s.push(this.parser.assignTexture(e,"clearcoatRoughnessMap",t.clearcoatRoughnessTexture)),t.clearcoatNormalTexture!==void 0&&(s.push(this.parser.assignTexture(e,"clearcoatNormalMap",t.clearcoatNormalTexture)),t.clearcoatNormalTexture.scale!==void 0)){const a=t.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Ge(a,a)}return Promise.all(s)}},oA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_DISPERSION}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);return t===null||(e.dispersion=t.dispersion!==void 0?t.dispersion:0),Promise.resolve()}},rA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_IRIDESCENCE}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];return t.iridescenceFactor!==void 0&&(e.iridescence=t.iridescenceFactor),t.iridescenceTexture!==void 0&&s.push(this.parser.assignTexture(e,"iridescenceMap",t.iridescenceTexture)),t.iridescenceIor!==void 0&&(e.iridescenceIOR=t.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),t.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=t.iridescenceThicknessMinimum),t.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=t.iridescenceThicknessMaximum),t.iridescenceThicknessTexture!==void 0&&s.push(this.parser.assignTexture(e,"iridescenceThicknessMap",t.iridescenceThicknessTexture)),Promise.all(s)}},AA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_SHEEN}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];if(e.sheenColor=new xe(0,0,0),e.sheenRoughness=0,e.sheen=1,t.sheenColorFactor!==void 0){const a=t.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],Me)}return t.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=t.sheenRoughnessFactor),t.sheenColorTexture!==void 0&&s.push(this.parser.assignTexture(e,"sheenColorMap",t.sheenColorTexture,ge)),t.sheenRoughnessTexture!==void 0&&s.push(this.parser.assignTexture(e,"sheenRoughnessMap",t.sheenRoughnessTexture)),Promise.all(s)}},cA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_TRANSMISSION}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];return t.transmissionFactor!==void 0&&(e.transmission=t.transmissionFactor),t.transmissionTexture!==void 0&&s.push(this.parser.assignTexture(e,"transmissionMap",t.transmissionTexture)),Promise.all(s)}},lA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_VOLUME}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];e.thickness=t.thicknessFactor!==void 0?t.thicknessFactor:0,t.thicknessTexture!==void 0&&s.push(this.parser.assignTexture(e,"thicknessMap",t.thicknessTexture)),e.attenuationDistance=t.attenuationDistance||1/0;const a=t.attenuationColor||[1,1,1];return e.attenuationColor=new xe().setRGB(a[0],a[1],a[2],Me),Promise.all(s)}},hA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_IOR}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);return t===null||(e.ior=t.ior!==void 0?t.ior:1.5),Promise.resolve()}},gA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_SPECULAR}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];e.specularIntensity=t.specularFactor!==void 0?t.specularFactor:1,t.specularTexture!==void 0&&s.push(this.parser.assignTexture(e,"specularIntensityMap",t.specularTexture));const a=t.specularColorFactor||[1,1,1];return e.specularColor=new xe().setRGB(a[0],a[1],a[2],Me),t.specularColorTexture!==void 0&&s.push(this.parser.assignTexture(e,"specularColorMap",t.specularColorTexture,ge)),Promise.all(s)}},dA=class{constructor(o){this.parser=o,this.name=ie.EXT_MATERIALS_BUMP}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];return e.bumpScale=t.bumpFactor!==void 0?t.bumpFactor:1,t.bumpTexture!==void 0&&s.push(this.parser.assignTexture(e,"bumpMap",t.bumpTexture)),Promise.all(s)}},pA=class{constructor(o){this.parser=o,this.name=ie.KHR_MATERIALS_ANISOTROPY}getMaterialType(o){return Re(this.parser,o,this.name)!==null?Ct:null}extendMaterialParams(o,e){const t=Re(this.parser,o,this.name);if(t===null)return Promise.resolve();const s=[];return t.anisotropyStrength!==void 0&&(e.anisotropy=t.anisotropyStrength),t.anisotropyRotation!==void 0&&(e.anisotropyRotation=t.anisotropyRotation),t.anisotropyTexture!==void 0&&s.push(this.parser.assignTexture(e,"anisotropyMap",t.anisotropyTexture)),Promise.all(s)}};class uA{constructor(e){this.parser=e,this.name=ie.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,a=s.textures[e];if(!a.extensions||!a.extensions[this.name])return null;const i=a.extensions[this.name],n=t.options.ktx2Loader;if(!n){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,n)}}class bA{constructor(e){this.parser=e,this.name=ie.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,s=this.parser,a=s.json,i=a.textures[e];if(!i.extensions||!i.extensions[t])return null;const n=i.extensions[t],r=a.images[n.source];let A=s.textureLoader;if(r.uri){const h=s.options.manager.getHandler(r.uri);h!==null&&(A=h)}return s.loadTextureImage(e,n.source,A)}}class fA{constructor(e){this.parser=e,this.name=ie.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,s=this.parser,a=s.json,i=a.textures[e];if(!i.extensions||!i.extensions[t])return null;const n=i.extensions[t],r=a.images[n.source];let A=s.textureLoader;if(r.uri){const h=s.options.manager.getHandler(r.uri);h!==null&&(A=h)}return s.loadTextureImage(e,n.source,A)}}class Ki{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const a=s.extensions[this.name],i=this.parser.getDependency("buffer",a.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(r){const A=a.byteOffset||0,h=a.byteLength||0,c=a.count,l=a.byteStride,d=new Uint8Array(r,A,h);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(c,l,d,a.mode,a.filter).then(function(p){return p.buffer}):n.ready.then(function(){const p=new ArrayBuffer(c*l);return n.decodeGltfBuffer(new Uint8Array(p),c,l,d,a.mode,a.filter),p})})}else return null}}let mA=class{constructor(o){this.name=ie.EXT_MESH_GPU_INSTANCING,this.parser=o}createNodeMesh(o){const e=this.parser.json,t=e.nodes[o];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const s=e.meshes[t.mesh];for(const r of s.primitives)if(r.mode!==ht.TRIANGLES&&r.mode!==ht.TRIANGLE_STRIP&&r.mode!==ht.TRIANGLE_FAN&&r.mode!==void 0)return null;const a=t.extensions[this.name].attributes,i=[],n={};for(const r in a)i.push(this.parser.getDependency("accessor",a[r]).then(A=>(n[r]=A,n[r])));return i.length<1?null:(i.push(this.parser.createNodeMesh(o)),Promise.all(i).then(r=>{const A=r.pop(),h=A.isGroup?A.children:[A],c=r[0].count,l=[];for(const d of h){const p=new de,b=new U,m=new De,f=new U(1,1,1),E=new gr(d.geometry,d.material,c);for(let I=0;I<c;I++)n.TRANSLATION&&b.fromBufferAttribute(n.TRANSLATION,I),n.ROTATION&&m.fromBufferAttribute(n.ROTATION,I),n.SCALE&&f.fromBufferAttribute(n.SCALE,I),E.setMatrixAt(I,p.compose(b,m,f));for(const I in n)if(I==="_COLOR_0"){const C=n[I];E.instanceColor=new dr(C.array,C.itemSize,C.normalized)}else I!=="TRANSLATION"&&I!=="ROTATION"&&I!=="SCALE"&&d.geometry.setAttribute(I,n[I]);Bt.prototype.copy.call(E,d),this.parser.assignFinalMaterial(E),l.push(E)}return A.isGroup?(A.clear(),A.add(...l),A):l[0]}))}};const zi="glTF",Ba=12,Ji={JSON:1313821514,BIN:5130562};class EA{constructor(e){this.name=ie.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ba),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==zi)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const a=this.header.length-Ba,i=new DataView(e,Ba);let n=0;for(;n<a;){const r=i.getUint32(n,!0);n+=4;const A=i.getUint32(n,!0);if(n+=4,A===Ji.JSON){const h=new Uint8Array(e,Ba+n,r);this.content=s.decode(h)}else if(A===Ji.BIN){const h=Ba+n;this.body=e.slice(h,h+r)}n+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class IA{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ie.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,a=this.dracoLoader,i=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,r={},A={},h={};for(const c in n){const l=Rs[c]||c.toLowerCase();r[l]=n[c]}for(const c in e.attributes){const l=Rs[c]||c.toLowerCase();if(n[c]!==void 0){const d=s.accessors[e.attributes[c]],p=ca[d.componentType];h[l]=p.name,A[l]=d.normalized===!0}}return t.getDependency("bufferView",i).then(function(c){return new Promise(function(l,d){a.decodeDracoFile(c,function(p){for(const b in p.attributes){const m=p.attributes[b],f=A[b];f!==void 0&&(m.normalized=f)}l(p)},r,h,Me,d)})})}}class CA{constructor(){this.name=ie.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class BA{constructor(){this.name=ie.KHR_MESH_QUANTIZATION}}class Yi extends br{constructor(e,t,s,a){super(e,t,s,a)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,a=this.valueSize,i=e*a*3+a;for(let n=0;n!==a;n++)t[n]=s[i+n];return t}interpolate_(e,t,s,a){const i=this.resultBuffer,n=this.sampleValues,r=this.valueSize,A=r*2,h=r*3,c=a-t,l=(s-t)/c,d=l*l,p=d*l,b=e*h,m=b-h,f=-2*p+3*d,E=p-d,I=1-f,C=E-d+l;for(let Q=0;Q!==r;Q++){const w=n[m+Q+r],x=n[m+Q+A]*c,S=n[b+Q+r],D=n[b+Q]*c;i[Q]=I*w+C*x+f*S+E*D}return i}}const wA=new De;class yA extends Yi{interpolate_(e,t,s,a){const i=super.interpolate_(e,t,s,a);return wA.fromArray(i).normalize().toArray(i),i}}const ht={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ca={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Xi={9728:ba,9729:$e,9984:As,9985:Bi,9986:Ci,9987:ua},Vi={33071:Ua,33648:wi,10497:Wt},Ss={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Rs={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Kt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},QA={CUBICSPLINE:void 0,LINEAR:ds,STEP:Di},Ts={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new cs({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Si})),o.DefaultMaterial}function $t(o,e,t){for(const s in t.extensions)o[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function vt(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function xA(o,e,t){let s=!1,a=!1,i=!1;for(let h=0,c=e.length;h<c;h++){const l=e[h];if(l.POSITION!==void 0&&(s=!0),l.NORMAL!==void 0&&(a=!0),l.COLOR_0!==void 0&&(i=!0),s&&a&&i)break}if(!s&&!a&&!i)return Promise.resolve(o);const n=[],r=[],A=[];for(let h=0,c=e.length;h<c;h++){const l=e[h];if(s){const d=l.POSITION!==void 0?t.getDependency("accessor",l.POSITION):o.attributes.position;n.push(d)}if(a){const d=l.NORMAL!==void 0?t.getDependency("accessor",l.NORMAL):o.attributes.normal;r.push(d)}if(i){const d=l.COLOR_0!==void 0?t.getDependency("accessor",l.COLOR_0):o.attributes.color;A.push(d)}}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(A)]).then(function(h){const c=h[0],l=h[1],d=h[2];return s&&(o.morphAttributes.position=c),a&&(o.morphAttributes.normal=l),i&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function DA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let s=0,a=t.length;s<a;s++)o.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function SA(o){let e;const t=o.extensions&&o.extensions[ie.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+ks(t.attributes):e=o.indices+":"+ks(o.attributes)+":"+o.mode,o.targets!==void 0)for(let s=0,a=o.targets.length;s<a;s++)e+=":"+ks(o.targets[s]);return e}function ks(o){let e="";const t=Object.keys(o).sort();for(let s=0,a=t.length;s<a;s++)e+=t[s]+":"+o[t[s]]+";";return e}function Fs(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function RA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":o.search(/\.ktx2($|\?)/i)>0||o.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const TA=new de;class kA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new tA,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,a=-1,i=!1,n=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const r=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);a=s&&A?parseInt(A[1],10):-1,i=r.indexOf("Firefox")>-1,n=i?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&a<17||i&&n<98?this.textureLoader=new rs(this.options.manager):this.textureLoader=new pr(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ut(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,a=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(n){return n._markDefs&&n._markDefs()}),Promise.all(this._invokeAll(function(n){return n.beforeRoot&&n.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(n){const r={scene:n[0][a.scene||0],scenes:n[0],animations:n[1],cameras:n[2],asset:a.asset,parser:s,userData:{}};return $t(i,r,a),vt(r,a),Promise.all(s._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let a=0,i=t.length;a<i;a++){const n=t[a].joints;for(let r=0,A=n.length;r<A;r++)e[n[r]].isBone=!0}for(let a=0,i=e.length;a<i;a++){const n=e[a];n.mesh!==void 0&&(this._addNodeRef(this.meshCache,n.mesh),n.skin!==void 0&&(s[n.mesh].isSkinnedMesh=!0)),n.camera!==void 0&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const a=s.clone(),i=(n,r)=>{const A=this.associations.get(n);A!=null&&this.associations.set(r,A);for(const[h,c]of n.children.entries())i(c,r.children[h])};return i(s,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const a=e(t[s]);if(a)return a}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let a=0;a<t.length;a++){const i=e(t[a]);i&&s.push(i)}return s}getDependency(e,t){const s=e+":"+t;let a=this.cache.get(s);if(!a){switch(e){case"scene":a=this.loadScene(t);break;case"node":a=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":a=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":a=this.loadAccessor(t);break;case"bufferView":a=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":a=this.loadBuffer(t);break;case"material":a=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":a=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":a=this.loadSkin(t);break;case"animation":a=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":a=this.loadCamera(t);break;default:if(a=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!a)throw new Error("Unknown type: "+e);break}this.cache.add(s,a)}return a}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,a=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(a.map(function(i,n){return s.getDependency(e,n)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ie.KHR_BINARY_GLTF].body);const a=this.options;return new Promise(function(i,n){s.load(Vt.resolveURL(t.uri,a.path),i,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const a=t.byteLength||0,i=t.byteOffset||0;return s.slice(i,i+a)})}loadAccessor(e){const t=this,s=this.json,a=this.json.accessors[e];if(a.bufferView===void 0&&a.sparse===void 0){const n=Ss[a.type],r=ca[a.componentType],A=a.normalized===!0,h=new r(a.count*n);return Promise.resolve(new nt(h,n,A))}const i=[];return a.bufferView!==void 0?i.push(this.getDependency("bufferView",a.bufferView)):i.push(null),a.sparse!==void 0&&(i.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(i).then(function(n){const r=n[0],A=Ss[a.type],h=ca[a.componentType],c=h.BYTES_PER_ELEMENT,l=c*A,d=a.byteOffset||0,p=a.bufferView!==void 0?s.bufferViews[a.bufferView].byteStride:void 0,b=a.normalized===!0;let m,f;if(p&&p!==l){const E=Math.floor(d/p),I="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+E+":"+a.count;let C=t.cache.get(I);C||(m=new h(r,E*p,a.count*p/c),C=new Ii(m,p/c),t.cache.add(I,C)),f=new qt(C,A,d%p/c,b)}else r===null?m=new h(a.count*A):m=new h(r,d,a.count*A),f=new nt(m,A,b);if(a.sparse!==void 0){const E=Ss.SCALAR,I=ca[a.sparse.indices.componentType],C=a.sparse.indices.byteOffset||0,Q=a.sparse.values.byteOffset||0,w=new I(n[1],C,a.sparse.count*E),x=new h(n[2],Q,a.sparse.count*A);r!==null&&(f=new nt(f.array.slice(),f.itemSize,f.normalized)),f.normalized=!1;for(let S=0,D=w.length;S<D;S++){const M=w[S];if(f.setX(M,x[S*A]),A>=2&&f.setY(M,x[S*A+1]),A>=3&&f.setZ(M,x[S*A+2]),A>=4&&f.setW(M,x[S*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}f.normalized=b}return f})}loadTexture(e){const t=this.json,s=this.options,a=t.textures[e].source,i=t.images[a];let n=this.textureLoader;if(i.uri){const r=s.manager.getHandler(i.uri);r!==null&&(n=r)}return this.loadTextureImage(e,a,n)}loadTextureImage(e,t,s){const a=this,i=this.json,n=i.textures[e],r=i.images[t],A=(r.uri||r.bufferView)+":"+n.sampler;if(this.textureCache[A])return this.textureCache[A];const h=this.loadImageSource(t,s).then(function(c){c.flipY=!1,c.name=n.name||r.name||"",c.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(c.name=r.uri);const l=(i.samplers||{})[n.sampler]||{};return c.magFilter=Xi[l.magFilter]||$e,c.minFilter=Xi[l.minFilter]||ua,c.wrapS=Vi[l.wrapS]||Wt,c.wrapT=Vi[l.wrapT]||Wt,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==ba&&c.minFilter!==$e,c.anisotropy=4,a.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[A]=h,h}loadImageSource(e,t){const s=this,a=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(l=>l.clone());const n=a.images[e],r=self.URL||self.webkitURL;let A=n.uri||"",h=!1;if(n.bufferView!==void 0)A=s.getDependency("bufferView",n.bufferView).then(function(l){h=!0;const d=new Blob([l],{type:n.mimeType});return A=r.createObjectURL(d),A});else if(n.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(A).then(function(l){return new Promise(function(d,p){let b=d;t.isImageBitmapLoader===!0&&(b=function(m){const f=new ps(m);f.needsUpdate=!0,d(f)}),t.load(Vt.resolveURL(l,i.path),b,void 0,p)})}).then(function(l){return h===!0&&r.revokeObjectURL(A),vt(l,n),l.userData.mimeType=n.mimeType||RA(n.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),l});return this.sourceCache[e]=c,c}assignTexture(e,t,s,a){const i=this;return this.getDependency("texture",s.index).then(function(n){if(!n)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(n=n.clone(),n.channel=s.texCoord),i.extensions[ie.KHR_TEXTURE_TRANSFORM]){const r=s.extensions!==void 0?s.extensions[ie.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=i.associations.get(n);n=i.extensions[ie.KHR_TEXTURE_TRANSFORM].extendTexture(n,r),i.associations.set(n,A)}}return a!==void 0&&(n.colorSpace=a),e[t]=n,n})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const a=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,n=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new fa,ma.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,A.sizeAttenuation=!1,this.cache.add(r,A)),s=A}else if(e.isLine){const r="LineBasicMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new _t,ma.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,this.cache.add(r,A)),s=A}if(a||i||n){let r="ClonedMaterial:"+s.uuid+":";a&&(r+="derivative-tangents:"),i&&(r+="vertex-colors:"),n&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=s.clone(),i&&(A.vertexColors=!0),n&&(A.flatShading=!0),a&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(s))),s=A}e.material=s}getMaterialType(){return cs}loadMaterial(e){const t=this,s=this.json,a=this.extensions,i=s.materials[e];let n;const r={},A=i.extensions||{},h=[];if(A[ie.KHR_MATERIALS_UNLIT]){const l=a[ie.KHR_MATERIALS_UNLIT];n=l.getMaterialType(),h.push(l.extendParams(r,i,t))}else{const l=i.pbrMetallicRoughness||{};if(r.color=new xe(1,1,1),r.opacity=1,Array.isArray(l.baseColorFactor)){const d=l.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],Me),r.opacity=d[3]}l.baseColorTexture!==void 0&&h.push(t.assignTexture(r,"map",l.baseColorTexture,ge)),r.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,r.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(r,"metalnessMap",l.metallicRoughnessTexture)),h.push(t.assignTexture(r,"roughnessMap",l.metallicRoughnessTexture))),n=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}i.doubleSided===!0&&(r.side=ls);const c=i.alphaMode||Ts.OPAQUE;if(c===Ts.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,c===Ts.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&n!==It&&(h.push(t.assignTexture(r,"normalMap",i.normalTexture)),r.normalScale=new Ge(1,1),i.normalTexture.scale!==void 0)){const l=i.normalTexture.scale;r.normalScale.set(l,l)}if(i.occlusionTexture!==void 0&&n!==It&&(h.push(t.assignTexture(r,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&n!==It){const l=i.emissiveFactor;r.emissive=new xe().setRGB(l[0],l[1],l[2],Me)}return i.emissiveTexture!==void 0&&n!==It&&h.push(t.assignTexture(r,"emissiveMap",i.emissiveTexture,ge)),Promise.all(h).then(function(){const l=new n(r);return i.name&&(l.name=i.name),vt(l,i),t.associations.set(l,{materials:e}),i.extensions&&$t(a,l,i),l})}createUniqueName(e){const t=Lt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,a=this.primitiveCache;function i(r){return s[ie.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return Wi(A,r,t)})}const n=[];for(let r=0,A=e.length;r<A;r++){const h=e[r],c=SA(h),l=a[c];if(l)n.push(l.promise);else{let d;h.extensions&&h.extensions[ie.KHR_DRACO_MESH_COMPRESSION]?d=i(h):d=Wi(new lt,h,t),a[c]={primitive:h,promise:d},n.push(d)}}return Promise.all(n)}loadMesh(e){const t=this,s=this.json,a=this.extensions,i=s.meshes[e],n=i.primitives,r=[];for(let A=0,h=n.length;A<h;A++){const c=n[A].material===void 0?vA(this.cache):this.getDependency("material",n[A].material);r.push(c)}return r.push(t.loadGeometries(n)),Promise.all(r).then(function(A){const h=A.slice(0,A.length-1),c=A[A.length-1],l=[];for(let p=0,b=c.length;p<b;p++){const m=c[p],f=n[p];let E;const I=h[p];if(f.mode===ht.TRIANGLES||f.mode===ht.TRIANGLE_STRIP||f.mode===ht.TRIANGLE_FAN||f.mode===void 0)E=i.isSkinnedMesh===!0?new yi(m,I):new j(m,I),E.isSkinnedMesh===!0&&E.normalizeSkinWeights(),f.mode===ht.TRIANGLE_STRIP?E.geometry=qi(E.geometry,fi):f.mode===ht.TRIANGLE_FAN&&(E.geometry=qi(E.geometry,ns));else if(f.mode===ht.LINES)E=new Pa(m,I);else if(f.mode===ht.LINE_STRIP)E=new bt(m,I);else if(f.mode===ht.LINE_LOOP)E=new ur(m,I);else if(f.mode===ht.POINTS)E=new Ga(m,I);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+f.mode);Object.keys(E.geometry.morphAttributes).length>0&&DA(E,i),E.name=t.createUniqueName(i.name||"mesh_"+e),vt(E,i),f.extensions&&$t(a,E,f),t.assignFinalMaterial(E),l.push(E)}for(let p=0,b=l.length;p<b;p++)t.associations.set(l[p],{meshes:e,primitives:p});if(l.length===1)return i.extensions&&$t(a,l[0],i),l[0];const d=new Zt;i.extensions&&$t(a,d,i),t.associations.set(d,{meshes:e});for(let p=0,b=l.length;p<b;p++)d.add(l[p]);return d})}loadCamera(e){let t;const s=this.json.cameras[e],a=s[s.type];if(!a){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new hs(we.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):s.type==="orthographic"&&(t=new Qi(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),vt(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let a=0,i=t.joints.length;a<i;a++)s.push(this._loadNodeShallow(t.joints[a]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(a){const i=a.pop(),n=a,r=[],A=[];for(let h=0,c=n.length;h<c;h++){const l=n[h];if(l){r.push(l);const d=new de;i!==null&&d.fromArray(i.array,h*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[h])}return new vi(r,A)})}loadAnimation(e){const t=this.json,s=this,a=t.animations[e],i=a.name?a.name:"animation_"+e,n=[],r=[],A=[],h=[],c=[];let l=0,d=a.channels.length;for(l=0,d=a.channels.length;l<d;l++){const p=a.channels[l],b=a.samplers[p.sampler],m=p.target,f=m.node,E=a.parameters!==void 0?a.parameters[b.input]:b.input,I=a.parameters!==void 0?a.parameters[b.output]:b.output;m.node!==void 0&&(n.push(this.getDependency("node",f)),r.push(this.getDependency("accessor",E)),A.push(this.getDependency("accessor",I)),h.push(b),c.push(m))}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(A),Promise.all(h),Promise.all(c)]).then(function(p){const b=p[0],m=p[1],f=p[2],E=p[3],I=p[4],C=[];for(l=0,d=b.length;l<d;l++){const w=b[l],x=m[l],S=f[l],D=E[l],M=I[l];if(w===void 0)continue;w.updateMatrix&&w.updateMatrix();const O=s._createAnimationTracks(w,x,S,D,M);if(O)for(let z=0;z<O.length;z++)C.push(O[z])}const Q=new xi(i,void 0,C);return vt(Q,a),Q})}createNodeMesh(e){const t=this.json,s=this,a=t.nodes[e];return a.mesh===void 0?null:s.getDependency("mesh",a.mesh).then(function(i){const n=s._getNodeRef(s.meshCache,a.mesh,i);return a.weights!==void 0&&n.traverse(function(r){if(r.isMesh)for(let A=0,h=a.weights.length;A<h;A++)r.morphTargetInfluences[A]=a.weights[A]}),n})}loadNode(e){const t=this.json,s=this,a=t.nodes[e],i=s._loadNodeShallow(e),n=[],r=a.children||[];for(let h=0,c=r.length;h<c;h++)n.push(s.getDependency("node",r[h]));const A=a.skin===void 0?Promise.resolve(null):s.getDependency("skin",a.skin);return Promise.all([i,Promise.all(n),A]).then(function(h){const c=h[0],l=h[1],d=h[2];d!==null&&c.traverse(function(p){p.isSkinnedMesh&&p.bind(d,TA)});for(let p=0,b=l.length;p<b;p++)c.add(l[p]);if(c.userData.pivot!==void 0&&l.length>0){const p=c.userData.pivot,b=l[0];c.pivot=new U().fromArray(p),c.position.x-=p[0],c.position.y-=p[1],c.position.z-=p[2],b.position.set(0,0,0),delete c.userData.pivot}return c})}_loadNodeShallow(e){const t=this.json,s=this.extensions,a=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],n=i.name?a.createUniqueName(i.name):"",r=[],A=a._invokeOne(function(h){return h.createNodeMesh&&h.createNodeMesh(e)});return A&&r.push(A),i.camera!==void 0&&r.push(a.getDependency("camera",i.camera).then(function(h){return a._getNodeRef(a.cameraCache,i.camera,h)})),a._invokeAll(function(h){return h.createNodeAttachment&&h.createNodeAttachment(e)}).forEach(function(h){r.push(h)}),this.nodeCache[e]=Promise.all(r).then(function(h){let c;if(i.isBone===!0?c=new gs:h.length>1?c=new Zt:h.length===1?c=h[0]:c=new Bt,c!==h[0])for(let l=0,d=h.length;l<d;l++)c.add(h[l]);if(i.name&&(c.userData.name=i.name,c.name=n),vt(c,i),i.extensions&&$t(s,c,i),i.matrix!==void 0){const l=new de;l.fromArray(i.matrix),c.applyMatrix4(l)}else i.translation!==void 0&&c.position.fromArray(i.translation),i.rotation!==void 0&&c.quaternion.fromArray(i.rotation),i.scale!==void 0&&c.scale.fromArray(i.scale);if(!a.associations.has(c))a.associations.set(c,{});else if(i.mesh!==void 0&&a.meshCache.refs[i.mesh]>1){const l=a.associations.get(c);a.associations.set(c,{...l})}return a.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],a=this,i=new Zt;s.name&&(i.name=a.createUniqueName(s.name)),vt(i,s),s.extensions&&$t(t,i,s);const n=s.nodes||[],r=[];for(let A=0,h=n.length;A<h;A++)r.push(a.getDependency("node",n[A]));return Promise.all(r).then(function(A){for(let c=0,l=A.length;c<l;c++){const d=A[c];d.parent!==null?i.add(eA(d)):i.add(d)}const h=c=>{const l=new Map;for(const[d,p]of a.associations)(d instanceof ma||d instanceof ps)&&l.set(d,p);return c.traverse(d=>{const p=a.associations.get(d);p!=null&&l.set(d,p)}),l};return a.associations=h(i),i})}_createAnimationTracks(e,t,s,a,i){const n=[],r=e.name?e.name:e.uuid,A=[];Kt[i.path]===Kt.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let h;switch(Kt[i.path]){case Kt.weights:h=bs;break;case Kt.rotation:h=fs;break;case Kt.translation:case Kt.scale:h=us;break;default:s.itemSize===1?h=bs:h=us;break}const c=a.interpolation!==void 0?QA[a.interpolation]:ds,l=this._getArrayFromAccessor(s);for(let d=0,p=A.length;d<p;d++){const b=new h(A[d]+"."+Kt[i.path],t.array,l,c);a.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),n.push(b)}return n}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Fs(t.constructor),a=new Float32Array(t.length);for(let i=0,n=t.length;i<n;i++)a[i]=t[i]*s;t=a}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const s=this instanceof fs?yA:Yi;return new s(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function FA(o,e,t){const s=e.attributes,a=new Oa;if(s.POSITION!==void 0){const r=t.json.accessors[s.POSITION],A=r.min,h=r.max;if(A!==void 0&&h!==void 0){if(a.set(new U(A[0],A[1],A[2]),new U(h[0],h[1],h[2])),r.normalized){const c=Fs(ca[r.componentType]);a.min.multiplyScalar(c),a.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const r=new U,A=new U;for(let h=0,c=i.length;h<c;h++){const l=i[h];if(l.POSITION!==void 0){const d=t.json.accessors[l.POSITION],p=d.min,b=d.max;if(p!==void 0&&b!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(b[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(b[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(b[2]))),d.normalized){const m=Fs(ca[d.componentType]);A.multiplyScalar(m)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(r)}o.boundingBox=a;const n=new ms;a.getCenter(n.center),n.radius=a.min.distanceTo(a.max)/2,o.boundingSphere=n}function Wi(o,e,t){const s=e.attributes,a=[];function i(n,r){return t.getDependency("accessor",n).then(function(A){o.setAttribute(r,A)})}for(const n in s){const r=Rs[n]||n.toLowerCase();r in o.attributes||a.push(i(s[n],r))}if(e.indices!==void 0&&!o.index){const n=t.getDependency("accessor",e.indices).then(function(r){o.setIndex(r)});a.push(n)}return Ye.workingColorSpace!==Me&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ye.workingColorSpace}" not supported.`),vt(o,e),FA(o,e,t),Promise.all(a).then(function(){return e.targets!==void 0?xA(o,e.targets,t):o})}var MA=function(){var o="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb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bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:XseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk::ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxabaiarcefciGfcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGfgkcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabaiarcufciGfcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkabakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuec:q:6dkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:Ctklbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaoclffaqc:q:yjjbfRbbfhoxikaic8Wfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaocwffaqc:q:yjjbfRbbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitc:q1jjbfpbibaic:q:yjjbfRbbgipsaoRbegqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqc:q:yjjbfRbbfhokalc;abfhialcjefaX0meaihlamao9Rc;Fb0mbkkdnaiaX9pmbaici4hlinamao9RcK6mwa5aifhqdndndndndndnaOaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaoclffahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssss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a8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk:TseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:2Pliur97eue978Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskaipxFubbFubbFubbFubbgxpklbdnalTmbcbhvabhdinadczfgmampbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblbaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbaiaxpkladnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblaaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk:Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpx:ji:1S:ji:1S:ji:1S:ji:1SaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83ibawarp5bampEd:T:j83ibaocwfaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83ibaoaxp5bampEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgmpklbaiampklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipx:ji:1S:ji:1S:ji:1S:ji:1SaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83iKaiarp5bampEd:T:j83izaiaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83iwaiaxp5bampEb:T:j83ibkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk:CPvdue97euw97eu8Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadpbbbhradpxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpkbbadczfhdaoclfgoal6mbkkalaeSmeaiavpklaaicafabalcdtfgdaeciGglcdtgo;8qbbaiavpklbdnalTmbaipblahraipxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpklakadaicafao;8qbbskaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadczfgspxbFu9hbFu9hbFu9hbFu9hadpbbbgDaspbbbgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblbp9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpkbbadaxarpmbezHdiOAlvCXorQLpkbbadcafhdaoclfgoal6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgrpklbaiarpklbaiabalcitfgdaeciGglcitgo;8qbbaiavpkladnalTmbaipxbFu9hbFu9hbFu9hbFu9haipblbgDaipblzgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblap9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpklzaiaxarpmbezHdiOAlvCXorQLpklbkadaiao;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var a=WebAssembly.validate(t)?r(e):r(o),i,n=WebAssembly.instantiate(a,{}).then(function(E){i=E.instance,i.exports.__wasm_call_ctors()});function r(E){for(var I=new Uint8Array(E.length),C=0;C<E.length;++C){var Q=E.charCodeAt(C);I[C]=Q>96?Q-97:Q>64?Q-39:Q+4}for(var w=0,C=0;C<E.length;++C)I[w++]=I[C]<60?s[I[C]]:(I[C]-60)*64+I[++C];return I.buffer.slice(0,w)}function A(E,I,C,Q,w,x,S){var D=E.exports.sbrk,M=Q+3&-4,O=D(M*w),z=D(x.length),Y=new Uint8Array(E.exports.memory.buffer);Y.set(x,z);var ee=I(O,Q,w,z,x.length);if(ee==0&&S&&S(O,M,w),C.set(Y.subarray(O,O+Q*w)),D(O-D(0)),ee!=0)throw new Error("Malformed buffer data: "+ee)}var h={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],d=0;function p(E){var I={object:new Worker(E),pending:0,requests:{}};return I.object.onmessage=function(C){var Q=C.data;I.pending-=Q.count,I.requests[Q.id][Q.action](Q.value),delete I.requests[Q.id]},I}function b(E){for(var I="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+f.name+";"+A.toString()+f.toString(),C=new Blob([I],{type:"text/javascript"}),Q=URL.createObjectURL(C),w=l.length;w<E;++w)l[w]=p(Q);for(var w=E;w<l.length;++w)l[w].object.postMessage({});l.length=E,URL.revokeObjectURL(Q)}function m(E,I,C,Q,w){for(var x=l[0],S=1;S<l.length;++S)l[S].pending<x.pending&&(x=l[S]);return new Promise(function(D,M){var O=new Uint8Array(C),z=++d;x.pending+=E,x.requests[z]={resolve:D,reject:M},x.object.postMessage({id:z,count:E,size:I,source:O,mode:Q,filter:w},[O.buffer])})}function f(E){var I=E.data;if(!I.id)return self.close();self.ready.then(function(C){try{var Q=new Uint8Array(I.count*I.size);A(C,C.exports[I.mode],Q,I.count,I.size,I.source,C.exports[I.filter]),self.postMessage({id:I.id,count:I.count,action:"resolve",value:Q},[Q.buffer])}catch(w){self.postMessage({id:I.id,count:I.count,action:"reject",value:w})}})}return{ready:n,supported:!0,useWorkers:function(E){b(E)},decodeVertexBuffer:function(E,I,C,Q,w){A(i,i.exports.meshopt_decodeVertexBuffer,E,I,C,Q,i.exports[h[w]])},decodeIndexBuffer:function(E,I,C,Q){A(i,i.exports.meshopt_decodeIndexBuffer,E,I,C,Q)},decodeIndexSequence:function(E,I,C,Q){A(i,i.exports.meshopt_decodeIndexSequence,E,I,C,Q)},decodeGltfBuffer:function(E,I,C,Q,w,x){A(i,i.exports[c[w]],E,I,C,Q,i.exports[h[x]])},decodeGltfBufferAsync:function(E,I,C,Q,w){return l.length>0?m(E,I,C,c[Q],h[w]):n.then(function(){var x=new Uint8Array(E*I);return A(i,i.exports[c[Q]],x,E,I,C,i.exports[h[w]]),x})}}}();const Ms=new WeakMap;class _A extends Mt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,a){const i=new ut(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,n=>{this.parse(n,t,a)},s,a)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,ge,s).catch(s)}decodeDracoFile(e,t,s,a,i=Me,n=()=>{}){const r={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:i};return this.decodeGeometry(e,r).then(t).catch(n)}decodeGeometry(e,t){const s=JSON.stringify(t);if(Ms.has(e)){const A=Ms.get(e);if(A.key===s)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let a;const i=this.workerNextTaskID++,n=e.byteLength,r=this._getWorker(i,n).then(A=>(a=A,new Promise((h,c)=>{a._callbacks[i]={resolve:h,reject:c},a.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{a&&i&&this._releaseTask(a,i)}),Ms.set(e,{key:s,promise:r}),r}_createGeometry(e){const t=new lt;e.index&&t.setIndex(new nt(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const{name:a,array:i,itemSize:n,stride:r,vertexColorSpace:A}=e.attributes[s];let h;if(n===r)h=new nt(i,n);else{const c=new Ii(i,r);h=new qt(c,n,0)}a==="color"&&(this._assignVertexColorSpace(h,A),h.normalized=!(i instanceof Float32Array)),t.setAttribute(a,h)}return t}_assignVertexColorSpace(e,t){if(t!==ge)return;const s=new xe;for(let a=0,i=e.count;a<i;a++)s.fromBufferAttribute(e,a),Ye.colorSpaceToWorking(s,ge),e.setXYZ(a,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new ut(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((a,i)=>{s.load(e,a,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(s=>{const a=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const i=LA.toString(),n=["/* draco decoder */",a,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
2
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const a=new Worker(this.workerSourceURL);a._callbacks={},a._taskCosts={},a._taskLoad=0,a.postMessage({type:"init",decoderConfig:this.decoderConfig}),a.onmessage=function(i){const n=i.data;switch(n.type){case"decode":a._callbacks[n.id].resolve(n);break;case"error":a._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(a)}else this.workerPool.sort(function(a,i){return a._taskLoad>i._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function LA(){let o,e;onmessage=function(n){const r=n.data;switch(r.type){case"init":o=r.decoderConfig,e=new Promise(function(c){o.onModuleLoaded=function(l){c({draco:l})},DracoDecoderModule(o)});break;case"decode":const A=r.buffer,h=r.taskConfig;e.then(c=>{const l=c.draco,d=new l.Decoder;try{const p=t(l,d,new Int8Array(A),h),b=p.attributes.map(m=>m.array.buffer);p.index&&b.push(p.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:p},b)}catch(p){console.error(p),self.postMessage({type:"error",id:r.id,error:p.message})}finally{l.destroy(d)}});break}};function t(n,r,A,h){const c=h.attributeIDs,l=h.attributeTypes;let d,p;const b=r.GetEncodedGeometryType(A);if(b===n.TRIANGULAR_MESH)d=new n.Mesh,p=r.DecodeArrayToMesh(A,A.byteLength,d);else if(b===n.POINT_CLOUD)d=new n.PointCloud,p=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const m={index:null,attributes:[]};for(const f in c){const E=self[l[f]];let I,C;if(h.useUniqueIDs)C=c[f],I=r.GetAttributeByUniqueId(d,C);else{if(C=r.GetAttributeId(d,n[c[f]]),C===-1)continue;I=r.GetAttribute(d,C)}const Q=a(n,r,d,f,E,I);f==="color"&&(Q.vertexColorSpace=h.vertexColorSpace),m.attributes.push(Q)}return b===n.TRIANGULAR_MESH&&(m.index=s(n,r,d)),n.destroy(d),m}function s(n,r,A){const h=A.num_faces()*3,c=h*4,l=n._malloc(c);r.GetTrianglesUInt32Array(A,c,l);const d=new Uint32Array(n.HEAPF32.buffer,l,h).slice();return n._free(l),{array:d,itemSize:1}}function a(n,r,A,h,c,l){const d=A.num_points(),p=l.num_components(),b=i(n,c),m=p*c.BYTES_PER_ELEMENT,f=Math.ceil(m/4)*4,E=f/c.BYTES_PER_ELEMENT,I=d*m,C=d*f,Q=n._malloc(I);r.GetAttributeDataArrayForAllPoints(A,l,b,I,Q);const w=new c(n.HEAPF32.buffer,Q,I/c.BYTES_PER_ELEMENT);let x;if(m===f)x=w.slice();else{x=new c(C/c.BYTES_PER_ELEMENT);let S=0;for(let D=0,M=w.length;D<M;D++){for(let O=0;O<p;O++)x[S+O]=w[D*p+O];S+=E}}return n._free(Q),{name:h,count:d,itemSize:p,array:x,stride:E}}function i(n,r){switch(r){case Float32Array:return n.DT_FLOAT32;case Int8Array:return n.DT_INT8;case Int16Array:return n.DT_INT16;case Int32Array:return n.DT_INT32;case Uint8Array:return n.DT_UINT8;case Uint16Array:return n.DT_UINT16;case Uint32Array:return n.DT_UINT32}}}class NA{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const s=this.workersResolve[e];if(s&&s(t),this.queue.length){const{resolve:a,msg:i,transfer:n}=this.queue.shift();this.workersResolve[e]=a,this.workers[e].postMessage(i,n)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const a=this._getIdleWorker();a!==-1?(this._initWorker(a),this.workerStatus|=1<<a,this.workersResolve[a]=s,this.workers[a].postMessage(e,t)):this.queue.push({resolve:s,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const UA=0,Zi=2,PA=1,$i=2,GA=0,OA=1,jA=10,qA=0,en=9,tn=15,an=16,sn=22,nn=37,on=43,rn=76,An=83,cn=97,ln=100,hn=103,gn=109,dn=122,pn=123,un=131,bn=132,fn=133,mn=134,En=137,In=138,Cn=139,Bn=140,wn=141,yn=142,Qn=145,vn=146,xn=148,Dn=152,Sn=153,Rn=154,Tn=155,kn=156,Fn=157,Mn=158,_n=165,Ln=166,Nn=1000054e3,Un=1000054001,Pn=1000054004,Gn=1000054005,_s=1000066e3,On=1000066004;class wa{constructor(e,t,s,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=a,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const s=this._offset;let a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<e;)a++,this._offset++;return a<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,a)}}const We=[171,75,84,88,32,50,48,187,13,10,26,10];function jn(o){return new TextDecoder().decode(o)}function HA(o){const e=new Uint8Array(o.buffer,o.byteOffset,We.length);if(e[0]!==We[0]||e[1]!==We[1]||e[2]!==We[2]||e[3]!==We[3]||e[4]!==We[4]||e[5]!==We[5]||e[6]!==We[6]||e[7]!==We[7]||e[8]!==We[8]||e[9]!==We[9]||e[10]!==We[10]||e[11]!==We[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},s=17*Uint32Array.BYTES_PER_ELEMENT,a=new wa(o,We.length,s,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32(),t.levelCount=a._nextUint32(),t.supercompressionScheme=a._nextUint32();const i=a._nextUint32(),n=a._nextUint32(),r=a._nextUint32(),A=a._nextUint32(),h=a._nextUint64(),c=a._nextUint64(),l=3*Math.max(t.levelCount,1)*8,d=new wa(o,We.length+s,l,!0);for(let te=0,oe=Math.max(t.levelCount,1);te<oe;te++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new wa(o,i,n,!0);p._skip(4);const b=p._nextUint16(),m=p._nextUint16(),f=p._nextUint16(),E=p._nextUint16(),I={vendorId:b,descriptorType:m,versionNumber:f,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},C=(E/4-6)/4;for(let te=0;te<C;te++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),I.samples[te]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(I);const Q=new wa(o,r,A,!0);for(;Q._offset<A;){const te=Q._nextUint32(),oe=Q._scan(te),he=jn(oe);if(t.keyValue[he]=Q._nextUint8Array(te-oe.byteLength-1),he.match(/^ktx/i)){const Qe=jn(t.keyValue[he]);t.keyValue[he]=Qe.substring(0,Qe.lastIndexOf("\0"))}Q._skip(te%4?4-te%4:0)}if(c<=0)return t;const w=new wa(o,h,c,!0),x=w._nextUint16(),S=w._nextUint16(),D=w._nextUint32(),M=w._nextUint32(),O=w._nextUint32(),z=w._nextUint32(),Y=[];for(let te=0,oe=Math.max(t.levelCount,1);te<oe;te++)Y.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const ee=h+w._offset,J=ee+D,X=J+M,V=X+O,W=new Uint8Array(o.buffer,o.byteOffset+ee,D),ne=new Uint8Array(o.buffer,o.byteOffset+J,M),Ae=new Uint8Array(o.buffer,o.byteOffset+X,O),Oe=new Uint8Array(o.buffer,o.byteOffset+V,z);return t.globalData={endpointCount:x,selectorCount:S,imageDescs:Y,endpointsData:W,selectorsData:ne,tablesData:Ae,extendedData:Oe},t}let Ls,Ut,Ns;const Us={env:{emscripten_notify_memory_growth:function(o){Ns=new Uint8Array(Ut.exports.memory.buffer)}}};class KA{init(){return Ls||(Ls=typeof fetch<"u"?fetch("data:application/wasm;base64,"+qn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Us)).then(this._init):WebAssembly.instantiate(Buffer.from(qn,"base64"),Us).then(this._init),Ls)}_init(e){Ut=e.instance,Us.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ut)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,a=Ut.exports.malloc(s);Ns.set(e,a),t=t||Number(Ut.exports.ZSTD_findDecompressedSize(a,s));const i=Ut.exports.malloc(t),n=Ut.exports.ZSTD_decompress(i,t,a,s),r=Ns.slice(i,i+n);return Ut.exports.free(a),Ut.exports.free(i),r}}const qn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lz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gAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAg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gMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQ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0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKA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2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0A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AABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",zA="display-p3",JA="display-p3-linear";({...Ye.spaces[ge]});const Ps=new WeakMap;let Gs=0,Os;class dt extends Mt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new NA,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},typeof navigator<"u"&&typeof navigator.platform<"u"&&typeof navigator.userAgent<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new ut(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new ut(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const a=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,a]).then(([i,n])=>{const r=dt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(dt.EngineFormat),"let _EngineType = "+JSON.stringify(dt.EngineType),"let _TranscoderFormat = "+JSON.stringify(dt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(dt.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
3
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=n,this.workerPool.setWorkerCreator(()=>{const h=new Worker(this.workerSourceURL),c=this.transcoderBinary.slice(0);return h.postMessage({type:"init",config:this.workerConfig,transcoderBinary:c},[c]),h})}),Gs>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Gs++}return this.transcoderPending}load(e,t,s,a){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new ut(this.manager);i.setPath(this.path),i.setCrossOrigin(this.crossOrigin),i.setWithCredentials(this.withCredentials),i.setRequestHeader(this.requestHeader),i.setResponseType("arraybuffer"),i.load(e,n=>{this.parse(n,t,a)},s,a)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Ps.has(e))return Ps.get(e).promise.then(t).catch(s);this._createTexture(e).then(a=>t?t(a):null).catch(s)}_createTextureFrom(e,t){const{type:s,error:a,data:{faces:i,width:n,height:r,format:A,type:h,dfdFlags:c}}=e;if(s==="error")return Promise.reject(a);let l;if(t.faceCount===6)l=new fr(i,A,h);else{const d=i[0].mipmaps;l=t.layerCount>1?new mr(d,n,r,t.layerCount,A,h):new Ea(d,n,r,A,h)}return l.minFilter=i[0].mipmaps.length===1?$e:ua,l.magFilter=$e,l.generateMipmaps=!1,l.needsUpdate=!0,l.colorSpace=Hn(t),l.premultiplyAlpha=!!(c&PA),l}async _createTexture(e,t={}){const s=HA(new Uint8Array(e)),a=s.vkFormat===_s&&s.dataFormatDescriptor[0].colorModel===167;if(!(s.vkFormat===qA||a&&!this.workerConfig.astcHDRSupported))return XA(s);const i=t,n=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e])).then(r=>this._createTextureFrom(r.data,s));return Ps.set(e,{promise:n}),n}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Gs--}}dt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},dt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},dt.EngineFormat={RGBAFormat:ot,RGBA_ASTC_4x4_Format:ja,RGB_BPTC_UNSIGNED_Format:Tr,RGBA_BPTC_Format:Cs,RGBA_ETC2_EAC_Format:Fi,RGBA_PVRTC_4BPPV1_Format:Is,RGBA_S3TC_DXT5_Format:Bs,RGB_ETC1_Format:Rr,RGB_ETC2_Format:ki,RGB_PVRTC_4BPPV1_Format:Sr,RGBA_S3TC_DXT1_Format:ws},dt.EngineType={UnsignedByteType:le,HalfFloatType:Xe,FloatType:ft},dt.BasisWorker=function(){let o,e,t;const s=_EngineFormat,a=_EngineType,i=_TranscoderFormat,n=_BasisFormat;self.addEventListener("message",function(b){const m=b.data;switch(m.type){case"init":o=m.config,r(m.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:f,buffers:E,width:I,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:S}=A(m.buffer);self.postMessage({type:"transcode",id:m.id,data:{faces:f,width:I,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:S}},E)}catch(f){console.error(f),self.postMessage({type:"error",id:m.id,error:f.message})}});break}});function r(b){e=new Promise(m=>{t={wasmBinary:b,onRuntimeInitialized:m},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(b){const m=new t.KTX2File(new Uint8Array(b));function f(){m.close(),m.delete()}if(!m.isValid())throw f(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let E;if(m.isUASTC())E=n.UASTC;else if(m.isETC1S())E=n.ETC1S;else if(m.isHDR())E=n.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const I=m.getWidth(),C=m.getHeight(),Q=m.getLayers()||1,w=m.getLevels(),x=m.getFaces(),S=m.getHasAlpha(),D=m.getDFDFlags(),{transcoderFormat:M,engineFormat:O,engineType:z}=l(E,I,C,S);if(!I||!C||!w)throw f(),new Error("THREE.KTX2Loader: Invalid texture");if(!m.startTranscoding())throw f(),new Error("THREE.KTX2Loader: .startTranscoding failed");const Y=[],ee=[];for(let J=0;J<x;J++){const X=[];for(let V=0;V<w;V++){const W=[];let ne,Ae;for(let te=0;te<Q;te++){const oe=m.getImageLevelInfo(V,te,J);J===0&&V===0&&te===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?(ne=oe.origWidth,Ae=oe.origHeight):(ne=oe.width,Ae=oe.height);let he=new Uint8Array(m.getImageTranscodedSizeInBytes(V,te,0,M));const Qe=m.transcodeImage(he,V,te,J,M,0,-1,-1);if(z===a.HalfFloatType&&(he=new Uint16Array(he.buffer,he.byteOffset,he.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Qe)throw f(),new Error("THREE.KTX2Loader: .transcodeImage failed.");W.push(he)}const Oe=p(W);X.push({data:Oe,width:ne,height:Ae}),ee.push(Oe.buffer)}Y.push({mipmaps:X,width:I,height:C,format:O,type:z})}return f(),{faces:Y,buffers:ee,width:I,height:C,hasAlpha:S,dfdFlags:D,format:O,type:z}}const h=[{if:"astcSupported",basisFormat:[n.UASTC],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],engineType:[a.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],engineType:[a.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.BC1,i.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],engineType:[a.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],engineType:[a.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.ETC1],engineFormat:[s.RGB_ETC1_Format],engineType:[a.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],engineType:[a.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[n.UASTC_HDR],transcoderFormat:[i.BC6H],engineFormat:[s.RGB_BPTC_UNSIGNED_Format],engineType:[a.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[i.RGBA32,i.RGBA32],engineFormat:[s.RGBAFormat,s.RGBAFormat],engineType:[a.UnsignedByteType,a.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[n.UASTC_HDR],transcoderFormat:[i.RGBA_HALF],engineFormat:[s.RGBAFormat],engineType:[a.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],c={[n.ETC1S]:h.filter(b=>b.basisFormat.includes(n.ETC1S)).sort((b,m)=>b.priorityETC1S-m.priorityETC1S),[n.UASTC]:h.filter(b=>b.basisFormat.includes(n.UASTC)).sort((b,m)=>b.priorityUASTC-m.priorityUASTC),[n.UASTC_HDR]:h.filter(b=>b.basisFormat.includes(n.UASTC_HDR)).sort((b,m)=>b.priorityHDR-m.priorityHDR)};function l(b,m,f,E){const I=c[b];for(let C=0;C<I.length;C++){const Q=I[C];if(Q.if&&!o[Q.if]||!Q.basisFormat.includes(b)||E&&Q.transcoderFormat.length<2||Q.needsPowerOfTwo&&!(d(m)&&d(f)))continue;const w=Q.transcoderFormat[E?1:0],x=Q.engineFormat[E?1:0],S=Q.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(b){return b<=2?!0:(b&b-1)===0&&b!==0}function p(b){if(b.length===1)return b[0];let m=0;for(let I=0;I<b.length;I++){const C=b[I];m+=C.byteLength}const f=new Uint8Array(m);let E=0;for(let I=0;I<b.length;I++){const C=b[I];f.set(C,E),E+=C.byteLength}return f}};const YA=new Set([ot,Qs,wt,Nt]),js={[gn]:ot,[hn]:wt,[ln]:Nt,[cn]:ot,[An]:wt,[rn]:Nt,[on]:ot,[nn]:ot,[sn]:wt,[an]:wt,[tn]:Nt,[en]:Nt,[pn]:Qs,[dn]:Qs,[Dn]:Fi,[xn]:ki,[Sn]:vr,[Rn]:Qr,[Tn]:yr,[kn]:wr,[_s]:ja,[Mn]:ja,[Fn]:ja,[On]:ys,[Ln]:ys,[_n]:ys,[mn]:ws,[fn]:ws,[bn]:Ti,[un]:Ti,[In]:Bs,[En]:Bs,[Bn]:Br,[Cn]:Cr,[yn]:Ir,[wn]:Er,[vn]:Cs,[Qn]:Cs,[Gn]:Is,[Un]:Is,[Pn]:Ri,[Nn]:Ri},la={[gn]:ft,[hn]:ft,[ln]:ft,[cn]:Xe,[An]:Xe,[rn]:Xe,[on]:le,[nn]:le,[sn]:le,[an]:le,[tn]:le,[en]:le,[pn]:_i,[dn]:Mi,[Dn]:le,[xn]:le,[Sn]:le,[Rn]:le,[Tn]:le,[kn]:le,[_s]:Xe,[Mn]:le,[Fn]:le,[On]:Xe,[Ln]:le,[_n]:le,[mn]:le,[fn]:le,[bn]:le,[un]:le,[In]:le,[En]:le,[Bn]:le,[Cn]:le,[yn]:le,[wn]:le,[vn]:le,[Qn]:le,[Gn]:le,[Un]:le,[Pn]:le,[Nn]:le};async function XA(o){const{vkFormat:e}=o;if(js[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);la[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;o.supercompressionScheme===Zi&&(Os||(Os=new Promise(async n=>{const r=new KA;await r.init(),n(r)})),t=await Os);const s=[];for(let n=0;n<o.levels.length;n++){const r=Math.max(1,o.pixelWidth>>n),A=Math.max(1,o.pixelHeight>>n),h=o.pixelDepth?Math.max(1,o.pixelDepth>>n):0,c=o.levels[n];let l;if(o.supercompressionScheme===UA)l=c.levelData;else if(o.supercompressionScheme===Zi)l=t.decode(c.levelData,c.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;la[e]===ft?d=new Float32Array(l.buffer,l.byteOffset,l.byteLength/Float32Array.BYTES_PER_ELEMENT):la[e]===Xe?d=new Uint16Array(l.buffer,l.byteOffset,l.byteLength/Uint16Array.BYTES_PER_ELEMENT):la[e]===_i||la[e]===Mi?d=new Uint32Array(l.buffer,l.byteOffset,l.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=l,s.push({data:d,width:r,height:A,depth:h})}const a=o.levelCount===0||s.length>1;let i;if(YA.has(js[e]))i=o.pixelDepth===0?new xr(s[0].data,o.pixelWidth,o.pixelHeight):new Dr(s[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),i.minFilter=a?As:ba,i.magFilter=ba,i.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new Ea(s,o.pixelWidth,o.pixelHeight),i.minFilter=a?ua:$e,i.magFilter=$e}return i.mipmaps=s,i.type=la[e],i.format=js[e],i.colorSpace=Hn(o),i.needsUpdate=!0,Promise.resolve(i)}function Hn(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===OA?e.transferFunction===$i?ge:Me:e.colorPrimaries===jA?e.transferFunction===$i?zA:JA:e.colorPrimaries===GA?Es:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Es)}const Kn=new kr;Kn.camera=new hs,yt.basic,yt.basic,yt.points,yt.standard,yt.physical,yt.phong;var ya=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(c){c.preventDefault(),s(++o%e.children.length)},!1);function t(c){return e.appendChild(c.dom),c}function s(c){for(var l=0;l<e.children.length;l++)e.children[l].style.display=l===c?"block":"none";o=c}var a=(performance||Date).now(),i=a,n=0,r=t(new ya.Panel("FPS","#0ff","#002")),A=t(new ya.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=t(new ya.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:e,addPanel:t,showPanel:s,begin:function(){a=(performance||Date).now()},end:function(){n++;var c=(performance||Date).now();if(A.update(c-a,200),c>=i+1e3&&(r.update(n*1e3/(c-i),100),i=c,n=0,h)){var l=performance.memory;h.update(l.usedJSHeapSize/1048576,l.jsHeapSizeLimit/1048576)}return c},update:function(){a=this.end()},domElement:e,setMode:s}};ya.Panel=function(o,e,t){var s=1/0,a=0,i=Math.round,n=i(window.devicePixelRatio||1),r=80*n,A=48*n,h=3*n,c=2*n,l=3*n,d=15*n,p=74*n,b=30*n,m=document.createElement("canvas");m.width=r,m.height=A,m.style.cssText="width:80px;height:48px";var f=m.getContext("2d");return f.font="bold "+9*n+"px Helvetica,Arial,sans-serif",f.textBaseline="top",f.fillStyle=t,f.fillRect(0,0,r,A),f.fillStyle=e,f.fillText(o,h,c),f.fillRect(l,d,p,b),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(l,d,p,b),{dom:m,update:function(E,I){s=Math.min(s,E),a=Math.max(a,E),f.fillStyle=t,f.globalAlpha=1,f.fillRect(0,0,r,d),f.fillStyle=e,f.fillText(i(E)+" "+o+" ("+i(s)+"-"+i(a)+")",h,c),f.drawImage(m,l+n,d,p-n,b,l,d,p-n,b),f.fillRect(l+p-n,d,n,b),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(l+p-n,d,n,i((1-E/I)*b))}}};class VA extends Fr{constructor(e,t={}){const s=t.font;if(s===void 0)super();else{const a=s.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(a,t)}this.type="TextGeometry"}}class WA extends Mt{constructor(e){super(e)}load(e,t,s,a){const i=this,n=new ut(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,function(r){const A=i.parse(JSON.parse(r));t&&t(A)},s,a)}parse(e){return new zn(e)}}class zn{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,s="ltr"){const a=[],i=ZA(e,t,this.data,s);for(let n=0,r=i.length;n<r;n++)a.push(...i[n].toShapes());return a}}function ZA(o,e,t,s){const a=Array.from(o),i=e/t.resolution,n=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*i,r=[];let A=0,h=0;(s=="rtl"||s=="tb")&&a.reverse();for(let c=0;c<a.length;c++){const l=a[c];if(l===`
4
+ `)A=0,h-=n;else{const d=$A(l,i,A,h,t);s=="tb"?(A=0,h+=t.ascender*i):A+=d.offsetX,r.push(d.path)}}return r}function $A(o,e,t,s,a){const i=a.glyphs[o]||a.glyphs["?"];if(!i){console.error('THREE.Font: character "'+o+'" does not exists in font family '+a.familyName+".");return}const n=new Mr;let r,A,h,c,l,d,p,b;if(i.o){const m=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let f=0,E=m.length;f<E;)switch(m[f++]){case"m":r=m[f++]*e+t,A=m[f++]*e+s,n.moveTo(r,A);break;case"l":r=m[f++]*e+t,A=m[f++]*e+s,n.lineTo(r,A);break;case"q":h=m[f++]*e+t,c=m[f++]*e+s,l=m[f++]*e+t,d=m[f++]*e+s,n.quadraticCurveTo(l,d,h,c);break;case"b":h=m[f++]*e+t,c=m[f++]*e+s,l=m[f++]*e+t,d=m[f++]*e+s,p=m[f++]*e+t,b=m[f++]*e+s,n.bezierCurveTo(l,d,p,b,h,c);break}}return{offsetX:i.ha*e,path:n}}var Te=Uint8Array,rt=Uint16Array,qs=Int32Array,Ka=new Te([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),za=new Te([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Hs=new Te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jn=function(o,e){for(var t=new rt(31),s=0;s<31;++s)t[s]=e+=1<<o[s-1];for(var a=new qs(t[30]),s=1;s<30;++s)for(var i=t[s];i<t[s+1];++i)a[i]=i-t[s]<<5|s;return{b:t,r:a}},Yn=Jn(Ka,2),Xn=Yn.b,Ks=Yn.r;Xn[28]=258,Ks[258]=28;for(var Vn=Jn(za,0),ec=Vn.b,Wn=Vn.r,zs=new rt(32768),Ce=0;Ce<32768;++Ce){var zt=(Ce&43690)>>1|(Ce&21845)<<1;zt=(zt&52428)>>2|(zt&13107)<<2,zt=(zt&61680)>>4|(zt&3855)<<4,zs[Ce]=((zt&65280)>>8|(zt&255)<<8)>>1}for(var xt=function(o,e,t){for(var s=o.length,a=0,i=new rt(e);a<s;++a)o[a]&&++i[o[a]-1];var n=new rt(e);for(a=1;a<e;++a)n[a]=n[a-1]+i[a-1]<<1;var r;if(t){r=new rt(1<<e);var A=15-e;for(a=0;a<s;++a)if(o[a])for(var h=a<<4|o[a],c=e-o[a],l=n[o[a]-1]++<<c,d=l|(1<<c)-1;l<=d;++l)r[zs[l]>>A]=h}else for(r=new rt(s),a=0;a<s;++a)o[a]&&(r[a]=zs[n[o[a]-1]++]>>15-o[a]);return r},Jt=new Te(288),Ce=0;Ce<144;++Ce)Jt[Ce]=8;for(var Ce=144;Ce<256;++Ce)Jt[Ce]=9;for(var Ce=256;Ce<280;++Ce)Jt[Ce]=7;for(var Ce=280;Ce<288;++Ce)Jt[Ce]=8;for(var Qa=new Te(32),Ce=0;Ce<32;++Ce)Qa[Ce]=5;var tc=xt(Jt,9,0),ac=xt(Jt,9,1),sc=xt(Qa,5,0),ic=xt(Qa,5,1),Js=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},mt=function(o,e,t){var s=e/8|0;return(o[s]|o[s+1]<<8)>>(e&7)&t},Ys=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Xs=function(o){return(o+7)/8|0},Vs=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new Te(o.subarray(e,t))},nc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],tt=function(o,e,t){var s=new Error(e||nc[o]);if(s.code=o,Error.captureStackTrace&&Error.captureStackTrace(s,tt),!t)throw s;return s},oc=function(o,e,t,s){var a=o.length,i=0;if(!a||e.f&&!e.l)return t||new Te(0);var n=!t,r=n||e.i!=2,A=e.i;n&&(t=new Te(a*3));var h=function(Ne){var Ue=t.length;if(Ne>Ue){var kt=new Te(Math.max(Ue*2,Ne));kt.set(t),t=kt}},c=e.f||0,l=e.p||0,d=e.b||0,p=e.l,b=e.d,m=e.m,f=e.n,E=a*8;do{if(!p){c=mt(o,l,1);var I=mt(o,l+1,3);if(l+=3,I)if(I==1)p=ac,b=ic,m=9,f=5;else if(I==2){var C=mt(o,l,31)+257,Q=mt(o,l+10,15)+4,w=C+mt(o,l+5,31)+1;l+=14;for(var x=new Te(w),S=new Te(19),D=0;D<Q;++D)S[Hs[D]]=mt(o,l+D*3,7);l+=Q*3;for(var M=Js(S),O=(1<<M)-1,z=xt(S,M,1),D=0;D<w;){var Y=z[mt(o,l,O)];l+=Y&15;var ee=Y>>4;if(ee<16)x[D++]=ee;else{var J=0,X=0;for(ee==16?(X=3+mt(o,l,3),l+=2,J=x[D-1]):ee==17?(X=3+mt(o,l,7),l+=3):ee==18&&(X=11+mt(o,l,127),l+=7);X--;)x[D++]=J}}var V=x.subarray(0,C),W=x.subarray(C);m=Js(V),f=Js(W),p=xt(V,m,1),b=xt(W,f,1)}else tt(1);else{var ee=Xs(l)+4,ne=o[ee-4]|o[ee-3]<<8,Ae=ee+ne;if(Ae>a){A&&tt(0);break}r&&h(d+ne),t.set(o.subarray(ee,Ae),d),e.b=d+=ne,e.p=l=Ae*8,e.f=c;continue}if(l>E){A&&tt(0);break}}r&&h(d+131072);for(var Oe=(1<<m)-1,te=(1<<f)-1,oe=l;;oe=l){var J=p[Ys(o,l)&Oe],he=J>>4;if(l+=J&15,l>E){A&&tt(0);break}if(J||tt(2),he<256)t[d++]=he;else if(he==256){oe=l,p=null;break}else{var Qe=he-254;if(he>264){var D=he-257,Be=Ka[D];Qe=mt(o,l,(1<<Be)-1)+Xn[D],l+=Be}var st=b[Ys(o,l)&te],pt=st>>4;st||tt(3),l+=st&15;var W=ec[pt];if(pt>3){var Be=za[pt];W+=Ys(o,l)&(1<<Be)-1,l+=Be}if(l>E){A&&tt(0);break}r&&h(d+131072);var Ot=d+Qe;if(d<W){var ia=i-W,na=Math.min(W,Ot);for(ia+d<0&&tt(3);d<na;++d)t[d]=s[ia+d]}for(;d<Ot;++d)t[d]=t[d-W]}}e.l=p,e.p=oe,e.b=d,e.f=c,p&&(c=1,e.m=m,e.d=b,e.n=f)}while(!c);return d!=t.length&&n?Vs(t,0,d):t.subarray(0,d)},Pt=function(o,e,t){t<<=e&7;var s=e/8|0;o[s]|=t,o[s+1]|=t>>8},va=function(o,e,t){t<<=e&7;var s=e/8|0;o[s]|=t,o[s+1]|=t>>8,o[s+2]|=t>>16},Ws=function(o,e){for(var t=[],s=0;s<o.length;++s)o[s]&&t.push({s,f:o[s]});var a=t.length,i=t.slice();if(!a)return{t:to,l:0};if(a==1){var n=new Te(t[0].s+1);return n[t[0].s]=1,{t:n,l:1}}t.sort(function(w,x){return w.f-x.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],h=0,c=1,l=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};c!=a-1;)r=t[t[h].f<t[l].f?h++:l++],A=t[h!=c&&t[h].f<t[l].f?h++:l++],t[c++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=i[0].s,s=1;s<a;++s)i[s].s>d&&(d=i[s].s);var p=new rt(d+1),b=Zs(t[c-1],p,0);if(b>e){var s=0,m=0,f=b-e,E=1<<f;for(i.sort(function(x,S){return p[S.s]-p[x.s]||x.f-S.f});s<a;++s){var I=i[s].s;if(p[I]>e)m+=E-(1<<b-p[I]),p[I]=e;else break}for(m>>=f;m>0;){var C=i[s].s;p[C]<e?m-=1<<e-p[C]++-1:++s}for(;s>=0&&m;--s){var Q=i[s].s;p[Q]==e&&(--p[Q],++m)}b=e}return{t:new Te(p),l:b}},Zs=function(o,e,t){return o.s==-1?Math.max(Zs(o.l,e,t+1),Zs(o.r,e,t+1)):e[o.s]=t},Zn=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new rt(++e),s=0,a=o[0],i=1,n=function(A){t[s++]=A},r=1;r<=e;++r)if(o[r]==a&&r!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)n(32754);i>2&&(n(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(n(a),--i;i>6;i-=6)n(8304);i>2&&(n(i-3<<5|8208),i=0)}for(;i--;)n(a);i=1,a=o[r]}return{c:t.subarray(0,s),n:e}},xa=function(o,e){for(var t=0,s=0;s<e.length;++s)t+=o[s]*e[s];return t},$n=function(o,e,t){var s=t.length,a=Xs(e+2);o[a]=s&255,o[a+1]=s>>8,o[a+2]=o[a]^255,o[a+3]=o[a+1]^255;for(var i=0;i<s;++i)o[a+i+4]=t[i];return(a+4+s)*8},eo=function(o,e,t,s,a,i,n,r,A,h,c){Pt(e,c++,t),++a[256];for(var l=Ws(a,15),d=l.t,p=l.l,b=Ws(i,15),m=b.t,f=b.l,E=Zn(d),I=E.c,C=E.n,Q=Zn(m),w=Q.c,x=Q.n,S=new rt(19),D=0;D<I.length;++D)++S[I[D]&31];for(var D=0;D<w.length;++D)++S[w[D]&31];for(var M=Ws(S,7),O=M.t,z=M.l,Y=19;Y>4&&!O[Hs[Y-1]];--Y);var ee=h+5<<3,J=xa(a,Jt)+xa(i,Qa)+n,X=xa(a,d)+xa(i,m)+n+14+3*Y+xa(S,O)+2*S[16]+3*S[17]+7*S[18];if(A>=0&&ee<=J&&ee<=X)return $n(e,c,o.subarray(A,A+h));var V,W,ne,Ae;if(Pt(e,c,1+(X<J)),c+=2,X<J){V=xt(d,p,0),W=d,ne=xt(m,f,0),Ae=m;var Oe=xt(O,z,0);Pt(e,c,C-257),Pt(e,c+5,x-1),Pt(e,c+10,Y-4),c+=14;for(var D=0;D<Y;++D)Pt(e,c+3*D,O[Hs[D]]);c+=3*Y;for(var te=[I,w],oe=0;oe<2;++oe)for(var he=te[oe],D=0;D<he.length;++D){var Qe=he[D]&31;Pt(e,c,Oe[Qe]),c+=O[Qe],Qe>15&&(Pt(e,c,he[D]>>5&127),c+=he[D]>>12)}}else V=tc,W=Jt,ne=sc,Ae=Qa;for(var D=0;D<r;++D){var Be=s[D];if(Be>255){var Qe=Be>>18&31;va(e,c,V[Qe+257]),c+=W[Qe+257],Qe>7&&(Pt(e,c,Be>>23&31),c+=Ka[Qe]);var st=Be&31;va(e,c,ne[st]),c+=Ae[st],st>3&&(va(e,c,Be>>5&8191),c+=za[st])}else va(e,c,V[Be]),c+=W[Be]}return va(e,c,V[256]),c+W[256]},rc=new qs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),to=new Te(0),Ac=function(o,e,t,s,a,i){var n=i.z||o.length,r=new Te(s+n+5*(1+Math.ceil(n/7e3))+a),A=r.subarray(s,r.length-a),h=i.l,c=(i.r||0)&7;if(e){c&&(A[0]=i.r>>3);for(var l=rc[e-1],d=l>>13,p=l&8191,b=(1<<t)-1,m=i.p||new rt(32768),f=i.h||new rt(b+1),E=Math.ceil(t/3),I=2*E,C=function(ct){return(o[ct]^o[ct+1]<<E^o[ct+2]<<I)&b},Q=new qs(25e3),w=new rt(288),x=new rt(32),S=0,D=0,M=i.i||0,O=0,z=i.w||0,Y=0;M+2<n;++M){var ee=C(M),J=M&32767,X=f[ee];if(m[J]=X,f[ee]=J,z<=M){var V=n-M;if((S>7e3||O>24576)&&(V>423||!h)){c=eo(o,A,0,Q,w,x,D,O,Y,M-Y,c),O=S=D=0,Y=M;for(var W=0;W<286;++W)w[W]=0;for(var W=0;W<30;++W)x[W]=0}var ne=2,Ae=0,Oe=p,te=J-X&32767;if(V>2&&ee==C(M-te))for(var oe=Math.min(d,V)-1,he=Math.min(32767,M),Qe=Math.min(258,V);te<=he&&--Oe&&J!=X;){if(o[M+ne]==o[M+ne-te]){for(var Be=0;Be<Qe&&o[M+Be]==o[M+Be-te];++Be);if(Be>ne){if(ne=Be,Ae=te,Be>oe)break;for(var st=Math.min(te,Be-2),pt=0,W=0;W<st;++W){var Ot=M-te+W&32767,ia=m[Ot],na=Ot-ia&32767;na>pt&&(pt=na,X=Ot)}}}J=X,X=m[J],te+=J-X&32767}if(Ae){Q[O++]=268435456|Ks[ne]<<18|Wn[Ae];var Ne=Ks[ne]&31,Ue=Wn[Ae]&31;D+=Ka[Ne]+za[Ue],++w[257+Ne],++x[Ue],z=M+ne,++S}else Q[O++]=o[M],++w[o[M]]}}for(M=Math.max(M,z);M<n;++M)Q[O++]=o[M],++w[o[M]];c=eo(o,A,h,Q,w,x,D,O,Y,M-Y,c),h||(i.r=c&7|A[c/8|0]<<3,c-=7,i.h=f,i.p=m,i.i=M,i.w=z)}else{for(var M=i.w||0;M<n+h;M+=65535){var kt=M+65535;kt>=n&&(A[c/8|0]=h,kt=n),c=$n(A,c+1,o.subarray(M,kt))}i.i=n}return Vs(r,0,s+Xs(c)+a)},cc=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,s=9;--s;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),lc=function(){var o=-1;return{p:function(e){for(var t=o,s=0;s<e.length;++s)t=cc[t&255^e[s]]^t>>>8;o=t},d:function(){return~o}}},hc=function(o,e,t,s,a){if(!a&&(a={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),n=new Te(i.length+o.length);n.set(i),n.set(o,i.length),o=n,a.w=i.length}return Ac(o,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,s,a)},ao=function(o,e){var t={};for(var s in o)t[s]=o[s];for(var s in e)t[s]=e[s];return t},je=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},gc=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&tt(6,"invalid zlib data"),(o[1]>>5&1)==1&&tt(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function dc(o,e){return hc(o,e||{},0,0)}function Da(o,e){return oc(o.subarray(gc(o),-4),{i:2},e,e)}var so=function(o,e,t,s){for(var a in o){var i=o[a],n=e+a,r=s;Array.isArray(i)&&(r=ao(s,i[1]),i=i[0]),i instanceof Te?t[n]=[i,r]:(t[n+="/"]=[new Te(0),r],so(i,n,t,s))}},io=typeof TextEncoder<"u"&&new TextEncoder,pc=typeof TextDecoder<"u"&&new TextDecoder,uc=0;try{pc.decode(to,{stream:!0}),uc=1}catch{}function $s(o,e){var t;if(io)return io.encode(o);for(var s=o.length,a=new Te(o.length+(o.length>>1)),i=0,n=function(c){a[i++]=c},t=0;t<s;++t){if(i+5>a.length){var r=new Te(i+8+(s-t<<1));r.set(a),a=r}var A=o.charCodeAt(t);A<128||e?n(A):A<2048?(n(192|A>>6),n(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|o.charCodeAt(++t)&1023,n(240|A>>18),n(128|A>>12&63),n(128|A>>6&63),n(128|A&63)):(n(224|A>>12),n(128|A>>6&63),n(128|A&63))}return Vs(a,0,i)}var ei=function(o){var e=0;if(o)for(var t in o){var s=o[t].length;s>65535&&tt(9),e+=s+4}return e},no=function(o,e,t,s,a,i,n,r){var A=s.length,h=t.extra,c=r&&r.length,l=ei(h);je(o,e,n!=null?33639248:67324752),e+=4,n!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(i<0&&8),o[e++]=a&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&tt(10),je(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,i!=-1&&(je(o,e,t.crc),je(o,e+4,i<0?-i-2:i),je(o,e+8,t.size)),je(o,e+12,A),je(o,e+14,l),e+=16,n!=null&&(je(o,e,c),je(o,e+6,t.attrs),je(o,e+10,n),e+=14),o.set(s,e),e+=A,l)for(var b in h){var m=h[b],f=m.length;je(o,e,+b),je(o,e+2,f),o.set(m,e+4),e+=4+f}return c&&(o.set(r,e),e+=c),e},bc=function(o,e,t,s,a){je(o,e,101010256),je(o,e+8,t),je(o,e+10,t),je(o,e+12,s),je(o,e+16,a)};function fc(o,e){e||(e={});var t={},s=[];so(o,"",t,e);var a=0,i=0;for(var n in t){var r=t[n],A=r[0],h=r[1],c=h.level==0?0:8,l=$s(n),d=l.length,p=h.comment,b=p&&$s(p),m=b&&b.length,f=ei(h.extra);d>65535&&tt(11);var E=c?dc(A,h):A,I=E.length,C=lc();C.p(A),s.push(ao(h,{size:A.length,crc:C.d(),c:E,f:l,m:b,u:d!=n.length||b&&p.length!=m,o:a,compression:c})),a+=30+d+f+I,i+=76+2*(d+f)+(m||0)+I}for(var Q=new Te(i+22),w=a,x=i-a,S=0;S<s.length;++S){var l=s[S];no(Q,l.o,l,l.f,l.u,l.c.length);var D=30+l.f.length+ei(l.extra);Q.set(l.c,l.o+D),no(Q,a,l,l.f,l.u,l.c.length,l.o,l.m),a+=16+D+(l.m?l.m.length:0)}return bc(Q,a,s.length,x,w),Q}class mc extends Li{constructor(e){super(e),this.type=Xe,this.outputFormat=ot}parse(e){const t=Math.pow(2.7182818,2.2);function s(g,u){let B=0;for(let R=0;R<65536;++R)(R==0||g[R>>3]&1<<(R&7))&&(u[B++]=R);const v=B-1;for(;B<65536;)u[B++]=0;return v}function a(g){for(let u=0;u<16384;u++)g[u]={},g[u].len=0,g[u].lit=0,g[u].p=null}const i={l:0,c:0,lc:0};function n(g,u,B,v,R){for(;B<g;)u=u<<8|kt(v,R),B+=8;B-=g,i.l=u>>B&(1<<g)-1,i.c=u,i.lc=B}const r=new Array(59);function A(g){for(let B=0;B<=58;++B)r[B]=0;for(let B=0;B<65537;++B)r[g[B]]+=1;let u=0;for(let B=58;B>0;--B){const v=u+r[B]>>1;r[B]=u,u=v}for(let B=0;B<65537;++B){const v=g[B];v>0&&(g[B]=v|r[v]++<<6)}}function h(g,u,B,v,R,N){const y=u;let L=0,k=0;for(;v<=R;v++){if(y.value-u.value>B)return!1;n(6,L,k,g,y);const T=i.l;if(L=i.c,k=i.lc,N[v]=T,T==63){if(y.value-u.value>B)throw new Error("Something wrong with hufUnpackEncTable");n(8,L,k,g,y);let F=i.l+6;if(L=i.c,k=i.lc,v+F>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;F--;)N[v++]=0;v--}else if(T>=59){let F=T-59+2;if(v+F>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;F--;)N[v++]=0;v--}}A(N)}function c(g){return g&63}function l(g){return g>>6}function d(g,u,B,v){for(;u<=B;u++){const R=l(g[u]),N=c(g[u]);if(R>>N)throw new Error("Invalid table entry");if(N>14){const y=v[R>>N-14];if(y.len)throw new Error("Invalid table entry");if(y.lit++,y.p){const L=y.p;y.p=new Array(y.lit);for(let k=0;k<y.lit-1;++k)y.p[k]=L[k]}else y.p=new Array(1);y.p[y.lit-1]=u}else if(N){let y=0;for(let L=1<<14-N;L>0;L--){const k=v[(R<<14-N)+y];if(k.len||k.p)throw new Error("Invalid table entry");k.len=N,k.lit=u,y++}}}return!0}const p={c:0,lc:0};function b(g,u,B,v){g=g<<8|kt(B,v),u+=8,p.c=g,p.lc=u}const m={c:0,lc:0};function f(g,u,B,v,R,N,y,L,k){if(g==u){v<8&&(b(B,v,R,N),B=p.c,v=p.lc),v-=8;let T=B>>v;if(T=new Uint8Array([T])[0],L.value+T>k)return!1;const F=y[L.value-1];for(;T-- >0;)y[L.value++]=F}else if(L.value<k)y[L.value++]=g;else return!1;m.c=B,m.lc=v}function E(g){return g&65535}function I(g){const u=E(g);return u>32767?u-65536:u}const C={a:0,b:0};function Q(g,u){const B=I(g),v=I(u),R=B+(v&1)+(v>>1),N=R,y=R-v;C.a=N,C.b=y}function w(g,u){const B=E(g),v=E(u),R=B-(v>>1)&65535,N=v+R-32768&65535;C.a=N,C.b=R}function x(g,u,B,v,R,N,y){const L=y<16384,k=B>R?R:B;let T=1,F,G;for(;T<=k;)T<<=1;for(T>>=1,F=T,T>>=1;T>=1;){G=0;const _=G+N*(R-F),H=N*T,Z=N*F,P=v*T,K=v*F;let $,ue,Ee,Fe;for(;G<=_;G+=Z){let be=G;const ae=G+v*(B-F);for(;be<=ae;be+=K){const ve=be+P,Pe=be+H,Ie=Pe+P;L?(Q(g[be+u],g[Pe+u]),$=C.a,Ee=C.b,Q(g[ve+u],g[Ie+u]),ue=C.a,Fe=C.b,Q($,ue),g[be+u]=C.a,g[ve+u]=C.b,Q(Ee,Fe),g[Pe+u]=C.a,g[Ie+u]=C.b):(w(g[be+u],g[Pe+u]),$=C.a,Ee=C.b,w(g[ve+u],g[Ie+u]),ue=C.a,Fe=C.b,w($,ue),g[be+u]=C.a,g[ve+u]=C.b,w(Ee,Fe),g[Pe+u]=C.a,g[Ie+u]=C.b)}if(B&T){const ve=be+H;L?Q(g[be+u],g[ve+u]):w(g[be+u],g[ve+u]),$=C.a,g[ve+u]=C.b,g[be+u]=$}}if(R&T){let be=G;const ae=G+v*(B-F);for(;be<=ae;be+=K){const ve=be+P;L?Q(g[be+u],g[ve+u]):w(g[be+u],g[ve+u]),$=C.a,g[ve+u]=C.b,g[be+u]=$}}F=T,T>>=1}return G}function S(g,u,B,v,R,N,y,L,k){let T=0,F=0;const G=y,_=Math.trunc(v.value+(R+7)/8);for(;v.value<_;)for(b(T,F,B,v),T=p.c,F=p.lc;F>=14;){const Z=T>>F-14&16383,P=u[Z];if(P.len)F-=P.len,f(P.lit,N,T,F,B,v,L,k,G),T=m.c,F=m.lc;else{if(!P.p)throw new Error("hufDecode issues");let K;for(K=0;K<P.lit;K++){const $=c(g[P.p[K]]);for(;F<$&&v.value<_;)b(T,F,B,v),T=p.c,F=p.lc;if(F>=$&&l(g[P.p[K]])==(T>>F-$&(1<<$)-1)){F-=$,f(P.p[K],N,T,F,B,v,L,k,G),T=m.c,F=m.lc;break}}if(K==P.lit)throw new Error("hufDecode issues")}}const H=8-R&7;for(T>>=H,F-=H;F>0;){const Z=u[T<<14-F&16383];if(Z.len)F-=Z.len,f(Z.lit,N,T,F,B,v,L,k,G),T=m.c,F=m.lc;else throw new Error("hufDecode issues")}return!0}function D(g,u,B,v,R,N){const y={value:0},L=B.value,k=Ue(u,B),T=Ue(u,B);B.value+=4;const F=Ue(u,B);if(B.value+=4,k<0||k>=65537||T<0||T>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const G=new Array(65537),_=new Array(16384);a(_);const H=v-(B.value-L);if(h(g,B,H,k,T,G),F>8*(v-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,k,T,_),S(G,_,g,B,F,T,N,R,y)}function M(g,u,B){for(let v=0;v<B;++v)u[v]=g[u[v]]}function O(g){for(let u=1;u<g.length;u++){const B=g[u-1]+g[u]-128;g[u]=B}}function z(g,u){let B=0,v=Math.floor((g.length+1)/2),R=0;const N=g.length-1;for(;!(R>N||(u[R++]=g[B++],R>N));)u[R++]=g[v++]}function Y(g){let u=g.byteLength;const B=new Array;let v=0;const R=new DataView(g);for(;u>0;){const N=R.getInt8(v++);if(N<0){const y=-N;u-=y+1;for(let L=0;L<y;L++)B.push(R.getUint8(v++))}else{const y=N;u-=2;const L=R.getUint8(v++);for(let k=0;k<y+1;k++)B.push(L)}}return B}function ee(g,u,B,v,R,N){let y=new DataView(N.buffer);const L=B[g.idx[0]].width,k=B[g.idx[0]].height,T=3,F=Math.floor(L/8),G=Math.ceil(L/8),_=Math.ceil(k/8),H=L-(G-1)*8,Z=k-(_-1)*8,P={value:0},K=new Array(T),$=new Array(T),ue=new Array(T),Ee=new Array(T),Fe=new Array(T);for(let ae=0;ae<T;++ae)Fe[ae]=u[g.idx[ae]],K[ae]=ae<1?0:K[ae-1]+G*_,$[ae]=new Float32Array(64),ue[ae]=new Uint16Array(64),Ee[ae]=new Uint16Array(G*64);for(let ae=0;ae<_;++ae){let ve=8;ae==_-1&&(ve=Z);let Pe=8;for(let ce=0;ce<G;++ce){ce==G-1&&(Pe=H);for(let me=0;me<T;++me)ue[me].fill(0),ue[me][0]=R[K[me]++],X(P,v,ue[me]),V(ue[me],$[me]),W($[me]);ne($);for(let me=0;me<T;++me)Ae($[me],Ee[me],ce*64)}let Ie=0;for(let ce=0;ce<T;++ce){const me=B[g.idx[ce]].type;for(let Ft=8*ae;Ft<8*ae+ve;++Ft){Ie=Fe[ce][Ft];for(let pa=0;pa<F;++pa){const Et=pa*64+(Ft&7)*8;y.setUint16(Ie+0*me,Ee[ce][Et+0],!0),y.setUint16(Ie+2*me,Ee[ce][Et+1],!0),y.setUint16(Ie+4*me,Ee[ce][Et+2],!0),y.setUint16(Ie+6*me,Ee[ce][Et+3],!0),y.setUint16(Ie+8*me,Ee[ce][Et+4],!0),y.setUint16(Ie+10*me,Ee[ce][Et+5],!0),y.setUint16(Ie+12*me,Ee[ce][Et+6],!0),y.setUint16(Ie+14*me,Ee[ce][Et+7],!0),Ie+=16*me}}if(F!=G)for(let Ft=8*ae;Ft<8*ae+ve;++Ft){const pa=Fe[ce][Ft]+8*F*2*me,Et=F*64+(Ft&7)*8;for(let Na=0;Na<Pe;++Na)y.setUint16(pa+Na*2*me,Ee[ce][Et+Na],!0)}}}const be=new Uint16Array(L);y=new DataView(N.buffer);for(let ae=0;ae<T;++ae){B[g.idx[ae]].decoded=!0;const ve=B[g.idx[ae]].type;if(B[ae].type==2)for(let Pe=0;Pe<k;++Pe){const Ie=Fe[ae][Pe];for(let ce=0;ce<L;++ce)be[ce]=y.getUint16(Ie+ce*2*ve,!0);for(let ce=0;ce<L;++ce)y.setFloat32(Ie+ce*2*ve,q(be[ce]),!0)}}}function J(g,u,B,v,R,N){const y=new DataView(N.buffer),L=B[g],k=L.width,T=L.height,F=Math.ceil(k/8),G=Math.ceil(T/8),_=Math.floor(k/8),H=k-(F-1)*8,Z=T-(G-1)*8,P={value:0};let K=0;const $=new Float32Array(64),ue=new Uint16Array(64),Ee=new Uint16Array(F*64);for(let Fe=0;Fe<G;++Fe){let be=8;Fe==G-1&&(be=Z);for(let ae=0;ae<F;++ae)ue.fill(0),ue[0]=R[K++],X(P,v,ue),V(ue,$),W($),Ae($,Ee,ae*64);for(let ae=8*Fe;ae<8*Fe+be;++ae){let ve=u[g][ae];for(let Pe=0;Pe<_;++Pe){const Ie=Pe*64+(ae&7)*8;for(let ce=0;ce<8;++ce)y.setUint16(ve+ce*2*L.type,Ee[Ie+ce],!0);ve+=16*L.type}if(F!=_){const Pe=_*64+(ae&7)*8;for(let Ie=0;Ie<H;++Ie)y.setUint16(ve+Ie*2*L.type,Ee[Pe+Ie],!0)}}}L.decoded=!0}function X(g,u,B){let v,R=1;for(;R<64;)v=u[g.value],v==65280?R=64:v>>8==255?R+=v&255:(B[R]=v,R++),g.value++}function V(g,u){u[0]=q(g[0]),u[1]=q(g[1]),u[2]=q(g[5]),u[3]=q(g[6]),u[4]=q(g[14]),u[5]=q(g[15]),u[6]=q(g[27]),u[7]=q(g[28]),u[8]=q(g[2]),u[9]=q(g[4]),u[10]=q(g[7]),u[11]=q(g[13]),u[12]=q(g[16]),u[13]=q(g[26]),u[14]=q(g[29]),u[15]=q(g[42]),u[16]=q(g[3]),u[17]=q(g[8]),u[18]=q(g[12]),u[19]=q(g[17]),u[20]=q(g[25]),u[21]=q(g[30]),u[22]=q(g[41]),u[23]=q(g[43]),u[24]=q(g[9]),u[25]=q(g[11]),u[26]=q(g[18]),u[27]=q(g[24]),u[28]=q(g[31]),u[29]=q(g[40]),u[30]=q(g[44]),u[31]=q(g[53]),u[32]=q(g[10]),u[33]=q(g[19]),u[34]=q(g[23]),u[35]=q(g[32]),u[36]=q(g[39]),u[37]=q(g[45]),u[38]=q(g[52]),u[39]=q(g[54]),u[40]=q(g[20]),u[41]=q(g[22]),u[42]=q(g[33]),u[43]=q(g[38]),u[44]=q(g[46]),u[45]=q(g[51]),u[46]=q(g[55]),u[47]=q(g[60]),u[48]=q(g[21]),u[49]=q(g[34]),u[50]=q(g[37]),u[51]=q(g[47]),u[52]=q(g[50]),u[53]=q(g[56]),u[54]=q(g[59]),u[55]=q(g[61]),u[56]=q(g[35]),u[57]=q(g[36]),u[58]=q(g[48]),u[59]=q(g[49]),u[60]=q(g[57]),u[61]=q(g[58]),u[62]=q(g[62]),u[63]=q(g[63])}function W(g){const u=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),v=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),N=.5*Math.cos(5*3.14159/16),y=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),k=new Array(4),T=new Array(4),F=new Array(4),G=new Array(4);for(let _=0;_<8;++_){const H=_*8;k[0]=v*g[H+2],k[1]=y*g[H+2],k[2]=v*g[H+6],k[3]=y*g[H+6],T[0]=B*g[H+1]+R*g[H+3]+N*g[H+5]+L*g[H+7],T[1]=R*g[H+1]-L*g[H+3]-B*g[H+5]-N*g[H+7],T[2]=N*g[H+1]-B*g[H+3]+L*g[H+5]+R*g[H+7],T[3]=L*g[H+1]-N*g[H+3]+R*g[H+5]-B*g[H+7],F[0]=u*(g[H+0]+g[H+4]),F[3]=u*(g[H+0]-g[H+4]),F[1]=k[0]+k[3],F[2]=k[1]-k[2],G[0]=F[0]+F[1],G[1]=F[3]+F[2],G[2]=F[3]-F[2],G[3]=F[0]-F[1],g[H+0]=G[0]+T[0],g[H+1]=G[1]+T[1],g[H+2]=G[2]+T[2],g[H+3]=G[3]+T[3],g[H+4]=G[3]-T[3],g[H+5]=G[2]-T[2],g[H+6]=G[1]-T[1],g[H+7]=G[0]-T[0]}for(let _=0;_<8;++_)k[0]=v*g[16+_],k[1]=y*g[16+_],k[2]=v*g[48+_],k[3]=y*g[48+_],T[0]=B*g[8+_]+R*g[24+_]+N*g[40+_]+L*g[56+_],T[1]=R*g[8+_]-L*g[24+_]-B*g[40+_]-N*g[56+_],T[2]=N*g[8+_]-B*g[24+_]+L*g[40+_]+R*g[56+_],T[3]=L*g[8+_]-N*g[24+_]+R*g[40+_]-B*g[56+_],F[0]=u*(g[_]+g[32+_]),F[3]=u*(g[_]-g[32+_]),F[1]=k[0]+k[3],F[2]=k[1]-k[2],G[0]=F[0]+F[1],G[1]=F[3]+F[2],G[2]=F[3]-F[2],G[3]=F[0]-F[1],g[0+_]=G[0]+T[0],g[8+_]=G[1]+T[1],g[16+_]=G[2]+T[2],g[24+_]=G[3]+T[3],g[32+_]=G[3]-T[3],g[40+_]=G[2]-T[2],g[48+_]=G[1]-T[1],g[56+_]=G[0]-T[0]}function ne(g){for(let u=0;u<64;++u){const B=g[0][u],v=g[1][u],R=g[2][u];g[0][u]=B+1.5747*R,g[1][u]=B-.1873*v-.4682*R,g[2][u]=B+1.8556*v}}function Ae(g,u,B){for(let v=0;v<64;++v)u[B+v]=oa.toHalfFloat(Oe(g[v]))}function Oe(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(t,Math.abs(g)-1)}function te(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function oe(g){const u=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(Y(u)),v=new Uint8Array(B.length);return O(B),z(B,v),new DataView(v.buffer)}function he(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=Da(u),v=new Uint8Array(B.length);return O(B),z(B,v),new DataView(v.buffer)}function Qe(g){const u=g.viewer,B={value:g.offset.value},v=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),R=new Uint8Array(8192);let N=0;const y=new Array(g.inputChannels.length);for(let Z=0,P=g.inputChannels.length;Z<P;Z++)y[Z]={},y[Z].start=N,y[Z].end=y[Z].start,y[Z].nx=g.columns,y[Z].ny=g.lines,y[Z].size=g.type,N+=y[Z].nx*y[Z].ny*y[Z].size;const L=da(u,B),k=da(u,B);if(k>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=k)for(let Z=0;Z<k-L+1;Z++)R[Z+L]=ct(u,B);const T=new Uint16Array(65536),F=s(R,T),G=Ue(u,B);D(g.array,u,B,G,v,N);for(let Z=0;Z<g.inputChannels.length;++Z){const P=y[Z];for(let K=0;K<y[Z].size;++K)x(v,P.start+K,P.nx,P.size,P.ny,P.nx*P.size,F)}M(T,v,N);let _=0;const H=new Uint8Array(v.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let P=0;P<g.inputChannels.length;P++){const K=y[P],$=K.nx*K.size,ue=new Uint8Array(v.buffer,K.end*2,$*2);H.set(ue,_),_+=$*2,K.end+=$}return new DataView(H.buffer)}function Be(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=Da(u),v=g.inputChannels.length*g.lines*g.columns*g.totalBytes,R=new ArrayBuffer(v),N=new DataView(R);let y=0,L=0;const k=new Array(4);for(let T=0;T<g.lines;T++)for(let F=0;F<g.inputChannels.length;F++){let G=0;switch(g.inputChannels[F].pixelType){case 1:k[0]=y,k[1]=k[0]+g.columns,y=k[1]+g.columns;for(let _=0;_<g.columns;++_){const H=B[k[0]++]<<8|B[k[1]++];G+=H,N.setUint16(L,G,!0),L+=2}break;case 2:k[0]=y,k[1]=k[0]+g.columns,k[2]=k[1]+g.columns,y=k[2]+g.columns;for(let _=0;_<g.columns;++_){const H=B[k[0]++]<<24|B[k[1]++]<<16|B[k[2]++]<<8;G+=H,N.setUint32(L,G,!0),L+=4}break}}return N}function st(g){const u=g.viewer,B={value:g.offset.value},v=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),R={version:it(u,B),unknownUncompressedSize:it(u,B),unknownCompressedSize:it(u,B),acCompressedSize:it(u,B),dcCompressedSize:it(u,B),rleCompressedSize:it(u,B),rleUncompressedSize:it(u,B),rleRawSize:it(u,B),totalAcUncompressedCount:it(u,B),totalDcUncompressedCount:it(u,B),acCompression:it(u,B)};if(R.version<2)throw new Error("EXRLoader.parse: "+Xt.compression+" version "+R.version+" is unsupported");const N=new Array;let y=da(u,B)-2;for(;y>0;){const P=pt(u.buffer,B),K=ct(u,B),$=K>>2&3,ue=(K>>4)-1,Ee=new Int8Array([ue])[0],Fe=ct(u,B);N.push({name:P,index:Ee,type:Fe,compression:$}),y-=P.length+3}const L=Xt.channels,k=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const K=k[P]={},$=L[P];K.name=$.name,K.compression=0,K.decoded=!1,K.type=$.pixelType,K.pLinear=$.pLinear,K.width=g.columns,K.height=g.lines}const T={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const K=k[P];for(let $=0;$<N.length;++$){const ue=N[$];K.name==ue.name&&(K.compression=ue.compression,ue.index>=0&&(T.idx[ue.index]=P),K.offset=P)}}let F,G,_;if(R.acCompressedSize>0)switch(R.acCompression){case 0:F=new Uint16Array(R.totalAcUncompressedCount),D(g.array,u,B,R.acCompressedSize,F,R.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+R.totalAcUncompressedCount),K=Da(P);F=new Uint16Array(K.buffer),B.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const P={array:g.array,offset:B,size:R.dcCompressedSize};G=new Uint16Array(he(P).buffer),B.value+=R.dcCompressedSize}if(R.rleRawSize>0){const P=g.array.slice(B.value,B.value+R.rleCompressedSize),K=Da(P);_=Y(K.buffer),B.value+=R.rleCompressedSize}let H=0;const Z=new Array(k.length);for(let P=0;P<Z.length;++P)Z[P]=new Array;for(let P=0;P<g.lines;++P)for(let K=0;K<k.length;++K)Z[K].push(H),H+=k[K].width*g.type*2;T.idx[0]!==void 0&&k[T.idx[0]]&&ee(T,Z,k,F,G,v);for(let P=0;P<k.length;++P){const K=k[P];if(!K.decoded)switch(K.compression){case 2:let $=0,ue=0;for(let Ee=0;Ee<g.lines;++Ee){let Fe=Z[P][$];for(let be=0;be<K.width;++be){for(let ae=0;ae<2*K.type;++ae)v[Fe++]=_[ue+ae*K.width*K.height];ue++}$++}break;case 1:J(P,Z,k,F,G,v);break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(v.buffer)}function pt(g,u){const B=new Uint8Array(g);let v=0;for(;B[u.value+v]!=0;)v+=1;const R=new TextDecoder().decode(B.slice(u.value,u.value+v));return u.value=u.value+v+1,R}function Ot(g,u,B){const v=new TextDecoder().decode(new Uint8Array(g).slice(u.value,u.value+B));return u.value=u.value+B,v}function ia(g,u){const B=Ne(g,u),v=Ue(g,u);return[B,v]}function na(g,u){const B=Ue(g,u),v=Ue(g,u);return[B,v]}function Ne(g,u){const B=g.getInt32(u.value,!0);return u.value=u.value+4,B}function Ue(g,u){const B=g.getUint32(u.value,!0);return u.value=u.value+4,B}function kt(g,u){const B=g[u.value];return u.value=u.value+1,B}function ct(g,u){const B=g.getUint8(u.value);return u.value=u.value+1,B}const it=function(g,u){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(u.value,!0)):B=g.getUint32(u.value+4,!0)+Number(g.getUint32(u.value,!0)<<32),u.value+=8,B};function ze(g,u){const B=g.getFloat32(u.value,!0);return u.value+=4,B}function zo(g,u){return oa.toHalfFloat(ze(g,u))}function q(g){const u=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(u?u===31?B?NaN:1/0:Math.pow(2,u-15)*(1+B/1024):6103515625e-14*(B/1024))}function da(g,u){const B=g.getUint16(u.value,!0);return u.value+=2,B}function Jo(g,u){return q(da(g,u))}function Yo(g,u,B,v){const R=B.value,N=[];for(;B.value<R+v-1;){const y=pt(u,B),L=Ne(g,B),k=ct(g,B);B.value+=3;const T=Ne(g,B),F=Ne(g,B);N.push({name:y,pixelType:L,pLinear:k,xSampling:T,ySampling:F})}return B.value+=1,N}function Xo(g,u){const B=ze(g,u),v=ze(g,u),R=ze(g,u),N=ze(g,u),y=ze(g,u),L=ze(g,u),k=ze(g,u),T=ze(g,u);return{redX:B,redY:v,greenX:R,greenY:N,blueX:y,blueY:L,whiteX:k,whiteY:T}}function Vo(g,u){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],v=ct(g,u);return B[v]}function Wo(g,u){const B=Ne(g,u),v=Ne(g,u),R=Ne(g,u),N=Ne(g,u);return{xMin:B,yMin:v,xMax:R,yMax:N}}function Zo(g,u){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],v=ct(g,u);return B[v]}function $o(g,u){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],v=ct(g,u);return B[v]}function er(g,u){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],v=["ROUND_DOWN","ROUND_UP"],R=Ue(g,u),N=Ue(g,u),y=ct(g,u);return{xSize:R,ySize:N,levelMode:B[y&15],roundingMode:v[y>>4]}}function tr(g,u){const B=ze(g,u),v=ze(g,u);return[B,v]}function ar(g,u){const B=ze(g,u),v=ze(g,u),R=ze(g,u);return[B,v,R]}function sr(g,u,B,v,R){if(v==="string"||v==="stringvector"||v==="iccProfile")return Ot(u,B,R);if(v==="chlist")return Yo(g,u,B,R);if(v==="chromaticities")return Xo(g,B);if(v==="compression")return Vo(g,B);if(v==="box2i")return Wo(g,B);if(v==="envmap")return $o(g,B);if(v==="tiledesc")return er(g,B);if(v==="lineOrder")return Zo(g,B);if(v==="float")return ze(g,B);if(v==="v2f")return tr(g,B);if(v==="v3f")return ar(g,B);if(v==="int")return Ne(g,B);if(v==="rational")return ia(g,B);if(v==="timecode")return na(g,B);if(v==="preview")return B.value+=R,"skipped";B.value+=R}function ir(g,u){const B=Math.log2(g);return u=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function nr(g,u,B){let v=0;switch(g.levelMode){case"ONE_LEVEL":v=1;break;case"MIPMAP_LEVELS":v=ir(Math.max(u,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return v}function pi(g,u,B,v){const R=new Array(g);for(let N=0;N<g;N++){const y=1<<N;let L=u/y|0;v=="ROUND_UP"&&L*y<u&&(L+=1);const k=Math.max(L,1);R[N]=(k+B-1)/B|0}return R}function or(){const g=this,u=g.offset,B={value:0};for(let v=0;v<g.tileCount;v++){const R=Ne(g.viewer,u),N=Ne(g.viewer,u);u.value+=8,g.size=Ue(g.viewer,u);const y=R*g.blockWidth,L=N*g.blockHeight;g.columns=y+g.blockWidth>g.width?g.width-y:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const k=g.columns*g.totalBytes,T=g.size<g.lines*k?g.uncompress(g):te(g);u.value+=g.size;for(let F=0;F<g.lines;F++){const G=F*g.columns*g.totalBytes;for(let _=0;_<g.inputChannels.length;_++){const H=Xt.channels[_].name,Z=g.channelByteOffsets[H]*g.columns,P=g.decodeChannels[H];if(P===void 0)continue;B.value=G+Z;const K=(g.height-(1+L+F))*g.outLineWidth;for(let $=0;$<g.columns;$++){const ue=K+($+y)*g.outputChannels+P;g.byteArray[ue]=g.getter(T,B)}}}}}function rr(){const g=this,u=g.offset,B={value:0};for(let v=0;v<g.height/g.blockHeight;v++){const R=Ne(g.viewer,u)-Xt.dataWindow.yMin;g.size=Ue(g.viewer,u),g.lines=R+g.blockHeight>g.height?g.height-R:g.blockHeight;const N=g.columns*g.totalBytes,y=g.size<g.lines*N?g.uncompress(g):te(g);u.value+=g.size;for(let L=0;L<g.blockHeight;L++){const k=v*g.blockHeight,T=L+g.scanOrder(k);if(T>=g.height)continue;const F=L*N,G=(g.height-1-T)*g.outLineWidth;for(let _=0;_<g.inputChannels.length;_++){const H=Xt.channels[_].name,Z=g.channelByteOffsets[H]*g.columns,P=g.decodeChannels[H];if(P!==void 0){B.value=F+Z;for(let K=0;K<g.columns;K++){const $=G+K*g.outputChannels+P;g.byteArray[$]=g.getter(y,B)}}}}}}function Ar(g,u,B){const v={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");v.version=g.getUint8(4);const R=g.getUint8(5);v.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},B.value=8;let N=!0;for(;N;){const y=pt(u,B);if(y==="")N=!1;else{const L=pt(u,B),k=Ue(g,B),T=sr(g,u,B,L,k);T===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):v[y]=T}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",v),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return v}function cr(g,u,B,v,R,N){const y={size:0,viewer:u,array:B,offset:v,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},shouldExpand:!1,scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:Me};switch(g.compression){case"NO_COMPRESSION":y.blockHeight=1,y.uncompress=te;break;case"RLE_COMPRESSION":y.blockHeight=1,y.uncompress=oe;break;case"ZIPS_COMPRESSION":y.blockHeight=1,y.uncompress=he;break;case"ZIP_COMPRESSION":y.blockHeight=16,y.uncompress=he;break;case"PIZ_COMPRESSION":y.blockHeight=32,y.uncompress=Qe;break;case"PXR24_COMPRESSION":y.blockHeight=16,y.uncompress=Be;break;case"DWAA_COMPRESSION":y.blockHeight=32,y.uncompress=st;break;case"DWAB_COMPRESSION":y.blockHeight=256,y.uncompress=st;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const L={};for(const _ of g.channels)switch(_.name){case"Y":case"R":case"G":case"B":case"A":L[_.name]=!0,y.type=_.pixelType}let k=!1,T=!1;if(L.R&&L.G&&L.B)y.outputChannels=4;else if(L.Y)y.outputChannels=1;else throw new Error("EXRLoader.parse: file contains unsupported data channels.");switch(y.outputChannels){case 4:N==ot?(k=!L.A,y.format=ot,y.colorSpace=Me,y.outputChannels=4,y.decodeChannels={R:0,G:1,B:2,A:3}):N==wt?(y.format=wt,y.colorSpace=Me,y.outputChannels=2,y.decodeChannels={R:0,G:1}):N==Nt?(y.format=Nt,y.colorSpace=Me,y.outputChannels=1,y.decodeChannels={R:0}):T=!0;break;case 1:N==ot?(k=!0,y.format=ot,y.colorSpace=Me,y.outputChannels=4,y.shouldExpand=!0,y.decodeChannels={Y:0}):N==wt?(y.format=wt,y.colorSpace=Me,y.outputChannels=2,y.shouldExpand=!0,y.decodeChannels={Y:0}):N==Nt?(y.format=Nt,y.colorSpace=Me,y.outputChannels=1,y.decodeChannels={Y:0}):T=!0;break;default:T=!0}if(T)throw new Error("EXRLoader.parse: invalid output format for specified file.");if(y.type==1)switch(R){case ft:y.getter=Jo;break;case Xe:y.getter=da;break}else if(y.type==2)switch(R){case ft:y.getter=ze;break;case Xe:y.getter=zo}else throw new Error("EXRLoader.parse: unsupported pixelType "+y.type+" for "+g.compression+".");y.columns=y.width;const F=y.width*y.height*y.outputChannels;switch(R){case ft:y.byteArray=new Float32Array(F),k&&y.byteArray.fill(1,0,F);break;case Xe:y.byteArray=new Uint16Array(F),k&&y.byteArray.fill(15360,0,F);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let G=0;for(const _ of g.channels)y.decodeChannels[_.name]!==void 0&&(y.channelByteOffsets[_.name]=G),G+=_.pixelType*2;if(y.totalBytes=G,y.outLineWidth=y.width*y.outputChannels,g.lineOrder==="INCREASING_Y"?y.scanOrder=_=>_:y.scanOrder=_=>y.height-1-_,g.spec.singleTile){y.blockHeight=g.tiles.ySize,y.blockWidth=g.tiles.xSize;const _=nr(g.tiles,y.width,y.height),H=pi(_,y.width,g.tiles.xSize,g.tiles.roundingMode),Z=pi(_,y.height,g.tiles.ySize,g.tiles.roundingMode);y.tileCount=H[0]*Z[0];for(let P=0;P<_;P++)for(let K=0;K<Z[P];K++)for(let $=0;$<H[P];$++)it(u,v);y.decode=or.bind(y)}else{y.blockWidth=y.width;const _=Math.ceil(y.height/y.blockHeight);for(let H=0;H<_;H++)it(u,v);y.decode=rr.bind(y)}return y}const ui={value:0},bi=new DataView(e),lr=new Uint8Array(e),Xt=Ar(bi,e,ui),jt=cr(Xt,bi,lr,ui,this.type,this.outputFormat);if(jt.decode(),jt.shouldExpand){const g=jt.byteArray;if(this.outputFormat==ot)for(let u=0;u<g.length;u+=4)g[u+2]=g[u+1]=g[u];else if(this.outputFormat==wt)for(let u=0;u<g.length;u+=2)g[u+1]=g[u]}return{header:Xt,width:jt.width,height:jt.height,data:jt.byteArray,format:jt.format,colorSpace:jt.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}setOutputFormat(e){return this.outputFormat=e,this}load(e,t,s,a){function i(n,r){n.colorSpace=r.colorSpace,n.minFilter=$e,n.magFilter=$e,n.generateMipmaps=!1,n.flipY=!1,t&&t(n,r)}return super.load(e,i,s,a)}}class Ec extends Li{constructor(e){super(e),this.type=Xe}parse(e){const t=function(f,E){switch(f){case 1:throw new Error("THREE.HDRLoader: Read Error: "+(E||""));case 2:throw new Error("THREE.HDRLoader: Write Error: "+(E||""));case 3:throw new Error("THREE.HDRLoader: Bad File Format: "+(E||""));default:case 4:throw new Error("THREE.HDRLoader: Memory Error: "+(E||""))}},s=function(f,E,I){E=E||1024;let C=f.pos,Q=-1,w=0,x="",S=String.fromCharCode.apply(null,new Uint16Array(f.subarray(C,C+128)));for(;0>(Q=S.indexOf(`
5
+ `))&&w<E&&C<f.byteLength;)x+=S,w+=S.length,C+=128,S+=String.fromCharCode.apply(null,new Uint16Array(f.subarray(C,C+128)));return-1<Q?(f.pos+=w+Q+1,x+S.slice(0,Q)):!1},a=function(f){const E=/^#\?(\S+)/,I=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,C=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,Q=/^\s*FORMAT=(\S+)\s*$/,w=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,x={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let S,D;for((f.pos>=f.byteLength||!(S=s(f)))&&t(1,"no header found"),(D=S.match(E))||t(3,"bad initial token"),x.valid|=1,x.programtype=D[1],x.string+=S+`
6
+ `;S=s(f),S!==!1;){if(x.string+=S+`
7
+ `,S.charAt(0)==="#"){x.comments+=S+`
8
+ `;continue}if((D=S.match(I))&&(x.gamma=parseFloat(D[1])),(D=S.match(C))&&(x.exposure=parseFloat(D[1])),(D=S.match(Q))&&(x.valid|=2,x.format=D[1]),(D=S.match(w))&&(x.valid|=4,x.height=parseInt(D[1],10),x.width=parseInt(D[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},i=function(f,E,I){const C=E;if(C<8||C>32767||f[0]!==2||f[1]!==2||f[2]&128)return new Uint8Array(f);C!==(f[2]<<8|f[3])&&t(3,"wrong scanline width");const Q=new Uint8Array(4*E*I);Q.length||t(4,"unable to allocate buffer space");let w=0,x=0;const S=4*C,D=new Uint8Array(4),M=new Uint8Array(S);let O=I;for(;O>0&&x<f.byteLength;){x+4>f.byteLength&&t(1),D[0]=f[x++],D[1]=f[x++],D[2]=f[x++],D[3]=f[x++],(D[0]!=2||D[1]!=2||(D[2]<<8|D[3])!=C)&&t(3,"bad rgbe scanline format");let z=0,Y;for(;z<S&&x<f.byteLength;){Y=f[x++];const J=Y>128;if(J&&(Y-=128),(Y===0||z+Y>S)&&t(3,"bad scanline data"),J){const X=f[x++];for(let V=0;V<Y;V++)M[z++]=X}else M.set(f.subarray(x,x+Y),z),z+=Y,x+=Y}const ee=C;for(let J=0;J<ee;J++){let X=0;Q[w]=M[J+X],X+=C,Q[w+1]=M[J+X],X+=C,Q[w+2]=M[J+X],X+=C,Q[w+3]=M[J+X],w+=4}O--}return Q},n=function(f,E,I,C){const Q=f[E+3],w=Math.pow(2,Q-128)/255;I[C+0]=f[E+0]*w,I[C+1]=f[E+1]*w,I[C+2]=f[E+2]*w,I[C+3]=1},r=function(f,E,I,C){const Q=f[E+3],w=Math.pow(2,Q-128)/255;I[C+0]=oa.toHalfFloat(Math.min(f[E+0]*w,65504)),I[C+1]=oa.toHalfFloat(Math.min(f[E+1]*w,65504)),I[C+2]=oa.toHalfFloat(Math.min(f[E+2]*w,65504)),I[C+3]=oa.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const h=a(A),c=h.width,l=h.height,d=i(A.subarray(A.pos),c,l);let p,b,m;switch(this.type){case ft:m=d.length/4;const f=new Float32Array(m*4);for(let I=0;I<m;I++)n(d,I*4,f,I*4);p=f,b=ft;break;case Xe:m=d.length/4;const E=new Uint16Array(m*4);for(let I=0;I<m;I++)r(d,I*4,E,I*4);p=E,b=Xe;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:c,height:l,data:p,header:h.string,gamma:h.gamma,exposure:h.exposure,type:b}}setDataType(e){return this.type=e,this}load(e,t,s,a){function i(n,r){switch(n.type){case ft:case Xe:n.colorSpace=Me,n.minFilter=$e,n.magFilter=$e,n.generateMipmaps=!1,n.flipY=!0;break}t&&t(n,r)}return super.load(e,i,s,a)}}const ea=new vs,Je=new U,Yt=new U,ye=new De,oo={X:new U(1,0,0),Y:new U(0,1,0),Z:new U(0,0,1)},ti={type:"change"},ro={type:"mouseDown",mode:null},Ao={type:"mouseUp",mode:null},co={type:"objectChange"};class Ic extends Ni{constructor(e,t=null){super(void 0,t);const s=new vc(this);this._root=s;const a=new po;this._gizmo=a,s.add(a);const i=new xc;this._plane=i,s.add(i);const n=this;function r(C,Q){let w=Q;Object.defineProperty(n,C,{get:function(){return w!==void 0?w:Q},set:function(x){w!==x&&(w=x,i[C]=x,a[C]=x,n.dispatchEvent({type:C+"-changed",value:x}),n.dispatchEvent(ti))}}),n[C]=Q,i[C]=Q,a[C]=Q}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const A=new U,h=new U,c=new De,l=new De,d=new U,p=new De,b=new U,m=new U,f=new U,E=0,I=new U;r("worldPosition",A),r("worldPositionStart",h),r("worldQuaternion",c),r("worldQuaternionStart",l),r("cameraPosition",d),r("cameraQuaternion",p),r("pointStart",b),r("pointEnd",m),r("rotationAxis",f),r("rotationAngle",E),r("eye",I),this._offset=new U,this._startNorm=new U,this._endNorm=new U,this._cameraScale=new U,this._parentPosition=new U,this._parentQuaternion=new De,this._parentQuaternionInv=new De,this._parentScale=new U,this._worldScaleStart=new U,this._worldQuaternionInv=new De,this._worldScale=new U,this._positionStart=new U,this._quaternionStart=new De,this._scaleStart=new U,this._getPointer=Cc.bind(this),this._onPointerDown=wc.bind(this),this._onPointerHover=Bc.bind(this),this._onPointerMove=yc.bind(this),this._onPointerUp=Qc.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&ea.setFromCamera(e,this.camera);const t=ai(this._gizmo.picker[this.mode],ea);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&ea.setFromCamera(e,this.camera);const t=ai(this._plane,ea,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,ro.mode=this.mode,this.dispatchEvent(ro)}}pointerMove(e){const t=this.axis,s=this.mode,a=this.object;let i=this.space;if(s==="scale"?i="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(i="world"),a===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&ea.setFromCamera(e,this.camera);const n=ai(this._plane,ea,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),i==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),i==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),a.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i==="local"&&(a.position.applyQuaternion(ye.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.position.applyQuaternion(this._quaternionStart)),i==="world"&&(a.parent&&a.position.add(Je.setFromMatrixPosition(a.parent.matrixWorld)),t.search("X")!==-1&&(a.position.x=Math.round(a.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(a.position.y=Math.round(a.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(a.position.z=Math.round(a.position.z/this.translationSnap)*this.translationSnap),a.parent&&a.position.sub(Je.setFromMatrixPosition(a.parent.matrixWorld)))),a.position.x=Math.max(this.minX,Math.min(this.maxX,a.position.x)),a.position.y=Math.max(this.minY,Math.min(this.maxY,a.position.y)),a.position.z=Math.max(this.minZ,Math.min(this.maxZ,a.position.z));else if(s==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),Yt.set(r,r,r)}else Je.copy(this.pointStart),Yt.copy(this.pointEnd),Je.applyQuaternion(this._worldQuaternionInv),Yt.applyQuaternion(this._worldQuaternionInv),Yt.divide(Je),t.search("X")===-1&&(Yt.x=1),t.search("Y")===-1&&(Yt.y=1),t.search("Z")===-1&&(Yt.z=1);a.scale.copy(this._scaleStart).multiply(Yt),this.scaleSnap&&(t.search("X")!==-1&&(a.scale.x=Math.round(a.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(a.scale.y=Math.round(a.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(a.scale.z=Math.round(a.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(Je.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Je.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(oo[t]),Je.copy(oo[t]),i==="local"&&Je.applyQuaternion(this.worldQuaternion),Je.cross(this.eye),Je.length()===0?A=!0:this.rotationAngle=this._offset.dot(Je.normalize())*r),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i==="local"&&t!=="E"&&t!=="XYZE"?(a.quaternion.copy(this._quaternionStart),a.quaternion.multiply(ye.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),a.quaternion.copy(ye.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),a.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(ti),this.dispatchEvent(co)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Ao.mode=this.mode,this.dispatchEvent(Ao)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(ti),this.dispatchEvent(co),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ea}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,s,a){const i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(s),i.active.color.set(a),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(s),i.activeTransparent.color.set(a),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(s),i.active._color&&i.active._color.set(a),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(s),i.activeTransparent._color&&i.activeTransparent._color.set(a)}}function Cc(o){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:o.button};{const e=this.domElement.getBoundingClientRect();return{x:(o.clientX-e.left)/e.width*2-1,y:-(o.clientY-e.top)/e.height*2+1,button:o.button}}}function Bc(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function wc(o){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(o)),this.pointerDown(this._getPointer(o)))}function yc(o){this.enabled&&this.pointerMove(this._getPointer(o))}function Qc(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function ai(o,e,t){const s=e.intersectObject(o,!0);for(let a=0;a<s.length;a++)if(s[a].object.visible||t)return s[a];return!1}const Ja=new Ht,fe=new U(0,1,0),lo=new U(0,0,0),ho=new de,Ya=new De,Xa=new De,Dt=new U,go=new de,Sa=new U(1,0,0),ta=new U(0,1,0),Ra=new U(0,0,1),Va=new U,Ta=new U,ka=new U;class vc extends Bt{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}}class po extends Bt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new It({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new _t({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=e.clone();s.opacity=.15;const a=t.clone();a.opacity=.5;const i=e.clone();i.color.setHex(16711680);const n=e.clone();n.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const h=e.clone();h.color.setHex(65280),h.opacity=.5;const c=e.clone();c.color.setHex(255),c.opacity=.5;const l=e.clone();l.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25;const p=e.clone();p.color.setHex(16776960);const b=e.clone();b.color.setHex(7895160),this.materialLib={xAxis:i,yAxis:n,zAxis:r,active:p,xAxisTransparent:A,yAxisTransparent:h,zAxisTransparent:c,activeTransparent:d};const m=new et(0,.04,.1,12);m.translate(0,.05,0);const f=new Ve(.08,.08,.08);f.translate(0,.04,0);const E=new lt;E.setAttribute("position",new _e([0,0,0,1,0,0],3));const I=new et(.0075,.0075,.5,3);I.translate(0,.25,0);function C(X,V){const W=new Ia(X,.0075,3,64,V*Math.PI*2);return W.rotateY(Math.PI/2),W.rotateX(Math.PI/2),W}function Q(){const X=new lt;return X.setAttribute("position",new _e([0,0,0,1,1,1],3)),X}const w={X:[[new j(m,i),[.5,0,0],[0,0,-Math.PI/2]],[new j(m,i),[-.5,0,0],[0,0,Math.PI/2]],[new j(I,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new j(m,n),[0,.5,0]],[new j(m,n),[0,-.5,0],[Math.PI,0,0]],[new j(I,n)]],Z:[[new j(m,r),[0,0,.5],[Math.PI/2,0,0]],[new j(m,r),[0,0,-.5],[-Math.PI/2,0,0]],[new j(I,r),null,[Math.PI/2,0,0]]],XYZ:[[new j(new qa(.1,0),l),[0,0,0]]],XY:[[new j(new Ve(.15,.15,.01),c),[.15,.15,0]]],YZ:[[new j(new Ve(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new j(new Ve(.15,.15,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new j(new et(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new j(new et(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new j(new et(.2,0,.6,4),s),[0,.3,0]],[new j(new et(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new j(new et(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new j(new et(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new j(new qa(.2,0),s)]],XY:[[new j(new Ve(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new j(new Ve(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new j(new Ve(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},S={START:[[new j(new qa(.01,2),a),null,null,null,"helper"]],END:[[new j(new qa(.01,2),a),null,null,null,"helper"]],DELTA:[[new bt(Q(),a),null,null,null,"helper"]],X:[[new bt(E,a),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new bt(E,a),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new bt(E,a),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new j(C(.5,1),b),null,[0,Math.PI/2,0]]],X:[[new j(C(.5,.5),i)]],Y:[[new j(C(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new j(C(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new j(C(.75,1),d),null,[0,Math.PI/2,0]]]},M={AXIS:[[new bt(E,a),[-1e3,0,0],null,[1e6,1,1],"helper"]]},O={XYZE:[[new j(new is(.25,10,8),s)]],X:[[new j(new Ia(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new j(new Ia(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new j(new Ia(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new j(new Ia(.75,.1,2,24),s)]]},z={X:[[new j(f,i),[.5,0,0],[0,0,-Math.PI/2]],[new j(I,i),[0,0,0],[0,0,-Math.PI/2]],[new j(f,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new j(f,n),[0,.5,0]],[new j(I,n)],[new j(f,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new j(f,r),[0,0,.5],[Math.PI/2,0,0]],[new j(I,r),[0,0,0],[Math.PI/2,0,0]],[new j(f,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new j(new Ve(.15,.15,.01),c),[.15,.15,0]]],YZ:[[new j(new Ve(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new j(new Ve(.15,.15,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new j(new Ve(.1,.1,.1),l)]]},Y={X:[[new j(new et(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new j(new et(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new j(new et(.2,0,.6,4),s),[0,.3,0]],[new j(new et(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new j(new et(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new j(new et(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new j(new Ve(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new j(new Ve(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new j(new Ve(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new j(new Ve(.2,.2,.2),s),[0,0,0]]]},ee={X:[[new bt(E,a),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new bt(E,a),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new bt(E,a),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function J(X){const V=new Bt;for(const W in X)for(let ne=X[W].length;ne--;){const Ae=X[W][ne][0].clone(),Oe=X[W][ne][1],te=X[W][ne][2],oe=X[W][ne][3],he=X[W][ne][4];Ae.name=W,Ae.tag=he,Oe&&Ae.position.set(Oe[0],Oe[1],Oe[2]),te&&Ae.rotation.set(te[0],te[1],te[2]),oe&&Ae.scale.set(oe[0],oe[1],oe[2]),Ae.updateMatrix();const Qe=Ae.geometry.clone();Qe.applyMatrix4(Ae.matrix),Ae.geometry=Qe,Ae.renderOrder=1/0,Ae.position.set(0,0,0),Ae.rotation.set(0,0,0),Ae.scale.set(1,1,1),V.add(Ae)}return V}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=J(w)),this.add(this.gizmo.rotate=J(D)),this.add(this.gizmo.scale=J(z)),this.add(this.picker.translate=J(x)),this.add(this.picker.rotate=J(O)),this.add(this.picker.scale=J(Y)),this.add(this.helper.translate=J(S)),this.add(this.helper.rotate=J(M)),this.add(this.helper.scale=J(ee)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Xa;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let a=0;a<s.length;a++){const i=s[a];i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition);let n;if(this.camera.isOrthographicCamera?n=(this.camera.top-this.camera.bottom)/this.camera.zoom:n=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(n*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(ye.setFromEuler(Ja.set(0,0,0)),i.quaternion.copy(t).multiply(ye),Math.abs(fe.copy(Sa).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(ye.setFromEuler(Ja.set(0,0,Math.PI/2)),i.quaternion.copy(t).multiply(ye),Math.abs(fe.copy(ta).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(ye.setFromEuler(Ja.set(0,Math.PI/2,0)),i.quaternion.copy(t).multiply(ye),Math.abs(fe.copy(Ra).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(ye.setFromEuler(Ja.set(0,Math.PI/2,0)),fe.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(ho.lookAt(lo,fe,ta)),i.quaternion.multiply(ye),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),Je.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Je.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(Je),i.visible=this.dragging):(i.quaternion.copy(t),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(fe.copy(Sa).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(fe.copy(ta).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(fe.copy(Ra).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(fe.copy(Ra).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(fe.copy(Sa).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(fe.copy(ta).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(Ya.copy(t),fe.copy(this.eye).applyQuaternion(ye.copy(t).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(ho.lookAt(this.eye,lo,ta)),i.name==="X"&&(ye.setFromAxisAngle(Sa,Math.atan2(-fe.y,fe.z)),ye.multiplyQuaternions(Ya,ye),i.quaternion.copy(ye)),i.name==="Y"&&(ye.setFromAxisAngle(ta,Math.atan2(fe.x,fe.z)),ye.multiplyQuaternions(Ya,ye),i.quaternion.copy(ye)),i.name==="Z"&&(ye.setFromAxisAngle(Ra,Math.atan2(fe.y,fe.x)),ye.multiplyQuaternions(Ya,ye),i.quaternion.copy(ye))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis?(i.material.color.copy(this.materialLib.active.color),i.material.opacity=1):this.axis.split("").some(function(r){return i.name===r})&&(i.material.color.copy(this.materialLib.active.color),i.material.opacity=1))}super.updateMatrixWorld(e)}}class xc extends j{constructor(){super(new Ui(1e5,1e5,2,2),new It({visible:!1,wireframe:!0,side:ls,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Va.copy(Sa).applyQuaternion(t==="local"?this.worldQuaternion:Xa),Ta.copy(ta).applyQuaternion(t==="local"?this.worldQuaternion:Xa),ka.copy(Ra).applyQuaternion(t==="local"?this.worldQuaternion:Xa),fe.copy(Ta),this.mode){case"translate":case"scale":switch(this.axis){case"X":fe.copy(this.eye).cross(Va),Dt.copy(Va).cross(fe);break;case"Y":fe.copy(this.eye).cross(Ta),Dt.copy(Ta).cross(fe);break;case"Z":fe.copy(this.eye).cross(ka),Dt.copy(ka).cross(fe);break;case"XY":Dt.copy(ka);break;case"YZ":Dt.copy(Va);break;case"XZ":fe.copy(ka),Dt.copy(Ta);break;case"XYZ":case"E":Dt.set(0,0,0);break}break;default:Dt.set(0,0,0)}Dt.length()===0?this.quaternion.copy(this.cameraQuaternion):(go.lookAt(Je.set(0,0,0),Dt,fe),this.quaternion.setFromRotationMatrix(go)),super.updateMatrixWorld(e)}}const uo={type:"change"},si={type:"start"},bo={type:"end"},Dc={type:"endMovement"},Wa=new _r,fo=new Lr,Sc=Math.cos(70*we.DEG2RAD),Le=new U;new U;const at=2*Math.PI,pe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},aa=1e-6;let Rc=class extends Ni{constructor(o,e=null){super(o,e),this.state=pe.NONE,this.target=new U,this.cursor=new U,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ra.ROTATE,MIDDLE:ra.DOLLY,RIGHT:ra.PAN},this.touches={ONE:Aa.ROTATE,TWO:Aa.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new U,this._lastQuaternion=new De,this._lastTargetPosition=new U,this._quat=new De().setFromUnitVectors(o.up,new U(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Pi,this._sphericalDelta=new Pi,this._scale=1,this._currentScale=1,this._panOffset=new U,this._rotateStart=new Ge,this._rotateEnd=new Ge,this._rotateDelta=new Ge,this._panStart=new Ge,this._panEnd=new Ge,this._panDelta=new Ge,this._dollyStart=new Ge,this._dollyEnd=new Ge,this._dollyDelta=new Ge,this._dollyDirection=new U,this._mouse=new Ge,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=kc.bind(this),this._onPointerDown=Tc.bind(this),this._onPointerUp=Fc.bind(this),this._onContextMenu=Gc.bind(this),this._onMouseWheel=Lc.bind(this),this._onKeyDown=Nc.bind(this),this._onTouchStart=Uc.bind(this),this._onTouchMove=Pc.bind(this),this._onMouseDown=Mc.bind(this),this._onMouseMove=_c.bind(this),this._interceptControlDown=Oc.bind(this),this._interceptControlUp=jc.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(o){this._cursorStyle=o,o==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(o){super.connect(o),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(uo),this.update(),this.state=pe.NONE,this._isDamping=!1}pan(o,e){this._pan(o,e),this.update()}dollyIn(o){this._dollyIn(o),this.update()}dollyOut(o){this._dollyOut(o),this.update()}rotateLeft(o){this._rotateLeft(o),this.update()}rotateUp(o){this._rotateUp(o),this.update()}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);Le.copy(e).sub(this.target),Le.applyQuaternion(this._quat),this._spherical.setFromVector3(Le),this.autoRotate&&this.state===pe.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let t=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(t)&&isFinite(s)&&(t<-Math.PI?t+=at:t>Math.PI&&(t-=at),s<-Math.PI?s+=at:s>Math.PI&&(s-=at),t<=s?this._spherical.theta=Math.max(t,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+s)/2?Math.max(t,this._spherical.theta):Math.min(s,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let a=!1;if(this.enableDamping?this._currentScale=we.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const i=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),a=Math.abs(i-this._spherical.radius)>aa*100}if(Le.setFromSpherical(this._spherical),Le.applyQuaternion(this._quatInverse),e.copy(this.target).add(Le),this.object.parent?this.object.parent.worldToLocal(e):this.object.position.copy(e),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let i=null;if(this.object.isPerspectiveCamera){const n=Le.length();i=this._clampDistance(n*this._currentScale);const r=n-i;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),a=Math.abs(r)>aa}else if(this.object.isOrthographicCamera){const n=new U(this._mouse.x,this._mouse.y,0);n.unproject(this.object);const r=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),a=Math.abs(r-this.object.zoom)>aa;const A=new U(this._mouse.x,this._mouse.y,0);A.unproject(this.object),this.object.position.sub(A).add(n),this.object.updateMatrixWorld(),i=Le.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;i!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(i).add(this.object.position):(Wa.origin.copy(this.object.position),Wa.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Wa.direction))<Sc?this.object.lookAt(this.target):(fo.setFromNormalAndCoplanarPoint(this.object.up,this.target),Wa.intersectPlane(fo,this.target))))}else if(this.object.isOrthographicCamera){const i=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(i-this.object.zoom)>aa&&(this.object.updateProjectionMatrix(),a=!0)}return this._scale=1,a||this._lastPosition.distanceToSquared(this.object.position)>aa||8*(1-this._lastQuaternion.dot(this.object.quaternion))>aa||this._lastTargetPosition.distanceToSquared(this.target)>aa?(this.dispatchEvent(uo),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===pe.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===pe.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(Dc)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?at/60*this.autoRotateSpeed*o:at/60/60*this.autoRotateSpeed}_getZoomScale(o){const e=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,e){Le.setFromMatrixColumn(e,0),Le.multiplyScalar(-o),this._panOffset.add(Le)}_panUp(o,e){this.screenSpacePanning===!0?Le.setFromMatrixColumn(e,1):(Le.setFromMatrixColumn(e,0),Le.crossVectors(this.object.up,Le)),Le.multiplyScalar(o),this._panOffset.add(Le)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(Le).sub(this.target);let s=Le.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*s/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*s/t.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/t.clientWidth,this.object.matrixWorld),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/t.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const t=this.domElement.getBoundingClientRect(),s=o-t.left,a=e-t.top,i=t.width,n=t.height;this._mouse.x=s/i*2-1,this._mouse.y=-(a/n)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(at*this._rotateDelta.x/e.clientHeight),this._rotateUp(at*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(o){this._panEnd.set(o.clientX,o.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let e=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(at*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-at*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(at*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-at*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._rotateStart.set(t,s)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._panStart.set(t,s)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,s=o.pageY-e.y,a=Math.sqrt(t*t+s*s);this._dollyStart.set(0,a)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const t=this._getSecondPointerPosition(o),s=.5*(o.pageX+t.x),a=.5*(o.pageY+t.y);this._rotateEnd.set(s,a)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(at*this._rotateDelta.x/e.clientHeight),this._rotateUp(at*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._panEnd.set(t,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,s=o.pageY-e.y,a=Math.sqrt(t*t+s*s);this._dollyEnd.set(0,a),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const i=(o.pageX+e.x)*.5,n=(o.pageY+e.y)*.5;this._updateZoomParameters(i,n)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(o){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId)return!0;return!1}_trackPointer(o){let e=this._pointerPositions[o.pointerId];e===void 0&&(e=new Ge,this._pointerPositions[o.pointerId]=e),e.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const e=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(o){const e=o.deltaMode,t={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(e){case 1:t.deltaY*=16;break;case 2:t.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(t.deltaY*=10),t}};function Tc(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function kc(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function Fc(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(bo),this.state=pe.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Mc(o){let e;switch(o.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case ra.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=pe.DOLLY;break;case ra.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=pe.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=pe.ROTATE}break;case ra.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=pe.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=pe.PAN}break;default:this.state=pe.NONE}this.state!==pe.NONE&&this.dispatchEvent(si)}function _c(o){switch(this.state){case pe.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case pe.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case pe.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Lc(o){this.enabled===!1||this.enableZoom===!1||this.state!==pe.NONE||(o.preventDefault(),this.dispatchEvent(si),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(bo))}function Nc(o){this.enabled!==!1&&this._handleKeyDown(o)}function Uc(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case Aa.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=pe.TOUCH_ROTATE;break;case Aa.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=pe.TOUCH_PAN;break;default:this.state=pe.NONE}break;case 2:switch(this.touches.TWO){case Aa.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=pe.TOUCH_DOLLY_PAN;break;case Aa.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=pe.TOUCH_DOLLY_ROTATE;break;default:this.state=pe.NONE}break;default:this.state=pe.NONE}this.state!==pe.NONE&&this.dispatchEvent(si)}function Pc(o){switch(this._trackPointer(o),this.state){case pe.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case pe.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case pe.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case pe.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=pe.NONE}}function Gc(o){this.enabled!==!1&&o.preventDefault()}function Oc(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function jc(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class qc extends bt{constructor(e,t=1,s=16,a=2){const i=new lt,n=s+a*2,r=new Float32Array((n*3+3)*3);i.setAttribute("position",new nt(r,3));const A=new _t({color:65280}),h=new _t({color:16776960});super(i,[h,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=s,this.divisionsOuterAngle=a,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,s=this.divisionsInnerAngle,a=this.divisionsOuterAngle,i=we.degToRad(e.panner.coneInnerAngle),n=we.degToRad(e.panner.coneOuterAngle),r=i/2,A=n/2;let h=0,c=0,l,d;const p=this.geometry,b=p.attributes.position;p.clearGroups();function m(f,E,I,C){const Q=(E-f)/I;for(b.setXYZ(h,0,0,0),c++,l=f;l<E;l+=Q)d=h+c,b.setXYZ(d,Math.sin(l)*t,0,Math.cos(l)*t),b.setXYZ(d+1,Math.sin(Math.min(l+Q,E))*t,0,Math.cos(Math.min(l+Q,E))*t),b.setXYZ(d+2,0,0,0),c+=3;p.addGroup(h,c,C),h+=c,c=0}m(-A,-r,a,0),m(-r,r,s,1),m(r,A,a,0),b.needsUpdate=!0,i===n&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Hc={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
9
9
 
10
10
  varying vec2 vUv;
11
11
 
@@ -37,7 +37,7 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
37
37
 
38
38
  gl_FragColor = sum;
39
39
 
40
- }`},Dc={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
40
+ }`},Kc={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
41
41
 
42
42
  varying vec2 vUv;
43
43
 
@@ -69,24 +69,7 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
69
69
 
70
70
  gl_FragColor = sum;
71
71
 
72
- }`};let Rs,an,os,$s;function on(o,e=1/0,t=null){an||(an=new yi(2,2,1,1)),os||(os=new jn({uniforms:{blitTexture:new lr(o)},vertexShader:`
73
- varying vec2 vUv;
74
- void main(){
75
- vUv = uv;
76
- gl_Position = vec4(position.xy * 1.0,0.,.999999);
77
- }`,fragmentShader:`
78
- uniform sampler2D blitTexture;
79
- varying vec2 vUv;
80
-
81
- void main(){
82
- gl_FragColor = vec4(vUv.xy, 0, 1);
83
-
84
- #ifdef IS_SRGB
85
- gl_FragColor = sRGBTransferOETF( texture2D( blitTexture, vUv) );
86
- #else
87
- gl_FragColor = texture2D( blitTexture, vUv);
88
- #endif
89
- }`})),os.uniforms.blitTexture.value=o,os.defines.IS_SRGB=o.colorSpace==ce,os.needsUpdate=!0,$s||($s=new O(an,os),$s.frustumCulled=!1);const i=new Ps,s=new vi;s.add($s),t===null&&(t=Rs=new hr({antialias:!1}));const n=Math.min(o.image.width,e),a=Math.min(o.image.height,e);t.setSize(n,a),t.clear(),t.render(s,i);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=n,r.height=a,A.drawImage(t.domElement,0,0,n,a);const c=new qn(r);return c.minFilter=o.minFilter,c.magFilter=o.magFilter,c.wrapS=o.wrapS,c.wrapT=o.wrapT,c.colorSpace=o.colorSpace,c.name=o.name,Rs&&(Rs.forceContextLoss(),Rs.dispose(),Rs=null),c}const Va={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class rn{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Gc(e)}),this.register(function(e){return new Pc(e)}),this.register(function(e){return new qc(e)}),this.register(function(e){return new zc(e)}),this.register(function(e){return new Yc(e)}),this.register(function(e){return new Kc(e)}),this.register(function(e){return new Oc(e)}),this.register(function(e){return new Hc(e)}),this.register(function(e){return new jc(e)}),this.register(function(e){return new Jc(e)}),this.register(function(e){return new Vc(e)}),this.register(function(e){return new Wc(e)}),this.register(function(e){return new Xc(e)}),this.register(function(e){return new Zc(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){const n=new Uc,a=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)a.push(this.pluginCallbacks[r](n));n.setPlugins(a),n.write(e,t,s).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,s,n,t)})}}const ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},An="KHR_mesh_quantization",at={};at[Ls]=ae.NEAREST,at[li]=ae.NEAREST_MIPMAP_NEAREST,at[Qn]=ae.NEAREST_MIPMAP_LINEAR,at[it]=ae.LINEAR,at[yn]=ae.LINEAR_MIPMAP_NEAREST,at[hs]=ae.LINEAR_MIPMAP_LINEAR,at[Ns]=ae.CLAMP_TO_EDGE,at[zt]=ae.REPEAT,at[vn]=ae.MIRRORED_REPEAT;const Wa={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Rc=new Be,Xa=12,Tc=1179937895,kc=2,Za=8,Mc=1313821514,Fc=5130562;function Ts(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function _c(o){return new TextEncoder().encode(o).buffer}function Lc(o){return Ts(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Nc(o,e,t){const i={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=e;s<e+t;s++)for(let n=0;n<o.itemSize;n++){let a;o.itemSize>4?a=o.array[s*o.itemSize+n]:(n===0?a=o.getX(s):n===1?a=o.getY(s):n===2?a=o.getZ(s):n===3&&(a=o.getW(s)),o.normalized===!0&&(a=Ee.normalize(a,o.array))),i.min[n]=Math.min(i.min[n],a),i.max[n]=Math.max(i.max[n],a)}return i}function $a(o){return Math.ceil(o/4)*4}function cn(o,e=0){const t=$a(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let s=o.byteLength;s<t;s++)i[s]=e;return i.buffer}return o}function eo(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function to(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class Uc{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+gr}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const s=this,n=s.buffers,a=s.json;i=s.options;const r=s.extensionsUsed,A=s.extensionsRequired,c=new Blob(n,{type:"application/octet-stream"}),l=Object.keys(r),h=Object.keys(A);if(l.length>0&&(a.extensionsUsed=l),h.length>0&&(a.extensionsRequired=h),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),i.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=cn(d.result),f=new DataView(new ArrayBuffer(Za));f.setUint32(0,p.byteLength,!0),f.setUint32(4,Fc,!0);const b=cn(_c(JSON.stringify(a)),32),m=new DataView(new ArrayBuffer(Za));m.setUint32(0,b.byteLength,!0),m.setUint32(4,Mc,!0);const I=new ArrayBuffer(Xa),E=new DataView(I);E.setUint32(0,Tc,!0),E.setUint32(4,kc,!0);const C=Xa+m.byteLength+b.byteLength+f.byteLength+p.byteLength;E.setUint32(8,C,!0);const Q=new Blob([I,m,b,f,p],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(Q),w.onloadend=function(){t(w.result)}}}else if(a.buffers&&a.buffers.length>0){const d=new FileReader;d.readAsDataURL(c),d.onloadend=function(){const p=d.result;a.buffers[0].uri=p,t(a)}}else t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const i=this.options,s=this.extensionsUsed;try{const n=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&n.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const a in n.gltfExtensions)t.extensions[a]=n.gltfExtensions[a],s[a]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(n){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+n.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const i=new Map;i.set(!0,this.uid++),i.set(!1,this.uid++),this.uids.set(e,i)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new N;for(let i=0,s=e.count;i<s;i++)if(Math.abs(t.fromBufferAttribute(e,i).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),s=new N;for(let n=0,a=i.count;n<a;n++)s.fromBufferAttribute(i,n),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),i.setXYZ(n,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(s.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function i(d){return d.colorSpace===ce?function(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}:function(p){return p}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof ps&&(e=on(e)),t instanceof ps&&(t=on(t));const s=e?e.image:null,n=t?t.image:null,a=Math.max(s?s.width:0,n?n.width:0),r=Math.max(s?s.height:0,n?n.height:0),A=eo();A.width=a,A.height=r;const c=A.getContext("2d",{willReadFrequently:!0});c.fillStyle="#00ffff",c.fillRect(0,0,a,r);const l=c.getImageData(0,0,a,r);if(s){c.drawImage(s,0,0,a,r);const d=i(e),p=c.getImageData(0,0,a,r).data;for(let f=2;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}if(n){c.drawImage(n,0,0,a,r);const d=i(t),p=c.getImageData(0,0,a,r).data;for(let f=1;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}c.putImageData(l,0,0);const h=(e||t).clone();return h.source=new dr(A),h.colorSpace=Hs,h.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),h}processBuffer(e){const t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,n){const a=this.json;a.bufferViews||(a.bufferViews=[]);let r;switch(t){case ae.BYTE:case ae.UNSIGNED_BYTE:r=1;break;case ae.SHORT:case ae.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;n===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=$a(s*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=i;p<i+s;p++){for(let f=0;f<e.itemSize;f++){let b;e.itemSize>4?b=e.array[p*e.itemSize+f]:(f===0?b=e.getX(p):f===1?b=e.getY(p):f===2?b=e.getZ(p):f===3&&(b=e.getW(p)),e.normalized===!0&&(b=Ee.normalize(b,e.array))),t===ae.FLOAT?l.setFloat32(h,b,!0):t===ae.INT?l.setInt32(h,b,!0):t===ae.UNSIGNED_INT?l.setUint32(h,b,!0):t===ae.SHORT?l.setInt16(h,b,!0):t===ae.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ae.BYTE?l.setInt8(h,b):t===ae.UNSIGNED_BYTE&&l.setUint8(h,b),h+=r}h%A!==0&&(h+=A-h%A)}const d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};return n!==void 0&&(d.target=n),n===ae.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){const n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){const a=cn(n.result),r={buffer:t.processBuffer(a),byteOffset:t.byteOffset,byteLength:a.byteLength};t.byteOffset+=a.byteLength,s(i.bufferViews.push(r)-1)}})}processAccessor(e,t,i,s){const n=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ae.FLOAT;else if(e.array.constructor===Int32Array)r=ae.INT;else if(e.array.constructor===Uint32Array)r=ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ae.SHORT;else if(e.array.constructor===Uint16Array)r=ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ae.BYTE;else if(e.array.constructor===Uint8Array)r=ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;const A=Nc(e,i,s);let c;t!==void 0&&(c=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const l=this.processBufferView(e,r,i,s,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:r,count:s,max:A.max,min:A.min,type:a[e.itemSize]};return e.normalized===!0&&(h.normalized=!0),n.accessors||(n.accessors=[]),n.accessors.push(h)-1}processImage(e,t,i,s="image/png"){if(e!==null){const n=this,a=n.cache,r=n.json,A=n.options,c=n.pending;a.images.has(e)||a.images.set(e,{});const l=a.images.get(e),h=s+":flipY/"+i.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:s},p=eo();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(i===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Nt&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const m=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<m.length;I+=4)m[I+0]=e.data[I+0],m[I+1]=e.data[I+1],m[I+2]=e.data[I+2],m[I+3]=e.data[I+3];f.putImageData(new ImageData(m,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)f.drawImage(e,0,0,p.width,p.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?c.push(to(p,s).then(m=>n.processBufferViewImage(m)).then(m=>{d.bufferView=m})):p.toDataURL!==void 0?d.uri=p.toDataURL(s):c.push(to(p,s).then(m=>new FileReader().readAsDataURL(m)).then(m=>{d.uri=m}));const b=r.images.push(d)-1;return l[h]=b,b}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const i={magFilter:at[e.magFilter],minFilter:at[e.minFilter],wrapS:at[e.wrapS],wrapT:at[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){const t=this.options,i=this.cache,s=this.json;if(i.textures.has(e))return i.textures.get(e);const n={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,n)}),n.keep===!1)return null;n.newTexture!=null&&(e=n.newTexture),s.textures||(s.textures=[]),e instanceof ps&&(e=on(e,t.maxTextureSize));let a=e.userData.mimeType;a==="image/webp"&&(a="image/png");const r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(r.name=e.name),this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,r)});const A=s.textures.push(r)-1;return i.textures.set(e,A),A}processMaterial(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const s={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const n=e.color.toArray().concat([e.opacity]);Ts(n,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=.5,s.pbrMetallicRoughness.roughnessFactor=.5);const a=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(a||r){const c=this.buildMetalRoughTexture(a,r),l={index:this.processTexture(c),channel:c.channel};this.applyTextureTransform(l,c),s.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const c={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(c,e.map),s.pbrMetallicRoughness.baseColorTexture=c}if(e.emissive){const c=e.emissive;if(Math.max(c.r,c.g,c.b)>0&&(s.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),s.emissiveTexture=l}}if(e.normalMap?.image){const c={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(c.scale=e.normalScale.x),this.applyTextureTransform(c,e.normalMap),s.normalTexture=c}if(e.aoMap?.image){const c={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(c.strength=e.aoMapIntensity),this.applyTextureTransform(c,e.aoMap),s.occlusionTexture=c}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===gi&&(s.doubleSided=!0),e.name!==""&&(s.name=e.name),this.serializeUserData(e,s),this._invokeAll(function(c){c.writeMaterial&&c.writeMaterial(e,s)});const A=i.materials.push(s)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(w){w.beforeWriteMesh&&w.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const i=this.cache,s=this.json,n=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)n.push(e.material[w].uuid);else n.push(e.material.uuid);const a=n.join(":");if(i.meshes.has(a))return i.meshes.get(a);const r=e.geometry;let A;e.isLineSegments?A=ae.LINES:e.isLineLoop?A=ae.LINE_LOOP:e.isLine?A=ae.LINE_STRIP:e.isPoints?A=ae.POINTS:A=e.material.wireframe?ae.LINES:ae.TRIANGLES;const c={},l={},h=[],d=[],p={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let b=null;for(let w in r.attributes){if(w.slice(0,5)==="morph")continue;const x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),i.attributes.has(this.getUID(x))){l[w]=i.attributes.get(this.getUID(x));continue}b=null;const D=x.array;w==="JOINTS_0"&&!(D instanceof Uint16Array)&&!(D instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new st(new Uint16Array(D),x.itemSize,x.normalized));const S=this.processAccessor(b||x,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),l[w]=S,i.attributes.set(this.getUID(x),S))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const w=[],x=[],D={};if(e.morphTargetDictionary!==void 0)for(const S in e.morphTargetDictionary)D[e.morphTargetDictionary[S]]=S;for(let S=0;S<e.morphTargetInfluences.length;++S){const F={};let Y=!1;for(const V in r.morphAttributes){if(V!=="position"&&V!=="normal"&&V!=="color"){Y||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),Y=!0);continue}const K=r.morphAttributes[V][S],W=V.toUpperCase()+(V==="color"?"_0":""),j=r.attributes[V];if(i.attributes.has(this.getUID(K,!0))){F[W]=i.attributes.get(this.getUID(K,!0));continue}const X=K.clone();if(!r.morphTargetsRelative)for(let J=0,ee=K.count;J<ee;J++)for(let $=0;$<K.itemSize;$++)$===0&&X.setX(J,K.getX(J)-j.getX(J)),$===1&&X.setY(J,K.getY(J)-j.getY(J)),$===2&&X.setZ(J,K.getZ(J)-j.getZ(J)),$===3&&X.setW(J,K.getW(J)-j.getW(J));F[W]=this.processAccessor(X,r),i.attributes.set(this.getUID(j,!0),F[W])}d.push(F),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&x.push(D[S])}c.weights=w,x.length>0&&(c.extras={},c.extras.targetNames=x)}const m=Array.isArray(e.material);if(m&&r.groups.length===0)return null;let I=!1;if(m&&r.index===null){const w=[];for(let x=0,D=r.attributes.position.count;x<D;x++)w[x]=x;r.setIndex(w),I=!0}const E=m?e.material:[e.material],C=m?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=C.length;w<x;w++){const D={mode:A,attributes:l};if(this.serializeUserData(r,D),d.length>0&&(D.targets=d),r.index!==null){let F=this.getUID(r.index);(C[w].start!==void 0||C[w].count!==void 0)&&(F+=":"+C[w].start+":"+C[w].count),i.attributes.has(F)?D.indices=i.attributes.get(F):(D.indices=this.processAccessor(r.index,r,C[w].start,C[w].count),i.attributes.set(F,D.indices)),D.indices===null&&delete D.indices}const S=this.processMaterial(E[C[w].materialIndex]);S!==null&&(D.material=S),h.push(D)}I===!0&&r.setIndex(null),c.primitives=h,s.meshes||(s.meshes=[]),this._invokeAll(function(w){w.writeMesh&&w.writeMesh(e,c)});const Q=s.meshes.push(c)-1;return i.meshes.set(a,Q),Q}detectMeshQuantization(e,t){if(this.extensionsUsed[An])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const s=e.split("_",1)[0];Va[s]&&Va[s].includes(i)&&(this.extensionsUsed[An]=!0,this.extensionsRequired[An]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?s.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){const i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=rn.Utils.mergeMorphTargetTracks(e.clone(),t);const n=e.tracks,a=[],r=[];for(let A=0;A<n.length;++A){const c=n[A],l=Dt.parseTrackName(c.name);let h=Dt.findNode(t,l.nodeName);const d=Wa[l.propertyName];if(l.objectName==="bones"&&(h.isSkinnedMesh===!0?h=h.skeleton.getBoneByName(l.objectIndex):h=void 0),!h||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name);continue}const p=1;let f=c.values.length/c.times.length;d===Wa.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Tn?b="STEP":b="LINEAR",r.push({input:this.processAccessor(new st(c.times,p)),output:this.processAccessor(new st(c.values,f)),interpolation:b}),a.push({sampler:r.length-1,target:{node:s.get(h),path:d}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:r,channels:a}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],n=e.skeleton;if(n===void 0)return null;const a=e.skeleton.bones[0];if(a===void 0)return null;const r=[],A=new Float32Array(n.bones.length*16),c=new le;for(let l=0;l<n.bones.length;++l)r.push(i.get(n.bones[l])),c.copy(n.boneInverses[l]),c.multiply(e.bindMatrix).toArray(A,l*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new st(A,16)),joints:r,skeleton:i.get(a)}),s.skin=t.skins.length-1}processNode(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const i=this.json,s=this.options,n=this.nodeMap;i.nodes||(i.nodes=[]);const a={};if(s.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Ts(A,[0,0,0,1])||(a.rotation=A),Ts(c,[0,0,0])||(a.translation=c),Ts(l,[1,1,1])||(a.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),Lc(e.matrix)===!1&&(a.matrix=e.matrix.elements);if(e.name!==""&&(a.name=String(e.name)),this.serializeUserData(e,a),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(a.mesh=A)}else e.isCamera&&(a.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let c=0,l=e.children.length;c<l;c++){const h=e.children[c];if(h.visible||s.onlyVisible===!1){const d=this.processNode(h);d!==null&&A.push(d)}}A.length>0&&(a.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,a)});const r=i.nodes.push(a)-1;return n.set(e,r),r}processScene(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);const n=[];for(let a=0,r=e.children.length;a<r;a++){const A=e.children[a];if(A.visible||i.onlyVisible===!1){const c=this.processNode(A);c!==null&&n.push(c)}}n.length>0&&(s.nodes=n),this.serializeUserData(e,s)}processObjects(e){const t=new vi;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(s){s.beforeParse&&s.beforeParse(e)});const i=[];for(let s=0;s<e.length;s++)e[s]instanceof vi?this.processScene(e[s]):i.push(e[s]);i.length>0&&this.processObjects(i);for(let s=0;s<this.skins.length;++s)this.processSkin(this.skins[s]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll(function(s){s.afterParse&&s.afterParse(e)})}_invokeAll(e){for(let t=0,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class Gc{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,s=i.json,n=i.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(1-e.penumbra)*e.angle,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),n[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},n[this.name]=!0);const r=s.extensions[this.name].lights;r.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class Pc{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Oc{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){const a={index:i.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(a,e.clearcoatMap),n.clearcoatTexture=a}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const a={index:i.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(a,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){const a={index:i.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(a.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(a,e.clearcoatNormalMap),n.clearcoatNormalTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Hc{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const i=this.writer.extensionsUsed,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class jc{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){const a={index:i.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(a,e.iridescenceMap),n.iridescenceTexture=a}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const a={index:i.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(a,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class qc{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){const a={index:i.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(a,e.transmissionMap),n.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class zc{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){const a={index:i.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(a,e.thicknessMap),n.thicknessTexture=a}e.attenuationDistance!==1/0&&(n.attenuationDistance=e.attenuationDistance),n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Yc{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const i=this.writer.extensionsUsed,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Kc{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Rc)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.specularIntensityMap){const a={index:i.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(a,e.specularIntensityMap),n.specularTexture=a}if(e.specularColorMap){const a={index:i.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(a,e.specularColorMap),n.specularColorTexture=a}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Jc{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.sheenRoughnessMap){const a={index:i.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(a,e.sheenRoughnessMap),n.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:i.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(a,e.sheenColorMap),n.sheenColorTexture=a}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Vc{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.anisotropyMap){const a={index:i.processTexture(e.anisotropyMap)};i.applyTextureTransform(a,e.anisotropyMap),n.anisotropyTexture=a}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Wc{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const i=this.writer.extensionsUsed,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Xc{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.bumpMap){const a={index:i.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(a,e.bumpMap),n.bumpTexture=a}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Zc{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,s=e,n=new Float32Array(s.count*3),a=new Float32Array(s.count*4),r=new Float32Array(s.count*3),A=new le,c=new N,l=new we,h=new N;for(let p=0;p<s.count;p++)s.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(n,p*3),l.toArray(a,p*4),h.toArray(r,p*3);const d={TRANSLATION:i.processAccessor(new st(n,3)),ROTATION:i.processAccessor(new st(a,4)),SCALE:i.processAccessor(new st(r,3))};s.instanceColor&&(d._COLOR_0=i.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}}rn.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),i=new o.TimeBufferType(o.times.length+1),s=new o.ValueBufferType(o.values.length+t),n=o.createInterpolant(new o.ValueBufferType(t));let a;if(o.times.length===0){i[0]=e;for(let r=0;r<t;r++)s[r]=0;a=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;i[0]=e,i.set(o.times,1),s.set(n.evaluate(e),0),s.set(o.values,t),a=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;i[i.length-1]=e,i.set(o.times,0),s.set(o.values,0),s.set(n.evaluate(e),o.values.length),a=i.length-1}else for(let r=0;r<o.times.length;r++){if(Math.abs(o.times[r]-e)<.001)return r;if(o.times[r]<e&&o.times[r+1]>e){i.set(o.times.slice(0,r+1),0),i[r+1]=e,i.set(o.times.slice(r+1),r+2),s.set(o.values.slice(0,(r+1)*t),0),s.set(n.evaluate(e),(r+1)*t),s.set(o.values.slice((r+1)*t),(r+2)*t),a=r+1;break}}return o.times=i,o.values=s,a},mergeMorphTargetTracks:function(o,e){const t=[],i={},s=o.tracks;for(let n=0;n<s.length;++n){let a=s[n];const r=Dt.parseTrackName(a.name),A=Dt.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),a=a.clone(),a.setInterpolation(pi)}const c=A.morphTargetInfluences.length,l=A.morphTargetDictionary[r.propertyIndex];if(l===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let h;if(i[A.uuid]===void 0){h=a.clone();const p=new h.ValueBufferType(c*h.times.length);for(let f=0;f<h.times.length;f++)p[f*c+l]=h.values[f];h.name=(r.nodeName||"")+".morphTargetInfluences",h.values=p,i[A.uuid]=h,t.push(h);continue}const d=a.createInterpolant(new a.ValueBufferType(1));h=i[A.uuid];for(let p=0;p<h.times.length;p++)h.values[p*c+l]=d.evaluate(h.times[p]);for(let p=0;p<a.times.length;p++){const f=this.insertKeyframe(h,a.times[p]);h.values[f*c+l]=a.values[p]}}return o.tracks=t,o}};const Qe={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function so(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function $c(o){if(!o)throw new Error("No basePath supplied");return await so(`${o}/profilesList.json`)}async function el(o,e,t=null,i=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const s=await $c(e);let n;if(o.profiles.some(A=>{const c=s[A];return c&&(n={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!n}),!n){if(!t)throw new Error("No matching profile name found");const A=s[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);n={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const a=await so(n.profilePath);let r;if(i){let A;if(o.handedness==="any"?A=a.layouts[Object.keys(a.layouts)[0]]:A=a.layouts[o.handedness],!A)throw new Error(`No matching handedness, ${o.handedness}, in profile ${n.profileId}`);A.assetPath&&(r=n.profilePath.replace("profile.json",A.assetPath))}return{profile:a,assetPath:r}}const tl={xAxis:0,yAxis:0,button:0,state:Qe.ComponentState.DEFAULT};function sl(o=0,e=0){let t=o,i=e;if(Math.sqrt(o*o+e*e)>1){const s=Math.atan2(e,o);t=Math.cos(s),i=Math.sin(s)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:i*.5+.5}}class il{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Qe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(tl)}updateFromComponent({xAxis:e,yAxis:t,button:i,state:s}){const{normalizedXAxis:n,normalizedYAxis:a}=sl(e,t);switch(this.componentProperty){case Qe.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?n:.5;break;case Qe.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?a:.5;break;case Qe.ComponentProperty.BUTTON:this.value=this.states.includes(s)?i:0;break;case Qe.ComponentProperty.STATE:this.valueNodeProperty===Qe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class nl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(i=>{const s=new il(t.visualResponses[i]);this.visualResponses[i]=s}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Qe.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=Qe.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=Qe.ComponentState.PRESSED:(t.touched||this.values.button>Qe.ButtonTouchThreshold)&&(this.values.state=Qe.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Qe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Qe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class al{constructor(e,t,i){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=i,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(s=>{const n=this.layoutDescription.components[s];this.components[s]=new nl(s,n)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const ol="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",rl="generic-trigger";class Al extends It{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(i=>{const{valueNode:s,minNode:n,maxNode:a,value:r,valueNodeProperty:A}=i;s&&(A===Qe.VisualResponseProperty.VISIBILITY?s.visible=r:A===Qe.VisualResponseProperty.TRANSFORM&&(s.quaternion.slerpQuaternions(n.quaternion,a.quaternion,r),s.position.lerpVectors(n.position,a.position,r)))})}))}}function cl(o,e){Object.values(o.components).forEach(t=>{const{type:i,touchPointNodeName:s,visualResponses:n}=t;if(i===Qe.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(s),t.touchPointNode){const a=new oi(.001),r=new mt({color:255}),A=new O(a,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(n).forEach(a=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=a;if(l===Qe.VisualResponseProperty.TRANSFORM){if(a.minNode=e.getObjectByName(A),a.maxNode=e.getObjectByName(c),!a.minNode){console.warn(`Could not find ${A} in the model`);return}if(!a.maxNode){console.warn(`Could not find ${c} in the model`);return}}a.valueNode=e.getObjectByName(r),a.valueNode||console.warn(`Could not find ${r} in the model`)})})}function io(o,e){cl(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.layers.mask!=0&&e.traverse(t=>{t.layers.mask=o.layers.mask}),o.add(e)}class ll{constructor(e=null,t=null){this.gltfLoader=e,this.path=ol,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new Si)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Al;let i=null;return e.addEventListener("connected",s=>{const n=s.data;n.targetRayMode!=="tracked-pointer"||!n.gamepad||n.hand||el(n,this.path,rl).then(({profile:a,assetPath:r})=>{t.motionController=new al(n,a,r);const A=this._assetCache[t.motionController.assetUrl];if(A)i=A.scene.clone(),io(t,i),this.onLoad&&this.onLoad(i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,c=>{this._assetCache[t.motionController.assetUrl]=c,i=c.scene.clone(),io(t,i),this.onLoad&&this.onLoad(i)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(a=>{console.warn(a)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(i),i=null}),t}}const hl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class gl{constructor(e,t,i,s,n=null,a=null){this.controller=t,this.handModel=e,this.bones=[],n===null&&(n=new Si,n.setPath(i||hl)),n.load(`${s}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const c=A.getObjectByProperty("type","SkinnedMesh");c.frustumCulled=!1,c.castShadow=!0,c.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(l=>{const h=A.getObjectByName(l);h!==void 0?h.jointName=l:console.warn(`Couldn't find ${l} in ${s} hand mesh`),this.bones.push(h)}),a&&a(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const i=this.bones[t];if(i){const s=e[i.jointName];if(s.visible){const n=s.position;i.position.copy(n),i.quaternion.copy(s.quaternion)}}}}}const no=new Os,ei=new N;class ao extends pr{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Te(e,3)),this.setAttribute("uv",new Te(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new xi(t,6,1);return this.setAttribute("instanceStart",new Kt(i,3,0)),this.setAttribute("instanceEnd",new Kt(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new xi(t,6,1);return this.setAttribute("instanceColorStart",new Kt(i,3,0)),this.setAttribute("instanceColorEnd",new Kt(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new ur(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Os);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),no.setFromBufferAttribute(t),this.boundingBox.union(no))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ii),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let n=0,a=e.count;n<a;n++)ei.fromBufferAttribute(e,n),s=Math.max(s,i.distanceToSquared(ei)),ei.fromBufferAttribute(t,n),s=Math.max(s,i.distanceToSquared(ei));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}zs.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new _e(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Et.line={uniforms:zn.merge([zs.common,zs.fog,zs.line]),vertexShader:`
72
+ }`},mo={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Fa{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new al(e)}),this.register(function(e){return new sl(e)}),this.register(function(e){return new rl(e)}),this.register(function(e){return new Al(e)}),this.register(function(e){return new cl(e)}),this.register(function(e){return new ll(e)}),this.register(function(e){return new il(e)}),this.register(function(e){return new nl(e)}),this.register(function(e){return new ol(e)}),this.register(function(e){return new hl(e)}),this.register(function(e){return new gl(e)}),this.register(function(e){return new dl(e)}),this.register(function(e){return new pl(e)}),this.register(function(e){return new ul(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,s,a){const i=new tl,n=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)n.push(this.pluginCallbacks[r](i));i.setPlugins(n),i.setTextureUtils(this.textureUtils),i.writeAsync(e,t,a).catch(s)}parseAsync(e,t){const s=this;return new Promise(function(a,i){s.parse(e,a,i,t)})}}const re={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},ii="KHR_mesh_quantization",At={};At[ba]=re.NEAREST,At[As]=re.NEAREST_MIPMAP_NEAREST,At[Ci]=re.NEAREST_MIPMAP_LINEAR,At[$e]=re.LINEAR,At[Bi]=re.LINEAR_MIPMAP_NEAREST,At[ua]=re.LINEAR_MIPMAP_LINEAR,At[Ua]=re.CLAMP_TO_EDGE,At[Wt]=re.REPEAT,At[wi]=re.MIRRORED_REPEAT;const Eo={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},zc=new xe,Io=12,Jc=1179937895,Yc=2,Co=8,Xc=1313821514,Vc=5130562;function Gt(o,e){return o.length===e.length&&o.every(function(t,s){return t===e[s]})}function Wc(o){return new TextEncoder().encode(o).buffer}function Zc(o){return Gt(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function $c(o,e,t){const s={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let a=e;a<e+t;a++)for(let i=0;i<o.itemSize;i++){let n;o.itemSize>4?n=o.array[a*o.itemSize+i]:(i===0?n=o.getX(a):i===1?n=o.getY(a):i===2?n=o.getZ(a):i===3&&(n=o.getW(a)),o.normalized===!0&&(n=we.normalize(n,o.array))),s.min[i]=Math.min(s.min[i],n),s.max[i]=Math.max(s.max[i],n)}return s}function Bo(o){return Math.ceil(o/4)*4}function ni(o,e=0){const t=Bo(o.byteLength);if(t!==o.byteLength){const s=new Uint8Array(t);if(s.set(new Uint8Array(o)),e!==0)for(let a=o.byteLength;a<t;a++)s[a]=e;return s.buffer}return o}function wo(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function el(o,e){if(typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas){let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}else return new Promise(t=>o.toBlob(t,e))}class tl{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+Nr}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);const a=this,i=a.buffers,n=a.json;s=a.options;const r=a.extensionsUsed,A=a.extensionsRequired,h=new Blob(i,{type:"application/octet-stream"}),c=Object.keys(r),l=Object.keys(A);if(c.length>0&&(n.extensionsUsed=c),l.length>0&&(n.extensionsRequired=l),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=h.size),s.binary===!0){const d=new FileReader;d.readAsArrayBuffer(h),d.onloadend=function(){const p=ni(d.result),b=new DataView(new ArrayBuffer(Co));b.setUint32(0,p.byteLength,!0),b.setUint32(4,Vc,!0);const m=ni(Wc(JSON.stringify(n)),32),f=new DataView(new ArrayBuffer(Co));f.setUint32(0,m.byteLength,!0),f.setUint32(4,Xc,!0);const E=new ArrayBuffer(Io),I=new DataView(E);I.setUint32(0,Jc,!0),I.setUint32(4,Yc,!0);const C=Io+f.byteLength+m.byteLength+b.byteLength+p.byteLength;I.setUint32(8,C,!0);const Q=new Blob([E,f,m,b,p],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(Q),w.onloadend=function(){t(w.result)}}}else if(n.buffers&&n.buffers.length>0){const d=new FileReader;d.readAsDataURL(h),d.onloadend=function(){const p=d.result;n.buffers[0].uri=p,t(n)}}else t(n)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const s=this.options,a=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&i.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const n in i.gltfExtensions)t.extensions[n]=i.gltfExtensions[n],a[n]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const s=new Map;s.set(!0,this.uid++),s.set(!1,this.uid++),this.uids.set(e,s)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new U;for(let s=0,a=e.count;s<a;s++)if(Math.abs(t.fromBufferAttribute(e,s).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const s=e.clone(),a=new U;for(let i=0,n=s.count;i<n;i++)a.fromBufferAttribute(s,i),a.x===0&&a.y===0&&a.z===0?a.setX(1):a.normalize(),s.setXYZ(i,a.x,a.y,a.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1;const a={};(t.offset.x!==0||t.offset.y!==0)&&(a.offset=t.offset.toArray(),s=!0),t.rotation!==0&&(a.rotation=t.rotation,s=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(a.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=a,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function s(d){return d.colorSpace===ge?function(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}:function(p){return p}}e instanceof Ea&&(e=await this.decompressTextureAsync(e)),t instanceof Ea&&(t=await this.decompressTextureAsync(t));const a=e?e.image:null,i=t?t.image:null,n=Math.max(a?a.width:0,i?i.width:0),r=Math.max(a?a.height:0,i?i.height:0),A=wo();A.width=n,A.height=r;const h=A.getContext("2d",{willReadFrequently:!0});h.fillStyle="#00ffff",h.fillRect(0,0,n,r);const c=h.getImageData(0,0,n,r);if(a){h.drawImage(a,0,0,n,r);const d=s(e),p=h.getImageData(0,0,n,r).data;for(let b=2;b<p.length;b+=4)c.data[b]=d(p[b]/256)*256}if(i){h.drawImage(i,0,0,n,r);const d=s(t),p=h.getImageData(0,0,n,r).data;for(let b=1;b<p.length;b+=4)c.data[b]=d(p[b]/256)*256}h.putImageData(c,0,0);const l=(e||t).clone();return l.source=new Ur(A),l.colorSpace=Es,l.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),l}async decompressTextureAsync(e,t=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,a,i){const n=this.json;n.bufferViews||(n.bufferViews=[]);let r;switch(t){case re.BYTE:case re.UNSIGNED_BYTE:r=1;break;case re.SHORT:case re.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;i===re.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const h=Bo(a*A),c=new DataView(new ArrayBuffer(h));let l=0;for(let p=s;p<s+a;p++){for(let b=0;b<e.itemSize;b++){let m;e.itemSize>4?m=e.array[p*e.itemSize+b]:(b===0?m=e.getX(p):b===1?m=e.getY(p):b===2?m=e.getZ(p):b===3&&(m=e.getW(p)),e.normalized===!0&&(m=we.normalize(m,e.array))),t===re.FLOAT?c.setFloat32(l,m,!0):t===re.INT?c.setInt32(l,m,!0):t===re.UNSIGNED_INT?c.setUint32(l,m,!0):t===re.SHORT?c.setInt16(l,m,!0):t===re.UNSIGNED_SHORT?c.setUint16(l,m,!0):t===re.BYTE?c.setInt8(l,m):t===re.UNSIGNED_BYTE&&c.setUint8(l,m),l+=r}l%A!==0&&(l+=A-l%A)}const d={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:h};return i!==void 0&&(d.target=i),i===re.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=h,n.bufferViews.push(d),{id:n.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(a){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const n=ni(i.result),r={buffer:t.processBuffer(n),byteOffset:t.byteOffset,byteLength:n.byteLength};t.byteOffset+=n.byteLength,a(s.bufferViews.push(r)-1)}})}processAccessor(e,t,s,a){const i=this.json,n={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=re.FLOAT;else if(e.array.constructor===Int32Array)r=re.INT;else if(e.array.constructor===Uint32Array)r=re.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=re.SHORT;else if(e.array.constructor===Uint16Array)r=re.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=re.BYTE;else if(e.array.constructor===Uint8Array)r=re.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(s===void 0&&(s=0),(a===void 0||a===1/0)&&(a=e.count),a===0)return null;const A=$c(e,s,a);let h;t!==void 0&&(h=e===t.index?re.ELEMENT_ARRAY_BUFFER:re.ARRAY_BUFFER);const c=this.processBufferView(e,r,s,a,h),l={bufferView:c.id,byteOffset:c.byteOffset,componentType:r,count:a,max:A.max,min:A.min,type:n[e.itemSize]};return e.normalized===!0&&(l.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(l)-1}processImage(e,t,s,a="image/png"){if(e!==null){const i=this,n=i.cache,r=i.json,A=i.options,h=i.pending;n.images.has(e)||n.images.set(e,{});const c=n.images.get(e),l=a+":flipY/"+s.toString();if(c[l]!==void 0)return c[l];r.images||(r.images=[]);const d={mimeType:a},p=wo();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const b=p.getContext("2d",{willReadFrequently:!0});if(s===!0&&(b.translate(0,p.height),b.scale(1,-1)),e.data!==void 0){t!==ot&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const f=new Uint8ClampedArray(e.height*e.width*4);for(let E=0;E<f.length;E+=4)f[E+0]=e.data[E+0],f[E+1]=e.data[E+1],f[E+2]=e.data[E+2],f[E+3]=e.data[E+3];b.putImageData(new ImageData(f,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)b.drawImage(e,0,0,p.width,p.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?h.push(el(p,a).then(f=>i.processBufferViewImage(f)).then(f=>{d.bufferView=f})):d.uri=Pr.getDataURL(p,a);const m=r.images.push(d)-1;return c[l]=m,m}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const s={magFilter:At[e.magFilter],minFilter:At[e.minFilter],wrapS:At[e.wrapS],wrapT:At[e.wrapT]};return t.samplers.push(s)-1}async processTextureAsync(e){const t=this.options,s=this.cache,a=this.json;if(s.textures.has(e))return s.textures.get(e);const i={keep:!0,newTexture:null};if(this._invokeAll(function(h){h.beforeWriteTexture&&h.beforeWriteTexture(e,i)}),i.keep===!1)return null;i.newTexture!=null&&(e=i.newTexture),a.textures||(a.textures=[]),e instanceof Ea&&(e=await this.decompressTextureAsync(e,t.maxTextureSize));let n=e.userData.mimeType;n==="image/webp"&&(n="image/png");const r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(r.name=e.name),await this._invokeAllAsync(async function(h){h.writeTexture&&await h.writeTexture(e,r)});const A=a.textures.push(r)-1;return s.textures.set(e,A),A}async processMaterialAsync(e){const t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);const a={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const i=e.color.toArray().concat([e.opacity]);Gt(i,[1,1,1,1])||(a.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(a.pbrMetallicRoughness.metallicFactor=e.metalness,a.pbrMetallicRoughness.roughnessFactor=e.roughness):(a.pbrMetallicRoughness.metallicFactor=0,a.pbrMetallicRoughness.roughnessFactor=1);const n=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(n||r){const h=await this.buildMetalRoughTextureAsync(n,r),c={index:await this.processTextureAsync(h),texCoord:h.channel};this.applyTextureTransform(c,h),a.pbrMetallicRoughness.metallicRoughnessTexture=c}if(e.map){const h={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(h,e.map),a.pbrMetallicRoughness.baseColorTexture=h}if(e.emissive){const h=e.emissive;if(Math.max(h.r,h.g,h.b)>0&&(a.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const c={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(c,e.emissiveMap),a.emissiveTexture=c}}if(e.normalMap?.image){const h={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(h.scale=e.normalScale.x),this.applyTextureTransform(h,e.normalMap),a.normalTexture=h}if(e.aoMap?.image){const h={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(h.strength=e.aoMapIntensity),this.applyTextureTransform(h,e.aoMap),a.occlusionTexture=h}e.transparent?a.alphaMode="BLEND":e.alphaTest>0&&(a.alphaMode="MASK",a.alphaCutoff=e.alphaTest),e.side===ls&&(a.doubleSided=!0),e.name!==""&&(a.name=e.name),this.serializeUserData(e,a),await this._invokeAllAsync(async function(h){h.writeMaterialAsync&&await h.writeMaterialAsync(e,a)});const A=s.materials.push(a)-1;return t.materials.set(e,A),A}async processMeshAsync(e){const t={keep:!0};if(this._invokeAll(function(w){w.beforeWriteMesh&&w.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const s=this.cache,a=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)i.push(e.material[w].uuid);else i.push(e.material.uuid);const n=i.join(":");if(s.meshes.has(n))return s.meshes.get(n);const r=e.geometry;let A;e.isLineSegments?A=re.LINES:e.isLineLoop?A=re.LINE_LOOP:e.isLine?A=re.LINE_STRIP:e.isPoints?A=re.POINTS:A=e.material.wireframe?re.LINES:re.TRIANGLES;const h={},c={},l=[],d=[],p={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},b=r.getAttribute("normal");b!==void 0&&!this.isNormalizedNormalAttribute(b)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(b)));let m=null;for(let w in r.attributes){if(w.slice(0,5)==="morph")continue;const x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),s.attributes.has(this.getUID(x))){c[w]=s.attributes.get(this.getUID(x));continue}m=null;const S=x.array;w==="JOINTS_0"&&!(S instanceof Uint16Array)&&!(S instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),m=Fa.Utils.toTypedBufferAttribute(x,Uint16Array)):(S instanceof Uint32Array||S instanceof Int32Array)&&!w.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${w}" converted to type FLOAT.`),m=Fa.Utils.toTypedBufferAttribute(x,Float32Array));const D=this.processAccessor(m||x,r);D!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),c[w]=D,s.attributes.set(this.getUID(x),D))}if(b!==void 0&&r.setAttribute("normal",b),Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const w=[],x=[],S={};if(e.morphTargetDictionary!==void 0)for(const D in e.morphTargetDictionary)S[e.morphTargetDictionary[D]]=D;for(let D=0;D<e.morphTargetInfluences.length;++D){const M={};let O=!1;for(const z in r.morphAttributes){if(z!=="position"&&z!=="normal"&&z!=="color"){O||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),O=!0);continue}const Y=r.morphAttributes[z][D],ee=z.toUpperCase()+(z==="color"?"_0":""),J=r.attributes[z];if(s.attributes.has(this.getUID(Y,!0))){M[ee]=s.attributes.get(this.getUID(Y,!0));continue}const X=Y.clone();if(!r.morphTargetsRelative)for(let V=0,W=Y.count;V<W;V++)for(let ne=0;ne<Y.itemSize;ne++)ne===0&&X.setX(V,Y.getX(V)-J.getX(V)),ne===1&&X.setY(V,Y.getY(V)-J.getY(V)),ne===2&&X.setZ(V,Y.getZ(V)-J.getZ(V)),ne===3&&X.setW(V,Y.getW(V)-J.getW(V));M[ee]=this.processAccessor(X,r),s.attributes.set(this.getUID(J,!0),M[ee])}d.push(M),w.push(e.morphTargetInfluences[D]),e.morphTargetDictionary!==void 0&&x.push(S[D])}h.weights=w,x.length>0&&(h.extras={},h.extras.targetNames=x)}const f=Array.isArray(e.material);if(f&&r.groups.length===0)return null;let E=!1;if(f&&r.index===null){const w=[];for(let x=0,S=r.attributes.position.count;x<S;x++)w[x]=x;r.setIndex(w),E=!0}const I=f?e.material:[e.material],C=f?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=C.length;w<x;w++){const S={mode:A,attributes:c};if(this.serializeUserData(r,S),d.length>0&&(S.targets=d),r.index!==null){let M=this.getUID(r.index);(C[w].start!==void 0||C[w].count!==void 0)&&(M+=":"+C[w].start+":"+C[w].count),s.attributes.has(M)?S.indices=s.attributes.get(M):(S.indices=this.processAccessor(r.index,r,C[w].start,C[w].count),s.attributes.set(M,S.indices)),S.indices===null&&delete S.indices}const D=await this.processMaterialAsync(I[C[w].materialIndex]);D!==null&&(S.material=D),l.push(S)}E===!0&&r.setIndex(null),h.primitives=l,a.meshes||(a.meshes=[]),await this._invokeAllAsync(function(w){w.writeMesh&&w.writeMesh(e,h)});const Q=a.meshes.push(h)-1;return s.meshes.set(n,Q),Q}detectMeshQuantization(e,t){if(this.extensionsUsed[ii])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");const a=e.split("_",1)[0];mo[a]&&mo[a].includes(s)&&(this.extensionsUsed[ii]=!0,this.extensionsRequired[ii]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const s=e.isOrthographicCamera,a={type:s?"orthographic":"perspective"};return s?a.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:a.perspective={aspectRatio:e.aspect,yfov:we.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(a.name=e.type),t.cameras.push(a)-1}processAnimation(e,t){const s=this.json,a=this.nodeMap;s.animations||(s.animations=[]),e=Fa.Utils.mergeMorphTargetTracks(e.clone(),t);const i=e.tracks,n=[],r=[];for(let h=0;h<i.length;++h){const c=i[h],l=Lt.parseTrackName(c.name);let d=Lt.findNode(t,l.nodeName);const p=Eo[l.propertyName];if(l.objectName==="bones"&&(d.isSkinnedMesh===!0?d=d.skeleton.getBoneByName(l.objectIndex):d=void 0),!d||!p){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name);continue}const b=1;let m=c.values.length/c.times.length;p===Eo.morphTargetInfluences&&(m/=d.morphTargetInfluences.length);let f;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(f="CUBICSPLINE",m/=3):c.getInterpolation()===Di?f="STEP":f="LINEAR",r.push({input:this.processAccessor(new nt(c.times,b)),output:this.processAccessor(new nt(c.values,m)),interpolation:f}),n.push({sampler:r.length-1,target:{node:a.get(d),path:p}})}const A={name:e.name||"clip_"+s.animations.length,samplers:r,channels:n};return this.serializeUserData(e,A),s.animations.push(A),s.animations.length-1}processSkin(e){const t=this.json,s=this.nodeMap,a=t.nodes[s.get(e)],i=e.skeleton;if(i===void 0)return null;const n=e.skeleton.bones[0];if(n===void 0)return null;const r=[],A=new Float32Array(i.bones.length*16),h=new de;for(let c=0;c<i.bones.length;++c)r.push(s.get(i.bones[c])),h.copy(i.boneInverses[c]),h.multiply(e.bindMatrix).toArray(A,c*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new nt(A,16)),joints:r,skeleton:s.get(n)}),a.skin=t.skins.length-1}async processNodeAsync(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const s=this.json,a=this.options,i=this.nodeMap;if(s.nodes||(s.nodes=[]),e.pivot!==null)return await this._processNodeWithPivotAsync(e);const n={};if(a.trs){const A=e.quaternion.toArray(),h=e.position.toArray(),c=e.scale.toArray();Gt(A,[0,0,0,1])||(n.rotation=A),Gt(h,[0,0,0])||(n.translation=h),Gt(c,[1,1,1])||(n.scale=c)}else e.matrixAutoUpdate&&e.updateMatrix(),Zc(e.matrix)===!1&&(n.matrix=e.matrix.elements);if(e.name!==""&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){const A=await this.processMeshAsync(e);A!==null&&(n.mesh=A)}else e.isCamera&&(n.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);const r=s.nodes.push(n)-1;if(i.set(e,r),e.children.length>0){const A=[];for(let h=0,c=e.children.length;h<c;h++){const l=e.children[h];if(l.visible||a.onlyVisible===!1){const d=await this.processNodeAsync(l);d!==null&&A.push(d)}}A.length>0&&(n.children=A)}return await this._invokeAllAsync(function(A){A.writeNode&&A.writeNode(e,n)}),r}async _processNodeWithPivotAsync(e){const t=this.json,s=this.options,a=this.nodeMap,i=e.pivot,n={},r=e.quaternion.toArray(),A=[e.position.x+i.x,e.position.y+i.y,e.position.z+i.z],h=e.scale.toArray();Gt(r,[0,0,0,1])||(n.rotation=r),Gt(A,[0,0,0])||(n.translation=A),Gt(h,[1,1,1])||(n.scale=h),n.extras={pivot:i.toArray()},e.name!==""&&(n.name=String(e.name)),this.serializeUserData(e,n);const c=t.nodes.push(n)-1;a.set(e,c);const l={},d=[-i.x,-i.y,-i.z];if(Gt(d,[0,0,0])||(l.translation=d),e.isMesh||e.isLine||e.isPoints){const b=await this.processMeshAsync(e);b!==null&&(l.mesh=b)}else e.isCamera&&(l.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);const p=[t.nodes.push(l)-1];if(e.children.length>0){const b=[];for(let m=0,f=e.children.length;m<f;m++){const E=e.children[m];if(E.visible||s.onlyVisible===!1){const I=await this.processNodeAsync(E);I!==null&&b.push(I)}}b.length>0&&(l.children=b)}return n.children=p,await this._invokeAllAsync(function(b){b.writeNode&&b.writeNode(e,n)}),c}async processSceneAsync(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const a={};e.name!==""&&(a.name=e.name),t.scenes.push(a);const i=[];for(let n=0,r=e.children.length;n<r;n++){const A=e.children[n];if(A.visible||s.onlyVisible===!1){const h=await this.processNodeAsync(A);h!==null&&i.push(h)}}i.length>0&&(a.nodes=i),this.serializeUserData(e,a)}async processObjectsAsync(e){const t=new Gi;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);await this.processSceneAsync(t)}async processInputAsync(e){const t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(a){a.beforeParse&&a.beforeParse(e)});const s=[];for(let a=0;a<e.length;a++)e[a]instanceof Gi?await this.processSceneAsync(e[a]):s.push(e[a]);s.length>0&&await this.processObjectsAsync(s);for(let a=0;a<this.skins.length;++a)this.processSkin(this.skins[a]);for(let a=0;a<t.animations.length;++a)this.processAnimation(t.animations[a],e[0]);await this._invokeAllAsync(function(a){a.afterParse&&a.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,s=this.plugins.length;t<s;t++)await e(this.plugins[t])}}class al{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const s=this.writer,a=s.json,i=s.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=(1-e.penumbra)*e.angle,n.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(a.extensions=a.extensions||{},a.extensions[this.name]={lights:[]},i[this.name]=!0);const r=a.extensions[this.name].lights;r.push(n),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class sl{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;const s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class il{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const s=this.writer,a=s.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const n={index:await s.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(n,e.clearcoatMap),i.clearcoatTexture=n}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const n={index:await s.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(n,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=n}if(e.clearcoatNormalMap){const n={index:await s.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(n.scale=e.clearcoatNormalScale.x),s.applyTextureTransform(n,e.clearcoatNormalMap),i.clearcoatNormalTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class nl{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const s=this.writer.extensionsUsed,a={};a.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=a,s[this.name]=!0}}class ol{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const s=this.writer,a=s.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const n={index:await s.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(n,e.iridescenceMap),i.iridescenceTexture=n}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const n={index:await s.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(n,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class rl{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,a=s.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const n={index:await s.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(n,e.transmissionMap),i.transmissionTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class Al{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,a=s.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const n={index:await s.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(n,e.thicknessMap),i.thicknessTexture=n}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class cl{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const s=this.writer.extensionsUsed,a={};a.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=a,s[this.name]=!0}}class ll{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(zc)&&!e.specularIntensityMap&&!e.specularColorMap)return;const s=this.writer,a=s.extensionsUsed,i={};if(e.specularIntensityMap){const n={index:await s.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(n,e.specularIntensityMap),i.specularTexture=n}if(e.specularColorMap){const n={index:await s.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(n,e.specularColorMap),i.specularColorTexture=n}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class hl{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const s=this.writer,a=s.extensionsUsed,i={};if(e.sheenRoughnessMap){const n={index:await s.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(n,e.sheenRoughnessMap),i.sheenRoughnessTexture=n}if(e.sheenColorMap){const n={index:await s.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(n,e.sheenColorMap),i.sheenColorTexture=n}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class gl{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const s=this.writer,a=s.extensionsUsed,i={};if(e.anisotropyMap){const n={index:await s.processTextureAsync(e.anisotropyMap)};s.applyTextureTransform(n,e.anisotropyMap),i.anisotropyTexture=n}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class dl{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const s=this.writer.extensionsUsed,a={};a.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=a,s[this.name]=!0}}class pl{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const s=this.writer,a=s.extensionsUsed,i={};if(e.bumpMap){const n={index:await s.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(n,e.bumpMap),i.bumpTexture=n}i.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=i,a[this.name]=!0}}class ul{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const s=this.writer,a=e,i=new Float32Array(a.count*3),n=new Float32Array(a.count*4),r=new Float32Array(a.count*3),A=new de,h=new U,c=new De,l=new U;for(let p=0;p<a.count;p++)a.getMatrixAt(p,A),A.decompose(h,c,l),h.toArray(i,p*3),c.toArray(n,p*4),l.toArray(r,p*3);const d={TRANSLATION:s.processAccessor(new nt(i,3)),ROTATION:s.processAccessor(new nt(n,4)),SCALE:s.processAccessor(new nt(r,3))};a.instanceColor&&(d._COLOR_0=s.processAccessor(a.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}}Fa.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),s=new o.TimeBufferType(o.times.length+1),a=new o.ValueBufferType(o.values.length+t),i=o.createInterpolant(new o.ValueBufferType(t));let n;if(o.times.length===0){s[0]=e;for(let r=0;r<t;r++)a[r]=0;n=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;s[0]=e,s.set(o.times,1),a.set(i.evaluate(e),0),a.set(o.values,t),n=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;s[s.length-1]=e,s.set(o.times,0),a.set(o.values,0),a.set(i.evaluate(e),o.values.length),n=s.length-1}else for(let r=0;r<o.times.length;r++){if(Math.abs(o.times[r]-e)<.001)return r;if(o.times[r]<e&&o.times[r+1]>e){s.set(o.times.slice(0,r+1),0),s[r+1]=e,s.set(o.times.slice(r+1),r+2),a.set(o.values.slice(0,(r+1)*t),0),a.set(i.evaluate(e),(r+1)*t),a.set(o.values.slice((r+1)*t),(r+2)*t),n=r+1;break}}return o.times=s,o.values=a,n},mergeMorphTargetTracks:function(o,e){const t=[],s={},a=o.tracks;for(let i=0;i<a.length;++i){let n=a[i];const r=Lt.parseTrackName(n.name),A=Lt.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),n=n.clone(),n.setInterpolation(ds)}const h=A.morphTargetInfluences.length,c=A.morphTargetDictionary[r.propertyIndex];if(c===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let l;if(s[A.uuid]===void 0){l=n.clone();const p=new l.ValueBufferType(h*l.times.length);for(let b=0;b<l.times.length;b++)p[b*h+c]=l.values[b];l.name=(r.nodeName||"")+".morphTargetInfluences",l.values=p,s[A.uuid]=l,t.push(l);continue}const d=n.createInterpolant(new n.ValueBufferType(1));l=s[A.uuid];for(let p=0;p<l.times.length;p++)l.values[p*h+c]=d.evaluate(l.times[p]);for(let p=0;p<n.times.length;p++){const b=this.insertKeyframe(l,n.times[p]);l.values[b*h+c]=n.values[p]}}return o.tracks=t,o},toTypedBufferAttribute:function(o,e){const t=new nt(new e(o.count*o.itemSize),o.itemSize,!1);if(!o.normalized&&!o.isInterleavedBufferAttribute)return t.array.set(o.array),t;for(let s=0,a=o.count;s<a;s++)for(let i=0;i<o.itemSize;i++)t.setComponent(s,i,o.getComponent(s,i));return t}};const Se={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function yo(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function bl(o){if(!o)throw new Error("No basePath supplied");return await yo(`${o}/profilesList.json`)}async function fl(o,e,t=null,s=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const a=await bl(e);let i;if(o.profiles.some(A=>{const h=a[A];return h&&(i={profileId:A,profilePath:`${e}/${h.path}`,deprecated:!!h.deprecated}),!!i}),!i){if(!t)throw new Error("No matching profile name found");const A=a[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);i={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const n=await yo(i.profilePath);let r;if(s){let A;if(o.handedness==="any"?A=n.layouts[Object.keys(n.layouts)[0]]:A=n.layouts[o.handedness],!A)throw new Error(`No matching handedness, ${o.handedness}, in profile ${i.profileId}`);A.assetPath&&(r=i.profilePath.replace("profile.json",A.assetPath))}return{profile:n,assetPath:r}}const ml={xAxis:0,yAxis:0,button:0,state:Se.ComponentState.DEFAULT};function El(o=0,e=0){let t=o,s=e;if(Math.sqrt(o*o+e*e)>1){const a=Math.atan2(e,o);t=Math.cos(a),s=Math.sin(a)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class Il{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Se.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(ml)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:a}){const{normalizedXAxis:i,normalizedYAxis:n}=El(e,t);switch(this.componentProperty){case Se.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?i:.5;break;case Se.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?n:.5;break;case Se.ComponentProperty.BUTTON:this.value=this.states.includes(a)?s:0;break;case Se.ComponentProperty.STATE:this.valueNodeProperty===Se.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class Cl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(s=>{const a=new Il(t.visualResponses[s]);this.visualResponses[s]=a}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Se.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=Se.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=Se.ComponentState.PRESSED:(t.touched||this.values.button>Se.ButtonTouchThreshold)&&(this.values.state=Se.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Se.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Se.AxisTouchThreshold&&(this.values.state=Se.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Se.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Se.AxisTouchThreshold&&(this.values.state=Se.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Bl{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(a=>{const i=this.layoutDescription.components[a];this.components[a]=new Cl(a,i)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const wl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",yl="generic-trigger";class Ql extends Bt{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(s=>{const{valueNode:a,minNode:i,maxNode:n,value:r,valueNodeProperty:A}=s;a&&(A===Se.VisualResponseProperty.VISIBILITY?a.visible=r:A===Se.VisualResponseProperty.TRANSFORM&&(a.quaternion.slerpQuaternions(i.quaternion,n.quaternion,r),a.position.lerpVectors(i.position,n.position,r)))})}))}}function vl(o,e){Object.values(o.components).forEach(t=>{const{type:s,touchPointNodeName:a,visualResponses:i}=t;if(s===Se.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(a),t.touchPointNode){const n=new is(.001),r=new It({color:255}),A=new j(n,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(i).forEach(n=>{const{valueNodeName:r,minNodeName:A,maxNodeName:h,valueNodeProperty:c}=n;if(c===Se.VisualResponseProperty.TRANSFORM){if(n.minNode=e.getObjectByName(A),n.maxNode=e.getObjectByName(h),!n.minNode){console.warn(`Could not find ${A} in the model`);return}if(!n.maxNode){console.warn(`Could not find ${h} in the model`);return}}n.valueNode=e.getObjectByName(r),n.valueNode||console.warn(`Could not find ${r} in the model`)})})}function Qo(o,e){vl(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.layers.mask!=0&&e.traverse(t=>{t.layers.mask=o.layers.mask}),o.add(e)}class xl{constructor(e=null,t=null){this.gltfLoader=e,this.path=wl,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new Ds)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Ql;let s=null;return e.addEventListener("connected",a=>{const i=a.data;i.targetRayMode!=="tracked-pointer"||!i.gamepad||i.hand||fl(i,this.path,yl).then(({profile:n,assetPath:r})=>{t.motionController=new Bl(i,n,r);const A=this._assetCache[t.motionController.assetUrl];if(A)s=A.scene.clone(),Qo(t,s),this.onLoad&&this.onLoad(s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,h=>{this._assetCache[t.motionController.assetUrl]=h,s=h.scene.clone(),Qo(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(n=>{console.warn(n)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}const Dl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class Sl{constructor(e,t,s,a,i=null,n=null){this.controller=t,this.handModel=e,this.bones=[],i===null&&(i=new Ds,i.setPath(s||Dl)),i.load(`${a}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const h=A.getObjectByProperty("type","SkinnedMesh");h.frustumCulled=!1,h.castShadow=!0,h.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(c=>{const l=A.getObjectByName(c);l!==void 0?l.jointName=c:console.warn(`Couldn't find ${c} in ${a} hand mesh`),this.bones.push(l)}),n&&n(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const s=this.bones[t];if(s){const a=e[s.jointName];if(a.visible){const i=a.position;s.position.copy(i),s.quaternion.copy(a.quaternion)}}}}}const vo=new Oa,Za=new U;class xo extends Gr{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new _e(e,3)),this.setAttribute("uv",new _e(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,s=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),s.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new xs(t,6,1);return this.setAttribute("instanceStart",new qt(s,3,0)),this.setAttribute("instanceEnd",new qt(s,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new xs(t,6,1);return this.setAttribute("instanceColorStart",new qt(s,3,0)),this.setAttribute("instanceColorEnd",new qt(s,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Or(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Oa);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),vo.setFromBufferAttribute(t),this.boundingBox.union(vo))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ms),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let a=0;for(let i=0,n=e.count;i<n;i++)Za.fromBufferAttribute(e,i),a=Math.max(a,s.distanceToSquared(Za)),Za.fromBufferAttribute(t,i),a=Math.max(a,s.distanceToSquared(Za));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Ha.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ge(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},yt.line={uniforms:Oi.merge([Ha.common,Ha.fog,Ha.line]),vertexShader:`
90
73
  #include <common>
91
74
  #include <color_pars_vertex>
92
75
  #include <fog_pars_vertex>
@@ -367,6 +350,9 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
367
350
 
368
351
  void main() {
369
352
 
353
+ float alpha = opacity;
354
+ vec4 diffuseColor = vec4( diffuse, alpha );
355
+
370
356
  #include <clipping_planes_fragment>
371
357
 
372
358
  #ifdef USE_DASH
@@ -377,8 +363,6 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
377
363
 
378
364
  #endif
379
365
 
380
- float alpha = opacity;
381
-
382
366
  #ifdef WORLD_UNITS
383
367
 
384
368
  // Find the closest points on the view ray and the line segment
@@ -443,8 +427,6 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
443
427
 
444
428
  #endif
445
429
 
446
- vec4 diffuseColor = vec4( diffuse, alpha );
447
-
448
430
  #include <logdepthbuf_fragment>
449
431
  #include <color_fragment>
450
432
 
@@ -456,9 +438,9 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
456
438
  #include <premultiplied_alpha_fragment>
457
439
 
458
440
  }
459
- `};class ln extends jn{constructor(e){super({type:"LineMaterial",uniforms:zn.clone(Et.line.uniforms),vertexShader:Et.line.vertexShader,fragmentShader:Et.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const hn=new Rt,oo=new N,ro=new N,Ge=new Rt,Pe=new Rt,wt=new Rt,gn=new N,dn=new le,Oe=new fr,Ao=new N,ti=new Os,si=new Ii,Qt=new Rt;let yt,Zt;function co(o,e,t){return Qt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),Qt.multiplyScalar(1/Qt.w),Qt.x=Zt/t.width,Qt.y=Zt/t.height,Qt.applyMatrix4(o.projectionMatrixInverse),Qt.multiplyScalar(1/Qt.w),Math.abs(Math.max(Qt.x,Qt.y))}function dl(o,e){const t=o.matrixWorld,i=o.geometry,s=i.attributes.instanceStart,n=i.attributes.instanceEnd,a=Math.min(i.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Oe.start.fromBufferAttribute(s,r),Oe.end.fromBufferAttribute(n,r),Oe.applyMatrix4(t);const c=new N,l=new N;yt.distanceSqToSegment(Oe.start,Oe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:yt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function pl(o,e,t){const i=e.projectionMatrix,s=o.material.resolution,n=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;yt.at(1,wt),wt.w=1,wt.applyMatrix4(e.matrixWorldInverse),wt.applyMatrix4(i),wt.multiplyScalar(1/wt.w),wt.x*=s.x/2,wt.y*=s.y/2,wt.z=0,gn.copy(wt),dn.multiplyMatrices(e.matrixWorldInverse,n);for(let h=0,d=c;h<d;h++){if(Ge.fromBufferAttribute(r,h),Pe.fromBufferAttribute(A,h),Ge.w=1,Pe.w=1,Ge.applyMatrix4(dn),Pe.applyMatrix4(dn),Ge.z>l&&Pe.z>l)continue;if(Ge.z>l){const I=Ge.z-Pe.z,E=(Ge.z-l)/I;Ge.lerp(Pe,E)}else if(Pe.z>l){const I=Pe.z-Ge.z,E=(Pe.z-l)/I;Pe.lerp(Ge,E)}Ge.applyMatrix4(i),Pe.applyMatrix4(i),Ge.multiplyScalar(1/Ge.w),Pe.multiplyScalar(1/Pe.w),Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.x*=s.x/2,Pe.y*=s.y/2,Oe.start.copy(Ge),Oe.start.z=0,Oe.end.copy(Pe),Oe.end.z=0;const p=Oe.closestPointToPointParameter(gn,!0);Oe.at(p,Ao);const f=Ee.lerp(Ge.z,Pe.z,p),b=f>=-1&&f<=1,m=gn.distanceTo(Ao)<Zt*.5;if(b&&m){Oe.start.fromBufferAttribute(r,h),Oe.end.fromBufferAttribute(A,h),Oe.start.applyMatrix4(n),Oe.end.applyMatrix4(n);const I=new N,E=new N;yt.distanceSqToSegment(Oe.start,Oe.end,E,I),t.push({point:E,pointOnLine:I,distance:yt.origin.distanceTo(E),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class ul extends O{constructor(e=new ao,t=new ln({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(i,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const n=new xi(s,2,1);return e.setAttribute("instanceDistanceStart",new Kt(n,1,0)),e.setAttribute("instanceDistanceEnd",new Kt(n,1,1)),this}raycast(e,t){const i=this.material.worldUnits,s=e.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const n=e.params.Line2!==void 0&&e.params.Line2.threshold||0;yt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+n,r.boundingSphere===null&&r.computeBoundingSphere(),si.copy(r.boundingSphere).applyMatrix4(a);let c;if(i)c=Zt*.5;else{const h=Math.max(s.near,si.distanceToPoint(yt.origin));c=co(s,h,A.resolution)}if(si.radius+=c,yt.intersectsSphere(si)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),ti.copy(r.boundingBox).applyMatrix4(a);let l;if(i)l=Zt*.5;else{const h=Math.max(s.near,ti.distanceToPoint(yt.origin));l=co(s,h,A.resolution)}ti.expandByScalar(l),yt.intersectsBox(ti)!==!1&&(i?dl(this,t):pl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(hn),this.material.uniforms.resolution.value.set(hn.z,hn.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setPositions(i),this}setColors(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setColors(i),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class fl extends ul{constructor(e=new lo,t=new ln({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class ml extends O{constructor(e){const t=new bl(e),i=new yi(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(i,s);function n(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",n),this.addEventListener("mousemove",n),this.addEventListener("mouseup",n),this.addEventListener("click",n),this.dispose=function(){i.dispose(),s.dispose(),s.map.dispose(),pn.delete(e),this.removeEventListener("mousedown",n),this.removeEventListener("mousemove",n),this.removeEventListener("mouseup",n),this.removeEventListener("click",n)}}}class bl extends qn{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=ce,this.minFilter=it,this.magFilter=it;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),i={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,i),this.observer=t}dispatchDOMEvent(e){e.data&&Il(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pn=new WeakMap;function ho(o){const e=document.createRange(),t=new Be;function i(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let m=-1/0,I=-1/0,E=1/0,C=1/0;for(let Q=0;Q<p.length;Q++){const w=p[Q];m=Math.max(m,w.x),I=Math.max(I,w.y),E=Math.min(E,w.x+w.width),C=Math.min(C,w.y+w.height)}d.save(),d.beginPath(),d.rect(m,I,E-m,C-I),d.clip(),f=!0}return{add:function(m){p.push(m),b()},remove:function(){p.pop(),b()}}}function s(d,p,f,b){b!==""&&(d.textTransform==="uppercase"&&(b=b.toUpperCase()),l.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,l.textBaseline="top",l.fillStyle=d.color,l.fillText(b,p,f+parseFloat(d.fontSize)*.1))}function n(d,p,f,b,m){f<2*m&&(m=f/2),b<2*m&&(m=b/2),l.beginPath(),l.moveTo(d+m,p),l.arcTo(d+f,p,d+f,p+b,m),l.arcTo(d+f,p+b,d,p+b,m),l.arcTo(d,p+b,d,p,m),l.arcTo(d,p,d+f,p,m),l.closePath()}function a(d,p,f,b,m,I){const E=d[p+"Width"],C=d[p+"Style"],Q=d[p+"Color"];E!=="0px"&&C!=="none"&&Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=Q,l.lineWidth=parseFloat(E),l.beginPath(),l.moveTo(f,b),l.lineTo(f+m,b+I),l.stroke())}function r(d,p){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let f=0,b=0,m=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const C=e.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,s(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,l.save();const Q=window.devicePixelRatio;l.scale(1/Q,1/Q),l.drawImage(d,f,b),l.restore()}else if(d instanceof HTMLImageElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,l.drawImage(d,f,b,m,I)}else{const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,p=window.getComputedStyle(d),n(f,b,m,I,parseFloat(p.borderRadius));const Q=p.backgroundColor;Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=Q,l.fill());const w=["borderTop","borderLeft","borderBottom","borderRight"];let x=!0,D=null;for(const S of w){if(D!==null&&(x=p[S+"Width"]===p[D+"Width"]&&p[S+"Color"]===p[D+"Color"]&&p[S+"Style"]===p[D+"Style"]),x===!1)break;D=S}if(x===!0){const S=parseFloat(p.borderTopWidth);p.borderTopWidth!=="0px"&&p.borderTopStyle!=="none"&&p.borderTopColor!=="transparent"&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=p.borderTopColor,l.lineWidth=S,l.stroke())}else a(p,"borderTop",f,b,m,0),a(p,"borderLeft",f,b,0,I),a(p,"borderBottom",f,b+I,m,0),a(p,"borderRight",f+m,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const F=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(n(f,b,m,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(n(f+2,b+2,m-4,I-4,I),l.fillStyle=S,l.strokeStyle=F,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(n(f,b,m,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?F:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const Y=l.textAlign;l.textAlign="center";const V={color:F,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(V,f+m/2,b,"\u2714"),l.textAlign=Y}if(d.type==="range"){const[Y,V,K]=["min","max","value"].map(j=>parseFloat(d[j])),W=(K-Y)/(V-Y)*(m-I);n(f,b+I/4,m,I/2,I/4),l.fillStyle=F,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),n(f,b+I/4,W+I/2,I/2,I/4),l.fillStyle=S,l.fill(),n(f+W,b,I,I,I/2),l.fillStyle=S,l.fill()}(d.type==="color"||d.type==="text"||d.type==="number")&&(h.add({x:f,y:b,width:m,height:I}),s(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const E=p.overflow==="auto"||p.overflow==="hidden";E&&h.add({x:f,y:b,width:m,height:I});for(let C=0;C<d.childNodes.length;C++)r(d.childNodes[C],p);E&&h.remove()}const A=o.getBoundingClientRect();let c=pn.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pn.set(o,c));const l=c.getContext("2d"),h=new i(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Il(o,e,t,i){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:i*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const n=o.getBoundingClientRect();t=t*n.width+n.left,i=i*n.height+n.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&i>A.top&&i<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(p=>parseFloat(r[p])),h=A.width,d=(t-A.x)/h;r.value=c+(l-c)*d,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const ii=new _e,rs={type:"",data:ii},go=new Qi;class El extends Yt{listenToPointerEvents(e,t){const i=this,s=new Qi,n=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();ii.x=(r.clientX-A.left)/A.width*2-1,ii.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(ii,t);const c=s.intersectObjects(i.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;rs.type=r.type,rs.data.set(d.x,1-d.y),h.dispatchEvent(rs)}}n.addEventListener("pointerdown",a),n.addEventListener("pointerup",a),n.addEventListener("pointermove",a),n.addEventListener("mousedown",a),n.addEventListener("mouseup",a),n.addEventListener("mousemove",a),n.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,i={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(n){const a=n.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;rs.type=i[n.type],rs.data.set(l.x,1-l.y),c.dispatchEvent(rs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const ks=new N,Ms=new N,po=new Yn;class Cl extends Us{constructor(e,t=1,i=16711680){const s=new rt,n=e.geometry.attributes.normal.count,a=new Te(n*2*3,3);s.setAttribute("position",a),super(s,new St({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){const s=i.attributes.position,n=i.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)ks.fromBufferAttribute(s,r).applyMatrix4(e),Ms.fromBufferAttribute(n,r),Ms.applyMatrix3(po).normalize().multiplyScalar(this.size).add(ks),t.setXYZ(a,ks.x,ks.y,ks.z),a=a+1,t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function uo(o,e,t){const i=t.length-o-1;if(e>=t[i])return i-1;if(e<=t[o])return o;let s=o,n=i,a=Math.floor((s+n)/2);for(;e<t[a]||e>=t[a+1];)e<t[a]?n=a:s=a,a=Math.floor((s+n)/2);return a}function Bl(o,e,t,i){const s=[],n=[],a=[];s[0]=1;for(let r=1;r<=t;++r){n[r]=e-i[o+1-r],a[r]=i[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=a[c+1],h=n[r-c],d=s[c]/(l+h);s[c]=A+l*d,A=h*d}s[r]=A}return s}function wl(o,e,t,i){const s=uo(o,i,e),n=Bl(s,i,o,e),a=new Rt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[s-o+r],c=n[r],l=A.w*c;a.x+=A.x*l,a.y+=A.y*l,a.z+=A.z*l,a.w+=A.w*c}return a}function Ql(o,e,t,i,s){const n=[];for(let h=0;h<=t;++h)n[h]=0;const a=[];for(let h=0;h<=i;++h)a[h]=n.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=n.slice(0);r[0][0]=1;const A=n.slice(0),c=n.slice(0);for(let h=1;h<=t;++h){A[h]=e-s[o+1-h],c[h]=s[o+h]-e;let d=0;for(let p=0;p<h;++p){const f=c[p+1],b=A[h-p];r[h][p]=f+b;const m=r[p][h-1]/r[h][p];r[p][h]=d+f*m,d=b*m}r[h][h]=d}for(let h=0;h<=t;++h)a[0][h]=r[h][t];for(let h=0;h<=t;++h){let d=0,p=1;const f=[];for(let b=0;b<=t;++b)f[b]=n.slice(0);f[0][0]=1;for(let b=1;b<=i;++b){let m=0;const I=h-b,E=t-b;h>=b&&(f[p][0]=f[d][0]/r[E+1][I],m=f[p][0]*r[I][E]);const C=I>=-1?1:-I,Q=h-1<=E?b-1:t-h;for(let x=C;x<=Q;++x)f[p][x]=(f[d][x]-f[d][x-1])/r[E+1][I+x],m+=f[p][x]*r[I+x][E];h<=E&&(f[p][b]=-f[d][b-1]/r[E+1][h],m+=f[p][b]*r[h][E]),a[b][h]=m;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=i;++h){for(let d=0;d<=t;++d)a[h][d]*=l;l*=t-h}return a}function yl(o,e,t,i,s){const n=s<o?s:o,a=[],r=uo(o,i,e),A=Ql(r,i,o,n,e),c=[];for(let l=0;l<t.length;++l){const h=t[l].clone(),d=h.w;h.x*=d,h.y*=d,h.z*=d,c[l]=h}for(let l=0;l<=n;++l){const h=c[r-o].clone().multiplyScalar(A[l][0]);for(let d=1;d<=o;++d)h.add(c[r-o+d].clone().multiplyScalar(A[l][d]));a[l]=h}for(let l=n+1;l<=s+1;++l)a[l]=new Rt(0,0,0);return a}function vl(o,e){let t=1;for(let s=2;s<=o;++s)t*=s;let i=1;for(let s=2;s<=e;++s)i*=s;for(let s=2;s<=o-e;++s)i*=s;return t/i}function xl(o){const e=o.length,t=[],i=[];for(let n=0;n<e;++n){const a=o[n];t[n]=new N(a.x,a.y,a.z),i[n]=a.w}const s=[];for(let n=0;n<e;++n){const a=t[n].clone();for(let r=1;r<=n;++r)a.sub(s[n-r].clone().multiplyScalar(vl(n,r)*i[r]));s[n]=a.divideScalar(i[0])}return s}function Sl(o,e,t,i,s){const n=yl(o,e,t,i,s);return xl(n)}class Dl extends mr{constructor(e,t,i,s,n){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=n||this.knots.length-1;for(let a=0;a<i.length;++a){const r=i[a];this.controlPoints[a]=new Rt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new N){const i=t,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),n=wl(this.degree,this.knots,this.controlPoints,s);return n.w!==1&&n.divideScalar(n.w),i.set(n.x,n.y,n.z)}getTangent(e,t=new N){const i=t,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),n=Sl(this.degree,this.knots,this.controlPoints,s,1);return i.copy(n[1]).normalize(),i}}let ie,xe,Je;class Rl extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=n.path===""?qt.extractUrlBase(e):n.path,r=new ht(this.manager);r.setPath(n.path),r.setResponseType("arraybuffer"),r.setRequestHeader(n.requestHeader),r.setWithCredentials(n.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}parse(e,t){if(Ll(e))ie=new _l().parse(e);else{const s=Eo(e);if(!Nl(s))throw new Error("THREE.FBXLoader: Unknown format.");if(bo(s)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+bo(s));ie=new Fl().parse(s)}const i=new ci(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Tl(i,this.manager).parse(ie)}getFbxTree(){return ie}}class Tl{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){xe=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),s=this.parseDeformers(),n=new kl().parse(s);return this.parseScene(s,n,i),Je}parseConnections(){const e=new Map;return"Connections"in ie&&ie.Connections.connections.forEach(function(t){const i=t[0],s=t[1],n=t[2];e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:s,relationship:n};e.get(i).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const r={ID:i,relationship:n};e.get(s).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in ie.Objects){const i=ie.Objects.Video;for(const s in i){const n=i[s],a=parseInt(s);if(e[a]=n.RelativeFilename||n.Filename,"Content"in n){const r=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,A=typeof n.Content=="string"&&n.Content!=="";if(r||A){const c=this.parseImage(i[s]);t[n.RelativeFilename||n.Filename]=c}}}}for(const i in e){const s=e[i];t[s]!==void 0?e[i]=t[s]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){const t=e.Content,i=e.RelativeFilename||e.Filename,s=i.slice(i.lastIndexOf(".")+1).toLowerCase();let n;switch(s){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),n="image/tga";break;default:console.warn('FBXLoader: Image type "'+s+'" is not supported.');return}if(typeof t=="string")return"data:"+n+";base64,"+t;{const a=new Uint8Array(t);return window.URL.createObjectURL(new Blob([a],{type:n}))}}parseTextures(e){const t=new Map;if("Texture"in ie.Objects){const i=ie.Objects.Texture;for(const s in i){const n=this.parseTexture(i[s],e);t.set(parseInt(s),n)}}return t}parseTexture(e,t){const i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;const s=e.WrapModeU,n=e.WrapModeV,a=s!==void 0?s.value:0,r=n!==void 0?n.value:0;if(i.wrapS=a===0?zt:Ns,i.wrapT=r===0?zt:Ns,"Scaling"in e){const A=e.Scaling.value;i.repeat.x=A[0],i.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;i.offset.x=A[0],i.offset.y=A[1]}return i}loadTexture(e,t){const i=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),s=e.FileName.split(".").pop().toLowerCase(),n=i.has(s)?this.manager.getHandler(`.${s}`):this.textureLoader;if(!n)return console.warn(`FBXLoader: ${s.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new ui;const a=n.path;a||n.setPath(this.textureLoader.path);const r=xe.get(e.id).children;let A;r!==void 0&&r.length>0&&t[r[0].ID]!==void 0&&(A=t[r[0].ID],(A.indexOf("blob:")===0||A.indexOf("data:")===0)&&n.setPath(void 0));const c=n.load(A);return n.setPath(a),c}parseMaterials(e){const t=new Map;if("Material"in ie.Objects){const i=ie.Objects.Material;for(const s in i){const n=this.parseMaterial(i[s],e);n!==null&&t.set(parseInt(s),n)}}return t}parseMaterial(e,t){const i=e.id,s=e.attrName;let n=e.ShadingModel;if(typeof n=="object"&&(n=n.value),!xe.has(i))return null;const a=this.parseParameters(e,t,i);let r;switch(n.toLowerCase()){case"phong":r=new ms;break;case"lambert":r=new br;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),r=new ms;break}return r.setValues(a),r.name=s,r}parseParameters(e,t,i){const s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=We.toWorkingColorSpace(new Be().fromArray(e.Diffuse.value),ce):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=We.toWorkingColorSpace(new Be().fromArray(e.DiffuseColor.value),ce)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=We.toWorkingColorSpace(new Be().fromArray(e.Emissive.value),ce):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=We.toWorkingColorSpace(new Be().fromArray(e.EmissiveColor.value),ce)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(s.opacity=parseFloat(e.Opacity.value)),s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=We.toWorkingColorSpace(new Be().fromArray(e.Specular.value),ce):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=We.toWorkingColorSpace(new Be().fromArray(e.SpecularColor.value),ce));const n=this;return xe.get(i).children.forEach(function(a){const r=a.relationship;switch(r){case"Bump":s.bumpMap=n.getTexture(t,a.ID);break;case"Maya|TEX_ao_map":s.aoMap=n.getTexture(t,a.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=n.getTexture(t,a.ID),s.map!==void 0&&(s.map.colorSpace=ce);break;case"DisplacementColor":s.displacementMap=n.getTexture(t,a.ID);break;case"EmissiveColor":s.emissiveMap=n.getTexture(t,a.ID),s.emissiveMap!==void 0&&(s.emissiveMap.colorSpace=ce);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=n.getTexture(t,a.ID);break;case"ReflectionColor":s.envMap=n.getTexture(t,a.ID),s.envMap!==void 0&&(s.envMap.mapping=Ir,s.envMap.colorSpace=ce);break;case"SpecularColor":s.specularMap=n.getTexture(t,a.ID),s.specularMap!==void 0&&(s.specularMap.colorSpace=ce);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=n.getTexture(t,a.ID),s.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),s}getTexture(e,t){return"LayeredTexture"in ie.Objects&&t in ie.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=xe.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ie.Objects){const i=ie.Objects.Deformer;for(const s in i){const n=i[s],a=xe.get(parseInt(s));if(n.attrType==="Skin"){const r=this.parseSkeleton(a,i);r.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=a.parents[0].ID,e[s]=r}else if(n.attrType==="BlendShape"){const r={id:s};r.rawTargets=this.parseMorphTargets(a,i),r.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[s]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const i=[];return e.children.forEach(function(s){const n=t[s.ID];if(n.attrType!=="Cluster")return;const a={ID:s.ID,indices:[],weights:[],transformLink:new le().fromArray(n.TransformLink.a)};"Indexes"in n&&(a.indices=n.Indexes.a,a.weights=n.Weights.a),i.push(a)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){const i=[];for(let s=0;s<e.children.length;s++){const n=e.children[s],a=t[n.ID],r={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if(a.attrType!=="BlendShapeChannel")return;r.geoID=xe.get(parseInt(n.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,i.push(r)}return i}parseScene(e,t,i){Je=new Yt;const s=this.parseModels(e.skeletons,t,i),n=ie.Objects.Model,a=this;s.forEach(function(A){const c=n[A.ID];a.setLookAtProperties(A,c),xe.get(A.ID)?.parents?.forEach(function(l){const h=s.get(l.ID);h!==void 0&&h.add(A)}),A.parent===null&&Je.add(A)}),this.bindSkeleton(e.skeletons,t,s),this.addGlobalSceneSettings(),Je.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const c=Io(A.userData.transformData);A.applyMatrix4(c),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new Ml().parse();Je.children.length===1&&Je.children[0].isGroup&&(Je.children[0].animations=r,Je=Je.children[0]),Je.animations=r}parseModels(e,t,i){const s=new Map,n=ie.Objects.Model;for(const a in n){const r=parseInt(a),A=n[a],c=xe.get(r);let l=this.buildSkeleton(c,e,r,A.attrName);if(!l){switch(A.attrType){case"Camera":l=this.createCamera(c);break;case"Light":l=this.createLight(c);break;case"Mesh":l=this.createMesh(c,t,i);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new di;break;default:l=new Yt;break}l.name=A.attrName?Dt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),s.set(r,l)}return s}buildSkeleton(e,t,i,s){let n=null;return e?.parents.forEach(function(a){for(const r in t){const A=t[r];A.rawBones.forEach(function(c,l){if(c.ID===a.ID){const h=n;n=new di,n.matrixWorld.copy(c.transformLink),n.name=s?Dt.sanitizeNodeName(s):"",n.userData.originalName=s,n.ID=i,A.bones[l]=n,h!==null&&n.add(h)}})}}),n}createCamera(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new It;else{let s=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(s=1);let n=1;i.NearPlane!==void 0&&(n=i.NearPlane.value/1e3);let a=1e3;i.FarPlane!==void 0&&(a=i.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(r=i.AspectWidth.value,A=i.AspectHeight.value);const c=r/A;let l=45;i.FieldOfView!==void 0&&(l=i.FieldOfView.value);const h=i.FocalLength?i.FocalLength.value:null;switch(s){case 0:t=new Ps(l,c,n,a),h!==null&&t.setFocalLength(h);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new It;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+s+"."),t=new It;break}}return t}createLight(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new It;else{let s;i.LightType===void 0?s=0:s=i.LightType.value;let n=16777215;i.Color!==void 0&&(n=We.toWorkingColorSpace(new Be().fromArray(i.Color.value),ce));let a=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(a=0);let r=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?r=0:r=i.FarAttenuationEnd.value);const A=1;switch(s){case 0:t=new Ai(n,a,r,A);break;case 1:t=new wn(n,a);break;case 2:let c=Math.PI/3;i.InnerAngle!==void 0&&(c=Ee.degToRad(i.InnerAngle.value));let l=0;i.OuterAngle!==void 0&&(l=Ee.degToRad(i.OuterAngle.value),l=Math.max(l,1)),t=new Bn(n,a,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new Ai(n,a);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let s,n=null,a=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(n=t.get(A.ID)),i.has(A.ID)&&r.push(i.get(A.ID))}),r.length>1?a=r:r.length>0?a=r[0]:(a=new ms({name:xt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(a)),"color"in n.attributes&&r.forEach(function(A){A.vertexColors=!0}),n.groups.length>0){let A=!1;for(let c=0,l=n.groups.length;c<l;c++){const h=n.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new hi;r.push(c)}}return n.FBX_Deformer?(s=new xn(n,a),s.normalizeSkinWeights()):s=new O(n,a),s}createCurve(e,t){const i=e.children.reduce(function(n,a){return t.has(a.ID)&&(n=t.get(a.ID)),n},null),s=new St({name:xt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new gt(i,s)}getTransformData(e,t){const i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Fs(t.RotationOrder.value):i.eulerOrder=Fs(0),"Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&xe.get(e.ID).children.forEach(function(i){if(i.relationship==="LookAtProperty"){const s=ie.Objects.Model[i.ID];if("Lcl_Translation"in s){const n=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(n),Je.add(e.target)):e.lookAt(new N().fromArray(n))}}})}bindSkeleton(e,t,i){const s=this.parsePoseNodes();for(const n in e){const a=e[n];xe.get(parseInt(a.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;xe.get(A).parents.forEach(function(c){i.has(c.ID)&&i.get(c.ID).bind(new Dn(a.bones),s[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ie.Objects){const t=ie.Objects.Pose;for(const i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){const s=t[i].PoseNode;Array.isArray(s)?s.forEach(function(n){e[n.Node]=new le().fromArray(n.Matrix.a)}):e[s.Node]=new le().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ie){if("AmbientColor"in ie.GlobalSettings){const e=ie.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],s=e[2];if(t!==0||i!==0||s!==0){const n=new Be().setRGB(t,i,s,ce);Je.add(new Er(n,1))}}"UnitScaleFactor"in ie.GlobalSettings&&(Je.userData.unitScaleFactor=ie.GlobalSettings.UnitScaleFactor.value)}}}class kl{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ie.Objects){const i=ie.Objects.Geometry;for(const s in i){const n=xe.get(parseInt(s)),a=this.parseGeometry(n,i[s],e);t.set(parseInt(s),a)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){const s=i.skeletons,n=[],a=e.parents.map(function(h){return ie.Objects.Model[h.ID]});if(a.length===0)return;const r=e.children.reduce(function(h,d){return s[d.ID]!==void 0&&(h=s[d.ID]),h},null);e.children.forEach(function(h){i.morphTargets[h.ID]!==void 0&&n.push(i.morphTargets[h.ID])});const A=a[0],c={};"RotationOrder"in A&&(c.eulerOrder=Fs(A.RotationOrder.value)),"InheritType"in A&&(c.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(c.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(c.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(c.scale=A.GeometricScaling.value);const l=Io(c);return this.genGeometry(t,r,n,l)}genGeometry(e,t,i,s){const n=new rt;e.attrName&&(n.name=e.attrName);const a=this.parseGeoNode(e,t),r=this.genBuffers(a),A=new Te(r.vertex,3);if(A.applyMatrix4(s),n.setAttribute("position",A),r.colors.length>0&&n.setAttribute("color",new Te(r.colors,3)),t&&(n.setAttribute("skinIndex",new Cr(r.weightsIndices,4)),n.setAttribute("skinWeight",new Te(r.vertexWeights,4)),n.FBX_Deformer=t),r.normal.length>0){const c=new Yn().getNormalMatrix(s),l=new Te(r.normal,3);l.applyNormalMatrix(c),n.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;n.setAttribute(h,new Te(r.uvs[l],2))}),a.material&&a.material.mappingType!=="AllSame"){let c=r.materialIndex[0],l=0;if(r.materialIndex.forEach(function(h,d){h!==c&&(n.addGroup(l,d-l,c),c=h,l=d)}),n.groups.length>0){const h=n.groups[n.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&n.addGroup(d,r.materialIndex.length-d,c)}n.groups.length===0&&n.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(n,e,i,s),n}parseGeoNode(e,t){const i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let s=0;for(;e.LayerElementUV[s];)e.LayerElementUV[s].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[s])),s++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(s,n){s.indices.forEach(function(a,r){i.weightTable[a]===void 0&&(i.weightTable[a]=[]),i.weightTable[a].push({id:n,weight:s.weights[r]})})})),i}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,s=0,n=!1,a=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,m=!1;p<0&&(p=p^-1,m=!0);let I=[],E=[];if(a.push(p*3,p*3+1,p*3+2),e.color){const C=ni(f,i,p,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(C){E.push(C.weight),I.push(C.id)}),E.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const C=[0,0,0,0],Q=[0,0,0,0];E.forEach(function(w,x){let D=w,S=I[x];Q.forEach(function(F,Y,V){if(D>F){V[Y]=D,D=F;const K=C[Y];C[Y]=S,S=K}})}),I=C,E=Q}for(;E.length<4;)E.push(0),I.push(0);for(let C=0;C<4;++C)l.push(E[C]),h.push(I[C])}if(e.normal){const C=ni(f,i,p,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=ni(f,i,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(C,Q){const w=ni(f,i,p,C);c[Q]===void 0&&(c[Q]=[]),c[Q].push(w[0]),c[Q].push(w[1])}),s++,m&&(d.genFace(t,e,a,b,r,A,c,l,h,s),i++,s=0,a=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new N(0,0,0);for(let i=0;i<e.length;i++){const s=e[i],n=e[(i+1)%e.length];t.x+=(s.y-n.y)*(s.z+n.z),t.y+=(s.z-n.z)*(s.x+n.x),t.z+=(s.x-n.x)*(s.y+n.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),i=(Math.abs(t.z)>.5?new N(0,1,0):new N(0,0,1)).cross(t).normalize(),s=t.clone().cross(i).normalize();return{normal:t,tangent:i,bitangent:s}}flattenVertex(e,t,i){return new _e(e.dot(t),e.dot(i))}genFace(e,t,i,s,n,a,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<i.length;I+=3)d.push(new N(p[i[I]],p[i[I+1]],p[i[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),m=[];for(const I of d)m.push(this.flattenVertex(I,f,b));h=Br.triangulateShape(m,[])}else l===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),h=[[0,1,2]]):h=[[0,1,2]];for(const[d,p,f]of h)e.vertex.push(t.vertexPositions[i[d*3]]),e.vertex.push(t.vertexPositions[i[d*3+1]]),e.vertex.push(t.vertexPositions[i[d*3+2]]),e.vertex.push(t.vertexPositions[i[p*3]]),e.vertex.push(t.vertexPositions[i[p*3+1]]),e.vertex.push(t.vertexPositions[i[p*3+2]]),e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[f*3+2]]),t.skeleton&&(e.vertexWeights.push(A[d*4]),e.vertexWeights.push(A[d*4+1]),e.vertexWeights.push(A[d*4+2]),e.vertexWeights.push(A[d*4+3]),e.vertexWeights.push(A[p*4]),e.vertexWeights.push(A[p*4+1]),e.vertexWeights.push(A[p*4+2]),e.vertexWeights.push(A[p*4+3]),e.vertexWeights.push(A[f*4]),e.vertexWeights.push(A[f*4+1]),e.vertexWeights.push(A[f*4+2]),e.vertexWeights.push(A[f*4+3]),e.weightsIndices.push(c[d*4]),e.weightsIndices.push(c[d*4+1]),e.weightsIndices.push(c[d*4+2]),e.weightsIndices.push(c[d*4+3]),e.weightsIndices.push(c[p*4]),e.weightsIndices.push(c[p*4+1]),e.weightsIndices.push(c[p*4+2]),e.weightsIndices.push(c[p*4+3]),e.weightsIndices.push(c[f*4]),e.weightsIndices.push(c[f*4+1]),e.weightsIndices.push(c[f*4+2]),e.weightsIndices.push(c[f*4+3])),t.color&&(e.colors.push(a[d*3]),e.colors.push(a[d*3+1]),e.colors.push(a[d*3+2]),e.colors.push(a[p*3]),e.colors.push(a[p*3+1]),e.colors.push(a[p*3+2]),e.colors.push(a[f*3]),e.colors.push(a[f*3+1]),e.colors.push(a[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(s),e.materialIndex.push(s),e.materialIndex.push(s)),t.normal&&(e.normal.push(n[d*3]),e.normal.push(n[d*3+1]),e.normal.push(n[d*3+2]),e.normal.push(n[p*3]),e.normal.push(n[p*3+1]),e.normal.push(n[p*3+2]),e.normal.push(n[f*3]),e.normal.push(n[f*3+1]),e.normal.push(n[f*3+2])),t.uv&&t.uv.forEach(function(b,m){e.uvs[m]===void 0&&(e.uvs[m]=[]),e.uvs[m].push(r[m][d*2]),e.uvs[m].push(r[m][d*2+1]),e.uvs[m].push(r[m][p*2]),e.uvs[m].push(r[m][p*2+1]),e.uvs[m].push(r[m][f*2]),e.uvs[m].push(r[m][f*2+1])})}addMorphTargets(e,t,i,s){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const n=this;i.forEach(function(a){a.rawTargets.forEach(function(r){const A=ie.Objects.Geometry[r.geoID];A!==void 0&&n.genMorphGeometry(e,t,A,s,r.name)})})}genMorphGeometry(e,t,i,s,n){const a=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=i.Vertices!==void 0?i.Vertices.a:[],c=i.Indexes!==void 0?i.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const m=c[b]*3;h[m]=A[b*3],h[m+1]=A[b*3+1],h[m+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:a},p=this.genBuffers(d),f=new Te(p.vertex,3);f.name=n||i.attrName,f.applyMatrix4(s),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Normals.a;let n=[];return i==="IndexToDirect"&&("NormalIndex"in e?n=e.NormalIndex.a:"NormalsIndex"in e&&(n=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:n,mappingType:t,referenceType:i}}parseUVs(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.UV.a;let n=[];return i==="IndexToDirect"&&(n=e.UVIndex.a),{dataSize:2,buffer:s,indices:n,mappingType:t,referenceType:i}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Colors.a;let n=[];i==="IndexToDirect"&&(n=e.ColorIndex.a);for(let a=0,r=new Be;a<s.length;a+=4)r.fromArray(s,a),We.toWorkingColorSpace(r,ce),r.toArray(s,a);return{dataSize:4,buffer:s,indices:n,mappingType:t,referenceType:i}}parseMaterialIndices(e){const t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const s=e.Materials.a,n=[];for(let a=0;a<s.length;++a)n.push(a);return{dataSize:1,buffer:s,indices:n,mappingType:t,referenceType:i}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new rt;const i=t-1,s=e.KnotVector.a,n=[],a=e.Points.a;for(let l=0,h=a.length;l<h;l+=4)n.push(new Rt().fromArray(a,l));let r,A;if(e.Form==="Closed")n.push(n[0]);else if(e.Form==="Periodic"){r=i,A=s.length-1-r;for(let l=0;l<i;++l)n.push(n[l])}const c=new Dl(i,s,n,r,A).getPoints(n.length*12);return new rt().setFromPoints(c)}}class Ml{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const i in t){const s=t[i],n=this.addClip(s);e.push(n)}return e}parseClips(){if(ie.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ie.Objects.AnimationCurveNode,t=new Map;for(const i in e){const s=e[i];if(s.attrName.match(/S|R|T|DeformPercent/)!==null){const n={id:s.id,attr:s.attrName,curves:{}};t.set(n.id,n)}}return t}parseAnimationCurves(e){const t=ie.Objects.AnimationCurve;for(const i in t){const s={id:t[i].id,times:t[i].KeyTime.a.map(Ul),values:t[i].KeyValueFloat.a},n=xe.get(s.id);if(n!==void 0){const a=n.parents[0].ID,r=n.parents[0].relationship;r.match(/X/)?e.get(a).curves.x=s:r.match(/Y/)?e.get(a).curves.y=s:r.match(/Z/)?e.get(a).curves.z=s:r.match(/DeformPercent/)&&e.has(a)&&(e.get(a).curves.morph=s)}}}parseAnimationLayers(e){const t=ie.Objects.AnimationLayer,i=new Map;for(const s in t){const n=[],a=xe.get(parseInt(s));a!==void 0&&(a.children.forEach(function(r,A){if(e.has(r.ID)){const c=e.get(r.ID);if(c.curves.x!==void 0||c.curves.y!==void 0||c.curves.z!==void 0){if(n[A]===void 0){const l=xe.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=ie.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?Dt.sanitizeNodeName(h.attrName):"",ID:h.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Je.traverse(function(p){p.ID===h.id&&(d.transform=p.matrix,p.userData.transformData&&(d.eulerOrder=p.userData.transformData.eulerOrder))}),d.transform||(d.transform=new le),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),n[A]=d}}n[A]&&(n[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(n[A]===void 0){const l=xe.get(r.ID).parents.filter(function(m){return m.relationship!==void 0})[0].ID,h=xe.get(l).parents[0].ID,d=xe.get(h).parents[0].ID,p=xe.get(d).parents[0].ID,f=ie.Objects.Model[p],b={modelName:f.attrName?Dt.sanitizeNodeName(f.attrName):"",morphName:ie.Objects.Deformer[l].attrName};n[A]=b}n[A][c.attr]=c}}}),i.set(parseInt(s),n))}return i}parseAnimStacks(e){const t=ie.Objects.AnimationStack,i={};for(const s in t){const n=xe.get(parseInt(s)).children;n.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const a=e.get(n[0].ID);i[s]={name:t[s].attrName,layer:a}}return i}addClip(e){let t=[];const i=this;return e.layer.forEach(function(s){t=t.concat(i.generateTracks(s))}),new Rn(e.name,-1,t)}generateTracks(e){const t=[];let i=new N,s=new N;if(e.transform&&e.transform.decompose(i,new we,s),i=i.toArray(),s=s.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");n!==void 0&&t.push(n)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);n!==void 0&&t.push(n)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");n!==void 0&&t.push(n)}if(e.DeformPercent!==void 0){const n=this.generateMorphTrack(e);n!==void 0&&t.push(n)}return t}generateVectorTrack(e,t,i,s){const n=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(n,t,i);return new fi(e+"."+s,n,a)}generateRotationTrack(e,t,i,s,n){let a,r;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const d=this.interpolateRotations(t.x,t.y,t.z,n);a=d[0],r=d[1]}const A=Fs(0);i!==void 0&&(i=i.map(Ee.degToRad),i.push(A),i=new Ut().fromArray(i),i=new we().setFromEuler(i)),s!==void 0&&(s=s.map(Ee.degToRad),s.push(A),s=new Ut().fromArray(s),s=new we().setFromEuler(s).invert());const c=new we,l=new Ut,h=[];if(!(!r||!a)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],n),c.setFromEuler(l),i!==void 0&&c.premultiply(i),s!==void 0&&c.multiply(s),d>2&&new we().fromArray(h,(d-3)/3*4).dot(c)<0&&c.set(-c.x,-c.y,-c.z,-c.w),c.toArray(h,d/3*4);return new bi(e+".quaternion",a,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,i=t.values.map(function(n){return n/100}),s=Je.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new mi(e.modelName+".morphTargetInfluences["+s+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,s){return i-s}),t.length>1){let i=1,s=t[0];for(let n=1;n<t.length;n++){const a=t[n];a!==s&&(t[i]=a,s=a,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){const s=i,n=[];let a=-1,r=-1,A=-1;return e.forEach(function(c){if(t.x&&(a=t.x.times.indexOf(c)),t.y&&(r=t.y.times.indexOf(c)),t.z&&(A=t.z.times.indexOf(c)),a!==-1){const l=t.x.values[a];n.push(l),s[0]=l}else n.push(s[0]);if(r!==-1){const l=t.y.values[r];n.push(l),s[1]=l}else n.push(s[1]);if(A!==-1){const l=t.z.values[A];n.push(l),s[2]=l}else n.push(s[2])}),n}interpolateRotations(e,t,i,s){const n=[],a=[];n.push(e.times[0]),a.push(Ee.degToRad(e.values[0])),a.push(Ee.degToRad(t.values[0])),a.push(Ee.degToRad(i.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],i.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const c=A.map(Ee.degToRad),l=[e.values[r],t.values[r],i.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(Ee.degToRad),d=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){const f=Math.max(...p)/180,b=new Ut(...c,s),m=new Ut(...h,s),I=new we().setFromEuler(b),E=new we().setFromEuler(m);I.dot(E)&&E.set(-E.x,-E.y,-E.z,-E.w);const C=e.times[r-1],Q=e.times[r]-C,w=new we,x=new Ut;for(let D=0;D<1;D+=1/f)w.copy(I.clone().slerp(E.clone(),D)),n.push(C+D*Q),x.setFromQuaternion(w,s),a.push(x.x),a.push(x.y),a.push(x.z)}else n.push(e.times[r]),a.push(Ee.degToRad(e.values[r])),a.push(Ee.degToRad(t.values[r])),a.push(Ee.degToRad(i.values[r]))}return[n,a]}}class Fl{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new mo,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,i=e.split(/[\r\n]+/);return i.forEach(function(s,n){const a=s.match(/^[\s\t]*;/),r=s.match(/^[\s\t]*$/);if(a||r)return;const A=s.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),c=s.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=s.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(s,A):c?t.parseNodeProperty(s,c,i[++n]):l?t.popStack():s.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(s)}),this.allNodes}parseNodeBegin(e,t){const i=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),n={name:i},a=this.parseNodeAttr(s),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,n):i in r?(i==="PoseNode"?r.PoseNode.push(n):r[i].id!==void 0&&(r[i]={},r[i][r[i].id]=r[i]),a.id!==""&&(r[i][a.id]=n)):typeof a.id=="number"?(r[i]={},r[i][a.id]=n):i!=="Properties70"&&(i==="PoseNode"?r[i]=[n]:r[i]=n),typeof a.id=="number"&&(n.id=a.id),a.name!==""&&(n.attrName=a.name),a.type!==""&&(n.attrType=a.type),this.pushStack(n)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",s="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:i,type:s}}parseNodeProperty(e,t,i){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();s==="Content"&&n===","&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if(a.name==="Properties70"){this.parseNodeSpecialProperty(e,s,n);return}if(s==="C"){const r=n.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=n.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),s="connections",n=[A,c],Pl(n,l),a[s]===void 0&&(a[s]=[])}s==="Node"&&(a.id=n),s in a&&Array.isArray(a[s])?a[s].push(n):s!=="a"?a[s]=n:a.a=n,this.setCurrentProp(a,s),s==="a"&&n.slice(-1)!==","&&(a.a=fn(n))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=fn(t.a))}parseNodeSpecialProperty(e,t,i){const s=i.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),n=s[0],a=s[1],r=s[2],A=s[3];let c=s[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=fn(c);break}this.getPrevNode()[n]={type:a,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),n)}}class _l{parse(e){const t=new fo(e);t.skip(23);const i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const s=new mo;for(;!this.endOfContent(t);){const n=this.parseNode(t,i);n!==null&&s.add(n.name,n)}return s}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const i={},s=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const a=e.getUint8(),r=e.getString(a);if(s===0)return null;const A=[];for(let d=0;d<n;d++)A.push(this.parseProperty(e));const c=A.length>0?A[0]:"",l=A.length>1?A[1]:"",h=A.length>2?A[2]:"";for(i.singleProperty=n===1&&e.getOffset()===s;s>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,i,d)}return i.propertyList=A,typeof c=="number"&&(i.id=c),l!==""&&(i.attrName=l),h!==""&&(i.attrType=h),r!==""&&(i.name=r),i}parseSubNode(e,t,i){if(i.singleProperty===!0){const s=i.propertyList[0];Array.isArray(s)?(t[i.name]=i,i.a=s):t[i.name]=s}else if(e==="Connections"&&i.name==="C"){const s=[];i.propertyList.forEach(function(n,a){a!==0&&s.push(n)}),t.connections===void 0&&(t.connections=[]),t.connections.push(s)}else if(i.name==="Properties70")Object.keys(i).forEach(function(s){t[s]=i[s]});else if(e==="Properties70"&&i.name==="P"){let s=i.propertyList[0],n=i.propertyList[1];const a=i.propertyList[2],r=i.propertyList[3];let A;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),n==="Color"||n==="ColorRGB"||n==="Vector"||n==="Vector3D"||n.indexOf("Lcl_")===0?A=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:A=i.propertyList[4],t[s]={type:n,type2:a,flag:r,value:A}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){const t=e.getString(1);let i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const s=e.getUint32(),n=e.getUint32(),a=e.getUint32();if(n===0)switch(t){case"b":case"c":return e.getBooleanArray(s);case"d":return e.getFloat64Array(s);case"f":return e.getFloat32Array(s);case"i":return e.getInt32Array(s);case"l":return e.getInt64Array(s)}const r=ys(new Uint8Array(e.getArrayBuffer(a))),A=new fo(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(s);case"d":return A.getFloat64Array(s);case"f":return A.getFloat32Array(s);case"i":return A.getInt32Array(s);case"l":return A.getInt64Array(s)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class fo{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const s=i.indexOf(0);return s>=0&&(i=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(i)}}class mo{add(e,t){this[e]=t}}function Ll(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===Eo(o,0,e.length)}function Nl(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function i(s){const n=o[s-1];return o=o.slice(t+s),t++,n}for(let s=0;s<e.length;++s)if(i(1)===e[s])return!1;return!0}function bo(o){const e=/FBXVersion: (\d+)/,t=o.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Ul(o){return o/46186158e3}const Gl=[];function ni(o,e,t,i){let s;switch(i.mappingType){case"ByPolygonVertex":s=o;break;case"ByPolygon":s=e;break;case"ByVertice":s=t;break;case"AllSame":s=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(s=i.indices[s]);const n=s*i.dataSize,a=n+i.dataSize;return Ol(Gl,i.buffer,n,a)}const un=new Ut,As=new N;function Io(o){const e=new le,t=new le,i=new le,s=new le,n=new le,a=new le,r=new le,A=new le,c=new le,l=new le,h=new le,d=new le,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(As.fromArray(o.translation));const f=Fs(0);if(o.preRotation){const V=o.preRotation.map(Ee.degToRad);V.push(f),t.makeRotationFromEuler(un.fromArray(V))}if(o.rotation){const V=o.rotation.map(Ee.degToRad);V.push(o.eulerOrder||f),i.makeRotationFromEuler(un.fromArray(V))}if(o.postRotation){const V=o.postRotation.map(Ee.degToRad);V.push(f),s.makeRotationFromEuler(un.fromArray(V)),s.invert()}o.scale&&n.scale(As.fromArray(o.scale)),o.scalingOffset&&r.setPosition(As.fromArray(o.scalingOffset)),o.scalingPivot&&a.setPosition(As.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(As.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(As.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(i).multiply(s),m=new le;m.extractRotation(l);const I=new le;I.copyPosition(l);const E=I.clone().invert().multiply(l),C=m.clone().invert().multiply(E),Q=n,w=new le;if(p===0)w.copy(m).multiply(b).multiply(C).multiply(Q);else if(p===1)w.copy(m).multiply(C).multiply(b).multiply(Q);else{const V=new le().scale(new N().setFromMatrixScale(h)).clone().invert(),K=C.clone().multiply(V);w.copy(m).multiply(b).multiply(K).multiply(Q)}const x=c.clone().invert(),D=a.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(i).multiply(s).multiply(x).multiply(r).multiply(a).multiply(n).multiply(D);const F=new le().copyPosition(S),Y=l.clone().multiply(F);return d.copyPosition(Y),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Fs(o){o=o||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[o]}function fn(o){return o.split(",").map(function(e){return parseFloat(e)})}function Eo(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function Pl(o,e){for(let t=0,i=o.length,s=e.length;t<s;t++,i++)o[i]=e[t]}function Ol(o,e,t,i){for(let s=t,n=0;s<i;s++,n++)o[n]=e[s];return o}class Hl extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=this.path===""?qt.extractUrlBase(e):this.path,r=new ht(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
460
- `);let s={};const n=/\s+/,a={};for(let A=0;A<i.length;A++){let c=i[A];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const l=c.indexOf(" ");let h=l>=0?c.substring(0,l):c;h=h.toLowerCase();let d=l>=0?c.substring(l+1):"";if(d=d.trim(),h==="newmtl")s={name:d},a[d]=s;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){const p=d.split(n,3);s[h]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else s[h]=d}const r=new jl(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(a),r}}class jl{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:kn,this.wrap=this.options.wrap!==void 0?this.options.wrap:zt}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const i in e){const s=e[i],n={};t[i]=n;for(const a in s){let r=!0,A=s[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(A=[A[0]/255,A[1]/255,A[2]/255]),this.options&&this.options.ignoreZeroRGBs&&A[0]===0&&A[1]===0&&A[2]===0&&(r=!1);break}r&&(n[c]=A)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,i=this.materialsInfo[e],s={name:e,side:this.side};function n(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function a(r,A){if(s[r])return;const c=t.getTextureParams(A,s),l=t.loadTexture(n(t.baseUrl,c.url));l.repeat.copy(c.scale),l.offset.copy(c.offset),l.wrapS=t.wrap,l.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(l.colorSpace=ce),s[r]=l}for(const r in i){const A=i[r];let c;if(A!=="")switch(r.toLowerCase()){case"kd":s.color=We.toWorkingColorSpace(new Be().fromArray(A),ce);break;case"ks":s.specular=We.toWorkingColorSpace(new Be().fromArray(A),ce);break;case"ke":s.emissive=We.toWorkingColorSpace(new Be().fromArray(A),ce);break;case"map_kd":a("map",A);break;case"map_ks":a("specularMap",A);break;case"map_ke":a("emissiveMap",A);break;case"norm":a("normalMap",A);break;case"map_bump":case"bump":a("bumpMap",A);break;case"map_d":a("alphaMap",A),s.transparent=!0;break;case"ns":s.shininess=parseFloat(A);break;case"d":c=parseFloat(A),c<1&&(s.opacity=c,s.transparent=!0);break;case"tr":c=parseFloat(A),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(s.opacity=1-c,s.transparent=!0);break}}return this.materials[e]=new ms(s),this.materials[e]}getTextureParams(e,t){const i={scale:new _e(1,1),offset:new _e(0,0)},s=e.split(/\s+/);let n;return n=s.indexOf("-bm"),n>=0&&(t.bumpScale=parseFloat(s[n+1]),s.splice(n,2)),n=s.indexOf("-s"),n>=0&&(i.scale.set(parseFloat(s[n+1]),parseFloat(s[n+2])),s.splice(n,4)),n=s.indexOf("-o"),n>=0&&(i.offset.set(parseFloat(s[n+1]),parseFloat(s[n+2])),s.splice(n,4)),i.url=s.join(" ").trim(),i}loadTexture(e,t,i,s,n){const a=this.manager!==void 0?this.manager:wr;let r=a.getHandler(e);r===null&&(r=new ci(a)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,i,s,n);return t!==void 0&&(A.mapping=t),A}}const ql=/^[og]\s*(.+)?/,zl=/^mtllib /,Yl=/^usemtl /,Kl=/^usemap /,Co=/\s+/,Bo=new N,mn=new N,wo=new N,Qo=new N,ct=new N,ai=new Be;function Jl(){const o={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(s,n){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const r={index:this.materials.length,name:s||"",mtllib:Array.isArray(n)&&n.length>0?n[n.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const c={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(s){const n=this.currentMaterial();if(n&&n.groupEnd===-1&&(n.groupEnd=this.geometry.vertices.length/3,n.groupCount=n.groupEnd-n.groupStart,n.inherited=!1),s&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return s&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),n}},i&&i.name&&typeof i.clone=="function"){const s=i.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(e,t,i){const s=this.vertices,n=this.object.geometry.vertices;n.push(s[e+0],s[e+1],s[e+2]),n.push(s[t+0],s[t+1],s[t+2]),n.push(s[i+0],s[i+1],s[i+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){const s=this.normals,n=this.object.geometry.normals;n.push(s[e+0],s[e+1],s[e+2]),n.push(s[t+0],s[t+1],s[t+2]),n.push(s[i+0],s[i+1],s[i+2])},addFaceNormal:function(e,t,i){const s=this.vertices,n=this.object.geometry.normals;Bo.fromArray(s,e),mn.fromArray(s,t),wo.fromArray(s,i),ct.subVectors(wo,mn),Qo.subVectors(Bo,mn),ct.cross(Qo),ct.normalize(),n.push(ct.x,ct.y,ct.z),n.push(ct.x,ct.y,ct.z),n.push(ct.x,ct.y,ct.z)},addColor:function(e,t,i){const s=this.colors,n=this.object.geometry.colors;s[e]!==void 0&&n.push(s[e+0],s[e+1],s[e+2]),s[t]!==void 0&&n.push(s[t+0],s[t+1],s[t+2]),s[i]!==void 0&&n.push(s[i+0],s[i+1],s[i+2])},addUV:function(e,t,i){const s=this.uvs,n=this.object.geometry.uvs;n.push(s[e+0],s[e+1]),n.push(s[t+0],s[t+1]),n.push(s[i+0],s[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,s,n,a,r,A,c){const l=this.vertices.length;let h=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),p=this.parseVertexIndex(i,l);if(this.addVertex(h,d,p),this.addColor(h,d,p),r!==void 0&&r!==""){const f=this.normals.length;h=this.parseNormalIndex(r,f),d=this.parseNormalIndex(A,f),p=this.parseNormalIndex(c,f),this.addNormal(h,d,p)}else this.addFaceNormal(h,d,p);if(s!==void 0&&s!==""){const f=this.uvs.length;h=this.parseUVIndex(s,f),d=this.parseUVIndex(n,f),p=this.parseUVIndex(a,f),this.addUV(h,d,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let i=0,s=e.length;i<s;i++){const n=this.parseVertexIndex(e[i],t);this.addVertexPoint(n),this.addColor(n)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const i=this.vertices.length,s=this.uvs.length;for(let n=0,a=e.length;n<a;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(let n=0,a=t.length;n<a;n++)this.addUVLine(this.parseUVIndex(t[n],s))}};return o.startObject("",!1),o}class Vl extends xt{constructor(e){super(e),this.materials=null,this.materialsLoader=new Hl(e)}load(e,t,i,s){const n=this,a=new ht(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,async function(r){try{const A=n.parse(r,!0);for(let c=0,l=A.materialLibraries.length;c<l;c++){const h=A.materialLibraries[c];if(!h||typeof h!="string"||h.trim()===""){console.warn("THREE.OBJLoader: Invalid or empty material library reference, skipping.");continue}const d=e.startsWith("blob:")?e+"/"+h:new URL(h,e);console.debug("Loading MTL file: "+d),await new Promise((p,f)=>{n.materialsLoader.load(d.toString(),b=>{n.setMaterials(b),p()},null,f)})}t(n.createObjects(A))}catch(A){s?s(A):console.error(A),n.manager.itemError(e)}},i,s)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const i=new Jl;e.indexOf(`\r
441
+ `};class oi extends jr{constructor(e){super({type:"LineMaterial",uniforms:Oi.clone(yt.line.uniforms),vertexShader:yt.line.vertexShader,fragmentShader:yt.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const ri=new Qt,Do=new U,So=new U,qe=new Qt,He=new Qt,St=new Qt,Ai=new U,ci=new de,Ke=new qr,Ro=new U,$a=new Oa,es=new ms,Rt=new Qt;let Tt,sa;function To(o,e,t){return Rt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),Rt.multiplyScalar(1/Rt.w),Rt.x=sa/t.width,Rt.y=sa/t.height,Rt.applyMatrix4(o.projectionMatrixInverse),Rt.multiplyScalar(1/Rt.w),Math.abs(Math.max(Rt.x,Rt.y))}function Rl(o,e){const t=o.matrixWorld,s=o.geometry,a=s.attributes.instanceStart,i=s.attributes.instanceEnd,n=Math.min(s.instanceCount,a.count);for(let r=0,A=n;r<A;r++){Ke.start.fromBufferAttribute(a,r),Ke.end.fromBufferAttribute(i,r),Ke.applyMatrix4(t);const h=new U,c=new U;Tt.distanceSqToSegment(Ke.start,Ke.end,c,h),c.distanceTo(h)<sa*.5&&e.push({point:c,pointOnLine:h,distance:Tt.origin.distanceTo(c),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function Tl(o,e,t){const s=e.projectionMatrix,a=o.material.resolution,i=o.matrixWorld,n=o.geometry,r=n.attributes.instanceStart,A=n.attributes.instanceEnd,h=Math.min(n.instanceCount,r.count),c=-e.near;Tt.at(1,St),St.w=1,St.applyMatrix4(e.matrixWorldInverse),St.applyMatrix4(s),St.multiplyScalar(1/St.w),St.x*=a.x/2,St.y*=a.y/2,St.z=0,Ai.copy(St),ci.multiplyMatrices(e.matrixWorldInverse,i);for(let l=0,d=h;l<d;l++){if(qe.fromBufferAttribute(r,l),He.fromBufferAttribute(A,l),qe.w=1,He.w=1,qe.applyMatrix4(ci),He.applyMatrix4(ci),qe.z>c&&He.z>c)continue;if(qe.z>c){const E=qe.z-He.z,I=(qe.z-c)/E;qe.lerp(He,I)}else if(He.z>c){const E=He.z-qe.z,I=(He.z-c)/E;He.lerp(qe,I)}qe.applyMatrix4(s),He.applyMatrix4(s),qe.multiplyScalar(1/qe.w),He.multiplyScalar(1/He.w),qe.x*=a.x/2,qe.y*=a.y/2,He.x*=a.x/2,He.y*=a.y/2,Ke.start.copy(qe),Ke.start.z=0,Ke.end.copy(He),Ke.end.z=0;const p=Ke.closestPointToPointParameter(Ai,!0);Ke.at(p,Ro);const b=we.lerp(qe.z,He.z,p),m=b>=-1&&b<=1,f=Ai.distanceTo(Ro)<sa*.5;if(m&&f){Ke.start.fromBufferAttribute(r,l),Ke.end.fromBufferAttribute(A,l),Ke.start.applyMatrix4(i),Ke.end.applyMatrix4(i);const E=new U,I=new U;Tt.distanceSqToSegment(Ke.start,Ke.end,I,E),t.push({point:I,pointOnLine:E,distance:Tt.origin.distanceTo(I),object:o,face:null,faceIndex:l,uv:null,uv1:null})}}}class kl extends j{constructor(e=new xo,t=new oi({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,a=new Float32Array(2*t.count);for(let n=0,r=0,A=t.count;n<A;n++,r+=2)Do.fromBufferAttribute(t,n),So.fromBufferAttribute(s,n),a[r]=r===0?0:a[r-1],a[r+1]=a[r]+Do.distanceTo(So);const i=new xs(a,2,1);return e.setAttribute("instanceDistanceStart",new qt(i,1,0)),e.setAttribute("instanceDistanceEnd",new qt(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,a=e.camera;a===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Tt=e.ray;const n=this.matrixWorld,r=this.geometry,A=this.material;sa=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),es.copy(r.boundingSphere).applyMatrix4(n);let h;if(s)h=sa*.5;else{const l=Math.max(a.near,es.distanceToPoint(Tt.origin));h=To(a,l,A.resolution)}if(es.radius+=h,Tt.intersectsSphere(es)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),$a.copy(r.boundingBox).applyMatrix4(n);let c;if(s)c=sa*.5;else{const l=Math.max(a.near,$a.distanceToPoint(Tt.origin));c=To(a,l,A.resolution)}$a.expandByScalar(c),Tt.intersectsBox($a)!==!1&&(s?Rl(this,t):Tl(this,a,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(ri),this.material.uniforms.resolution.value.set(ri.z,ri.w))}}class ko extends xo{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let a=0;a<t;a+=3)s[2*a]=e[a],s[2*a+1]=e[a+1],s[2*a+2]=e[a+2],s[2*a+3]=e[a+3],s[2*a+4]=e[a+4],s[2*a+5]=e[a+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let a=0;a<t;a+=3)s[2*a]=e[a],s[2*a+1]=e[a+1],s[2*a+2]=e[a+2],s[2*a+3]=e[a+3],s[2*a+4]=e[a+4],s[2*a+5]=e[a+5];return super.setColors(s),this}setFromPoints(e){const t=e.length-1,s=new Float32Array(6*t);for(let a=0;a<t;a++)s[6*a]=e[a].x,s[6*a+1]=e[a].y,s[6*a+2]=e[a].z||0,s[6*a+3]=e[a+1].x,s[6*a+4]=e[a+1].y,s[6*a+5]=e[a+1].z||0;return super.setPositions(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Fl extends kl{constructor(e=new ko,t=new oi({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class Ml extends j{constructor(e){const t=new _l(e),s=new Ui(t.image.width*.001,t.image.height*.001),a=new It({map:t,toneMapped:!1,transparent:!0});super(s,a);function i(n){a.map.dispatchDOMEvent(n)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),a.dispose(),a.map.dispose(),li.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class _l extends Hr{constructor(e){super(Fo(e)),this.dom=e,this.anisotropy=16,this.colorSpace=ge,this.minFilter=$e,this.magFilter=$e,this.generateMipmaps=!1;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&Ll(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Fo(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const li=new WeakMap;function Fo(o){const e=document.createRange(),t=new xe;function s(d){const p=[];let b=!1;function m(){if(b&&(b=!1,d.restore()),p.length===0)return;let f=-1/0,E=-1/0,I=1/0,C=1/0;for(let Q=0;Q<p.length;Q++){const w=p[Q];f=Math.max(f,w.x),E=Math.max(E,w.y),I=Math.min(I,w.x+w.width),C=Math.min(C,w.y+w.height)}d.save(),d.beginPath(),d.rect(f,E,I-f,C-E),d.clip(),b=!0}return{add:function(f){p.push(f),m()},remove:function(){p.pop(),m()}}}function a(d,p,b,m){m!==""&&(d.textTransform==="uppercase"&&(m=m.toUpperCase()),c.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,c.textBaseline="top",c.fillStyle=d.color,c.fillText(m,p,b+parseFloat(d.fontSize)*.1))}function i(d,p,b,m,f){b<2*f&&(f=b/2),m<2*f&&(f=m/2),c.beginPath(),c.moveTo(d+f,p),c.arcTo(d+b,p,d+b,p+m,f),c.arcTo(d+b,p+m,d,p+m,f),c.arcTo(d,p+m,d,p,f),c.arcTo(d,p,d+b,p,f),c.closePath()}function n(d,p,b,m,f,E){const I=d[p+"Width"],C=d[p+"Style"],Q=d[p+"Color"];I!=="0px"&&C!=="none"&&Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(c.strokeStyle=Q,c.lineWidth=parseFloat(I),c.beginPath(),c.moveTo(b,m),c.lineTo(b+f,m+E),c.stroke())}function r(d,p){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let b=0,m=0,f=0,E=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const C=e.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,f=C.width,E=C.height,a(p,b,m,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const C=d.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5;const Q=C.width,w=C.height;c.drawImage(d,b,m,Q,w)}else if(d instanceof HTMLImageElement){const C=d.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,f=C.width,E=C.height,c.drawImage(d,b,m,f,E)}else{const C=d.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,f=C.width,E=C.height,p=window.getComputedStyle(d),i(b,m,f,E,parseFloat(p.borderRadius));const Q=p.backgroundColor;Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(c.fillStyle=Q,c.fill());const w=["borderTop","borderLeft","borderBottom","borderRight"];let x=!0,S=null;for(const D of w){if(S!==null&&(x=p[D+"Width"]===p[S+"Width"]&&p[D+"Color"]===p[S+"Color"]&&p[D+"Style"]===p[S+"Style"]),x===!1)break;S=D}if(x===!0){const D=parseFloat(p.borderTopWidth);p.borderTopWidth!=="0px"&&p.borderTopStyle!=="none"&&p.borderTopColor!=="transparent"&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&(c.strokeStyle=p.borderTopColor,c.lineWidth=D,c.stroke())}else n(p,"borderTop",b,m,f,0),n(p,"borderLeft",b,m,0,E),n(p,"borderBottom",b,m+E,f,0),n(p,"borderRight",b+f,m,0,E);if(d instanceof HTMLInputElement){let D=p.accentColor;(D===void 0||D==="auto")&&(D=p.color),t.set(D);const M=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(i(b,m,f,E,E),c.fillStyle="white",c.strokeStyle=D,c.lineWidth=1,c.fill(),c.stroke(),d.checked&&(i(b+2,m+2,f-4,E-4,E),c.fillStyle=D,c.strokeStyle=M,c.lineWidth=2,c.fill(),c.stroke())),d.type==="checkbox"&&(i(b,m,f,E,2),c.fillStyle=d.checked?D:"white",c.strokeStyle=d.checked?M:D,c.lineWidth=1,c.stroke(),c.fill(),d.checked)){const O=c.textAlign;c.textAlign="center";const z={color:M,fontFamily:p.fontFamily,fontSize:E+"px",fontWeight:"bold"};a(z,b+f/2,m,"\u2714"),c.textAlign=O}if(d.type==="range"){const[O,z,Y]=["min","max","value"].map(J=>parseFloat(d[J])),ee=(Y-O)/(z-O)*(f-E);i(b,m+E/4,f,E/2,E/4),c.fillStyle=M,c.strokeStyle=D,c.lineWidth=1,c.fill(),c.stroke(),i(b,m+E/4,ee+E/2,E/2,E/4),c.fillStyle=D,c.fill(),i(b+ee,m,E,E,E/2),c.fillStyle=D,c.fill()}if(d.type==="color"||d.type==="text"||d.type==="number"||d.type==="email"||d.type==="password"){l.add({x:b,y:m,width:f,height:E});const O=d.type==="password"?"*".repeat(d.value.length):d.value;a(p,b+parseInt(p.paddingLeft),m+parseInt(p.paddingTop),O),l.remove()}}}const I=p.overflow==="auto"||p.overflow==="hidden";I&&l.add({x:b,y:m,width:f,height:E});for(let C=0;C<d.childNodes.length;C++)r(d.childNodes[C],p);I&&l.remove()}const A=o.getBoundingClientRect();let h=li.get(o);h===void 0&&(h=document.createElement("canvas"),li.set(o,h)),h.width=A.width,h.height=A.height;const c=h.getContext("2d"),l=new s(c);return c.clearRect(0,0,h.width,h.height),r(o),h}function Ll(o,e,t,s){const a={clientX:t*o.offsetWidth+o.offsetLeft,clientY:s*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,a));const i=o.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function n(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom){if(r.dispatchEvent(new MouseEvent(e,a)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click")){const[h,c]=["min","max"].map(p=>parseFloat(r[p])),l=A.width,d=(t-A.x)/l;r.value=h+(c-h)*d,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}r instanceof HTMLInputElement&&(r.type==="text"||r.type==="number"||r.type==="email"||r.type==="password")&&(e==="mousedown"||e==="click")&&r.focus()}for(let h=0;h<r.childNodes.length;h++)n(r.childNodes[h])}}n(o)}const ts=new Ge,ha={type:"",data:ts},Nl={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"},Mo=new vs;class Ul extends Zt{constructor(){super(),this.raycaster=new vs,this.element=null,this.camera=null,this.controllers=[],this._onPointerEvent=this.onPointerEvent.bind(this),this._onXRControllerEvent=this.onXRControllerEvent.bind(this)}onPointerEvent(e){e.stopPropagation();const t=this.element.getBoundingClientRect();ts.x=(e.clientX-t.left)/t.width*2-1,ts.y=-(e.clientY-t.top)/t.height*2+1,this.raycaster.setFromCamera(ts,this.camera);const s=this.raycaster.intersectObjects(this.children,!1);if(s.length>0){const a=s[0],i=a.object,n=a.uv;ha.type=e.type,ha.data.set(n.x,1-n.y),i.dispatchEvent(ha)}}onXRControllerEvent(e){const t=e.target;Mo.setFromXRController(t);const s=Mo.intersectObjects(this.children,!1);if(s.length>0){const a=s[0],i=a.object,n=a.uv;ha.type=Nl[e.type],ha.data.set(n.x,1-n.y),i.dispatchEvent(ha)}}listenToPointerEvents(e,t){this.camera=t,this.element=e.domElement,this.element.addEventListener("pointerdown",this._onPointerEvent),this.element.addEventListener("pointerup",this._onPointerEvent),this.element.addEventListener("pointermove",this._onPointerEvent),this.element.addEventListener("mousedown",this._onPointerEvent),this.element.addEventListener("mouseup",this._onPointerEvent),this.element.addEventListener("mousemove",this._onPointerEvent),this.element.addEventListener("click",this._onPointerEvent)}disconnectionPointerEvents(){this.element!==null&&(this.element.removeEventListener("pointerdown",this._onPointerEvent),this.element.removeEventListener("pointerup",this._onPointerEvent),this.element.removeEventListener("pointermove",this._onPointerEvent),this.element.removeEventListener("mousedown",this._onPointerEvent),this.element.removeEventListener("mouseup",this._onPointerEvent),this.element.removeEventListener("mousemove",this._onPointerEvent),this.element.removeEventListener("click",this._onPointerEvent))}listenToXRControllerEvents(e){this.controllers.push(e),e.addEventListener("move",this._onXRControllerEvent),e.addEventListener("select",this._onXRControllerEvent),e.addEventListener("selectstart",this._onXRControllerEvent),e.addEventListener("selectend",this._onXRControllerEvent)}disconnectXrControllerEvents(){for(const e of this.controllers)e.removeEventListener("move",this._onXRControllerEvent),e.removeEventListener("select",this._onXRControllerEvent),e.removeEventListener("selectstart",this._onXRControllerEvent),e.removeEventListener("selectend",this._onXRControllerEvent)}disconnect(){this.disconnectionPointerEvents(),this.disconnectXrControllerEvents(),this.camera=null,this.element=null,this.controllers=[]}}const Ma=new U,_a=new U,_o=new ji;class Pl extends Pa{constructor(e,t=1,s=16711680){const a=new lt,i=e.geometry.attributes.normal.count,n=new _e(i*2*3,3);a.setAttribute("position",n),super(a,new _t({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.isVertexNormalsHelper=!0,this.update()}update(){this.object.updateMatrixWorld(!0),_o.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const a=s.attributes.position,i=s.attributes.normal;let n=0;for(let r=0,A=a.count;r<A;r++)Ma.fromBufferAttribute(a,r).applyMatrix4(e),_a.fromBufferAttribute(i,r),_a.applyMatrix3(_o).normalize().multiplyScalar(this.size).add(Ma),t.setXYZ(n,Ma.x,Ma.y,Ma.z),n=n+1,t.setXYZ(n,_a.x,_a.y,_a.z),n=n+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Lo(o,e,t){const s=t.length-o-1;if(e>=t[s])return s-1;if(e<=t[o])return o;let a=o,i=s,n=Math.floor((a+i)/2);for(;e<t[n]||e>=t[n+1];)e<t[n]?i=n:a=n,n=Math.floor((a+i)/2);return n}function Gl(o,e,t,s){const a=[],i=[],n=[];a[0]=1;for(let r=1;r<=t;++r){i[r]=e-s[o+1-r],n[r]=s[o+r]-e;let A=0;for(let h=0;h<r;++h){const c=n[h+1],l=i[r-h],d=a[h]/(c+l);a[h]=A+c*d,A=l*d}a[r]=A}return a}function Ol(o,e,t,s){const a=Lo(o,s,e),i=Gl(a,s,o,e),n=new Qt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[a-o+r],h=i[r],c=A.w*h;n.x+=A.x*c,n.y+=A.y*c,n.z+=A.z*c,n.w+=A.w*h}return n}function jl(o,e,t,s,a){const i=[];for(let l=0;l<=t;++l)i[l]=0;const n=[];for(let l=0;l<=s;++l)n[l]=i.slice(0);const r=[];for(let l=0;l<=t;++l)r[l]=i.slice(0);r[0][0]=1;const A=i.slice(0),h=i.slice(0);for(let l=1;l<=t;++l){A[l]=e-a[o+1-l],h[l]=a[o+l]-e;let d=0;for(let p=0;p<l;++p){const b=h[p+1],m=A[l-p];r[l][p]=b+m;const f=r[p][l-1]/r[l][p];r[p][l]=d+b*f,d=m*f}r[l][l]=d}for(let l=0;l<=t;++l)n[0][l]=r[l][t];for(let l=0;l<=t;++l){let d=0,p=1;const b=[];for(let m=0;m<=t;++m)b[m]=i.slice(0);b[0][0]=1;for(let m=1;m<=s;++m){let f=0;const E=l-m,I=t-m;l>=m&&(b[p][0]=b[d][0]/r[I+1][E],f=b[p][0]*r[E][I]);const C=E>=-1?1:-E,Q=l-1<=I?m-1:t-l;for(let x=C;x<=Q;++x)b[p][x]=(b[d][x]-b[d][x-1])/r[I+1][E+x],f+=b[p][x]*r[E+x][I];l<=I&&(b[p][m]=-b[d][m-1]/r[I+1][l],f+=b[p][m]*r[l][I]),n[m][l]=f;const w=d;d=p,p=w}}let c=t;for(let l=1;l<=s;++l){for(let d=0;d<=t;++d)n[l][d]*=c;c*=t-l}return n}function ql(o,e,t,s,a){const i=a<o?a:o,n=[],r=Lo(o,s,e),A=jl(r,s,o,i,e),h=[];for(let c=0;c<t.length;++c){const l=t[c].clone(),d=l.w;l.x*=d,l.y*=d,l.z*=d,h[c]=l}for(let c=0;c<=i;++c){const l=h[r-o].clone().multiplyScalar(A[c][0]);for(let d=1;d<=o;++d)l.add(h[r-o+d].clone().multiplyScalar(A[c][d]));n[c]=l}for(let c=i+1;c<=a+1;++c)n[c]=new Qt(0,0,0);return n}function Hl(o,e){let t=1;for(let a=2;a<=o;++a)t*=a;let s=1;for(let a=2;a<=e;++a)s*=a;for(let a=2;a<=o-e;++a)s*=a;return t/s}function Kl(o){const e=o.length,t=[],s=[];for(let i=0;i<e;++i){const n=o[i];t[i]=new U(n.x,n.y,n.z),s[i]=n.w}const a=[];for(let i=0;i<e;++i){const n=t[i].clone();for(let r=1;r<=i;++r)n.sub(a[i-r].clone().multiplyScalar(Hl(i,r)*s[r]));a[i]=n.divideScalar(s[0])}return a}function zl(o,e,t,s,a){const i=ql(o,e,t,s,a);return Kl(i)}class Jl extends Kr{constructor(e,t,s,a,i){super();const n=t?t.length-1:0,r=s?s.length:0;this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=a||0,this.endKnot=i||n;for(let A=0;A<r;++A){const h=s[A];this.controlPoints[A]=new Qt(h.x,h.y,h.z,h.w)}}getPoint(e,t=new U){const s=t,a=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=Ol(this.degree,this.knots,this.controlPoints,a);return i.w!==1&&i.divideScalar(i.w),s.set(i.x,i.y,i.z)}getTangent(e,t=new U){const s=t,a=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=zl(this.degree,this.knots,this.controlPoints,a,1);return s.copy(i[1]).normalize(),s}toJSON(){const e=super.toJSON();return e.degree=this.degree,e.knots=[...this.knots],e.controlPoints=this.controlPoints.map(t=>t.toArray()),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e}fromJSON(e){return super.fromJSON(e),this.degree=e.degree,this.knots=[...e.knots],this.controlPoints=e.controlPoints.map(t=>new Qt(t[0],t[1],t[2],t[3])),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this}}let se,ke,Ze;class Yl extends Mt{constructor(e){super(e)}load(e,t,s,a){const i=this,n=i.path===""?Vt.extractUrlBase(e):i.path,r=new ut(this.manager);r.setPath(i.path),r.setResponseType("arraybuffer"),r.setRequestHeader(i.requestHeader),r.setWithCredentials(i.withCredentials),r.load(e,function(A){try{t(i.parse(A,n))}catch(h){a?a(h):console.error(h),i.manager.itemError(e)}},s,a)}parse(e,t){if(eh(e))se=new $l().parse(e);else{const a=Oo(e);if(!th(a))throw new Error("THREE.FBXLoader: Unknown format.");if(Po(a)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Po(a));se=new Zl().parse(a)}const s=new rs(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Xl(s,this.manager).parse(se)}getFbxTree(){return se}}class Xl{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){ke=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),s=this.parseMaterials(t),a=this.parseDeformers(),i=new Vl().parse(a);return this.parseScene(a,i,s),Ze}parseConnections(){const e=new Map;return"Connections"in se&&se.Connections.connections.forEach(function(t){const s=t[0],a=t[1],i=t[2];e.has(s)||e.set(s,{parents:[],children:[]});const n={ID:a,relationship:i};e.get(s).parents.push(n),e.has(a)||e.set(a,{parents:[],children:[]});const r={ID:s,relationship:i};e.get(a).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in se.Objects){const s=se.Objects.Video;for(const a in s){const i=s[a],n=parseInt(a);if(e[n]=i.RelativeFilename||i.Filename,"Content"in i){const r=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,A=typeof i.Content=="string"&&i.Content!=="";if(r||A){const h=this.parseImage(s[a]);t[i.RelativeFilename||i.Filename]=h}}}}for(const s in e){const a=e[s];t[a]!==void 0?e[s]=t[a]:e[s]=e[s].split("\\").pop()}return e}parseImage(e){const t=e.Content,s=e.RelativeFilename||e.Filename,a=s.slice(s.lastIndexOf(".")+1).toLowerCase();let i;switch(a){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",s),i="image/tga";break;case"webp":i="image/webp";break;default:console.warn('FBXLoader: Image type "'+a+'" is not supported.');return}if(typeof t=="string")return"data:"+i+";base64,"+t;{const n=new Uint8Array(t);return window.URL.createObjectURL(new Blob([n],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in se.Objects){const s=se.Objects.Texture;for(const a in s){const i=this.parseTexture(s[a],e);t.set(parseInt(a),i)}}return t}parseTexture(e,t){const s=this.loadTexture(e,t);s.ID=e.id,s.name=e.attrName;const a=e.WrapModeU,i=e.WrapModeV,n=a!==void 0?a.value:0,r=i!==void 0?i.value:0;if(s.wrapS=n===0?Wt:Ua,s.wrapT=r===0?Wt:Ua,"Scaling"in e){const A=e.Scaling.value;s.repeat.x=A[0],s.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;s.offset.x=A[0],s.offset.y=A[1]}return s}loadTexture(e,t){const s=e.FileName.split(".").pop().toLowerCase();let a=this.manager.getHandler(`.${s}`);a===null&&(a=this.textureLoader);const i=a.path;i||a.setPath(this.textureLoader.path);const n=ke.get(e.id).children;let r;if(n!==void 0&&n.length>0&&t[n[0].ID]!==void 0&&(r=t[n[0].ID],(r.indexOf("blob:")===0||r.indexOf("data:")===0)&&a.setPath(void 0)),r===void 0)return console.warn("FBXLoader: Undefined filename, creating placeholder texture."),new ps;const A=a.load(r);return a.setPath(i),A}parseMaterials(e){const t=new Map;if("Material"in se.Objects){const s=se.Objects.Material;for(const a in s){const i=this.parseMaterial(s[a],e);i!==null&&t.set(parseInt(a),i)}}return t}parseMaterial(e,t){const s=e.id,a=e.attrName;let i=e.ShadingModel;if(typeof i=="object"&&(i=i.value),!ke.has(s))return null;const n=this.parseParameters(e,t,s);let r;switch(i.toLowerCase()){case"phong":r=new Ca;break;case"lambert":r=new zr;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),r=new Ca;break}return r.setValues(n),r.name=a,r}parseParameters(e,t,s){const a={};e.BumpFactor&&(a.bumpScale=e.BumpFactor.value),e.Diffuse?a.color=Ye.colorSpaceToWorking(new xe().fromArray(e.Diffuse.value),ge):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(a.color=Ye.colorSpaceToWorking(new xe().fromArray(e.DiffuseColor.value),ge)),e.DisplacementFactor&&(a.displacementScale=e.DisplacementFactor.value),e.Emissive?a.emissive=Ye.colorSpaceToWorking(new xe().fromArray(e.Emissive.value),ge):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(a.emissive=Ye.colorSpaceToWorking(new xe().fromArray(e.EmissiveColor.value),ge)),e.EmissiveFactor&&(a.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),a.opacity=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0),(a.opacity===1||a.opacity===0)&&(a.opacity=e.Opacity?parseFloat(e.Opacity.value):null,a.opacity===null&&(a.opacity=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),a.opacity<1&&(a.transparent=!0),e.ReflectionFactor&&(a.reflectivity=e.ReflectionFactor.value),e.Shininess&&(a.shininess=e.Shininess.value),e.Specular?a.specular=Ye.colorSpaceToWorking(new xe().fromArray(e.Specular.value),ge):e.SpecularColor&&e.SpecularColor.type==="Color"&&(a.specular=Ye.colorSpaceToWorking(new xe().fromArray(e.SpecularColor.value),ge));const i=this;return ke.get(s).children.forEach(function(n){const r=n.relationship;switch(r){case"Bump":a.bumpMap=i.getTexture(t,n.ID);break;case"Maya|TEX_ao_map":a.aoMap=i.getTexture(t,n.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":a.map=i.getTexture(t,n.ID),a.map!==void 0&&(a.map.colorSpace=ge);break;case"DisplacementColor":a.displacementMap=i.getTexture(t,n.ID);break;case"EmissiveColor":a.emissiveMap=i.getTexture(t,n.ID),a.emissiveMap!==void 0&&(a.emissiveMap.colorSpace=ge);break;case"NormalMap":case"Maya|TEX_normal_map":a.normalMap=i.getTexture(t,n.ID);break;case"ReflectionColor":a.envMap=i.getTexture(t,n.ID),a.envMap!==void 0&&(a.envMap.mapping=Jr,a.envMap.colorSpace=ge);break;case"SpecularColor":a.specularMap=i.getTexture(t,n.ID),a.specularMap!==void 0&&(a.specularMap.colorSpace=ge);break;case"TransparentColor":case"TransparencyFactor":a.alphaMap=i.getTexture(t,n.ID),a.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),a}getTexture(e,t){return"LayeredTexture"in se.Objects&&t in se.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=ke.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in se.Objects){const s=se.Objects.Deformer;for(const a in s){const i=s[a],n=ke.get(parseInt(a));if(i.attrType==="Skin"){const r=this.parseSkeleton(n,s);r.ID=a,n.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=n.parents[0].ID,e[a]=r}else if(i.attrType==="BlendShape"){const r={id:a};r.rawTargets=this.parseMorphTargets(n,s),r.id=a,n.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[a]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const s=[];return e.children.forEach(function(a){const i=t[a.ID];if(i.attrType!=="Cluster")return;const n={ID:a.ID,indices:[],weights:[],transformLink:new de().fromArray(i.TransformLink.a)};"Indexes"in i&&(n.indices=i.Indexes.a,n.weights=i.Weights.a),s.push(n)}),{rawBones:s,bones:[]}}parseMorphTargets(e,t){const s=[];for(let a=0;a<e.children.length;a++){const i=e.children[a],n=t[i.ID],r={name:n.attrName,initialWeight:n.DeformPercent,id:n.id,fullWeights:n.FullWeights.a};if(n.attrType!=="BlendShapeChannel")return;r.geoID=ke.get(parseInt(i.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,s.push(r)}return s}parseScene(e,t,s){Ze=new Zt;const a=this.parseModels(e.skeletons,t,s),i=se.Objects.Model,n=this;a.forEach(function(A){const h=i[A.ID];n.setLookAtProperties(A,h),ke.get(A.ID)?.parents?.forEach(function(c){const l=a.get(c.ID);l!==void 0&&l.add(A)}),A.parent===null&&Ze.add(A)}),this.bindSkeleton(e.skeletons,t,a),this.addGlobalSceneSettings(),Ze.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const h=Go(A.userData.transformData);A.applyMatrix4(h),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new Wl().parse();Ze.children.length===1&&Ze.children[0].isGroup&&(Ze.children[0].animations=r,Ze=Ze.children[0]),Ze.animations=r}parseModels(e,t,s){const a=new Map,i=se.Objects.Model;for(const n in i){const r=parseInt(n),A=i[n],h=ke.get(r);let c=this.buildSkeleton(h,e,r,A.attrName);if(!c){switch(A.attrType){case"Camera":c=this.createCamera(h);break;case"Light":c=this.createLight(h);break;case"Mesh":c=this.createMesh(h,t,s);break;case"NurbsCurve":c=this.createCurve(h,t);break;case"LimbNode":case"Root":c=new gs;break;default:c=new Zt;break}c.name=A.attrName?Lt.sanitizeNodeName(A.attrName):"",c.userData.originalName=A.attrName,c.ID=r}this.getTransformData(c,A),a.set(r,c)}return a}buildSkeleton(e,t,s,a){let i=null;return e?.parents.forEach(function(n){for(const r in t){const A=t[r];A.rawBones.forEach(function(h,c){if(h.ID===n.ID){const l=i;i=new gs,i.matrixWorld.copy(h.transformLink),i.name=a?Lt.sanitizeNodeName(a):"",i.userData.originalName=a,i.ID=s,A.bones[c]=i,l!==null&&i.add(l)}})}}),i}createCamera(e){let t,s;if(e.children.forEach(function(a){const i=se.Objects.NodeAttribute[a.ID];i!==void 0&&(s=i)}),s===void 0)t=new Bt;else{let a=0;s.CameraProjectionType!==void 0&&s.CameraProjectionType.value===1&&(a=1);let i=1;s.NearPlane!==void 0&&(i=s.NearPlane.value/1e3);let n=1e3;s.FarPlane!==void 0&&(n=s.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;s.AspectWidth!==void 0&&s.AspectHeight!==void 0&&(r=s.AspectWidth.value,A=s.AspectHeight.value);const h=r/A;let c=45;s.FieldOfView!==void 0&&(c=s.FieldOfView.value);const l=s.FocalLength?s.FocalLength.value:null;switch(a){case 0:t=new hs(c,h,i,n),l!==null&&t.setFocalLength(l);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new Bt;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+a+"."),t=new Bt;break}}return t}createLight(e){let t,s;if(e.children.forEach(function(a){const i=se.Objects.NodeAttribute[a.ID];i!==void 0&&(s=i)}),s===void 0)t=new Bt;else{let a;s.LightType===void 0?a=0:a=s.LightType.value;let i=16777215;s.Color!==void 0&&(i=Ye.colorSpaceToWorking(new xe().fromArray(s.Color.value),ge));let n=s.Intensity===void 0?1:s.Intensity.value/100;s.CastLightOnObject!==void 0&&s.CastLightOnObject.value===0&&(n=0);let r=0;s.FarAttenuationEnd!==void 0&&(s.EnableFarAttenuation!==void 0&&s.EnableFarAttenuation.value===0?r=0:r=s.FarAttenuationEnd.value);const A=1;switch(a){case 0:t=new os(i,n,r,A);break;case 1:t=new Ei(i,n);break;case 2:let h=Math.PI/3;s.InnerAngle!==void 0&&(h=we.degToRad(s.InnerAngle.value));let c=0;s.OuterAngle!==void 0&&(c=we.degToRad(s.OuterAngle.value),c=Math.max(c,1)),t=new mi(i,n,r,h,c,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+s.LightType.value+", defaulting to a PointLight."),t=new os(i,n);break}s.CastShadows!==void 0&&s.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,s){let a,i=null,n=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(i=t.get(A.ID)),s.has(A.ID)&&r.push(s.get(A.ID))}),r.length>1?n=r:r.length>0?n=r[0]:(n=new Ca({name:Mt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(n)),"color"in i.attributes&&r.forEach(function(A){A.vertexColors=!0}),i.groups.length>0){let A=!1;for(let h=0,c=i.groups.length;h<c;h++){const l=i.groups[h];(l.materialIndex<0||l.materialIndex>=r.length)&&(l.materialIndex=r.length,A=!0)}if(A){const h=new cs;r.push(h)}}return i.FBX_Deformer?(a=new yi(i,n),a.normalizeSkinWeights()):a=new j(i,n),a}createCurve(e,t){const s=e.children.reduce(function(i,n){return t.has(n.ID)&&(i=t.get(n.ID)),i},null),a=new _t({name:Mt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new bt(s,a)}getTransformData(e,t){const s={};"InheritType"in t&&(s.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?s.eulerOrder=La(t.RotationOrder.value):s.eulerOrder=La(0),"Lcl_Translation"in t&&(s.translation=t.Lcl_Translation.value),"PreRotation"in t&&(s.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(s.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(s.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(s.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(s.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(s.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(s.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(s.rotationPivot=t.RotationPivot.value),e.userData.transformData=s}setLookAtProperties(e,t){"LookAtProperty"in t&&ke.get(e.ID).children.forEach(function(s){if(s.relationship==="LookAtProperty"){const a=se.Objects.Model[s.ID];if("Lcl_Translation"in a){const i=a.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(i),Ze.add(e.target)):e.lookAt(new U().fromArray(i))}}})}bindSkeleton(e,t,s){const a=this.parsePoseNodes();for(const i in e){const n=e[i];ke.get(parseInt(n.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;ke.get(A).parents.forEach(function(h){s.has(h.ID)&&s.get(h.ID).bind(new vi(n.bones),a[h.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in se.Objects){const t=se.Objects.Pose;for(const s in t)if(t[s].attrType==="BindPose"&&t[s].NbPoseNodes>0){const a=t[s].PoseNode;Array.isArray(a)?a.forEach(function(i){e[i.Node]=new de().fromArray(i.Matrix.a)}):e[a.Node]=new de().fromArray(a.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in se){if("AmbientColor"in se.GlobalSettings){const e=se.GlobalSettings.AmbientColor.value,t=e[0],s=e[1],a=e[2];if(t!==0||s!==0||a!==0){const i=new xe().setRGB(t,s,a,ge);Ze.add(new Yr(i,1))}}"UnitScaleFactor"in se.GlobalSettings&&(Ze.userData.unitScaleFactor=se.GlobalSettings.UnitScaleFactor.value)}}}class Vl{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in se.Objects){const s=se.Objects.Geometry;for(const a in s){const i=ke.get(parseInt(a)),n=this.parseGeometry(i,s[a],e);t.set(parseInt(a),n)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,s){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,s);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,s){const a=s.skeletons,i=[],n=e.parents.map(function(l){return se.Objects.Model[l.ID]});if(n.length===0)return;const r=e.children.reduce(function(l,d){return a[d.ID]!==void 0&&(l=a[d.ID]),l},null);e.children.forEach(function(l){s.morphTargets[l.ID]!==void 0&&i.push(s.morphTargets[l.ID])});const A=n[0],h={};"RotationOrder"in A&&(h.eulerOrder=La(A.RotationOrder.value)),"InheritType"in A&&(h.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(h.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(h.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(h.scale=A.GeometricScaling.value);const c=Go(h);return this.genGeometry(t,r,i,c)}genGeometry(e,t,s,a){const i=new lt;e.attrName&&(i.name=e.attrName);const n=this.parseGeoNode(e,t),r=this.genBuffers(n),A=new _e(r.vertex,3);if(A.applyMatrix4(a),i.setAttribute("position",A),r.colors.length>0&&i.setAttribute("color",new _e(r.colors,3)),t&&(i.setAttribute("skinIndex",new Xr(r.weightsIndices,4)),i.setAttribute("skinWeight",new _e(r.vertexWeights,4)),i.FBX_Deformer=t),r.normal.length>0){const h=new ji().getNormalMatrix(a),c=new _e(r.normal,3);c.applyNormalMatrix(h),i.setAttribute("normal",c)}if(r.uvs.forEach(function(h,c){const l=c===0?"uv":`uv${c}`;i.setAttribute(l,new _e(r.uvs[c],2))}),n.material&&n.material.mappingType!=="AllSame"){let h=r.materialIndex[0],c=0;if(r.materialIndex.forEach(function(l,d){l!==h&&(i.addGroup(c,d-c,h),h=l,c=d)}),i.groups.length>0){const l=i.groups[i.groups.length-1],d=l.start+l.count;d!==r.materialIndex.length&&i.addGroup(d,r.materialIndex.length-d,h)}i.groups.length===0&&i.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(i,e,s,a),i}parseGeoNode(e,t){const s={};if(s.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],s.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&e.LayerElementColor[0].Colors&&(s.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(s.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(s.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){s.uv=[];let a=0;for(;e.LayerElementUV[a];)e.LayerElementUV[a].UV&&s.uv.push(this.parseUVs(e.LayerElementUV[a])),a++}return s.weightTable={},t!==null&&(s.skeleton=t,t.rawBones.forEach(function(a,i){a.indices.forEach(function(n,r){s.weightTable[n]===void 0&&(s.weightTable[n]=[]),s.weightTable[n].push({id:i,weight:a.weights[r]})})})),s}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let s=0,a=0,i=!1,n=[],r=[],A=[],h=[],c=[],l=[];const d=this;return e.vertexIndices.forEach(function(p,b){let m,f=!1;p<0&&(p=p^-1,f=!0);let E=[],I=[];if(n.push(p*3,p*3+1,p*3+2),e.color){const C=as(b,s,p,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(C){I.push(C.weight),E.push(C.id)}),I.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const C=[0,0,0,0],Q=[0,0,0,0];I.forEach(function(w,x){let S=w,D=E[x];Q.forEach(function(M,O,z){if(S>M){z[O]=S,S=M;const Y=C[O];C[O]=D,D=Y}})}),E=C,I=Q}for(;I.length<4;)I.push(0),E.push(0);for(let C=0;C<4;++C)c.push(I[C]),l.push(E[C])}if(e.normal){const C=as(b,s,p,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(m=as(b,s,p,e.material)[0],m<0&&(d.negativeMaterialIndices=!0,m=0)),e.uv&&e.uv.forEach(function(C,Q){const w=as(b,s,p,C);h[Q]===void 0&&(h[Q]=[]),h[Q].push(w[0]),h[Q].push(w[1])}),a++,f&&(d.genFace(t,e,n,m,r,A,h,c,l,a),s++,a=0,n=[],r=[],A=[],h=[],c=[],l=[])}),t}getNormalNewell(e){const t=new U(0,0,0);for(let s=0;s<e.length;s++){const a=e[s],i=e[(s+1)%e.length];t.x+=(a.y-i.y)*(a.z+i.z),t.y+=(a.z-i.z)*(a.x+i.x),t.z+=(a.x-i.x)*(a.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),s=(Math.abs(t.z)>.5?new U(0,1,0):new U(0,0,1)).cross(t).normalize(),a=t.clone().cross(s).normalize();return{normal:t,tangent:s,bitangent:a}}flattenVertex(e,t,s){return new Ge(e.dot(t),e.dot(s))}genFace(e,t,s,a,i,n,r,A,h,c){let l;if(c>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let E=0;E<s.length;E+=3)d.push(new U(p[s[E]],p[s[E+1]],p[s[E+2]]));const{tangent:b,bitangent:m}=this.getNormalTangentAndBitangent(d),f=[];for(const E of d)f.push(this.flattenVertex(E,b,m));l=Vr.triangulateShape(f,[])}else c===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),l=[[0,1,2]]):l=[[0,1,2]];for(const[d,p,b]of l)e.vertex.push(t.vertexPositions[s[d*3]]),e.vertex.push(t.vertexPositions[s[d*3+1]]),e.vertex.push(t.vertexPositions[s[d*3+2]]),e.vertex.push(t.vertexPositions[s[p*3]]),e.vertex.push(t.vertexPositions[s[p*3+1]]),e.vertex.push(t.vertexPositions[s[p*3+2]]),e.vertex.push(t.vertexPositions[s[b*3]]),e.vertex.push(t.vertexPositions[s[b*3+1]]),e.vertex.push(t.vertexPositions[s[b*3+2]]),t.skeleton&&(e.vertexWeights.push(A[d*4]),e.vertexWeights.push(A[d*4+1]),e.vertexWeights.push(A[d*4+2]),e.vertexWeights.push(A[d*4+3]),e.vertexWeights.push(A[p*4]),e.vertexWeights.push(A[p*4+1]),e.vertexWeights.push(A[p*4+2]),e.vertexWeights.push(A[p*4+3]),e.vertexWeights.push(A[b*4]),e.vertexWeights.push(A[b*4+1]),e.vertexWeights.push(A[b*4+2]),e.vertexWeights.push(A[b*4+3]),e.weightsIndices.push(h[d*4]),e.weightsIndices.push(h[d*4+1]),e.weightsIndices.push(h[d*4+2]),e.weightsIndices.push(h[d*4+3]),e.weightsIndices.push(h[p*4]),e.weightsIndices.push(h[p*4+1]),e.weightsIndices.push(h[p*4+2]),e.weightsIndices.push(h[p*4+3]),e.weightsIndices.push(h[b*4]),e.weightsIndices.push(h[b*4+1]),e.weightsIndices.push(h[b*4+2]),e.weightsIndices.push(h[b*4+3])),t.color&&(e.colors.push(n[d*3]),e.colors.push(n[d*3+1]),e.colors.push(n[d*3+2]),e.colors.push(n[p*3]),e.colors.push(n[p*3+1]),e.colors.push(n[p*3+2]),e.colors.push(n[b*3]),e.colors.push(n[b*3+1]),e.colors.push(n[b*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(a),e.materialIndex.push(a),e.materialIndex.push(a)),t.normal&&(e.normal.push(i[d*3]),e.normal.push(i[d*3+1]),e.normal.push(i[d*3+2]),e.normal.push(i[p*3]),e.normal.push(i[p*3+1]),e.normal.push(i[p*3+2]),e.normal.push(i[b*3]),e.normal.push(i[b*3+1]),e.normal.push(i[b*3+2])),t.uv&&t.uv.forEach(function(m,f){e.uvs[f]===void 0&&(e.uvs[f]=[]),e.uvs[f].push(r[f][d*2]),e.uvs[f].push(r[f][d*2+1]),e.uvs[f].push(r[f][p*2]),e.uvs[f].push(r[f][p*2+1]),e.uvs[f].push(r[f][b*2]),e.uvs[f].push(r[f][b*2+1])})}addMorphTargets(e,t,s,a){if(s.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;s.forEach(function(n){n.rawTargets.forEach(function(r){const A=se.Objects.Geometry[r.geoID];A!==void 0&&i.genMorphGeometry(e,t,A,a,r.name)})})}genMorphGeometry(e,t,s,a,i){const n=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=s.Vertices!==void 0?s.Vertices.a:[],h=s.Indexes!==void 0?s.Indexes.a:[],c=e.attributes.position.count*3,l=new Float32Array(c);for(let m=0;m<h.length;m++){const f=h[m]*3;l[f]=A[m*3],l[f+1]=A[m*3+1],l[f+2]=A[m*3+2]}const d={vertexIndices:r,vertexPositions:l,baseVertexPositions:n},p=this.genBuffers(d),b=new _e(p.vertex,3);b.name=i||s.attrName,b.applyMatrix4(a),e.morphAttributes.position.push(b)}parseNormals(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,a=e.Normals.a;let i=[];return s==="IndexToDirect"&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:a,indices:i,mappingType:t,referenceType:s}}parseUVs(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,a=e.UV.a;let i=[];return s==="IndexToDirect"&&(i=e.UVIndex.a),{dataSize:2,buffer:a,indices:i,mappingType:t,referenceType:s}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,s=e.ReferenceInformationType,a=e.Colors.a;let i=[];s==="IndexToDirect"&&(i=e.ColorIndex.a);for(let n=0,r=new xe;n<a.length;n+=4)r.fromArray(a,n),Ye.colorSpaceToWorking(r,ge),r.toArray(a,n);return{dataSize:4,buffer:a,indices:i,mappingType:t,referenceType:s}}parseMaterialIndices(e){const t=e.MappingInformationType,s=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:s};const a=e.Materials.a,i=[];for(let n=0;n<a.length;++n)i.push(n);return{dataSize:1,buffer:a,indices:i,mappingType:t,referenceType:s}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new lt;const s=t-1,a=e.KnotVector.a,i=[],n=e.Points.a;for(let c=0,l=n.length;c<l;c+=4)i.push(new Qt().fromArray(n,c));let r,A;if(e.Form==="Closed")i.push(i[0]);else if(e.Form==="Periodic"){r=s,A=a.length-1-r;for(let c=0;c<s;++c)i.push(i[c])}const h=new Jl(s,a,i,r,A).getPoints(i.length*12);return new lt().setFromPoints(h)}}class Wl{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const s in t){const a=t[s],i=this.addClip(a);e.push(i)}return e}parseClips(){if(se.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=se.Objects.AnimationCurveNode,t=new Map;for(const s in e){const a=e[s];if(a.attrName.match(/S|R|T|DeformPercent/)!==null){const i={id:a.id,attr:a.attrName,curves:{}};t.set(i.id,i)}}return t}parseAnimationCurves(e){const t=se.Objects.AnimationCurve;for(const s in t){const a={id:t[s].id,times:t[s].KeyTime.a.map(ah),values:t[s].KeyValueFloat.a},i=ke.get(a.id);if(i!==void 0){const n=i.parents[0].ID,r=i.parents[0].relationship;r.match(/X/)?e.get(n).curves.x=a:r.match(/Y/)?e.get(n).curves.y=a:r.match(/Z/)?e.get(n).curves.z=a:r.match(/DeformPercent/)&&e.has(n)&&(e.get(n).curves.morph=a)}}}parseAnimationLayers(e){const t=se.Objects.AnimationLayer,s=new Map;for(const a in t){const i=[],n=ke.get(parseInt(a));n!==void 0&&(n.children.forEach(function(r,A){if(e.has(r.ID)){const h=e.get(r.ID);if(h.curves.x!==void 0||h.curves.y!==void 0||h.curves.z!==void 0){if(i[A]===void 0){const c=ke.get(r.ID).parents.filter(function(l){return l.relationship!==void 0})[0].ID;if(c!==void 0){const l=se.Objects.Model[c.toString()];if(l===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:l.attrName?Lt.sanitizeNodeName(l.attrName):"",ID:l.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Ze.traverse(function(p){p.ID===l.id&&(d.transform=p.matrix,p.userData.transformData&&(d.eulerOrder=p.userData.transformData.eulerOrder))}),d.transform||(d.transform=new de),"PreRotation"in l&&(d.preRotation=l.PreRotation.value),"PostRotation"in l&&(d.postRotation=l.PostRotation.value),i[A]=d}}i[A]&&(i[A][h.attr]=h)}else if(h.curves.morph!==void 0){if(i[A]===void 0){const c=ke.get(r.ID).parents.filter(function(f){return f.relationship!==void 0})[0].ID,l=ke.get(c).parents[0].ID,d=ke.get(l).parents[0].ID,p=ke.get(d).parents[0].ID,b=se.Objects.Model[p],m={modelName:b.attrName?Lt.sanitizeNodeName(b.attrName):"",morphName:se.Objects.Deformer[c].attrName};i[A]=m}i[A][h.attr]=h}}}),s.set(parseInt(a),i))}return s}parseAnimStacks(e){const t=se.Objects.AnimationStack,s={};for(const a in t){const i=ke.get(parseInt(a)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const n=e.get(i[0].ID);s[a]={name:t[a].attrName,layer:n}}return s}addClip(e){let t=[];const s=this;return e.layer.forEach(function(a){t=t.concat(s.generateTracks(a))}),new xi(e.name,-1,t)}generateTracks(e){const t=[];let s=new U,a=new U;if(e.transform&&e.transform.decompose(s,new De,a),s=s.toArray(),a=a.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,s,"position");i!==void 0&&t.push(i)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const i=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);i!==void 0&&t.push(i)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.S.curves,a,"scale");i!==void 0&&t.push(i)}if(e.DeformPercent!==void 0){const i=this.generateMorphTrack(e);i!==void 0&&t.push(i)}return t}generateVectorTrack(e,t,s,a){const i=this.getTimesForAllAxes(t),n=this.getKeyframeTrackValues(i,t,s);return new us(e+"."+a,i,n)}generateRotationTrack(e,t,s,a,i){let n,r;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const d=this.interpolateRotations(t.x,t.y,t.z,i);n=d[0],r=d[1]}const A=La(0);s!==void 0&&(s=s.map(we.degToRad),s.push(A),s=new Ht().fromArray(s),s=new De().setFromEuler(s)),a!==void 0&&(a=a.map(we.degToRad),a.push(A),a=new Ht().fromArray(a),a=new De().setFromEuler(a).invert());const h=new De,c=new Ht,l=[];if(!(!r||!n)){for(let d=0;d<r.length;d+=3)c.set(r[d],r[d+1],r[d+2],i),h.setFromEuler(c),s!==void 0&&h.premultiply(s),a!==void 0&&h.multiply(a),d>2&&new De().fromArray(l,(d-3)/3*4).dot(h)<0&&h.set(-h.x,-h.y,-h.z,-h.w),h.toArray(l,d/3*4);return new fs(e+".quaternion",n,l)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,s=t.values.map(function(i){return i/100}),a=Ze.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new bs(e.modelName+".morphTargetInfluences["+a+"]",t.times,s)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(s,a){return s-a}),t.length>1){let s=1,a=t[0];for(let i=1;i<t.length;i++){const n=t[i];n!==a&&(t[s]=n,a=n,s++)}t=t.slice(0,s)}return t}getKeyframeTrackValues(e,t,s){const a=s,i=[];let n=-1,r=-1,A=-1;return e.forEach(function(h){if(t.x&&(n=t.x.times.indexOf(h)),t.y&&(r=t.y.times.indexOf(h)),t.z&&(A=t.z.times.indexOf(h)),n!==-1){const c=t.x.values[n];i.push(c),a[0]=c}else i.push(a[0]);if(r!==-1){const c=t.y.values[r];i.push(c),a[1]=c}else i.push(a[1]);if(A!==-1){const c=t.z.values[A];i.push(c),a[2]=c}else i.push(a[2])}),i}interpolateRotations(e,t,s,a){const i=[],n=[];i.push(e.times[0]),n.push(we.degToRad(e.values[0])),n.push(we.degToRad(t.values[0])),n.push(we.degToRad(s.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],s.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const h=A.map(we.degToRad),c=[e.values[r],t.values[r],s.values[r]];if(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))continue;const l=c.map(we.degToRad),d=[c[0]-A[0],c[1]-A[1],c[2]-A[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){const b=Math.max(...p)/180,m=new Ht(...h,a),f=new Ht(...l,a),E=new De().setFromEuler(m),I=new De().setFromEuler(f);E.dot(I)&&I.set(-I.x,-I.y,-I.z,-I.w);const C=e.times[r-1],Q=e.times[r]-C,w=new De,x=new Ht;for(let S=0;S<1;S+=1/b)w.copy(E.clone().slerp(I.clone(),S)),i.push(C+S*Q),x.setFromQuaternion(w,a),n.push(x.x),n.push(x.y),n.push(x.z)}else i.push(e.times[r]),n.push(we.degToRad(e.values[r])),n.push(we.degToRad(t.values[r])),n.push(we.degToRad(s.values[r]))}return[i,n]}}class Zl{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new Uo,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,s=e.split(/[\r\n]+/);return s.forEach(function(a,i){const n=a.match(/^[\s\t]*;/),r=a.match(/^[\s\t]*$/);if(n||r)return;const A=a.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),h=a.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=a.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(a,A):h?t.parseNodeProperty(a,h,s[++i]):c?t.popStack():a.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(a)}),this.allNodes}parseNodeBegin(e,t){const s=t[1].trim().replace(/^"/,"").replace(/"$/,""),a=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:s},n=this.parseNodeAttr(a),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(s,i):s in r?(s==="PoseNode"?r.PoseNode.push(i):r[s].id!==void 0&&(r[s]={},r[s][r[s].id]=r[s]),n.id!==""&&(r[s][n.id]=i)):typeof n.id=="number"?(r[s]={},r[s][n.id]=i):s!=="Properties70"&&(s==="PoseNode"?r[s]=[i]:r[s]=i),typeof n.id=="number"&&(i.id=n.id),n.name!==""&&(i.attrName=n.name),n.type!==""&&(i.attrType=n.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let s="",a="";return e.length>1&&(s=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:s,type:a}}parseNodeProperty(e,t,s){let a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();a==="Content"&&i===","&&(i=s.replace(/"/g,"").replace(/,$/,"").trim());const n=this.getCurrentNode();if(n.name==="Properties70"){this.parseNodeSpecialProperty(e,a,i);return}if(a==="C"){const r=i.split(",").slice(1),A=parseInt(r[0]),h=parseInt(r[1]);let c=i.split(",").slice(3);c=c.map(function(l){return l.trim().replace(/^"/,"")}),a="connections",i=[A,h],ih(i,c),n[a]===void 0&&(n[a]=[])}a==="Node"&&(n.id=i),a in n&&Array.isArray(n[a])?n[a].push(i):a!=="a"?n[a]=i:n.a=i,this.setCurrentProp(n,a),a==="a"&&i.slice(-1)!==","&&(n.a=gi(i))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=gi(t.a))}parseNodeSpecialProperty(e,t,s){const a=s.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=a[0],n=a[1],r=a[2],A=a[3];let h=a[4];switch(n){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":h=parseFloat(h);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":h=gi(h);break}this.getPrevNode()[i]={type:n,type2:r,flag:A,value:h},this.setCurrentProp(this.getPrevNode(),i)}}class $l{parse(e){const t=new No(e);t.skip(23);const s=t.getUint32();if(s<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+s);const a=new Uo;for(;!this.endOfContent(t);){const i=this.parseNode(t,s);i!==null&&a.add(i.name,i)}return a}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const s={},a=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const n=e.getUint8(),r=e.getString(n);if(a===0)return null;const A=[];for(let d=0;d<i;d++)A.push(this.parseProperty(e));const h=A.length>0?A[0]:"",c=A.length>1?A[1]:"",l=A.length>2?A[2]:"";for(s.singleProperty=i===1&&e.getOffset()===a;a>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,s,d)}return s.propertyList=A,typeof h=="number"&&(s.id=h),c!==""&&(s.attrName=c),l!==""&&(s.attrType=l),r!==""&&(s.name=r),s}parseSubNode(e,t,s){if(s.singleProperty===!0){const a=s.propertyList[0];Array.isArray(a)?(t[s.name]=s,s.a=a):t[s.name]=a}else if(e==="Connections"&&s.name==="C"){const a=[];s.propertyList.forEach(function(i,n){n!==0&&a.push(i)}),t.connections===void 0&&(t.connections=[]),t.connections.push(a)}else if(s.name==="Properties70")Object.keys(s).forEach(function(a){t[a]=s[a]});else if(e==="Properties70"&&s.name==="P"){let a=s.propertyList[0],i=s.propertyList[1];const n=s.propertyList[2],r=s.propertyList[3];let A;a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),i==="Color"||i==="ColorRGB"||i==="Vector"||i==="Vector3D"||i.indexOf("Lcl_")===0?A=[s.propertyList[4],s.propertyList[5],s.propertyList[6]]:A=s.propertyList[4],t[a]={type:i,type2:n,flag:r,value:A}}else t[s.name]===void 0?typeof s.id=="number"?(t[s.name]={},t[s.name][s.id]=s):t[s.name]=s:s.name==="PoseNode"?(Array.isArray(t[s.name])||(t[s.name]=[t[s.name]]),t[s.name].push(s)):t[s.name][s.id]===void 0&&(t[s.name][s.id]=s)}parseProperty(e){const t=e.getString(1);let s;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return s=e.getUint32(),e.getArrayBuffer(s);case"S":return s=e.getUint32(),e.getString(s);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const a=e.getUint32(),i=e.getUint32(),n=e.getUint32();if(i===0)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}const r=Da(new Uint8Array(e.getArrayBuffer(n))),A=new No(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(a);case"d":return A.getFloat64Array(a);case"f":return A.getFloat32Array(a);case"i":return A.getInt32Array(a);case"l":return A.getInt64Array(a)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class No{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let s=0;s<e;s++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let s=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const a=s.indexOf(0);return a>=0&&(s=new Uint8Array(this.dv.buffer,t,a)),this._textDecoder.decode(s)}}class Uo{add(e,t){this[e]=t}}function eh(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===Oo(o,0,e.length)}function th(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function s(a){const i=o[a-1];return o=o.slice(t+a),t++,i}for(let a=0;a<e.length;++a)if(s(1)===e[a])return!1;return!0}function Po(o){const e=/FBXVersion: (\d+)/,t=o.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function ah(o){return o/46186158e3}const sh=[];function as(o,e,t,s){let a;switch(s.mappingType){case"ByPolygonVertex":a=o;break;case"ByPolygon":a=e;break;case"ByVertice":a=t;break;case"AllSame":a=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}s.referenceType==="IndexToDirect"&&(a=s.indices[a]);const i=a*s.dataSize,n=i+s.dataSize;return nh(sh,s.buffer,i,n)}const hi=new Ht,ga=new U;function Go(o){const e=new de,t=new de,s=new de,a=new de,i=new de,n=new de,r=new de,A=new de,h=new de,c=new de,l=new de,d=new de,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(ga.fromArray(o.translation));const b=La(0);if(o.preRotation){const z=o.preRotation.map(we.degToRad);z.push(b),t.makeRotationFromEuler(hi.fromArray(z))}if(o.rotation){const z=o.rotation.map(we.degToRad);z.push(o.eulerOrder||b),s.makeRotationFromEuler(hi.fromArray(z))}if(o.postRotation){const z=o.postRotation.map(we.degToRad);z.push(b),a.makeRotationFromEuler(hi.fromArray(z)),a.invert()}o.scale&&i.scale(ga.fromArray(o.scale)),o.scalingOffset&&r.setPosition(ga.fromArray(o.scalingOffset)),o.scalingPivot&&n.setPosition(ga.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(ga.fromArray(o.rotationOffset)),o.rotationPivot&&h.setPosition(ga.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(l.copy(o.parentMatrix),c.copy(o.parentMatrixWorld));const m=t.clone().multiply(s).multiply(a),f=new de;f.extractRotation(c);const E=new de;E.copyPosition(c);const I=E.clone().invert().multiply(c),C=f.clone().invert().multiply(I),Q=i,w=new de;if(p===0)w.copy(f).multiply(m).multiply(C).multiply(Q);else if(p===1)w.copy(f).multiply(C).multiply(m).multiply(Q);else{const z=new de().scale(new U().setFromMatrixScale(l)).clone().invert(),Y=C.clone().multiply(z);w.copy(f).multiply(m).multiply(Y).multiply(Q)}const x=h.clone().invert(),S=n.clone().invert();let D=e.clone().multiply(A).multiply(h).multiply(t).multiply(s).multiply(a).multiply(x).multiply(r).multiply(n).multiply(i).multiply(S);const M=new de().copyPosition(D),O=c.clone().multiply(M);return d.copyPosition(O),D=d.clone().multiply(w),D.premultiply(c.invert()),D}function La(o){o=o||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[o]}function gi(o){return o.split(",").map(function(e){return parseFloat(e)})}function Oo(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function ih(o,e){for(let t=0,s=o.length,a=e.length;t<a;t++,s++)o[s]=e[t]}function nh(o,e,t,s){for(let a=t,i=0;a<s;a++,i++)o[i]=e[a];return o}class oh extends Mt{constructor(e){super(e)}load(e,t,s,a){const i=this,n=this.path===""?Vt.extractUrlBase(e):this.path,r=new ut(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(i.parse(A,n))}catch(h){a?a(h):console.error(h),i.manager.itemError(e)}},s,a)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const s=e.split(`
442
+ `);let a={};const i=/\s+/,n={};for(let A=0;A<s.length;A++){let h=s[A];if(h=h.trim(),h.length===0||h.charAt(0)==="#")continue;const c=h.indexOf(" ");let l=c>=0?h.substring(0,c):h;l=l.toLowerCase();let d=c>=0?h.substring(c+1):"";if(d=d.trim(),l==="newmtl")a={name:d},n[d]=a;else if(l==="ka"||l==="kd"||l==="ks"||l==="ke"){const p=d.split(i,3);a[l]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else a[l]=d}const r=new rh(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(n),r}}class rh{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Si,this.wrap=this.options.wrap!==void 0?this.options.wrap:Wt}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const s in e){const a=e[s],i={};t[s]=i;for(const n in a){let r=!0,A=a[n];const h=n.toLowerCase();switch(h){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(A=[A[0]/255,A[1]/255,A[2]/255]),this.options&&this.options.ignoreZeroRGBs&&A[0]===0&&A[1]===0&&A[2]===0&&(r=!1);break}r&&(i[h]=A)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,s=this.materialsInfo[e],a={name:e,side:this.side};function i(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function n(r,A){if(a[r])return;const h=t.getTextureParams(A,a),c=t.loadTexture(i(t.baseUrl,h.url));c.repeat.copy(h.scale),c.offset.copy(h.offset),c.wrapS=t.wrap,c.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(c.colorSpace=ge),a[r]=c}for(const r in s){const A=s[r];let h;if(A!=="")switch(r.toLowerCase()){case"kd":a.color=Ye.colorSpaceToWorking(new xe().fromArray(A),ge);break;case"ks":a.specular=Ye.colorSpaceToWorking(new xe().fromArray(A),ge);break;case"ke":a.emissive=Ye.colorSpaceToWorking(new xe().fromArray(A),ge);break;case"map_kd":n("map",A);break;case"map_ks":n("specularMap",A);break;case"map_ke":n("emissiveMap",A);break;case"norm":n("normalMap",A);break;case"map_bump":case"bump":n("bumpMap",A);break;case"disp":n("displacementMap",A);break;case"map_d":n("alphaMap",A),a.transparent=!0;break;case"ns":a.shininess=parseFloat(A);break;case"d":h=parseFloat(A),h<1&&(a.opacity=h,a.transparent=!0);break;case"tr":h=parseFloat(A),this.options&&this.options.invertTrProperty&&(h=1-h),h>0&&(a.opacity=1-h,a.transparent=!0);break}}return this.materials[e]=new Ca(a),this.materials[e]}getTextureParams(e,t){const s={scale:new Ge(1,1),offset:new Ge(0,0)},a=e.split(/\s+/);let i;return i=a.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(a[i+1]),a.splice(i,2)),i=a.indexOf("-mm"),i>=0&&(t.displacementBias=parseFloat(a[i+1]),t.displacementScale=parseFloat(a[i+2]),a.splice(i,3)),i=a.indexOf("-s"),i>=0&&(s.scale.set(parseFloat(a[i+1]),parseFloat(a[i+2])),a.splice(i,4)),i=a.indexOf("-o"),i>=0&&(s.offset.set(parseFloat(a[i+1]),parseFloat(a[i+2])),a.splice(i,4)),s.url=a.join(" ").trim(),s}loadTexture(e,t,s,a,i){const n=this.manager!==void 0?this.manager:Wr;let r=n.getHandler(e);r===null&&(r=new rs(n)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,s,a,i);return t!==void 0&&(A.mapping=t),A}}const Ah=/^[og]\s*(.+)?/,ch=/^mtllib /,lh=/^usemtl /,hh=/^usemap /,jo=/\s+/,qo=new U,di=new U,Ho=new U,Ko=new U,gt=new U,ss=new xe;function gh(){const o={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const s=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(a,i){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const r={index:this.materials.length,name:a||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const h={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return h.clone=this.clone.bind(h),h}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(a){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),a&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return a&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},s&&s.name&&typeof s.clone=="function"){const a=s.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseNormalIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseUVIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/2)*2},addVertex:function(e,t,s){const a=this.vertices,i=this.object.geometry.vertices;i.push(a[e+0],a[e+1],a[e+2]),i.push(a[t+0],a[t+1],a[t+2]),i.push(a[s+0],a[s+1],a[s+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,s){const a=this.normals,i=this.object.geometry.normals;i.push(a[e+0],a[e+1],a[e+2]),i.push(a[t+0],a[t+1],a[t+2]),i.push(a[s+0],a[s+1],a[s+2])},addFaceNormal:function(e,t,s){const a=this.vertices,i=this.object.geometry.normals;qo.fromArray(a,e),di.fromArray(a,t),Ho.fromArray(a,s),gt.subVectors(Ho,di),Ko.subVectors(qo,di),gt.cross(Ko),gt.normalize(),i.push(gt.x,gt.y,gt.z),i.push(gt.x,gt.y,gt.z),i.push(gt.x,gt.y,gt.z)},addColor:function(e,t,s){const a=this.colors,i=this.object.geometry.colors;a[e]!==void 0&&i.push(a[e+0],a[e+1],a[e+2]),a[t]!==void 0&&i.push(a[t+0],a[t+1],a[t+2]),a[s]!==void 0&&i.push(a[s+0],a[s+1],a[s+2])},addUV:function(e,t,s){const a=this.uvs,i=this.object.geometry.uvs;i.push(a[e+0],a[e+1]),i.push(a[t+0],a[t+1]),i.push(a[s+0],a[s+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,s,a,i,n,r,A,h){const c=this.vertices.length;let l=this.parseVertexIndex(e,c),d=this.parseVertexIndex(t,c),p=this.parseVertexIndex(s,c);if(this.addVertex(l,d,p),this.addColor(l,d,p),r!==void 0&&r!==""){const b=this.normals.length;l=this.parseNormalIndex(r,b),d=this.parseNormalIndex(A,b),p=this.parseNormalIndex(h,b),this.addNormal(l,d,p)}else this.addFaceNormal(l,d,p);if(a!==void 0&&a!==""){const b=this.uvs.length;l=this.parseUVIndex(a,b),d=this.parseUVIndex(i,b),p=this.parseUVIndex(n,b),this.addUV(l,d,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let s=0,a=e.length;s<a;s++){const i=this.parseVertexIndex(e[s],t);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const s=this.vertices.length,a=this.uvs.length;for(let i=0,n=e.length;i<n;i++)this.addVertexLine(this.parseVertexIndex(e[i],s));for(let i=0,n=t.length;i<n;i++)this.addUVLine(this.parseUVIndex(t[i],a))}};return o.startObject("",!1),o}class dh extends Mt{constructor(e){super(e),this.materials=null,this.materialsLoader=new oh(e)}load(e,t,s,a){const i=this,n=new ut(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,async function(r){try{const A=i.parse(r,!0);for(let h=0,c=A.materialLibraries.length;h<c;h++){const l=A.materialLibraries[h];if(!l||typeof l!="string"||l.trim()===""){console.warn("THREE.OBJLoader: Invalid or empty material library reference, skipping.");continue}const d=e.startsWith("blob:")?e+"/"+l:new URL(l,e);console.debug("Loading MTL file: "+d),await new Promise((p,b)=>{i.materialsLoader.load(d.toString(),m=>{i.setMaterials(m),p()},null,b)})}t(i.createObjects(A))}catch(A){a?a(A):console.error(A),i.manager.itemError(e)}},s,a)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const s=new gh;e.indexOf(`\r
461
443
  `)!==-1&&(e=e.replace(/\r\n/g,`
462
444
  `)),e.indexOf(`\\
463
- `)!==-1&&(e=e.replace(/\\\n/g,""));const s=e.split(`
464
- `);let n=[];for(let a=0,r=s.length;a<r;a++){const A=s[a].trimStart();if(A.length===0)continue;const c=A.charAt(0);if(c!=="#")if(c==="v"){const l=A.split(Co);switch(l[0]){case"v":i.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(ai.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]),ce),i.colors.push(ai.r,ai.g,ai.b)):i.colors.push(void 0,void 0,void 0);break;case"vn":i.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":i.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(c==="f"){const l=A.slice(1).trim().split(Co),h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p];if(b.length>0){const m=b.split("/");h.push(m)}}const d=h[0];for(let p=1,f=h.length-1;p<f;p++){const b=h[p],m=h[p+1];i.addFace(d[0],b[0],m[0],d[1],b[1],m[1],d[2],b[2],m[2])}}else if(c==="l"){const l=A.substring(1).trim().split(" ");let h=[];const d=[];if(A.indexOf("/")===-1)h=l;else for(let p=0,f=l.length;p<f;p++){const b=l[p].split("/");b[0]!==""&&h.push(b[0]),b[1]!==""&&d.push(b[1])}i.addLineGeometry(h,d)}else if(c==="p"){const l=A.slice(1).trim().split(" ");i.addPointGeometry(l)}else if((n=ql.exec(A))!==null){const l=(" "+n[0].slice(1).trim()).slice(1);i.startObject(l)}else if(Yl.test(A))i.object.startMaterial(A.substring(7).trim(),i.materialLibraries);else if(zl.test(A))i.materialLibraries.push(A.substring(7).trim());else if(Kl.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(c==="s"){if(n=A.split(" "),n.length>1){const h=n[1].trim().toLowerCase();i.object.smooth=h!=="0"&&h!=="off"}else i.object.smooth=!0;const l=i.object.currentMaterial();l&&(l.smooth=i.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return i.finalize(),t?i:this.createObjects(i)}createObjects(e){const t=new Yt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let i=0,s=e.objects.length;i<s;i++){const n=e.objects[i],a=n.geometry,r=n.materials,A=a.type==="Line",c=a.type==="Points";let l=!1;if(a.vertices.length===0)continue;const h=new rt;h.setAttribute("position",new Te(a.vertices,3)),a.normals.length>0&&h.setAttribute("normal",new Te(a.normals,3)),a.colors.length>0&&(l=!0,h.setAttribute("color",new Te(a.colors,3))),a.hasUVIndices===!0&&h.setAttribute("uv",new Te(a.uvs,2));const d=[];for(let f=0,b=r.length;f<b;f++){const m=r[f],I=m.name+"_"+m.smooth+"_"+l;let E=e.materials[I];if(this.materials!==null){if(E=this.materials.create(m.name),A&&E&&!(E instanceof St)){const C=new St;ds.prototype.copy.call(C,E),C.color.copy(E.color),E=C}else if(c&&E&&!(E instanceof gs)){const C=new gs({size:10,sizeAttenuation:!1});ds.prototype.copy.call(C,E),C.color.copy(E.color),C.map=E.map,E=C}}E===void 0&&(A?E=new St:c?E=new gs({size:1,sizeAttenuation:!1}):E=new ms,E.name=m.name,E.flatShading=!m.smooth,E.vertexColors=l,e.materials[I]=E),d.push(E)}let p;if(d.length>1){for(let f=0,b=r.length;f<b;f++){const m=r[f];h.addGroup(m.groupStart,m.groupCount,f)}A?p=new Us(h,d):c?p=new Gs(h,d):p=new O(h,d)}else A?p=new Us(h,d[0]):c?p=new Gs(h,d[0]):p=new O(h,d[0]);p.name=n.name,t.add(p)}else if(e.vertices.length>0){const i=new gs({size:1,sizeAttenuation:!1}),s=new rt;s.setAttribute("position",new Te(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(s.setAttribute("color",new Te(e.colors,3)),i.vertexColors=!0);const n=new Gs(s,i);t.add(n)}return t}}class Wl{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Sn(-1,1,1,-1,0,1);class Xl extends rt{constructor(){super(),this.setAttribute("position",new Te([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Te([0,2,0,0,2,0],2))}}new Xl;export{rA as DRACOLoader,sc as EXRLoader,Rl as FBXLoader,Qa as Font,_A as FontLoader,rn as GLTFExporter,Si as GLTFLoader,Qr as GroundedSkybox,ml as HTMLMesh,Sc as HorizontalBlurShader,El as InteractiveGroup,lt as KTX2Loader,fl as Line2,lo as LineGeometry,ln as LineMaterial,oA as MeshoptDecoder,Vl as OBJLoader,pc as OrbitControls,Wl as Pass,xc as PositionalAudioHelper,ic as RGBELoader,Cs as Stats,FA as TextGeometry,nc as TransformControls,za as TransformControlsGizmo,Cl as VertexNormalsHelper,Dc as VerticalBlurShader,ll as XRControllerModelFactory,gl as XRHandMeshModel,yr as mergeVertices,wa as nodeFrame,$i as strToU8,tc as zipSync};
445
+ `)!==-1&&(e=e.replace(/\\\n/g,""));const a=e.split(`
446
+ `);let i=[];for(let n=0,r=a.length;n<r;n++){const A=a[n].trimStart();if(A.length===0)continue;const h=A.charAt(0);if(h!=="#")if(h==="v"){const c=A.split(jo);switch(c[0]){case"v":s.vertices.push(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3])),c.length>=7?(ss.setRGB(parseFloat(c[4]),parseFloat(c[5]),parseFloat(c[6]),ge),s.colors.push(ss.r,ss.g,ss.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3]));break;case"vt":s.uvs.push(parseFloat(c[1]),parseFloat(c[2]));break}}else if(h==="f"){const c=A.slice(1).trim().split(jo),l=[];for(let p=0,b=c.length;p<b;p++){const m=c[p];if(m.length>0){const f=m.split("/");l.push(f)}}const d=l[0];for(let p=1,b=l.length-1;p<b;p++){const m=l[p],f=l[p+1];s.addFace(d[0],m[0],f[0],d[1],m[1],f[1],d[2],m[2],f[2])}}else if(h==="l"){const c=A.substring(1).trim().split(" ");let l=[];const d=[];if(A.indexOf("/")===-1)l=c;else for(let p=0,b=c.length;p<b;p++){const m=c[p].split("/");m[0]!==""&&l.push(m[0]),m[1]!==""&&d.push(m[1])}s.addLineGeometry(l,d)}else if(h==="p"){const c=A.slice(1).trim().split(" ");s.addPointGeometry(c)}else if((i=Ah.exec(A))!==null){const c=(" "+i[0].slice(1).trim()).slice(1);s.startObject(c)}else if(lh.test(A))s.object.startMaterial(A.substring(7).trim(),s.materialLibraries);else if(ch.test(A))s.materialLibraries.push(A.substring(7).trim());else if(hh.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=A.split(" "),i.length>1){const l=i[1].trim().toLowerCase();s.object.smooth=l!=="0"&&l!=="off"}else s.object.smooth=!0;const c=s.object.currentMaterial();c&&(c.smooth=s.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return s.finalize(),t?s:this.createObjects(s)}createObjects(e){const t=new Zt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let s=0,a=e.objects.length;s<a;s++){const i=e.objects[s],n=i.geometry,r=i.materials,A=n.type==="Line",h=n.type==="Points";let c=!1;if(n.vertices.length===0)continue;const l=new lt;l.setAttribute("position",new _e(n.vertices,3)),n.normals.length>0&&l.setAttribute("normal",new _e(n.normals,3)),n.colors.length>0&&(c=!0,l.setAttribute("color",new _e(n.colors,3))),n.hasUVIndices===!0&&l.setAttribute("uv",new _e(n.uvs,2));const d=[];for(let b=0,m=r.length;b<m;b++){const f=r[b],E=f.name+"_"+f.smooth+"_"+c;let I=e.materials[E];if(this.materials!==null){if(I=this.materials.create(f.name),A&&I&&!(I instanceof _t)){const C=new _t;ma.prototype.copy.call(C,I),C.color.copy(I.color),I=C}else if(h&&I&&!(I instanceof fa)){const C=new fa({size:10,sizeAttenuation:!1});ma.prototype.copy.call(C,I),C.color.copy(I.color),C.map=I.map,I=C}}I===void 0&&(A?I=new _t:h?I=new fa({size:1,sizeAttenuation:!1}):I=new Ca,I.name=f.name,I.flatShading=!f.smooth,I.vertexColors=c,e.materials[E]=I),d.push(I)}let p;if(d.length>1){for(let b=0,m=r.length;b<m;b++){const f=r[b];l.addGroup(f.groupStart,f.groupCount,b)}A?p=new Pa(l,d):h?p=new Ga(l,d):p=new j(l,d)}else A?p=new Pa(l,d[0]):h?p=new Ga(l,d[0]):p=new j(l,d[0]);p.name=i.name,t.add(p)}else if(e.vertices.length>0){const s=new fa({size:1,sizeAttenuation:!1}),a=new lt;a.setAttribute("position",new _e(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(a.setAttribute("color",new _e(e.colors,3)),s.vertexColors=!0);const i=new Ga(a,s);t.add(i)}return t}}class ph{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Qi(-1,1,1,-1,0,1);class uh extends lt{constructor(){super(),this.setAttribute("position",new _e([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new _e([0,2,0,0,2,0],2))}}new uh;export{_A as DRACOLoader,mc as EXRLoader,Yl as FBXLoader,zn as Font,WA as FontLoader,Fa as GLTFExporter,Ds as GLTFLoader,Zr as GroundedSkybox,Ec as HDRLoader,Ml as HTMLMesh,Hc as HorizontalBlurShader,Ul as InteractiveGroup,dt as KTX2Loader,Fl as Line2,ko as LineGeometry,oi as LineMaterial,MA as MeshoptDecoder,dh as OBJLoader,Rc as OrbitControls,ph as Pass,qc as PositionalAudioHelper,ya as Stats,VA as TextGeometry,Ic as TransformControls,po as TransformControlsGizmo,Pl as VertexNormalsHelper,Kc as VerticalBlurShader,xl as XRControllerModelFactory,Sl as XRHandMeshModel,$r as mergeVertices,Kn as nodeFrame,$s as strToU8,fc as zipSync};