@markforster/heroquest-card-creator 0.6.2 → 0.7.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 (67) hide show
  1. package/out/404/index.html +2 -2
  2. package/out/404.html +2 -2
  3. package/out/_next/static/MCjz6tB5cDKjwYnkGDUah/_buildManifest.js +1 -0
  4. package/out/_next/static/chunks/11-aa6151b8a7487661.js +1 -0
  5. package/out/_next/static/chunks/117-32c4808da693e8a2.js +2 -0
  6. package/out/_next/static/chunks/208-82e58e6e4ba19c92.js +67 -0
  7. package/out/_next/static/chunks/315-55df286699f8b0e8.js +6 -0
  8. package/out/_next/static/chunks/421.41f21f5dfd414f63.js +1 -0
  9. package/out/_next/static/chunks/78-a62212fe1e976626.js +1 -0
  10. package/out/_next/static/chunks/901.26b72b54a20a237e.js +1 -0
  11. package/out/_next/static/chunks/924.2204e4941500ca44.js +1 -0
  12. package/out/_next/static/chunks/app/_not-found/page-cd0b8419e04bbf6b.js +1 -0
  13. package/out/_next/static/chunks/app/layout-ff6d2e61fb935b5c.js +1 -0
  14. package/out/_next/static/chunks/app/{page-08b2fe5702248cbe.js → page-cc0cc1a7d8239b11.js} +1 -1
  15. package/out/_next/static/chunks/{b536a0f1-15fcb22ec48614b3.js → b536a0f1-cae9e701de820869.js} +1 -1
  16. package/out/_next/static/chunks/{cb7556af-09dea4d6aa6606ba.js → cb7556af-561f1379df3518e9.js} +1 -1
  17. package/out/_next/static/chunks/fd9d1056-b7d67a92dad1d910.js +1 -0
  18. package/out/_next/static/chunks/framework-00a8ba1a63cfdc9e.js +1 -0
  19. package/out/_next/static/chunks/main-6ca21b4ba1c31341.js +1 -0
  20. package/out/_next/static/chunks/main-app-f06b48d9d592854a.js +1 -0
  21. package/out/_next/static/chunks/pages/_app-15e2daefa259f0b5.js +1 -0
  22. package/out/_next/static/chunks/pages/_error-28b803cb2479b966.js +1 -0
  23. package/out/_next/static/chunks/webpack-8acc9381d06a0317.js +1 -0
  24. package/out/_next/static/css/{349a5194958ca88d.css → 51c5daab4b3c5d98.css} +1 -1
  25. package/out/_next/static/css/d4f81156468795e7.css +1 -0
  26. package/out/_next/static/media/blueprint.10d46645.png +0 -0
  27. package/out/_next/static/media/bordered-mask.d506f676.png +0 -0
  28. package/out/_next/static/media/hero-back-border-and-text.0ba5cc66.png +0 -0
  29. package/out/_next/static/media/hero-back.838c0783.png +0 -0
  30. package/out/_next/static/media/parchment.450c71a4.png +0 -0
  31. package/out/_next/static/media/small-large-artwork-border-alpha-mask.9e1a274f.png +0 -0
  32. package/out/_next/static/media/small-large-artwork-border-blend-texture.b866e77e.png +0 -0
  33. package/out/_next/static/media/white-paper.b4831d18.png +0 -0
  34. package/out/_next/static/media/window-parchment.8f31db79.png +0 -0
  35. package/out/index.html +2 -2
  36. package/out/index.txt +10 -10
  37. package/out/sitemap.xml +1 -1
  38. package/package.json +2 -1
  39. package/out/_next/static/3aTEh4dDeqfON2qaXlzzM/_buildManifest.js +0 -1
  40. package/out/_next/static/chunks/11-78f479f14159541f.js +0 -1
  41. package/out/_next/static/chunks/117-02a1c5ab3bdda11d.js +0 -2
  42. package/out/_next/static/chunks/315-7d0c6c19cd998998.js +0 -6
  43. package/out/_next/static/chunks/421.f7d6805b56f50951.js +0 -1
  44. package/out/_next/static/chunks/470-f4093940b23b4005.js +0 -67
  45. package/out/_next/static/chunks/78-a0d1b28fa720d8c8.js +0 -1
  46. package/out/_next/static/chunks/901.97c805b54bd60aa3.js +0 -1
  47. package/out/_next/static/chunks/924.4a054bc97175666b.js +0 -1
  48. package/out/_next/static/chunks/app/_not-found/page-721e0182aa7da8b9.js +0 -1
  49. package/out/_next/static/chunks/app/layout-a407b7d5f0f75f95.js +0 -1
  50. package/out/_next/static/chunks/fd9d1056-524802b9ec96d394.js +0 -1
  51. package/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
  52. package/out/_next/static/chunks/main-5e42ad27df38cdd8.js +0 -1
  53. package/out/_next/static/chunks/main-app-0b6a7f5b2fb24b40.js +0 -1
  54. package/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
  55. package/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
  56. package/out/_next/static/chunks/webpack-2acf2b1ed69a3b7c.js +0 -1
  57. package/out/_next/static/css/83dce68ef19674c6.css +0 -1
  58. package/out/_next/static/media/blueprint.73c53722.png +0 -0
  59. package/out/_next/static/media/bordered-mask.82dc793a.png +0 -0
  60. package/out/_next/static/media/hero-back-border-and-text.59765c87.png +0 -0
  61. package/out/_next/static/media/hero-back.af5738a7.png +0 -0
  62. package/out/_next/static/media/parchment.622421f4.png +0 -0
  63. package/out/_next/static/media/small-large-artwork-border-alpha-mask.410ecda3.png +0 -0
  64. package/out/_next/static/media/small-large-artwork-border-blend-texture.002a2faa.png +0 -0
  65. package/out/_next/static/media/white-paper.b80839b0.png +0 -0
  66. package/out/_next/static/media/window-parchment.4e3e14fd.png +0 -0
  67. /package/out/_next/static/{3aTEh4dDeqfON2qaXlzzM → MCjz6tB5cDKjwYnkGDUah}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[689],{1448:function(e,t,i){let n,r,a,s,o;i.r(t),i.d(t,{ACESFilmicToneMapping:function(){return eh},AddEquation:function(){return C},AddOperation:function(){return er},AdditiveAnimationBlendMode:function(){return tF},AdditiveBlending:function(){return T},AgXToneMapping:function(){return ec},AlphaFormat:function(){return ej},AlwaysCompare:function(){return i_},AlwaysDepth:function(){return Z},AlwaysStencilFunc:function(){return il},AmbientLight:function(){return cl},AnimationAction:function(){return c$},AnimationClip:function(){return uG},AnimationLoader:function(){return uK},AnimationMixer:function(){return c0},AnimationObjectGroup:function(){return cK},AnimationUtils:function(){return uP},ArcCurve:function(){return hp},ArrayCamera:function(){return oU},ArrowHelper:function(){return dD},AttachedBindMode:function(){return ep},Audio:function(){return cN},AudioAnalyser:function(){return ck},AudioContext:function(){return cM},AudioListener:function(){return cU},AudioLoader:function(){return cS},AxesHelper:function(){return dO},BackSide:function(){return y},BasicDepthPacking:function(){return tV},BasicShadowMap:function(){return m},BatchedMesh:function(){return lq},Bone:function(){return lg},BooleanKeyframeTrack:function(){return uO},Box2:function(){return dr},Box3:function(){return np},Box3Helper:function(){return dL},BoxGeometry:function(){return an},BoxHelper:function(){return dI},BufferAttribute:function(){return rP},BufferGeometry:function(){return rq},BufferGeometryLoader:function(){return cm},ByteType:function(){return eD},Cache:function(){return uW},Camera:function(){return ah},CameraHelper:function(){return dC},CanvasTexture:function(){return hu},CapsuleGeometry:function(){return hN},CatmullRomCurve3:function(){return hx},CineonToneMapping:function(){return el},CircleGeometry:function(){return hD},ClampToEdgeWrapping:function(){return eS},Clock:function(){return cA},Color:function(){return rx},ColorKeyframeTrack:function(){return uF},ColorManagement:function(){return i3},CompressedArrayTexture:function(){return hl},CompressedCubeTexture:function(){return hh},CompressedTexture:function(){return ho},CompressedTextureLoader:function(){return u$},ConeGeometry:function(){return hF},ConstantAlphaFactor:function(){return j},ConstantColorFactor:function(){return W},CubeCamera:function(){return af},CubeReflectionMapping:function(){return eg},CubeRefractionMapping:function(){return e_},CubeTexture:function(){return am},CubeTextureLoader:function(){return u0},CubeUVReflectionMapping:function(){return ey},CubicBezierCurve:function(){return hb},CubicBezierCurve3:function(){return hT},CubicInterpolant:function(){return uL},CullFaceBack:function(){return d},CullFaceFront:function(){return p},CullFaceFrontBack:function(){return f},CullFaceNone:function(){return c},Curve:function(){return hc},CurvePath:function(){return hI},CustomBlending:function(){return A},CustomToneMapping:function(){return eu},CylinderGeometry:function(){return hO},Cylindrical:function(){return dt},Data3DTexture:function(){return no},DataArrayTexture:function(){return na},DataTexture:function(){return l_},DataTextureLoader:function(){return u1},DataUtils:function(){return rA},DecrementStencilOp:function(){return t6},DecrementWrapStencilOp:function(){return t9},DefaultLoadingManager:function(){return uj},DepthFormat:function(){return eK},DepthStencilFormat:function(){return e$},DepthTexture:function(){return a7},DetachedBindMode:function(){return ef},DirectionalLight:function(){return co},DirectionalLightHelper:function(){return dw},DiscreteInterpolant:function(){return uN},DisplayP3ColorSpace:function(){return tJ},DodecahedronGeometry:function(){return hz},DoubleSide:function(){return M},DstAlphaFactor:function(){return z},DstColorFactor:function(){return V},DynamicCopyUsage:function(){return iw},DynamicDrawUsage:function(){return ix},DynamicReadUsage:function(){return iS},EdgesGeometry:function(){return hW},EllipseCurve:function(){return hd},EqualCompare:function(){return ic},EqualDepth:function(){return $},EqualStencilFunc:function(){return ii},EquirectangularReflectionMapping:function(){return ev},EquirectangularRefractionMapping:function(){return ex},Euler:function(){return nJ},EventDispatcher:function(){return iI},ExtrudeGeometry:function(){return ut},FileLoader:function(){return uJ},Float16BufferAttribute:function(){return rB},Float32BufferAttribute:function(){return rz},FloatType:function(){return ek},Fog:function(){return oq},FogExp2:function(){return oj},FramebufferTexture:function(){return hs},FrontSide:function(){return x},Frustum:function(){return ab},GLBufferAttribute:function(){return c5},GLSL1:function(){return iA},GLSL3:function(){return iC},GreaterCompare:function(){return ip},GreaterDepth:function(){return ee},GreaterEqualCompare:function(){return ig},GreaterEqualDepth:function(){return Q},GreaterEqualStencilFunc:function(){return io},GreaterStencilFunc:function(){return ia},GridHelper:function(){return dy},Group:function(){return oN},HalfFloatType:function(){return eV},HemisphereLight:function(){return u4},HemisphereLightHelper:function(){return dx},IcosahedronGeometry:function(){return un},ImageBitmapLoader:function(){return cy},ImageLoader:function(){return uQ},ImageUtils:function(){return i6},IncrementStencilOp:function(){return t5},IncrementWrapStencilOp:function(){return t8},InstancedBufferAttribute:function(){return lM},InstancedBufferGeometry:function(){return cf},InstancedInterleavedBuffer:function(){return c4},InstancedMesh:function(){return lR},Int16BufferAttribute:function(){return rN},Int32BufferAttribute:function(){return rO},Int8BufferAttribute:function(){return rI},IntType:function(){return eB},InterleavedBuffer:function(){return oZ},InterleavedBufferAttribute:function(){return oK},Interpolant:function(){return uI},InterpolateDiscrete:function(){return tP},InterpolateLinear:function(){return tI},InterpolateSmooth:function(){return tL},InvertStencilOp:function(){return t7},KeepStencilOp:function(){return t3},KeyframeTrack:function(){return uD},LOD:function(){return la},LatheGeometry:function(){return hU},Layers:function(){return nK},LessCompare:function(){return iu},LessDepth:function(){return J},LessEqualCompare:function(){return id},LessEqualDepth:function(){return K},LessEqualStencilFunc:function(){return ir},LessStencilFunc:function(){return it},Light:function(){return u3},LightProbe:function(){return cc},Line:function(){return l2},Line3:function(){return dl},LineBasicMaterial:function(){return lY},LineCurve:function(){return hw},LineCurve3:function(){return hE},LineDashedMaterial:function(){return uT},LineLoop:function(){return l8},LineSegments:function(){return l6},LinearDisplayP3ColorSpace:function(){return tK},LinearFilter:function(){return eR},LinearInterpolant:function(){return uU},LinearMipMapLinearFilter:function(){return eU},LinearMipMapNearestFilter:function(){return eI},LinearMipmapLinearFilter:function(){return eL},LinearMipmapNearestFilter:function(){return eP},LinearSRGBColorSpace:function(){return tZ},LinearToneMapping:function(){return es},LinearTransfer:function(){return t$},Loader:function(){return uq},LoaderUtils:function(){return cp},LoadingManager:function(){return uX},LoopOnce:function(){return tA},LoopPingPong:function(){return tR},LoopRepeat:function(){return tC},LuminanceAlphaFormat:function(){return eJ},LuminanceFormat:function(){return eZ},MOUSE:function(){return h},Material:function(){return rS},MaterialLoader:function(){return cd},MathUtils:function(){return iH},Matrix2:function(){return di},Matrix3:function(){return iW},Matrix4:function(){return nk},MaxEquation:function(){return L},Mesh:function(){return at},MeshBasicMaterial:function(){return rb},MeshDepthMaterial:function(){return ow},MeshDistanceMaterial:function(){return oE},MeshLambertMaterial:function(){return uS},MeshMatcapMaterial:function(){return ub},MeshNormalMaterial:function(){return uM},MeshPhongMaterial:function(){return ux},MeshPhysicalMaterial:function(){return uv},MeshStandardMaterial:function(){return u_},MeshToonMaterial:function(){return uy},MinEquation:function(){return I},MirroredRepeatWrapping:function(){return eb},MixOperation:function(){return en},MultiplyBlending:function(){return E},MultiplyOperation:function(){return ei},NearestFilter:function(){return eT},NearestMipMapLinearFilter:function(){return eC},NearestMipMapNearestFilter:function(){return eE},NearestMipmapLinearFilter:function(){return eA},NearestMipmapNearestFilter:function(){return ew},NeutralToneMapping:function(){return ed},NeverCompare:function(){return ih},NeverDepth:function(){return Y},NeverStencilFunc:function(){return ie},NoBlending:function(){return S},NoColorSpace:function(){return tq},NoToneMapping:function(){return ea},NormalAnimationBlendMode:function(){return tO},NormalBlending:function(){return b},NotEqualCompare:function(){return im},NotEqualDepth:function(){return et},NotEqualStencilFunc:function(){return is},NumberKeyframeTrack:function(){return uB},Object3D:function(){return rn},ObjectLoader:function(){return cg},ObjectSpaceNormalMap:function(){return tj},OctahedronGeometry:function(){return ur},OneFactor:function(){return N},OneMinusConstantAlphaFactor:function(){return q},OneMinusConstantColorFactor:function(){return X},OneMinusDstAlphaFactor:function(){return k},OneMinusDstColorFactor:function(){return H},OneMinusSrcAlphaFactor:function(){return B},OneMinusSrcColorFactor:function(){return O},OrthographicCamera:function(){return az},P3Primaries:function(){return t1},PCFShadowMap:function(){return g},PCFSoftShadowMap:function(){return _},PMREMGenerator:function(){return aJ},Path:function(){return hL},PerspectiveCamera:function(){return ap},Plane:function(){return ay},PlaneGeometry:function(){return aE},PlaneHelper:function(){return dU},PointLight:function(){return ca},PointLightHelper:function(){return dm},Points:function(){return hn},PointsMaterial:function(){return l9},PolarGridHelper:function(){return dM},PolyhedronGeometry:function(){return hB},PositionalAudio:function(){return cz},PropertyBinding:function(){return cJ},PropertyMixer:function(){return cV},QuadraticBezierCurve:function(){return hA},QuadraticBezierCurve3:function(){return hC},Quaternion:function(){return nh},QuaternionKeyframeTrack:function(){return uk},QuaternionLinearInterpolant:function(){return uz},RED_GREEN_RGTC2_Format:function(){return tw},RED_RGTC1_Format:function(){return tb},REVISION:function(){return l},RGBADepthPacking:function(){return tH},RGBAFormat:function(){return eY},RGBAIntegerFormat:function(){return e4},RGBA_ASTC_10x10_Format:function(){return t_},RGBA_ASTC_10x5_Format:function(){return tf},RGBA_ASTC_10x6_Format:function(){return tm},RGBA_ASTC_10x8_Format:function(){return tg},RGBA_ASTC_12x10_Format:function(){return tv},RGBA_ASTC_12x12_Format:function(){return tx},RGBA_ASTC_4x4_Format:function(){return ts},RGBA_ASTC_5x4_Format:function(){return to},RGBA_ASTC_5x5_Format:function(){return tl},RGBA_ASTC_6x5_Format:function(){return th},RGBA_ASTC_6x6_Format:function(){return tu},RGBA_ASTC_8x5_Format:function(){return tc},RGBA_ASTC_8x6_Format:function(){return td},RGBA_ASTC_8x8_Format:function(){return tp},RGBA_BPTC_Format:function(){return ty},RGBA_ETC2_EAC_Format:function(){return ta},RGBA_PVRTC_2BPPV1_Format:function(){return ti},RGBA_PVRTC_4BPPV1_Format:function(){return tt},RGBA_S3TC_DXT1_Format:function(){return e6},RGBA_S3TC_DXT3_Format:function(){return e8},RGBA_S3TC_DXT5_Format:function(){return e9},RGBDepthPacking:function(){return tG},RGBFormat:function(){return eq},RGBIntegerFormat:function(){return e3},RGB_BPTC_SIGNED_Format:function(){return tM},RGB_BPTC_UNSIGNED_Format:function(){return tS},RGB_ETC1_Format:function(){return tn},RGB_ETC2_Format:function(){return tr},RGB_PVRTC_2BPPV1_Format:function(){return te},RGB_PVRTC_4BPPV1_Format:function(){return e7},RGB_S3TC_DXT1_Format:function(){return e5},RGDepthPacking:function(){return tW},RGFormat:function(){return e1},RGIntegerFormat:function(){return e2},RawShaderMaterial:function(){return ug},Ray:function(){return nz},Raycaster:function(){return c8},Rec709Primaries:function(){return t0},RectAreaLight:function(){return ch},RedFormat:function(){return eQ},RedIntegerFormat:function(){return e0},ReinhardToneMapping:function(){return eo},RenderTarget:function(){return nn},RepeatWrapping:function(){return eM},ReplaceStencilOp:function(){return t4},ReverseSubtractEquation:function(){return P},RingGeometry:function(){return ua},SIGNED_RED_GREEN_RGTC2_Format:function(){return tE},SIGNED_RED_RGTC1_Format:function(){return tT},SRGBColorSpace:function(){return tY},SRGBTransfer:function(){return tQ},Scene:function(){return oY},ShaderChunk:function(){return aA},ShaderLib:function(){return aR},ShaderMaterial:function(){return al},ShadowMaterial:function(){return um},Shape:function(){return hX},ShapeGeometry:function(){return us},ShapePath:function(){return dF},ShapeUtils:function(){return h9},ShortType:function(){return eO},Skeleton:function(){return ly},SkeletonHelper:function(){return df},SkinnedMesh:function(){return lm},Source:function(){return i9},Sphere:function(){return nI},SphereGeometry:function(){return uo},Spherical:function(){return de},SphericalHarmonics3:function(){return cu},SplineCurve:function(){return hR},SpotLight:function(){return ce},SpotLightHelper:function(){return du},Sprite:function(){return lt},SpriteMaterial:function(){return o$},SrcAlphaFactor:function(){return F},SrcAlphaSaturateFactor:function(){return G},SrcColorFactor:function(){return D},StaticCopyUsage:function(){return iT},StaticDrawUsage:function(){return iv},StaticReadUsage:function(){return iM},StereoCamera:function(){return cE},StreamCopyUsage:function(){return iE},StreamDrawUsage:function(){return iy},StreamReadUsage:function(){return ib},StringKeyframeTrack:function(){return uV},SubtractEquation:function(){return R},SubtractiveBlending:function(){return w},TOUCH:function(){return u},TangentSpaceNormalMap:function(){return tX},TetrahedronGeometry:function(){return ul},Texture:function(){return nt},TextureLoader:function(){return u2},TextureUtils:function(){return oP},TorusGeometry:function(){return uh},TorusKnotGeometry:function(){return uu},Triangle:function(){return rf},TriangleFanDrawMode:function(){return tk},TriangleStripDrawMode:function(){return tz},TrianglesDrawMode:function(){return tB},TubeGeometry:function(){return uc},UVMapping:function(){return em},Uint16BufferAttribute:function(){return rD},Uint32BufferAttribute:function(){return rF},Uint8BufferAttribute:function(){return rL},Uint8ClampedBufferAttribute:function(){return rU},Uniform:function(){return c1},UniformsGroup:function(){return c3},UniformsLib:function(){return aC},UniformsUtils:function(){return ao},UnsignedByteType:function(){return eN},UnsignedInt248Type:function(){return eW},UnsignedInt5999Type:function(){return eX},UnsignedIntType:function(){return ez},UnsignedShort4444Type:function(){return eH},UnsignedShort5551Type:function(){return eG},UnsignedShortType:function(){return eF},VSMShadowMap:function(){return v},Vector2:function(){return iG},Vector3:function(){return nu},Vector4:function(){return ni},VectorKeyframeTrack:function(){return uH},VideoTexture:function(){return ha},WebGL3DRenderTarget:function(){return nl},WebGLArrayRenderTarget:function(){return ns},WebGLCoordinateSystem:function(){return iR},WebGLCubeRenderTarget:function(){return ag},WebGLMultipleRenderTargets:function(){return dB},WebGLRenderTarget:function(){return nr},WebGLRenderer:function(){return oX},WebGLUtils:function(){return oL},WebGPUCoordinateSystem:function(){return iP},WireframeGeometry:function(){return ud},WrapAroundEnding:function(){return tD},ZeroCurvatureEnding:function(){return tU},ZeroFactor:function(){return U},ZeroSlopeEnding:function(){return tN},ZeroStencilOp:function(){return t2},createCanvasElement:function(){return iJ}});let l="167",h={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},u={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},c=0,d=1,p=2,f=3,m=0,g=1,_=2,v=3,x=0,y=1,M=2,S=0,b=1,T=2,w=3,E=4,A=5,C=100,R=101,P=102,I=103,L=104,U=200,N=201,D=202,O=203,F=204,B=205,z=206,k=207,V=208,H=209,G=210,W=211,X=212,j=213,q=214,Y=0,Z=1,J=2,K=3,$=4,Q=5,ee=6,et=7,ei=0,en=1,er=2,ea=0,es=1,eo=2,el=3,eh=4,eu=5,ec=6,ed=7,ep="attached",ef="detached",em=300,eg=301,e_=302,ev=303,ex=304,ey=306,eM=1e3,eS=1001,eb=1002,eT=1003,ew=1004,eE=1004,eA=1005,eC=1005,eR=1006,eP=1007,eI=1007,eL=1008,eU=1008,eN=1009,eD=1010,eO=1011,eF=1012,eB=1013,ez=1014,ek=1015,eV=1016,eH=1017,eG=1018,eW=1020,eX=35902,ej=1021,eq=1022,eY=1023,eZ=1024,eJ=1025,eK=1026,e$=1027,eQ=1028,e0=1029,e1=1030,e2=1031,e3=1032,e4=1033,e5=33776,e6=33777,e8=33778,e9=33779,e7=35840,te=35841,tt=35842,ti=35843,tn=36196,tr=37492,ta=37496,ts=37808,to=37809,tl=37810,th=37811,tu=37812,tc=37813,td=37814,tp=37815,tf=37816,tm=37817,tg=37818,t_=37819,tv=37820,tx=37821,ty=36492,tM=36494,tS=36495,tb=36283,tT=36284,tw=36285,tE=36286,tA=2200,tC=2201,tR=2202,tP=2300,tI=2301,tL=2302,tU=2400,tN=2401,tD=2402,tO=2500,tF=2501,tB=0,tz=1,tk=2,tV=3200,tH=3201,tG=3202,tW=3203,tX=0,tj=1,tq="",tY="srgb",tZ="srgb-linear",tJ="display-p3",tK="display-p3-linear",t$="linear",tQ="srgb",t0="rec709",t1="p3",t2=0,t3=7680,t4=7681,t5=7682,t6=7683,t8=34055,t9=34056,t7=5386,ie=512,it=513,ii=514,ir=515,ia=516,is=517,io=518,il=519,ih=512,iu=513,ic=514,id=515,ip=516,im=517,ig=518,i_=519,iv=35044,ix=35048,iy=35040,iM=35045,iS=35049,ib=35041,iT=35046,iw=35050,iE=35042,iA="100",iC="300 es",iR=2e3,iP=2001;class iI{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e);e.target=null}}}let iL=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],iU=1234567,iN=Math.PI/180,iD=180/Math.PI;function iO(){let e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(iL[255&e]+iL[e>>8&255]+iL[e>>16&255]+iL[e>>24&255]+"-"+iL[255&t]+iL[t>>8&255]+"-"+iL[t>>16&15|64]+iL[t>>24&255]+"-"+iL[63&i|128]+iL[i>>8&255]+"-"+iL[i>>16&255]+iL[i>>24&255]+iL[255&n]+iL[n>>8&255]+iL[n>>16&255]+iL[n>>24&255]).toLowerCase()}function iF(e,t,i){return Math.max(t,Math.min(i,e))}function iB(e,t){return(e%t+t)%t}function iz(e,t,i){return(1-i)*e+i*t}function ik(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function iV(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let iH={DEG2RAD:iN,RAD2DEG:iD,generateUUID:iO,clamp:iF,euclideanModulo:iB,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:iz,damp:function(e,t,i,n){return iz(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(iB(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(iU=e);let t=iU+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*iN},radToDeg:function(e){return e*iD},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,i,n,r){let a=Math.cos,s=Math.sin,o=a(i/2),l=s(i/2),h=a((t+n)/2),u=s((t+n)/2),c=a((t-n)/2),d=s((t-n)/2),p=a((n-t)/2),f=s((n-t)/2);switch(r){case"XYX":e.set(o*u,l*c,l*d,o*h);break;case"YZY":e.set(l*d,o*u,l*c,o*h);break;case"ZXZ":e.set(l*c,l*d,o*u,o*h);break;case"XZX":e.set(o*u,l*f,l*p,o*h);break;case"YXY":e.set(l*p,o*u,l*f,o*h);break;case"ZYZ":e.set(l*f,l*p,o*u,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:iV,denormalize:ik};class iG{constructor(e=0,t=0){iG.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iF(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class iW{constructor(e,t,i,n,r,a,s,o,l){iW.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,s,o,l)}set(e,t,i,n,r,a,s,o,l){let h=this.elements;return h[0]=e,h[1]=n,h[2]=s,h[3]=t,h[4]=r,h[5]=o,h[6]=i,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[3],o=i[6],l=i[1],h=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],_=n[1],v=n[4],x=n[7],y=n[2],M=n[5],S=n[8];return r[0]=a*f+s*_+o*y,r[3]=a*m+s*v+o*M,r[6]=a*g+s*x+o*S,r[1]=l*f+h*_+u*y,r[4]=l*m+h*v+u*M,r[7]=l*g+h*x+u*S,r[2]=c*f+d*_+p*y,r[5]=c*m+d*v+p*M,r[8]=c*g+d*x+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8];return t*a*h-t*s*l-i*r*h+i*s*o+n*r*l-n*a*o}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=h*a-s*l,c=s*o-h*r,d=l*r-a*o,p=t*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=u*f,e[1]=(n*l-h*i)*f,e[2]=(s*i-n*a)*f,e[3]=c*f,e[4]=(h*t-n*o)*f,e[5]=(n*r-s*t)*f,e[6]=d*f,e[7]=(i*o-l*t)*f,e[8]=(a*t-i*r)*f,this}transpose(){let e;let t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*a+l*s)+a+e,-n*l,n*o,-n*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(iX.makeScale(e,t)),this}rotate(e){return this.premultiply(iX.makeRotation(-e)),this}translate(e,t){return this.premultiply(iX.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let iX=new iW;function ij(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let iq={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iY(e,t){return new iq[e](t)}function iZ(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function iJ(){let e=iZ("canvas");return e.style.display="block",e}let iK={};function i$(e){e in iK||(iK[e]=!0,console.warn(e))}let iQ=new iW().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),i0=new iW().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),i1={[tZ]:{transfer:t$,primaries:t0,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[tY]:{transfer:tQ,primaries:t0,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[tK]:{transfer:t$,primaries:t1,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(i0),fromReference:e=>e.applyMatrix3(iQ)},[tJ]:{transfer:tQ,primaries:t1,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(i0),fromReference:e=>e.applyMatrix3(iQ).convertLinearToSRGB()}},i2=new Set([tZ,tK]),i3={enabled:!0,_workingColorSpace:tZ,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!i2.has(colorSpace))throw Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;let n=i1[t].toReference;return(0,i1[i].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return i1[e].primaries},getTransfer:function(e){return e===tq?t$:i1[e].transfer},getLuminanceCoefficients:function(e,t=this._workingColorSpace){return e.fromArray(i1[t].luminanceCoefficients)}};function i4(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function i5(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class i6{static getDataURL(e){let t;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===n&&(n=iZ("canvas")),n.width=e.width,n.height=e.height;let i=n.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=n}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=iZ("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e<r.length;e++)r[e]=255*i4(r[e]/255);return i.putImageData(n,0,0),t}if(!e.data)return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*i4(t[e]/255)):t[e]=i4(t[e]);return{data:t,width:e.width,height:e.height}}}}let i8=0;class i9{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:i8++}),this.uuid=iO(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(i7(n[t].image)):e.push(i7(n[t]))}else e=i7(n);i.url=e}return t||(e.images[this.uuid]=i),i}}function i7(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?i6.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ne=0;class nt extends iI{constructor(e=nt.DEFAULT_IMAGE,t=nt.DEFAULT_MAPPING,i=eS,n=eS,r=eR,a=eL,s=eY,o=eN,l=nt.DEFAULT_ANISOTROPY,h=tq){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ne++}),this.uuid=iO(),this.name="",this.source=new i9(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new iG(0,0),this.repeat=new iG(1,1),this.center=new iG(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new iW,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==em)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eM:e.x=e.x-Math.floor(e.x);break;case eS:e.x=e.x<0?0:1;break;case eb:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case eM:e.y=e.y-Math.floor(e.y);break;case eS:e.y=e.y<0?0:1;break;case eb:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}nt.DEFAULT_IMAGE=null,nt.DEFAULT_MAPPING=em,nt.DEFAULT_ANISOTROPY=1;class ni{constructor(e=0,t=0,i=0,n=1){ni.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;let a=e.elements,s=a[0],o=a[4],l=a[8],h=a[1],u=a[5],c=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-h)&&.01>Math.abs(l-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(o+h)&&.1>Math.abs(l+d)&&.1>Math.abs(c+p)&&.1>Math.abs(s+u+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(u+1)/2,m=(f+1)/2,g=(o+h)/4,_=(l+d)/4,v=(c+p)/4;return e>a&&e>m?e<.01?(i=0,n=.707106781,r=.707106781):(n=g/(i=Math.sqrt(e)),r=_/i):a>m?a<.01?(i=.707106781,n=0,r=.707106781):(i=g/(n=Math.sqrt(a)),r=v/n):m<.01?(i=.707106781,n=.707106781,r=0):(i=_/(r=Math.sqrt(m)),n=v/r),this.set(i,n,r,t),this}let m=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(h-o)*(h-o));return .001>Math.abs(m)&&(m=1),this.x=(p-c)/m,this.y=(l-d)/m,this.z=(h-o)/m,this.w=Math.acos((s+u+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class nn extends iI{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ni(0,0,e,t),this.scissorTest=!1,this.viewport=new ni(0,0,e,t);let n=new nt({width:e,height:t,depth:1},(i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:eR,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i)).mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);n.flipY=!1,n.generateMipmaps=i.generateMipmaps,n.internalFormat=i.internalFormat,this.textures=[];let r=i.count;for(let e=0;e<r;e++)this.textures[e]=n.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.textures.length;n<r;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new i9(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class nr extends nn{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class na extends nt{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ns extends nr{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new na(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class no extends nt{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nl extends nr{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new no(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class nh{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,r,a,s){let o=i[n+0],l=i[n+1],h=i[n+2],u=i[n+3],c=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s){e[t+0]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u;return}if(1===s){e[t+0]=c,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(u!==f||o!==c||l!==d||h!==p){let e=1-s,t=o*c+l*d+h*p+u*f,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){let r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,s=Math.sin(s*a)/r}let r=s*i;if(o=o*e+c*r,l=l*e+d*r,h=h*e+p*r,u=u*e+f*r,e===1-s){let e=1/Math.sqrt(o*o+l*l+h*h+u*u);o*=e,l*=e,h*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,n,r,a){let s=i[n],o=i[n+1],l=i[n+2],h=i[n+3],u=r[a],c=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+h*u+o*d-l*c,e[t+1]=o*p+h*c+l*u-s*d,e[t+2]=l*p+h*d+s*c-o*u,e[t+3]=h*p-s*u-o*c-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(i/2),h=s(n/2),u=s(r/2),c=o(i/2),d=o(n/2),p=o(r/2);switch(a){case"XYZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"YXZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"ZXY":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"ZYX":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"YZX":this._x=c*h*u+l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u-c*d*p;break;case"XZY":this._x=c*h*u-l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],h=t[6],u=t[10],c=i+s+u;if(c>0){let e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(h-o)*e,this._y=(r-l)*e,this._z=(a-n)*e}else if(i>s&&i>u){let e=2*Math.sqrt(1+i-s-u);this._w=(h-o)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+l)/e}else if(s>u){let e=2*Math.sqrt(1+s-i-u);this._w=(r-l)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(o+h)/e}else{let e=2*Math.sqrt(1+u-i-s);this._w=(a-n)/e,this._x=(r+l)/e,this._y=(o+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(iF(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);return 0===i||this.slerp(e,Math.min(1,t/i)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,h=t._w;return this._x=i*h+a*s+n*l-r*o,this._y=n*h+a*o+r*s-i*l,this._z=r*h+a*l+i*o-n*s,this._w=a*h-i*s-n*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,n=this._y,r=this._z,a=this._w,s=a*e._w+i*e._x+n*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}let l=Math.sqrt(o),h=Math.atan2(l,s),u=Math.sin((1-t)*h)/l,c=Math.sin(t*h)/l;return this._w=a*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class nu{constructor(e=0,t=0,i=0){nu.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(nd.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nd.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*n-s*i),h=2*(s*t-r*n),u=2*(r*i-a*t);return this.x=t+o*l+a*u-s*h,this.y=i+o*h+s*l-r*u,this.z=n+o*u+r*h-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=n*o-r*s,this.y=r*a-i*o,this.z=i*s-n*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return nc.copy(this).projectOnVector(e),this.sub(nc)}reflect(e){return this.sub(nc.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iF(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let nc=new nu,nd=new nh;class np{constructor(e=new nu(Infinity,Infinity,Infinity),t=new nu(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(nm.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(nm.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=nm.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(void 0!==i){let n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,i=n.count;t<i;t++)!0===e.isMesh?e.getVertexPosition(t,nm):nm.fromBufferAttribute(n,t),nm.applyMatrix4(e.matrixWorld),this.expandByPoint(nm);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),ng.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),ng.copy(i.boundingBox)),ng.applyMatrix4(e.matrixWorld),this.union(ng)}let n=e.children;for(let e=0,i=n.length;e<i;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,nm),nm.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nb),nT.subVectors(this.max,nb),n_.subVectors(e.a,nb),nv.subVectors(e.b,nb),nx.subVectors(e.c,nb),ny.subVectors(nv,n_),nM.subVectors(nx,nv),nS.subVectors(n_,nx);let t=[0,-ny.z,ny.y,0,-nM.z,nM.y,0,-nS.z,nS.y,ny.z,0,-ny.x,nM.z,0,-nM.x,nS.z,0,-nS.x,-ny.y,ny.x,0,-nM.y,nM.x,0,-nS.y,nS.x,0];return!!(nA(t,n_,nv,nx,nT)&&nA(t=[1,0,0,0,1,0,0,0,1],n_,nv,nx,nT))&&(nw.crossVectors(ny,nM),nA(t=[nw.x,nw.y,nw.z],n_,nv,nx,nT))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,nm).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(nm).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(nf[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nf[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nf[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nf[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nf[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nf[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nf[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nf[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nf)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let nf=[new nu,new nu,new nu,new nu,new nu,new nu,new nu,new nu],nm=new nu,ng=new np,n_=new nu,nv=new nu,nx=new nu,ny=new nu,nM=new nu,nS=new nu,nb=new nu,nT=new nu,nw=new nu,nE=new nu;function nA(e,t,i,n,r){for(let a=0,s=e.length-3;a<=s;a+=3){nE.fromArray(e,a);let s=r.x*Math.abs(nE.x)+r.y*Math.abs(nE.y)+r.z*Math.abs(nE.z),o=t.dot(nE),l=i.dot(nE),h=n.dot(nE);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>s)return!1}return!0}let nC=new np,nR=new nu,nP=new nu;class nI{constructor(e=new nu,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):nC.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;t<r;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;nR.subVectors(e,this.center);let t=nR.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=(e-this.radius)*.5;this.center.addScaledVector(nR,i/e),this.radius+=i}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(nP.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(nR.copy(e.center).add(nP)),this.expandByPoint(nR.copy(e.center).sub(nP)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let nL=new nu,nU=new nu,nN=new nu,nD=new nu,nO=new nu,nF=new nu,nB=new nu;class nz{constructor(e=new nu,t=new nu(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,nL)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=nL.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nL.copy(this.origin).addScaledVector(this.direction,t),nL.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){let r,a,s,o;nU.copy(e).add(t).multiplyScalar(.5),nN.copy(t).sub(e).normalize(),nD.copy(this.origin).sub(nU);let l=.5*e.distanceTo(t),h=-this.direction.dot(nN),u=nD.dot(this.direction),c=-nD.dot(nN),d=nD.lengthSq(),p=Math.abs(1-h*h);if(p>0){if(r=h*c-u,a=h*u-c,o=l*p,r>=0){if(a>=-o){if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+h*a+2*u)+a*(h*r+a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=l)+u)))*r+a*(a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=-l)+u)))*r+a*(a+2*c)+d}else a<=-o?(a=(r=Math.max(0,-(-h*l+u)))>0?-l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-c),l))*(a+2*c)+d):(a=(r=Math.max(0,-(h*l+u)))>0?l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d)}else a=h>0?-l:l,s=-(r=Math.max(0,-(h*a+u)))*r+a*(a+2*c)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,r),n&&n.copy(nU).addScaledVector(nN,a),s}intersectSphere(e,t){nL.subVectors(e.center,this.origin);let i=nL.dot(this.direction),n=nL.dot(nL)-i*i,r=e.radius*e.radius;if(n>r)return null;let a=Math.sqrt(r-n),s=i-a,o=i+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let i,n,r,a,s,o;let l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(l>=0?(i=(e.min.x-c.x)*l,n=(e.max.x-c.x)*l):(i=(e.max.x-c.x)*l,n=(e.min.x-c.x)*l),h>=0?(r=(e.min.y-c.y)*h,a=(e.max.y-c.y)*h):(r=(e.max.y-c.y)*h,a=(e.min.y-c.y)*h),i>a||r>n)?null:((r>i||isNaN(i))&&(i=r),(a<n||isNaN(n))&&(n=a),u>=0?(s=(e.min.z-c.z)*u,o=(e.max.z-c.z)*u):(s=(e.max.z-c.z)*u,o=(e.min.z-c.z)*u),i>o||s>n)?null:((s>i||i!=i)&&(i=s),(o<n||n!=n)&&(n=o),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,nL)}intersectTriangle(e,t,i,n,r){let a;nO.subVectors(t,e),nF.subVectors(i,e),nB.crossVectors(nO,nF);let s=this.direction.dot(nB);if(s>0){if(n)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}nD.subVectors(this.origin,e);let o=a*this.direction.dot(nF.crossVectors(nD,nF));if(o<0)return null;let l=a*this.direction.dot(nO.cross(nD));if(l<0||o+l>s)return null;let h=-a*nD.dot(nB);return h<0?null:this.at(h/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class nk{constructor(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m){nk.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m)}set(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=h,g[10]=u,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new nk().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/nV.setFromMatrixColumn(e,0).length(),r=1/nV.setFromMatrixColumn(e,1).length(),a=1/nV.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),h=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=-o*u,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=n+i*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e+r*s,t[4]=n*s-i,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-s,t[2]=i*s-n,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=n+i*s,t[1]=i+n*s,t[5]=a*h,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=r-e*u,t[8]=n*u+i,t[1]=u,t[5]=a*h,t[9]=-s*h,t[2]=-l*h,t[6]=i*u+n,t[10]=e-r*u}else if("XZY"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=-u,t[8]=l*h,t[1]=e*u+r,t[5]=a*h,t[9]=i*u-n,t[2]=n*u-i,t[6]=s*h,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nG,e,nW)}lookAt(e,t,i){let n=this.elements;return nq.subVectors(e,t),0===nq.lengthSq()&&(nq.z=1),nq.normalize(),nX.crossVectors(i,nq),0===nX.lengthSq()&&(1===Math.abs(i.z)?nq.x+=1e-4:nq.z+=1e-4,nq.normalize(),nX.crossVectors(i,nq)),nX.normalize(),nj.crossVectors(nq,nX),n[0]=nX.x,n[4]=nj.x,n[8]=nq.x,n[1]=nX.y,n[5]=nj.y,n[9]=nq.y,n[2]=nX.z,n[6]=nj.z,n[10]=nq.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[4],o=i[8],l=i[12],h=i[1],u=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],_=i[3],v=i[7],x=i[11],y=i[15],M=n[0],S=n[4],b=n[8],T=n[12],w=n[1],E=n[5],A=n[9],C=n[13],R=n[2],P=n[6],I=n[10],L=n[14],U=n[3],N=n[7],D=n[11],O=n[15];return r[0]=a*M+s*w+o*R+l*U,r[4]=a*S+s*E+o*P+l*N,r[8]=a*b+s*A+o*I+l*D,r[12]=a*T+s*C+o*L+l*O,r[1]=h*M+u*w+c*R+d*U,r[5]=h*S+u*E+c*P+d*N,r[9]=h*b+u*A+c*I+d*D,r[13]=h*T+u*C+c*L+d*O,r[2]=p*M+f*w+m*R+g*U,r[6]=p*S+f*E+m*P+g*N,r[10]=p*b+f*A+m*I+g*D,r[14]=p*T+f*C+m*L+g*O,r[3]=_*M+v*w+x*R+y*U,r[7]=_*S+v*E+x*P+y*N,r[11]=_*b+v*A+x*I+y*D,r[15]=_*T+v*C+x*L+y*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],h=e[2],u=e[6],c=e[10],d=e[14],p=e[3];return p*(+r*o*u-n*l*u-r*s*c+i*l*c+n*s*d-i*o*d)+e[7]*(+t*o*d-t*l*c+r*a*c-n*a*d+n*l*h-r*o*h)+e[11]*(+t*l*u-t*s*d-r*a*u+i*a*d+r*s*h-i*l*h)+e[15]*(-n*s*h-t*o*u+t*s*c+n*a*u-i*a*c+i*o*h)}transpose(){let e;let t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],_=u*m*l-f*c*l+f*o*d-s*m*d-u*o*g+s*c*g,v=p*c*l-h*m*l-p*o*d+a*m*d+h*o*g-a*c*g,x=h*f*l-p*u*l+p*s*d-a*f*d-h*s*g+a*u*g,y=p*u*o-h*f*o-p*s*c+a*f*c+h*s*m-a*u*m,M=t*_+i*v+n*x+r*y;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/M;return e[0]=_*S,e[1]=(f*c*r-u*m*r-f*n*d+i*m*d+u*n*g-i*c*g)*S,e[2]=(s*m*r-f*o*r+f*n*l-i*m*l-s*n*g+i*o*g)*S,e[3]=(u*o*r-s*c*r-u*n*l+i*c*l+s*n*d-i*o*d)*S,e[4]=v*S,e[5]=(h*m*r-p*c*r+p*n*d-t*m*d-h*n*g+t*c*g)*S,e[6]=(p*o*r-a*m*r-p*n*l+t*m*l+a*n*g-t*o*g)*S,e[7]=(a*c*r-h*o*r+h*n*l-t*c*l-a*n*d+t*o*d)*S,e[8]=x*S,e[9]=(p*u*r-h*f*r-p*i*d+t*f*d+h*i*g-t*u*g)*S,e[10]=(a*f*r-p*s*r+p*i*l-t*f*l-a*i*g+t*s*g)*S,e[11]=(h*s*r-a*u*r-h*i*l+t*u*l+a*i*d-t*s*d)*S,e[12]=y*S,e[13]=(h*f*n-p*u*n+p*i*c-t*f*c-h*i*m+t*u*m)*S,e[14]=(p*s*n-a*f*n-p*i*o+t*f*o+a*i*m-t*s*m)*S,e[15]=(a*u*n-h*s*n+h*i*o-t*u*o-a*i*c+t*s*c)*S,this}scale(e){let t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,s=e.y,o=e.z,l=r*a,h=r*s;return this.set(l*a+i,l*s-n*o,l*o+n*s,0,l*s+n*o,h*s+i,h*o-n*a,0,l*o-n*s,h*o+n*a,r*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,h=a+a,u=s+s,c=r*l,d=r*h,p=r*u,f=a*h,m=a*u,g=s*u,_=o*l,v=o*h,x=o*u,y=i.x,M=i.y,S=i.z;return n[0]=(1-(f+g))*y,n[1]=(d+x)*y,n[2]=(p-v)*y,n[3]=0,n[4]=(d-x)*M,n[5]=(1-(c+g))*M,n[6]=(m+_)*M,n[7]=0,n[8]=(p+v)*S,n[9]=(m-_)*S,n[10]=(1-(c+f))*S,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,r=nV.set(n[0],n[1],n[2]).length(),a=nV.set(n[4],n[5],n[6]).length(),s=nV.set(n[8],n[9],n[10]).length();0>this.determinant()&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],nH.copy(this);let o=1/r,l=1/a,h=1/s;return nH.elements[0]*=o,nH.elements[1]*=o,nH.elements[2]*=o,nH.elements[4]*=l,nH.elements[5]*=l,nH.elements[6]*=l,nH.elements[8]*=h,nH.elements[9]*=h,nH.elements[10]*=h,t.setFromRotationMatrix(nH),i.x=r,i.y=a,i.z=s,this}makePerspective(e,t,i,n,r,a,s=iR){let o,l;let h=this.elements;if(s===iR)o=-(a+r)/(a-r),l=-2*a*r/(a-r);else if(s===iP)o=-a/(a-r),l=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return h[0]=2*r/(t-e),h[4]=0,h[8]=(t+e)/(t-e),h[12]=0,h[1]=0,h[5]=2*r/(i-n),h[9]=(i+n)/(i-n),h[13]=0,h[2]=0,h[6]=0,h[10]=o,h[14]=l,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,n,r,a,s=iR){let o,l;let h=this.elements,u=1/(t-e),c=1/(i-n),d=1/(a-r);if(s===iR)o=(a+r)*d,l=-2*d;else if(s===iP)o=r*d,l=-1*d;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-((t+e)*u),h[1]=0,h[5]=2*c,h[9]=0,h[13]=-((i+n)*c),h[2]=0,h[6]=0,h[10]=l,h[14]=-o,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}let nV=new nu,nH=new nk,nG=new nu(0,0,0),nW=new nu(1,1,1),nX=new nu,nj=new nu,nq=new nu,nY=new nk,nZ=new nh;class nJ{constructor(e=0,t=0,i=0,n=nJ.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let n=e.elements,r=n[0],a=n[4],s=n[8],o=n[1],l=n[5],h=n[9],u=n[2],c=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(iF(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-iF(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(iF(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-iF(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(iF(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-iF(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(c,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return nY.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nY,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return nZ.setFromEuler(this),this.setFromQuaternion(nZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nJ.DEFAULT_ORDER="XYZ";class nK{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&(1<<e|0))!=0}}let n$=0,nQ=new nu,n0=new nh,n1=new nk,n2=new nu,n3=new nu,n4=new nu,n5=new nh,n6=new nu(1,0,0),n8=new nu(0,1,0),n9=new nu(0,0,1),n7={type:"added"},re={type:"removed"},rt={type:"childadded",child:null},ri={type:"childremoved",child:null};class rn extends iI{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:n$++}),this.uuid=iO(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rn.DEFAULT_UP.clone();let e=new nu,t=new nJ,i=new nh,n=new nu(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new nk},normalMatrix:{value:new iW}}),this.matrix=new nk,this.matrixWorld=new nk,this.matrixAutoUpdate=rn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new nK,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return n0.setFromAxisAngle(e,t),this.quaternion.multiply(n0),this}rotateOnWorldAxis(e,t){return n0.setFromAxisAngle(e,t),this.quaternion.premultiply(n0),this}rotateX(e){return this.rotateOnAxis(n6,e)}rotateY(e){return this.rotateOnAxis(n8,e)}rotateZ(e){return this.rotateOnAxis(n9,e)}translateOnAxis(e,t){return nQ.copy(e).applyQuaternion(this.quaternion),this.position.add(nQ.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(n6,e)}translateY(e){return this.translateOnAxis(n8,e)}translateZ(e){return this.translateOnAxis(n9,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(n1.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?n2.copy(e):n2.set(e,t,i);let n=this.parent;this.updateWorldMatrix(!0,!1),n3.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?n1.lookAt(n3,n2,this.up):n1.lookAt(n2,n3,this.up),this.quaternion.setFromRotationMatrix(n1),n&&(n1.extractRotation(n.matrixWorld),n0.setFromRotationMatrix(n1),this.quaternion.premultiply(n0.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(n7),rt.child=e,this.dispatchEvent(rt),rt.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(re),ri.child=e,this.dispatchEvent(ri),ri.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),n1.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),n1.multiply(e.parent.matrixWorld)),e.applyMatrix4(n1),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(n7),rt.child=e,this.dispatchEvent(rt),rt.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);let n=this.children;for(let r=0,a=n.length;r<a;r++)n[r].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n3,e,n4),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n3,n5,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map(e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()})),n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){let n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material){if(Array.isArray(this.material)){let t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material)}if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){let t=a(e.geometries),n=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),h=a(e.animations),u=a(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h),u.length>0&&(i.nodes=u)}return i.object=n,i;function a(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let i=e.children[t];this.add(i.clone())}return this}}rn.DEFAULT_UP=new nu(0,1,0),rn.DEFAULT_MATRIX_AUTO_UPDATE=!0,rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let rr=new nu,ra=new nu,rs=new nu,ro=new nu,rl=new nu,rh=new nu,ru=new nu,rc=new nu,rd=new nu,rp=new nu;class rf{constructor(e=new nu,t=new nu,i=new nu){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),rr.subVectors(e,t),n.cross(rr);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){rr.subVectors(n,t),ra.subVectors(i,t),rs.subVectors(e,t);let a=rr.dot(rr),s=rr.dot(ra),o=rr.dot(rs),l=ra.dot(ra),h=ra.dot(rs),u=a*l-s*s;if(0===u)return r.set(0,0,0),null;let c=1/u,d=(l*o-s*h)*c,p=(a*h-s*o)*c;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,ro)&&ro.x>=0&&ro.y>=0&&ro.x+ro.y<=1}static getInterpolation(e,t,i,n,r,a,s,o){return null===this.getBarycoord(e,t,i,n,ro)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ro.x),o.addScaledVector(a,ro.y),o.addScaledVector(s,ro.z),o)}static isFrontFacing(e,t,i,n){return rr.subVectors(i,t),ra.subVectors(e,t),0>rr.cross(ra).dot(n)}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return rr.subVectors(this.c,this.b),ra.subVectors(this.a,this.b),.5*rr.cross(ra).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return rf.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return rf.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,r){return rf.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return rf.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return rf.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,n;let r=this.a,a=this.b,s=this.c;rl.subVectors(a,r),rh.subVectors(s,r),rc.subVectors(e,r);let o=rl.dot(rc),l=rh.dot(rc);if(o<=0&&l<=0)return t.copy(r);rd.subVectors(e,a);let h=rl.dot(rd),u=rh.dot(rd);if(h>=0&&u<=h)return t.copy(a);let c=o*u-h*l;if(c<=0&&o>=0&&h<=0)return i=o/(o-h),t.copy(r).addScaledVector(rl,i);rp.subVectors(e,s);let d=rl.dot(rp),p=rh.dot(rp);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),t.copy(r).addScaledVector(rh,n);let m=h*p-d*u;if(m<=0&&u-h>=0&&d-p>=0)return ru.subVectors(s,a),n=(u-h)/(u-h+(d-p)),t.copy(a).addScaledVector(ru,n);let g=1/(m+f+c);return i=f*g,n=c*g,t.copy(r).addScaledVector(rl,i).addScaledVector(rh,n)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let rm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rg={h:0,s:0,l:0},r_={h:0,s:0,l:0};function rv(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*6*(2/3-i):e}class rx{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){return void 0===t&&void 0===i?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,i),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=tY){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,i3.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=i3.workingColorSpace){return this.r=e,this.g=t,this.b=i,i3.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=i3.workingColorSpace){if(e=iB(e,1),t=iF(t,0,1),i=iF(i,0,1),0===t)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=rv(r,n,e+1/3),this.g=rv(r,n,e),this.b=rv(r,n,e-1/3)}return i3.toWorkingColorSpace(this,n),this}setStyle(e,t=tY){let i;function n(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;let a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=tY){let i=rm[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=i4(e.r),this.g=i4(e.g),this.b=i4(e.b),this}copyLinearToSRGB(e){return this.r=i5(e.r),this.g=i5(e.g),this.b=i5(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tY){return i3.fromWorkingColorSpace(ry.copy(this),e),65536*Math.round(iF(255*ry.r,0,255))+256*Math.round(iF(255*ry.g,0,255))+Math.round(iF(255*ry.b,0,255))}getHexString(e=tY){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=i3.workingColorSpace){let i,n;i3.fromWorkingColorSpace(ry.copy(this),t);let r=ry.r,a=ry.g,s=ry.b,o=Math.max(r,a,s),l=Math.min(r,a,s),h=(l+o)/2;if(l===o)i=0,n=0;else{let e=o-l;switch(n=h<=.5?e/(o+l):e/(2-o-l),o){case r:i=(a-s)/e+(a<s?6:0);break;case a:i=(s-r)/e+2;break;case s:i=(r-a)/e+4}i/=6}return e.h=i,e.s=n,e.l=h,e}getRGB(e,t=i3.workingColorSpace){return i3.fromWorkingColorSpace(ry.copy(this),t),e.r=ry.r,e.g=ry.g,e.b=ry.b,e}getStyle(e=tY){i3.fromWorkingColorSpace(ry.copy(this),e);let t=ry.r,i=ry.g,n=ry.b;return e!==tY?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(e,t,i){return this.getHSL(rg),this.setHSL(rg.h+e,rg.s+t,rg.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(rg),e.getHSL(r_);let i=iz(rg.h,r_.h,t),n=iz(rg.s,r_.s,t),r=iz(rg.l,r_.l,t);return this.setHSL(i,n,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,n=this.b,r=e.elements;return this.r=r[0]*t+r[3]*i+r[6]*n,this.g=r[1]*t+r[4]*i+r[7]*n,this.b=r[2]*t+r[5]*i+r[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let ry=new rx;rx.NAMES=rm;let rM=0;class rS extends iI{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rM++}),this.uuid=iO(),this.name="",this.type="Material",this.blending=b,this.side=x,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=F,this.blendDst=B,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rx(0,0,0),this.blendAlpha=0,this.depthFunc=K,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=il,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=t3,this.stencilZFail=t3,this.stencilZPass=t3,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(void 0===n){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(i.blending=this.blending),this.side!==x&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),this.blendSrc!==F&&(i.blendSrc=this.blendSrc),this.blendDst!==B&&(i.blendDst=this.blendDst),this.blendEquation!==C&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==K&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==il&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==t3&&(i.stencilFail=this.stencilFail),this.stencilZFail!==t3&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==t3&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){let t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class rb extends rS{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rx(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nJ,this.combine=ei,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let rT=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(n[e]=0,n[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;(8388608&t)==0;)t<<=1,i-=8388608;t&=-8388609,i+=947912704,a[e]=t|i}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();function rw(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=iF(e,-65504,65504),rT.floatView[0]=e;let t=rT.uint32View[0],i=t>>23&511;return rT.baseTable[i]+((8388607&t)>>rT.shiftTable[i])}function rE(e){let t=e>>10;return rT.uint32View[0]=rT.mantissaTable[rT.offsetTable[t]+(1023&e)]+rT.exponentTable[t],rT.floatView[0]}let rA={toHalfFloat:rw,fromHalfFloat:rE},rC=new nu,rR=new iG;class rP{constructor(e,t,i=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=iv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ek,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return i$("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)rR.fromBufferAttribute(this,t),rR.applyMatrix3(e),this.setXY(t,rR.x,rR.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix3(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix4(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyNormalMatrix(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.transformDirection(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=ik(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=iV(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ik(t,this.array)),t}setX(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ik(t,this.array)),t}setY(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=ik(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=ik(t,this.array)),t}setW(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array),r=iV(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==iv&&(e.usage=this.usage),e}}class rI extends rP{constructor(e,t,i){super(new Int8Array(e),t,i)}}class rL extends rP{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class rU extends rP{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class rN extends rP{constructor(e,t,i){super(new Int16Array(e),t,i)}}class rD extends rP{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class rO extends rP{constructor(e,t,i){super(new Int32Array(e),t,i)}}class rF extends rP{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class rB extends rP{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=rE(this.array[e*this.itemSize]);return this.normalized&&(t=ik(t,this.array)),t}setX(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize]=rw(t),this}getY(e){let t=rE(this.array[e*this.itemSize+1]);return this.normalized&&(t=ik(t,this.array)),t}setY(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+1]=rw(t),this}getZ(e){let t=rE(this.array[e*this.itemSize+2]);return this.normalized&&(t=ik(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+2]=rw(t),this}getW(e){let t=rE(this.array[e*this.itemSize+3]);return this.normalized&&(t=ik(t,this.array)),t}setW(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+3]=rw(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this.array[e+2]=rw(n),this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array),r=iV(r,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this.array[e+2]=rw(n),this.array[e+3]=rw(r),this}}class rz extends rP{constructor(e,t,i){super(new Float32Array(e),t,i)}}let rk=0,rV=new nk,rH=new rn,rG=new nu,rW=new np,rX=new np,rj=new nu;class rq extends iI{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rk++}),this.uuid=iO(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(ij(e)?rF:rD)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=new iW().getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return rV.makeRotationFromQuaternion(e),this.applyMatrix4(rV),this}rotateX(e){return rV.makeRotationX(e),this.applyMatrix4(rV),this}rotateY(e){return rV.makeRotationY(e),this.applyMatrix4(rV),this}rotateZ(e){return rV.makeRotationZ(e),this.applyMatrix4(rV),this}translate(e,t,i){return rV.makeTranslation(e,t,i),this.applyMatrix4(rV),this}scale(e,t,i){return rV.makeScale(e,t,i),this.applyMatrix4(rV),this}lookAt(e){return rH.lookAt(e),rH.updateMatrix(),this.applyMatrix4(rH.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rG).negate(),this.translate(rG.x,rG.y,rG.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new rz(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new np);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nu(-1/0,-1/0,-1/0),new nu(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rW.setFromBufferAttribute(i),this.morphTargetsRelative?(rj.addVectors(this.boundingBox.min,rW.min),this.boundingBox.expandByPoint(rj),rj.addVectors(this.boundingBox.max,rW.max),this.boundingBox.expandByPoint(rj)):(this.boundingBox.expandByPoint(rW.min),this.boundingBox.expandByPoint(rW.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new nI);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new nu,1/0);return}if(e){let i=this.boundingSphere.center;if(rW.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rX.setFromBufferAttribute(i),this.morphTargetsRelative?(rj.addVectors(rW.min,rX.min),rW.expandByPoint(rj),rj.addVectors(rW.max,rX.max),rW.expandByPoint(rj)):(rW.expandByPoint(rX.min),rW.expandByPoint(rX.max))}rW.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)rj.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(rj));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)rj.fromBufferAttribute(a,t),s&&(rG.fromBufferAttribute(e,t),rj.add(rG)),n=Math.max(n,i.distanceToSquared(rj))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,n=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new rP(new Float32Array(4*i.count),4));let a=this.getAttribute("tangent"),s=[],o=[];for(let e=0;e<i.count;e++)s[e]=new nu,o[e]=new nu;let l=new nu,h=new nu,u=new nu,c=new iG,d=new iG,p=new iG,f=new nu,m=new nu,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){let n=g[t],a=n.start,_=n.count;for(let t=a,n=a+_;t<n;t+=3)!function(e,t,n){l.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),u.fromBufferAttribute(i,n),c.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),p.fromBufferAttribute(r,n),h.sub(l),u.sub(l),d.sub(c),p.sub(c);let a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(f.copy(h).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(h,-p.x).multiplyScalar(a),s[e].add(f),s[t].add(f),s[n].add(f),o[e].add(m),o[t].add(m),o[n].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let _=new nu,v=new nu,x=new nu,y=new nu;function M(e){x.fromBufferAttribute(n,e),y.copy(x);let t=s[e];_.copy(t),_.sub(x.multiplyScalar(x.dot(t))).normalize(),v.crossVectors(y,t);let i=v.dot(o[e]);a.setXYZW(e,_.x,_.y,_.z,i<0?-1:1)}for(let t=0,i=g.length;t<i;++t){let i=g[t],n=i.start,r=i.count;for(let t=n,i=n+r;t<i;t+=3)M(e.getX(t+0)),M(e.getX(t+1)),M(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new rP(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let n=new nu,r=new nu,a=new nu,s=new nu,o=new nu,l=new nu,h=new nu,u=new nu;if(e)for(let c=0,d=e.count;c<d;c+=3){let d=e.getX(c+0),p=e.getX(c+1),f=e.getX(c+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),s.add(h),o.add(h),l.add(h),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),i.setXYZ(e+0,h.x,h.y,h.z),i.setXYZ(e+1,h.x,h.y,h.z),i.setXYZ(e+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)rj.fromBufferAttribute(e,t),rj.normalize(),e.setXYZ(t,rj.x,rj.y,rj.z)}toNonIndexed(){function e(e,t){let i=e.array,n=e.itemSize,r=e.normalized,a=new i.constructor(t.length*n),s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*n;for(let e=0;e<n;e++)a[o++]=i[s++]}return new rP(a,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new rq,i=this.index.array,n=this.attributes;for(let r in n){let a=e(n[r],i);t.setAttribute(r,a)}let r=this.morphAttributes;for(let n in r){let a=[],s=r[n];for(let t=0,n=s.length;t<n;t++){let n=e(s[t],i);a.push(n)}t.morphAttributes[n]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,i=a.length;e<i;e++){let i=a[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let t in i){let n=i[t];e.data.attributes[t]=n.toJSON(e.data)}let n={},r=!1;for(let t in this.morphAttributes){let i=this.morphAttributes[t],a=[];for(let t=0,n=i.length;t<n;t++){let n=i[t];a.push(n.toJSON(e.data))}a.length>0&&(n[t]=a,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(t));let n=e.attributes;for(let e in n){let i=n[e];this.setAttribute(e,i.clone(t))}let r=e.morphAttributes;for(let e in r){let i=[],n=r[e];for(let e=0,r=n.length;e<r;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let rY=new nk,rZ=new nz,rJ=new nI,rK=new nu,r$=new nu,rQ=new nu,r0=new nu,r1=new nu,r2=new nu,r3=new iG,r4=new iG,r5=new iG,r6=new nu,r8=new nu,r9=new nu,r7=new nu,ae=new nu;class at extends rn{constructor(e=new rq,t=new rb){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let s=this.morphTargetInfluences;if(r&&s){r2.set(0,0,0);for(let i=0,n=r.length;i<n;i++){let n=s[i],o=r[i];0!==n&&(r1.fromBufferAttribute(o,e),a?r2.addScaledVector(r1,n):r2.addScaledVector(r1.sub(t),n))}t.add(r2)}return t}raycast(e,t){let i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),rJ.copy(i.boundingSphere),rJ.applyMatrix4(r),rZ.copy(e.ray).recast(e.near),!1===rJ.containsPoint(rZ.origin)&&(null===rZ.intersectSphere(rJ,rK)||rZ.origin.distanceToSquared(rK)>(e.far-e.near)**2)||(rY.copy(r).invert(),rZ.copy(e.ray).applyMatrix4(rY),null!==i.boundingBox&&!1===rZ.intersectsBox(i.boundingBox)))return;this._computeIntersections(e,t,rZ)}}_computeIntersections(e,t,i){let n;let r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,c=r.groups,d=r.drawRange;if(null!==s){if(Array.isArray(a))for(let r=0,o=c.length;r<o;r++){let o=c[r],p=a[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let r=f;r<m;r+=3)(n=ai(this,p,e,i,l,h,u,s.getX(r),s.getX(r+1),s.getX(r+2)))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=o.materialIndex,t.push(n))}else{let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let c=r;c<o;c+=3)(n=ai(this,a,e,i,l,h,u,s.getX(c),s.getX(c+1),s.getX(c+2)))&&(n.faceIndex=Math.floor(c/3),t.push(n))}}else if(void 0!==o){if(Array.isArray(a))for(let r=0,s=c.length;r<s;r++){let s=c[r],p=a[s.materialIndex],f=Math.max(s.start,d.start),m=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let r=f;r<m;r+=3)(n=ai(this,p,e,i,l,h,u,r,r+1,r+2))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=s.materialIndex,t.push(n))}else{let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let o=r;o<s;o+=3)(n=ai(this,a,e,i,l,h,u,o,o+1,o+2))&&(n.faceIndex=Math.floor(o/3),t.push(n))}}}}function ai(e,t,i,n,r,a,s,o,l,h){e.getVertexPosition(o,r$),e.getVertexPosition(l,rQ),e.getVertexPosition(h,r0);let u=function(e,t,i,n,r,a,s,o){if(null===(t.side===y?n.intersectTriangle(s,a,r,!0,o):n.intersectTriangle(r,a,s,t.side===x,o)))return null;ae.copy(o),ae.applyMatrix4(e.matrixWorld);let l=i.ray.origin.distanceTo(ae);return l<i.near||l>i.far?null:{distance:l,point:ae.clone(),object:e}}(e,t,i,n,r$,rQ,r0,r7);if(u){r&&(r3.fromBufferAttribute(r,o),r4.fromBufferAttribute(r,l),r5.fromBufferAttribute(r,h),u.uv=rf.getInterpolation(r7,r$,rQ,r0,r3,r4,r5,new iG)),a&&(r3.fromBufferAttribute(a,o),r4.fromBufferAttribute(a,l),r5.fromBufferAttribute(a,h),u.uv1=rf.getInterpolation(r7,r$,rQ,r0,r3,r4,r5,new iG)),s&&(r6.fromBufferAttribute(s,o),r8.fromBufferAttribute(s,l),r9.fromBufferAttribute(s,h),u.normal=rf.getInterpolation(r7,r$,rQ,r0,r6,r8,r9,new nu),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:l,c:h,normal:new nu,materialIndex:0};rf.getNormal(r$,rQ,r0,e.normal),u.face=e}return u}class an extends rq{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};let s=this;n=Math.floor(n),r=Math.floor(r);let o=[],l=[],h=[],u=[],c=0,d=0;function p(e,t,i,n,r,a,p,f,m,g,_){let v=a/m,x=p/g,y=a/2,M=p/2,S=f/2,b=m+1,T=g+1,w=0,E=0,A=new nu;for(let a=0;a<T;a++){let s=a*x-M;for(let o=0;o<b;o++){let c=o*v-y;A[e]=c*n,A[t]=s*r,A[i]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[i]=f>0?1:-1,h.push(A.x,A.y,A.z),u.push(o/m),u.push(1-a/g),w+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let i=c+t+b*e,n=c+t+b*(e+1),r=c+(t+1)+b*(e+1),a=c+(t+1)+b*e;o.push(i,n,a),o.push(n,r,a),E+=6}s.addGroup(d,E,_),d+=E,c+=w}p("z","y","x",-1,-1,i,t,e,a=Math.floor(a),r,0),p("z","y","x",1,-1,i,t,-e,a,r,1),p("x","z","y",1,1,e,i,t,n,a,2),p("x","z","y",1,-1,e,i,-t,n,a,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new rz(l,3)),this.setAttribute("normal",new rz(h,3)),this.setAttribute("uv",new rz(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new an(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function ar(e){let t={};for(let i in e)for(let n in t[i]={},e[i]){let r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][n]=null):t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}return t}function aa(e){let t={};for(let i=0;i<e.length;i++){let n=ar(e[i]);for(let e in n)t[e]=n[e]}return t}function as(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:i3.workingColorSpace}let ao={clone:ar,merge:aa};class al extends rS{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ar(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);for(let i in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class ah extends rn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new nk,this.projectionMatrix=new nk,this.projectionMatrixInverse=new nk,this.coordinateSystem=iR}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let au=new nu,ac=new iG,ad=new iG;class ap extends ah{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*iD*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*iN*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*iD*Math.atan(Math.tan(.5*iN*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){au.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(au.x,au.y).multiplyScalar(-e/au.z),au.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(au.x,au.y).multiplyScalar(-e/au.z)}getViewSize(e,t){return this.getViewBounds(e,ac,ad),t.subVectors(ad,ac)}setViewOffset(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*iN*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/s,n*=a.width/e,i*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class af extends rn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new ap(-90,1,e,t);n.layers=this.layers,this.add(n);let r=new ap(-90,1,e,t);r.layers=this.layers,this.add(r);let a=new ap(-90,1,e,t);a.layers=this.layers,this.add(a);let s=new ap(-90,1,e,t);s.layers=this.layers,this.add(s);let o=new ap(-90,1,e,t);o.layers=this.layers,this.add(o);let l=new ap(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,r,a,s,o]=t;for(let e of t)this.remove(e);if(e===iR)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(e===iP)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,h]=this.children,u=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,r),e.setRenderTarget(i,1,n),e.render(t,a),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,o),e.setRenderTarget(i,4,n),e.render(t,l),i.texture.generateMipmaps=f,e.setRenderTarget(i,5,n),e.render(t,h),e.setRenderTarget(u,c,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class am extends nt{constructor(e,t,i,n,r,a,s,o,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:eg,i,n,r,a,s,o,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ag extends nr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1};this.texture=new am([i,i,i,i,i,i],t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:eR}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[689],{51448:function(e,t,i){let n,r,a,s,o;i.r(t),i.d(t,{ACESFilmicToneMapping:function(){return eh},AddEquation:function(){return C},AddOperation:function(){return er},AdditiveAnimationBlendMode:function(){return tF},AdditiveBlending:function(){return T},AgXToneMapping:function(){return ec},AlphaFormat:function(){return ej},AlwaysCompare:function(){return i_},AlwaysDepth:function(){return Z},AlwaysStencilFunc:function(){return il},AmbientLight:function(){return cl},AnimationAction:function(){return c$},AnimationClip:function(){return uG},AnimationLoader:function(){return uK},AnimationMixer:function(){return c0},AnimationObjectGroup:function(){return cK},AnimationUtils:function(){return uP},ArcCurve:function(){return hp},ArrayCamera:function(){return oU},ArrowHelper:function(){return dD},AttachedBindMode:function(){return ep},Audio:function(){return cN},AudioAnalyser:function(){return ck},AudioContext:function(){return cM},AudioListener:function(){return cU},AudioLoader:function(){return cS},AxesHelper:function(){return dO},BackSide:function(){return y},BasicDepthPacking:function(){return tV},BasicShadowMap:function(){return m},BatchedMesh:function(){return lq},Bone:function(){return lg},BooleanKeyframeTrack:function(){return uO},Box2:function(){return dr},Box3:function(){return np},Box3Helper:function(){return dL},BoxGeometry:function(){return an},BoxHelper:function(){return dI},BufferAttribute:function(){return rP},BufferGeometry:function(){return rq},BufferGeometryLoader:function(){return cm},ByteType:function(){return eD},Cache:function(){return uW},Camera:function(){return ah},CameraHelper:function(){return dC},CanvasTexture:function(){return hu},CapsuleGeometry:function(){return hN},CatmullRomCurve3:function(){return hx},CineonToneMapping:function(){return el},CircleGeometry:function(){return hD},ClampToEdgeWrapping:function(){return eS},Clock:function(){return cA},Color:function(){return rx},ColorKeyframeTrack:function(){return uF},ColorManagement:function(){return i3},CompressedArrayTexture:function(){return hl},CompressedCubeTexture:function(){return hh},CompressedTexture:function(){return ho},CompressedTextureLoader:function(){return u$},ConeGeometry:function(){return hF},ConstantAlphaFactor:function(){return j},ConstantColorFactor:function(){return W},CubeCamera:function(){return af},CubeReflectionMapping:function(){return eg},CubeRefractionMapping:function(){return e_},CubeTexture:function(){return am},CubeTextureLoader:function(){return u0},CubeUVReflectionMapping:function(){return ey},CubicBezierCurve:function(){return hb},CubicBezierCurve3:function(){return hT},CubicInterpolant:function(){return uL},CullFaceBack:function(){return d},CullFaceFront:function(){return p},CullFaceFrontBack:function(){return f},CullFaceNone:function(){return c},Curve:function(){return hc},CurvePath:function(){return hI},CustomBlending:function(){return A},CustomToneMapping:function(){return eu},CylinderGeometry:function(){return hO},Cylindrical:function(){return dt},Data3DTexture:function(){return no},DataArrayTexture:function(){return na},DataTexture:function(){return l_},DataTextureLoader:function(){return u1},DataUtils:function(){return rA},DecrementStencilOp:function(){return t6},DecrementWrapStencilOp:function(){return t9},DefaultLoadingManager:function(){return uj},DepthFormat:function(){return eK},DepthStencilFormat:function(){return e$},DepthTexture:function(){return a7},DetachedBindMode:function(){return ef},DirectionalLight:function(){return co},DirectionalLightHelper:function(){return dw},DiscreteInterpolant:function(){return uN},DisplayP3ColorSpace:function(){return tJ},DodecahedronGeometry:function(){return hz},DoubleSide:function(){return M},DstAlphaFactor:function(){return z},DstColorFactor:function(){return V},DynamicCopyUsage:function(){return iw},DynamicDrawUsage:function(){return ix},DynamicReadUsage:function(){return iS},EdgesGeometry:function(){return hW},EllipseCurve:function(){return hd},EqualCompare:function(){return ic},EqualDepth:function(){return $},EqualStencilFunc:function(){return ii},EquirectangularReflectionMapping:function(){return ev},EquirectangularRefractionMapping:function(){return ex},Euler:function(){return nJ},EventDispatcher:function(){return iI},ExtrudeGeometry:function(){return ut},FileLoader:function(){return uJ},Float16BufferAttribute:function(){return rB},Float32BufferAttribute:function(){return rz},FloatType:function(){return ek},Fog:function(){return oq},FogExp2:function(){return oj},FramebufferTexture:function(){return hs},FrontSide:function(){return x},Frustum:function(){return ab},GLBufferAttribute:function(){return c5},GLSL1:function(){return iA},GLSL3:function(){return iC},GreaterCompare:function(){return ip},GreaterDepth:function(){return ee},GreaterEqualCompare:function(){return ig},GreaterEqualDepth:function(){return Q},GreaterEqualStencilFunc:function(){return io},GreaterStencilFunc:function(){return ia},GridHelper:function(){return dy},Group:function(){return oN},HalfFloatType:function(){return eV},HemisphereLight:function(){return u4},HemisphereLightHelper:function(){return dx},IcosahedronGeometry:function(){return un},ImageBitmapLoader:function(){return cy},ImageLoader:function(){return uQ},ImageUtils:function(){return i6},IncrementStencilOp:function(){return t5},IncrementWrapStencilOp:function(){return t8},InstancedBufferAttribute:function(){return lM},InstancedBufferGeometry:function(){return cf},InstancedInterleavedBuffer:function(){return c4},InstancedMesh:function(){return lR},Int16BufferAttribute:function(){return rN},Int32BufferAttribute:function(){return rO},Int8BufferAttribute:function(){return rI},IntType:function(){return eB},InterleavedBuffer:function(){return oZ},InterleavedBufferAttribute:function(){return oK},Interpolant:function(){return uI},InterpolateDiscrete:function(){return tP},InterpolateLinear:function(){return tI},InterpolateSmooth:function(){return tL},InvertStencilOp:function(){return t7},KeepStencilOp:function(){return t3},KeyframeTrack:function(){return uD},LOD:function(){return la},LatheGeometry:function(){return hU},Layers:function(){return nK},LessCompare:function(){return iu},LessDepth:function(){return J},LessEqualCompare:function(){return id},LessEqualDepth:function(){return K},LessEqualStencilFunc:function(){return ir},LessStencilFunc:function(){return it},Light:function(){return u3},LightProbe:function(){return cc},Line:function(){return l2},Line3:function(){return dl},LineBasicMaterial:function(){return lY},LineCurve:function(){return hw},LineCurve3:function(){return hE},LineDashedMaterial:function(){return uT},LineLoop:function(){return l8},LineSegments:function(){return l6},LinearDisplayP3ColorSpace:function(){return tK},LinearFilter:function(){return eR},LinearInterpolant:function(){return uU},LinearMipMapLinearFilter:function(){return eU},LinearMipMapNearestFilter:function(){return eI},LinearMipmapLinearFilter:function(){return eL},LinearMipmapNearestFilter:function(){return eP},LinearSRGBColorSpace:function(){return tZ},LinearToneMapping:function(){return es},LinearTransfer:function(){return t$},Loader:function(){return uq},LoaderUtils:function(){return cp},LoadingManager:function(){return uX},LoopOnce:function(){return tA},LoopPingPong:function(){return tR},LoopRepeat:function(){return tC},LuminanceAlphaFormat:function(){return eJ},LuminanceFormat:function(){return eZ},MOUSE:function(){return h},Material:function(){return rS},MaterialLoader:function(){return cd},MathUtils:function(){return iH},Matrix2:function(){return di},Matrix3:function(){return iW},Matrix4:function(){return nk},MaxEquation:function(){return L},Mesh:function(){return at},MeshBasicMaterial:function(){return rb},MeshDepthMaterial:function(){return ow},MeshDistanceMaterial:function(){return oE},MeshLambertMaterial:function(){return uS},MeshMatcapMaterial:function(){return ub},MeshNormalMaterial:function(){return uM},MeshPhongMaterial:function(){return ux},MeshPhysicalMaterial:function(){return uv},MeshStandardMaterial:function(){return u_},MeshToonMaterial:function(){return uy},MinEquation:function(){return I},MirroredRepeatWrapping:function(){return eb},MixOperation:function(){return en},MultiplyBlending:function(){return E},MultiplyOperation:function(){return ei},NearestFilter:function(){return eT},NearestMipMapLinearFilter:function(){return eC},NearestMipMapNearestFilter:function(){return eE},NearestMipmapLinearFilter:function(){return eA},NearestMipmapNearestFilter:function(){return ew},NeutralToneMapping:function(){return ed},NeverCompare:function(){return ih},NeverDepth:function(){return Y},NeverStencilFunc:function(){return ie},NoBlending:function(){return S},NoColorSpace:function(){return tq},NoToneMapping:function(){return ea},NormalAnimationBlendMode:function(){return tO},NormalBlending:function(){return b},NotEqualCompare:function(){return im},NotEqualDepth:function(){return et},NotEqualStencilFunc:function(){return is},NumberKeyframeTrack:function(){return uB},Object3D:function(){return rn},ObjectLoader:function(){return cg},ObjectSpaceNormalMap:function(){return tj},OctahedronGeometry:function(){return ur},OneFactor:function(){return N},OneMinusConstantAlphaFactor:function(){return q},OneMinusConstantColorFactor:function(){return X},OneMinusDstAlphaFactor:function(){return k},OneMinusDstColorFactor:function(){return H},OneMinusSrcAlphaFactor:function(){return B},OneMinusSrcColorFactor:function(){return O},OrthographicCamera:function(){return az},P3Primaries:function(){return t1},PCFShadowMap:function(){return g},PCFSoftShadowMap:function(){return _},PMREMGenerator:function(){return aJ},Path:function(){return hL},PerspectiveCamera:function(){return ap},Plane:function(){return ay},PlaneGeometry:function(){return aE},PlaneHelper:function(){return dU},PointLight:function(){return ca},PointLightHelper:function(){return dm},Points:function(){return hn},PointsMaterial:function(){return l9},PolarGridHelper:function(){return dM},PolyhedronGeometry:function(){return hB},PositionalAudio:function(){return cz},PropertyBinding:function(){return cJ},PropertyMixer:function(){return cV},QuadraticBezierCurve:function(){return hA},QuadraticBezierCurve3:function(){return hC},Quaternion:function(){return nh},QuaternionKeyframeTrack:function(){return uk},QuaternionLinearInterpolant:function(){return uz},RED_GREEN_RGTC2_Format:function(){return tw},RED_RGTC1_Format:function(){return tb},REVISION:function(){return l},RGBADepthPacking:function(){return tH},RGBAFormat:function(){return eY},RGBAIntegerFormat:function(){return e4},RGBA_ASTC_10x10_Format:function(){return t_},RGBA_ASTC_10x5_Format:function(){return tf},RGBA_ASTC_10x6_Format:function(){return tm},RGBA_ASTC_10x8_Format:function(){return tg},RGBA_ASTC_12x10_Format:function(){return tv},RGBA_ASTC_12x12_Format:function(){return tx},RGBA_ASTC_4x4_Format:function(){return ts},RGBA_ASTC_5x4_Format:function(){return to},RGBA_ASTC_5x5_Format:function(){return tl},RGBA_ASTC_6x5_Format:function(){return th},RGBA_ASTC_6x6_Format:function(){return tu},RGBA_ASTC_8x5_Format:function(){return tc},RGBA_ASTC_8x6_Format:function(){return td},RGBA_ASTC_8x8_Format:function(){return tp},RGBA_BPTC_Format:function(){return ty},RGBA_ETC2_EAC_Format:function(){return ta},RGBA_PVRTC_2BPPV1_Format:function(){return ti},RGBA_PVRTC_4BPPV1_Format:function(){return tt},RGBA_S3TC_DXT1_Format:function(){return e6},RGBA_S3TC_DXT3_Format:function(){return e8},RGBA_S3TC_DXT5_Format:function(){return e9},RGBDepthPacking:function(){return tG},RGBFormat:function(){return eq},RGBIntegerFormat:function(){return e3},RGB_BPTC_SIGNED_Format:function(){return tM},RGB_BPTC_UNSIGNED_Format:function(){return tS},RGB_ETC1_Format:function(){return tn},RGB_ETC2_Format:function(){return tr},RGB_PVRTC_2BPPV1_Format:function(){return te},RGB_PVRTC_4BPPV1_Format:function(){return e7},RGB_S3TC_DXT1_Format:function(){return e5},RGDepthPacking:function(){return tW},RGFormat:function(){return e1},RGIntegerFormat:function(){return e2},RawShaderMaterial:function(){return ug},Ray:function(){return nz},Raycaster:function(){return c8},Rec709Primaries:function(){return t0},RectAreaLight:function(){return ch},RedFormat:function(){return eQ},RedIntegerFormat:function(){return e0},ReinhardToneMapping:function(){return eo},RenderTarget:function(){return nn},RepeatWrapping:function(){return eM},ReplaceStencilOp:function(){return t4},ReverseSubtractEquation:function(){return P},RingGeometry:function(){return ua},SIGNED_RED_GREEN_RGTC2_Format:function(){return tE},SIGNED_RED_RGTC1_Format:function(){return tT},SRGBColorSpace:function(){return tY},SRGBTransfer:function(){return tQ},Scene:function(){return oY},ShaderChunk:function(){return aA},ShaderLib:function(){return aR},ShaderMaterial:function(){return al},ShadowMaterial:function(){return um},Shape:function(){return hX},ShapeGeometry:function(){return us},ShapePath:function(){return dF},ShapeUtils:function(){return h9},ShortType:function(){return eO},Skeleton:function(){return ly},SkeletonHelper:function(){return df},SkinnedMesh:function(){return lm},Source:function(){return i9},Sphere:function(){return nI},SphereGeometry:function(){return uo},Spherical:function(){return de},SphericalHarmonics3:function(){return cu},SplineCurve:function(){return hR},SpotLight:function(){return ce},SpotLightHelper:function(){return du},Sprite:function(){return lt},SpriteMaterial:function(){return o$},SrcAlphaFactor:function(){return F},SrcAlphaSaturateFactor:function(){return G},SrcColorFactor:function(){return D},StaticCopyUsage:function(){return iT},StaticDrawUsage:function(){return iv},StaticReadUsage:function(){return iM},StereoCamera:function(){return cE},StreamCopyUsage:function(){return iE},StreamDrawUsage:function(){return iy},StreamReadUsage:function(){return ib},StringKeyframeTrack:function(){return uV},SubtractEquation:function(){return R},SubtractiveBlending:function(){return w},TOUCH:function(){return u},TangentSpaceNormalMap:function(){return tX},TetrahedronGeometry:function(){return ul},Texture:function(){return nt},TextureLoader:function(){return u2},TextureUtils:function(){return oP},TorusGeometry:function(){return uh},TorusKnotGeometry:function(){return uu},Triangle:function(){return rf},TriangleFanDrawMode:function(){return tk},TriangleStripDrawMode:function(){return tz},TrianglesDrawMode:function(){return tB},TubeGeometry:function(){return uc},UVMapping:function(){return em},Uint16BufferAttribute:function(){return rD},Uint32BufferAttribute:function(){return rF},Uint8BufferAttribute:function(){return rL},Uint8ClampedBufferAttribute:function(){return rU},Uniform:function(){return c1},UniformsGroup:function(){return c3},UniformsLib:function(){return aC},UniformsUtils:function(){return ao},UnsignedByteType:function(){return eN},UnsignedInt248Type:function(){return eW},UnsignedInt5999Type:function(){return eX},UnsignedIntType:function(){return ez},UnsignedShort4444Type:function(){return eH},UnsignedShort5551Type:function(){return eG},UnsignedShortType:function(){return eF},VSMShadowMap:function(){return v},Vector2:function(){return iG},Vector3:function(){return nu},Vector4:function(){return ni},VectorKeyframeTrack:function(){return uH},VideoTexture:function(){return ha},WebGL3DRenderTarget:function(){return nl},WebGLArrayRenderTarget:function(){return ns},WebGLCoordinateSystem:function(){return iR},WebGLCubeRenderTarget:function(){return ag},WebGLMultipleRenderTargets:function(){return dB},WebGLRenderTarget:function(){return nr},WebGLRenderer:function(){return oX},WebGLUtils:function(){return oL},WebGPUCoordinateSystem:function(){return iP},WireframeGeometry:function(){return ud},WrapAroundEnding:function(){return tD},ZeroCurvatureEnding:function(){return tU},ZeroFactor:function(){return U},ZeroSlopeEnding:function(){return tN},ZeroStencilOp:function(){return t2},createCanvasElement:function(){return iJ}});let l="167",h={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},u={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},c=0,d=1,p=2,f=3,m=0,g=1,_=2,v=3,x=0,y=1,M=2,S=0,b=1,T=2,w=3,E=4,A=5,C=100,R=101,P=102,I=103,L=104,U=200,N=201,D=202,O=203,F=204,B=205,z=206,k=207,V=208,H=209,G=210,W=211,X=212,j=213,q=214,Y=0,Z=1,J=2,K=3,$=4,Q=5,ee=6,et=7,ei=0,en=1,er=2,ea=0,es=1,eo=2,el=3,eh=4,eu=5,ec=6,ed=7,ep="attached",ef="detached",em=300,eg=301,e_=302,ev=303,ex=304,ey=306,eM=1e3,eS=1001,eb=1002,eT=1003,ew=1004,eE=1004,eA=1005,eC=1005,eR=1006,eP=1007,eI=1007,eL=1008,eU=1008,eN=1009,eD=1010,eO=1011,eF=1012,eB=1013,ez=1014,ek=1015,eV=1016,eH=1017,eG=1018,eW=1020,eX=35902,ej=1021,eq=1022,eY=1023,eZ=1024,eJ=1025,eK=1026,e$=1027,eQ=1028,e0=1029,e1=1030,e2=1031,e3=1032,e4=1033,e5=33776,e6=33777,e8=33778,e9=33779,e7=35840,te=35841,tt=35842,ti=35843,tn=36196,tr=37492,ta=37496,ts=37808,to=37809,tl=37810,th=37811,tu=37812,tc=37813,td=37814,tp=37815,tf=37816,tm=37817,tg=37818,t_=37819,tv=37820,tx=37821,ty=36492,tM=36494,tS=36495,tb=36283,tT=36284,tw=36285,tE=36286,tA=2200,tC=2201,tR=2202,tP=2300,tI=2301,tL=2302,tU=2400,tN=2401,tD=2402,tO=2500,tF=2501,tB=0,tz=1,tk=2,tV=3200,tH=3201,tG=3202,tW=3203,tX=0,tj=1,tq="",tY="srgb",tZ="srgb-linear",tJ="display-p3",tK="display-p3-linear",t$="linear",tQ="srgb",t0="rec709",t1="p3",t2=0,t3=7680,t4=7681,t5=7682,t6=7683,t8=34055,t9=34056,t7=5386,ie=512,it=513,ii=514,ir=515,ia=516,is=517,io=518,il=519,ih=512,iu=513,ic=514,id=515,ip=516,im=517,ig=518,i_=519,iv=35044,ix=35048,iy=35040,iM=35045,iS=35049,ib=35041,iT=35046,iw=35050,iE=35042,iA="100",iC="300 es",iR=2e3,iP=2001;class iI{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e);e.target=null}}}let iL=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],iU=1234567,iN=Math.PI/180,iD=180/Math.PI;function iO(){let e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(iL[255&e]+iL[e>>8&255]+iL[e>>16&255]+iL[e>>24&255]+"-"+iL[255&t]+iL[t>>8&255]+"-"+iL[t>>16&15|64]+iL[t>>24&255]+"-"+iL[63&i|128]+iL[i>>8&255]+"-"+iL[i>>16&255]+iL[i>>24&255]+iL[255&n]+iL[n>>8&255]+iL[n>>16&255]+iL[n>>24&255]).toLowerCase()}function iF(e,t,i){return Math.max(t,Math.min(i,e))}function iB(e,t){return(e%t+t)%t}function iz(e,t,i){return(1-i)*e+i*t}function ik(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function iV(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let iH={DEG2RAD:iN,RAD2DEG:iD,generateUUID:iO,clamp:iF,euclideanModulo:iB,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:iz,damp:function(e,t,i,n){return iz(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(iB(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(iU=e);let t=iU+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*iN},radToDeg:function(e){return e*iD},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,i,n,r){let a=Math.cos,s=Math.sin,o=a(i/2),l=s(i/2),h=a((t+n)/2),u=s((t+n)/2),c=a((t-n)/2),d=s((t-n)/2),p=a((n-t)/2),f=s((n-t)/2);switch(r){case"XYX":e.set(o*u,l*c,l*d,o*h);break;case"YZY":e.set(l*d,o*u,l*c,o*h);break;case"ZXZ":e.set(l*c,l*d,o*u,o*h);break;case"XZX":e.set(o*u,l*f,l*p,o*h);break;case"YXY":e.set(l*p,o*u,l*f,o*h);break;case"ZYZ":e.set(l*f,l*p,o*u,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:iV,denormalize:ik};class iG{constructor(e=0,t=0){iG.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iF(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class iW{constructor(e,t,i,n,r,a,s,o,l){iW.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,s,o,l)}set(e,t,i,n,r,a,s,o,l){let h=this.elements;return h[0]=e,h[1]=n,h[2]=s,h[3]=t,h[4]=r,h[5]=o,h[6]=i,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[3],o=i[6],l=i[1],h=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],_=n[1],v=n[4],x=n[7],y=n[2],M=n[5],S=n[8];return r[0]=a*f+s*_+o*y,r[3]=a*m+s*v+o*M,r[6]=a*g+s*x+o*S,r[1]=l*f+h*_+u*y,r[4]=l*m+h*v+u*M,r[7]=l*g+h*x+u*S,r[2]=c*f+d*_+p*y,r[5]=c*m+d*v+p*M,r[8]=c*g+d*x+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8];return t*a*h-t*s*l-i*r*h+i*s*o+n*r*l-n*a*o}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=h*a-s*l,c=s*o-h*r,d=l*r-a*o,p=t*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=u*f,e[1]=(n*l-h*i)*f,e[2]=(s*i-n*a)*f,e[3]=c*f,e[4]=(h*t-n*o)*f,e[5]=(n*r-s*t)*f,e[6]=d*f,e[7]=(i*o-l*t)*f,e[8]=(a*t-i*r)*f,this}transpose(){let e;let t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*a+l*s)+a+e,-n*l,n*o,-n*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(iX.makeScale(e,t)),this}rotate(e){return this.premultiply(iX.makeRotation(-e)),this}translate(e,t){return this.premultiply(iX.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let iX=new iW;function ij(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let iq={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iY(e,t){return new iq[e](t)}function iZ(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function iJ(){let e=iZ("canvas");return e.style.display="block",e}let iK={};function i$(e){e in iK||(iK[e]=!0,console.warn(e))}let iQ=new iW().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),i0=new iW().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),i1={[tZ]:{transfer:t$,primaries:t0,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[tY]:{transfer:tQ,primaries:t0,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[tK]:{transfer:t$,primaries:t1,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(i0),fromReference:e=>e.applyMatrix3(iQ)},[tJ]:{transfer:tQ,primaries:t1,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(i0),fromReference:e=>e.applyMatrix3(iQ).convertLinearToSRGB()}},i2=new Set([tZ,tK]),i3={enabled:!0,_workingColorSpace:tZ,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!i2.has(colorSpace))throw Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;let n=i1[t].toReference;return(0,i1[i].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return i1[e].primaries},getTransfer:function(e){return e===tq?t$:i1[e].transfer},getLuminanceCoefficients:function(e,t=this._workingColorSpace){return e.fromArray(i1[t].luminanceCoefficients)}};function i4(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function i5(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class i6{static getDataURL(e){let t;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===n&&(n=iZ("canvas")),n.width=e.width,n.height=e.height;let i=n.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=n}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=iZ("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e<r.length;e++)r[e]=255*i4(r[e]/255);return i.putImageData(n,0,0),t}if(!e.data)return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*i4(t[e]/255)):t[e]=i4(t[e]);return{data:t,width:e.width,height:e.height}}}}let i8=0;class i9{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:i8++}),this.uuid=iO(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(i7(n[t].image)):e.push(i7(n[t]))}else e=i7(n);i.url=e}return t||(e.images[this.uuid]=i),i}}function i7(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?i6.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ne=0;class nt extends iI{constructor(e=nt.DEFAULT_IMAGE,t=nt.DEFAULT_MAPPING,i=eS,n=eS,r=eR,a=eL,s=eY,o=eN,l=nt.DEFAULT_ANISOTROPY,h=tq){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ne++}),this.uuid=iO(),this.name="",this.source=new i9(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new iG(0,0),this.repeat=new iG(1,1),this.center=new iG(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new iW,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==em)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eM:e.x=e.x-Math.floor(e.x);break;case eS:e.x=e.x<0?0:1;break;case eb:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case eM:e.y=e.y-Math.floor(e.y);break;case eS:e.y=e.y<0?0:1;break;case eb:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}nt.DEFAULT_IMAGE=null,nt.DEFAULT_MAPPING=em,nt.DEFAULT_ANISOTROPY=1;class ni{constructor(e=0,t=0,i=0,n=1){ni.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,r;let a=e.elements,s=a[0],o=a[4],l=a[8],h=a[1],u=a[5],c=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-h)&&.01>Math.abs(l-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(o+h)&&.1>Math.abs(l+d)&&.1>Math.abs(c+p)&&.1>Math.abs(s+u+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(u+1)/2,m=(f+1)/2,g=(o+h)/4,_=(l+d)/4,v=(c+p)/4;return e>a&&e>m?e<.01?(i=0,n=.707106781,r=.707106781):(n=g/(i=Math.sqrt(e)),r=_/i):a>m?a<.01?(i=.707106781,n=0,r=.707106781):(i=g/(n=Math.sqrt(a)),r=v/n):m<.01?(i=.707106781,n=.707106781,r=0):(i=_/(r=Math.sqrt(m)),n=v/r),this.set(i,n,r,t),this}let m=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(h-o)*(h-o));return .001>Math.abs(m)&&(m=1),this.x=(p-c)/m,this.y=(l-d)/m,this.z=(h-o)/m,this.w=Math.acos((s+u+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class nn extends iI{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ni(0,0,e,t),this.scissorTest=!1,this.viewport=new ni(0,0,e,t);let n=new nt({width:e,height:t,depth:1},(i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:eR,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i)).mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);n.flipY=!1,n.generateMipmaps=i.generateMipmaps,n.internalFormat=i.internalFormat,this.textures=[];let r=i.count;for(let e=0;e<r;e++)this.textures[e]=n.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.textures.length;n<r;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new i9(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class nr extends nn{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class na extends nt{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ns extends nr{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new na(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class no extends nt{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nl extends nr{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new no(null,e,t,i),this.texture.isRenderTargetTexture=!0}}class nh{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,r,a,s){let o=i[n+0],l=i[n+1],h=i[n+2],u=i[n+3],c=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s){e[t+0]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u;return}if(1===s){e[t+0]=c,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(u!==f||o!==c||l!==d||h!==p){let e=1-s,t=o*c+l*d+h*p+u*f,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){let r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,s=Math.sin(s*a)/r}let r=s*i;if(o=o*e+c*r,l=l*e+d*r,h=h*e+p*r,u=u*e+f*r,e===1-s){let e=1/Math.sqrt(o*o+l*l+h*h+u*u);o*=e,l*=e,h*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,n,r,a){let s=i[n],o=i[n+1],l=i[n+2],h=i[n+3],u=r[a],c=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+h*u+o*d-l*c,e[t+1]=o*p+h*c+l*u-s*d,e[t+2]=l*p+h*d+s*c-o*u,e[t+3]=h*p-s*u-o*c-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(i/2),h=s(n/2),u=s(r/2),c=o(i/2),d=o(n/2),p=o(r/2);switch(a){case"XYZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"YXZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"ZXY":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"ZYX":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"YZX":this._x=c*h*u+l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u-c*d*p;break;case"XZY":this._x=c*h*u-l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],h=t[6],u=t[10],c=i+s+u;if(c>0){let e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(h-o)*e,this._y=(r-l)*e,this._z=(a-n)*e}else if(i>s&&i>u){let e=2*Math.sqrt(1+i-s-u);this._w=(h-o)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+l)/e}else if(s>u){let e=2*Math.sqrt(1+s-i-u);this._w=(r-l)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(o+h)/e}else{let e=2*Math.sqrt(1+u-i-s);this._w=(a-n)/e,this._x=(r+l)/e,this._y=(o+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(iF(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);return 0===i||this.slerp(e,Math.min(1,t/i)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,h=t._w;return this._x=i*h+a*s+n*l-r*o,this._y=n*h+a*o+r*s-i*l,this._z=r*h+a*l+i*o-n*s,this._w=a*h-i*s-n*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,n=this._y,r=this._z,a=this._w,s=a*e._w+i*e._x+n*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}let l=Math.sqrt(o),h=Math.atan2(l,s),u=Math.sin((1-t)*h)/l,c=Math.sin(t*h)/l;return this._w=a*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class nu{constructor(e=0,t=0,i=0){nu.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(nd.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nd.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*n-s*i),h=2*(s*t-r*n),u=2*(r*i-a*t);return this.x=t+o*l+a*u-s*h,this.y=i+o*h+s*l-r*u,this.z=n+o*u+r*h-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=n*o-r*s,this.y=r*a-i*o,this.z=i*s-n*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return nc.copy(this).projectOnVector(e),this.sub(nc)}reflect(e){return this.sub(nc.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iF(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let nc=new nu,nd=new nh;class np{constructor(e=new nu(Infinity,Infinity,Infinity),t=new nu(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(nm.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(nm.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=nm.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(void 0!==i){let n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,i=n.count;t<i;t++)!0===e.isMesh?e.getVertexPosition(t,nm):nm.fromBufferAttribute(n,t),nm.applyMatrix4(e.matrixWorld),this.expandByPoint(nm);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),ng.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),ng.copy(i.boundingBox)),ng.applyMatrix4(e.matrixWorld),this.union(ng)}let n=e.children;for(let e=0,i=n.length;e<i;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,nm),nm.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nb),nT.subVectors(this.max,nb),n_.subVectors(e.a,nb),nv.subVectors(e.b,nb),nx.subVectors(e.c,nb),ny.subVectors(nv,n_),nM.subVectors(nx,nv),nS.subVectors(n_,nx);let t=[0,-ny.z,ny.y,0,-nM.z,nM.y,0,-nS.z,nS.y,ny.z,0,-ny.x,nM.z,0,-nM.x,nS.z,0,-nS.x,-ny.y,ny.x,0,-nM.y,nM.x,0,-nS.y,nS.x,0];return!!(nA(t,n_,nv,nx,nT)&&nA(t=[1,0,0,0,1,0,0,0,1],n_,nv,nx,nT))&&(nw.crossVectors(ny,nM),nA(t=[nw.x,nw.y,nw.z],n_,nv,nx,nT))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,nm).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(nm).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(nf[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nf[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nf[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nf[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nf[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nf[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nf[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nf[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nf)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let nf=[new nu,new nu,new nu,new nu,new nu,new nu,new nu,new nu],nm=new nu,ng=new np,n_=new nu,nv=new nu,nx=new nu,ny=new nu,nM=new nu,nS=new nu,nb=new nu,nT=new nu,nw=new nu,nE=new nu;function nA(e,t,i,n,r){for(let a=0,s=e.length-3;a<=s;a+=3){nE.fromArray(e,a);let s=r.x*Math.abs(nE.x)+r.y*Math.abs(nE.y)+r.z*Math.abs(nE.z),o=t.dot(nE),l=i.dot(nE),h=n.dot(nE);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>s)return!1}return!0}let nC=new np,nR=new nu,nP=new nu;class nI{constructor(e=new nu,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):nC.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;t<r;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;nR.subVectors(e,this.center);let t=nR.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=(e-this.radius)*.5;this.center.addScaledVector(nR,i/e),this.radius+=i}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(nP.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(nR.copy(e.center).add(nP)),this.expandByPoint(nR.copy(e.center).sub(nP)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let nL=new nu,nU=new nu,nN=new nu,nD=new nu,nO=new nu,nF=new nu,nB=new nu;class nz{constructor(e=new nu,t=new nu(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,nL)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=nL.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nL.copy(this.origin).addScaledVector(this.direction,t),nL.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){let r,a,s,o;nU.copy(e).add(t).multiplyScalar(.5),nN.copy(t).sub(e).normalize(),nD.copy(this.origin).sub(nU);let l=.5*e.distanceTo(t),h=-this.direction.dot(nN),u=nD.dot(this.direction),c=-nD.dot(nN),d=nD.lengthSq(),p=Math.abs(1-h*h);if(p>0){if(r=h*c-u,a=h*u-c,o=l*p,r>=0){if(a>=-o){if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+h*a+2*u)+a*(h*r+a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=l)+u)))*r+a*(a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=-l)+u)))*r+a*(a+2*c)+d}else a<=-o?(a=(r=Math.max(0,-(-h*l+u)))>0?-l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-c),l))*(a+2*c)+d):(a=(r=Math.max(0,-(h*l+u)))>0?l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d)}else a=h>0?-l:l,s=-(r=Math.max(0,-(h*a+u)))*r+a*(a+2*c)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,r),n&&n.copy(nU).addScaledVector(nN,a),s}intersectSphere(e,t){nL.subVectors(e.center,this.origin);let i=nL.dot(this.direction),n=nL.dot(nL)-i*i,r=e.radius*e.radius;if(n>r)return null;let a=Math.sqrt(r-n),s=i-a,o=i+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let i,n,r,a,s,o;let l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(l>=0?(i=(e.min.x-c.x)*l,n=(e.max.x-c.x)*l):(i=(e.max.x-c.x)*l,n=(e.min.x-c.x)*l),h>=0?(r=(e.min.y-c.y)*h,a=(e.max.y-c.y)*h):(r=(e.max.y-c.y)*h,a=(e.min.y-c.y)*h),i>a||r>n)?null:((r>i||isNaN(i))&&(i=r),(a<n||isNaN(n))&&(n=a),u>=0?(s=(e.min.z-c.z)*u,o=(e.max.z-c.z)*u):(s=(e.max.z-c.z)*u,o=(e.min.z-c.z)*u),i>o||s>n)?null:((s>i||i!=i)&&(i=s),(o<n||n!=n)&&(n=o),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,nL)}intersectTriangle(e,t,i,n,r){let a;nO.subVectors(t,e),nF.subVectors(i,e),nB.crossVectors(nO,nF);let s=this.direction.dot(nB);if(s>0){if(n)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}nD.subVectors(this.origin,e);let o=a*this.direction.dot(nF.crossVectors(nD,nF));if(o<0)return null;let l=a*this.direction.dot(nO.cross(nD));if(l<0||o+l>s)return null;let h=-a*nD.dot(nB);return h<0?null:this.at(h/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class nk{constructor(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m){nk.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m)}set(e,t,i,n,r,a,s,o,l,h,u,c,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=h,g[10]=u,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new nk().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/nV.setFromMatrixColumn(e,0).length(),r=1/nV.setFromMatrixColumn(e,1).length(),a=1/nV.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),h=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=-o*u,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=n+i*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e+r*s,t[4]=n*s-i,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-s,t[2]=i*s-n,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=n+i*s,t[1]=i+n*s,t[5]=a*h,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=r-e*u,t[8]=n*u+i,t[1]=u,t[5]=a*h,t[9]=-s*h,t[2]=-l*h,t[6]=i*u+n,t[10]=e-r*u}else if("XZY"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=-u,t[8]=l*h,t[1]=e*u+r,t[5]=a*h,t[9]=i*u-n,t[2]=n*u-i,t[6]=s*h,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nG,e,nW)}lookAt(e,t,i){let n=this.elements;return nq.subVectors(e,t),0===nq.lengthSq()&&(nq.z=1),nq.normalize(),nX.crossVectors(i,nq),0===nX.lengthSq()&&(1===Math.abs(i.z)?nq.x+=1e-4:nq.z+=1e-4,nq.normalize(),nX.crossVectors(i,nq)),nX.normalize(),nj.crossVectors(nq,nX),n[0]=nX.x,n[4]=nj.x,n[8]=nq.x,n[1]=nX.y,n[5]=nj.y,n[9]=nq.y,n[2]=nX.z,n[6]=nj.z,n[10]=nq.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[4],o=i[8],l=i[12],h=i[1],u=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],_=i[3],v=i[7],x=i[11],y=i[15],M=n[0],S=n[4],b=n[8],T=n[12],w=n[1],E=n[5],A=n[9],C=n[13],R=n[2],P=n[6],I=n[10],L=n[14],U=n[3],N=n[7],D=n[11],O=n[15];return r[0]=a*M+s*w+o*R+l*U,r[4]=a*S+s*E+o*P+l*N,r[8]=a*b+s*A+o*I+l*D,r[12]=a*T+s*C+o*L+l*O,r[1]=h*M+u*w+c*R+d*U,r[5]=h*S+u*E+c*P+d*N,r[9]=h*b+u*A+c*I+d*D,r[13]=h*T+u*C+c*L+d*O,r[2]=p*M+f*w+m*R+g*U,r[6]=p*S+f*E+m*P+g*N,r[10]=p*b+f*A+m*I+g*D,r[14]=p*T+f*C+m*L+g*O,r[3]=_*M+v*w+x*R+y*U,r[7]=_*S+v*E+x*P+y*N,r[11]=_*b+v*A+x*I+y*D,r[15]=_*T+v*C+x*L+y*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],h=e[2],u=e[6],c=e[10],d=e[14],p=e[3];return p*(+r*o*u-n*l*u-r*s*c+i*l*c+n*s*d-i*o*d)+e[7]*(+t*o*d-t*l*c+r*a*c-n*a*d+n*l*h-r*o*h)+e[11]*(+t*l*u-t*s*d-r*a*u+i*a*d+r*s*h-i*l*h)+e[15]*(-n*s*h-t*o*u+t*s*c+n*a*u-i*a*c+i*o*h)}transpose(){let e;let t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],_=u*m*l-f*c*l+f*o*d-s*m*d-u*o*g+s*c*g,v=p*c*l-h*m*l-p*o*d+a*m*d+h*o*g-a*c*g,x=h*f*l-p*u*l+p*s*d-a*f*d-h*s*g+a*u*g,y=p*u*o-h*f*o-p*s*c+a*f*c+h*s*m-a*u*m,M=t*_+i*v+n*x+r*y;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/M;return e[0]=_*S,e[1]=(f*c*r-u*m*r-f*n*d+i*m*d+u*n*g-i*c*g)*S,e[2]=(s*m*r-f*o*r+f*n*l-i*m*l-s*n*g+i*o*g)*S,e[3]=(u*o*r-s*c*r-u*n*l+i*c*l+s*n*d-i*o*d)*S,e[4]=v*S,e[5]=(h*m*r-p*c*r+p*n*d-t*m*d-h*n*g+t*c*g)*S,e[6]=(p*o*r-a*m*r-p*n*l+t*m*l+a*n*g-t*o*g)*S,e[7]=(a*c*r-h*o*r+h*n*l-t*c*l-a*n*d+t*o*d)*S,e[8]=x*S,e[9]=(p*u*r-h*f*r-p*i*d+t*f*d+h*i*g-t*u*g)*S,e[10]=(a*f*r-p*s*r+p*i*l-t*f*l-a*i*g+t*s*g)*S,e[11]=(h*s*r-a*u*r-h*i*l+t*u*l+a*i*d-t*s*d)*S,e[12]=y*S,e[13]=(h*f*n-p*u*n+p*i*c-t*f*c-h*i*m+t*u*m)*S,e[14]=(p*s*n-a*f*n-p*i*o+t*f*o+a*i*m-t*s*m)*S,e[15]=(a*u*n-h*s*n+h*i*o-t*u*o-a*i*c+t*s*c)*S,this}scale(e){let t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,s=e.y,o=e.z,l=r*a,h=r*s;return this.set(l*a+i,l*s-n*o,l*o+n*s,0,l*s+n*o,h*s+i,h*o-n*a,0,l*o-n*s,h*o+n*a,r*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,h=a+a,u=s+s,c=r*l,d=r*h,p=r*u,f=a*h,m=a*u,g=s*u,_=o*l,v=o*h,x=o*u,y=i.x,M=i.y,S=i.z;return n[0]=(1-(f+g))*y,n[1]=(d+x)*y,n[2]=(p-v)*y,n[3]=0,n[4]=(d-x)*M,n[5]=(1-(c+g))*M,n[6]=(m+_)*M,n[7]=0,n[8]=(p+v)*S,n[9]=(m-_)*S,n[10]=(1-(c+f))*S,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,r=nV.set(n[0],n[1],n[2]).length(),a=nV.set(n[4],n[5],n[6]).length(),s=nV.set(n[8],n[9],n[10]).length();0>this.determinant()&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],nH.copy(this);let o=1/r,l=1/a,h=1/s;return nH.elements[0]*=o,nH.elements[1]*=o,nH.elements[2]*=o,nH.elements[4]*=l,nH.elements[5]*=l,nH.elements[6]*=l,nH.elements[8]*=h,nH.elements[9]*=h,nH.elements[10]*=h,t.setFromRotationMatrix(nH),i.x=r,i.y=a,i.z=s,this}makePerspective(e,t,i,n,r,a,s=iR){let o,l;let h=this.elements;if(s===iR)o=-(a+r)/(a-r),l=-2*a*r/(a-r);else if(s===iP)o=-a/(a-r),l=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return h[0]=2*r/(t-e),h[4]=0,h[8]=(t+e)/(t-e),h[12]=0,h[1]=0,h[5]=2*r/(i-n),h[9]=(i+n)/(i-n),h[13]=0,h[2]=0,h[6]=0,h[10]=o,h[14]=l,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,i,n,r,a,s=iR){let o,l;let h=this.elements,u=1/(t-e),c=1/(i-n),d=1/(a-r);if(s===iR)o=(a+r)*d,l=-2*d;else if(s===iP)o=r*d,l=-1*d;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-((t+e)*u),h[1]=0,h[5]=2*c,h[9]=0,h[13]=-((i+n)*c),h[2]=0,h[6]=0,h[10]=l,h[14]=-o,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}let nV=new nu,nH=new nk,nG=new nu(0,0,0),nW=new nu(1,1,1),nX=new nu,nj=new nu,nq=new nu,nY=new nk,nZ=new nh;class nJ{constructor(e=0,t=0,i=0,n=nJ.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let n=e.elements,r=n[0],a=n[4],s=n[8],o=n[1],l=n[5],h=n[9],u=n[2],c=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(iF(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-iF(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(iF(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-iF(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(iF(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-iF(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(c,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return nY.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nY,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return nZ.setFromEuler(this),this.setFromQuaternion(nZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nJ.DEFAULT_ORDER="XYZ";class nK{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&(1<<e|0))!=0}}let n$=0,nQ=new nu,n0=new nh,n1=new nk,n2=new nu,n3=new nu,n4=new nu,n5=new nh,n6=new nu(1,0,0),n8=new nu(0,1,0),n9=new nu(0,0,1),n7={type:"added"},re={type:"removed"},rt={type:"childadded",child:null},ri={type:"childremoved",child:null};class rn extends iI{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:n$++}),this.uuid=iO(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rn.DEFAULT_UP.clone();let e=new nu,t=new nJ,i=new nh,n=new nu(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new nk},normalMatrix:{value:new iW}}),this.matrix=new nk,this.matrixWorld=new nk,this.matrixAutoUpdate=rn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new nK,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return n0.setFromAxisAngle(e,t),this.quaternion.multiply(n0),this}rotateOnWorldAxis(e,t){return n0.setFromAxisAngle(e,t),this.quaternion.premultiply(n0),this}rotateX(e){return this.rotateOnAxis(n6,e)}rotateY(e){return this.rotateOnAxis(n8,e)}rotateZ(e){return this.rotateOnAxis(n9,e)}translateOnAxis(e,t){return nQ.copy(e).applyQuaternion(this.quaternion),this.position.add(nQ.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(n6,e)}translateY(e){return this.translateOnAxis(n8,e)}translateZ(e){return this.translateOnAxis(n9,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(n1.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?n2.copy(e):n2.set(e,t,i);let n=this.parent;this.updateWorldMatrix(!0,!1),n3.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?n1.lookAt(n3,n2,this.up):n1.lookAt(n2,n3,this.up),this.quaternion.setFromRotationMatrix(n1),n&&(n1.extractRotation(n.matrixWorld),n0.setFromRotationMatrix(n1),this.quaternion.premultiply(n0.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(n7),rt.child=e,this.dispatchEvent(rt),rt.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(re),ri.child=e,this.dispatchEvent(ri),ri.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),n1.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),n1.multiply(e.parent.matrixWorld)),e.applyMatrix4(n1),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(n7),rt.child=e,this.dispatchEvent(rt),rt.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);let n=this.children;for(let r=0,a=n.length;r<a;r++)n[r].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n3,e,n4),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n3,n5,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map(e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()})),n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){let n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material){if(Array.isArray(this.material)){let t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material)}if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){let t=a(e.geometries),n=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),h=a(e.animations),u=a(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h),u.length>0&&(i.nodes=u)}return i.object=n,i;function a(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let i=e.children[t];this.add(i.clone())}return this}}rn.DEFAULT_UP=new nu(0,1,0),rn.DEFAULT_MATRIX_AUTO_UPDATE=!0,rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let rr=new nu,ra=new nu,rs=new nu,ro=new nu,rl=new nu,rh=new nu,ru=new nu,rc=new nu,rd=new nu,rp=new nu;class rf{constructor(e=new nu,t=new nu,i=new nu){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),rr.subVectors(e,t),n.cross(rr);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){rr.subVectors(n,t),ra.subVectors(i,t),rs.subVectors(e,t);let a=rr.dot(rr),s=rr.dot(ra),o=rr.dot(rs),l=ra.dot(ra),h=ra.dot(rs),u=a*l-s*s;if(0===u)return r.set(0,0,0),null;let c=1/u,d=(l*o-s*h)*c,p=(a*h-s*o)*c;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,ro)&&ro.x>=0&&ro.y>=0&&ro.x+ro.y<=1}static getInterpolation(e,t,i,n,r,a,s,o){return null===this.getBarycoord(e,t,i,n,ro)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ro.x),o.addScaledVector(a,ro.y),o.addScaledVector(s,ro.z),o)}static isFrontFacing(e,t,i,n){return rr.subVectors(i,t),ra.subVectors(e,t),0>rr.cross(ra).dot(n)}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return rr.subVectors(this.c,this.b),ra.subVectors(this.a,this.b),.5*rr.cross(ra).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return rf.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return rf.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,r){return rf.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return rf.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return rf.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,n;let r=this.a,a=this.b,s=this.c;rl.subVectors(a,r),rh.subVectors(s,r),rc.subVectors(e,r);let o=rl.dot(rc),l=rh.dot(rc);if(o<=0&&l<=0)return t.copy(r);rd.subVectors(e,a);let h=rl.dot(rd),u=rh.dot(rd);if(h>=0&&u<=h)return t.copy(a);let c=o*u-h*l;if(c<=0&&o>=0&&h<=0)return i=o/(o-h),t.copy(r).addScaledVector(rl,i);rp.subVectors(e,s);let d=rl.dot(rp),p=rh.dot(rp);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),t.copy(r).addScaledVector(rh,n);let m=h*p-d*u;if(m<=0&&u-h>=0&&d-p>=0)return ru.subVectors(s,a),n=(u-h)/(u-h+(d-p)),t.copy(a).addScaledVector(ru,n);let g=1/(m+f+c);return i=f*g,n=c*g,t.copy(r).addScaledVector(rl,i).addScaledVector(rh,n)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let rm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rg={h:0,s:0,l:0},r_={h:0,s:0,l:0};function rv(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*6*(2/3-i):e}class rx{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){return void 0===t&&void 0===i?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,i),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=tY){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,i3.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=i3.workingColorSpace){return this.r=e,this.g=t,this.b=i,i3.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=i3.workingColorSpace){if(e=iB(e,1),t=iF(t,0,1),i=iF(i,0,1),0===t)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=rv(r,n,e+1/3),this.g=rv(r,n,e),this.b=rv(r,n,e-1/3)}return i3.toWorkingColorSpace(this,n),this}setStyle(e,t=tY){let i;function n(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;let a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=tY){let i=rm[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=i4(e.r),this.g=i4(e.g),this.b=i4(e.b),this}copyLinearToSRGB(e){return this.r=i5(e.r),this.g=i5(e.g),this.b=i5(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tY){return i3.fromWorkingColorSpace(ry.copy(this),e),65536*Math.round(iF(255*ry.r,0,255))+256*Math.round(iF(255*ry.g,0,255))+Math.round(iF(255*ry.b,0,255))}getHexString(e=tY){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=i3.workingColorSpace){let i,n;i3.fromWorkingColorSpace(ry.copy(this),t);let r=ry.r,a=ry.g,s=ry.b,o=Math.max(r,a,s),l=Math.min(r,a,s),h=(l+o)/2;if(l===o)i=0,n=0;else{let e=o-l;switch(n=h<=.5?e/(o+l):e/(2-o-l),o){case r:i=(a-s)/e+(a<s?6:0);break;case a:i=(s-r)/e+2;break;case s:i=(r-a)/e+4}i/=6}return e.h=i,e.s=n,e.l=h,e}getRGB(e,t=i3.workingColorSpace){return i3.fromWorkingColorSpace(ry.copy(this),t),e.r=ry.r,e.g=ry.g,e.b=ry.b,e}getStyle(e=tY){i3.fromWorkingColorSpace(ry.copy(this),e);let t=ry.r,i=ry.g,n=ry.b;return e!==tY?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(e,t,i){return this.getHSL(rg),this.setHSL(rg.h+e,rg.s+t,rg.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(rg),e.getHSL(r_);let i=iz(rg.h,r_.h,t),n=iz(rg.s,r_.s,t),r=iz(rg.l,r_.l,t);return this.setHSL(i,n,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,n=this.b,r=e.elements;return this.r=r[0]*t+r[3]*i+r[6]*n,this.g=r[1]*t+r[4]*i+r[7]*n,this.b=r[2]*t+r[5]*i+r[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let ry=new rx;rx.NAMES=rm;let rM=0;class rS extends iI{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rM++}),this.uuid=iO(),this.name="",this.type="Material",this.blending=b,this.side=x,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=F,this.blendDst=B,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rx(0,0,0),this.blendAlpha=0,this.depthFunc=K,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=il,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=t3,this.stencilZFail=t3,this.stencilZPass=t3,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(void 0===n){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(i.blending=this.blending),this.side!==x&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),this.blendSrc!==F&&(i.blendSrc=this.blendSrc),this.blendDst!==B&&(i.blendDst=this.blendDst),this.blendEquation!==C&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==K&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==il&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==t3&&(i.stencilFail=this.stencilFail),this.stencilZFail!==t3&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==t3&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){let t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class rb extends rS{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rx(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nJ,this.combine=ei,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let rT=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(n[e]=0,n[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;(8388608&t)==0;)t<<=1,i-=8388608;t&=-8388609,i+=947912704,a[e]=t|i}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();function rw(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=iF(e,-65504,65504),rT.floatView[0]=e;let t=rT.uint32View[0],i=t>>23&511;return rT.baseTable[i]+((8388607&t)>>rT.shiftTable[i])}function rE(e){let t=e>>10;return rT.uint32View[0]=rT.mantissaTable[rT.offsetTable[t]+(1023&e)]+rT.exponentTable[t],rT.floatView[0]}let rA={toHalfFloat:rw,fromHalfFloat:rE},rC=new nu,rR=new iG;class rP{constructor(e,t,i=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=iv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ek,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return i$("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)rR.fromBufferAttribute(this,t),rR.applyMatrix3(e),this.setXY(t,rR.x,rR.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix3(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix4(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyNormalMatrix(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.transformDirection(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=ik(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=iV(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ik(t,this.array)),t}setX(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ik(t,this.array)),t}setY(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=ik(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=ik(t,this.array)),t}setW(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array),r=iV(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==iv&&(e.usage=this.usage),e}}class rI extends rP{constructor(e,t,i){super(new Int8Array(e),t,i)}}class rL extends rP{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class rU extends rP{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class rN extends rP{constructor(e,t,i){super(new Int16Array(e),t,i)}}class rD extends rP{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class rO extends rP{constructor(e,t,i){super(new Int32Array(e),t,i)}}class rF extends rP{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class rB extends rP{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=rE(this.array[e*this.itemSize]);return this.normalized&&(t=ik(t,this.array)),t}setX(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize]=rw(t),this}getY(e){let t=rE(this.array[e*this.itemSize+1]);return this.normalized&&(t=ik(t,this.array)),t}setY(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+1]=rw(t),this}getZ(e){let t=rE(this.array[e*this.itemSize+2]);return this.normalized&&(t=ik(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+2]=rw(t),this}getW(e){let t=rE(this.array[e*this.itemSize+3]);return this.normalized&&(t=ik(t,this.array)),t}setW(e,t){return this.normalized&&(t=iV(t,this.array)),this.array[e*this.itemSize+3]=rw(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this.array[e+2]=rw(n),this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iV(t,this.array),i=iV(i,this.array),n=iV(n,this.array),r=iV(r,this.array)),this.array[e+0]=rw(t),this.array[e+1]=rw(i),this.array[e+2]=rw(n),this.array[e+3]=rw(r),this}}class rz extends rP{constructor(e,t,i){super(new Float32Array(e),t,i)}}let rk=0,rV=new nk,rH=new rn,rG=new nu,rW=new np,rX=new np,rj=new nu;class rq extends iI{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rk++}),this.uuid=iO(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(ij(e)?rF:rD)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=new iW().getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return rV.makeRotationFromQuaternion(e),this.applyMatrix4(rV),this}rotateX(e){return rV.makeRotationX(e),this.applyMatrix4(rV),this}rotateY(e){return rV.makeRotationY(e),this.applyMatrix4(rV),this}rotateZ(e){return rV.makeRotationZ(e),this.applyMatrix4(rV),this}translate(e,t,i){return rV.makeTranslation(e,t,i),this.applyMatrix4(rV),this}scale(e,t,i){return rV.makeScale(e,t,i),this.applyMatrix4(rV),this}lookAt(e){return rH.lookAt(e),rH.updateMatrix(),this.applyMatrix4(rH.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rG).negate(),this.translate(rG.x,rG.y,rG.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new rz(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new np);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nu(-1/0,-1/0,-1/0),new nu(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rW.setFromBufferAttribute(i),this.morphTargetsRelative?(rj.addVectors(this.boundingBox.min,rW.min),this.boundingBox.expandByPoint(rj),rj.addVectors(this.boundingBox.max,rW.max),this.boundingBox.expandByPoint(rj)):(this.boundingBox.expandByPoint(rW.min),this.boundingBox.expandByPoint(rW.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new nI);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new nu,1/0);return}if(e){let i=this.boundingSphere.center;if(rW.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rX.setFromBufferAttribute(i),this.morphTargetsRelative?(rj.addVectors(rW.min,rX.min),rW.expandByPoint(rj),rj.addVectors(rW.max,rX.max),rW.expandByPoint(rj)):(rW.expandByPoint(rX.min),rW.expandByPoint(rX.max))}rW.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)rj.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(rj));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)rj.fromBufferAttribute(a,t),s&&(rG.fromBufferAttribute(e,t),rj.add(rG)),n=Math.max(n,i.distanceToSquared(rj))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,n=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new rP(new Float32Array(4*i.count),4));let a=this.getAttribute("tangent"),s=[],o=[];for(let e=0;e<i.count;e++)s[e]=new nu,o[e]=new nu;let l=new nu,h=new nu,u=new nu,c=new iG,d=new iG,p=new iG,f=new nu,m=new nu,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){let n=g[t],a=n.start,_=n.count;for(let t=a,n=a+_;t<n;t+=3)!function(e,t,n){l.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),u.fromBufferAttribute(i,n),c.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),p.fromBufferAttribute(r,n),h.sub(l),u.sub(l),d.sub(c),p.sub(c);let a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(f.copy(h).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(h,-p.x).multiplyScalar(a),s[e].add(f),s[t].add(f),s[n].add(f),o[e].add(m),o[t].add(m),o[n].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let _=new nu,v=new nu,x=new nu,y=new nu;function M(e){x.fromBufferAttribute(n,e),y.copy(x);let t=s[e];_.copy(t),_.sub(x.multiplyScalar(x.dot(t))).normalize(),v.crossVectors(y,t);let i=v.dot(o[e]);a.setXYZW(e,_.x,_.y,_.z,i<0?-1:1)}for(let t=0,i=g.length;t<i;++t){let i=g[t],n=i.start,r=i.count;for(let t=n,i=n+r;t<i;t+=3)M(e.getX(t+0)),M(e.getX(t+1)),M(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new rP(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let n=new nu,r=new nu,a=new nu,s=new nu,o=new nu,l=new nu,h=new nu,u=new nu;if(e)for(let c=0,d=e.count;c<d;c+=3){let d=e.getX(c+0),p=e.getX(c+1),f=e.getX(c+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),s.add(h),o.add(h),l.add(h),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),i.setXYZ(e+0,h.x,h.y,h.z),i.setXYZ(e+1,h.x,h.y,h.z),i.setXYZ(e+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)rj.fromBufferAttribute(e,t),rj.normalize(),e.setXYZ(t,rj.x,rj.y,rj.z)}toNonIndexed(){function e(e,t){let i=e.array,n=e.itemSize,r=e.normalized,a=new i.constructor(t.length*n),s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*n;for(let e=0;e<n;e++)a[o++]=i[s++]}return new rP(a,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new rq,i=this.index.array,n=this.attributes;for(let r in n){let a=e(n[r],i);t.setAttribute(r,a)}let r=this.morphAttributes;for(let n in r){let a=[],s=r[n];for(let t=0,n=s.length;t<n;t++){let n=e(s[t],i);a.push(n)}t.morphAttributes[n]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,i=a.length;e<i;e++){let i=a[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let t in i){let n=i[t];e.data.attributes[t]=n.toJSON(e.data)}let n={},r=!1;for(let t in this.morphAttributes){let i=this.morphAttributes[t],a=[];for(let t=0,n=i.length;t<n;t++){let n=i[t];a.push(n.toJSON(e.data))}a.length>0&&(n[t]=a,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(t));let n=e.attributes;for(let e in n){let i=n[e];this.setAttribute(e,i.clone(t))}let r=e.morphAttributes;for(let e in r){let i=[],n=r[e];for(let e=0,r=n.length;e<r;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let rY=new nk,rZ=new nz,rJ=new nI,rK=new nu,r$=new nu,rQ=new nu,r0=new nu,r1=new nu,r2=new nu,r3=new iG,r4=new iG,r5=new iG,r6=new nu,r8=new nu,r9=new nu,r7=new nu,ae=new nu;class at extends rn{constructor(e=new rq,t=new rb){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let s=this.morphTargetInfluences;if(r&&s){r2.set(0,0,0);for(let i=0,n=r.length;i<n;i++){let n=s[i],o=r[i];0!==n&&(r1.fromBufferAttribute(o,e),a?r2.addScaledVector(r1,n):r2.addScaledVector(r1.sub(t),n))}t.add(r2)}return t}raycast(e,t){let i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),rJ.copy(i.boundingSphere),rJ.applyMatrix4(r),rZ.copy(e.ray).recast(e.near),!1===rJ.containsPoint(rZ.origin)&&(null===rZ.intersectSphere(rJ,rK)||rZ.origin.distanceToSquared(rK)>(e.far-e.near)**2)||(rY.copy(r).invert(),rZ.copy(e.ray).applyMatrix4(rY),null!==i.boundingBox&&!1===rZ.intersectsBox(i.boundingBox)))return;this._computeIntersections(e,t,rZ)}}_computeIntersections(e,t,i){let n;let r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,u=r.attributes.normal,c=r.groups,d=r.drawRange;if(null!==s){if(Array.isArray(a))for(let r=0,o=c.length;r<o;r++){let o=c[r],p=a[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let r=f;r<m;r+=3)(n=ai(this,p,e,i,l,h,u,s.getX(r),s.getX(r+1),s.getX(r+2)))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=o.materialIndex,t.push(n))}else{let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let c=r;c<o;c+=3)(n=ai(this,a,e,i,l,h,u,s.getX(c),s.getX(c+1),s.getX(c+2)))&&(n.faceIndex=Math.floor(c/3),t.push(n))}}else if(void 0!==o){if(Array.isArray(a))for(let r=0,s=c.length;r<s;r++){let s=c[r],p=a[s.materialIndex],f=Math.max(s.start,d.start),m=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let r=f;r<m;r+=3)(n=ai(this,p,e,i,l,h,u,r,r+1,r+2))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=s.materialIndex,t.push(n))}else{let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let o=r;o<s;o+=3)(n=ai(this,a,e,i,l,h,u,o,o+1,o+2))&&(n.faceIndex=Math.floor(o/3),t.push(n))}}}}function ai(e,t,i,n,r,a,s,o,l,h){e.getVertexPosition(o,r$),e.getVertexPosition(l,rQ),e.getVertexPosition(h,r0);let u=function(e,t,i,n,r,a,s,o){if(null===(t.side===y?n.intersectTriangle(s,a,r,!0,o):n.intersectTriangle(r,a,s,t.side===x,o)))return null;ae.copy(o),ae.applyMatrix4(e.matrixWorld);let l=i.ray.origin.distanceTo(ae);return l<i.near||l>i.far?null:{distance:l,point:ae.clone(),object:e}}(e,t,i,n,r$,rQ,r0,r7);if(u){r&&(r3.fromBufferAttribute(r,o),r4.fromBufferAttribute(r,l),r5.fromBufferAttribute(r,h),u.uv=rf.getInterpolation(r7,r$,rQ,r0,r3,r4,r5,new iG)),a&&(r3.fromBufferAttribute(a,o),r4.fromBufferAttribute(a,l),r5.fromBufferAttribute(a,h),u.uv1=rf.getInterpolation(r7,r$,rQ,r0,r3,r4,r5,new iG)),s&&(r6.fromBufferAttribute(s,o),r8.fromBufferAttribute(s,l),r9.fromBufferAttribute(s,h),u.normal=rf.getInterpolation(r7,r$,rQ,r0,r6,r8,r9,new nu),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:l,c:h,normal:new nu,materialIndex:0};rf.getNormal(r$,rQ,r0,e.normal),u.face=e}return u}class an extends rq{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};let s=this;n=Math.floor(n),r=Math.floor(r);let o=[],l=[],h=[],u=[],c=0,d=0;function p(e,t,i,n,r,a,p,f,m,g,_){let v=a/m,x=p/g,y=a/2,M=p/2,S=f/2,b=m+1,T=g+1,w=0,E=0,A=new nu;for(let a=0;a<T;a++){let s=a*x-M;for(let o=0;o<b;o++){let c=o*v-y;A[e]=c*n,A[t]=s*r,A[i]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[i]=f>0?1:-1,h.push(A.x,A.y,A.z),u.push(o/m),u.push(1-a/g),w+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let i=c+t+b*e,n=c+t+b*(e+1),r=c+(t+1)+b*(e+1),a=c+(t+1)+b*e;o.push(i,n,a),o.push(n,r,a),E+=6}s.addGroup(d,E,_),d+=E,c+=w}p("z","y","x",-1,-1,i,t,e,a=Math.floor(a),r,0),p("z","y","x",1,-1,i,t,-e,a,r,1),p("x","z","y",1,1,e,i,t,n,a,2),p("x","z","y",1,-1,e,i,-t,n,a,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new rz(l,3)),this.setAttribute("normal",new rz(h,3)),this.setAttribute("uv",new rz(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new an(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function ar(e){let t={};for(let i in e)for(let n in t[i]={},e[i]){let r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][n]=null):t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}return t}function aa(e){let t={};for(let i=0;i<e.length;i++){let n=ar(e[i]);for(let e in n)t[e]=n[e]}return t}function as(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:i3.workingColorSpace}let ao={clone:ar,merge:aa};class al extends rS{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ar(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);for(let i in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class ah extends rn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new nk,this.projectionMatrix=new nk,this.projectionMatrixInverse=new nk,this.coordinateSystem=iR}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let au=new nu,ac=new iG,ad=new iG;class ap extends ah{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*iD*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*iN*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*iD*Math.atan(Math.tan(.5*iN*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){au.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(au.x,au.y).multiplyScalar(-e/au.z),au.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(au.x,au.y).multiplyScalar(-e/au.z)}getViewSize(e,t){return this.getViewBounds(e,ac,ad),t.subVectors(ad,ac)}setViewOffset(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*iN*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/s,n*=a.width/e,i*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class af extends rn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new ap(-90,1,e,t);n.layers=this.layers,this.add(n);let r=new ap(-90,1,e,t);r.layers=this.layers,this.add(r);let a=new ap(-90,1,e,t);a.layers=this.layers,this.add(a);let s=new ap(-90,1,e,t);s.layers=this.layers,this.add(s);let o=new ap(-90,1,e,t);o.layers=this.layers,this.add(o);let l=new ap(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,r,a,s,o]=t;for(let e of t)this.remove(e);if(e===iR)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(e===iP)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,h]=this.children,u=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,r),e.setRenderTarget(i,1,n),e.render(t,a),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,o),e.setRenderTarget(i,4,n),e.render(t,l),i.texture.generateMipmaps=f,e.setRenderTarget(i,5,n),e.render(t,h),e.setRenderTarget(u,c,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class am extends nt{constructor(e,t,i,n,r,a,s,o,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:eg,i,n,r,a,s,o,l,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ag extends nr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1};this.texture=new am([i,i,i,i,i,i],t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:eR}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
2
2
 
3
3
  varying vec3 vWorldDirection;
4
4