@needle-tools/engine 4.11.5 → 4.12.0-next.dd87659
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.
- package/CHANGELOG.md +14 -0
- package/components.needle.json +1 -1
- package/custom-elements.json +420 -0
- package/dist/generateMeshBVH.worker-mO20N_b8.js +21 -0
- package/dist/{gltf-progressive-GwdQV1Qx.umd.cjs → gltf-progressive-DWcmTMCh.umd.cjs} +1 -1
- package/dist/{gltf-progressive-CftVUJy3.min.js → gltf-progressive-DZrY8VT6.min.js} +2 -2
- package/dist/{gltf-progressive-BvlZQAkt.js → gltf-progressive-DgYz5BYa.js} +19 -19
- package/dist/loader.worker-Dip-PthR.js +23 -0
- package/dist/{needle-engine.bundle-DYdft7n9.min.js → needle-engine.bundle-CiL59iU3.min.js} +130 -135
- package/dist/{needle-engine.bundle-DSm5itjo.js → needle-engine.bundle-CiqX7AtA.js} +4368 -4241
- package/dist/{needle-engine.bundle-DMqWdPzL.umd.cjs → needle-engine.bundle-DzYZGJbS.umd.cjs} +138 -143
- package/dist/needle-engine.d.ts +18164 -1
- package/dist/needle-engine.js +336 -335
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-CJC0Npcd.js → postprocessing-BTW9pD_s.js} +1822 -1723
- package/dist/{postprocessing-DrM4PWU3.umd.cjs → postprocessing-CMgoN5t5.umd.cjs} +229 -158
- package/dist/{postprocessing-l7zsdO_Q.min.js → postprocessing-DYDtB188.min.js} +227 -156
- package/dist/rapier-B3oL1ap-.js +5217 -0
- package/dist/rapier-DJ-luMxr.min.js +1 -0
- package/dist/rapier-DQltNJbN.umd.cjs +1 -0
- package/dist/{three-BDW9I486.min.js → three-B7CT31Bt.min.js} +1 -5
- package/dist/{three-MHVqtJYj.js → three-DfMvBzXi.js} +0 -5
- package/dist/{three-examples-CgwGHSgz.umd.cjs → three-examples-CsW4_6LI.umd.cjs} +2 -7
- package/dist/{three-examples-fvEPSC8L.min.js → three-examples-D1P7eEhn.min.js} +2 -7
- package/dist/{three-examples-C5Ht-QFN.js → three-examples-D1SK93ek.js} +1 -7
- package/dist/{three-mesh-ui-BjWTTk1R.js → three-mesh-ui-C_uSB5dD.js} +1 -1
- package/dist/{three-mesh-ui-Bm32sS2a.umd.cjs → three-mesh-ui-DpATDXwU.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-CLdkp21K.min.js → three-mesh-ui-LQ44s0AL.min.js} +1 -1
- package/dist/{three-iFaDq9U3.umd.cjs → three-qj71I7J3.umd.cjs} +2 -6
- package/dist/{vendor-CsyK1CFs.min.js → vendor-BKGa4GE0.min.js} +34 -39
- package/dist/{vendor-petGQl0N.js → vendor-D0zoswDa.js} +1626 -1605
- package/dist/{vendor-6kAXU6fm.umd.cjs → vendor-UCpFAwt1.umd.cjs} +30 -35
- package/lib/engine/api.d.ts +0 -1
- package/lib/engine/api.js +0 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/debug/debug_spector.d.ts +16 -0
- package/lib/engine/debug/debug_spector.js +28 -0
- package/lib/engine/debug/debug_spector.js.map +1 -0
- package/lib/engine/engine_application.d.ts +7 -0
- package/lib/engine/engine_application.js +8 -1
- package/lib/engine/engine_application.js.map +1 -1
- package/lib/engine/engine_context.js +4 -1
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_license.js +1 -1
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_physics.js +6 -2
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +11 -2
- package/lib/engine/engine_physics_rapier.js +9 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_texture.d.ts +1 -1
- package/lib/engine/engine_tonemapping.d.ts +1 -1
- package/lib/engine/engine_types.d.ts +16 -0
- package/lib/engine/engine_typestore.d.ts +1 -0
- package/lib/engine/engine_typestore.js +5 -6
- package/lib/engine/engine_typestore.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +11 -0
- package/lib/engine/webcomponents/logo-element.js +6 -0
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +24 -3
- package/lib/engine/webcomponents/needle menu/needle-menu.js +18 -3
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +5 -0
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +220 -8
- package/lib/engine/webcomponents/needle-engine.js +94 -13
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +2 -1
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +9 -0
- package/lib/engine-components/AlignmentConstraint.js +9 -0
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +1 -0
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AudioListener.d.ts +2 -0
- package/lib/engine-components/AudioListener.js +2 -0
- package/lib/engine-components/AudioListener.js.map +1 -1
- package/lib/engine-components/AudioSource.d.ts +1 -0
- package/lib/engine-components/AudioSource.js +1 -0
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AxesHelper.d.ts +2 -0
- package/lib/engine-components/AxesHelper.js +2 -0
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +1 -0
- package/lib/engine-components/Camera.js +1 -0
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +4 -1
- package/lib/engine-components/CharacterController.js +4 -1
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Component.d.ts +5 -0
- package/lib/engine-components/Component.js +7 -0
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DeleteBox.d.ts +2 -0
- package/lib/engine-components/DeleteBox.js +2 -0
- package/lib/engine-components/DeleteBox.js.map +1 -1
- package/lib/engine-components/DeviceFlag.d.ts +4 -0
- package/lib/engine-components/DeviceFlag.js +4 -0
- package/lib/engine-components/DeviceFlag.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +1 -0
- package/lib/engine-components/DragControls.js +1 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +1 -0
- package/lib/engine-components/DropListener.js +1 -0
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.d.ts +1 -0
- package/lib/engine-components/Duplicatable.js +1 -0
- package/lib/engine-components/Duplicatable.js.map +1 -1
- package/lib/engine-components/EventTrigger.d.ts +2 -0
- package/lib/engine-components/EventTrigger.js +2 -0
- package/lib/engine-components/EventTrigger.js.map +1 -1
- package/lib/engine-components/GridHelper.d.ts +2 -0
- package/lib/engine-components/GridHelper.js +2 -0
- package/lib/engine-components/GridHelper.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +1 -0
- package/lib/engine-components/GroundProjection.js +1 -0
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +2 -0
- package/lib/engine-components/LODGroup.js +2 -0
- package/lib/engine-components/LODGroup.js.map +1 -1
- package/lib/engine-components/Light.d.ts +1 -0
- package/lib/engine-components/Light.js +1 -0
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +1 -0
- package/lib/engine-components/LookAtConstraint.js +1 -0
- package/lib/engine-components/LookAtConstraint.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +1 -0
- package/lib/engine-components/NeedleMenu.js +1 -0
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/NestedGltf.d.ts +1 -0
- package/lib/engine-components/NestedGltf.js +1 -0
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +1 -0
- package/lib/engine-components/Networking.js +1 -0
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/OffsetConstraint.d.ts +7 -0
- package/lib/engine-components/OffsetConstraint.js +7 -0
- package/lib/engine-components/OffsetConstraint.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -0
- package/lib/engine-components/OrbitControls.js +1 -0
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/PlayerColor.d.ts +2 -0
- package/lib/engine-components/PlayerColor.js +2 -0
- package/lib/engine-components/PlayerColor.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +1 -0
- package/lib/engine-components/ReflectionProbe.js +1 -0
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/RendererInstancing.d.ts +5 -3
- package/lib/engine-components/RendererInstancing.js +64 -31
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +1 -0
- package/lib/engine-components/RigidBody.js +1 -0
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.d.ts +1 -0
- package/lib/engine-components/SceneSwitcher.js +1 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/ScreenCapture.d.ts +1 -0
- package/lib/engine-components/ScreenCapture.js +1 -0
- package/lib/engine-components/ScreenCapture.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +1 -0
- package/lib/engine-components/SeeThrough.js +1 -0
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/ShadowCatcher.d.ts +2 -0
- package/lib/engine-components/ShadowCatcher.js +2 -0
- package/lib/engine-components/ShadowCatcher.js.map +1 -1
- package/lib/engine-components/Skybox.d.ts +16 -5
- package/lib/engine-components/Skybox.js +38 -25
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/SmoothFollow.d.ts +1 -0
- package/lib/engine-components/SmoothFollow.js +1 -0
- package/lib/engine-components/SmoothFollow.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.d.ts +1 -0
- package/lib/engine-components/SpatialTrigger.js +1 -0
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +1 -0
- package/lib/engine-components/SpectatorCamera.js +1 -0
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +1 -0
- package/lib/engine-components/SpriteRenderer.js +1 -0
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/SyncedCamera.d.ts +2 -0
- package/lib/engine-components/SyncedCamera.js +2 -0
- package/lib/engine-components/SyncedCamera.js.map +1 -1
- package/lib/engine-components/SyncedRoom.d.ts +1 -0
- package/lib/engine-components/SyncedRoom.js +1 -0
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.d.ts +2 -0
- package/lib/engine-components/SyncedTransform.js +2 -0
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TransformGizmo.d.ts +2 -0
- package/lib/engine-components/TransformGizmo.js +2 -0
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +1 -0
- package/lib/engine-components/VideoPlayer.js +1 -0
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +1 -0
- package/lib/engine-components/Voip.js +1 -0
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +24 -3
- package/lib/engine-components/export/usdz/USDZExporter.js +36 -2
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +18 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +18 -0
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -0
- package/lib/engine-components/particlesystem/ParticleSystem.js +1 -0
- package/lib/engine-components/particlesystem/ParticleSystem.js.map +1 -1
- package/lib/engine-components/physics/Attractor.d.ts +3 -0
- package/lib/engine-components/physics/Attractor.js +3 -0
- package/lib/engine-components/physics/Attractor.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js +1 -0
- package/lib/engine-components/postprocessing/Effects/BloomEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js +4 -0
- package/lib/engine-components/postprocessing/Effects/ChromaticAberration.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.d.ts +3 -0
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js +3 -0
- package/lib/engine-components/postprocessing/Effects/ColorAdjustments.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js +4 -0
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.d.ts +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js +1 -0
- package/lib/engine-components/postprocessing/Effects/EffectWrapper.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.d.ts +3 -0
- package/lib/engine-components/postprocessing/Effects/Pixelation.js +3 -0
- package/lib/engine-components/postprocessing/Effects/Pixelation.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js +4 -0
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Sharpening.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js +4 -0
- package/lib/engine-components/postprocessing/Effects/TiltShiftEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Vignette.d.ts +4 -0
- package/lib/engine-components/postprocessing/Effects/Vignette.js +4 -0
- package/lib/engine-components/postprocessing/Effects/Vignette.js.map +1 -1
- package/lib/engine-components/postprocessing/Volume.d.ts +1 -0
- package/lib/engine-components/postprocessing/Volume.js +1 -0
- package/lib/engine-components/postprocessing/Volume.js.map +1 -1
- package/lib/engine-components/splines/Spline.d.ts +1 -0
- package/lib/engine-components/splines/Spline.js +1 -0
- package/lib/engine-components/splines/Spline.js.map +1 -1
- package/lib/engine-components/splines/SplineWalker.d.ts +1 -0
- package/lib/engine-components/splines/SplineWalker.js +1 -0
- package/lib/engine-components/splines/SplineWalker.js.map +1 -1
- package/lib/engine-components/timeline/PlayableDirector.d.ts +1 -0
- package/lib/engine-components/timeline/PlayableDirector.js +1 -0
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/timeline/SignalAsset.d.ts +1 -0
- package/lib/engine-components/timeline/SignalAsset.js +1 -0
- package/lib/engine-components/timeline/SignalAsset.js.map +1 -1
- package/lib/engine-components/ui/Button.d.ts +4 -0
- package/lib/engine-components/ui/Button.js +4 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +5 -0
- package/lib/engine-components/ui/Canvas.js +5 -0
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/CanvasGroup.d.ts +4 -0
- package/lib/engine-components/ui/CanvasGroup.js +4 -0
- package/lib/engine-components/ui/CanvasGroup.js.map +1 -1
- package/lib/engine-components/ui/EventSystem.d.ts +2 -0
- package/lib/engine-components/ui/EventSystem.js +2 -0
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/lib/engine-components/ui/Image.d.ts +4 -0
- package/lib/engine-components/ui/Image.js +4 -0
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/InputField.d.ts +4 -0
- package/lib/engine-components/ui/InputField.js +4 -0
- package/lib/engine-components/ui/InputField.js.map +1 -1
- package/lib/engine-components/ui/Outline.d.ts +7 -0
- package/lib/engine-components/ui/Outline.js +7 -0
- package/lib/engine-components/ui/Outline.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +1 -0
- package/lib/engine-components/ui/Text.js +1 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +1 -0
- package/lib/engine-components/utils/LookAt.js +1 -0
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/web/Clickthrough.d.ts +1 -1
- package/lib/engine-components/web/Clickthrough.js +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +2 -0
- package/lib/engine-components/web/CursorFollow.js +3 -0
- package/lib/engine-components/web/CursorFollow.js.map +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +1 -0
- package/lib/engine-components/web/HoverAnimation.js +1 -0
- package/lib/engine-components/web/HoverAnimation.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.d.ts +2 -0
- package/lib/engine-components/web/ScrollFollow.js +2 -0
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +1 -0
- package/lib/engine-components/web/ViewBox.js +1 -0
- package/lib/engine-components/web/ViewBox.js.map +1 -1
- package/lib/engine-components/webxr/Avatar.d.ts +5 -0
- package/lib/engine-components/webxr/Avatar.js +5 -0
- package/lib/engine-components/webxr/Avatar.js.map +1 -1
- package/lib/engine-components/webxr/WebARCameraBackground.d.ts +1 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js +1 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.d.ts +1 -0
- package/lib/engine-components/webxr/WebARSessionRoot.js +1 -0
- package/lib/engine-components/webxr/WebARSessionRoot.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +1 -1
- package/lib/engine-components/webxr/WebXR.js +5 -1
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerFollow.d.ts +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +4 -0
- package/lib/engine-components/webxr/controllers/XRControllerModel.js +4 -0
- package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
- package/lib/engine-components/webxr/controllers/XRControllerMovement.d.ts +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js +1 -0
- package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
- package/lib/engine-components-experimental/networking/PlayerSync.d.ts +2 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js +2 -0
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
- package/lib/needle-engine.js +2 -1
- package/lib/needle-engine.js.map +1 -1
- package/package.json +20 -13
- package/plugins/types/needleConfig.d.ts +1 -1
- package/plugins/types/next.d.ts +1 -1
- package/plugins/types/userconfig.d.ts +4 -1
- package/plugins/vite/custom-element-data.js +80 -0
- package/plugins/vite/index.js +4 -0
- package/src/engine/api.ts +0 -1
- package/src/engine/debug/debug_spector.ts +43 -0
- package/src/engine/engine_application.ts +16 -1
- package/src/engine/engine_context.ts +5 -1
- package/src/engine/engine_license.ts +1 -1
- package/src/engine/engine_physics.ts +6 -2
- package/src/engine/engine_physics_rapier.ts +11 -2
- package/src/engine/engine_texture.ts +1 -1
- package/src/engine/engine_tonemapping.ts +1 -1
- package/src/engine/engine_types.ts +17 -0
- package/src/engine/engine_typestore.ts +5 -6
- package/src/engine/webcomponents/logo-element.ts +12 -0
- package/src/engine/webcomponents/needle menu/needle-menu.ts +24 -3
- package/src/engine/webcomponents/needle-button.ts +6 -0
- package/src/engine/webcomponents/needle-engine.ts +331 -22
- package/src/engine/xr/NeedleXRSession.ts +3 -1
- package/src/engine-components/AlignmentConstraint.ts +9 -0
- package/src/engine-components/Animator.ts +1 -0
- package/src/engine-components/AudioListener.ts +2 -0
- package/src/engine-components/AudioSource.ts +1 -0
- package/src/engine-components/AxesHelper.ts +2 -0
- package/src/engine-components/Camera.ts +1 -0
- package/src/engine-components/CharacterController.ts +4 -1
- package/src/engine-components/Component.ts +9 -1
- package/src/engine-components/DeleteBox.ts +2 -0
- package/src/engine-components/DeviceFlag.ts +4 -0
- package/src/engine-components/DragControls.ts +1 -0
- package/src/engine-components/DropListener.ts +1 -0
- package/src/engine-components/Duplicatable.ts +1 -0
- package/src/engine-components/EventTrigger.ts +2 -0
- package/src/engine-components/GridHelper.ts +2 -0
- package/src/engine-components/GroundProjection.ts +1 -0
- package/src/engine-components/LODGroup.ts +2 -0
- package/src/engine-components/Light.ts +1 -0
- package/src/engine-components/LookAtConstraint.ts +1 -0
- package/src/engine-components/NeedleMenu.ts +1 -0
- package/src/engine-components/NestedGltf.ts +1 -0
- package/src/engine-components/Networking.ts +1 -0
- package/src/engine-components/OffsetConstraint.ts +7 -0
- package/src/engine-components/OrbitControls.ts +1 -0
- package/src/engine-components/PlayerColor.ts +2 -0
- package/src/engine-components/ReflectionProbe.ts +1 -0
- package/src/engine-components/RendererInstancing.ts +69 -33
- package/src/engine-components/RigidBody.ts +1 -0
- package/src/engine-components/SceneSwitcher.ts +1 -0
- package/src/engine-components/ScreenCapture.ts +1 -0
- package/src/engine-components/SeeThrough.ts +1 -0
- package/src/engine-components/ShadowCatcher.ts +2 -0
- package/src/engine-components/Skybox.ts +48 -36
- package/src/engine-components/SmoothFollow.ts +1 -0
- package/src/engine-components/SpatialTrigger.ts +1 -0
- package/src/engine-components/SpectatorCamera.ts +1 -0
- package/src/engine-components/SpriteRenderer.ts +1 -0
- package/src/engine-components/SyncedCamera.ts +2 -0
- package/src/engine-components/SyncedRoom.ts +1 -0
- package/src/engine-components/SyncedTransform.ts +2 -0
- package/src/engine-components/TransformGizmo.ts +2 -0
- package/src/engine-components/VideoPlayer.ts +1 -0
- package/src/engine-components/Voip.ts +1 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +52 -5
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +18 -0
- package/src/engine-components/particlesystem/ParticleSystem.ts +1 -0
- package/src/engine-components/physics/Attractor.ts +3 -0
- package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -0
- package/src/engine-components/postprocessing/Effects/ChromaticAberration.ts +4 -0
- package/src/engine-components/postprocessing/Effects/ColorAdjustments.ts +3 -0
- package/src/engine-components/postprocessing/Effects/DepthOfField.ts +4 -0
- package/src/engine-components/postprocessing/Effects/EffectWrapper.ts +1 -0
- package/src/engine-components/postprocessing/Effects/Pixelation.ts +3 -0
- package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Sharpening.ts +4 -0
- package/src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Tonemapping.ts +4 -0
- package/src/engine-components/postprocessing/Effects/Vignette.ts +4 -0
- package/src/engine-components/postprocessing/Volume.ts +1 -0
- package/src/engine-components/splines/Spline.ts +1 -0
- package/src/engine-components/splines/SplineWalker.ts +1 -0
- package/src/engine-components/timeline/PlayableDirector.ts +1 -0
- package/src/engine-components/timeline/SignalAsset.ts +1 -0
- package/src/engine-components/ui/Button.ts +4 -0
- package/src/engine-components/ui/Canvas.ts +5 -0
- package/src/engine-components/ui/CanvasGroup.ts +4 -0
- package/src/engine-components/ui/EventSystem.ts +2 -0
- package/src/engine-components/ui/Image.ts +4 -0
- package/src/engine-components/ui/InputField.ts +4 -0
- package/src/engine-components/ui/Outline.ts +7 -0
- package/src/engine-components/ui/Text.ts +1 -0
- package/src/engine-components/utils/LookAt.ts +1 -0
- package/src/engine-components/web/Clickthrough.ts +1 -1
- package/src/engine-components/web/CursorFollow.ts +4 -0
- package/src/engine-components/web/HoverAnimation.ts +1 -0
- package/src/engine-components/web/ScrollFollow.ts +2 -0
- package/src/engine-components/web/ViewBox.ts +1 -0
- package/src/engine-components/webxr/Avatar.ts +5 -0
- package/src/engine-components/webxr/WebARCameraBackground.ts +1 -0
- package/src/engine-components/webxr/WebARSessionRoot.ts +1 -0
- package/src/engine-components/webxr/WebXR.ts +5 -1
- package/src/engine-components/webxr/controllers/XRControllerFollow.ts +1 -0
- package/src/engine-components/webxr/controllers/XRControllerModel.ts +4 -0
- package/src/engine-components/webxr/controllers/XRControllerMovement.ts +1 -0
- package/src/engine-components-experimental/networking/PlayerSync.ts +2 -0
- package/src/needle-engine.ts +4 -2
- package/dist/generateMeshBVH.worker-B9bjdr6J.js +0 -25
- package/dist/loader.worker-CiTwpNPW.js +0 -27
- package/dist/rapier-BqdcSmKY.umd.cjs +0 -1
- package/dist/rapier-Cg3w3nFI.min.js +0 -1
- package/dist/rapier-sU12SWAs.js +0 -5217
- package/lib/engine/webcomponents/needle-engine.attributes.d.ts +0 -70
- package/lib/engine/webcomponents/needle-engine.attributes.js +0 -2
- package/lib/engine/webcomponents/needle-engine.attributes.js.map +0 -1
- package/src/engine/webcomponents/needle-engine.attributes.ts +0 -85
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";var bA=(function(){var A="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var i=WebAssembly.validate(t)?e:A,n,r=WebAssembly.instantiate(o(i),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var E=new Uint8Array(m.length),C=0;C<m.length;++C){var y=m.charCodeAt(C);E[C]=y>96?y-97:y>64?y-39:y+4}for(var Q=0,C=0;C<m.length;++C)E[Q++]=E[C]<60?s[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,Q)}function a(m,E,C,y,Q,M){var S=n.exports.sbrk,R=C+3&-4,D=S(R*y),O=S(Q.length),H=new Uint8Array(n.exports.memory.buffer);H.set(Q,O);var ae=m(D,C,y,O,Q.length);if(ae==0&&M&&M(D,R,y),E.set(H.subarray(D,D+C*y)),S(D-S(0)),ae!=0)throw new Error("Malformed buffer data: "+ae)}var h={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},c={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],u=0;function d(m){var E={object:new Worker(m),pending:0,requests:{}};return E.object.onmessage=function(C){var y=C.data;E.pending-=y.count,E.requests[y.id][y.action](y.value),delete E.requests[y.id]},E}function g(m){for(var E="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+a.toString()+f.toString(),C=new Blob([E],{type:"text/javascript"}),y=URL.createObjectURL(C),Q=0;Q<m;++Q)l[Q]=d(y);URL.revokeObjectURL(y)}function p(m,E,C,y,Q){for(var M=l[0],S=1;S<l.length;++S)l[S].pending<M.pending&&(M=l[S]);return new Promise(function(R,D){var O=new Uint8Array(C),H=u++;M.pending+=m,M.requests[H]={resolve:R,reject:D},M.object.postMessage({id:H,count:m,size:E,source:O,mode:y,filter:Q},[O.buffer])})}function f(m){r.then(function(){var E=m.data;try{var C=new Uint8Array(E.count*E.size);a(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:E.id,count:E.count,action:"reject",value:y})}})}return{ready:r,supported:!0,useWorkers:function(m){g(m)},decodeVertexBuffer:function(m,E,C,y,Q){a(n.exports.meshopt_decodeVertexBuffer,m,E,C,y,n.exports[h[Q]])},decodeIndexBuffer:function(m,E,C,y){a(n.exports.meshopt_decodeIndexBuffer,m,E,C,y)},decodeIndexSequence:function(m,E,C,y){a(n.exports.meshopt_decodeIndexSequence,m,E,C,y)},decodeGltfBuffer:function(m,E,C,y,Q,M){a(n.exports[c[Q]],m,E,C,y,n.exports[h[M]])},decodeGltfBufferAsync:function(m,E,C,y,Q){return l.length>0?p(m,E,C,c[y],h[Q]):r.then(function(){var M=new Uint8Array(m*E);return a(n.exports[c[y]],M,m,E,C,n.exports[h[Q]]),M})}}})();/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2010-2024 Three.js Authors
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/const Ks="169",Ys=0,Nr=1,yA=2,Rr=1,Fr=100,Dr=204,_r=205,kr=3,EA=0,Ki=0,Lr="attached",CA="detached",vr=300,Gr=301,BA=302,ps=1e3,Et=1001,Yi=1002,Me=1003,Or=1004,xA=1005,ot=1006,QA=1007,kt=1008,xe=1009,wA=1013,Ur=1014,at=1015,Ct=1016,TA=1020,zr=35902,Pr=35899,Xi=1022,At=1023,Zi=1026,Hr=1027,Lt=1028,fs=1030,qr=33776,$i=33777,Vr=33778,en=33779,SA=35840,MA=35842,NA=36196,jr=37492,Jr=37496,Xs=37808,Wr=37812,tn=36492,RA=36495,ms=2300,Is=2301,sn=2302,Kr=2400,Yr=2401,Xr=2402,FA=2500,DA=0,Zr=1,nn=2,rn=0,_A=1,vt="",ne="srgb",ge="srgb-linear",kA="display-p3",$r="display-p3-linear",on="linear",eo="srgb",to="rec709",so="p3",Gt=7680,io=519,Zs=35044,ht=2e3,$s=2001;class Ot{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let n=0,r=i.length;n<r;n++)i[n].call(this,e);e.target=null}}}const he=["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"];let no=1234567;const bs=Math.PI/180,ys=180/Math.PI;function Ne(){const A=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(he[A&255]+he[A>>8&255]+he[A>>16&255]+he[A>>24&255]+"-"+he[e&255]+he[e>>8&255]+"-"+he[e>>16&15|64]+he[e>>24&255]+"-"+he[t&63|128]+he[t>>8&255]+"-"+he[t>>16&255]+he[t>>24&255]+he[s&255]+he[s>>8&255]+he[s>>16&255]+he[s>>24&255]).toLowerCase()}function ce(A,e,t){return Math.max(e,Math.min(t,A))}function an(A,e){return(A%e+e)%e}function LA(A,e,t,s,i){return s+(A-e)*(i-s)/(t-e)}function vA(A,e,t){return A!==e?(t-A)/(e-A):0}function Es(A,e,t){return(1-t)*A+t*e}function GA(A,e,t,s){return Es(A,e,1-Math.exp(-t*s))}function OA(A,e=1){return e-Math.abs(an(A,e*2)-e)}function UA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*(3-2*A))}function zA(A,e,t){return A<=e?0:A>=t?1:(A=(A-e)/(t-e),A*A*A*(A*(A*6-15)+10))}function PA(A,e){return A+Math.floor(Math.random()*(e-A+1))}function HA(A,e){return A+Math.random()*(e-A)}function qA(A){return A*(.5-Math.random())}function VA(A){A!==void 0&&(no=A);let e=no+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function jA(A){return A*bs}function JA(A){return A*ys}function WA(A){return(A&A-1)===0&&A!==0}function KA(A){return Math.pow(2,Math.ceil(Math.log(A)/Math.LN2))}function YA(A){return Math.pow(2,Math.floor(Math.log(A)/Math.LN2))}function XA(A,e,t,s,i){const n=Math.cos,r=Math.sin,o=n(t/2),a=r(t/2),h=n((e+s)/2),c=r((e+s)/2),l=n((e-s)/2),u=r((e-s)/2),d=n((s-e)/2),g=r((s-e)/2);switch(i){case"XYX":A.set(o*c,a*l,a*u,o*h);break;case"YZY":A.set(a*u,o*c,a*l,o*h);break;case"ZXZ":A.set(a*l,a*u,o*c,o*h);break;case"XZX":A.set(o*c,a*g,a*d,o*h);break;case"YXY":A.set(a*d,o*c,a*g,o*h);break;case"ZYZ":A.set(a*g,a*d,o*c,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Re(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return A/4294967295;case Uint16Array:return A/65535;case Uint8Array:return A/255;case Int32Array:return Math.max(A/2147483647,-1);case Int16Array:return Math.max(A/32767,-1);case Int8Array:return Math.max(A/127,-1);default:throw new Error("Invalid component type.")}}function z(A,e){switch(e.constructor){case Float32Array:return A;case Uint32Array:return Math.round(A*4294967295);case Uint16Array:return Math.round(A*65535);case Uint8Array:return Math.round(A*255);case Int32Array:return Math.round(A*2147483647);case Int16Array:return Math.round(A*32767);case Int8Array:return Math.round(A*127);default:throw new Error("Invalid component type.")}}const ro={DEG2RAD:bs,RAD2DEG:ys,generateUUID:Ne,clamp:ce,euclideanModulo:an,mapLinear:LA,inverseLerp:vA,lerp:Es,damp:GA,pingpong:OA,smoothstep:UA,smootherstep:zA,randInt:PA,randFloat:HA,randFloatSpread:qA,seededRandom:VA,degToRad:jA,radToDeg:JA,isPowerOfTwo:WA,ceilPowerOfTwo:KA,floorPowerOfTwo:YA,setQuaternionFromProperEuler:XA,normalize:z,denormalize:Re};class q{constructor(e=0,t=0){q.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 new 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 new 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){const t=this.x,s=this.y,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6],this.y=i[1]*t+i[4]*s+i[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){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}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){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}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,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,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){const s=Math.cos(t),i=Math.sin(t),n=this.x-e.x,r=this.y-e.y;return this.x=n*s-r*i+e.x,this.y=n*i+r*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Fe{constructor(e,t,s,i,n,r,o,a,h){Fe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h)}set(e,t,s,i,n,r,o,a,h){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=n,c[5]=a,c[6]=s,c[7]=r,c[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[3],a=s[6],h=s[1],c=s[4],l=s[7],u=s[2],d=s[5],g=s[8],p=i[0],f=i[3],m=i[6],E=i[1],C=i[4],y=i[7],Q=i[2],M=i[5],S=i[8];return n[0]=r*p+o*E+a*Q,n[3]=r*f+o*C+a*M,n[6]=r*m+o*y+a*S,n[1]=h*p+c*E+l*Q,n[4]=h*f+c*C+l*M,n[7]=h*m+c*y+l*S,n[2]=u*p+d*E+g*Q,n[5]=u*f+d*C+g*M,n[8]=u*m+d*y+g*S,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8];return t*r*c-t*o*h-s*n*c+s*o*a+i*n*h-i*r*a}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=c*r-o*h,u=o*a-c*n,d=h*n-r*a,g=t*l+s*u+i*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const p=1/g;return e[0]=l*p,e[1]=(i*h-c*s)*p,e[2]=(o*s-i*r)*p,e[3]=u*p,e[4]=(c*t-i*a)*p,e[5]=(i*n-o*t)*p,e[6]=d*p,e[7]=(s*a-h*t)*p,e[8]=(r*t-s*n)*p,this}transpose(){let e;const 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){const 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,s,i,n,r,o){const a=Math.cos(n),h=Math.sin(n);return this.set(s*a,s*h,-s*(a*r+h*o)+r+e,-i*h,i*a,-i*(-h*r+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(An.makeScale(e,t)),this}rotate(e){return this.premultiply(An.makeRotation(-e)),this}translate(e,t){return this.premultiply(An.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){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<9;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const An=new Fe;function ZA(A){for(let e=A.length-1;e>=0;--e)if(A[e]>=65535)return!0;return!1}function hn(A){return document.createElementNS("http://www.w3.org/1999/xhtml",A)}const oo=new Fe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),ao=new Fe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Cs={[ge]:{transfer:on,primaries:to,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A,fromReference:A=>A},[ne]:{transfer:eo,primaries:to,luminanceCoefficients:[.2126,.7152,.0722],toReference:A=>A.convertSRGBToLinear(),fromReference:A=>A.convertLinearToSRGB()},[$r]:{transfer:on,primaries:so,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.applyMatrix3(ao),fromReference:A=>A.applyMatrix3(oo)},[kA]:{transfer:eo,primaries:so,luminanceCoefficients:[.2289,.6917,.0793],toReference:A=>A.convertSRGBToLinear().applyMatrix3(ao),fromReference:A=>A.applyMatrix3(oo).convertLinearToSRGB()}},$A=new Set([ge,$r]),le={enabled:!0,_workingColorSpace:ge,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(A){if(!$A.has(A))throw new Error(`Unsupported working color space, "${A}".`);this._workingColorSpace=A},convert:function(A,e,t){if(this.enabled===!1||e===t||!e||!t)return A;const s=Cs[e].toReference,i=Cs[t].fromReference;return i(s(A))},fromWorkingColorSpace:function(A,e){return this.convert(A,this._workingColorSpace,e)},toWorkingColorSpace:function(A,e){return this.convert(A,e,this._workingColorSpace)},getPrimaries:function(A){return Cs[A].primaries},getTransfer:function(A){return A===vt?on:Cs[A].transfer},getLuminanceCoefficients:function(A,e=this._workingColorSpace){return A.fromArray(Cs[e].luminanceCoefficients)}};function Ut(A){return A<.04045?A*.0773993808:Math.pow(A*.9478672986+.0521327014,2.4)}function cn(A){return A<.0031308?A*12.92:1.055*Math.pow(A,.41666)-.055}let zt;class eh{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{zt===void 0&&(zt=hn("canvas")),zt.width=e.width,zt.height=e.height;const s=zt.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=zt}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=hn("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),n=i.data;for(let r=0;r<n.length;r++)n[r]=Ut(n[r]/255)*255;return s.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let s=0;s<t.length;s++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[s]=Math.floor(Ut(t[s]/255)*255):t[s]=Ut(t[s]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let th=0;class Ao{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:th++}),this.uuid=Ne(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const s={uuid:this.uuid,url:""},i=this.data;if(i!==null){let n;if(Array.isArray(i)){n=[];for(let r=0,o=i.length;r<o;r++)i[r].isDataTexture?n.push(ln(i[r].image)):n.push(ln(i[r]))}else n=ln(i);s.url=n}return t||(e.images[this.uuid]=s),s}}function ln(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap?eh.getDataURL(A):A.data?{data:Array.from(A.data),width:A.width,height:A.height,type:A.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let sh=0;class ue extends Ot{constructor(e=ue.DEFAULT_IMAGE,t=ue.DEFAULT_MAPPING,s=Et,i=Et,n=ot,r=kt,o=At,a=xe,h=ue.DEFAULT_ANISOTROPY,c=vt){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:sh++}),this.uuid=Ne(),this.name="",this.source=new Ao(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=s,this.wrapT=i,this.magFilter=n,this.minFilter=r,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new q(0,0),this.repeat=new q(1,1),this.center=new q(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,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){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const s={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&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==vr)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ps:e.x=e.x-Math.floor(e.x);break;case Et:e.x=e.x<0?0:1;break;case Yi:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ps:e.y=e.y-Math.floor(e.y);break;case Et:e.y=e.y<0?0:1;break;case Yi:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}ue.DEFAULT_IMAGE=null,ue.DEFAULT_MAPPING=vr,ue.DEFAULT_ANISOTROPY=4;class K{constructor(e=0,t=0,s=0,i=1){K.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=i}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,s,i){return this.x=e,this.y=t,this.z=s,this.w=i,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 new 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 new 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=e.w!==void 0?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){const t=this.x,s=this.y,i=this.z,n=this.w,r=e.elements;return this.x=r[0]*t+r[4]*s+r[8]*i+r[12]*n,this.y=r[1]*t+r[5]*s+r[9]*i+r[13]*n,this.z=r[2]*t+r[6]*s+r[10]*i+r[14]*n,this.w=r[3]*t+r[7]*s+r[11]*i+r[15]*n,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,s,i,n;const a=e.elements,h=a[0],c=a[4],l=a[8],u=a[1],d=a[5],g=a[9],p=a[2],f=a[6],m=a[10];if(Math.abs(c-u)<.01&&Math.abs(l-p)<.01&&Math.abs(g-f)<.01){if(Math.abs(c+u)<.1&&Math.abs(l+p)<.1&&Math.abs(g+f)<.1&&Math.abs(h+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const C=(h+1)/2,y=(d+1)/2,Q=(m+1)/2,M=(c+u)/4,S=(l+p)/4,R=(g+f)/4;return C>y&&C>Q?C<.01?(s=0,i=.707106781,n=.707106781):(s=Math.sqrt(C),i=M/s,n=S/s):y>Q?y<.01?(s=.707106781,i=0,n=.707106781):(i=Math.sqrt(y),s=M/i,n=R/i):Q<.01?(s=.707106781,i=.707106781,n=0):(n=Math.sqrt(Q),s=S/n,i=R/n),this.set(s,i,n,t),this}let E=Math.sqrt((f-g)*(f-g)+(l-p)*(l-p)+(u-c)*(u-c));return Math.abs(E)<.001&&(E=1),this.x=(f-g)/E,this.y=(l-p)/E,this.z=(u-c)/E,this.w=Math.acos((h+d+m-1)/2),this}setFromMatrixPosition(e){const 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){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}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,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,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 ho extends Ot{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new K(0,0,e,t),this.scissorTest=!1,this.viewport=new K(0,0,e,t);const i={width:e,height:t,depth:1};s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ot,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},s);const n=new ue(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace);n.flipY=!1,n.generateMipmaps=s.generateMipmaps,n.internalFormat=s.internalFormat,this.textures=[];const r=s.count;for(let o=0;o<r;o++)this.textures[o]=n.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,s=1){if(this.width!==e||this.height!==t||this.depth!==s){this.width=e,this.height=t,this.depth=s;for(let i=0,n=this.textures.length;i<n;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=s;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 s=0,i=e.textures.length;s<i;s++)this.textures[s]=e.textures[s].clone(),this.textures[s].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Ao(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ih extends ue{constructor(e=null,t=1,s=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=Me,this.minFilter=Me,this.wrapR=Et,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ct{constructor(e=0,t=0,s=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=i}static slerpFlat(e,t,s,i,n,r,o){let a=s[i+0],h=s[i+1],c=s[i+2],l=s[i+3];const u=n[r+0],d=n[r+1],g=n[r+2],p=n[r+3];if(o===0){e[t+0]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l;return}if(o===1){e[t+0]=u,e[t+1]=d,e[t+2]=g,e[t+3]=p;return}if(l!==p||a!==u||h!==d||c!==g){let f=1-o;const m=a*u+h*d+c*g+l*p,E=m>=0?1:-1,C=1-m*m;if(C>Number.EPSILON){const Q=Math.sqrt(C),M=Math.atan2(Q,m*E);f=Math.sin(f*M)/Q,o=Math.sin(o*M)/Q}const y=o*E;if(a=a*f+u*y,h=h*f+d*y,c=c*f+g*y,l=l*f+p*y,f===1-o){const Q=1/Math.sqrt(a*a+h*h+c*c+l*l);a*=Q,h*=Q,c*=Q,l*=Q}}e[t]=a,e[t+1]=h,e[t+2]=c,e[t+3]=l}static multiplyQuaternionsFlat(e,t,s,i,n,r){const o=s[i],a=s[i+1],h=s[i+2],c=s[i+3],l=n[r],u=n[r+1],d=n[r+2],g=n[r+3];return e[t]=o*g+c*l+a*d-h*u,e[t+1]=a*g+c*u+h*l-o*d,e[t+2]=h*g+c*d+o*u-a*l,e[t+3]=c*g-o*l-a*u-h*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,s,i){return this._x=e,this._y=t,this._z=s,this._w=i,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){const s=e._x,i=e._y,n=e._z,r=e._order,o=Math.cos,a=Math.sin,h=o(s/2),c=o(i/2),l=o(n/2),u=a(s/2),d=a(i/2),g=a(n/2);switch(r){case"XYZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"YXZ":this._x=u*c*l+h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"ZXY":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l-u*d*g;break;case"ZYX":this._x=u*c*l-h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l+u*d*g;break;case"YZX":this._x=u*c*l+h*d*g,this._y=h*d*l+u*c*g,this._z=h*c*g-u*d*l,this._w=h*c*l-u*d*g;break;case"XZY":this._x=u*c*l-h*d*g,this._y=h*d*l-u*c*g,this._z=h*c*g+u*d*l,this._w=h*c*l+u*d*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],i=t[4],n=t[8],r=t[1],o=t[5],a=t[9],h=t[2],c=t[6],l=t[10],u=s+o+l;if(u>0){const d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(c-a)*d,this._y=(n-h)*d,this._z=(r-i)*d}else if(s>o&&s>l){const d=2*Math.sqrt(1+s-o-l);this._w=(c-a)/d,this._x=.25*d,this._y=(i+r)/d,this._z=(n+h)/d}else if(o>l){const d=2*Math.sqrt(1+o-s-l);this._w=(n-h)/d,this._x=(i+r)/d,this._y=.25*d,this._z=(a+c)/d}else{const d=2*Math.sqrt(1+l-s-o);this._w=(r-i)/d,this._x=(n+h)/d,this._y=(a+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return s<Number.EPSILON?(s=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(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=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ce(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,t/s);return this.slerp(e,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 e===0?(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){const s=e._x,i=e._y,n=e._z,r=e._w,o=t._x,a=t._y,h=t._z,c=t._w;return this._x=s*c+r*o+i*h-n*a,this._y=i*c+r*a+n*o-s*h,this._z=n*c+r*h+s*a-i*o,this._w=r*c-s*o-i*a-n*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,i=this._y,n=this._z,r=this._w;let o=r*e._w+s*e._x+i*e._y+n*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=s,this._y=i,this._z=n,this;const a=1-o*o;if(a<=Number.EPSILON){const d=1-t;return this._w=d*r+t*this._w,this._x=d*s+t*this._x,this._y=d*i+t*this._y,this._z=d*n+t*this._z,this.normalize(),this}const h=Math.sqrt(a),c=Math.atan2(h,o),l=Math.sin((1-t)*c)/h,u=Math.sin(t*c)/h;return this._w=r*l+this._w*u,this._x=s*l+this._x*u,this._y=i*l+this._y*u,this._z=n*l+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),n=Math.sqrt(s);return this.set(i*Math.sin(e),i*Math.cos(e),n*Math.sin(t),n*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 b{constructor(e=0,t=0,s=0){b.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,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 new 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 new 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(co.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(co.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[3]*s+n[6]*i,this.y=n[1]*t+n[4]*s+n[7]*i,this.z=n[2]*t+n[5]*s+n[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,n=e.elements,r=1/(n[3]*t+n[7]*s+n[11]*i+n[15]);return this.x=(n[0]*t+n[4]*s+n[8]*i+n[12])*r,this.y=(n[1]*t+n[5]*s+n[9]*i+n[13])*r,this.z=(n[2]*t+n[6]*s+n[10]*i+n[14])*r,this}applyQuaternion(e){const t=this.x,s=this.y,i=this.z,n=e.x,r=e.y,o=e.z,a=e.w,h=2*(r*i-o*s),c=2*(o*t-n*i),l=2*(n*s-r*t);return this.x=t+a*h+r*l-o*c,this.y=s+a*c+o*h-n*l,this.z=i+a*l+n*c-r*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,s=this.y,i=this.z,n=e.elements;return this.x=n[0]*t+n[4]*s+n[8]*i,this.y=n[1]*t+n[5]*s+n[9]*i,this.z=n[2]*t+n[6]*s+n[10]*i,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){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}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,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,i=e.y,n=e.z,r=t.x,o=t.y,a=t.z;return this.x=i*a-n*o,this.y=n*r-s*a,this.z=s*o-i*r,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return un.copy(this).projectOnVector(e),this.sub(un)}reflect(e){return this.sub(un.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(ce(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return t*t+s*s+i*i}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,s){const i=Math.sin(t)*e;return this.x=i*Math.sin(s),this.y=Math.cos(t)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,s=Math.sqrt(1-t*t);return this.x=s*Math.cos(e),this.y=t,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const un=new b,co=new ct;class We{constructor(e=new b(1/0,1/0,1/0),t=new b(-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,s=e.length;t<s;t+=3)this.expandByPoint(De.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,s=e.count;t<s;t++)this.expandByPoint(De.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,s=e.length;t<s;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const s=De.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(s),this.max.copy(e).add(s),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=1/0,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);const s=e.geometry;if(s!==void 0){const n=s.getAttribute("position");if(t===!0&&n!==void 0&&e.isInstancedMesh!==!0)for(let r=0,o=n.count;r<o;r++)e.isMesh===!0?e.getVertexPosition(r,De):De.fromBufferAttribute(n,r),De.applyMatrix4(e.matrixWorld),this.expandByPoint(De);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ei.copy(e.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),ei.copy(s.boundingBox)),ei.applyMatrix4(e.matrixWorld),this.union(ei)}const i=e.children;for(let n=0,r=i.length;n<r;n++)this.expandByObject(i[n],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,De),De.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Bs),ti.subVectors(this.max,Bs),Pt.subVectors(e.a,Bs),Ht.subVectors(e.b,Bs),qt.subVectors(e.c,Bs),lt.subVectors(Ht,Pt),ut.subVectors(qt,Ht),Bt.subVectors(Pt,qt);let t=[0,-lt.z,lt.y,0,-ut.z,ut.y,0,-Bt.z,Bt.y,lt.z,0,-lt.x,ut.z,0,-ut.x,Bt.z,0,-Bt.x,-lt.y,lt.x,0,-ut.y,ut.x,0,-Bt.y,Bt.x,0];return!dn(t,Pt,Ht,qt,ti)||(t=[1,0,0,0,1,0,0,0,1],!dn(t,Pt,Ht,qt,ti))?!1:(si.crossVectors(lt,ut),t=[si.x,si.y,si.z],dn(t,Pt,Ht,qt,ti))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,De).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(De).length()*.5),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()?this:(Ke[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ke[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ke[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ke[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ke[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ke[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ke[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ke[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ke),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)}}const Ke=[new b,new b,new b,new b,new b,new b,new b,new b],De=new b,ei=new We,Pt=new b,Ht=new b,qt=new b,lt=new b,ut=new b,Bt=new b,Bs=new b,ti=new b,si=new b,xt=new b;function dn(A,e,t,s,i){for(let n=0,r=A.length-3;n<=r;n+=3){xt.fromArray(A,n);const o=i.x*Math.abs(xt.x)+i.y*Math.abs(xt.y)+i.z*Math.abs(xt.z),a=e.dot(xt),h=t.dot(xt),c=s.dot(xt);if(Math.max(-Math.max(a,h,c),Math.min(a,h,c))>o)return!1}return!0}const nh=new We,xs=new b,gn=new b;class Oe{constructor(e=new b,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){const s=this.center;t!==void 0?s.copy(t):nh.setFromPoints(e).getCenter(s);let i=0;for(let n=0,r=e.length;n<r;n++)i=Math.max(i,s.distanceToSquared(e[n]));return this.radius=Math.sqrt(i),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){const 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){const s=this.center.distanceToSquared(e);return t.copy(e),s>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):(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;xs.subVectors(e,this.center);const t=xs.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),i=(s-this.radius)*.5;this.center.addScaledVector(xs,i/s),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(gn.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(xs.copy(e.center).add(gn)),this.expandByPoint(xs.copy(e.center).sub(gn))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ye=new b,pn=new b,ii=new b,dt=new b,fn=new b,ni=new b,mn=new b;class ri{constructor(e=new b,t=new b(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,Ye)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ye.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ye.copy(this.origin).addScaledVector(this.direction,t),Ye.distanceToSquared(e))}distanceSqToSegment(e,t,s,i){pn.copy(e).add(t).multiplyScalar(.5),ii.copy(t).sub(e).normalize(),dt.copy(this.origin).sub(pn);const n=e.distanceTo(t)*.5,r=-this.direction.dot(ii),o=dt.dot(this.direction),a=-dt.dot(ii),h=dt.lengthSq(),c=Math.abs(1-r*r);let l,u,d,g;if(c>0)if(l=r*a-o,u=r*o-a,g=n*c,l>=0)if(u>=-g)if(u<=g){const p=1/c;l*=p,u*=p,d=l*(l+r*u+2*o)+u*(r*l+u+2*a)+h}else u=n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u=-n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;else u<=-g?(l=Math.max(0,-(-r*n+o)),u=l>0?-n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h):u<=g?(l=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+h):(l=Math.max(0,-(r*n+o)),u=l>0?n:Math.min(Math.max(-n,-a),n),d=-l*l+u*(u+2*a)+h);else u=r>0?-n:n,l=Math.max(0,-(r*u+o)),d=-l*l+u*(u+2*a)+h;return s&&s.copy(this.origin).addScaledVector(this.direction,l),i&&i.copy(pn).addScaledVector(ii,u),d}intersectSphere(e,t){Ye.subVectors(e.center,this.origin);const s=Ye.dot(this.direction),i=Ye.dot(Ye)-s*s,n=e.radius*e.radius;if(i>n)return null;const r=Math.sqrt(n-i),o=s-r,a=s+r;return a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,i,n,r,o,a;const h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return h>=0?(s=(e.min.x-u.x)*h,i=(e.max.x-u.x)*h):(s=(e.max.x-u.x)*h,i=(e.min.x-u.x)*h),c>=0?(n=(e.min.y-u.y)*c,r=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,r=(e.min.y-u.y)*c),s>r||n>i||((n>s||isNaN(s))&&(s=n),(r<i||isNaN(i))&&(i=r),l>=0?(o=(e.min.z-u.z)*l,a=(e.max.z-u.z)*l):(o=(e.max.z-u.z)*l,a=(e.min.z-u.z)*l),s>a||o>i)||((o>s||s!==s)&&(s=o),(a<i||i!==i)&&(i=a),i<0)?null:this.at(s>=0?s:i,t)}intersectsBox(e){return this.intersectBox(e,Ye)!==null}intersectTriangle(e,t,s,i,n){fn.subVectors(t,e),ni.subVectors(s,e),mn.crossVectors(fn,ni);let r=this.direction.dot(mn),o;if(r>0){if(i)return null;o=1}else if(r<0)o=-1,r=-r;else return null;dt.subVectors(this.origin,e);const a=o*this.direction.dot(ni.crossVectors(dt,ni));if(a<0)return null;const h=o*this.direction.dot(fn.cross(dt));if(h<0||a+h>r)return null;const c=-o*dt.dot(mn);return c<0?null:this.at(c/r,n)}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 k{constructor(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){k.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f)}set(e,t,s,i,n,r,o,a,h,c,l,u,d,g,p,f){const m=this.elements;return m[0]=e,m[4]=t,m[8]=s,m[12]=i,m[1]=n,m[5]=r,m[9]=o,m[13]=a,m[2]=h,m[6]=c,m[10]=l,m[14]=u,m[3]=d,m[7]=g,m[11]=p,m[15]=f,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 k().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const 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,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,i=1/Vt.setFromMatrixColumn(e,0).length(),n=1/Vt.setFromMatrixColumn(e,1).length(),r=1/Vt.setFromMatrixColumn(e,2).length();return t[0]=s[0]*i,t[1]=s[1]*i,t[2]=s[2]*i,t[3]=0,t[4]=s[4]*n,t[5]=s[5]*n,t[6]=s[6]*n,t[7]=0,t[8]=s[8]*r,t[9]=s[9]*r,t[10]=s[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,i=e.y,n=e.z,r=Math.cos(s),o=Math.sin(s),a=Math.cos(i),h=Math.sin(i),c=Math.cos(n),l=Math.sin(n);if(e.order==="XYZ"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=-a*l,t[8]=h,t[1]=d+g*h,t[5]=u-p*h,t[9]=-o*a,t[2]=p-u*h,t[6]=g+d*h,t[10]=r*a}else if(e.order==="YXZ"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u+p*o,t[4]=g*o-d,t[8]=r*h,t[1]=r*l,t[5]=r*c,t[9]=-o,t[2]=d*o-g,t[6]=p+u*o,t[10]=r*a}else if(e.order==="ZXY"){const u=a*c,d=a*l,g=h*c,p=h*l;t[0]=u-p*o,t[4]=-r*l,t[8]=g+d*o,t[1]=d+g*o,t[5]=r*c,t[9]=p-u*o,t[2]=-r*h,t[6]=o,t[10]=r*a}else if(e.order==="ZYX"){const u=r*c,d=r*l,g=o*c,p=o*l;t[0]=a*c,t[4]=g*h-d,t[8]=u*h+p,t[1]=a*l,t[5]=p*h+u,t[9]=d*h-g,t[2]=-h,t[6]=o*a,t[10]=r*a}else if(e.order==="YZX"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=p-u*l,t[8]=g*l+d,t[1]=l,t[5]=r*c,t[9]=-o*c,t[2]=-h*c,t[6]=d*l+g,t[10]=u-p*l}else if(e.order==="XZY"){const u=r*a,d=r*h,g=o*a,p=o*h;t[0]=a*c,t[4]=-l,t[8]=h*c,t[1]=u*l+p,t[5]=r*c,t[9]=d*l-g,t[2]=g*l-d,t[6]=o*c,t[10]=p*l+u}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(rh,e,oh)}lookAt(e,t,s){const i=this.elements;return be.subVectors(e,t),be.lengthSq()===0&&(be.z=1),be.normalize(),gt.crossVectors(s,be),gt.lengthSq()===0&&(Math.abs(s.z)===1?be.x+=1e-4:be.z+=1e-4,be.normalize(),gt.crossVectors(s,be)),gt.normalize(),oi.crossVectors(be,gt),i[0]=gt.x,i[4]=oi.x,i[8]=be.x,i[1]=gt.y,i[5]=oi.y,i[9]=be.y,i[2]=gt.z,i[6]=oi.z,i[10]=be.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,n=this.elements,r=s[0],o=s[4],a=s[8],h=s[12],c=s[1],l=s[5],u=s[9],d=s[13],g=s[2],p=s[6],f=s[10],m=s[14],E=s[3],C=s[7],y=s[11],Q=s[15],M=i[0],S=i[4],R=i[8],D=i[12],O=i[1],H=i[5],ae=i[9],W=i[13],Ae=i[2],Ve=i[6],Be=i[10],nt=i[14],je=i[3],Je=i[7],rt=i[11],V=i[15];return n[0]=r*M+o*O+a*Ae+h*je,n[4]=r*S+o*H+a*Ve+h*Je,n[8]=r*R+o*ae+a*Be+h*rt,n[12]=r*D+o*W+a*nt+h*V,n[1]=c*M+l*O+u*Ae+d*je,n[5]=c*S+l*H+u*Ve+d*Je,n[9]=c*R+l*ae+u*Be+d*rt,n[13]=c*D+l*W+u*nt+d*V,n[2]=g*M+p*O+f*Ae+m*je,n[6]=g*S+p*H+f*Ve+m*Je,n[10]=g*R+p*ae+f*Be+m*rt,n[14]=g*D+p*W+f*nt+m*V,n[3]=E*M+C*O+y*Ae+Q*je,n[7]=E*S+C*H+y*Ve+Q*Je,n[11]=E*R+C*ae+y*Be+Q*rt,n[15]=E*D+C*W+y*nt+Q*V,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],s=e[4],i=e[8],n=e[12],r=e[1],o=e[5],a=e[9],h=e[13],c=e[2],l=e[6],u=e[10],d=e[14],g=e[3],p=e[7],f=e[11],m=e[15];return g*(+n*a*l-i*h*l-n*o*u+s*h*u+i*o*d-s*a*d)+p*(+t*a*d-t*h*u+n*r*u-i*r*d+i*h*c-n*a*c)+f*(+t*h*l-t*o*d-n*r*l+s*r*d+n*o*c-s*h*c)+m*(-i*o*c-t*a*l+t*o*u+i*r*l-s*r*u+s*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],i=e[2],n=e[3],r=e[4],o=e[5],a=e[6],h=e[7],c=e[8],l=e[9],u=e[10],d=e[11],g=e[12],p=e[13],f=e[14],m=e[15],E=l*f*h-p*u*h+p*a*d-o*f*d-l*a*m+o*u*m,C=g*u*h-c*f*h-g*a*d+r*f*d+c*a*m-r*u*m,y=c*p*h-g*l*h+g*o*d-r*p*d-c*o*m+r*l*m,Q=g*l*a-c*p*a-g*o*u+r*p*u+c*o*f-r*l*f,M=t*E+s*C+i*y+n*Q;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/M;return e[0]=E*S,e[1]=(p*u*n-l*f*n-p*i*d+s*f*d+l*i*m-s*u*m)*S,e[2]=(o*f*n-p*a*n+p*i*h-s*f*h-o*i*m+s*a*m)*S,e[3]=(l*a*n-o*u*n-l*i*h+s*u*h+o*i*d-s*a*d)*S,e[4]=C*S,e[5]=(c*f*n-g*u*n+g*i*d-t*f*d-c*i*m+t*u*m)*S,e[6]=(g*a*n-r*f*n-g*i*h+t*f*h+r*i*m-t*a*m)*S,e[7]=(r*u*n-c*a*n+c*i*h-t*u*h-r*i*d+t*a*d)*S,e[8]=y*S,e[9]=(g*l*n-c*p*n-g*s*d+t*p*d+c*s*m-t*l*m)*S,e[10]=(r*p*n-g*o*n+g*s*h-t*p*h-r*s*m+t*o*m)*S,e[11]=(c*o*n-r*l*n-c*s*h+t*l*h+r*s*d-t*o*d)*S,e[12]=Q*S,e[13]=(c*p*i-g*l*i+g*s*u-t*p*u-c*s*f+t*l*f)*S,e[14]=(g*o*i-r*p*i-g*s*a+t*p*a+r*s*f-t*o*f)*S,e[15]=(r*l*i-c*o*i+c*s*a-t*l*a-r*s*u+t*o*u)*S,this}scale(e){const t=this.elements,s=e.x,i=e.y,n=e.z;return t[0]*=s,t[4]*=i,t[8]*=n,t[1]*=s,t[5]*=i,t[9]*=n,t[2]*=s,t[6]*=i,t[10]*=n,t[3]*=s,t[7]*=i,t[11]*=n,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,i))}makeTranslation(e,t,s){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,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),i=Math.sin(t),n=1-s,r=e.x,o=e.y,a=e.z,h=n*r,c=n*o;return this.set(h*r+s,h*o-i*a,h*a+i*o,0,h*o+i*a,c*o+s,c*a-i*r,0,h*a-i*o,c*a+i*r,n*a*a+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,i,n,r){return this.set(1,s,n,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,s){const i=this.elements,n=t._x,r=t._y,o=t._z,a=t._w,h=n+n,c=r+r,l=o+o,u=n*h,d=n*c,g=n*l,p=r*c,f=r*l,m=o*l,E=a*h,C=a*c,y=a*l,Q=s.x,M=s.y,S=s.z;return i[0]=(1-(p+m))*Q,i[1]=(d+y)*Q,i[2]=(g-C)*Q,i[3]=0,i[4]=(d-y)*M,i[5]=(1-(u+m))*M,i[6]=(f+E)*M,i[7]=0,i[8]=(g+C)*S,i[9]=(f-E)*S,i[10]=(1-(u+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,s){const i=this.elements;let n=Vt.set(i[0],i[1],i[2]).length();const r=Vt.set(i[4],i[5],i[6]).length(),o=Vt.set(i[8],i[9],i[10]).length();this.determinant()<0&&(n=-n),e.x=i[12],e.y=i[13],e.z=i[14],_e.copy(this);const h=1/n,c=1/r,l=1/o;return _e.elements[0]*=h,_e.elements[1]*=h,_e.elements[2]*=h,_e.elements[4]*=c,_e.elements[5]*=c,_e.elements[6]*=c,_e.elements[8]*=l,_e.elements[9]*=l,_e.elements[10]*=l,t.setFromRotationMatrix(_e),s.x=n,s.y=r,s.z=o,this}makePerspective(e,t,s,i,n,r,o=ht){const a=this.elements,h=2*n/(t-e),c=2*n/(s-i),l=(t+e)/(t-e),u=(s+i)/(s-i);let d,g;if(o===ht)d=-(r+n)/(r-n),g=-2*r*n/(r-n);else if(o===$s)d=-r/(r-n),g=-r*n/(r-n);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return a[0]=h,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=g,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,s,i,n,r,o=ht){const a=this.elements,h=1/(t-e),c=1/(s-i),l=1/(r-n),u=(t+e)*h,d=(s+i)*c;let g,p;if(o===ht)g=(r+n)*l,p=-2*l;else if(o===$s)g=n*l,p=-1*l;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return a[0]=2*h,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=p,a[14]=-g,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<16;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const Vt=new b,_e=new k,rh=new b(0,0,0),oh=new b(1,1,1),gt=new b,oi=new b,be=new b,lo=new k,uo=new ct;class jt{constructor(e=0,t=0,s=0,i=jt.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=i}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,s,i=this._order){return this._x=e,this._y=t,this._z=s,this._order=i,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,s=!0){const i=e.elements,n=i[0],r=i[4],o=i[8],a=i[1],h=i[5],c=i[9],l=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(ce(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,n)):(this._x=Math.atan2(u,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-l,n),this._z=0);break;case"ZXY":this._x=Math.asin(ce(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-ce(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(ce(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-l,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ce(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(u,h),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return lo.makeRotationFromQuaternion(e),this.setFromRotationMatrix(lo,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return uo.setFromEuler(this),this.setFromQuaternion(uo,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],e[3]!==void 0&&(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}}jt.DEFAULT_ORDER="XYZ";class ah{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 Ah=0;const go=new b,Jt=new ct,Xe=new k,ai=new b,Qs=new b,hh=new b,ch=new ct,po=new b(1,0,0),fo=new b(0,1,0),mo=new b(0,0,1),Io={type:"added"},lh={type:"removed"},Wt={type:"childadded",child:null},In={type:"childremoved",child:null};class Y extends Ot{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Ah++}),this.uuid=Ne(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Y.DEFAULT_UP.clone();const e=new b,t=new jt,s=new ct,i=new b(1,1,1);function n(){s.setFromEuler(t,!1)}function r(){t.setFromQuaternion(s,void 0,!1)}t._onChange(n),s._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new k},normalMatrix:{value:new Fe}}),this.matrix=new k,this.matrixWorld=new k,this.matrixAutoUpdate=Y.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ah,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 Jt.setFromAxisAngle(e,t),this.quaternion.multiply(Jt),this}rotateOnWorldAxis(e,t){return Jt.setFromAxisAngle(e,t),this.quaternion.premultiply(Jt),this}rotateX(e){return this.rotateOnAxis(po,e)}rotateY(e){return this.rotateOnAxis(fo,e)}rotateZ(e){return this.rotateOnAxis(mo,e)}translateOnAxis(e,t){return go.copy(e).applyQuaternion(this.quaternion),this.position.add(go.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(po,e)}translateY(e){return this.translateOnAxis(fo,e)}translateZ(e){return this.translateOnAxis(mo,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Xe.copy(this.matrixWorld).invert())}lookAt(e,t,s){e.isVector3?ai.copy(e):ai.set(e,t,s);const i=this.parent;this.updateWorldMatrix(!0,!1),Qs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xe.lookAt(Qs,ai,this.up):Xe.lookAt(ai,Qs,this.up),this.quaternion.setFromRotationMatrix(Xe),i&&(Xe.extractRotation(i.matrixWorld),Jt.setFromRotationMatrix(Xe),this.quaternion.premultiply(Jt.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Io),Wt.child=e,this.dispatchEvent(Wt),Wt.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(lh),In.child=e,this.dispatchEvent(In),In.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Xe.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Xe.multiply(e.parent.matrixWorld)),e.applyMatrix4(Xe),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Io),Wt.child=e,this.dispatchEvent(Wt),Wt.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 s=0,i=this.children.length;s<i;s++){const r=this.children[s].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,s=[]){this[e]===t&&s.push(this);const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].getObjectsByProperty(e,t,s);return s}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qs,e,hh),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qs,ch,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(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)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let s=0,i=t.length;s<i;s++)t[s].updateMatrixWorld(e)}updateWorldMatrix(e,t){const s=this.parent;if(e===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let n=0,r=i.length;n<r;n++)i[n].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",s={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function n(o,a){return o[a.uuid]===void 0&&(o[a.uuid]=a.toJSON(e)),a.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=n(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const a=o.shapes;if(Array.isArray(a))for(let h=0,c=a.length;h<c;h++){const l=a[h];n(e.shapes,l)}else n(e.shapes,a)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(n(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let a=0,h=this.material.length;a<h;a++)o.push(n(e.materials,this.material[a]));i.material=o}else i.material=n(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const a=this.animations[o];i.animations.push(n(e.animations,a))}}if(t){const o=r(e.geometries),a=r(e.materials),h=r(e.textures),c=r(e.images),l=r(e.shapes),u=r(e.skeletons),d=r(e.animations),g=r(e.nodes);o.length>0&&(s.geometries=o),a.length>0&&(s.materials=a),h.length>0&&(s.textures=h),c.length>0&&(s.images=c),l.length>0&&(s.shapes=l),u.length>0&&(s.skeletons=u),d.length>0&&(s.animations=d),g.length>0&&(s.nodes=g)}return s.object=i,s;function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}}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)),t===!0)for(let s=0;s<e.children.length;s++){const i=e.children[s];this.add(i.clone())}return this}}Y.DEFAULT_UP=new b(0,1,0),Y.DEFAULT_MATRIX_AUTO_UPDATE=!0,Y.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ke=new b,Ze=new b,bn=new b,$e=new b,Kt=new b,Yt=new b,bo=new b,yn=new b,En=new b,Cn=new b,Bn=new K,xn=new K,Qn=new K;class Le{constructor(e=new b,t=new b,s=new b){this.a=e,this.b=t,this.c=s}static getNormal(e,t,s,i){i.subVectors(s,t),ke.subVectors(e,t),i.cross(ke);const n=i.lengthSq();return n>0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(e,t,s,i,n){ke.subVectors(i,t),Ze.subVectors(s,t),bn.subVectors(e,t);const r=ke.dot(ke),o=ke.dot(Ze),a=ke.dot(bn),h=Ze.dot(Ze),c=Ze.dot(bn),l=r*h-o*o;if(l===0)return n.set(0,0,0),null;const u=1/l,d=(h*a-o*c)*u,g=(r*c-o*a)*u;return n.set(1-d-g,g,d)}static containsPoint(e,t,s,i){return this.getBarycoord(e,t,s,i,$e)===null?!1:$e.x>=0&&$e.y>=0&&$e.x+$e.y<=1}static getInterpolation(e,t,s,i,n,r,o,a){return this.getBarycoord(e,t,s,i,$e)===null?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(n,$e.x),a.addScaledVector(r,$e.y),a.addScaledVector(o,$e.z),a)}static getInterpolatedAttribute(e,t,s,i,n,r){return Bn.setScalar(0),xn.setScalar(0),Qn.setScalar(0),Bn.fromBufferAttribute(e,t),xn.fromBufferAttribute(e,s),Qn.fromBufferAttribute(e,i),r.setScalar(0),r.addScaledVector(Bn,n.x),r.addScaledVector(xn,n.y),r.addScaledVector(Qn,n.z),r}static isFrontFacing(e,t,s,i){return ke.subVectors(s,t),Ze.subVectors(e,t),ke.cross(Ze).dot(i)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,i){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,s,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),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 ke.subVectors(this.c,this.b),Ze.subVectors(this.a,this.b),ke.cross(Ze).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Le.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Le.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,s,i,n){return Le.getInterpolation(e,this.a,this.b,this.c,t,s,i,n)}containsPoint(e){return Le.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Le.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,i=this.b,n=this.c;let r,o;Kt.subVectors(i,s),Yt.subVectors(n,s),yn.subVectors(e,s);const a=Kt.dot(yn),h=Yt.dot(yn);if(a<=0&&h<=0)return t.copy(s);En.subVectors(e,i);const c=Kt.dot(En),l=Yt.dot(En);if(c>=0&&l<=c)return t.copy(i);const u=a*l-c*h;if(u<=0&&a>=0&&c<=0)return r=a/(a-c),t.copy(s).addScaledVector(Kt,r);Cn.subVectors(e,n);const d=Kt.dot(Cn),g=Yt.dot(Cn);if(g>=0&&d<=g)return t.copy(n);const p=d*h-a*g;if(p<=0&&h>=0&&g<=0)return o=h/(h-g),t.copy(s).addScaledVector(Yt,o);const f=c*g-d*l;if(f<=0&&l-c>=0&&d-g>=0)return bo.subVectors(n,i),o=(l-c)/(l-c+(d-g)),t.copy(i).addScaledVector(bo,o);const m=1/(f+p+u);return r=p*m,o=u*m,t.copy(s).addScaledVector(Kt,r).addScaledVector(Yt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const yo={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},pt={h:0,s:0,l:0},Ai={h:0,s:0,l:0};function wn(A,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?A+(e-A)*6*t:t<1/2?e:t<2/3?A+(e-A)*6*(2/3-t):A}class X{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ne){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,le.toWorkingColorSpace(this,t),this}setRGB(e,t,s,i=le.workingColorSpace){return this.r=e,this.g=t,this.b=s,le.toWorkingColorSpace(this,i),this}setHSL(e,t,s,i=le.workingColorSpace){if(e=an(e,1),t=ce(t,0,1),s=ce(s,0,1),t===0)this.r=this.g=this.b=s;else{const n=s<=.5?s*(1+t):s+t-s*t,r=2*s-n;this.r=wn(r,n,e+1/3),this.g=wn(r,n,e),this.b=wn(r,n,e-1/3)}return le.toWorkingColorSpace(this,i),this}setStyle(e,t=ne){function s(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let n;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return s(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],r=n.length;if(r===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(r===6)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=ne){const s=yo[e.toLowerCase()];return s!==void 0?this.setHex(s,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=Ut(e.r),this.g=Ut(e.g),this.b=Ut(e.b),this}copyLinearToSRGB(e){return this.r=cn(e.r),this.g=cn(e.g),this.b=cn(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ne){return le.fromWorkingColorSpace(de.copy(this),e),Math.round(ce(de.r*255,0,255))*65536+Math.round(ce(de.g*255,0,255))*256+Math.round(ce(de.b*255,0,255))}getHexString(e=ne){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=le.workingColorSpace){le.fromWorkingColorSpace(de.copy(this),t);const s=de.r,i=de.g,n=de.b,r=Math.max(s,i,n),o=Math.min(s,i,n);let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case s:a=(i-n)/l+(i<n?6:0);break;case i:a=(n-s)/l+2;break;case n:a=(s-i)/l+4;break}a/=6}return e.h=a,e.s=h,e.l=c,e}getRGB(e,t=le.workingColorSpace){return le.fromWorkingColorSpace(de.copy(this),t),e.r=de.r,e.g=de.g,e.b=de.b,e}getStyle(e=ne){le.fromWorkingColorSpace(de.copy(this),e);const t=de.r,s=de.g,i=de.b;return e!==ne?`color(${e} ${t.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(s*255)},${Math.round(i*255)})`}offsetHSL(e,t,s){return this.getHSL(pt),this.setHSL(pt.h+e,pt.s+t,pt.l+s)}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,s){return this.r=e.r+(t.r-e.r)*s,this.g=e.g+(t.g-e.g)*s,this.b=e.b+(t.b-e.b)*s,this}lerpHSL(e,t){this.getHSL(pt),e.getHSL(Ai);const s=Es(pt.h,Ai.h,t),i=Es(pt.s,Ai.s,t),n=Es(pt.l,Ai.l,t);return this.setHSL(s,i,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,s=this.g,i=this.b,n=e.elements;return this.r=n[0]*t+n[3]*s+n[6]*i,this.g=n[1]*t+n[4]*s+n[7]*i,this.b=n[2]*t+n[5]*s+n[8]*i,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}}const de=new X;X.NAMES=yo;let uh=0;class Qt extends Ot{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:uh++}),this.uuid=Ne(),this.name="",this.type="Material",this.blending=Rr,this.side=Ys,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Dr,this.blendDst=_r,this.blendEquation=Fr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new X(0,0,0),this.blendAlpha=0,this.depthFunc=kr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=io,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Gt,this.stencilZFail=Gt,this.stencilZPass=Gt,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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Rr&&(s.blending=this.blending),this.side!==Ys&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Dr&&(s.blendSrc=this.blendSrc),this.blendDst!==_r&&(s.blendDst=this.blendDst),this.blendEquation!==Fr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==kr&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==io&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Gt&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Gt&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Gt&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(n){const r=[];for(const o in n){const a=n[o];delete a.metadata,r.push(a)}return r}if(t){const n=i(e.textures),r=i(e.images);n.length>0&&(s.textures=n),r.length>0&&(s.images=r)}return s}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;const t=e.clippingPlanes;let s=null;if(t!==null){const i=t.length;s=new Array(i);for(let n=0;n!==i;++n)s[n]=t[n].clone()}return this.clippingPlanes=s,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){e===!0&&this.version++}}class Xt extends Qt{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new X(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 jt,this.combine=EA,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}}const Z=new b,hi=new q;class ye{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=Zs,this.updateRanges=[],this.gpuType=at,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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,s){e*=this.itemSize,s*=t.itemSize;for(let i=0,n=this.itemSize;i<n;i++)this.array[e+i]=t.array[s+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,s=this.count;t<s;t++)hi.fromBufferAttribute(this,t),hi.applyMatrix3(e),this.setXY(t,hi.x,hi.y);else if(this.itemSize===3)for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix3(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyMatrix4(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyMatrix4(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.applyNormalMatrix(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)Z.fromBufferAttribute(this,t),Z.transformDirection(e),this.setXYZ(t,Z.x,Z.y,Z.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let s=this.array[e*this.itemSize+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.array[e*this.itemSize+t]=s,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Re(t,this.array)),t}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Re(t,this.array)),t}setY(e,t){return this.normalized&&(t=z(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=Re(t,this.array)),t}setZ(e,t){return this.normalized&&(t=z(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=Re(t,this.array)),t}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,s){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.array[e+0]=t,this.array[e+1]=s,this}setXYZ(e,t,s,i){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e*=this.itemSize,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.array[e+0]=t,this.array[e+1]=s,this.array[e+2]=i,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const 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!==Zs&&(e.usage=this.usage),e}}class dh extends ye{constructor(e,t,s){super(new Uint16Array(e),t,s)}}class gh extends ye{constructor(e,t,s){super(new Uint32Array(e),t,s)}}class Tn extends ye{constructor(e,t,s){super(new Float32Array(e),t,s)}}let ph=0;const Qe=new k,Sn=new Y,Zt=new b,Ee=new We,ws=new We,re=new b;class wt extends Ot{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ph++}),this.uuid=Ne(),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(ZA(e)?gh:dh)(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 this.attributes[e]!==void 0}addGroup(e,t,s=0){this.groups.push({start:e,count:t,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const n=new Fe().getNormalMatrix(e);s.applyNormalMatrix(n),s.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Qe.makeRotationFromQuaternion(e),this.applyMatrix4(Qe),this}rotateX(e){return Qe.makeRotationX(e),this.applyMatrix4(Qe),this}rotateY(e){return Qe.makeRotationY(e),this.applyMatrix4(Qe),this}rotateZ(e){return Qe.makeRotationZ(e),this.applyMatrix4(Qe),this}translate(e,t,s){return Qe.makeTranslation(e,t,s),this.applyMatrix4(Qe),this}scale(e,t,s){return Qe.makeScale(e,t,s),this.applyMatrix4(Qe),this}lookAt(e){return Sn.lookAt(e),Sn.updateMatrix(),this.applyMatrix4(Sn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Zt).negate(),this.translate(Zt.x,Zt.y,Zt.z),this}setFromPoints(e){const t=[];for(let s=0,i=e.length;s<i;s++){const n=e[s];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Tn(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new We);const 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 b(-1/0,-1/0,-1/0),new b(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let s=0,i=t.length;s<i;s++){const n=t[s];Ee.setFromBufferAttribute(n),this.morphTargetsRelative?(re.addVectors(this.boundingBox.min,Ee.min),this.boundingBox.expandByPoint(re),re.addVectors(this.boundingBox.max,Ee.max),this.boundingBox.expandByPoint(re)):(this.boundingBox.expandByPoint(Ee.min),this.boundingBox.expandByPoint(Ee.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(){this.boundingSphere===null&&(this.boundingSphere=new Oe);const 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 b,1/0);return}if(e){const s=this.boundingSphere.center;if(Ee.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const o=t[n];ws.setFromBufferAttribute(o),this.morphTargetsRelative?(re.addVectors(Ee.min,ws.min),Ee.expandByPoint(re),re.addVectors(Ee.max,ws.max),Ee.expandByPoint(re)):(Ee.expandByPoint(ws.min),Ee.expandByPoint(ws.max))}Ee.getCenter(s);let i=0;for(let n=0,r=e.count;n<r;n++)re.fromBufferAttribute(e,n),i=Math.max(i,s.distanceToSquared(re));if(t)for(let n=0,r=t.length;n<r;n++){const o=t[n],a=this.morphTargetsRelative;for(let h=0,c=o.count;h<c;h++)re.fromBufferAttribute(o,h),a&&(Zt.fromBufferAttribute(e,h),re.add(Zt)),i=Math.max(i,s.distanceToSquared(re))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=t.position,i=t.normal,n=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ye(new Float32Array(4*s.count),4));const r=this.getAttribute("tangent"),o=[],a=[];for(let R=0;R<s.count;R++)o[R]=new b,a[R]=new b;const h=new b,c=new b,l=new b,u=new q,d=new q,g=new q,p=new b,f=new b;function m(R,D,O){h.fromBufferAttribute(s,R),c.fromBufferAttribute(s,D),l.fromBufferAttribute(s,O),u.fromBufferAttribute(n,R),d.fromBufferAttribute(n,D),g.fromBufferAttribute(n,O),c.sub(h),l.sub(h),d.sub(u),g.sub(u);const H=1/(d.x*g.y-g.x*d.y);isFinite(H)&&(p.copy(c).multiplyScalar(g.y).addScaledVector(l,-d.y).multiplyScalar(H),f.copy(l).multiplyScalar(d.x).addScaledVector(c,-g.x).multiplyScalar(H),o[R].add(p),o[D].add(p),o[O].add(p),a[R].add(f),a[D].add(f),a[O].add(f))}let E=this.groups;E.length===0&&(E=[{start:0,count:e.count}]);for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const C=new b,y=new b,Q=new b,M=new b;function S(R){Q.fromBufferAttribute(i,R),M.copy(Q);const D=o[R];C.copy(D),C.sub(Q.multiplyScalar(Q.dot(D))).normalize(),y.crossVectors(M,D);const H=y.dot(a[R])<0?-1:1;r.setXYZW(R,C.x,C.y,C.z,H)}for(let R=0,D=E.length;R<D;++R){const O=E[R],H=O.start,ae=O.count;for(let W=H,Ae=H+ae;W<Ae;W+=3)S(e.getX(W+0)),S(e.getX(W+1)),S(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new ye(new Float32Array(t.count*3),3),this.setAttribute("normal",s);else for(let u=0,d=s.count;u<d;u++)s.setXYZ(u,0,0,0);const i=new b,n=new b,r=new b,o=new b,a=new b,h=new b,c=new b,l=new b;if(e)for(let u=0,d=e.count;u<d;u+=3){const g=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);i.fromBufferAttribute(t,g),n.fromBufferAttribute(t,p),r.fromBufferAttribute(t,f),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),o.fromBufferAttribute(s,g),a.fromBufferAttribute(s,p),h.fromBufferAttribute(s,f),o.add(c),a.add(c),h.add(c),s.setXYZ(g,o.x,o.y,o.z),s.setXYZ(p,a.x,a.y,a.z),s.setXYZ(f,h.x,h.y,h.z)}else for(let u=0,d=t.count;u<d;u+=3)i.fromBufferAttribute(t,u+0),n.fromBufferAttribute(t,u+1),r.fromBufferAttribute(t,u+2),c.subVectors(r,n),l.subVectors(i,n),c.cross(l),s.setXYZ(u+0,c.x,c.y,c.z),s.setXYZ(u+1,c.x,c.y,c.z),s.setXYZ(u+2,c.x,c.y,c.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,s=e.count;t<s;t++)re.fromBufferAttribute(e,t),re.normalize(),e.setXYZ(t,re.x,re.y,re.z)}toNonIndexed(){function e(o,a){const h=o.array,c=o.itemSize,l=o.normalized,u=new h.constructor(a.length*c);let d=0,g=0;for(let p=0,f=a.length;p<f;p++){o.isInterleavedBufferAttribute?d=a[p]*o.data.stride+o.offset:d=a[p]*c;for(let m=0;m<c;m++)u[g++]=h[d++]}return new ye(u,c,l)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new wt,s=this.index.array,i=this.attributes;for(const o in i){const a=i[o],h=e(a,s);t.setAttribute(o,h)}const n=this.morphAttributes;for(const o in n){const a=[],h=n[o];for(let c=0,l=h.length;c<l;c++){const u=h[c],d=e(u,s);a.push(d)}t.morphAttributes[o]=a}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let o=0,a=r.length;o<a;o++){const h=r[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const 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),this.parameters!==void 0){const a=this.parameters;for(const h in a)a[h]!==void 0&&(e[h]=a[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const a in s){const h=s[a];e.data.attributes[a]=h.toJSON(e.data)}const i={};let n=!1;for(const a in this.morphAttributes){const h=this.morphAttributes[a],c=[];for(let l=0,u=h.length;l<u;l++){const d=h[l];c.push(d.toJSON(e.data))}c.length>0&&(i[a]=c,n=!0)}n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const i=e.attributes;for(const h in i){const c=i[h];this.setAttribute(h,c.clone(t))}const n=e.morphAttributes;for(const h in n){const c=[],l=n[h];for(let u=0,d=l.length;u<d;u++)c.push(l[u].clone(t));this.morphAttributes[h]=c}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let h=0,c=r.length;h<c;h++){const l=r[h];this.addGroup(l.start,l.count,l.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const a=e.boundingSphere;return a!==null&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Eo=new k,Tt=new ri,ci=new Oe,Co=new b,li=new b,ui=new b,di=new b,Mn=new b,gi=new b,Bo=new b,pi=new b;class fi extends Y{constructor(e=new wt,t=new Xt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}getVertexPosition(e,t){const s=this.geometry,i=s.attributes.position,n=s.morphAttributes.position,r=s.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(n&&o){gi.set(0,0,0);for(let a=0,h=n.length;a<h;a++){const c=o[a],l=n[a];c!==0&&(Mn.fromBufferAttribute(l,e),r?gi.addScaledVector(Mn,c):gi.addScaledVector(Mn.sub(t),c))}t.add(gi)}return t}raycast(e,t){const s=this.geometry,i=this.material,n=this.matrixWorld;i!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),ci.copy(s.boundingSphere),ci.applyMatrix4(n),Tt.copy(e.ray).recast(e.near),!(ci.containsPoint(Tt.origin)===!1&&(Tt.intersectSphere(ci,Co)===null||Tt.origin.distanceToSquared(Co)>(e.far-e.near)**2))&&(Eo.copy(n).invert(),Tt.copy(e.ray).applyMatrix4(Eo),!(s.boundingBox!==null&&Tt.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,Tt)))}_computeIntersections(e,t,s){let i;const n=this.geometry,r=this.material,o=n.index,a=n.attributes.position,h=n.attributes.uv,c=n.attributes.uv1,l=n.attributes.normal,u=n.groups,d=n.drawRange;if(o!==null)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(o.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=o.getX(y),S=o.getX(y+1),R=o.getX(y+2);i=mi(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(o.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=o.getX(f),C=o.getX(f+1),y=o.getX(f+2);i=mi(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}else if(a!==void 0)if(Array.isArray(r))for(let g=0,p=u.length;g<p;g++){const f=u[g],m=r[f.materialIndex],E=Math.max(f.start,d.start),C=Math.min(a.count,Math.min(f.start+f.count,d.start+d.count));for(let y=E,Q=C;y<Q;y+=3){const M=y,S=y+1,R=y+2;i=mi(this,m,e,s,h,c,l,M,S,R),i&&(i.faceIndex=Math.floor(y/3),i.face.materialIndex=f.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),p=Math.min(a.count,d.start+d.count);for(let f=g,m=p;f<m;f+=3){const E=f,C=f+1,y=f+2;i=mi(this,r,e,s,h,c,l,E,C,y),i&&(i.faceIndex=Math.floor(f/3),t.push(i))}}}}function fh(A,e,t,s,i,n,r,o){let a;if(e.side===Nr?a=s.intersectTriangle(r,n,i,!0,o):a=s.intersectTriangle(i,n,r,e.side===Ys,o),a===null)return null;pi.copy(o),pi.applyMatrix4(A.matrixWorld);const h=t.ray.origin.distanceTo(pi);return h<t.near||h>t.far?null:{distance:h,point:pi.clone(),object:A}}function mi(A,e,t,s,i,n,r,o,a,h){A.getVertexPosition(o,li),A.getVertexPosition(a,ui),A.getVertexPosition(h,di);const c=fh(A,e,t,s,li,ui,di,Bo);if(c){const l=new b;Le.getBarycoord(Bo,li,ui,di,l),i&&(c.uv=Le.getInterpolatedAttribute(i,o,a,h,l,new q)),n&&(c.uv1=Le.getInterpolatedAttribute(n,o,a,h,l,new q)),r&&(c.normal=Le.getInterpolatedAttribute(r,o,a,h,l,new b),c.normal.dot(s.direction)>0&&c.normal.multiplyScalar(-1));const u={a:o,b:a,c:h,normal:new b,materialIndex:0};Le.getNormal(li,ui,di,u.normal),c.face=u,c.barycoord=l}return c}class xo extends Y{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new k,this.projectionMatrix=new k,this.projectionMatrixInverse=new k,this.coordinateSystem=ht}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)}}const ft=new b,Qo=new q,wo=new q;class Nn extends xo{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ys*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(bs*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ys*2*Math.atan(Math.tan(bs*.5*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,s){ft.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ft.x,ft.y).multiplyScalar(-e/ft.z),ft.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(ft.x,ft.y).multiplyScalar(-e/ft.z)}getViewSize(e,t){return this.getViewBounds(e,Qo,wo),t.subVectors(wo,Qo)}setViewOffset(e,t,s,i,n,r){this.aspect=e/t,this.view===null&&(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=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(bs*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,n=-.5*i;const r=this.view;if(this.view!==null&&this.view.enabled){const a=r.fullWidth,h=r.fullHeight;n+=r.offsetX*i/a,t-=r.offsetY*s/h,i*=r.width/a,s*=r.height/h}const o=this.filmOffset;o!==0&&(n+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Rn=new b,mh=new b,Ih=new Fe;class St{constructor(e=new b(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,i){return this.normal.set(e,t,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const i=Rn.subVectors(s,t).cross(mh.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(Rn),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const n=-(e.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:t.copy(e.start).addScaledVector(s,n)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||Ih.getNormalMatrix(e),i=this.coplanarPoint(Rn).applyMatrix4(e),n=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(n),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Mt=new Oe,Ii=new b;class bh{constructor(e=new St,t=new St,s=new St,i=new St,n=new St,r=new St){this.planes=[e,t,s,i,n,r]}set(e,t,s,i,n,r){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(s),o[3].copy(i),o[4].copy(n),o[5].copy(r),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=ht){const s=this.planes,i=e.elements,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],c=i[5],l=i[6],u=i[7],d=i[8],g=i[9],p=i[10],f=i[11],m=i[12],E=i[13],C=i[14],y=i[15];if(s[0].setComponents(a-n,u-h,f-d,y-m).normalize(),s[1].setComponents(a+n,u+h,f+d,y+m).normalize(),s[2].setComponents(a+r,u+c,f+g,y+E).normalize(),s[3].setComponents(a-r,u-c,f-g,y-E).normalize(),s[4].setComponents(a-o,u-l,f-p,y-C).normalize(),t===ht)s[5].setComponents(a+o,u+l,f+p,y+C).normalize();else if(t===$s)s[5].setComponents(o,l,p,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Mt.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Mt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Mt)}intersectsSprite(e){return Mt.center.set(0,0,0),Mt.radius=.7071067811865476,Mt.applyMatrix4(e.matrixWorld),this.intersectsSphere(Mt)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(s)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let s=0;s<6;s++){const i=t[s];if(Ii.x=i.normal.x>0?e.max.x:e.min.x,Ii.y=i.normal.y>0?e.max.y:e.min.y,Ii.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ii)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class To extends xo{constructor(e=-1,t=1,s=1,i=-1,n=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=i,this.near=n,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,i,n,r){this.view===null&&(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=s,this.view.offsetY=i,this.view.width=n,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=s-e,r=s+e,o=i+t,a=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=h*this.view.offsetX,r=n+h*this.view.width,o-=c*this.view.offsetY,a=o-c*this.view.height}this.projectionMatrix.makeOrthographic(n,r,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class So extends ue{constructor(e,t,s,i,n,r,o,a,h,c=Zi){if(c!==Zi&&c!==Hr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");s===void 0&&c===Zi&&(s=Ur),s===void 0&&c===Hr&&(s=TA),super(null,i,n,r,o,a,c,s,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:Me,this.minFilter=a!==void 0?a:Me,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Fn extends Y{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Mo{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Zs,this.updateRanges=[],this.version=0,this.uuid=Ne()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,n=this.stride;i<n;i++)this.array[e+i]=t.array[s+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(t,this.stride);return s.setUsage(this.usage),s}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ne()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const pe=new b;class bi{constructor(e,t,s,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=s,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,s=this.data.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyMatrix4(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}applyNormalMatrix(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.applyNormalMatrix(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}transformDirection(e){for(let t=0,s=this.count;t<s;t++)pe.fromBufferAttribute(this,t),pe.transformDirection(e),this.setXYZ(t,pe.x,pe.y,pe.z);return this}getComponent(e,t){let s=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(s=Re(s,this.array)),s}setComponent(e,t,s){return this.normalized&&(s=z(s,this.array)),this.data.array[e*this.data.stride+this.offset+t]=s,this}setX(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=z(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Re(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Re(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Re(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Re(t,this.array)),t}setXY(e,t,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this}setXYZ(e,t,s,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this}setXYZW(e,t,s,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=z(t,this.array),s=z(s,this.array),i=z(i,this.array),n=z(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=s,this.data.array[e+2]=i,this.data.array[e+3]=n,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return new ye(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new bi(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let s=0;s<this.count;s++){const i=s*this.data.stride+this.offset;for(let n=0;n<this.itemSize;n++)t.push(this.data.array[i+n])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const No=new b,Ro=new K,Fo=new K,yh=new b,Do=new k,yi=new b,Dn=new Oe,_o=new k,_n=new ri;class Eh extends fi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Lr,this.bindMatrix=new k,this.bindMatrixInverse=new k,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new We),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,yi),this.boundingBox.expandByPoint(yi)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Oe),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let s=0;s<t.count;s++)this.getVertexPosition(s,yi),this.boundingSphere.expandByPoint(yi)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const s=this.material,i=this.matrixWorld;s!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Dn.copy(this.boundingSphere),Dn.applyMatrix4(i),e.ray.intersectsSphere(Dn)!==!1&&(_o.copy(i).invert(),_n.copy(e.ray).applyMatrix4(_o),!(this.boundingBox!==null&&_n.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,_n)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new K,t=this.geometry.attributes.skinWeight;for(let s=0,i=t.count;s<i;s++){e.fromBufferAttribute(t,s);const n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(s,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Lr?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===CA?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const s=this.skeleton,i=this.geometry;Ro.fromBufferAttribute(i.attributes.skinIndex,e),Fo.fromBufferAttribute(i.attributes.skinWeight,e),No.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){const r=Fo.getComponent(n);if(r!==0){const o=Ro.getComponent(n);Do.multiplyMatrices(s.bones[o].matrixWorld,s.boneInverses[o]),t.addScaledVector(yh.copy(No).applyMatrix4(Do),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}class ko extends Y{constructor(){super(),this.isBone=!0,this.type="Bone"}}class kn extends ue{constructor(e=null,t=1,s=1,i,n,r,o,a,h=Me,c=Me,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isDataTexture=!0,this.image={data:e,width:t,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Lo=new k,Ch=new k;class Ln{constructor(e=[],t=[]){this.uuid=Ne(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let s=0,i=this.bones.length;s<i;s++)this.boneInverses.push(new k)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const s=new k;this.bones[e]&&s.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(s)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&s.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const s=this.bones[e];s&&(s.parent&&s.parent.isBone?(s.matrix.copy(s.parent.matrixWorld).invert(),s.matrix.multiply(s.matrixWorld)):s.matrix.copy(s.matrixWorld),s.matrix.decompose(s.position,s.quaternion,s.scale))}}update(){const e=this.bones,t=this.boneInverses,s=this.boneMatrices,i=this.boneTexture;for(let n=0,r=e.length;n<r;n++){const o=e[n]?e[n].matrixWorld:Ch;Lo.multiplyMatrices(o,t[n]),Lo.toArray(s,n*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ln(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const s=new kn(t,e,e,At,at);return s.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=s,this}getBoneByName(e){for(let t=0,s=this.bones.length;t<s;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let s=0,i=e.bones.length;s<i;s++){const n=e.bones[s];let r=t[n];r===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new ko),this.bones.push(r),this.boneInverses.push(new k().fromArray(e.boneInverses[s]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,s=this.boneInverses;for(let i=0,n=t.length;i<n;i++){const r=t[i];e.bones.push(r.uuid);const o=s[i];e.boneInverses.push(o.toArray())}return e}}class vn extends ye{constructor(e,t,s,i=1){super(e,t,s),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const $t=new k,vo=new k,Ei=[],Go=new We,Bh=new k,Ts=new fi,Ss=new Oe;class xh extends fi{constructor(e,t,s){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new vn(new Float32Array(s*16),16),this.instanceColor=null,this.morphTexture=null,this.count=s,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<s;i++)this.setMatrixAt(i,Bh)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new We),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,$t),Go.copy(e.boundingBox).applyMatrix4($t),this.boundingBox.union(Go)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Oe),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let s=0;s<t;s++)this.getMatrixAt(s,$t),Ss.copy(e.boundingSphere).applyMatrix4($t),this.boundingSphere.union(Ss)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const s=t.morphTargetInfluences,i=this.morphTexture.source.data.data,n=s.length+1,r=e*n+1;for(let o=0;o<s.length;o++)s[o]=i[r+o]}raycast(e,t){const s=this.matrixWorld,i=this.count;if(Ts.geometry=this.geometry,Ts.material=this.material,Ts.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ss.copy(this.boundingSphere),Ss.applyMatrix4(s),e.ray.intersectsSphere(Ss)!==!1))for(let n=0;n<i;n++){this.getMatrixAt(n,$t),vo.multiplyMatrices(s,$t),Ts.matrixWorld=vo,Ts.raycast(e,Ei);for(let r=0,o=Ei.length;r<o;r++){const a=Ei[r];a.instanceId=n,a.object=this,t.push(a)}Ei.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new vn(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const s=t.morphTargetInfluences,i=s.length+1;this.morphTexture===null&&(this.morphTexture=new kn(new Float32Array(i*this.count),i,this.count,Lt,at));const n=this.morphTexture.source.data.data;let r=0;for(let h=0;h<s.length;h++)r+=s[h];const o=this.geometry.morphTargetsRelative?1:1-r,a=i*e;n[a]=o,n.set(s,a+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class Oo extends Qt{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new X(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Ci=new b,Bi=new b,Uo=new k,Ms=new ri,xi=new Oe,Gn=new b,zo=new b;class On extends Y{constructor(e=new wt,t=new Oo){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[0];for(let i=1,n=t.count;i<n;i++)Ci.fromBufferAttribute(t,i-1),Bi.fromBufferAttribute(t,i),s[i]=s[i-1],s[i]+=Ci.distanceTo(Bi);e.setAttribute("lineDistance",new Tn(s,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Line.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),xi.copy(s.boundingSphere),xi.applyMatrix4(i),xi.radius+=n,e.ray.intersectsSphere(xi)===!1)return;Uo.copy(i).invert(),Ms.copy(e.ray).applyMatrix4(Uo);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=this.isLineSegments?2:1,c=s.index,u=s.attributes.position;if(c!==null){const d=Math.max(0,r.start),g=Math.min(c.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=c.getX(p),E=c.getX(p+1),C=Qi(this,e,Ms,a,m,E);C&&t.push(C)}if(this.isLineLoop){const p=c.getX(g-1),f=c.getX(d),m=Qi(this,e,Ms,a,p,f);m&&t.push(m)}}else{const d=Math.max(0,r.start),g=Math.min(u.count,r.start+r.count);for(let p=d,f=g-1;p<f;p+=h){const m=Qi(this,e,Ms,a,p,p+1);m&&t.push(m)}if(this.isLineLoop){const p=Qi(this,e,Ms,a,g-1,d);p&&t.push(p)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function Qi(A,e,t,s,i,n){const r=A.geometry.attributes.position;if(Ci.fromBufferAttribute(r,i),Bi.fromBufferAttribute(r,n),t.distanceSqToSegment(Ci,Bi,Gn,zo)>s)return;Gn.applyMatrix4(A.matrixWorld);const a=e.ray.origin.distanceTo(Gn);if(!(a<e.near||a>e.far))return{distance:a,point:zo.clone().applyMatrix4(A.matrixWorld),index:i,face:null,faceIndex:null,barycoord:null,object:A}}const Po=new b,Ho=new b;class Qh extends On{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,s=[];for(let i=0,n=t.count;i<n;i+=2)Po.fromBufferAttribute(t,i),Ho.fromBufferAttribute(t,i+1),s[i]=i===0?0:s[i-1],s[i+1]=s[i]+Po.distanceTo(Ho);e.setAttribute("lineDistance",new Tn(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class wh extends On{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class qo extends Qt{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new X(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Vo=new k,Un=new ri,wi=new Oe,Ti=new b;class Th extends Y{constructor(e=new wt,t=new qo){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const s=this.geometry,i=this.matrixWorld,n=e.params.Points.threshold,r=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),wi.copy(s.boundingSphere),wi.applyMatrix4(i),wi.radius+=n,e.ray.intersectsSphere(wi)===!1)return;Vo.copy(i).invert(),Un.copy(e.ray).applyMatrix4(Vo);const o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=s.index,l=s.attributes.position;if(h!==null){const u=Math.max(0,r.start),d=Math.min(h.count,r.start+r.count);for(let g=u,p=d;g<p;g++){const f=h.getX(g);Ti.fromBufferAttribute(l,f),jo(Ti,f,a,i,e,t,this)}}else{const u=Math.max(0,r.start),d=Math.min(l.count,r.start+r.count);for(let g=u,p=d;g<p;g++)Ti.fromBufferAttribute(l,g),jo(Ti,g,a,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,r=i.length;n<r;n++){const o=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=n}}}}}function jo(A,e,t,s,i,n,r){const o=Un.distanceSqToPoint(A);if(o<t){const a=new b;Un.closestPointToPoint(A,a),a.applyMatrix4(s);const h=i.ray.origin.distanceTo(a);if(h<i.near||h>i.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:a,index:e,face:null,faceIndex:null,barycoord:null,object:r})}}class Sh extends ue{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Me,this.minFilter=Me,this.generateMipmaps=!1,this.needsUpdate=!0}}class Si extends ue{constructor(e,t,s,i,n,r,o,a,h,c,l,u){super(null,r,o,a,h,c,i,n,l,u),this.isCompressedTexture=!0,this.image={width:t,height:s},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Mh extends Si{constructor(e,t,s,i,n,r){super(e,t,s,n,r),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Et,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Nh extends Si{constructor(e,t,s){super(void 0,e[0].width,e[0].height,t,s,Gr),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class zn extends Qt{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new X(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new q(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jt,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ue extends zn{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new q(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ce(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new X(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new X(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new X(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Mi(A,e,t){return!A||!t&&A.constructor===e?A:typeof e.BYTES_PER_ELEMENT=="number"?new e(A):Array.prototype.slice.call(A)}function Rh(A){return ArrayBuffer.isView(A)&&!(A instanceof DataView)}function Fh(A){function e(i,n){return A[i]-A[n]}const t=A.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function Jo(A,e,t){const s=A.length,i=new A.constructor(s);for(let n=0,r=0;r!==s;++n){const o=t[n]*e;for(let a=0;a!==e;++a)i[r++]=A[o+a]}return i}function Wo(A,e,t,s){let i=1,n=A[0];for(;n!==void 0&&n[s]===void 0;)n=A[i++];if(n===void 0)return;let r=n[s];if(r!==void 0)if(Array.isArray(r))do r=n[s],r!==void 0&&(e.push(n.time),t.push.apply(t,r)),n=A[i++];while(n!==void 0);else if(r.toArray!==void 0)do r=n[s],r!==void 0&&(e.push(n.time),r.toArray(t,t.length)),n=A[i++];while(n!==void 0);else do r=n[s],r!==void 0&&(e.push(n.time),t.push(r)),n=A[i++];while(n!==void 0)}class Ns{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],n=t[s-1];s:{e:{let r;t:{i:if(!(e<i)){for(let o=s+2;;){if(i===void 0){if(e<n)break i;return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}if(s===o)break;if(n=i,i=t[++s],e<i)break e}r=t.length;break t}if(!(e>=n)){const o=t[1];e<o&&(s=2,n=o);for(let a=s-2;;){if(n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===a)break;if(i=n,n=t[--s-1],e>=n)break e}r=s,s=0;break t}break s}for(;s<r;){const o=s+r>>>1;e<t[o]?r=o:s=o+1}if(i=t[s],n=t[s-1],n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return s=t.length,this._cachedIndex=s,this.copySampleValue_(s-1)}this._cachedIndex=s,this.intervalChanged_(s,n,i)}return this.interpolate_(s,n,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,i=this.valueSize,n=e*i;for(let r=0;r!==i;++r)t[r]=s[n+r];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Dh extends Ns{constructor(e,t,s,i){super(e,t,s,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Kr,endingEnd:Kr}}intervalChanged_(e,t,s){const i=this.parameterPositions;let n=e-2,r=e+1,o=i[n],a=i[r];if(o===void 0)switch(this.getSettings_().endingStart){case Yr:n=e,o=2*t-s;break;case Xr:n=i.length-2,o=t+i[n]-i[n+1];break;default:n=e,o=s}if(a===void 0)switch(this.getSettings_().endingEnd){case Yr:r=e,a=2*s-t;break;case Xr:r=1,a=s+i[1]-i[0];break;default:r=e-1,a=t}const h=(s-t)*.5,c=this.valueSize;this._weightPrev=h/(t-o),this._weightNext=h/(a-s),this._offsetPrev=n*c,this._offsetNext=r*c}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,d=this._weightNext,g=(s-t)/(i-t),p=g*g,f=p*g,m=-u*f+2*u*p-u*g,E=(1+u)*f+(-1.5-2*u)*p+(-.5+u)*g+1,C=(-1-d)*f+(1.5+d)*p+.5*g,y=d*f-d*p;for(let Q=0;Q!==o;++Q)n[Q]=m*r[c+Q]+E*r[h+Q]+C*r[a+Q]+y*r[l+Q];return n}}class _h extends Ns{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=e*o,h=a-o,c=(s-t)/(i-t),l=1-c;for(let u=0;u!==o;++u)n[u]=r[h+u]*l+r[a+u]*c;return n}}class kh extends Ns{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class ze{constructor(e,t,s,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Mi(t,this.TimeBufferType),this.values=Mi(s,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let s;if(t.toJSON!==this.toJSON)s=t.toJSON(e);else{s={name:e.name,times:Mi(e.times,Array),values:Mi(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(s.interpolation=i)}return s.type=e.ValueTypeName,s}InterpolantFactoryMethodDiscrete(e){return new kh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _h(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Dh(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ms:t=this.InterpolantFactoryMethodDiscrete;break;case Is:t=this.InterpolantFactoryMethodLinear;break;case sn:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const s="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(s);return console.warn("THREE.KeyframeTrack:",s),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ms;case this.InterpolantFactoryMethodLinear:return Is;case this.InterpolantFactoryMethodSmooth:return sn}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let s=0,i=t.length;s!==i;++s)t[s]*=e}return this}trim(e,t){const s=this.times,i=s.length;let n=0,r=i-1;for(;n!==i&&s[n]<e;)++n;for(;r!==-1&&s[r]>t;)--r;if(++r,n!==0||r!==i){n>=r&&(r=Math.max(r,1),n=r-1);const o=this.getValueSize();this.times=s.slice(n,r),this.values=this.values.slice(n*o,r*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,n=s.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let o=0;o!==n;o++){const a=s[o];if(typeof a=="number"&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,a),e=!1;break}if(r!==null&&r>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,a,r),e=!1;break}r=a}if(i!==void 0&&Rh(i))for(let o=0,a=i.length;o!==a;++o){const h=i[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===sn,n=e.length-1;let r=1;for(let o=1;o<n;++o){let a=!1;const h=e[o],c=e[o+1];if(h!==c&&(o!==1||h!==e[0]))if(i)a=!0;else{const l=o*s,u=l-s,d=l+s;for(let g=0;g!==s;++g){const p=t[l+g];if(p!==t[u+g]||p!==t[d+g]){a=!0;break}}}if(a){if(o!==r){e[r]=e[o];const l=o*s,u=r*s;for(let d=0;d!==s;++d)t[u+d]=t[l+d]}++r}}if(n>0){e[r]=e[n];for(let o=n*s,a=r*s,h=0;h!==s;++h)t[a+h]=t[o+h];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}ze.prototype.TimeBufferType=Float32Array,ze.prototype.ValueBufferType=Float32Array,ze.prototype.DefaultInterpolation=Is;class es extends ze{constructor(e,t,s){super(e,t,s)}}es.prototype.ValueTypeName="bool",es.prototype.ValueBufferType=Array,es.prototype.DefaultInterpolation=ms,es.prototype.InterpolantFactoryMethodLinear=void 0,es.prototype.InterpolantFactoryMethodSmooth=void 0;class Ko extends ze{}Ko.prototype.ValueTypeName="color";class ts extends ze{}ts.prototype.ValueTypeName="number";class Lh extends Ns{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=(s-t)/(i-t);let h=e*o;for(let c=h+o;h!==c;h+=4)ct.slerpFlat(n,0,r,h-o,r,h,a);return n}}class ss extends ze{InterpolantFactoryMethodLinear(e){return new Lh(this.times,this.values,this.getValueSize(),e)}}ss.prototype.ValueTypeName="quaternion",ss.prototype.InterpolantFactoryMethodSmooth=void 0;class is extends ze{constructor(e,t,s){super(e,t,s)}}is.prototype.ValueTypeName="string",is.prototype.ValueBufferType=Array,is.prototype.DefaultInterpolation=ms,is.prototype.InterpolantFactoryMethodLinear=void 0,is.prototype.InterpolantFactoryMethodSmooth=void 0;class ns extends ze{}ns.prototype.ValueTypeName="vector";class vh{constructor(e="",t=-1,s=[],i=FA){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Ne(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let r=0,o=s.length;r!==o;++r)t.push(Oh(s[r]).scale(i));const n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,r=s.length;n!==r;++n)t.push(ze.toJSON(s[n]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const n=t.length,r=[];for(let o=0;o<n;o++){let a=[],h=[];a.push((o+n-1)%n,o,(o+1)%n),h.push(0,1,0);const c=Fh(a);a=Jo(a,1,c),h=Jo(h,1,c),!i&&a[0]===0&&(a.push(n),h.push(h[0])),r.push(new ts(".morphTargetInfluences["+t[o].name+"]",a,h).scale(1/s))}return new this(e,-1,r)}static findByName(e,t){let s=e;if(!Array.isArray(e)){const i=e;s=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<s.length;i++)if(s[i].name===t)return s[i];return null}static CreateClipsFromMorphTargetSequences(e,t,s){const i={},n=/^([\w-]*?)([\d]+)$/;for(let o=0,a=e.length;o<a;o++){const h=e[o],c=h.name.match(n);if(c&&c.length>1){const l=c[1];let u=i[l];u||(i[l]=u=[]),u.push(h)}}const r=[];for(const o in i)r.push(this.CreateFromMorphTargetSequence(o,i[o],t,s));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(l,u,d,g,p){if(d.length!==0){const f=[],m=[];Wo(d,f,m,g),f.length!==0&&p.push(new l(u,f,m))}},i=[],n=e.name||"default",r=e.fps||30,o=e.blendMode;let a=e.length||-1;const h=e.hierarchy||[];for(let l=0;l<h.length;l++){const u=h[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const d={};let g;for(g=0;g<u.length;g++)if(u[g].morphTargets)for(let p=0;p<u[g].morphTargets.length;p++)d[u[g].morphTargets[p]]=-1;for(const p in d){const f=[],m=[];for(let E=0;E!==u[g].morphTargets.length;++E){const C=u[g];f.push(C.time),m.push(C.morphTarget===p?1:0)}i.push(new ts(".morphTargetInfluence["+p+"]",f,m))}a=d.length*r}else{const d=".bones["+t[l].name+"]";s(ns,d+".position",u,"pos",i),s(ss,d+".quaternion",u,"rot",i),s(ns,d+".scale",u,"scl",i)}}return i.length===0?null:new this(n,a,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let s=0,i=e.length;s!==i;++s){const n=this.tracks[s];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Gh(A){switch(A.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ts;case"vector":case"vector2":case"vector3":case"vector4":return ns;case"color":return Ko;case"quaternion":return ss;case"bool":case"boolean":return es;case"string":return is}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+A)}function Oh(A){if(A.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Gh(A.type);if(A.times===void 0){const t=[],s=[];Wo(A.keys,t,s,"value"),A.times=t,A.values=s}return e.parse!==void 0?e.parse(A):new e(A.name,A.times,A.values,A.interpolation)}const mt={enabled:!1,files:{},add:function(A,e){this.enabled!==!1&&(this.files[A]=e)},get:function(A){if(this.enabled!==!1)return this.files[A]},remove:function(A){delete this.files[A]},clear:function(){this.files={}}};class Uh{constructor(e,t,s){const i=this;let n=!1,r=0,o=0,a;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s,this.itemStart=function(c){o++,n===!1&&i.onStart!==void 0&&i.onStart(c,r,o),n=!0},this.itemEnd=function(c){r++,i.onProgress!==void 0&&i.onProgress(c,r,o),r===o&&(n=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return a?a(c):c},this.setURLModifier=function(c){return a=c,this},this.addHandler=function(c,l){return h.push(c,l),this},this.removeHandler=function(c){const l=h.indexOf(c);return l!==-1&&h.splice(l,2),this},this.getHandler=function(c){for(let l=0,u=h.length;l<u;l+=2){const d=h[l],g=h[l+1];if(d.global&&(d.lastIndex=0),d.test(c))return g}return null}}}const zh=new Uh;class It{constructor(e){this.manager=e!==void 0?e:zh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const s=this;return new Promise(function(i,n){s.load(e,i,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}It.DEFAULT_MATERIAL_NAME="__DEFAULT";const et={};class Ph extends Error{constructor(e,t){super(e),this.response=t}}class Nt extends It{constructor(e){super(e)}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=mt.get(e);if(n!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(et[e]!==void 0){et[e].push({onLoad:t,onProgress:s,onError:i});return}et[e]=[],et[e].push({onLoad:t,onProgress:s,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(r).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const c=et[e],l=h.body.getReader(),u=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),d=u?parseInt(u):0,g=d!==0;let p=0;const f=new ReadableStream({start(m){E();function E(){l.read().then(({done:C,value:y})=>{if(C)m.close();else{p+=y.byteLength;const Q=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:d});for(let M=0,S=c.length;M<S;M++){const R=c[M];R.onProgress&&R.onProgress(Q)}m.enqueue(y),E()}},C=>{m.error(C)})}}});return new Response(f)}else throw new Ph(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(a){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return h.json();default:if(o===void 0)return h.text();{const l=/charset="?([^;"\s]*)"?/i.exec(o),u=l&&l[1]?l[1].toLowerCase():void 0,d=new TextDecoder(u);return h.arrayBuffer().then(g=>d.decode(g))}}}).then(h=>{mt.add(e,h);const c=et[e];delete et[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onLoad&&d.onLoad(h)}}).catch(h=>{const c=et[e];if(c===void 0)throw this.manager.itemError(e),h;delete et[e];for(let l=0,u=c.length;l<u;l++){const d=c[l];d.onError&&d.onError(h)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Hh extends It{constructor(e){super(e)}load(e,t,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=mt.get(e);if(r!==void 0)return n.manager.itemStart(e),setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r;const o=hn("img");function a(){c(),mt.add(e,this),t&&t(this),n.manager.itemEnd(e)}function h(l){c(),i&&i(l),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),n.manager.itemStart(e),o.src=e,o}}class qh extends It{constructor(e){super(e)}load(e,t,s,i){const n=new ue,r=new Hh(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(e,function(o){n.image=o,n.needsUpdate=!0,t!==void 0&&t(n)},s,i),n}}class Pn extends Y{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new X(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const Hn=new k,Yo=new b,Xo=new b;class qn{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new q(512,512),this.map=null,this.mapPass=null,this.matrix=new k,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new bh,this._frameExtents=new q(1,1),this._viewportCount=1,this._viewports=[new K(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;Yo.setFromMatrixPosition(e.matrixWorld),t.position.copy(Yo),Xo.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Xo),t.updateMatrixWorld(),Hn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Hn),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Hn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Vh extends qn{constructor(){super(new Nn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=ys*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(s!==t.fov||i!==t.aspect||n!==t.far)&&(t.fov=s,t.aspect=i,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class jh extends Pn{constructor(e,t,s=0,i=Math.PI/3,n=0,r=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.distance=s,this.angle=i,this.penumbra=n,this.decay=r,this.map=null,this.shadow=new Vh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Zo=new k,Rs=new b,Vn=new b;class Jh extends qn{constructor(){super(new Nn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new q(4,2),this._viewportCount=6,this._viewports=[new K(2,1,1,1),new K(0,1,1,1),new K(3,1,1,1),new K(1,1,1,1),new K(3,0,1,1),new K(1,0,1,1)],this._cubeDirections=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],this._cubeUps=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,n=e.distance||s.far;n!==s.far&&(s.far=n,s.updateProjectionMatrix()),Rs.setFromMatrixPosition(e.matrixWorld),s.position.copy(Rs),Vn.copy(s.position),Vn.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Vn),s.updateMatrixWorld(),i.makeTranslation(-Rs.x,-Rs.y,-Rs.z),Zo.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Zo)}}class Wh extends Pn{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new Jh}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Kh extends qn{constructor(){super(new To(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Yh extends Pn{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Y.DEFAULT_UP),this.updateMatrix(),this.target=new Y,this.shadow=new Kh}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Fs{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s<i;s++)t+=String.fromCharCode(e[s]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Xh extends It{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const n=this,r=mt.get(e);if(r!==void 0){if(n.manager.itemStart(e),r.then){r.then(h=>{t&&t(h),n.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(r),n.manager.itemEnd(e)},0),r}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const a=fetch(e,o).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(h){return mt.add(e,h),t&&t(h),n.manager.itemEnd(e),h}).catch(function(h){i&&i(h),mt.remove(e),n.manager.itemError(e),n.manager.itemEnd(e)});mt.add(e,a),n.manager.itemStart(e)}}const jn="\\[\\]\\.:\\/",Zh=new RegExp("["+jn+"]","g"),Jn="[^"+jn+"]",$h="[^"+jn.replace("\\.","")+"]",ec=/((?:WC+[\/:])*)/.source.replace("WC",Jn),tc=/(WCOD+)?/.source.replace("WCOD",$h),sc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Jn),ic=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Jn),nc=new RegExp("^"+ec+tc+sc+ic+"$"),rc=["material","materials","bones","map"];class oc{constructor(e,t,s){const i=s||P.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=s.length;i!==n;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class P{constructor(e,t,s){this.path=t,this.parsedPath=s||P.parseTrackName(t),this.node=P.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new P.Composite(e,t,s):new P(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Zh,"")}static parseTrackName(e){const t=nc.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const n=s.nodeName.substring(i+1);rc.indexOf(n)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=n)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(n,r){for(let o=0;o<n.length;o++){const a=n[o];if(!r&&(a.name===t||a.uuid===t))return a;if(r&&a.userData&&a.userData.name===t)return a;const h=s(a.children,r);if(h)return h}return null},i=s(e.children);if(i)return i;{const n=s(e.children,!0);if(n)return n}}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)e[t++]=s[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const s=this.resolvedProperty;for(let i=0,n=s.length;i!==n;++i)s[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,s=t.objectName,i=t.propertyName;let n=t.propertyIndex;if(e||(e=P.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(s){let h=t.objectIndex;switch(s){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===h){h=c;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[s]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[s]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const r=e[i];if(r===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(n!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[n]!==void 0&&(n=e.morphTargetDictionary[n])}a=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=n}else r.fromArray!==void 0&&r.toArray!==void 0?(a=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(a=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}P.Composite=oc,P.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},P.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},P.prototype.GetterByBindingType=[P.prototype._getValue_direct,P.prototype._getValue_array,P.prototype._getValue_arrayElement,P.prototype._getValue_toArray],P.prototype.SetterByBindingTypeAndVersioning=[[P.prototype._setValue_direct,P.prototype._setValue_direct_setNeedsUpdate,P.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[P.prototype._setValue_array,P.prototype._setValue_array_setNeedsUpdate,P.prototype._setValue_array_setMatrixWorldNeedsUpdate],[P.prototype._setValue_arrayElement,P.prototype._setValue_arrayElement_setNeedsUpdate,P.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[P.prototype._setValue_fromArray,P.prototype._setValue_fromArray_setNeedsUpdate,P.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];function Wn(A,e=0){let t=3735928559^e,s=1103547991^e;if(A instanceof Array)for(let i=0,n;i<A.length;i++)n=A[i],t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);else for(let i=0,n;i<A.length;i++)n=A.charCodeAt(i),t=Math.imul(t^n,2654435761),s=Math.imul(s^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&s)+(t>>>0)}const ac=(...A)=>Wn(A);function Ac(A,e=!1){const t=[];A.isNode===!0&&(t.push(A.id),A=A.getSelf());for(const{property:s,childNode:i}of Kn(A))t.push(t,Wn(s.slice(0,-4)),i.getCacheKey(e));return Wn(t)}function*Kn(A,e=!1){for(const t in A){if(t.startsWith("_")===!0)continue;const s=A[t];if(Array.isArray(s)===!0)for(let i=0;i<s.length;i++){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}else if(s&&s.isNode===!0)yield{property:t,childNode:s};else if(typeof s=="object")for(const i in s){const n=s[i];n&&(n.isNode===!0||e&&typeof n.toJSON=="function")&&(yield{property:t,index:i,childNode:n})}}}function Ni(A){if(A==null)return null;const e=typeof A;return A.isNode===!0?"node":e==="number"?"float":e==="boolean"?"bool":e==="string"?"string":e==="function"?"shader":A.isVector2===!0?"vec2":A.isVector3===!0?"vec3":A.isVector4===!0?"vec4":A.isMatrix3===!0?"mat3":A.isMatrix4===!0?"mat4":A.isColor===!0?"color":A instanceof ArrayBuffer?"ArrayBuffer":null}function $o(A,...e){const t=A?A.slice(-4):void 0;return e.length===1&&(t==="vec2"?e=[e[0],e[0]]:t==="vec3"?e=[e[0],e[0],e[0]]:t==="vec4"&&(e=[e[0],e[0],e[0],e[0]])),A==="color"?new X(...e):t==="vec2"?new q(...e):t==="vec3"?new b(...e):t==="vec4"?new K(...e):t==="mat3"?new Fe(...e):t==="mat4"?new k(...e):A==="bool"?e[0]||!1:A==="float"||A==="int"||A==="uint"?e[0]||0:A==="string"?e[0]||"":A==="ArrayBuffer"?cc(e[0]):null}function hc(A){let e="";const t=new Uint8Array(A);for(let s=0;s<t.length;s++)e+=String.fromCharCode(t[s]);return btoa(e)}function cc(A){return Uint8Array.from(atob(A),e=>e.charCodeAt(0)).buffer}const ea={VERTEX:"vertex"},$={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},Ds=["x","y","z","w"];let lc=0;class L extends Ot{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=$.NONE,this.updateBeforeType=$.NONE,this.updateAfterType=$.NONE,this.uuid=ro.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:lc++})}set needsUpdate(e){e===!0&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,$.FRAME)}onRenderUpdate(e){return this.onUpdate(e,$.RENDER)}onObjectUpdate(e){return this.onUpdate(e,$.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of Kn(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return e=e||this.version!==this._cacheKeyVersion,(e===!0||this._cacheKey===null)&&(this._cacheKey=Ac(this,e),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let s=0;for(const i of this.getChildren())t["node"+s++]=i;return null}analyze(e){if(e.increaseUsage(this)===1){const s=e.getNodeProperties(this);for(const i of Object.values(s))i&&i.isNode===!0&&i.build(e)}}generate(e,t){const{outputNode:s}=e.getNodeProperties(this);if(s&&s.isNode===!0)return s.build(e,t)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(e,t=null){const s=this.getShared(e);if(this!==s)return s.build(e,t);e.addNode(this),e.addChain(this);let i=null;const n=e.getBuildStage();if(n==="setup"){this.updateReference(e);const r=e.getNodeProperties(this);if(r.initialized!==!0){const o=e.stack.nodes.length;r.initialized=!0,r.outputNode=this.setup(e),r.outputNode!==null&&e.stack.nodes.length;for(const a of Object.values(r))a&&a.isNode===!0&&a.build(e)}}else if(n==="analyze")this.analyze(e);else if(n==="generate")if(this.generate.length===1){const o=this.getNodeType(e),a=e.getDataFromNode(this);i=a.snippet,i===void 0?(i=this.generate(e)||"",a.snippet=i):a.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),i=e.format(i,o,t)}else i=this.generate(e,t)||"";return e.removeChain(this),i}getSerializeChildren(){return Kn(this)}serialize(e){const t=this.getSerializeChildren(),s={};for(const{property:i,index:n,childNode:r}of t)n!==void 0?(s[i]===void 0&&(s[i]=Number.isInteger(n)?[]:{}),s[i][n]=r.toJSON(e.meta).uuid):s[i]=r.toJSON(e.meta).uuid;Object.keys(s).length>0&&(e.inputNodes=s)}deserialize(e){if(e.inputNodes!==void 0){const t=e.meta.nodes;for(const s in e.inputNodes)if(Array.isArray(e.inputNodes[s])){const i=[];for(const n of e.inputNodes[s])i.push(t[n]);this[s]=i}else if(typeof e.inputNodes[s]=="object"){const i={};for(const n in e.inputNodes[s]){const r=e.inputNodes[s][n];i[n]=t[r]}this[s]=i}else{const i=e.inputNodes[s];this[s]=t[i]}}}toJSON(e){const{uuid:t,type:s}=this,i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{},nodes:{}});let n=e.nodes[t];n===void 0&&(n={uuid:t,type:s,meta:e,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},i!==!0&&(e.nodes[n.uuid]=n),this.serialize(n),delete n.meta);function r(o){const a=[];for(const h in o){const c=o[h];delete c.metadata,a.push(c)}return a}if(i){const o=r(e.textures),a=r(e.images),h=r(e.nodes);o.length>0&&(n.textures=o),a.length>0&&(n.images=a),h.length>0&&(n.nodes=h)}return n}}class _s extends L{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.node.build(e),s=this.indexNode.build(e,"uint");return`${t}[ ${s} ]`}}class ta extends L{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let s=null;for(const i of this.convertTo.split("|"))(s===null||e.getTypeLength(t)===e.getTypeLength(i))&&(s=i);return s}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const s=this.node,i=this.getNodeType(e),n=s.build(e,i);return e.format(n,i,t)}}class me extends L{static get type(){return"TempNode"}constructor(e){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()==="generate"){const i=e.getVectorType(this.getNodeType(e,t)),n=e.getDataFromNode(this);if(n.propertyName!==void 0)return e.format(n.propertyName,i,t);if(i!=="void"&&t!=="void"&&this.hasDependencies(e)){const r=super.build(e,i),o=e.getVarFromNode(this,null,i),a=e.getPropertyName(o);return e.addLineFlowCode(`${a} = ${r}`,this),n.snippet=r,n.propertyName=a,e.format(n.propertyName,i,t)}}return super.build(e,t)}}class uc extends me{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}getNodeType(e){return this.nodeType!==null?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce((t,s)=>t+e.getTypeLength(s.getNodeType(e)),0))}generate(e,t){const s=this.getNodeType(e),i=this.nodes,n=e.getComponentType(s),r=[];for(const a of i){let h=a.build(e);const c=e.getComponentType(a.getNodeType(e));c!==n&&(h=e.format(h,c,n)),r.push(h)}const o=`${e.getType(s)}( ${r.join(", ")} )`;return e.format(o,s,t)}}const dc=Ds.join("");class sa extends L{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(Ds.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const s=this.node,i=e.getTypeLength(s.getNodeType(e));let n=null;if(i>1){let r=null;this.getVectorLength()>=i&&(r=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=s.build(e,r);this.components.length===i&&this.components===dc.slice(0,this.components.length)?n=e.format(a,r,t):n=e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else n=s.build(e,t);return n}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class gc extends me{static get type(){return"SetNode"}constructor(e,t,s){super(),this.sourceNode=e,this.components=t,this.targetNode=s}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:s,targetNode:i}=this,n=this.getNodeType(e),r=e.getTypeFromLength(s.length,i.getNodeType(e)),o=i.build(e,r),a=t.build(e,n),h=e.getTypeLength(n),c=[];for(let l=0;l<h;l++){const u=Ds[l];u===s[0]?(c.push(o),l+=s.length-1):c.push(a+"."+u)}return`${e.getType(n)}( ${c.join(", ")} )`}}class pc extends me{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:s}=this,i=this.getNodeType(e),n=s.build(e),r=e.getVarFromNode(this),o=e.getPropertyName(r);e.addLineFlowCode(o+" = "+n,this);const a=e.getTypeLength(i),h=[];let c=0;for(let l=0;l<a;l++){const u=Ds[l];u===t[c]?(h.push("1.0 - "+(o+"."+u)),c++):h.push(o+"."+u)}return`${e.getType(i)}( ${h.join(", ")} )`}}class Yn extends L{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return this.nodeType===null?Ni(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=Ni(this.value),e.nodeType=this.nodeType,e.valueType==="ArrayBuffer"&&(e.value=hc(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?$o(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){console.warn("Abstract function.")}}class tt extends Yn{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const s=this.getNodeType(e);return e.format(this.generateConst(e),s,t)}}let ia=null;const rs=new Map;function x(A,e){if(rs.has(A)){console.warn(`Redefinition of method chaining ${A}`);return}if(typeof e!="function")throw new Error(`Node element ${A} is not a function`);rs.set(A,e)}const na=A=>A.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),ra=A=>na(A).split("").sort().join(""),oa={setup(A,e){const t=e.shift();return A(Di(t),...e)},get(A,e,t){if(typeof e=="string"&&A[e]===void 0){if(A.isStackNode!==!0&&e==="assign")return(...s)=>(ia.assign(t,...s),t);if(rs.has(e)){const s=rs.get(e);return A.isStackNode?(...i)=>t.add(s(...i)):(...i)=>s(t,...i)}else{if(e==="self")return A;if(e.endsWith("Assign")&&rs.has(e.slice(0,e.length-6))){const s=rs.get(e.slice(0,e.length-6));return A.isStackNode?(...i)=>t.assign(i[0],s(...i)):(...i)=>t.assign(s(t,...i))}else{if(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0)return e=na(e),T(new sa(t,e));if(/^set[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=ra(e.slice(3).toLowerCase()),s=>T(new gc(A,e,s));if(/^flip[XYZWRGBASTPQ]{1,4}$/.test(e)===!0)return e=ra(e.slice(4).toLowerCase()),()=>T(new pc(T(A),e));if(e==="width"||e==="height"||e==="depth")return e==="width"?e="x":e==="height"?e="y":e==="depth"&&(e="z"),T(new sa(A,e));if(/^\d+$/.test(e)===!0)return T(new _s(t,new tt(Number(e),"uint")))}}}return Reflect.get(A,e,t)},set(A,e,t,s){return typeof e=="string"&&A[e]===void 0&&(/^[xyzwrgbastpq]{1,4}$/.test(e)===!0||e==="width"||e==="height"||e==="depth"||/^\d+$/.test(e)===!0)?(s[e].assign(t),!0):Reflect.set(A,e,t,s)}},Xn=new WeakMap,aa=new WeakMap,fc=function(A,e=null){const t=Ni(A);if(t==="node"){let s=Xn.get(A);return s===void 0&&(s=new Proxy(A,oa),Xn.set(A,s),Xn.set(s,s)),s}else{if(e===null&&(t==="float"||t==="boolean")||t&&t!=="shader"&&t!=="string")return T(tr(A,e));if(t==="shader")return te(A)}return A},mc=function(A,e=null){for(const t in A)A[t]=T(A[t],e);return A},Ic=function(A,e=null){const t=A.length;for(let s=0;s<t;s++)A[s]=T(A[s],e);return A},bc=function(A,e=null,t=null,s=null){const i=n=>T(s!==null?Object.assign(n,s):n);return e===null?(...n)=>i(new A(...os(n))):t!==null?(t=T(t),(...n)=>i(new A(e,...os(n),t))):(...n)=>i(new A(e,...os(n)))},yc=function(A,...e){return T(new A(...os(e)))};class Ec extends L{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}call(e){const{shaderNode:t,inputNodes:s}=this,i=e.getNodeProperties(t);if(i.onceOutput)return i.onceOutput;let n=null;if(t.layout){let r=aa.get(e.constructor);r===void 0&&(r=new WeakMap,aa.set(e.constructor,r));let o=r.get(t);o===void 0&&(o=T(e.buildFunctionNode(t)),r.set(t,o)),e.currentFunctionNode!==null&&e.currentFunctionNode.includes.push(o),n=T(o.call(s))}else{const r=t.jsFunc,o=s!==null?r(s,e):r(e);n=T(o)}return t.once&&(i.onceOutput=n),n}getOutputNode(e){const t=e.getNodeProperties(this);return t.outputNode===null&&(t.outputNode=this.setupOutput(e)),t.outputNode}setup(e){return this.getOutputNode(e)}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}generate(e,t){return this.getOutputNode(e).build(e,t)}}class Cc extends L{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}call(e=null){return Di(e),T(new Ec(this,e))}setup(){return this.call()}}const Bc=[!1,!0],xc=[0,1,2,3],Qc=[-1,-2],Aa=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],Zn=new Map;for(const A of Bc)Zn.set(A,new tt(A));const $n=new Map;for(const A of xc)$n.set(A,new tt(A,"uint"));const er=new Map([...$n].map(A=>new tt(A.value,"int")));for(const A of Qc)er.set(A,new tt(A,"int"));const Ri=new Map([...er].map(A=>new tt(A.value)));for(const A of Aa)Ri.set(A,new tt(A));for(const A of Aa)Ri.set(-A,new tt(-A));const Fi={bool:Zn,uint:$n,ints:er,float:Ri},ha=new Map([...Zn,...Ri]),tr=(A,e)=>ha.has(A)?ha.get(A):A.isNode===!0?A:new tt(A,e),wc=A=>{try{return A.getNodeType()}catch{return}},ee=function(A,e=null){return(...t)=>{if((t.length===0||!["bool","float","int","uint"].includes(A)&&t.every(i=>typeof i!="object"))&&(t=[$o(A,...t)]),t.length===1&&e!==null&&e.has(t[0]))return T(e.get(t[0]));if(t.length===1){const i=tr(t[0],A);return wc(i)===A?T(i):T(new ta(i,A))}const s=t.map(i=>tr(i));return T(new uc(s,A))}},Tc=A=>A!=null?A.nodeType||A.convertTo||(typeof A=="string"?A:null):null;function Sc(A,e){return new Proxy(new Cc(A,e),oa)}const T=(A,e=null)=>fc(A,e),Di=(A,e=null)=>new mc(A,e),os=(A,e=null)=>new Ic(A,e),w=(...A)=>new bc(...A),N=(...A)=>new yc(...A),te=(A,e)=>{const t=new Sc(A,e),s=(...i)=>{let n;return Di(i),i[0]&&i[0].isNode?n=[...i]:n=i[0],t.call(n)};return s.shaderNode=t,s.setLayout=i=>(t.setLayout(i),s),s.once=()=>(t.once=!0,s),s};x("toGlobal",A=>(A.global=!0,A));const sr=(...A)=>ia.If(...A);function Mc(A){return A}x("append",Mc);const Nc=new ee("color"),U=new ee("float",Fi.float),as=new ee("int",Fi.ints),Rc=new ee("uint",Fi.uint),Fc=new ee("bool",Fi.bool),F=new ee("vec2"),Dc=new ee("ivec2"),_c=new ee("uvec2"),kc=new ee("bvec2"),v=new ee("vec3"),Lc=new ee("ivec3"),vc=new ee("uvec3"),Gc=new ee("bvec3"),As=new ee("vec4"),Oc=new ee("ivec4"),Uc=new ee("uvec4"),zc=new ee("bvec4"),ca=new ee("mat2"),_i=new ee("mat3"),Pc=new ee("mat4");x("toColor",Nc),x("toFloat",U),x("toInt",as),x("toUint",Rc),x("toBool",Fc),x("toVec2",F),x("toIVec2",Dc),x("toUVec2",_c),x("toBVec2",kc),x("toVec3",v),x("toIVec3",Lc),x("toUVec3",vc),x("toBVec3",Gc),x("toVec4",As),x("toIVec4",Oc),x("toUVec4",Uc),x("toBVec4",zc),x("toMat2",ca),x("toMat3",_i),x("toMat4",Pc);const Hc=w(_s),qc=(A,e)=>T(new ta(T(A),e));x("element",Hc),x("convert",qc);class la extends L{static get type(){return"UniformGroupNode"}constructor(e,t=!1,s=1){super("string"),this.name=e,this.version=0,this.shared=t,this.order=s,this.isUniformGroup=!0}set needsUpdate(e){e===!0&&this.version++}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const Vc=A=>new la(A),Rt=((A,e=0)=>new la(A,!0,e))("render"),jc=Vc("object");class hs extends Yn{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=jc}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){const s=this.getSelf();return e=e.bind(s),super.onUpdate(i=>{const n=e(i,s);n!==void 0&&(this.value=n)},t)}generate(e,t){const s=this.getNodeType(e),i=this.getUniformHash(e);let n=e.getNodeFromHash(i);n===void 0&&(e.setHashNode(this,i),n=this);const r=n.getInputType(e),o=e.getUniformFromNode(n,r,e.shaderStage,this.name||e.context.label),a=e.getPropertyName(o);return e.context.label!==void 0&&delete e.context.label,e.format(a,s,t)}}const Ce=(A,e)=>{const t=Tc(e||A),s=A&&A.isNode===!0?A.node&&A.node.value||A.value:A;return T(new hs(s,t))};class ua extends L{static get type(){return"PropertyNode"}constructor(e,t=null,s=!1){super(e),this.name=t,this.varying=s,this.isPropertyNode=!0}getHash(e){return this.name||super.getHash(e)}isGlobal(){return!0}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const cs=(A,e)=>T(new ua(A,e)),da=N(ua,"vec4","DiffuseColor");class Jc extends me{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t}hasDependencies(){return!1}getNodeType(e,t){return t!=="void"?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(e.isAvailable("swizzleAssign")===!1&&t.isSplitNode&&t.components.length>1){const s=e.getTypeLength(t.node.getNodeType(e));return Ds.join("").slice(0,s)!==t.components}return!1}generate(e,t){const{targetNode:s,sourceNode:i}=this,n=this.needsSplitAssign(e),r=s.getNodeType(e),o=s.context({assign:!0}).build(e),a=i.build(e,r),h=i.getNodeType(e),c=e.getDataFromNode(this);let l;if(c.initialized===!0)t!=="void"&&(l=o);else if(n){const u=e.getVarFromNode(this,null,r),d=e.getPropertyName(u);e.addLineFlowCode(`${d} = ${a}`,this);const g=s.node.context({assign:!0}).build(e);for(let p=0;p<s.components.length;p++){const f=s.components[p];e.addLineFlowCode(`${g}.${f} = ${d}[ ${p} ]`,this)}t!=="void"&&(l=o)}else l=`${o} = ${a}`,(t==="void"||h==="void")&&(e.addLineFlowCode(l,this),t!=="void"&&(l=o));return c.initialized=!0,e.format(l,r,t)}}x("assign",w(Jc));class Wc extends me{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],s=this.functionNode,i=s.getInputs(e),n=this.parameters;if(Array.isArray(n))for(let o=0;o<n.length;o++){const a=i[o],h=n[o];t.push(h.build(e,a.type))}else for(const o of i){const a=n[o.name];if(a!==void 0)t.push(a.build(e,o.type));else throw new Error(`FunctionCallNode: Input '${o.name}' not found in FunctionNode.`)}return`${s.build(e,"property")}( ${t.join(", ")} )`}}x("call",(A,...e)=>(e=e.length>1||e[0]&&e[0].isNode===!0?os(e):Di(e[0]),T(new Wc(T(A),e))));class J extends me{static get type(){return"OperatorNode"}constructor(e,t,s,...i){if(super(),i.length>0){let n=new J(e,t,s);for(let r=0;r<i.length-1;r++)n=new J(e,n,i[r]);t=n,s=i[i.length-1]}this.op=e,this.aNode=t,this.bNode=s}getNodeType(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=i.getNodeType(e),o=typeof n<"u"?n.getNodeType(e):null;if(r==="void"||o==="void")return"void";if(s==="%")return r;if(s==="~"||s==="&"||s==="|"||s==="^"||s===">>"||s==="<<")return e.getIntegerType(r);if(s==="!"||s==="=="||s==="&&"||s==="||"||s==="^^")return"bool";if(s==="<"||s===">"||s==="<="||s===">="){const a=t?e.getTypeLength(t):Math.max(e.getTypeLength(r),e.getTypeLength(o));return a>1?`bvec${a}`:"bool"}else return r==="float"&&e.isMatrix(o)?o:e.isMatrix(r)&&e.isVector(o)?e.getVectorFromMatrix(r):e.isVector(r)&&e.isMatrix(o)?e.getVectorFromMatrix(o):e.getTypeLength(o)>e.getTypeLength(r)?o:r}generate(e,t){const s=this.op,i=this.aNode,n=this.bNode,r=this.getNodeType(e,t);let o=null,a=null;r!=="void"?(o=i.getNodeType(e),a=typeof n<"u"?n.getNodeType(e):null,s==="<"||s===">"||s==="<="||s===">="||s==="=="?e.isVector(o)?a=o:o!==a&&(o=a="float"):s===">>"||s==="<<"?(o=r,a=e.changeComponentType(a,"uint")):e.isMatrix(o)&&e.isVector(a)?a=e.getVectorFromMatrix(o):e.isVector(o)&&e.isMatrix(a)?o=e.getVectorFromMatrix(a):o=a=r):o=a=r;const h=i.build(e,o),c=typeof n<"u"?n.build(e,a):null,l=e.getTypeLength(t),u=e.getFunctionOperator(s);if(t!=="void")return s==="<"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} < ${c} )`,r,t):s==="<="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("lessThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} <= ${c} )`,r,t):s===">"&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThan",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} > ${c} )`,r,t):s===">="&&l>1?e.useComparisonMethod?e.format(`${e.getMethod("greaterThanEqual",t)}( ${h}, ${c} )`,r,t):e.format(`( ${h} >= ${c} )`,r,t):s==="!"||s==="~"?e.format(`(${s}${h})`,o,t):u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`( ${h} ${s} ${c} )`,r,t);if(o!=="void")return u?e.format(`${u}( ${h}, ${c} )`,r,t):e.format(`${h} ${s} ${c}`,r,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const Ft=w(J,"+"),ki=w(J,"-"),Li=w(J,"*"),ga=w(J,"/"),pa=w(J,"%"),Kc=w(J,"=="),Yc=w(J,"!="),Xc=w(J,"<"),Zc=w(J,">"),$c=w(J,"<="),el=w(J,">="),tl=w(J,"&&"),sl=w(J,"||"),il=w(J,"!"),nl=w(J,"^^"),rl=w(J,"&"),ol=w(J,"~"),al=w(J,"|"),Al=w(J,"^"),hl=w(J,"<<"),cl=w(J,">>");x("add",Ft),x("sub",ki),x("mul",Li),x("div",ga),x("modInt",pa),x("equal",Kc),x("notEqual",Yc),x("lessThan",Xc),x("greaterThan",Zc),x("lessThanEqual",$c),x("greaterThanEqual",el),x("and",tl),x("or",sl),x("not",il),x("xor",nl),x("bitAnd",rl),x("bitNot",ol),x("bitOr",al),x("bitXor",Al),x("shiftLeft",hl),x("shiftRight",cl),x("remainder",(...A)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),pa(...A)));class I extends me{static get type(){return"MathNode"}constructor(e,t,s=null,i=null){super(),this.method=e,this.aNode=t,this.bNode=s,this.cNode=i}getInputType(e){const t=this.aNode.getNodeType(e),s=this.bNode?this.bNode.getNodeType(e):null,i=this.cNode?this.cNode.getNodeType(e):null,n=e.isMatrix(t)?0:e.getTypeLength(t),r=e.isMatrix(s)?0:e.getTypeLength(s),o=e.isMatrix(i)?0:e.getTypeLength(i);return n>r&&n>o?t:r>o?s:o>n?i:t}getNodeType(e){const t=this.method;return t===I.LENGTH||t===I.DISTANCE||t===I.DOT?"float":t===I.CROSS?"vec3":t===I.ALL?"bool":t===I.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):t===I.MOD?this.aNode.getNodeType(e):this.getInputType(e)}generate(e,t){const s=this.method,i=this.getNodeType(e),n=this.getInputType(e),r=this.aNode,o=this.bNode,a=this.cNode,h=e.renderer.isWebGLRenderer===!0;if(s===I.TRANSFORM_DIRECTION){let c=r,l=o;e.isMatrix(c.getNodeType(e))?l=As(v(l),0):c=As(v(c),0);const u=Li(c,l).xyz;return fa(u).build(e,t)}else{if(s===I.NEGATE)return e.format("( - "+r.build(e,n)+" )",i,t);if(s===I.ONE_MINUS)return ki(1,r).build(e,t);if(s===I.RECIPROCAL)return ga(1,r).build(e,t);if(s===I.DIFFERENCE)return rr(ki(r,o)).build(e,t);{const c=[];return s===I.CROSS||s===I.MOD?c.push(r.build(e,i),o.build(e,i)):h&&s===I.STEP?c.push(r.build(e,e.getTypeLength(r.getNodeType(e))===1?"float":n),o.build(e,n)):h&&(s===I.MIN||s===I.MAX)||s===I.MOD?c.push(r.build(e,n),o.build(e,e.getTypeLength(o.getNodeType(e))===1?"float":n)):s===I.REFRACT?c.push(r.build(e,n),o.build(e,n),a.build(e,"float")):s===I.MIX?c.push(r.build(e,n),o.build(e,n),a.build(e,e.getTypeLength(a.getNodeType(e))===1?"float":n)):(c.push(r.build(e,n)),o!==null&&c.push(o.build(e,n)),a!==null&&c.push(a.build(e,n))),e.format(`${e.getMethod(s,i)}( ${c.join(", ")} )`,i,t)}}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}I.ALL="all",I.ANY="any",I.EQUALS="equals",I.RADIANS="radians",I.DEGREES="degrees",I.EXP="exp",I.EXP2="exp2",I.LOG="log",I.LOG2="log2",I.SQRT="sqrt",I.INVERSE_SQRT="inversesqrt",I.FLOOR="floor",I.CEIL="ceil",I.NORMALIZE="normalize",I.FRACT="fract",I.SIN="sin",I.COS="cos",I.TAN="tan",I.ASIN="asin",I.ACOS="acos",I.ATAN="atan",I.ABS="abs",I.SIGN="sign",I.LENGTH="length",I.NEGATE="negate",I.ONE_MINUS="oneMinus",I.DFDX="dFdx",I.DFDY="dFdy",I.ROUND="round",I.RECIPROCAL="reciprocal",I.TRUNC="trunc",I.FWIDTH="fwidth",I.BITCAST="bitcast",I.TRANSPOSE="transpose",I.ATAN2="atan2",I.MIN="min",I.MAX="max",I.MOD="mod",I.STEP="step",I.REFLECT="reflect",I.DISTANCE="distance",I.DIFFERENCE="difference",I.DOT="dot",I.CROSS="cross",I.POW="pow",I.TRANSFORM_DIRECTION="transformDirection",I.MIX="mix",I.CLAMP="clamp",I.REFRACT="refract",I.SMOOTHSTEP="smoothstep",I.FACEFORWARD="faceforward";const ll=U(Math.PI),ul=w(I,I.ALL),dl=w(I,I.ANY),gl=w(I,I.EQUALS),pl=w(I,I.RADIANS),fl=w(I,I.DEGREES),ml=w(I,I.EXP),Il=w(I,I.EXP2),bl=w(I,I.LOG),yl=w(I,I.LOG2),ir=w(I,I.SQRT),El=w(I,I.INVERSE_SQRT),Cl=w(I,I.FLOOR),Bl=w(I,I.CEIL),fa=w(I,I.NORMALIZE),nr=w(I,I.FRACT),ma=w(I,I.SIN),xl=w(I,I.COS),Ql=w(I,I.TAN),wl=w(I,I.ASIN),Tl=w(I,I.ACOS),Sl=w(I,I.ATAN),rr=w(I,I.ABS),Ia=w(I,I.SIGN),Ml=w(I,I.LENGTH),Nl=w(I,I.NEGATE),Rl=w(I,I.ONE_MINUS),Fl=w(I,I.DFDX),Dl=w(I,I.DFDY),_l=w(I,I.ROUND),kl=w(I,I.RECIPROCAL),Ll=w(I,I.TRUNC),vl=w(I,I.FWIDTH);I.BITCAST;const Gl=w(I,I.TRANSPOSE),Ol=w(I,I.ATAN2),Ul=w(I,I.MIN),or=w(I,I.MAX),ba=w(I,I.MOD),ya=w(I,I.STEP),zl=w(I,I.REFLECT),Pl=w(I,I.DISTANCE),Hl=w(I,I.DIFFERENCE),ar=w(I,I.DOT),ql=w(I,I.CROSS),Ea=w(I,I.POW),Vl=w(I,I.POW,2),jl=w(I,I.POW,3),Jl=w(I,I.POW,4),Wl=w(I,I.TRANSFORM_DIRECTION),Kl=A=>Li(Ia(A),Ea(rr(A),1/3)),Yl=A=>ar(A,A),bt=w(I,I.MIX),vi=(A,e=0,t=1)=>T(new I(I.CLAMP,T(A),T(e),T(t))),Xl=A=>vi(A),Zl=w(I,I.REFRACT),Ar=w(I,I.SMOOTHSTEP),$l=w(I,I.FACEFORWARD),eu=te(([A])=>{const s=43758.5453,i=ar(A.xy,F(12.9898,78.233)),n=ba(i,ll);return nr(ma(n).mul(s))}),tu=(A,e,t)=>bt(e,t,A),su=(A,e,t)=>Ar(e,t,A);x("all",ul),x("any",dl),x("equals",gl),x("radians",pl),x("degrees",fl),x("exp",ml),x("exp2",Il),x("log",bl),x("log2",yl),x("sqrt",ir),x("inverseSqrt",El),x("floor",Cl),x("ceil",Bl),x("normalize",fa),x("fract",nr),x("sin",ma),x("cos",xl),x("tan",Ql),x("asin",wl),x("acos",Tl),x("atan",Sl),x("abs",rr),x("sign",Ia),x("length",Ml),x("lengthSq",Yl),x("negate",Nl),x("oneMinus",Rl),x("dFdx",Fl),x("dFdy",Dl),x("round",_l),x("reciprocal",kl),x("trunc",Ll),x("fwidth",vl),x("atan2",Ol),x("min",Ul),x("max",or),x("mod",ba),x("step",ya),x("reflect",zl),x("distance",Pl),x("dot",ar),x("cross",ql),x("pow",Ea),x("pow2",Vl),x("pow3",jl),x("pow4",Jl),x("transformDirection",Wl),x("mix",tu),x("clamp",vi),x("refract",Zl),x("smoothstep",su),x("faceForward",$l),x("difference",Hl),x("saturate",Xl),x("cbrt",Kl),x("transpose",Gl),x("rand",eu);class iu extends L{static get type(){return"ConditionalNode"}constructor(e,t,s=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=s}getNodeType(e){const t=this.ifNode.getNodeType(e);if(this.elseNode!==null){const s=this.elseNode.getNodeType(e);if(e.getTypeLength(s)>e.getTypeLength(t))return s}return t}setup(e){const t=this.condNode.cache(),s=this.ifNode.cache(),i=this.elseNode?this.elseNode.cache():null,n=e.context.nodeBlock;e.getDataFromNode(s).parentNodeBlock=n,i!==null&&(e.getDataFromNode(i).parentNodeBlock=n);const r=e.getNodeProperties(this);r.condNode=t,r.ifNode=s.context({nodeBlock:s}),r.elseNode=i?i.context({nodeBlock:i}):null}generate(e,t){const s=this.getNodeType(e),i=e.getDataFromNode(this);if(i.nodeProperty!==void 0)return i.nodeProperty;const{condNode:n,ifNode:r,elseNode:o}=e.getNodeProperties(this),a=t!=="void",h=a?cs(s).build(e):"";i.nodeProperty=h;const c=n.build(e,"bool");e.addFlowCode(`
|
|
6
|
-
${e.tab}if ( ${c} ) {
|
|
7
|
-
|
|
8
|
-
`).addFlowTab();let l=r.build(e,s);if(l&&(a?l=h+" = "+l+";":l="return "+l+";"),e.removeFlowTab().addFlowCode(e.tab+" "+l+`
|
|
9
|
-
|
|
10
|
-
`+e.tab+"}"),o!==null){e.addFlowCode(` else {
|
|
11
|
-
|
|
12
|
-
`).addFlowTab();let u=o.build(e,s);u&&(a?u=h+" = "+u+";":u="return "+u+";"),e.removeFlowTab().addFlowCode(e.tab+" "+u+`
|
|
13
|
-
|
|
14
|
-
`+e.tab+`}
|
|
15
|
-
|
|
16
|
-
`)}else e.addFlowCode(`
|
|
17
|
-
|
|
18
|
-
`);return e.format(h,s,t)}}const hr=w(iu);x("select",hr),x("cond",(...A)=>(console.warn("TSL.ConditionalNode: cond() has been renamed to select()."),hr(...A)));class nu extends L{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){this.node.build(e)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value});const s=this.node.build(e);return e.setContext(t),s}generate(e,t){const s=e.getContext();e.setContext({...e.context,...this.value});const i=this.node.build(e,t);return e.setContext(s),i}}const Ca=w(nu),ru=(A,e)=>Ca(A,{label:e});x("context",Ca),x("label",ru);class ou extends L{static get type(){return"VarNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:s}=this,i=e.getVarFromNode(this,s,e.getVectorType(this.getNodeType(e))),n=e.getPropertyName(i),r=t.build(e,i.type);return e.addLineFlowCode(`${n} = ${r}`,this),n}}const Ba=w(ou);x("temp",Ba),x("toVar",(...A)=>Ba(...A).append());class au extends L{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0}isGlobal(){return!0}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let s=t.varying;if(s===void 0){const i=this.name,n=this.getNodeType(e);t.varying=s=e.getVaryingFromNode(this,i,n),t.node=this.node}return s.needsInterpolation||(s.needsInterpolation=e.shaderStage==="fragment"),s}setup(e){this.setupVarying(e)}analyze(e){return this.setupVarying(e),this.node.analyze(e)}generate(e){const t=e.getNodeProperties(this),s=this.setupVarying(e);if(t.propertyName===void 0){const i=this.getNodeType(e),n=e.getPropertyName(s,ea.VERTEX);e.flowNodeFromShaderStage(ea.VERTEX,this.node,i,n),t.propertyName=n}return e.getPropertyName(s)}}const ls=w(au);x("varying",ls);const ks="WorkingColorSpace",cr="OutputColorSpace";function xa(A){let e=null;return A===ge?e="Linear":A===ne&&(e="sRGB"),e}function Au(A,e){return xa(A)+"To"+xa(e)}class Gi extends me{static get type(){return"ColorSpaceNode"}constructor(e,t,s){super("vec4"),this.colorNode=e,this.source=t,this.target=s}getColorSpace(e,t){return t===ks?le.workingColorSpace:t===cr?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{renderer:t}=e,{colorNode:s}=this,i=this.getColorSpace(e,this.source),n=this.getColorSpace(e,this.target);if(i===n)return s;const r=Au(i,n);let o=null;const a=t.nodes.library.getColorSpaceFunction(r);return a!==null?o=As(a(s.rgb),s.a):(console.error("ColorSpaceNode: Unsupported Color Space configuration.",r),o=s),o}}const hu=A=>T(new Gi(T(A),ks,cr)),cu=A=>T(new Gi(T(A),cr,ks)),lu=(A,e)=>T(new Gi(T(A),ks,e)),Qa=(A,e)=>T(new Gi(T(A),e,ks));x("toOutputColorSpace",hu),x("toWorkingColorSpace",cu),x("workingToColorSpace",lu),x("colorSpaceToWorking",Qa);let uu=class extends _s{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),s=this.referenceNode.getNodeType(),i=this.getNodeType();return e.format(t,s,i)}};class du extends L{static get type(){return"ReferenceBaseNode"}constructor(e,t,s=null,i=null){super(),this.property=e,this.uniformType=t,this.object=s,this.count=i,this.properties=e.split("."),this.reference=s,this.node=null,this.group=null,this.updateType=$.OBJECT}setGroup(e){return this.group=e,this}element(e){return T(new uu(this,T(e)))}setNodeType(e){const t=Ce(null,e).getSelf();this.group!==null&&t.setGroup(this.group),this.node=t}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let s=e[t[0]];for(let i=1;i<t.length;i++)s=s[t[i]];return s}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}class gu extends du{static get type(){return"RendererReferenceNode"}constructor(e,t,s=null){super(e,t,s),this.renderer=s,this.setGroup(Rt)}updateReference(e){return this.reference=this.renderer!==null?this.renderer:e.renderer,this.reference}}const pu=(A,e,t)=>T(new gu(A,e,t));class fu extends me{static get type(){return"ToneMappingNode"}constructor(e,t=Iu,s=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=s}getCacheKey(){return ac(super.getCacheKey(),this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,s=this.toneMapping;if(s===Ki)return t;let i=null;const n=e.renderer.nodes.library.getToneMappingFunction(s);return n!==null?i=As(n(t.rgb,this.exposureNode),t.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",s),i=t),i}}const mu=(A,e,t)=>T(new fu(A,T(e),T(t))),Iu=pu("toneMappingExposure","float");x("toneMapping",(A,e,t)=>mu(e,t,A));class bu extends Yn{static get type(){return"BufferAttributeNode"}constructor(e,t=null,s=0,i=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=s,this.bufferOffset=i,this.usage=Zs,this.instanced=!1,this.attribute=null,this.global=!0,e&&e.isBufferAttribute===!0&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(this.bufferStride===0&&this.bufferOffset===0){let t=e.globalCache.getData(this.value);return t===void 0&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return this.bufferType===null&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(this.attribute!==null)return;const t=this.getNodeType(e),s=this.value,i=e.getTypeLength(t),n=this.bufferStride||i,r=this.bufferOffset,o=s.isInterleavedBuffer===!0?s:new Mo(s,n),a=new bi(o,i,r);o.setUsage(this.usage),this.attribute=a,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),s=e.getBufferAttributeFromNode(this,t),i=e.getPropertyName(s);let n=null;return e.shaderStage==="vertex"||e.shaderStage==="compute"?(this.name=i,n=i):n=ls(this).build(e,t),n}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&this.attribute.isBufferAttribute===!0&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const yu=(A,e,t,s)=>T(new bu(A,e,t,s));x("toAttribute",A=>yu(A.value));class Eu extends L{static get type(){return"ComputeNode"}constructor(e,t,s=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=s,this.dispatchCount=0,this.version=1,this.updateBeforeType=$.OBJECT,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let s=t[0];for(let i=1;i<t.length;i++)s*=t[i];this.dispatchCount=Math.ceil(e/s)}onInit(){}updateBefore({renderer:e}){e.compute(this)}generate(e){const{shaderStage:t}=e;if(t==="compute"){const s=this.computeNode.build(e,"void");s!==""&&e.addLineFlowCode(s,this)}}}x("compute",(A,e,t)=>T(new Eu(T(A),e,t)));class Cu extends L{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNode=!0}getNodeType(e){return this.node.getNodeType(e)}build(e,...t){const s=e.getCache(),i=e.getCacheFromNode(this,this.parent);e.setCache(i);const n=this.node.build(e,...t);return e.setCache(s),n}}x("cache",(A,...e)=>T(new Cu(T(A),...e)));class Bu extends L{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return t!==""&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}x("bypass",w(Bu));class wa extends L{static get type(){return"RemapNode"}constructor(e,t,s,i=U(0),n=U(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=s,this.outLowNode=i,this.outHighNode=n,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:s,outLowNode:i,outHighNode:n,doClamp:r}=this;let o=e.sub(t).div(s.sub(t));return r===!0&&(o=o.clamp()),o.mul(n.sub(i)).add(i)}}const xu=w(wa,null,null,{doClamp:!1}),Qu=w(wa);x("remap",xu),x("remapClamp",Qu);class wu extends L{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const s=this.getNodeType(e),i=this.snippet;if(s==="void")e.addLineFlowCode(i,this);else return e.format(`( ${i} )`,s,t)}}const Oi=w(wu);x("discard",A=>(A?hr(A,Oi("discard")):Oi("discard")).append());class Tu extends me{static get type(){return"RenderOutputNode"}constructor(e,t,s){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=s,this.isRenderOutput=!0}setup({context:e}){let t=this.colorNode||e.color;const s=(this.toneMapping!==null?this.toneMapping:e.toneMapping)||Ki,i=(this.outputColorSpace!==null?this.outputColorSpace:e.outputColorSpace)||vt;return s!==Ki&&(t=t.toneMapping(s)),i!==vt&&i!==le.workingColorSpace&&(t=t.workingToColorSpace(i)),t}}x("renderOutput",(A,e=null,t=null)=>T(new Tu(T(A),e,t)));class Su extends L{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(t===null){const s=this.getAttributeName(e);if(e.hasGeometryAttribute(s)){const i=e.geometry.getAttribute(s);t=e.getTypeFromAttribute(i)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),s=this.getNodeType(e);if(e.hasGeometryAttribute(t)===!0){const n=e.geometry.getAttribute(t),r=e.getTypeFromAttribute(n),o=e.getAttribute(t,r);return e.shaderStage==="vertex"?e.format(o.name,r,s):ls(this).build(e,s)}else return console.warn(`AttributeNode: Vertex attribute "${t}" not found on geometry.`),e.generateConst(s)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const Ls=(A,e)=>T(new Su(A,e)),Ui=A=>Ls("uv"+(A>0?A:""),"vec2");class Mu extends L{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const s=this.textureNode.build(e,"property"),i=this.levelNode===null?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${s}, ${i} )`,this.getNodeType(e),t)}}const Ta=w(Mu);class Nu extends hs{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=$.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,s=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(s&&s.width!==void 0){const{width:i,height:n}=s;this.value=Math.log2(Math.max(i,n))}}}const Ru=w(Nu);class zi extends hs{static get type(){return"TextureNode"}constructor(e,t=null,s=null,i=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=s,this.biasNode=i,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=$.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(t===null)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return this.value.isDepthTexture===!0?"float":this.value.type===Ur?"uvec4":this.value.type===wA?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return Ui(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return this._matrixUniform===null&&(this._matrixUniform=Ce(this.value.matrix)),this._matrixUniform.mul(v(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?$.FRAME:$.NONE,this}setupUV(e,t){const s=this.value;return e.isFlipY()&&(s.isRenderTargetTexture===!0||s.isFramebufferTexture===!0||s.isDepthTexture===!0)&&(this.sampler?t=t.flipY():t=t.setY(as(Ta(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;let s=this.uvNode;(s===null||e.context.forceUVContext===!0)&&e.context.getUV&&(s=e.context.getUV(this)),s||(s=this.getDefaultUV()),this.updateMatrix===!0&&(s=this.getTransformedUV(s)),s=this.setupUV(e,s);let i=this.levelNode;i===null&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=s,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,this.sampler===!0?"vec2":"ivec2")}generateSnippet(e,t,s,i,n,r,o,a){const h=this.value;let c;return i?c=e.generateTextureLevel(h,t,s,i,r):n?c=e.generateTextureBias(h,t,s,n,r):a?c=e.generateTextureGrad(h,t,s,a,r):o?c=e.generateTextureCompare(h,t,s,o,r):this.sampler===!1?c=e.generateTextureLoad(h,t,s,r):c=e.generateTexture(h,t,s,r),c}generate(e,t){const s=e.getNodeProperties(this),i=this.value;if(!i||i.isTexture!==!0)throw new Error("TextureNode: Need a three.js texture.");const n=super.generate(e,"property");if(t==="sampler")return n+"_sampler";if(e.isReference(t))return n;{const r=e.getDataFromNode(this);let o=r.propertyName;if(o===void 0){const{uvNode:c,levelNode:l,biasNode:u,compareNode:d,depthNode:g,gradNode:p}=s,f=this.generateUV(e,c),m=l?l.build(e,"float"):null,E=u?u.build(e,"float"):null,C=g?g.build(e,"int"):null,y=d?d.build(e,"float"):null,Q=p?[p[0].build(e,"vec2"),p[1].build(e,"vec2")]:null,M=e.getVarFromNode(this);o=e.getPropertyName(M);const S=this.generateSnippet(e,n,f,m,E,C,y,Q);e.addLineFlowCode(`${o} = ${S}`,this),r.snippet=S,r.propertyName=o}let a=o;const h=this.getNodeType(e);return e.needsToWorkingColorSpace(i)&&(a=Qa(Oi(a,h),i.colorSpace).setup(e).build(e,h)),e.format(a,h,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){const t=this.clone();return t.uvNode=T(e),t.referenceNode=this.getSelf(),T(t)}blur(e){const t=this.clone();return t.biasNode=T(e).mul(Ru(t)),t.referenceNode=this.getSelf(),T(t)}level(e){const t=this.clone();return t.levelNode=T(e),t.referenceNode=this.getSelf(),T(t)}size(e){return Ta(this,e)}bias(e){const t=this.clone();return t.biasNode=T(e),t.referenceNode=this.getSelf(),T(t)}compare(e){const t=this.clone();return t.compareNode=T(e),t.referenceNode=this.getSelf(),T(t)}grad(e,t){const s=this.clone();return s.gradNode=[T(e),T(t)],s.referenceNode=this.getSelf(),T(s)}depth(e){const t=this.clone();return t.depthNode=T(e),t.referenceNode=this.getSelf(),T(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;t!==null&&(t.value=e.matrix),e.matrixAutoUpdate===!0&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e}}const vs=w(zi),Gs=Ce("float").label("cameraNear").setGroup(Rt).onRenderUpdate(({camera:A})=>A.near),Os=Ce("float").label("cameraFar").setGroup(Rt).onRenderUpdate(({camera:A})=>A.far),Pi=Ce("mat4").label("cameraViewMatrix").setGroup(Rt).onRenderUpdate(({camera:A})=>A.matrixWorldInverse);class G extends L{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=$.OBJECT,this._uniformNode=new hs(null)}getNodeType(){const e=this.scope;if(e===G.WORLD_MATRIX)return"mat4";if(e===G.POSITION||e===G.VIEW_POSITION||e===G.DIRECTION||e===G.SCALE)return"vec3"}update(e){const t=this.object3d,s=this._uniformNode,i=this.scope;if(i===G.WORLD_MATRIX)s.value=t.matrixWorld;else if(i===G.POSITION)s.value=s.value||new b,s.value.setFromMatrixPosition(t.matrixWorld);else if(i===G.SCALE)s.value=s.value||new b,s.value.setFromMatrixScale(t.matrixWorld);else if(i===G.DIRECTION)s.value=s.value||new b,t.getWorldDirection(s.value);else if(i===G.VIEW_POSITION){const n=e.camera;s.value=s.value||new b,s.value.setFromMatrixPosition(t.matrixWorld),s.value.applyMatrix4(n.matrixWorldInverse)}}generate(e){const t=this.scope;return t===G.WORLD_MATRIX?this._uniformNode.nodeType="mat4":(t===G.POSITION||t===G.VIEW_POSITION||t===G.DIRECTION||t===G.SCALE)&&(this._uniformNode.nodeType="vec3"),this._uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}G.WORLD_MATRIX="worldMatrix",G.POSITION="position",G.SCALE="scale",G.VIEW_POSITION="viewPosition",G.DIRECTION="direction",G.DIRECTION,G.WORLD_MATRIX,G.POSITION,G.SCALE,G.VIEW_POSITION;class Pe extends G{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}Pe.DIRECTION;const Fu=N(Pe,Pe.WORLD_MATRIX);Pe.POSITION,Pe.SCALE,Pe.VIEW_POSITION;const Du=Ce(new Fe).onObjectUpdate(({object:A},e)=>e.value.getNormalMatrix(A.matrixWorld)),Sa=Pi.mul(Fu).toVar("modelViewMatrix_2"),_u=Ls("position","vec3").varying("positionLocal"),we=Sa.mul(_u).xyz.varying("v_positionView"),Ma=we.negate().varying("v_positionViewDirection").normalize().toVar("positionViewDirection");class ku extends L{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:s}=e;return t.coordinateSystem===ht&&s.side===Nr?"false":e.getFrontFacing()}}const lr=U(N(ku)).mul(2).sub(1),Lu=Ls("normal","vec3"),vu=te(A=>A.geometry.hasAttribute("normal")===!1?(console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'),v(0,1,0)):Lu,"vec3").once()().toVar("normalLocal"),Gu=we.dFdx().cross(we.dFdy()).normalize().toVar("normalFlat"),us=te(A=>{let e;return A.material.flatShading===!0?e=Gu:e=ls(Ra(vu),"v_normalView").normalize(),e},"vec3").once()().toVar("normalView"),Na=te(A=>A.context.setupNormal(),"vec3").once()().mul(lr).toVar("transformedNormalView"),Ra=te(([A],e)=>{const t=e.renderer.nodes.modelNormalViewMatrix;if(t!==null)return t.transformDirection(A);const s=Du.mul(A);return Pi.transformDirection(s)}),Ou=Ce(0).onReference(({material:A})=>A).onRenderUpdate(({material:A})=>A.refractionRatio),Uu=Ma.negate().reflect(Na),zu=Ma.negate().refract(Na,Ou),Pu=Uu.transformDirection(Pi).toVar("reflectVector"),Hu=zu.transformDirection(Pi).toVar("reflectVector");class qu extends zi{static get type(){return"CubeTextureNode"}constructor(e,t=null,s=null,i=null){super(e,t,s,i),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===Gr?Pu:e.mapping===BA?Hu:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',e.mapping),v(0,0,0))}setUpdateMatrix(){}setupUV(e,t){const s=this.value;return e.renderer.coordinateSystem===$s||!s.isRenderTargetTexture?v(t.x.negate(),t.yz):t}generateUV(e,t){return t.build(e,"vec3")}}const Vu=w(qu);class Fa extends hs{static get type(){return"BufferNode"}constructor(e,t,s=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=s}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const ju=(A,e,t)=>T(new Fa(A,e,t));class Ju extends _s{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),s=this.getNodeType();return e.format(t,"vec4",s)}}class Wu extends Fa{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null,"vec4"),this.array=e,this.elementType=t,this._elementType=null,this._elementLength=0,this.updateType=$.RENDER,this.isArrayBufferNode=!0}getElementType(){return this.elementType||this._elementType}getElementLength(){return this._elementLength}update(){const{array:e,value:t}=this,s=this.getElementLength(),i=this.getElementType();if(s===1)for(let n=0;n<e.length;n++){const r=n*4;t[r]=e[n]}else if(i==="color")for(let n=0;n<e.length;n++){const r=n*4,o=e[n];t[r]=o.r,t[r+1]=o.g,t[r+2]=o.b||0}else for(let n=0;n<e.length;n++){const r=n*4,o=e[n];t[r]=o.x,t[r+1]=o.y,t[r+2]=o.z||0,t[r+3]=o.w||0}}setup(e){const t=this.array.length;this._elementType=this.elementType===null?Ni(this.array[0]):this.elementType,this._elementLength=e.getTypeLength(this._elementType);let s=Float32Array;return this._elementType.charAt(0)==="i"?s=Int32Array:this._elementType.charAt(0)==="u"&&(s=Uint32Array),this.value=new s(t*4),this.bufferCount=t,this.bufferType=e.changeComponentType("vec4",e.getComponentType(this._elementType)),super.setup(e)}element(e){return T(new Ju(this,T(e)))}}const ur=(A,e)=>T(new Wu(A,e));class Ku extends _s{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),s=this.referenceNode.getNodeType(),i=this.getNodeType();return e.format(t,s,i)}}class Da extends L{static get type(){return"ReferenceNode"}constructor(e,t,s=null,i=null){super(),this.property=e,this.uniformType=t,this.object=s,this.count=i,this.properties=e.split("."),this.reference=s,this.node=null,this.group=null,this.name=null,this.updateType=$.OBJECT}element(e){return T(new Ku(this,T(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;this.count!==null?t=ju(null,e,this.count):Array.isArray(this.getValueFromReference())?t=ur(null,e):e==="texture"?t=vs(null):e==="cubeTexture"?t=Vu(null):t=Ce(null,e),this.group!==null&&t.setGroup(this.group),this.name!==null&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return this.node===null&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let s=e[t[0]];for(let i=1;i<t.length;i++)s=s[t[i]];return s}updateReference(e){return this.reference=this.object!==null?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){this.node===null&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const Dt=(A,e,t)=>T(new Da(A,e,t));class Yu extends Da{static get type(){return"MaterialReferenceNode"}constructor(e,t,s=null){super(e,t,s),this.material=s,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=this.material!==null?this.material:e.material,this.reference}}const Xu=(A,e,t)=>T(new Yu(A,e,t)),_a=te(A=>(A.geometry.hasAttribute("tangent")===!1&&A.geometry.computeTangents(),Ls("tangent","vec4")))(),Zu=_a.xyz.toVar("tangentLocal"),ka=Sa.mul(As(Zu,0)).xyz.varying("v_tangentView").normalize().toVar("tangentView"),$u=_i(ka,ls((A=>A.mul(_a.w).xyz)(us.cross(ka)),"v_bitangentView").normalize().toVar("bitangentView"),us),ed=te(A=>{const{eye_pos:e,surf_norm:t,mapN:s,uv:i}=A,n=e.dFdx(),r=e.dFdy(),o=i.dFdx(),a=i.dFdy(),h=t,c=r.cross(h),l=h.cross(n),u=c.mul(o.x).add(l.mul(a.x)),d=c.mul(o.y).add(l.mul(a.y)),g=u.dot(u).max(d.dot(d)),p=lr.mul(g.inverseSqrt());return Ft(u.mul(s.x,p),d.mul(s.y,p),h.mul(s.z)).normalize()});class td extends me{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=rn}setup(e){const{normalMapType:t,scaleNode:s}=this;let i=this.node.mul(2).sub(1);s!==null&&(i=v(i.xy.mul(s),i.z));let n=null;return t===_A?n=Ra(i):t===rn&&(e.hasGeometryAttribute("tangent")===!0?n=$u.mul(i).normalize():n=ed({eye_pos:we,surf_norm:us,mapN:i,uv:Ui()})),n}}const La=w(td),sd=te(({textureNode:A,bumpScale:e})=>{const t=i=>A.cache().context({getUV:n=>i(n.uvNode||Ui()),forceUVContext:!0}),s=U(t(i=>i));return F(U(t(i=>i.add(i.dFdx()))).sub(s),U(t(i=>i.add(i.dFdy()))).sub(s)).mul(e)}),id=te(A=>{const{surf_pos:e,surf_norm:t,dHdxy:s}=A,i=e.dFdx().normalize(),n=e.dFdy().normalize(),r=t,o=n.cross(r),a=r.cross(i),h=i.dot(o).mul(lr),c=h.sign().mul(s.x.mul(o).add(s.y.mul(a)));return h.abs().mul(t).sub(c).normalize()});class nd extends me{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=this.scaleNode!==null?this.scaleNode:1,t=sd({textureNode:this.textureNode,bumpScale:e});return id({surf_pos:we,surf_norm:us,dHdxy:t})}}const rd=w(nd),va=new Map;class B extends L{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let s=va.get(e);return s===void 0&&(s=Xu(e,t),va.set(e,s)),s}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache(e==="map"?"map":e+"Map","texture")}setup(e){const t=e.context.material,s=this.scope;let i=null;if(s===B.COLOR){const n=t.color!==void 0?this.getColor(s):v();t.map&&t.map.isTexture===!0?i=n.mul(this.getTexture("map")):i=n}else if(s===B.OPACITY){const n=this.getFloat(s);t.alphaMap&&t.alphaMap.isTexture===!0?i=n.mul(this.getTexture("alpha")):i=n}else if(s===B.SPECULAR_STRENGTH)t.specularMap&&t.specularMap.isTexture===!0?i=this.getTexture("specular").r:i=U(1);else if(s===B.SPECULAR_INTENSITY){const n=this.getFloat(s);t.specularMap?i=n.mul(this.getTexture(s).a):i=n}else if(s===B.SPECULAR_COLOR){const n=this.getColor(s);t.specularColorMap&&t.specularColorMap.isTexture===!0?i=n.mul(this.getTexture(s).rgb):i=n}else if(s===B.ROUGHNESS){const n=this.getFloat(s);t.roughnessMap&&t.roughnessMap.isTexture===!0?i=n.mul(this.getTexture(s).g):i=n}else if(s===B.METALNESS){const n=this.getFloat(s);t.metalnessMap&&t.metalnessMap.isTexture===!0?i=n.mul(this.getTexture(s).b):i=n}else if(s===B.EMISSIVE){const n=this.getFloat("emissiveIntensity"),r=this.getColor(s).mul(n);t.emissiveMap&&t.emissiveMap.isTexture===!0?i=r.mul(this.getTexture(s)):i=r}else if(s===B.NORMAL)t.normalMap?(i=La(this.getTexture("normal"),this.getCache("normalScale","vec2")),i.normalMapType=t.normalMapType):t.bumpMap?i=rd(this.getTexture("bump").r,this.getFloat("bumpScale")):i=us;else if(s===B.CLEARCOAT){const n=this.getFloat(s);t.clearcoatMap&&t.clearcoatMap.isTexture===!0?i=n.mul(this.getTexture(s).r):i=n}else if(s===B.CLEARCOAT_ROUGHNESS){const n=this.getFloat(s);t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.isTexture===!0?i=n.mul(this.getTexture(s).r):i=n}else if(s===B.CLEARCOAT_NORMAL)t.clearcoatNormalMap?i=La(this.getTexture(s),this.getCache(s+"Scale","vec2")):i=us;else if(s===B.SHEEN){const n=this.getColor("sheenColor").mul(this.getFloat("sheen"));t.sheenColorMap&&t.sheenColorMap.isTexture===!0?i=n.mul(this.getTexture("sheenColor").rgb):i=n}else if(s===B.SHEEN_ROUGHNESS){const n=this.getFloat(s);t.sheenRoughnessMap&&t.sheenRoughnessMap.isTexture===!0?i=n.mul(this.getTexture(s).a):i=n,i=i.clamp(.07,1)}else if(s===B.ANISOTROPY)if(t.anisotropyMap&&t.anisotropyMap.isTexture===!0){const n=this.getTexture(s);i=ca(Us.x,Us.y,Us.y.negate(),Us.x).mul(n.rg.mul(2).sub(F(1)).normalize().mul(n.b))}else i=Us;else if(s===B.IRIDESCENCE_THICKNESS){const n=Dt("1","float",t.iridescenceThicknessRange);if(t.iridescenceThicknessMap){const r=Dt("0","float",t.iridescenceThicknessRange);i=n.sub(r).mul(this.getTexture(s).g).add(r)}else i=n}else if(s===B.TRANSMISSION){const n=this.getFloat(s);t.transmissionMap?i=n.mul(this.getTexture(s).r):i=n}else if(s===B.THICKNESS){const n=this.getFloat(s);t.thicknessMap?i=n.mul(this.getTexture(s).g):i=n}else if(s===B.IOR)i=this.getFloat(s);else if(s===B.LIGHT_MAP)i=this.getTexture(s).rgb.mul(this.getFloat("lightMapIntensity"));else if(s===B.AO_MAP)i=this.getTexture(s).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const n=this.getNodeType(e);i=this.getCache(s,n)}return i}}B.ALPHA_TEST="alphaTest",B.COLOR="color",B.OPACITY="opacity",B.SHININESS="shininess",B.SPECULAR="specular",B.SPECULAR_STRENGTH="specularStrength",B.SPECULAR_INTENSITY="specularIntensity",B.SPECULAR_COLOR="specularColor",B.REFLECTIVITY="reflectivity",B.ROUGHNESS="roughness",B.METALNESS="metalness",B.NORMAL="normal",B.CLEARCOAT="clearcoat",B.CLEARCOAT_ROUGHNESS="clearcoatRoughness",B.CLEARCOAT_NORMAL="clearcoatNormal",B.EMISSIVE="emissive",B.ROTATION="rotation",B.SHEEN="sheen",B.SHEEN_ROUGHNESS="sheenRoughness",B.ANISOTROPY="anisotropy",B.IRIDESCENCE="iridescence",B.IRIDESCENCE_IOR="iridescenceIOR",B.IRIDESCENCE_THICKNESS="iridescenceThickness",B.IOR="ior",B.TRANSMISSION="transmission",B.THICKNESS="thickness",B.ATTENUATION_DISTANCE="attenuationDistance",B.ATTENUATION_COLOR="attenuationColor",B.LINE_SCALE="scale",B.LINE_DASH_SIZE="dashSize",B.LINE_GAP_SIZE="gapSize",B.LINE_WIDTH="linewidth",B.LINE_DASH_OFFSET="dashOffset",B.POINT_WIDTH="pointWidth",B.DISPERSION="dispersion",B.LIGHT_MAP="light",B.AO_MAP="ao",B.ALPHA_TEST,B.COLOR,B.SHININESS,B.EMISSIVE,B.OPACITY,B.SPECULAR,B.SPECULAR_INTENSITY,B.SPECULAR_COLOR,B.SPECULAR_STRENGTH,B.REFLECTIVITY,B.ROUGHNESS,B.METALNESS,B.CLEARCOAT,B.CLEARCOAT_ROUGHNESS,B.ROTATION,B.SHEEN,B.SHEEN_ROUGHNESS,B.ANISOTROPY,B.IRIDESCENCE,B.IRIDESCENCE_IOR,B.IRIDESCENCE_THICKNESS,B.TRANSMISSION,B.THICKNESS,B.IOR,B.ATTENUATION_DISTANCE,B.ATTENUATION_COLOR,B.LINE_SCALE,B.LINE_DASH_SIZE,B.LINE_GAP_SIZE,B.LINE_WIDTH,B.LINE_DASH_OFFSET,B.POINT_WIDTH,B.DISPERSION,B.LIGHT_MAP,B.AO_MAP;const Us=Ce(new q).onReference(function(A){return A.material}).onRenderUpdate(function({material:A}){this.value.set(A.anisotropy*Math.cos(A.anisotropyRotation),A.anisotropy*Math.sin(A.anisotropyRotation))});class j extends L{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isInstanceIndexNode=!0}generate(e){const t=this.getNodeType(e),s=this.scope;let i;if(s===j.VERTEX)i=e.getVertexIndex();else if(s===j.INSTANCE)i=e.getInstanceIndex();else if(s===j.DRAW)i=e.getDrawIndex();else if(s===j.INVOCATION_LOCAL)i=e.getInvocationLocalIndex();else if(s===j.INVOCATION_SUBGROUP)i=e.getInvocationSubgroupIndex();else if(s===j.SUBGROUP)i=e.getSubgroupIndex();else throw new Error("THREE.IndexNode: Unknown scope: "+s);let n;return e.shaderStage==="vertex"||e.shaderStage==="compute"?n=i:n=ls(this).build(e,t),n}}j.VERTEX="vertex",j.INSTANCE="instance",j.SUBGROUP="subgroup",j.INVOCATION_LOCAL="invocationLocal",j.INVOCATION_SUBGROUP="invocationSubgroup",j.DRAW="draw",j.VERTEX,j.INSTANCE,j.SUBGROUP,j.INVOCATION_SUBGROUP,j.INVOCATION_LOCAL,j.DRAW;class od extends L{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode(105+e)}getProperties(e){const t=e.getNodeProperties(this);if(t.stackNode!==void 0)return t;const s={};for(let n=0,r=this.params.length-1;n<r;n++){const o=this.params[n],a=o.isNode!==!0&&o.name||this.getVarName(n),h=o.isNode!==!0&&o.type||"int";s[a]=Oi(a,h)}const i=e.addStack();return t.returnsNode=this.params[this.params.length-1](s,i,e),t.stackNode=i,e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),s=this.params,i=t.stackNode;for(let o=0,a=s.length-1;o<a;o++){const h=s[o];let c=null,l=null,u=null,d=null,g=null,p=null;h.isNode?(d="int",u=this.getVarName(o),c="0",l=h.build(e,d),g="<"):(d=h.type||"int",u=h.name||this.getVarName(o),c=h.start,l=h.end,g=h.condition,p=h.update,typeof c=="number"?c=c.toString():c&&c.isNode&&(c=c.build(e,d)),typeof l=="number"?l=l.toString():l&&l.isNode&&(l=l.build(e,d)),c!==void 0&&l===void 0?(c=c+" - 1",l="0",g=">="):l!==void 0&&c===void 0&&(c="0",g="<"),g===void 0&&(Number(c)>Number(l)?g=">=":g="<"));const f={start:c,end:l},m=f.start,E=f.end;let C="",y="",Q="";p||(d==="int"||d==="uint"?g.includes("<")?p="++":p="--":g.includes("<")?p="+= 1.":p="-= 1."),C+=e.getVar(d,u)+" = "+m,y+=u+" "+g+" "+E,Q+=u+" "+p;const M=`for ( ${C}; ${y}; ${Q} )`;e.addFlowCode((o===0?`
|
|
19
|
-
`:"")+e.tab+M+` {
|
|
20
|
-
|
|
21
|
-
`).addFlowTab()}const n=i.build(e,"void"),r=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode(`
|
|
22
|
-
`+e.tab+n);for(let o=0,a=this.params.length-1;o<a;o++)e.addFlowCode((o===0?"":e.tab)+`}
|
|
23
|
-
|
|
24
|
-
`).removeFlowTab();return e.addFlowTab(),r}}const ds=(...A)=>T(new od(os(A,"int"))).append();let zs,Ps;class se extends L{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===se.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=$.NONE;return(this.scope===se.SIZE||this.scope===se.VIEWPORT)&&(e=$.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===se.VIEWPORT?t!==null?Ps.copy(t.viewport):(e.getViewport(Ps),Ps.multiplyScalar(e.getPixelRatio())):t!==null?(zs.width=t.width,zs.height=t.height):e.getDrawingBufferSize(zs)}setup(){const e=this.scope;let t=null;return e===se.SIZE?t=Ce(zs||(zs=new q)):e===se.VIEWPORT?t=Ce(Ps||(Ps=new K)):t=F(Hi.div(Ga)),t}generate(e){if(this.scope===se.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const s=e.getNodeProperties(Ga).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${s}.y - ${t}.y )`}return t}return super.generate(e)}}se.COORDINATE="coordinate",se.VIEWPORT="viewport",se.SIZE="size",se.UV="uv";const dr=N(se,se.UV),Ga=N(se,se.SIZE),Hi=N(se,se.COORDINATE),Oa=N(se,se.VIEWPORT);Oa.zw,Oa.xy;const Hs=new q;class ad extends zi{static get type(){return"ViewportTextureNode"}constructor(e=dr,t=null,s=null){s===null&&(s=new Sh,s.minFilter=kt),super(s,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=$.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(Hs);const s=this.value;(s.image.width!==Hs.width||s.image.height!==Hs.height)&&(s.image.width=Hs.width,s.image.height=Hs.height,s.needsUpdate=!0);const i=s.generateMipmaps;s.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(s),s.generateMipmaps=i}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}let gr=null;class Ad extends ad{static get type(){return"ViewportDepthTextureNode"}constructor(e=dr,t=null){gr===null&&(gr=new So),super(e,t,gr)}}const hd=w(Ad);class Ie extends L{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===Ie.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,s=this.valueNode;let i=null;if(t===Ie.DEPTH_BASE)s!==null&&(i=za().assign(s));else if(t===Ie.DEPTH)e.isPerspectiveCamera?i=cd(we.z,Gs,Os):i=qi(we.z,Gs,Os);else if(t===Ie.LINEAR_DEPTH)if(s!==null)if(e.isPerspectiveCamera){const n=Ua(s,Gs,Os);i=qi(n,Gs,Os)}else i=s;else i=qi(we.z,Gs,Os);return i}}Ie.DEPTH_BASE="depthBase",Ie.DEPTH="depth",Ie.LINEAR_DEPTH="linearDepth";const qi=(A,e,t)=>A.add(e).div(e.sub(t)),cd=(A,e,t)=>e.add(A).mul(t).div(t.sub(e).mul(A)),Ua=(A,e,t)=>e.mul(t).div(t.sub(e).mul(A).sub(t)),za=w(Ie,Ie.DEPTH_BASE),ld=N(Ie,Ie.DEPTH),ud=w(Ie,Ie.LINEAR_DEPTH);hd(),ld.assign=A=>za(A);class qs extends L{static get type(){return"ClippingNode"}constructor(e=qs.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{localClipIntersection:s,localClippingCount:i,globalClippingCount:n}=t,r=n+i,o=s?r-i:r;return this.scope===qs.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(t.planes,r,o):this.setupDefault(t.planes,r,o)}setupAlphaToCoverage(e,t,s){return te(()=>{const i=ur(e),n=cs("float","distanceToPlane"),r=cs("float","distanceToGradient"),o=cs("float","clipOpacity");o.assign(1);let a;if(ds(s,({i:h})=>{a=i.element(h),n.assign(we.dot(a.xyz).negate().add(a.w)),r.assign(n.fwidth().div(2)),o.mulAssign(Ar(r.negate(),r,n)),o.equal(0).discard()}),s<t){const h=cs("float","unionclipOpacity");h.assign(1),ds({start:s,end:t},({i:c})=>{a=i.element(c),n.assign(we.dot(a.xyz).negate().add(a.w)),r.assign(n.fwidth().div(2)),h.mulAssign(Ar(r.negate(),r,n).oneMinus())}),o.mulAssign(h.oneMinus())}da.a.mulAssign(o),da.a.equal(0).discard()})()}setupDefault(e,t,s){return te(()=>{const i=ur(e);let n;if(ds(s,({i:r})=>{n=i.element(r),we.dot(n.xyz).greaterThan(n.w).discard()}),s<t){const r=cs("bool","clipped");r.assign(!0),ds({start:s,end:t},({i:o})=>{n=i.element(o),r.assign(we.dot(n.xyz).greaterThan(n.w).and(r))}),r.discard()}})()}}qs.ALPHA_TO_COVERAGE="alphaToCoverage",qs.DEFAULT="default",v(.04),U(1);const dd=te(([A,e])=>{const t=A.toVar();t.assign(Li(2,t).sub(1));const s=v(t,1).toVar();return sr(e.equal(0),()=>{s.assign(s.zyx)}).ElseIf(e.equal(1),()=>{s.assign(s.xzy),s.xz.mulAssign(-1)}).ElseIf(e.equal(2),()=>{s.x.mulAssign(-1)}).ElseIf(e.equal(3),()=>{s.assign(s.zyx),s.xz.mulAssign(-1)}).ElseIf(e.equal(4),()=>{s.assign(s.xzy),s.xy.mulAssign(-1)}).ElseIf(e.equal(5),()=>{s.z.mulAssign(-1)}),s}).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]});te(({texture:A,uv:e})=>{const s=v().toVar();return sr(e.x.lessThan(1e-4),()=>{s.assign(v(1,0,0))}).ElseIf(e.y.lessThan(1e-4),()=>{s.assign(v(0,1,0))}).ElseIf(e.z.lessThan(1e-4),()=>{s.assign(v(0,0,1))}).ElseIf(e.x.greaterThan(1-1e-4),()=>{s.assign(v(-1,0,0))}).ElseIf(e.y.greaterThan(1-1e-4),()=>{s.assign(v(0,-1,0))}).ElseIf(e.z.greaterThan(1-1e-4),()=>{s.assign(v(0,0,-1))}).Else(()=>{const n=A.uv(e.add(v(-.01,0,0))).r.sub(A.uv(e.add(v(.01,0,0))).r),r=A.uv(e.add(v(0,-.01,0))).r.sub(A.uv(e.add(v(0,.01,0))).r),o=A.uv(e.add(v(0,0,-.01))).r.sub(A.uv(e.add(v(0,0,.01))).r);s.assign(v(n,r,o))}),s.normalize()});const pr=dd(Ui(),Ls("faceIndex")).normalize();v(pr.x,pr.y.negate(),pr.z);class ve extends hs{static get type(){return"TimerNode"}constructor(e=ve.LOCAL,t=1,s=0){super(s),this.scope=e,this.scale=t,this.updateType=$.FRAME}update(e){const t=this.scope,s=this.scale;t===ve.LOCAL?this.value+=e.deltaTime*s:t===ve.DELTA?this.value=e.deltaTime*s:t===ve.FRAME?this.value=e.frameId:this.value=e.time*s}serialize(e){super.serialize(e),e.scope=this.scope,e.scale=this.scale}deserialize(e){super.deserialize(e),this.scope=e.scope,this.scale=e.scale}}ve.LOCAL="local",ve.GLOBAL="global",ve.DELTA="delta",ve.FRAME="frame";const gd=(A,e=0)=>T(new ve(ve.LOCAL,A,e));class oe extends L{static get type(){return"OscNode"}constructor(e=oe.SINE,t=gd()){super(),this.method=e,this.timeNode=t}getNodeType(e){return this.timeNode.getNodeType(e)}setup(){const e=this.method,t=T(this.timeNode);let s=null;return e===oe.SINE?s=t.add(.75).mul(Math.PI*2).sin().mul(.5).add(.5):e===oe.SQUARE?s=t.fract().round():e===oe.TRIANGLE?s=t.add(.5).fract().mul(2).sub(1).abs():e===oe.SAWTOOTH&&(s=t.fract()),s}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}oe.SINE="sine",oe.SQUARE="square",oe.TRIANGLE="triangle",oe.SAWTOOTH="sawtooth",oe.SINE,oe.SQUARE,oe.TRIANGLE,oe.SAWTOOTH,new St,new b,new b,new b,new k,new b(0,0,-1),new K,new b,new b,new K,new q,new ho,dr.flipX();class He extends L{static get type(){return"SceneNode"}constructor(e=He.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,s=this.scene!==null?this.scene:e.scene;let i;return t===He.BACKGROUND_BLURRINESS?i=Dt("backgroundBlurriness","float",s):t===He.BACKGROUND_INTENSITY?i=Dt("backgroundIntensity","float",s):console.error("THREE.SceneNode: Unknown scope:",t),i}}He.BACKGROUND_BLURRINESS="backgroundBlurriness",He.BACKGROUND_INTENSITY="backgroundIntensity",He.BACKGROUND_BLURRINESS,He.BACKGROUND_INTENSITY;const pd=new q;class fd extends zi{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class Pa extends fd{static get type(){return"PassMultipleTextureNode"}constructor(e,t,s=!1){super(e,null),this.textureName=t,this.previousTexture=s}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class Vi extends me{static get type(){return"PassNode"}constructor(e,t,s,i={}){super("vec4"),this.scope=e,this.scene=t,this.camera=s,this.options=i,this._pixelRatio=1,this._width=1,this._height=1;const n=new So;n.isRenderTargetTexture=!0,n.name="depth";const r=new ho(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Ct,...i});r.texture.name="output",r.depthTexture=n,this.renderTarget=r,this.updateBeforeType=$.FRAME,this._textures={output:r.texture,depth:n},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Ce(0),this._cameraFar=Ce(0),this._mrt=null,this.isPassNode=!0}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(e){let t=this._textures[e];return t===void 0&&(t=this.renderTarget.texture.clone(),t.isRenderTargetTexture=!0,t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return t===void 0&&(t=this.getTexture(e).clone(),t.isRenderTargetTexture=!0,this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(t!==void 0){const s=this._textures[e],i=this.renderTarget.textures.indexOf(s);this.renderTarget.textures[i]=t,this._textures[e]=t,this._previousTextures[e]=s,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return t===void 0&&(this._textureNodes[e]=t=T(new Pa(this,e)),this._textureNodes[e].updateTexture()),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return t===void 0&&(this._textureNodes[e]===void 0&&this.getTextureNode(e),this._previousTextureNodes[e]=t=T(new Pa(this,e,!0)),this._previousTextureNodes[e].updateTexture()),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(t===void 0){const s=this._cameraNear,i=this._cameraFar;this._viewZNodes[e]=t=Ua(this.getTextureNode(e),s,i)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(t===void 0){const s=this._cameraNear,i=this._cameraFar,n=this.getViewZNode(e);this._linearDepthNodes[e]=t=qi(n,s,i)}return t}setup({renderer:e}){return this.renderTarget.samples=this.options.samples===void 0?e.samples:this.options.samples,e.backend.isWebGLBackend===!0&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===Vi.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:s,camera:i}=this;this._pixelRatio=t.getPixelRatio();const n=t.getSize(pd);this.setSize(n.width,n.height);const r=t.getRenderTarget(),o=t.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const a in this._previousTextures)this.toggleTexture(a);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(s,i),t.setRenderTarget(r),t.setMRT(o)}setSize(e,t){this._width=e,this._height=t;const s=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget.setSize(s,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}Vi.COLOR="color",Vi.DEPTH="depth",te(({depthTexture:A,shadowCoord:e})=>vs(A,e.xy).compare(e.z)),te(({depthTexture:A,shadowCoord:e,shadow:t})=>{const s=(p,f)=>vs(A,p).compare(f),i=Dt("mapSize","vec2",t).setGroup(Rt),n=Dt("radius","float",t).setGroup(Rt),r=F(1).div(i),o=r.x.negate().mul(n),a=r.y.negate().mul(n),h=r.x.mul(n),c=r.y.mul(n),l=o.div(2),u=a.div(2),d=h.div(2),g=c.div(2);return Ft(s(e.xy.add(F(o,a)),e.z),s(e.xy.add(F(0,a)),e.z),s(e.xy.add(F(h,a)),e.z),s(e.xy.add(F(l,u)),e.z),s(e.xy.add(F(0,u)),e.z),s(e.xy.add(F(d,u)),e.z),s(e.xy.add(F(o,0)),e.z),s(e.xy.add(F(l,0)),e.z),s(e.xy,e.z),s(e.xy.add(F(d,0)),e.z),s(e.xy.add(F(h,0)),e.z),s(e.xy.add(F(l,g)),e.z),s(e.xy.add(F(0,g)),e.z),s(e.xy.add(F(d,g)),e.z),s(e.xy.add(F(o,c)),e.z),s(e.xy.add(F(0,c)),e.z),s(e.xy.add(F(h,c)),e.z)).mul(1/17)}),te(({depthTexture:A,shadowCoord:e,shadow:t})=>{const s=(c,l)=>vs(A,c).compare(l),i=Dt("mapSize","vec2",t).setGroup(Rt),n=F(1).div(i),r=n.x,o=n.y,a=e.xy,h=nr(a.mul(i).add(.5));return a.subAssign(h.mul(n)),Ft(s(a,e.z),s(a.add(F(r,0)),e.z),s(a.add(F(0,o)),e.z),s(a.add(n),e.z),bt(s(a.add(F(r.negate(),0)),e.z),s(a.add(F(r.mul(2),0)),e.z),h.x),bt(s(a.add(F(r.negate(),o)),e.z),s(a.add(F(r.mul(2),o)),e.z),h.x),bt(s(a.add(F(0,o.negate())),e.z),s(a.add(F(0,o.mul(2))),e.z),h.y),bt(s(a.add(F(r,o.negate())),e.z),s(a.add(F(r,o.mul(2))),e.z),h.y),bt(bt(s(a.add(F(r.negate(),o.negate())),e.z),s(a.add(F(r.mul(2),o.negate())),e.z),h.x),bt(s(a.add(F(r.negate(),o.mul(2))),e.z),s(a.add(F(r.mul(2),o.mul(2))),e.z),h.x),h.y)).mul(1/9)}),te(({depthTexture:A,shadowCoord:e})=>{const t=U(1).toVar(),s=vs(A).uv(e.xy).rg,i=ya(e.z,s.x);return sr(i.notEqual(U(1)),()=>{const n=e.z.sub(s.x),r=or(0,s.y.mul(s.y));let o=r.div(r.add(n.mul(n)));o=vi(ki(o,.3).div(.95-.3)),t.assign(vi(or(i,o)))}),t}),te(({samples:A,radius:e,size:t,shadowPass:s})=>{const i=U(0).toVar(),n=U(0).toVar(),r=A.lessThanEqual(U(1)).select(U(0),U(2).div(A.sub(1))),o=A.lessThanEqual(U(1)).select(U(0),U(-1));ds({start:as(0),end:as(A),type:"int",condition:"<"},({i:h})=>{const c=o.add(U(h).mul(r)),l=s.uv(Ft(Hi.xy,F(0,c).mul(e)).div(t)).x;i.addAssign(l),n.addAssign(l.mul(l))}),i.divAssign(A),n.divAssign(A);const a=ir(n.sub(i.mul(i)));return F(i,a)}),te(({samples:A,radius:e,size:t,shadowPass:s})=>{const i=U(0).toVar(),n=U(0).toVar(),r=A.lessThanEqual(U(1)).select(U(0),U(2).div(A.sub(1))),o=A.lessThanEqual(U(1)).select(U(0),U(-1));ds({start:as(0),end:as(A),type:"int",condition:"<"},({i:h})=>{const c=o.add(U(h).mul(r)),l=s.uv(Ft(Hi.xy,F(c,0).mul(e)).div(t));i.addAssign(l.x),n.addAssign(Ft(l.y.mul(l.y),l.x.mul(l.x)))}),i.divAssign(A),n.divAssign(A);const a=ir(n.sub(i.mul(i)));return F(i,a)}),v(1.6605,-.1246,-.0182),v(-.5876,1.1329,-.1006),v(-.0728,-.0083,1.1187),v(.6274,.0691,.0164),v(.3293,.9195,.088),v(.0433,.0113,.8956);class md extends L{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:s}=e;s.backend.isWebGLBackend===!0?e.addFlowCode(` // ${t}Barrier
|
|
25
|
-
`):e.addLineFlowCode(`${t}Barrier()`,this)}}w(md);class qe extends me{static get type(){return"AtomicFunctionNode"}constructor(e,t,s,i=null){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=s,this.storeNode=i}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=this.method,s=this.getNodeType(e),i=this.getInputType(e),n=this.pointerNode,r=this.valueNode,o=[];o.push(`&${n.build(e,i)}`),o.push(r.build(e,i));const a=`${e.getMethod(t,s)}( ${o.join(", ")} )`;if(this.storeNode!==null){const h=this.storeNode.build(e,i);e.addLineFlowCode(`${h} = ${a}`,this)}else e.addLineFlowCode(a,this)}}if(qe.ATOMIC_LOAD="atomicLoad",qe.ATOMIC_STORE="atomicStore",qe.ATOMIC_ADD="atomicAdd",qe.ATOMIC_SUB="atomicSub",qe.ATOMIC_MAX="atomicMax",qe.ATOMIC_MIN="atomicMin",qe.ATOMIC_AND="atomicAnd",qe.ATOMIC_OR="atomicOr",qe.ATOMIC_XOR="atomicXor",w(qe),typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ks}})),typeof window<"u"){try{self.location.href,window.__THREE__IMPORTS__||(window.__THREE__IMPORTS__=[]),window.__THREE__IMPORTS__.push({url:self.location.href,revision:Ks})}catch{}window.__THREE__?(console.warn("WARNING: Multiple instances of Three.js being imported. Existing: "+window.__THREE__+", new: "+Ks),console.warn(window.__THREE__IMPORTS__)):window.__THREE__=Ks}const fr=new WeakMap;class Id extends It{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,i){const n=new Nt(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,r=>{this.parse(r,t,i)},s,i)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,ne,s).catch(s)}decodeDracoFile(e,t,s,i,n=ge,r=()=>{}){const o={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:n};return this.decodeGeometry(e,o).then(t).catch(r)}decodeGeometry(e,t){const s=JSON.stringify(t);if(fr.has(e)){const a=fr.get(e);if(a.key===s)return a.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const n=this.workerNextTaskID++,r=e.byteLength,o=this._getWorker(n,r).then(a=>(i=a,new Promise((h,c)=>{i._callbacks[n]={resolve:h,reject:c},i.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(a=>this._createGeometry(a.geometry));return o.catch(()=>!0).then(()=>{i&&n&&this._releaseTask(i,n)}),fr.set(e,{key:s,promise:o}),o}_createGeometry(e){const t=new wt;e.index&&t.setIndex(new ye(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const i=e.attributes[s],n=i.name,r=i.array,o=i.itemSize,a=new ye(r,o);n==="color"&&(this._assignVertexColorSpace(a,i.vertexColorSpace),a.normalized=!(r instanceof Float32Array)),t.setAttribute(n,a)}return t}_assignVertexColorSpace(e,t){if(t!==ne)return;const s=new X;for(let i=0,n=e.count;i<n;i++)s.fromBufferAttribute(e,i),le.toWorkingColorSpace(s,ne),e.setXYZ(i,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new Nt(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((i,n)=>{s.load(e,i,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(s=>{const i=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const n=bd.toString(),r=["/* draco decoder */",i,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(`
|
|
26
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(n){const r=n.data;switch(r.type){case"decode":i._callbacks[r.id].resolve(r);break;case"error":i._callbacks[r.id].reject(r);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+r.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,n){return i._taskLoad>n._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function bd(){let A,e;onmessage=function(r){const o=r.data;switch(o.type){case"init":A=o.decoderConfig,e=new Promise(function(c){A.onModuleLoaded=function(l){c({draco:l})},DracoDecoderModule(A)});break;case"decode":const a=o.buffer,h=o.taskConfig;e.then(c=>{const l=c.draco,u=new l.Decoder;try{const d=t(l,u,new Int8Array(a),h),g=d.attributes.map(p=>p.array.buffer);d.index&&g.push(d.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:d},g)}catch(d){console.error(d),self.postMessage({type:"error",id:o.id,error:d.message})}finally{l.destroy(u)}});break}};function t(r,o,a,h){const c=h.attributeIDs,l=h.attributeTypes;let u,d;const g=o.GetEncodedGeometryType(a);if(g===r.TRIANGULAR_MESH)u=new r.Mesh,d=o.DecodeArrayToMesh(a,a.byteLength,u);else if(g===r.POINT_CLOUD)u=new r.PointCloud,d=o.DecodeArrayToPointCloud(a,a.byteLength,u);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||u.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const p={index:null,attributes:[]};for(const f in c){const m=self[l[f]];let E,C;if(h.useUniqueIDs)C=c[f],E=o.GetAttributeByUniqueId(u,C);else{if(C=o.GetAttributeId(u,r[c[f]]),C===-1)continue;E=o.GetAttribute(u,C)}const y=i(r,o,u,f,m,E);f==="color"&&(y.vertexColorSpace=h.vertexColorSpace),p.attributes.push(y)}return g===r.TRIANGULAR_MESH&&(p.index=s(r,o,u)),r.destroy(u),p}function s(r,o,a){const c=a.num_faces()*3,l=c*4,u=r._malloc(l);o.GetTrianglesUInt32Array(a,l,u);const d=new Uint32Array(r.HEAPF32.buffer,u,c).slice();return r._free(u),{array:d,itemSize:1}}function i(r,o,a,h,c,l){const u=l.num_components(),g=a.num_points()*u,p=g*c.BYTES_PER_ELEMENT,f=n(r,c),m=r._malloc(p);o.GetAttributeDataArrayForAllPoints(a,l,f,p,m);const E=new c(r.HEAPF32.buffer,m,g).slice();return r._free(m),{name:h,array:E,itemSize:u}}function n(r,o){switch(o){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32}}}function Ha(A,e){if(e===DA)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),A;if(e===nn||e===Zr){let t=A.getIndex();if(t===null){const r=[],o=A.getAttribute("position");if(o!==void 0){for(let a=0;a<o.count;a++)r.push(a);A.setIndex(r),t=A.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),A}const s=t.count-2,i=[];if(e===nn)for(let r=1;r<=s;r++)i.push(t.getX(0)),i.push(t.getX(r)),i.push(t.getX(r+1));else for(let r=0;r<s;r++)r%2===0?(i.push(t.getX(r)),i.push(t.getX(r+1)),i.push(t.getX(r+2))):(i.push(t.getX(r+2)),i.push(t.getX(r+1)),i.push(t.getX(r)));i.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const n=A.clone();return n.setIndex(i),n.clearGroups(),n}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),A}class yd extends It{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Qd(t)}),this.register(function(t){return new wd(t)}),this.register(function(t){return new kd(t)}),this.register(function(t){return new Ld(t)}),this.register(function(t){return new vd(t)}),this.register(function(t){return new Sd(t)}),this.register(function(t){return new Md(t)}),this.register(function(t){return new Nd(t)}),this.register(function(t){return new Rd(t)}),this.register(function(t){return new xd(t)}),this.register(function(t){return new Fd(t)}),this.register(function(t){return new Td(t)}),this.register(function(t){return new _d(t)}),this.register(function(t){return new Dd(t)}),this.register(function(t){return new Cd(t)}),this.register(function(t){return new Gd(t)}),this.register(function(t){return new Od(t)})}load(e,t,s,i){const n=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const h=Fs.extractUrlBase(e);r=Fs.resolveURL(h,this.path)}else r=Fs.extractUrlBase(e);this.manager.itemStart(e);const o=function(h){i?i(h):console.error(h),n.manager.itemError(e),n.manager.itemEnd(e)},a=new Nt(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(h){try{n.parse(h,r,function(c){t(c),n.manager.itemEnd(e)},o)}catch(c){o(c)}},s,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,i){let n,r;const o={},a={},h=new TextDecoder;if(typeof e=="string")try{n=JSON.parse(e)}catch(l){r=e,i&&i(l);return}else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===qa){try{o[_.KHR_BINARY_GLTF]=new Ud(e)}catch(u){i&&i(u);return}try{n=JSON.parse(o[_.KHR_BINARY_GLTF].content)}catch(u){r=o[_.KHR_BINARY_GLTF].content,i&&i(u);return}}else try{n=JSON.parse(h.decode(e))}catch(u){r=h.decode(e),i&&i(u);return}else n=e;if(n.asset===void 0||n.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=n,this.jsonErrorData=r;const c=new $d(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){const u=this.pluginCallbacks[l](c);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,o[u.name]=!0}if(n.extensionsUsed)for(let l=0;l<n.extensionsUsed.length;++l){const u=n.extensionsUsed[l],d=n.extensionsRequired||[];switch(u){case _.KHR_MATERIALS_UNLIT:o[u]=new Bd;break;case _.KHR_DRACO_MESH_COMPRESSION:o[u]=new zd(n,this.dracoLoader);break;case _.KHR_TEXTURE_TRANSFORM:o[u]=new Pd;break;case _.KHR_MESH_QUANTIZATION:o[u]=new Hd;break;default:d.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,n){s.parse(e,t,i,n)})}}function Ed(){let A={};return{get:function(e){return A[e]},add:function(e,t){A[e]=t},remove:function(e){delete A[e]},removeAll:function(){A={}}}}const _={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Cd{constructor(e){this.parser=e,this.name=_.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s<i;s++){const n=t[s];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let i=t.cache.get(s);if(i)return i;const n=t.json,a=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e];let h;const c=new X(16777215);a.color!==void 0&&c.setRGB(a.color[0],a.color[1],a.color[2],ge);const l=a.range!==void 0?a.range:0;switch(a.type){case"directional":h=new Yh(c),h.target.position.set(0,0,-1),h.add(h.target);break;case"point":h=new Wh(c),h.distance=l;break;case"spot":h=new jh(c),h.distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle!==void 0?a.spot.innerConeAngle:0,a.spot.outerConeAngle=a.spot.outerConeAngle!==void 0?a.spot.outerConeAngle:Math.PI/4,h.angle=a.spot.outerConeAngle,h.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,h.target.position.set(0,0,-1),h.add(h.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return h.position.set(0,0,0),h.decay=2,st(h,a),a.intensity!==void 0&&(h.intensity=a.intensity),h.name=t.createUniqueName(a.name||"light_"+e),i=Promise.resolve(h),t.cache.add(s,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,n=s.json.nodes[e],o=(n.extensions&&n.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(a){return s._getNodeRef(t.cache,o,a)})}}class Bd{constructor(){this.name=_.KHR_MATERIALS_UNLIT}getMaterialType(){return Xt}extendParams(e,t,s){const i=[];e.color=new X(1,1,1),e.opacity=1;const n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){const r=n.baseColorFactor;e.color.setRGB(r[0],r[1],r[2],ge),e.opacity=r[3]}n.baseColorTexture!==void 0&&i.push(s.assignTexture(e,"map",n.baseColorTexture,ne))}return Promise.all(i)}}class xd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name].emissiveStrength;return n!==void 0&&(t.emissiveIntensity=n),Promise.resolve()}}class Qd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];if(r.clearcoatFactor!==void 0&&(t.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&n.push(s.assignTexture(t,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&n.push(s.assignTexture(t,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(n.push(s.assignTexture(t,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const o=r.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new q(o,o)}return Promise.all(n)}}class wd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_DISPERSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name];return t.dispersion=n.dispersion!==void 0?n.dispersion:0,Promise.resolve()}}class Td{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];return r.iridescenceFactor!==void 0&&(t.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&n.push(s.assignTexture(t,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(t.iridescenceIOR=r.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&n.push(s.assignTexture(t,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(n)}}class Sd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_SHEEN}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[];t.sheenColor=new X(0,0,0),t.sheenRoughness=0,t.sheen=1;const r=i.extensions[this.name];if(r.sheenColorFactor!==void 0){const o=r.sheenColorFactor;t.sheenColor.setRGB(o[0],o[1],o[2],ge)}return r.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&n.push(s.assignTexture(t,"sheenColorMap",r.sheenColorTexture,ne)),r.sheenRoughnessTexture!==void 0&&n.push(s.assignTexture(t,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(n)}}class Md{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];return r.transmissionFactor!==void 0&&(t.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&n.push(s.assignTexture(t,"transmissionMap",r.transmissionTexture)),Promise.all(n)}}class Nd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_VOLUME}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];t.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&n.push(s.assignTexture(t,"thicknessMap",r.thicknessTexture)),t.attenuationDistance=r.attenuationDistance||1/0;const o=r.attenuationColor||[1,1,1];return t.attenuationColor=new X().setRGB(o[0],o[1],o[2],ge),Promise.all(n)}}class Rd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_IOR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name];return t.ior=n.ior!==void 0?n.ior:1.5,Promise.resolve()}}class Fd{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_SPECULAR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];t.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&n.push(s.assignTexture(t,"specularIntensityMap",r.specularTexture));const o=r.specularColorFactor||[1,1,1];return t.specularColor=new X().setRGB(o[0],o[1],o[2],ge),r.specularColorTexture!==void 0&&n.push(s.assignTexture(t,"specularColorMap",r.specularColorTexture,ne)),Promise.all(n)}}class Dd{constructor(e){this.parser=e,this.name=_.EXT_MATERIALS_BUMP}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];return t.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&n.push(s.assignTexture(t,"bumpMap",r.bumpTexture)),Promise.all(n)}}class _d{constructor(e){this.parser=e,this.name=_.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:Ue}extendMaterialParams(e,t){const s=this.parser,i=s.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=[],r=i.extensions[this.name];return r.anisotropyStrength!==void 0&&(t.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(t.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&n.push(s.assignTexture(t,"anisotropyMap",r.anisotropyTexture)),Promise.all(n)}}class kd{constructor(e){this.parser=e,this.name=_.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,i=s.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const n=i.extensions[this.name],r=t.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,r)}}class Ld{constructor(e){this.parser=e,this.name=_.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,n=i.textures[e];if(!n.extensions||!n.extensions[t])return null;const r=n.extensions[t],o=i.images[r.source];let a=s.textureLoader;if(o.uri){const h=s.options.manager.getHandler(o.uri);h!==null&&(a=h)}return this.detectSupport().then(function(h){if(h)return s.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class vd{constructor(e){this.parser=e,this.name=_.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,n=i.textures[e];if(!n.extensions||!n.extensions[t])return null;const r=n.extensions[t],o=i.images[r.source];let a=s.textureLoader;if(o.uri){const h=s.options.manager.getHandler(o.uri);h!==null&&(a=h)}return this.detectSupport().then(function(h){if(h)return s.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Gd{constructor(e){this.name=_.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],n=this.parser.getDependency("buffer",i.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then(function(o){const a=i.byteOffset||0,h=i.byteLength||0,c=i.count,l=i.byteStride,u=new Uint8Array(o,a,h);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(c,l,u,i.mode,i.filter).then(function(d){return d.buffer}):r.ready.then(function(){const d=new ArrayBuffer(c*l);return r.decodeGltfBuffer(new Uint8Array(d),c,l,u,i.mode,i.filter),d})})}else return null}}class Od{constructor(e){this.name=_.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=t.meshes[s.mesh];for(const h of i.primitives)if(h.mode!==Te.TRIANGLES&&h.mode!==Te.TRIANGLE_STRIP&&h.mode!==Te.TRIANGLE_FAN&&h.mode!==void 0)return null;const r=s.extensions[this.name].attributes,o=[],a={};for(const h in r)o.push(this.parser.getDependency("accessor",r[h]).then(c=>(a[h]=c,a[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const c=h.pop(),l=c.isGroup?c.children:[c],u=h[0].count,d=[];for(const g of l){const p=new k,f=new b,m=new ct,E=new b(1,1,1),C=new xh(g.geometry,g.material,u);for(let y=0;y<u;y++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,y),a.ROTATION&&m.fromBufferAttribute(a.ROTATION,y),a.SCALE&&E.fromBufferAttribute(a.SCALE,y),C.setMatrixAt(y,p.compose(f,m,E));for(const y in a)if(y==="_COLOR_0"){const Q=a[y];C.instanceColor=new vn(Q.array,Q.itemSize,Q.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&g.geometry.setAttribute(y,a[y]);Y.prototype.copy.call(C,g),this.parser.assignFinalMaterial(C),d.push(C)}return c.isGroup?(c.clear(),c.add(...d),c):d[0]}))}}const qa="glTF",Vs=12,Va={JSON:1313821514,BIN:5130562};class Ud{constructor(e){this.name=_.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Vs),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==qa)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Vs,n=new DataView(e,Vs);let r=0;for(;r<i;){const o=n.getUint32(r,!0);r+=4;const a=n.getUint32(r,!0);if(r+=4,a===Va.JSON){const h=new Uint8Array(e,Vs+r,o);this.content=s.decode(h)}else if(a===Va.BIN){const h=Vs+r;this.body=e.slice(h,h+o)}r+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class zd{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=_.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,i=this.dracoLoader,n=e.extensions[this.name].bufferView,r=e.extensions[this.name].attributes,o={},a={},h={};for(const c in r){const l=Ir[c]||c.toLowerCase();o[l]=r[c]}for(const c in e.attributes){const l=Ir[c]||c.toLowerCase();if(r[c]!==void 0){const u=s.accessors[e.attributes[c]],d=gs[u.componentType];h[l]=d.name,a[l]=u.normalized===!0}}return t.getDependency("bufferView",n).then(function(c){return new Promise(function(l,u){i.decodeDracoFile(c,function(d){for(const g in d.attributes){const p=d.attributes[g],f=a[g];f!==void 0&&(p.normalized=f)}l(d)},o,h,ge,u)})})}}class Pd{constructor(){this.name=_.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Hd{constructor(){this.name=_.KHR_MESH_QUANTIZATION}}class ja extends Ns{constructor(e,t,s,i){super(e,t,s,i)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,i=this.valueSize,n=e*i*3+i;for(let r=0;r!==i;r++)t[r]=s[n+r];return t}interpolate_(e,t,s,i){const n=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=o*2,h=o*3,c=i-t,l=(s-t)/c,u=l*l,d=u*l,g=e*h,p=g-h,f=-2*d+3*u,m=d-u,E=1-f,C=m-u+l;for(let y=0;y!==o;y++){const Q=r[p+y+o],M=r[p+y+a]*c,S=r[g+y+o],R=r[g+y]*c;n[y]=E*Q+C*M+f*S+m*R}return n}}const qd=new ct;class Vd extends ja{interpolate_(e,t,s,i){const n=super.interpolate_(e,t,s,i);return qd.fromArray(n).normalize().toArray(n),n}}const Te={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},gs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ja={9728:Me,9729:ot,9984:Or,9985:QA,9986:xA,9987:kt},Wa={33071:Et,33648:Yi,10497:ps},mr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ir={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},yt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},jd={CUBICSPLINE:void 0,LINEAR:Is,STEP:ms},br={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Jd(A){return A.DefaultMaterial===void 0&&(A.DefaultMaterial=new zn({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ys})),A.DefaultMaterial}function _t(A,e,t){for(const s in t.extensions)A[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function st(A,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(A.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Wd(A,e,t){let s=!1,i=!1,n=!1;for(let h=0,c=e.length;h<c;h++){const l=e[h];if(l.POSITION!==void 0&&(s=!0),l.NORMAL!==void 0&&(i=!0),l.COLOR_0!==void 0&&(n=!0),s&&i&&n)break}if(!s&&!i&&!n)return Promise.resolve(A);const r=[],o=[],a=[];for(let h=0,c=e.length;h<c;h++){const l=e[h];if(s){const u=l.POSITION!==void 0?t.getDependency("accessor",l.POSITION):A.attributes.position;r.push(u)}if(i){const u=l.NORMAL!==void 0?t.getDependency("accessor",l.NORMAL):A.attributes.normal;o.push(u)}if(n){const u=l.COLOR_0!==void 0?t.getDependency("accessor",l.COLOR_0):A.attributes.color;a.push(u)}}return Promise.all([Promise.all(r),Promise.all(o),Promise.all(a)]).then(function(h){const c=h[0],l=h[1],u=h[2];return s&&(A.morphAttributes.position=c),i&&(A.morphAttributes.normal=l),n&&(A.morphAttributes.color=u),A.morphTargetsRelative=!0,A})}function Kd(A,e){if(A.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)A.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(A.morphTargetInfluences.length===t.length){A.morphTargetDictionary={};for(let s=0,i=t.length;s<i;s++)A.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Yd(A){let e;const t=A.extensions&&A.extensions[_.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+yr(t.attributes):e=A.indices+":"+yr(A.attributes)+":"+A.mode,A.targets!==void 0)for(let s=0,i=A.targets.length;s<i;s++)e+=":"+yr(A.targets[s]);return e}function yr(A){let e="";const t=Object.keys(A).sort();for(let s=0,i=t.length;s<i;s++)e+=t[s]+":"+A[t[s]]+";";return e}function Er(A){switch(A){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Xd(A){return A.search(/\.jpe?g($|\?)/i)>0||A.search(/^data\:image\/jpeg/)===0?"image/jpeg":A.search(/\.webp($|\?)/i)>0||A.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Zd=new k;class $d{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Ed,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,i=-1,n=!1,r=-1;if(typeof navigator<"u"){const o=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(o)===!0;const a=o.match(/Version\/(\d+)/);i=s&&a?parseInt(a[1],10):-1,n=o.indexOf("Firefox")>-1,r=n?o.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&i<17||n&&r<98?this.textureLoader=new qh(this.options.manager):this.textureLoader=new Xh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Nt(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,i=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(r){const o={scene:r[0][i.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:i.asset,parser:s,userData:{}};return _t(n,o,i),st(o,i),Promise.all(s._invokeAll(function(a){return a.afterRoot&&a.afterRoot(o)})).then(function(){for(const a of o.scenes)a.updateMatrixWorld();e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let i=0,n=t.length;i<n;i++){const r=t[i].joints;for(let o=0,a=r.length;o<a;o++)e[r[o]].isBone=!0}for(let i=0,n=e.length;i<n;i++){const r=e[i];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(s[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const i=s.clone(),n=(r,o)=>{const a=this.associations.get(r);a!=null&&this.associations.set(o,a);for(const[h,c]of r.children.entries())n(c,o.children[h])};return n(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const i=e(t[s]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let i=0;i<t.length;i++){const n=e(t[i]);n&&s.push(n)}return s}getDependency(e,t){const s=e+":"+t;let i=this.cache.get(s);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":i=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(s,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(n,r){return s.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[_.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(n,r){s.load(Fs.resolveURL(t.uri,i.path),n,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const i=t.byteLength||0,n=t.byteOffset||0;return s.slice(n,n+i)})}loadAccessor(e){const t=this,s=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const r=mr[i.type],o=gs[i.componentType],a=i.normalized===!0,h=new o(i.count*r);return Promise.resolve(new ye(h,r,a))}const n=[];return i.bufferView!==void 0?n.push(this.getDependency("bufferView",i.bufferView)):n.push(null),i.sparse!==void 0&&(n.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(n).then(function(r){const o=r[0],a=mr[i.type],h=gs[i.componentType],c=h.BYTES_PER_ELEMENT,l=c*a,u=i.byteOffset||0,d=i.bufferView!==void 0?s.bufferViews[i.bufferView].byteStride:void 0,g=i.normalized===!0;let p,f;if(d&&d!==l){const m=Math.floor(u/d),E="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+m+":"+i.count;let C=t.cache.get(E);C||(p=new h(o,m*d,i.count*d/c),C=new Mo(p,d/c),t.cache.add(E,C)),f=new bi(C,a,u%d/c,g)}else o===null?p=new h(i.count*a):p=new h(o,u,i.count*a),f=new ye(p,a,g);if(i.sparse!==void 0){const m=mr.SCALAR,E=gs[i.sparse.indices.componentType],C=i.sparse.indices.byteOffset||0,y=i.sparse.values.byteOffset||0,Q=new E(r[1],C,i.sparse.count*m),M=new h(r[2],y,i.sparse.count*a);o!==null&&(f=new ye(f.array.slice(),f.itemSize,f.normalized)),f.normalized=!1;for(let S=0,R=Q.length;S<R;S++){const D=Q[S];if(f.setX(D,M[S*a]),a>=2&&f.setY(D,M[S*a+1]),a>=3&&f.setZ(D,M[S*a+2]),a>=4&&f.setW(D,M[S*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}f.normalized=g}return f})}loadTexture(e){const t=this.json,s=this.options,n=t.textures[e].source,r=t.images[n];let o=this.textureLoader;if(r.uri){const a=s.manager.getHandler(r.uri);a!==null&&(o=a)}return this.loadTextureImage(e,n,o)}loadTextureImage(e,t,s){const i=this,n=this.json,r=n.textures[e],o=n.images[t],a=(o.uri||o.bufferView)+":"+r.sampler;if(this.textureCache[a])return this.textureCache[a];const h=this.loadImageSource(t,s).then(function(c){c.flipY=!1,c.name=r.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const u=(n.samplers||{})[r.sampler]||{};return c.magFilter=Ja[u.magFilter]||ot,c.minFilter=Ja[u.minFilter]||kt,c.wrapS=Wa[u.wrapS]||ps,c.wrapT=Wa[u.wrapT]||ps,c.anisotropy=4,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[a]=h,h}loadImageSource(e,t){const s=this,i=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(l=>l.clone());const r=i.images[e],o=self.URL||self.webkitURL;let a=r.uri||"",h=!1;if(r.bufferView!==void 0)a=s.getDependency("bufferView",r.bufferView).then(function(l){h=!0;const u=new Blob([l],{type:r.mimeType});return a=o.createObjectURL(u),a});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then(function(l){return new Promise(function(u,d){let g=u;t.isImageBitmapLoader===!0&&(g=function(p){const f=new ue(p);f.needsUpdate=!0,u(f)}),t.load(Fs.resolveURL(l,n.path),g,void 0,d)})}).then(function(l){return h===!0&&o.revokeObjectURL(a),st(l,r),l.userData.mimeType=r.mimeType||Xd(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),l});return this.sourceCache[e]=c,c}assignTexture(e,t,s,i){const n=this;return this.getDependency("texture",s.index).then(function(r){if(!r)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(r=r.clone(),r.channel=s.texCoord),n.extensions[_.KHR_TEXTURE_TRANSFORM]){const o=s.extensions!==void 0?s.extensions[_.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const a=n.associations.get(r);r=n.extensions[_.KHR_TEXTURE_TRANSFORM].extendTexture(r,o),n.associations.set(r,a)}}return i!==void 0&&(r.colorSpace=i),e[t]=r,r})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,r=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+s.uuid;let a=this.cache.get(o);a||(a=new qo,Qt.prototype.copy.call(a,s),a.color.copy(s.color),a.map=s.map,a.sizeAttenuation=!1,this.cache.add(o,a)),s=a}else if(e.isLine){const o="LineBasicMaterial:"+s.uuid;let a=this.cache.get(o);a||(a=new Oo,Qt.prototype.copy.call(a,s),a.color.copy(s.color),a.map=s.map,this.cache.add(o,a)),s=a}if(i||n||r){let o="ClonedMaterial:"+s.uuid+":";i&&(o+="derivative-tangents:"),n&&(o+="vertex-colors:"),r&&(o+="flat-shading:");let a=this.cache.get(o);a||(a=s.clone(),n&&(a.vertexColors=!0),r&&(a.flatShading=!0),i&&(a.normalScale&&(a.normalScale.y*=-1),a.clearcoatNormalScale&&(a.clearcoatNormalScale.y*=-1)),this.cache.add(o,a),this.associations.set(a,this.associations.get(s))),s=a}e.material=s}getMaterialType(){return zn}loadMaterial(e){const t=this,s=this.json,i=this.extensions,n=s.materials[e];let r;const o={},a=n.extensions||{},h=[];if(a[_.KHR_MATERIALS_UNLIT]){const l=i[_.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),h.push(l.extendParams(o,n,t))}else{const l=n.pbrMetallicRoughness||{};if(o.color=new X(1,1,1),o.opacity=1,Array.isArray(l.baseColorFactor)){const u=l.baseColorFactor;o.color.setRGB(u[0],u[1],u[2],ge),o.opacity=u[3]}l.baseColorTexture!==void 0&&h.push(t.assignTexture(o,"map",l.baseColorTexture,ne)),o.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,o.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(h.push(t.assignTexture(o,"metalnessMap",l.metallicRoughnessTexture)),h.push(t.assignTexture(o,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(u){return u.getMaterialType&&u.getMaterialType(e)}),h.push(Promise.all(this._invokeAll(function(u){return u.extendMaterialParams&&u.extendMaterialParams(e,o)})))}n.doubleSided===!0&&(o.side=yA);const c=n.alphaMode||br.OPAQUE;if(c===br.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===br.MASK&&(o.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&r!==Xt&&(h.push(t.assignTexture(o,"normalMap",n.normalTexture)),o.normalScale=new q(1,1),n.normalTexture.scale!==void 0)){const l=n.normalTexture.scale;o.normalScale.set(l,l)}if(n.occlusionTexture!==void 0&&r!==Xt&&(h.push(t.assignTexture(o,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&r!==Xt){const l=n.emissiveFactor;o.emissive=new X().setRGB(l[0],l[1],l[2],ge)}return n.emissiveTexture!==void 0&&r!==Xt&&h.push(t.assignTexture(o,"emissiveMap",n.emissiveTexture,ne)),Promise.all(h).then(function(){const l=new r(o);return n.name&&(l.name=n.name),st(l,n),t.associations.set(l,{materials:e}),n.extensions&&_t(i,l,n),l})}createUniqueName(e){const t=P.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function n(o){return s[_.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(a){return Ka(a,o,t)})}const r=[];for(let o=0,a=e.length;o<a;o++){const h=e[o],c=Yd(h),l=i[c];if(l)r.push(l.promise);else{let u;h.extensions&&h.extensions[_.KHR_DRACO_MESH_COMPRESSION]?u=n(h):u=Ka(new wt,h,t),i[c]={primitive:h,promise:u},r.push(u)}}return Promise.all(r)}loadMesh(e){const t=this,s=this.json,i=this.extensions,n=s.meshes[e],r=n.primitives,o=[];for(let a=0,h=r.length;a<h;a++){const c=r[a].material===void 0?Jd(this.cache):this.getDependency("material",r[a].material);o.push(c)}return o.push(t.loadGeometries(r)),Promise.all(o).then(function(a){const h=a.slice(0,a.length-1),c=a[a.length-1],l=[];for(let d=0,g=c.length;d<g;d++){const p=c[d],f=r[d];let m;const E=h[d];if(f.mode===Te.TRIANGLES||f.mode===Te.TRIANGLE_STRIP||f.mode===Te.TRIANGLE_FAN||f.mode===void 0)m=n.isSkinnedMesh===!0?new Eh(p,E):new fi(p,E),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),f.mode===Te.TRIANGLE_STRIP?m.geometry=Ha(m.geometry,Zr):f.mode===Te.TRIANGLE_FAN&&(m.geometry=Ha(m.geometry,nn));else if(f.mode===Te.LINES)m=new Qh(p,E);else if(f.mode===Te.LINE_STRIP)m=new On(p,E);else if(f.mode===Te.LINE_LOOP)m=new wh(p,E);else if(f.mode===Te.POINTS)m=new Th(p,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+f.mode);Object.keys(m.geometry.morphAttributes).length>0&&Kd(m,n),m.name=t.createUniqueName(n.name||"mesh_"+e),st(m,n),f.extensions&&_t(i,m,f),t.assignFinalMaterial(m),l.push(m)}for(let d=0,g=l.length;d<g;d++)t.associations.set(l[d],{meshes:e,primitives:d});if(l.length===1)return n.extensions&&_t(i,l[0],n),l[0];const u=new Fn;n.extensions&&_t(i,u,n),t.associations.set(u,{meshes:e});for(let d=0,g=l.length;d<g;d++)u.add(l[d]);return u})}loadCamera(e){let t;const s=this.json.cameras[e],i=s[s.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new Nn(ro.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):s.type==="orthographic"&&(t=new To(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),st(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let i=0,n=t.joints.length;i<n;i++)s.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(i){const n=i.pop(),r=i,o=[],a=[];for(let h=0,c=r.length;h<c;h++){const l=r[h];if(l){o.push(l);const u=new k;n!==null&&u.fromArray(n.array,h*16),a.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[h])}return new Ln(o,a)})}loadAnimation(e){const t=this.json,s=this,i=t.animations[e],n=i.name?i.name:"animation_"+e,r=[],o=[],a=[],h=[],c=[];let l=0,u=i.channels.length;for(l=0,u=i.channels.length;l<u;l++){const d=i.channels[l],g=i.samplers[d.sampler],p=d.target,f=p.node,m=i.parameters!==void 0?i.parameters[g.input]:g.input,E=i.parameters!==void 0?i.parameters[g.output]:g.output;p.node!==void 0&&(r.push(this.getDependency("node",f)),o.push(this.getDependency("accessor",m)),a.push(this.getDependency("accessor",E)),h.push(g),c.push(p))}return Promise.all([Promise.all(r),Promise.all(o),Promise.all(a),Promise.all(h),Promise.all(c)]).then(function(d){const g=d[0],p=d[1],f=d[2],m=d[3],E=d[4],C=[];for(l=0,u=g.length;l<u;l++){const y=g[l],Q=p[l],M=f[l],S=m[l],R=E[l];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const D=s._createAnimationTracks(y,Q,M,S,R);if(D)for(let O=0;O<D.length;O++)C.push(D[O])}return new vh(n,void 0,C)})}createNodeMesh(e){const t=this.json,s=this,i=t.nodes[e];return i.mesh===void 0?null:s.getDependency("mesh",i.mesh).then(function(n){const r=s._getNodeRef(s.meshCache,i.mesh,n);return i.weights!==void 0&&r.traverse(function(o){if(o.isMesh)for(let a=0,h=i.weights.length;a<h;a++)o.morphTargetInfluences[a]=i.weights[a]}),r})}loadNode(e){const t=this.json,s=this,i=t.nodes[e],n=s._loadNodeShallow(e),r=[],o=i.children||[];for(let h=0,c=o.length;h<c;h++)r.push(s.getDependency("node",o[h]));const a=i.skin===void 0?Promise.resolve(null):s.getDependency("skin",i.skin);return Promise.all([n,Promise.all(r),a]).then(function(h){const c=h[0],l=h[1],u=h[2];u!==null&&c.traverse(function(d){d.isSkinnedMesh&&d.bind(u,Zd)});for(let d=0,g=l.length;d<g;d++)c.add(l[d]);return c})}_loadNodeShallow(e){const t=this.json,s=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const n=t.nodes[e],r=n.name?i.createUniqueName(n.name):"",o=[],a=i._invokeOne(function(h){return h.createNodeMesh&&h.createNodeMesh(e)});return a&&o.push(a),n.camera!==void 0&&o.push(i.getDependency("camera",n.camera).then(function(h){return i._getNodeRef(i.cameraCache,n.camera,h)})),i._invokeAll(function(h){return h.createNodeAttachment&&h.createNodeAttachment(e)}).forEach(function(h){o.push(h)}),this.nodeCache[e]=Promise.all(o).then(function(h){let c;if(n.isBone===!0?c=new ko:h.length>1?c=new Fn:h.length===1?c=h[0]:c=new Y,c!==h[0])for(let l=0,u=h.length;l<u;l++)c.add(h[l]);if(n.name&&(c.userData.name=n.name,c.name=r),st(c,n),n.extensions&&_t(s,c,n),n.matrix!==void 0){const l=new k;l.fromArray(n.matrix),c.applyMatrix4(l)}else n.translation!==void 0&&c.position.fromArray(n.translation),n.rotation!==void 0&&c.quaternion.fromArray(n.rotation),n.scale!==void 0&&c.scale.fromArray(n.scale);return i.associations.has(c)||i.associations.set(c,{}),i.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],i=this,n=new Fn;s.name&&(n.name=i.createUniqueName(s.name)),st(n,s),s.extensions&&_t(t,n,s);const r=s.nodes||[],o=[];for(let a=0,h=r.length;a<h;a++)o.push(i.getDependency("node",r[a]));return Promise.all(o).then(function(a){for(let c=0,l=a.length;c<l;c++)n.add(a[c]);const h=c=>{const l=new Map;for(const[u,d]of i.associations)(u instanceof Qt||u instanceof ue)&&l.set(u,d);return c.traverse(u=>{const d=i.associations.get(u);d!=null&&l.set(u,d)}),l};return i.associations=h(n),n})}_createAnimationTracks(e,t,s,i,n){const r=[],o=e.name?e.name:e.uuid,a=[];yt[n.path]===yt.weights?e.traverse(function(u){u.morphTargetInfluences&&a.push(u.name?u.name:u.uuid)}):a.push(o);let h;switch(yt[n.path]){case yt.weights:h=ts;break;case yt.rotation:h=ss;break;case yt.position:case yt.scale:h=ns;break;default:switch(s.itemSize){case 1:h=ts;break;case 2:case 3:default:h=ns;break}break}const c=i.interpolation!==void 0?jd[i.interpolation]:Is,l=this._getArrayFromAccessor(s);for(let u=0,d=a.length;u<d;u++){const g=new h(a[u]+"."+yt[n.path],t.array,l,c);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}return r}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Er(t.constructor),i=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n++)i[n]=t[n]*s;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(s){const i=this instanceof ss?Vd:ja;return new i(this.times,this.values,this.getValueSize()/3,s)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function eg(A,e,t){const s=e.attributes,i=new We;if(s.POSITION!==void 0){const o=t.json.accessors[s.POSITION],a=o.min,h=o.max;if(a!==void 0&&h!==void 0){if(i.set(new b(a[0],a[1],a[2]),new b(h[0],h[1],h[2])),o.normalized){const c=Er(gs[o.componentType]);i.min.multiplyScalar(c),i.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const n=e.targets;if(n!==void 0){const o=new b,a=new b;for(let h=0,c=n.length;h<c;h++){const l=n[h];if(l.POSITION!==void 0){const u=t.json.accessors[l.POSITION],d=u.min,g=u.max;if(d!==void 0&&g!==void 0){if(a.setX(Math.max(Math.abs(d[0]),Math.abs(g[0]))),a.setY(Math.max(Math.abs(d[1]),Math.abs(g[1]))),a.setZ(Math.max(Math.abs(d[2]),Math.abs(g[2]))),u.normalized){const p=Er(gs[u.componentType]);a.multiplyScalar(p)}o.max(a)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(o)}A.boundingBox=i;const r=new Oe;i.getCenter(r.center),r.radius=i.min.distanceTo(i.max)/2,A.boundingSphere=r}function Ka(A,e,t){const s=e.attributes,i=[];function n(r,o){return t.getDependency("accessor",r).then(function(a){A.setAttribute(o,a)})}for(const r in s){const o=Ir[r]||r.toLowerCase();o in A.attributes||i.push(n(s[r],o))}if(e.indices!==void 0&&!A.index){const r=t.getDependency("accessor",e.indices).then(function(o){A.setIndex(o)});i.push(r)}return le.workingColorSpace!==ge&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${le.workingColorSpace}" not supported.`),st(A,e),eg(A,e,t),Promise.all(i).then(function(){return e.targets!==void 0?Wd(A,e.targets,t):A})}class tg{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const s=this.workersResolve[e];if(s&&s(t),this.queue.length){const{resolve:i,msg:n,transfer:r}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(n,r)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=s,this.workers[i].postMessage(e,t)):this.queue.push({resolve:s,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const sg=0,Ya=2,ig=1,Xa=2,ng=0,rg=1,og=10,ag=0,Za=9,$a=15,eA=16,tA=22,sA=37,iA=43,nA=76,rA=83,oA=97,aA=100,AA=103,hA=109,cA=122,lA=123,Ag=131,hg=132,cg=133,lg=134,ug=137,dg=138,gg=141,pg=142,fg=145,mg=146,uA=148,dA=152,Ig=157,bg=158,gA=165,pA=166,Cr=1000066e3;class js{constructor(e,t,s,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const s=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,i)}}const fe=[171,75,84,88,32,50,48,187,13,10,26,10];function fA(A){return new TextDecoder().decode(A)}function yg(A){const e=new Uint8Array(A.buffer,A.byteOffset,fe.length);if(e[0]!==fe[0]||e[1]!==fe[1]||e[2]!==fe[2]||e[3]!==fe[3]||e[4]!==fe[4]||e[5]!==fe[5]||e[6]!==fe[6]||e[7]!==fe[7]||e[8]!==fe[8]||e[9]!==fe[9]||e[10]!==fe[10]||e[11]!==fe[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},s=17*Uint32Array.BYTES_PER_ELEMENT,i=new js(A,fe.length,s,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32(),t.levelCount=i._nextUint32(),t.supercompressionScheme=i._nextUint32();const n=i._nextUint32(),r=i._nextUint32(),o=i._nextUint32(),a=i._nextUint32(),h=i._nextUint64(),c=i._nextUint64(),l=3*Math.max(t.levelCount,1)*8,u=new js(A,fe.length+s,l,!0);for(let V=0,ie=Math.max(t.levelCount,1);V<ie;V++)t.levels.push({levelData:new Uint8Array(A.buffer,A.byteOffset+u._nextUint64(),u._nextUint64()),uncompressedByteLength:u._nextUint64()});const d=new js(A,n,r,!0);d._skip(4);const g=d._nextUint16(),p=d._nextUint16(),f=d._nextUint16(),m=d._nextUint16(),E={vendorId:g,descriptorType:p,versionNumber:f,colorModel:d._nextUint8(),colorPrimaries:d._nextUint8(),transferFunction:d._nextUint8(),flags:d._nextUint8(),texelBlockDimension:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],bytesPlane:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],samples:[]},C=(m/4-6)/4;for(let V=0;V<C;V++){const ie={bitOffset:d._nextUint16(),bitLength:d._nextUint8(),channelType:d._nextUint8(),samplePosition:[d._nextUint8(),d._nextUint8(),d._nextUint8(),d._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&ie.channelType?(ie.sampleLower=d._nextInt32(),ie.sampleUpper=d._nextInt32()):(ie.sampleLower=d._nextUint32(),ie.sampleUpper=d._nextUint32()),E.samples[V]=ie}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const y=new js(A,o,a,!0);for(;y._offset<a;){const V=y._nextUint32(),ie=y._scan(V),Ge=fA(ie);if(t.keyValue[Ge]=y._nextUint8Array(V-ie.byteLength-1),Ge.match(/^ktx/i)){const Wi=fA(t.keyValue[Ge]);t.keyValue[Ge]=Wi.substring(0,Wi.lastIndexOf("\0"))}y._skip(V%4?4-V%4:0)}if(c<=0)return t;const Q=new js(A,h,c,!0),M=Q._nextUint16(),S=Q._nextUint16(),R=Q._nextUint32(),D=Q._nextUint32(),O=Q._nextUint32(),H=Q._nextUint32(),ae=[];for(let V=0,ie=Math.max(t.levelCount,1);V<ie;V++)ae.push({imageFlags:Q._nextUint32(),rgbSliceByteOffset:Q._nextUint32(),rgbSliceByteLength:Q._nextUint32(),alphaSliceByteOffset:Q._nextUint32(),alphaSliceByteLength:Q._nextUint32()});const W=h+Q._offset,Ae=W+R,Ve=Ae+D,Be=Ve+O,nt=new Uint8Array(A.buffer,A.byteOffset+W,R),je=new Uint8Array(A.buffer,A.byteOffset+Ae,D),Je=new Uint8Array(A.buffer,A.byteOffset+Ve,O),rt=new Uint8Array(A.buffer,A.byteOffset+Be,H);return t.globalData={endpointCount:M,selectorCount:S,imageDescs:ae,endpointsData:nt,selectorsData:je,tablesData:Je,extendedData:rt},t}let Br,it,xr;const Qr={env:{emscripten_notify_memory_growth:function(A){xr=new Uint8Array(it.exports.memory.buffer)}}};class Eg{init(){return Br||(Br=typeof fetch<"u"?fetch("data:application/wasm;base64,"+mA).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Qr)).then(this._init):WebAssembly.instantiate(Buffer.from(mA,"base64"),Qr).then(this._init),Br)}_init(e){it=e.instance,Qr.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!it)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,i=it.exports.malloc(s);xr.set(e,i),t=t||Number(it.exports.ZSTD_findDecompressedSize(i,s));const n=it.exports.malloc(t),r=it.exports.ZSTD_decompress(n,t,i,s),o=xr.slice(n,n+r);return it.exports.free(i),it.exports.free(n),o}}const mA="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/A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ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAAC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ItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiA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C0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAg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gQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Cg="display-p3",Bg="display-p3-linear",wr=new WeakMap;let Tr=0,Sr;class Se extends It{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new tg,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new Nt(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new Nt(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const i=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([n,r])=>{const o=Se.BasisWorker.toString(),a=["/* constants */","let _EngineFormat = "+JSON.stringify(Se.EngineFormat),"let _EngineType = "+JSON.stringify(Se.EngineType),"let _TranscoderFormat = "+JSON.stringify(Se.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Se.BasisFormat),"/* basis_transcoder.js */",n,"/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
|
|
27
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([a])),this.transcoderBinary=r,this.workerPool.setWorkerCreator(()=>{const h=new Worker(this.workerSourceURL),c=this.transcoderBinary.slice(0);return h.postMessage({type:"init",config:this.workerConfig,transcoderBinary:c},[c]),h})}),Tr>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Tr++}return this.transcoderPending}load(e,t,s,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new Nt(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setResponseType("arraybuffer"),n.load(e,r=>{this.parse(r,t,i)},s,i)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(wr.has(e))return wr.get(e).promise.then(t).catch(s);this._createTexture(e).then(i=>t?t(i):null).catch(s)}_createTextureFrom(e,t){const{type:s,error:i,data:{faces:n,width:r,height:o,format:a,type:h,dfdFlags:c}}=e;if(s==="error")return Promise.reject(i);let l;if(t.faceCount===6)l=new Nh(n,a,h);else{const u=n[0].mipmaps;l=t.layerCount>1?new Mh(u,r,o,t.layerCount,a,h):new Si(u,r,o,a,h)}return l.minFilter=n[0].mipmaps.length===1?ot:kt,l.magFilter=ot,l.generateMipmaps=!1,l.needsUpdate=!0,l.colorSpace=IA(t),l.premultiplyAlpha=!!(c&ig),l}async _createTexture(e,t={}){const s=yg(new Uint8Array(e)),i=s.vkFormat===Cr&&s.dataFormatDescriptor[0].colorModel===167;if(!(s.vkFormat===ag||i&&!this.workerConfig.astcHDRSupported))return Qg(s);const r=t,o=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:r},[e])).then(a=>this._createTextureFrom(a.data,s));return wr.set(e,{promise:o}),o}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Tr--}}Se.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},Se.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},Se.EngineFormat={RGBAFormat:At,RGBA_ASTC_4x4_Format:Xs,RGB_BPTC_UNSIGNED_Format:RA,RGBA_BPTC_Format:tn,RGBA_ETC2_EAC_Format:Jr,RGBA_PVRTC_4BPPV1_Format:MA,RGBA_S3TC_DXT5_Format:en,RGB_ETC1_Format:NA,RGB_ETC2_Format:jr,RGB_PVRTC_4BPPV1_Format:SA,RGBA_S3TC_DXT1_Format:$i},Se.EngineType={UnsignedByteType:xe,HalfFloatType:Ct,FloatType:at},Se.BasisWorker=function(){let A,e,t;const s=_EngineFormat,i=_EngineType,n=_TranscoderFormat,r=_BasisFormat;self.addEventListener("message",function(g){const p=g.data;switch(p.type){case"init":A=p.config,o(p.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:f,buffers:m,width:E,height:C,hasAlpha:y,format:Q,type:M,dfdFlags:S}=a(p.buffer);self.postMessage({type:"transcode",id:p.id,data:{faces:f,width:E,height:C,hasAlpha:y,format:Q,type:M,dfdFlags:S}},m)}catch(f){console.error(f),self.postMessage({type:"error",id:p.id,error:f.message})}});break}});function o(g){e=new Promise(p=>{t={wasmBinary:g,onRuntimeInitialized:p},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function a(g){const p=new t.KTX2File(new Uint8Array(g));function f(){p.close(),p.delete()}if(!p.isValid())throw f(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let m;if(p.isUASTC())m=r.UASTC;else if(p.isETC1S())m=r.ETC1S;else if(p.isHDR())m=r.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const E=p.getWidth(),C=p.getHeight(),y=p.getLayers()||1,Q=p.getLevels(),M=p.getFaces(),S=p.getHasAlpha(),R=p.getDFDFlags(),{transcoderFormat:D,engineFormat:O,engineType:H}=l(m,E,C,S);if(!E||!C||!Q)throw f(),new Error("THREE.KTX2Loader: Invalid texture");if(!p.startTranscoding())throw f(),new Error("THREE.KTX2Loader: .startTranscoding failed");const ae=[],W=[];for(let Ae=0;Ae<M;Ae++){const Ve=[];for(let Be=0;Be<Q;Be++){const nt=[];let je,Je;for(let V=0;V<y;V++){const ie=p.getImageLevelInfo(Be,V,Ae);Ae===0&&Be===0&&V===0&&(ie.origWidth%4!==0||ie.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),Q>1?(je=ie.origWidth,Je=ie.origHeight):(je=ie.width,Je=ie.height);let Ge=new Uint8Array(p.getImageTranscodedSizeInBytes(Be,V,0,D));const Wi=p.transcodeImage(Ge,Be,V,Ae,D,0,-1,-1);if(H===i.HalfFloatType&&(Ge=new Uint16Array(Ge.buffer,Ge.byteOffset,Ge.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Wi)throw f(),new Error("THREE.KTX2Loader: .transcodeImage failed.");nt.push(Ge)}const rt=d(nt);Ve.push({data:rt,width:je,height:Je}),W.push(rt.buffer)}ae.push({mipmaps:Ve,width:E,height:C,format:O,type:H})}return f(),{faces:ae,buffers:W,width:E,height:C,hasAlpha:S,dfdFlags:R,format:O,type:H}}const h=[{if:"astcSupported",basisFormat:[r.UASTC],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],engineType:[i.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],engineType:[i.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.BC1,n.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],engineType:[i.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],engineType:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.ETC1],engineFormat:[s.RGB_ETC1_Format],engineType:[i.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],engineType:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[r.UASTC_HDR],transcoderFormat:[n.BC6H],engineFormat:[s.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[r.ETC1S,r.UASTC],transcoderFormat:[n.RGBA32,n.RGBA32],engineFormat:[s.RGBAFormat,s.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[r.UASTC_HDR],transcoderFormat:[n.RGBA_HALF],engineFormat:[s.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],c={[r.ETC1S]:h.filter(g=>g.basisFormat.includes(r.ETC1S)).sort((g,p)=>g.priorityUASTC-p.priorityUASTC),[r.UASTC]:h.filter(g=>g.basisFormat.includes(r.UASTC)).sort((g,p)=>g.priorityUASTC-p.priorityUASTC),[r.UASTC_HDR]:h.filter(g=>g.basisFormat.includes(r.UASTC_HDR)).sort((g,p)=>g.priorityHDR-p.priorityHDR)};function l(g,p,f,m){const E=c[g];for(let C=0;C<E.length;C++){const y=E[C];if(y.if&&!A[y.if]||!y.basisFormat.includes(g)||m&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(u(p)&&u(f)))continue;const Q=y.transcoderFormat[m?1:0],M=y.engineFormat[m?1:0],S=y.engineType[0];return{transcoderFormat:Q,engineFormat:M,engineType:S}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function u(g){return g<=2?!0:(g&g-1)===0&&g!==0}function d(g){if(g.length===1)return g[0];let p=0;for(let E=0;E<g.length;E++){const C=g[E];p+=C.byteLength}const f=new Uint8Array(p);let m=0;for(let E=0;E<g.length;E++){const C=g[E];f.set(C,m),m+=C.byteLength}return f}};const xg=new Set([At,Xi,fs,Lt]),Mr={[hA]:At,[oA]:At,[sA]:At,[iA]:At,[AA]:fs,[rA]:fs,[eA]:fs,[tA]:fs,[aA]:Lt,[nA]:Lt,[$a]:Lt,[Za]:Lt,[lA]:Xi,[cA]:Xi,[uA]:jr,[dA]:Jr,[Cr]:Xs,[bg]:Xs,[Ig]:Xs,[pA]:Wr,[gA]:Wr,[cg]:$i,[lg]:$i,[Ag]:qr,[hg]:qr,[dg]:Vr,[ug]:Vr,[pg]:en,[gg]:en,[mg]:tn,[fg]:tn},Js={[hA]:at,[oA]:Ct,[sA]:xe,[iA]:xe,[AA]:at,[rA]:Ct,[eA]:xe,[tA]:xe,[aA]:at,[nA]:Ct,[$a]:xe,[Za]:xe,[lA]:zr,[cA]:Pr,[uA]:xe,[dA]:xe,[Cr]:Ct,[pA]:xe,[gA]:xe};async function Qg(A){const{vkFormat:e}=A;if(Mr[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;A.supercompressionScheme===Ya&&(Sr||(Sr=new Promise(async r=>{const o=new Eg;await o.init(),r(o)})),t=await Sr);const s=[];for(let r=0;r<A.levels.length;r++){const o=Math.max(1,A.pixelWidth>>r),a=Math.max(1,A.pixelHeight>>r),h=A.pixelDepth?Math.max(1,A.pixelDepth>>r):0,c=A.levels[r];let l;if(A.supercompressionScheme===sg)l=c.levelData;else if(A.supercompressionScheme===Ya)l=t.decode(c.levelData,c.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;Js[e]===at?u=new Float32Array(l.buffer,l.byteOffset,l.byteLength/Float32Array.BYTES_PER_ELEMENT):Js[e]===Ct?u=new Uint16Array(l.buffer,l.byteOffset,l.byteLength/Uint16Array.BYTES_PER_ELEMENT):Js[e]===zr||Js[e]===Pr?u=new Uint32Array(l.buffer,l.byteOffset,l.byteLength/Uint32Array.BYTES_PER_ELEMENT):u=l,s.push({data:u,width:o,height:a,depth:h})}const i=A.levelCount===0||s.length>1;let n;if(xg.has(Mr[e]))n=A.pixelDepth===0?new kn(s[0].data,A.pixelWidth,A.pixelHeight):new ih(s[0].data,A.pixelWidth,A.pixelHeight,A.pixelDepth),n.minFilter=i?Or:Me,n.magFilter=Me,n.generateMipmaps=A.levelCount===0;else{if(A.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new Si(s,A.pixelWidth,A.pixelHeight),n.minFilter=i?kt:ot,n.magFilter=ot}return n.mipmaps=s,n.type=Js[e],n.format=Mr[e],n.colorSpace=IA(A),n.needsUpdate=!0,Promise.resolve(n)}function IA(A){const e=A.dataFormatDescriptor[0];return e.colorPrimaries===rg?e.transferFunction===Xa?ne:ge:e.colorPrimaries===og?e.transferFunction===Xa?Cg:Bg:(e.colorPrimaries===ng||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),vt)}self.onmessage=A=>{const e=A.data;switch(e.type){case"init":break;case"load":Tg(e);break;default:console.error("[Worker] Unknown message type:",e.type);break}},self.onerror=A=>{console.error("[Worker] Error:",A)};function wg(A){self.postMessage(A)}let Ws=null,ji=null,Ji=null;async function Tg(A){Ws??=new yd,Ws.setMeshoptDecoder(bA),ji??=new Id,ji.setDecoderConfig({type:"js"}),ji.setDecoderPath(A.dracoDecoderPath),Ws.setDRACOLoader(ji),Ji??=new Se,Ji.workerConfig=A.ktx2LoaderConfig,Ji.setTranscoderPath(A.ktx2TranscoderPath),Ws.setKTX2Loader(Ji),Ws.load(A.url,e=>{const t={type:"loaded-gltf",result:{url:A.url,geometries:[],textures:[]}};Sg(e,t),wg(t)})}function Sg(A,e){const{result:t}=e;for(const s of A.parser.associations.keys()){const i=A.parser.associations.get(s);if(i)if("isTexture"in s&&s.isTexture){const n=s,r=A.parser.json.textures[i.textures??-1];t.textures.push({texture:n,textureIndex:i.textures??-1,extensions:r?.extensions??{}})}else if("isMesh"in s&&s.isMesh){const n=s,r=i.meshes??-1,o=i.primitives??-1,a=A.parser.json.meshes[r];t.geometries.push({geometry:n.geometry,meshIndex:r,primitiveIndex:o,extensions:a?.extensions??{}})}else"isMaterial"in s&&s.isMaterial}}})();
|