@splinetool/runtime 2.0.93 → 2.0.94
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/build/{runtime-DRACOLoader-GLMRFFK2.js → runtime-DRACOLoader-SDMMLQLV.js} +1 -1
- package/build/runtime-DRACOLoader-SDMMLQLV.js.br +0 -0
- package/build/runtime-DRACOLoader-SDMMLQLV.js.gz +0 -0
- package/build/{runtime-aiAssistant-5ECVEZLI.js → runtime-aiAssistant-MKZQ23BA.js} +1 -1
- package/build/runtime-aiAssistant-MKZQ23BA.js.br +0 -0
- package/build/runtime-aiAssistant-MKZQ23BA.js.gz +0 -0
- package/build/{runtime-apiServices-J4QEEJ2S.js → runtime-apiServices-YYNQCMLP.js} +1 -1
- package/build/runtime-apiServices-YYNQCMLP.js.br +0 -0
- package/build/runtime-apiServices-YYNQCMLP.js.gz +0 -0
- package/build/{runtime-audio-P56XBVSL.js → runtime-audio-GPQ4HYPM.js} +1 -1
- package/build/runtime-audio-GPQ4HYPM.js.br +0 -0
- package/build/runtime-audio-GPQ4HYPM.js.gz +0 -0
- package/build/{runtime-bloom-UG5HOSMH.js → runtime-bloom-UMJG5YKZ.js} +1 -1
- package/build/runtime-bloom-UMJG5YKZ.js.br +0 -0
- package/build/runtime-bloom-UMJG5YKZ.js.gz +0 -0
- package/build/{runtime-brightnessContrast-PGPHKJZX.js → runtime-brightnessContrast-LRDMKXC2.js} +1 -1
- package/build/runtime-brightnessContrast-LRDMKXC2.js.br +0 -0
- package/build/runtime-brightnessContrast-LRDMKXC2.js.gz +0 -0
- package/build/{runtime-chromaticAberration-T7XDMEVF.js → runtime-chromaticAberration-X46NQTBB.js} +1 -1
- package/build/runtime-chromaticAberration-X46NQTBB.js.br +0 -0
- package/build/runtime-chromaticAberration-X46NQTBB.js.gz +0 -0
- package/build/{runtime-chunk-BBD57YCP.js → runtime-chunk-32XVU5DS.js} +1 -1
- package/build/runtime-chunk-32XVU5DS.js.br +0 -0
- package/build/runtime-chunk-32XVU5DS.js.gz +0 -0
- package/build/{runtime-chunk-JKFC5GFF.js → runtime-chunk-33EF3BLM.js} +1 -1
- package/build/runtime-chunk-33EF3BLM.js.br +0 -0
- package/build/runtime-chunk-33EF3BLM.js.gz +0 -0
- package/build/runtime-chunk-3Q4J5ROW.js +1 -0
- package/build/runtime-chunk-3Q4J5ROW.js.br +0 -0
- package/build/runtime-chunk-3Q4J5ROW.js.gz +0 -0
- package/build/{runtime-chunk-OHSWHEBV.js → runtime-chunk-4Y4AXXPU.js} +1 -1
- package/build/runtime-chunk-4Y4AXXPU.js.br +0 -0
- package/build/runtime-chunk-4Y4AXXPU.js.gz +0 -0
- package/build/{runtime-chunk-QR32XGTY.js → runtime-chunk-AEPWABER.js} +1 -1
- package/build/runtime-chunk-AEPWABER.js.br +0 -0
- package/build/runtime-chunk-AEPWABER.js.gz +0 -0
- package/build/{runtime-chunk-CJAKEGOH.js → runtime-chunk-AU3CL3GR.js} +1 -1
- package/build/runtime-chunk-AU3CL3GR.js.br +0 -0
- package/build/runtime-chunk-AU3CL3GR.js.gz +0 -0
- package/build/{runtime-chunk-QSWZYIFB.js → runtime-chunk-BFGZJ4LR.js} +1 -1
- package/build/runtime-chunk-BFGZJ4LR.js.br +0 -0
- package/build/runtime-chunk-BFGZJ4LR.js.gz +0 -0
- package/build/{runtime-chunk-XA7NBHZC.js → runtime-chunk-D3OIGZUW.js} +1 -1
- package/build/runtime-chunk-D3OIGZUW.js.br +0 -0
- package/build/runtime-chunk-D3OIGZUW.js.gz +0 -0
- package/build/runtime-chunk-DCC352GL.js +1 -0
- package/build/runtime-chunk-DCC352GL.js.br +0 -0
- package/build/runtime-chunk-DCC352GL.js.gz +0 -0
- package/build/runtime-chunk-E4UNJ4TR.js +1 -0
- package/build/runtime-chunk-E4UNJ4TR.js.br +0 -0
- package/build/runtime-chunk-E4UNJ4TR.js.gz +0 -0
- package/build/{runtime-chunk-QE3AQ5FK.js → runtime-chunk-EEVK6AD6.js} +1 -1
- package/build/runtime-chunk-EEVK6AD6.js.br +0 -0
- package/build/runtime-chunk-EEVK6AD6.js.gz +0 -0
- package/build/{runtime-chunk-KHCWX7UM.js → runtime-chunk-F6XTFQMZ.js} +1 -1
- package/build/runtime-chunk-F6XTFQMZ.js.br +0 -0
- package/build/runtime-chunk-F6XTFQMZ.js.gz +0 -0
- package/build/{runtime-chunk-HBZCKQBD.js → runtime-chunk-FZVL5H67.js} +1 -1
- package/build/runtime-chunk-FZVL5H67.js.br +0 -0
- package/build/runtime-chunk-FZVL5H67.js.gz +0 -0
- package/build/{runtime-chunk-WWCXHYAF.js → runtime-chunk-GD4SGFHZ.js} +1 -1
- package/build/{runtime-chunk-WWCXHYAF.js.br → runtime-chunk-GD4SGFHZ.js.br} +0 -0
- package/build/runtime-chunk-GD4SGFHZ.js.gz +0 -0
- package/build/{runtime-chunk-OBAIF634.js → runtime-chunk-GSKBI4RN.js} +1 -1
- package/build/runtime-chunk-GSKBI4RN.js.br +0 -0
- package/build/runtime-chunk-GSKBI4RN.js.gz +0 -0
- package/build/{runtime-chunk-TXYV34UR.js → runtime-chunk-HGPSGN65.js} +1 -1
- package/build/runtime-chunk-HGPSGN65.js.br +2 -0
- package/build/runtime-chunk-HGPSGN65.js.gz +0 -0
- package/build/runtime-chunk-HOOQDTK7.js +1 -0
- package/build/runtime-chunk-HOOQDTK7.js.br +0 -0
- package/build/runtime-chunk-HOOQDTK7.js.gz +0 -0
- package/build/{runtime-chunk-CDN5RLZC.js → runtime-chunk-IBVB6UVI.js} +1 -1
- package/build/runtime-chunk-IBVB6UVI.js.br +0 -0
- package/build/runtime-chunk-IBVB6UVI.js.gz +0 -0
- package/build/{runtime-chunk-VQPMRUIZ.js → runtime-chunk-JABQRWT5.js} +1 -1
- package/build/runtime-chunk-JABQRWT5.js.br +0 -0
- package/build/runtime-chunk-JABQRWT5.js.gz +0 -0
- package/build/runtime-chunk-JJVEXKEO.js +1 -0
- package/build/runtime-chunk-JJVEXKEO.js.br +0 -0
- package/build/runtime-chunk-JJVEXKEO.js.gz +0 -0
- package/build/{runtime-chunk-VUJSHZTK.js → runtime-chunk-JTXN6DIH.js} +1 -1
- package/build/runtime-chunk-JTXN6DIH.js.br +0 -0
- package/build/runtime-chunk-JTXN6DIH.js.gz +0 -0
- package/build/{runtime-chunk-KK7BC667.js → runtime-chunk-KJQWLDYH.js} +1 -1
- package/build/runtime-chunk-KJQWLDYH.js.br +0 -0
- package/build/runtime-chunk-KJQWLDYH.js.gz +0 -0
- package/build/runtime-chunk-KPOUV3HD.js +1 -0
- package/build/runtime-chunk-KPOUV3HD.js.br +0 -0
- package/build/runtime-chunk-KPOUV3HD.js.gz +0 -0
- package/build/{runtime-chunk-54KAQGZU.js → runtime-chunk-KQTC7OLV.js} +1 -1
- package/build/runtime-chunk-KQTC7OLV.js.br +0 -0
- package/build/runtime-chunk-KQTC7OLV.js.gz +0 -0
- package/build/{runtime-chunk-W34CWO4J.js → runtime-chunk-PF6YNLMZ.js} +1 -1
- package/build/runtime-chunk-PF6YNLMZ.js.br +0 -0
- package/build/runtime-chunk-PF6YNLMZ.js.gz +0 -0
- package/build/{runtime-chunk-K6UEJGDM.js → runtime-chunk-PWMK5MVJ.js} +1 -1
- package/build/runtime-chunk-PWMK5MVJ.js.br +0 -0
- package/build/runtime-chunk-PWMK5MVJ.js.gz +0 -0
- package/build/runtime-chunk-QJMMF3L2.js +1 -0
- package/build/runtime-chunk-QJMMF3L2.js.br +0 -0
- package/build/runtime-chunk-QJMMF3L2.js.gz +0 -0
- package/build/{runtime-chunk-LZSX7T4B.js → runtime-chunk-REXAQKUN.js} +1 -1
- package/build/runtime-chunk-REXAQKUN.js.br +0 -0
- package/build/runtime-chunk-REXAQKUN.js.gz +0 -0
- package/build/{runtime-chunk-WCJY5BE7.js → runtime-chunk-RWYT7G6G.js} +1 -1
- package/build/runtime-chunk-RWYT7G6G.js.br +0 -0
- package/build/runtime-chunk-RWYT7G6G.js.gz +0 -0
- package/build/{runtime-chunk-PI5WT5IX.js → runtime-chunk-WYIK4MJQ.js} +1 -1
- package/build/runtime-chunk-WYIK4MJQ.js.br +0 -0
- package/build/runtime-chunk-WYIK4MJQ.js.gz +0 -0
- package/build/runtime-chunk-ZA3HZGIR.js +1 -0
- package/build/runtime-chunk-ZA3HZGIR.js.br +0 -0
- package/build/runtime-chunk-ZA3HZGIR.js.gz +0 -0
- package/build/{runtime-chunk-6TZS7SVL.js → runtime-chunk-ZFM73G2B.js} +1 -1
- package/build/runtime-chunk-ZFM73G2B.js.br +0 -0
- package/build/runtime-chunk-ZFM73G2B.js.gz +0 -0
- package/build/{runtime-chunk-JH5Z7VPK.js → runtime-chunk-ZJIYRGBK.js} +1 -1
- package/build/runtime-chunk-ZJIYRGBK.js.br +0 -0
- package/build/runtime-chunk-ZJIYRGBK.js.gz +0 -0
- package/build/{runtime-classicRuntime-L7QG2FJ5.js → runtime-classicRuntime-WIJ56CKR.js} +1 -1
- package/build/runtime-classicRuntime-WIJ56CKR.js.br +0 -0
- package/build/runtime-classicRuntime-WIJ56CKR.js.gz +0 -0
- package/build/runtime-cloners-2S7SALQM.js +1 -0
- package/build/runtime-cloners-2S7SALQM.js.br +1 -0
- package/build/runtime-cloners-2S7SALQM.js.gz +0 -0
- package/build/{runtime-collisionBVH-CQUE6RZV.js → runtime-collisionBVH-JA4BEOA7.js} +1 -1
- package/build/runtime-collisionBVH-JA4BEOA7.js.br +0 -0
- package/build/runtime-collisionBVH-JA4BEOA7.js.gz +0 -0
- package/build/{runtime-components-SNSQPVIU.js → runtime-components-3T3QMQUH.js} +1 -1
- package/build/runtime-components-3T3QMQUH.js.br +0 -0
- package/build/runtime-components-3T3QMQUH.js.gz +0 -0
- package/build/{runtime-conditional-SK6JLPTN.js → runtime-conditional-CCGDVDMD.js} +1 -1
- package/build/runtime-conditional-CCGDVDMD.js.br +0 -0
- package/build/runtime-conditional-CCGDVDMD.js.gz +0 -0
- package/build/{runtime-createDestroy-7JLV5ONP.js → runtime-createDestroy-W6FF4RAP.js} +1 -1
- package/build/runtime-createDestroy-W6FF4RAP.js.br +0 -0
- package/build/runtime-createDestroy-W6FF4RAP.js.gz +0 -0
- package/build/{runtime-depthOfField-WIDZIOIS.js → runtime-depthOfField-DSE6YVZ4.js} +1 -1
- package/build/runtime-depthOfField-DSE6YVZ4.js.br +0 -0
- package/build/runtime-depthOfField-DSE6YVZ4.js.gz +0 -0
- package/build/{runtime-dragDrop-74DNBQ4A.js → runtime-dragDrop-2TMWDGUQ.js} +1 -1
- package/build/runtime-dragDrop-2TMWDGUQ.js.br +0 -0
- package/build/runtime-dragDrop-2TMWDGUQ.js.gz +0 -0
- package/build/{runtime-fxBloom-4HSWHGBL.js → runtime-fxBloom-4HB5FTK3.js} +1 -1
- package/build/runtime-fxBloom-4HB5FTK3.js.br +0 -0
- package/build/runtime-fxBloom-4HB5FTK3.js.gz +0 -0
- package/build/{runtime-fxDepthOfField-NGC6SATF.js → runtime-fxDepthOfField-URCQCIRP.js} +1 -1
- package/build/runtime-fxDepthOfField-URCQCIRP.js.br +0 -0
- package/build/runtime-fxDepthOfField-URCQCIRP.js.gz +0 -0
- package/build/{runtime-gameControls-HMLU4O4P.js → runtime-gameControls-VAUAOGUW.js} +1 -1
- package/build/runtime-gameControls-VAUAOGUW.js.br +0 -0
- package/build/runtime-gameControls-VAUAOGUW.js.gz +0 -0
- package/build/runtime-hair-NLGIEVG3.js +1 -0
- package/build/runtime-hair-NLGIEVG3.js.br +1 -0
- package/build/runtime-hair-NLGIEVG3.js.gz +0 -0
- package/build/{runtime-hueSaturation-7HSYL7M5.js → runtime-hueSaturation-TZ5VQY72.js} +1 -1
- package/build/runtime-hueSaturation-TZ5VQY72.js.br +0 -0
- package/build/runtime-hueSaturation-TZ5VQY72.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-4TLAKDAM.js → runtime-mergeStaticGeometries-K2YJKZ3C.js} +1 -1
- package/build/runtime-mergeStaticGeometries-K2YJKZ3C.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-K2YJKZ3C.js.gz +0 -0
- package/build/{runtime-miscActions-YT3JTCAS.js → runtime-miscActions-6CUG2JSF.js} +1 -1
- package/build/runtime-miscActions-6CUG2JSF.js.br +0 -0
- package/build/runtime-miscActions-6CUG2JSF.js.gz +0 -0
- package/build/{runtime-mouseHover-UC4V64KR.js → runtime-mouseHover-CYCSNNZM.js} +1 -1
- package/build/runtime-mouseHover-CYCSNNZM.js.br +0 -0
- package/build/runtime-mouseHover-CYCSNNZM.js.gz +0 -0
- package/build/{runtime-noise-PPEDFDYO.js → runtime-noise-FLMWYKTL.js} +1 -1
- package/build/runtime-noise-FLMWYKTL.js.br +0 -0
- package/build/runtime-noise-FLMWYKTL.js.gz +0 -0
- package/build/{runtime-particles-KRZTDOJK.js → runtime-particles-PDPG5E74.js} +1 -1
- package/build/runtime-particles-PDPG5E74.js.br +0 -0
- package/build/runtime-particles-PDPG5E74.js.gz +0 -0
- package/build/{runtime-paths-4EGJEH3U.js → runtime-paths-E4GHUGNN.js} +1 -1
- package/build/runtime-paths-E4GHUGNN.js.br +0 -0
- package/build/runtime-paths-E4GHUGNN.js.gz +0 -0
- package/build/{runtime-pixelation-MVG6XLP3.js → runtime-pixelation-AOFGI5XX.js} +1 -1
- package/build/runtime-pixelation-AOFGI5XX.js.br +0 -0
- package/build/runtime-pixelation-AOFGI5XX.js.gz +0 -0
- package/build/{runtime-resize-72IGTMAR.js → runtime-resize-DAWD3MKG.js} +1 -1
- package/build/runtime-resize-DAWD3MKG.js.br +0 -0
- package/build/runtime-resize-DAWD3MKG.js.gz +0 -0
- package/build/{runtime-sceneTransition-55XY2MUR.js → runtime-sceneTransition-SFGBWSP3.js} +1 -1
- package/build/runtime-sceneTransition-SFGBWSP3.js.br +0 -0
- package/build/runtime-sceneTransition-SFGBWSP3.js.gz +0 -0
- package/build/{runtime-scroll-M6OD2EFE.js → runtime-scroll-HKLPDE7E.js} +1 -1
- package/build/runtime-scroll-HKLPDE7E.js.br +0 -0
- package/build/runtime-scroll-HKLPDE7E.js.gz +0 -0
- package/build/runtime-shapeBlends-COFJFXT6.js +1 -0
- package/build/runtime-shapeBlends-COFJFXT6.js.br +2 -0
- package/build/runtime-shapeBlends-COFJFXT6.js.gz +0 -0
- package/build/{runtime-text-4LC7VC5F.js → runtime-text-NQU4F3KI.js} +1 -1
- package/build/runtime-text-NQU4F3KI.js.br +0 -0
- package/build/runtime-text-NQU4F3KI.js.gz +0 -0
- package/build/{runtime-textInputs-YSSB35BQ.js → runtime-textInputs-5WG7OPGO.js} +1 -1
- package/build/runtime-textInputs-5WG7OPGO.js.br +0 -0
- package/build/runtime-textInputs-5WG7OPGO.js.gz +0 -0
- package/build/{runtime-timeline-EWF2TRMQ.js → runtime-timeline-EAC5OJEK.js} +1 -1
- package/build/runtime-timeline-EAC5OJEK.js.br +0 -0
- package/build/runtime-timeline-EAC5OJEK.js.gz +0 -0
- package/build/{runtime-tracking-ZRIG4OD6.js → runtime-tracking-6CN7PQFK.js} +1 -1
- package/build/runtime-tracking-6CN7PQFK.js.br +0 -0
- package/build/runtime-tracking-6CN7PQFK.js.gz +0 -0
- package/build/{runtime-transitions-CTFNET4C.js → runtime-transitions-N47Y4AXH.js} +1 -1
- package/build/runtime-transitions-N47Y4AXH.js.br +0 -0
- package/build/runtime-transitions-N47Y4AXH.js.gz +0 -0
- package/build/{runtime-ui2d-ACT52A4B.js → runtime-ui2d-T3OZFBOE.js} +1 -1
- package/build/runtime-ui2d-T3OZFBOE.js.br +0 -0
- package/build/runtime-ui2d-T3OZFBOE.js.gz +0 -0
- package/build/{runtime-updater-RCOMZLTB.js → runtime-updater-6YEO4WI3.js} +1 -1
- package/build/runtime-updater-6YEO4WI3.js.br +2 -0
- package/build/runtime-updater-6YEO4WI3.js.gz +0 -0
- package/build/{runtime-variables-DJUQPZDB.js → runtime-variables-ICLL7DZV.js} +1 -1
- package/build/runtime-variables-ICLL7DZV.js.br +0 -0
- package/build/runtime-variables-ICLL7DZV.js.gz +0 -0
- package/build/{runtime-vectorShapes-RYMOTNNM.js → runtime-vectorShapes-4MX2X2MH.js} +1 -1
- package/build/runtime-vectorShapes-4MX2X2MH.js.br +0 -0
- package/build/runtime-vectorShapes-4MX2X2MH.js.gz +0 -0
- package/build/{runtime-video-U5RS7HHJ.js → runtime-video-KFIFPA6P.js} +1 -1
- package/build/runtime-video-KFIFPA6P.js.br +0 -0
- package/build/runtime-video-KFIFPA6P.js.gz +0 -0
- package/build/{runtime-vignette-KYH2SCOD.js → runtime-vignette-S4Z7IMQ5.js} +1 -1
- package/build/runtime-vignette-S4Z7IMQ5.js.br +0 -0
- package/build/runtime-vignette-S4Z7IMQ5.js.gz +0 -0
- package/build/runtime-webgpu-JZZF7PVG.js +1 -0
- package/build/runtime-webgpu-JZZF7PVG.js.br +0 -0
- package/build/runtime-webgpu-JZZF7PVG.js.gz +0 -0
- package/build/runtime.cjs +16 -8
- package/build/runtime.js +1 -1
- package/build/runtime.js.br +0 -0
- package/build/runtime.js.gz +0 -0
- package/build/runtime.standalone.js +1 -1
- package/build/runtime.standalone.js.br +0 -0
- package/build/runtime.standalone.js.gz +0 -0
- package/build/runtime.standalone.webgl.js +1 -1
- package/build/runtime.standalone.webgl.js.br +0 -0
- package/build/runtime.standalone.webgl.js.gz +0 -0
- package/build/runtime.standalone.webgpu.js +1 -1
- package/build/runtime.standalone.webgpu.js.br +0 -0
- package/build/runtime.standalone.webgpu.js.gz +0 -0
- package/build/runtime.standalone.webgpu.micro.js +1 -1
- package/build/runtime.standalone.webgpu.micro.js.br +0 -0
- package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
- package/build/runtime.standalone.webgpu.min.js +1 -1
- package/build/runtime.standalone.webgpu.min.js.br +0 -0
- package/build/runtime.standalone.webgpu.min.js.gz +0 -0
- package/package.json +1 -1
- package/build/runtime-DRACOLoader-GLMRFFK2.js.br +0 -0
- package/build/runtime-DRACOLoader-GLMRFFK2.js.gz +0 -0
- package/build/runtime-aiAssistant-5ECVEZLI.js.br +0 -0
- package/build/runtime-aiAssistant-5ECVEZLI.js.gz +0 -0
- package/build/runtime-apiServices-J4QEEJ2S.js.br +0 -0
- package/build/runtime-apiServices-J4QEEJ2S.js.gz +0 -0
- package/build/runtime-audio-P56XBVSL.js.br +0 -7
- package/build/runtime-audio-P56XBVSL.js.gz +0 -0
- package/build/runtime-bloom-UG5HOSMH.js.br +0 -0
- package/build/runtime-bloom-UG5HOSMH.js.gz +0 -0
- package/build/runtime-brightnessContrast-PGPHKJZX.js.br +0 -0
- package/build/runtime-brightnessContrast-PGPHKJZX.js.gz +0 -0
- package/build/runtime-chromaticAberration-T7XDMEVF.js.br +0 -0
- package/build/runtime-chromaticAberration-T7XDMEVF.js.gz +0 -0
- package/build/runtime-chunk-54KAQGZU.js.br +0 -0
- package/build/runtime-chunk-54KAQGZU.js.gz +0 -0
- package/build/runtime-chunk-5WJTDAAI.js +0 -1
- package/build/runtime-chunk-5WJTDAAI.js.br +0 -0
- package/build/runtime-chunk-5WJTDAAI.js.gz +0 -0
- package/build/runtime-chunk-6FFBLDZX.js +0 -1
- package/build/runtime-chunk-6FFBLDZX.js.br +0 -0
- package/build/runtime-chunk-6FFBLDZX.js.gz +0 -0
- package/build/runtime-chunk-6TZS7SVL.js.br +0 -0
- package/build/runtime-chunk-6TZS7SVL.js.gz +0 -0
- package/build/runtime-chunk-7CHUIB5Q.js +0 -1
- package/build/runtime-chunk-7CHUIB5Q.js.br +0 -0
- package/build/runtime-chunk-7CHUIB5Q.js.gz +0 -0
- package/build/runtime-chunk-BBD57YCP.js.br +0 -0
- package/build/runtime-chunk-BBD57YCP.js.gz +0 -0
- package/build/runtime-chunk-BVVSZMXD.js +0 -1
- package/build/runtime-chunk-BVVSZMXD.js.br +0 -0
- package/build/runtime-chunk-BVVSZMXD.js.gz +0 -0
- package/build/runtime-chunk-CDN5RLZC.js.br +0 -0
- package/build/runtime-chunk-CDN5RLZC.js.gz +0 -0
- package/build/runtime-chunk-CJAKEGOH.js.br +0 -0
- package/build/runtime-chunk-CJAKEGOH.js.gz +0 -0
- package/build/runtime-chunk-GF2HB4HZ.js +0 -1
- package/build/runtime-chunk-GF2HB4HZ.js.br +0 -0
- package/build/runtime-chunk-GF2HB4HZ.js.gz +0 -0
- package/build/runtime-chunk-HBZCKQBD.js.br +0 -0
- package/build/runtime-chunk-HBZCKQBD.js.gz +0 -0
- package/build/runtime-chunk-JH5Z7VPK.js.br +0 -0
- package/build/runtime-chunk-JH5Z7VPK.js.gz +0 -0
- package/build/runtime-chunk-JKFC5GFF.js.br +0 -0
- package/build/runtime-chunk-JKFC5GFF.js.gz +0 -0
- package/build/runtime-chunk-K6UEJGDM.js.br +0 -0
- package/build/runtime-chunk-K6UEJGDM.js.gz +0 -0
- package/build/runtime-chunk-KHCWX7UM.js.br +0 -0
- package/build/runtime-chunk-KHCWX7UM.js.gz +0 -0
- package/build/runtime-chunk-KK7BC667.js.br +0 -0
- package/build/runtime-chunk-KK7BC667.js.gz +0 -0
- package/build/runtime-chunk-LZSX7T4B.js.br +0 -0
- package/build/runtime-chunk-LZSX7T4B.js.gz +0 -0
- package/build/runtime-chunk-NEKALYDS.js +0 -1
- package/build/runtime-chunk-NEKALYDS.js.br +0 -0
- package/build/runtime-chunk-NEKALYDS.js.gz +0 -0
- package/build/runtime-chunk-OBAIF634.js.br +0 -0
- package/build/runtime-chunk-OBAIF634.js.gz +0 -0
- package/build/runtime-chunk-OHSWHEBV.js.br +0 -0
- package/build/runtime-chunk-OHSWHEBV.js.gz +0 -0
- package/build/runtime-chunk-PI5WT5IX.js.br +0 -0
- package/build/runtime-chunk-PI5WT5IX.js.gz +0 -0
- package/build/runtime-chunk-QE3AQ5FK.js.br +0 -0
- package/build/runtime-chunk-QE3AQ5FK.js.gz +0 -0
- package/build/runtime-chunk-QR32XGTY.js.br +0 -0
- package/build/runtime-chunk-QR32XGTY.js.gz +0 -0
- package/build/runtime-chunk-QSWZYIFB.js.br +0 -0
- package/build/runtime-chunk-QSWZYIFB.js.gz +0 -0
- package/build/runtime-chunk-TXYV34UR.js.br +0 -0
- package/build/runtime-chunk-TXYV34UR.js.gz +0 -0
- package/build/runtime-chunk-VQPMRUIZ.js.br +0 -0
- package/build/runtime-chunk-VQPMRUIZ.js.gz +0 -0
- package/build/runtime-chunk-VUJSHZTK.js.br +0 -0
- package/build/runtime-chunk-VUJSHZTK.js.gz +0 -0
- package/build/runtime-chunk-VXU3S3Y3.js +0 -1
- package/build/runtime-chunk-VXU3S3Y3.js.br +0 -0
- package/build/runtime-chunk-VXU3S3Y3.js.gz +0 -0
- package/build/runtime-chunk-W34CWO4J.js.br +0 -0
- package/build/runtime-chunk-W34CWO4J.js.gz +0 -0
- package/build/runtime-chunk-WCJY5BE7.js.br +0 -0
- package/build/runtime-chunk-WCJY5BE7.js.gz +0 -0
- package/build/runtime-chunk-WWCXHYAF.js.gz +0 -0
- package/build/runtime-chunk-WWIPBG3J.js +0 -1
- package/build/runtime-chunk-WWIPBG3J.js.br +0 -0
- package/build/runtime-chunk-WWIPBG3J.js.gz +0 -0
- package/build/runtime-chunk-XA7NBHZC.js.br +0 -0
- package/build/runtime-chunk-XA7NBHZC.js.gz +0 -0
- package/build/runtime-classicRuntime-L7QG2FJ5.js.br +0 -0
- package/build/runtime-classicRuntime-L7QG2FJ5.js.gz +0 -0
- package/build/runtime-cloners-KG6N3BXV.js +0 -1
- package/build/runtime-cloners-KG6N3BXV.js.br +0 -0
- package/build/runtime-cloners-KG6N3BXV.js.gz +0 -0
- package/build/runtime-collisionBVH-CQUE6RZV.js.br +0 -0
- package/build/runtime-collisionBVH-CQUE6RZV.js.gz +0 -0
- package/build/runtime-components-SNSQPVIU.js.br +0 -0
- package/build/runtime-components-SNSQPVIU.js.gz +0 -0
- package/build/runtime-conditional-SK6JLPTN.js.br +0 -0
- package/build/runtime-conditional-SK6JLPTN.js.gz +0 -0
- package/build/runtime-createDestroy-7JLV5ONP.js.br +0 -0
- package/build/runtime-createDestroy-7JLV5ONP.js.gz +0 -0
- package/build/runtime-depthOfField-WIDZIOIS.js.br +0 -0
- package/build/runtime-depthOfField-WIDZIOIS.js.gz +0 -0
- package/build/runtime-dragDrop-74DNBQ4A.js.br +0 -0
- package/build/runtime-dragDrop-74DNBQ4A.js.gz +0 -0
- package/build/runtime-fxBloom-4HSWHGBL.js.br +0 -0
- package/build/runtime-fxBloom-4HSWHGBL.js.gz +0 -0
- package/build/runtime-fxDepthOfField-NGC6SATF.js.br +0 -0
- package/build/runtime-fxDepthOfField-NGC6SATF.js.gz +0 -0
- package/build/runtime-gameControls-HMLU4O4P.js.br +0 -0
- package/build/runtime-gameControls-HMLU4O4P.js.gz +0 -0
- package/build/runtime-hair-JWEUOSZQ.js +0 -1
- package/build/runtime-hair-JWEUOSZQ.js.br +0 -2
- package/build/runtime-hair-JWEUOSZQ.js.gz +0 -0
- package/build/runtime-hueSaturation-7HSYL7M5.js.br +0 -0
- package/build/runtime-hueSaturation-7HSYL7M5.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-4TLAKDAM.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-4TLAKDAM.js.gz +0 -0
- package/build/runtime-miscActions-YT3JTCAS.js.br +0 -0
- package/build/runtime-miscActions-YT3JTCAS.js.gz +0 -0
- package/build/runtime-mouseHover-UC4V64KR.js.br +0 -0
- package/build/runtime-mouseHover-UC4V64KR.js.gz +0 -0
- package/build/runtime-noise-PPEDFDYO.js.br +0 -0
- package/build/runtime-noise-PPEDFDYO.js.gz +0 -0
- package/build/runtime-particles-KRZTDOJK.js.br +0 -0
- package/build/runtime-particles-KRZTDOJK.js.gz +0 -0
- package/build/runtime-paths-4EGJEH3U.js.br +0 -0
- package/build/runtime-paths-4EGJEH3U.js.gz +0 -0
- package/build/runtime-pixelation-MVG6XLP3.js.br +0 -0
- package/build/runtime-pixelation-MVG6XLP3.js.gz +0 -0
- package/build/runtime-resize-72IGTMAR.js.br +0 -0
- package/build/runtime-resize-72IGTMAR.js.gz +0 -0
- package/build/runtime-sceneTransition-55XY2MUR.js.br +0 -0
- package/build/runtime-sceneTransition-55XY2MUR.js.gz +0 -0
- package/build/runtime-scroll-M6OD2EFE.js.br +0 -0
- package/build/runtime-scroll-M6OD2EFE.js.gz +0 -0
- package/build/runtime-shapeBlends-2QP6U25O.js +0 -1
- package/build/runtime-shapeBlends-2QP6U25O.js.br +0 -4
- package/build/runtime-shapeBlends-2QP6U25O.js.gz +0 -0
- package/build/runtime-text-4LC7VC5F.js.br +0 -0
- package/build/runtime-text-4LC7VC5F.js.gz +0 -0
- package/build/runtime-textInputs-YSSB35BQ.js.br +0 -0
- package/build/runtime-textInputs-YSSB35BQ.js.gz +0 -0
- package/build/runtime-timeline-EWF2TRMQ.js.br +0 -0
- package/build/runtime-timeline-EWF2TRMQ.js.gz +0 -0
- package/build/runtime-tracking-ZRIG4OD6.js.br +0 -0
- package/build/runtime-tracking-ZRIG4OD6.js.gz +0 -0
- package/build/runtime-transitions-CTFNET4C.js.br +0 -0
- package/build/runtime-transitions-CTFNET4C.js.gz +0 -0
- package/build/runtime-ui2d-ACT52A4B.js.br +0 -0
- package/build/runtime-ui2d-ACT52A4B.js.gz +0 -0
- package/build/runtime-updater-RCOMZLTB.js.br +0 -3
- package/build/runtime-updater-RCOMZLTB.js.gz +0 -0
- package/build/runtime-variables-DJUQPZDB.js.br +0 -0
- package/build/runtime-variables-DJUQPZDB.js.gz +0 -0
- package/build/runtime-vectorShapes-RYMOTNNM.js.br +0 -0
- package/build/runtime-vectorShapes-RYMOTNNM.js.gz +0 -0
- package/build/runtime-video-U5RS7HHJ.js.br +0 -0
- package/build/runtime-video-U5RS7HHJ.js.gz +0 -0
- package/build/runtime-vignette-KYH2SCOD.js.br +0 -0
- package/build/runtime-vignette-KYH2SCOD.js.gz +0 -0
- package/build/runtime-webgpu-GP4ESV4Z.js +0 -1
- package/build/runtime-webgpu-GP4ESV4Z.js.br +0 -0
- package/build/runtime-webgpu-GP4ESV4Z.js.gz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t="185",e={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},i=0,s=1,r=2,a=0,n=1,h=2,o=3,l=0,u=1,c=2,p=0,d=1,m=2,y=3,f=4,g=5,x=6,v=100,b=101,M=102,w=103,S=104,_=200,A=201,z=202,T=203,C=204,I=205,k=206,B=207,O=208,P=209,N=210,R=211,V=212,E=213,F=214,L=0,D=1,W=2,U=3,j=4,J=5,q=6,X=7,Y=0,Z=1,H=2,G=0,Q=1,$=2,K=3,tt=4,et=5,it=6,st=7,rt=300,at=301,nt=302,ht=303,ot=304,lt=306,ut=1e3,ct=1001,pt=1002,dt=1003,mt=1004,yt=1005,ft=1006,gt=1007,xt=1008,vt=1008,bt=1009,Mt=1010,wt=1011,St=1012,_t=1013,At=1014,zt=1015,Tt=1016,Ct=1017,It=1018,kt=1020,Bt=35902,Ot=35899,Pt=1021,Nt=1022,Rt=1023,Vt=1026,Et=1027,Ft=1028,Lt=1029,Dt=1030,Wt=1031,Ut=1032,jt=1033,Jt=33776,qt=33777,Xt=33778,Yt=33779,Zt=35840,Ht=35841,Gt=35842,Qt=35843,$t=36196,Kt=37492,te=37496,ee=37488,ie=37489,se=37490,re=37491,ae=37808,ne=37809,he=37810,oe=37811,le=37812,ue=37813,ce=37814,pe=37815,de=37816,me=37817,ye=37818,fe=37819,ge=37820,xe=37821,ve=36492,be=36494,Me=36495,we=36283,Se=36284,_e=36285,Ae=36286,ze=2200,Te=2201,Ce=2202,Ie=2300,ke=2301,Be=2302,Oe=2400,Pe=2401,Ne=2402,Re=3200,Ve=3201,Ee=0,Fe=1,Le="",De="srgb",We="srgb-linear",Ue="linear",je="srgb",Je="",qe="rg",Xe="ga",Ye=0,Ze=7680,He=7681,Ge=7682,Qe=7683,$e=34055,Ke=34056,ti=5386,ei=512,ii=513,si=514,ri=515,ai=516,ni=517,hi=518,oi=519,li=512,ui=513,ci=514,pi=515,di=516,mi=517,yi=518,fi=519,gi=35044,xi=35048,vi="300 es",bi=2e3,Mi=2001,wi={COMPUTE:"compute",RENDER:"render"},Si={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},_i={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},Ai={TEXTURE_COMPARE:"depthTextureCompare"},zi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Ti(t,e){return new zi[t](e)}function Ci(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ii(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ki(){let t=Ii("canvas");return t.style.display="block",t}var Bi={};function Oi(...t){let e="THREE."+t.shift();console.log(e,...t)}function Pi(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function Ni(...t){let e="THREE."+(t=Pi(t)).shift();{let i=t[0];i&&i.isStackTrace?console.warn(i.getError(e)):console.warn(e,...t)}}function Ri(...t){let e="THREE."+(t=Pi(t)).shift();{let i=t[0];i&&i.isStackTrace?console.error(i.getError(e)):console.error(e,...t)}}function Vi(...t){let e=t.join(" ");e in Bi||(Bi[e]=!0,Ni(...t))}function Ei(t,e,i){return new Promise(function(s,r){setTimeout(function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(a,i);break;default:s()}},i)})}var Fi={[L]:1,[W]:6,[j]:7,[U]:5,[D]:0,[q]:2,[X]:4,[J]:3},Li=class{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){let i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){let i=this._listeners;if(void 0===i)return;let s=i[t];if(void 0!==s){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let i=e[t.type];if(void 0!==i){t.target=this;let e=i.slice(0);for(let i=0,s=e.length;i<s;i++)e[i].call(this,t);t.target=null}}},Di=["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"],Wi=1234567,Ui=Math.PI/180,ji=180/Math.PI;function Ji(){let t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(Di[255&t]+Di[t>>8&255]+Di[t>>16&255]+Di[t>>24&255]+"-"+Di[255&e]+Di[e>>8&255]+"-"+Di[e>>16&15|64]+Di[e>>24&255]+"-"+Di[63&i|128]+Di[i>>8&255]+"-"+Di[i>>16&255]+Di[i>>24&255]+Di[255&s]+Di[s>>8&255]+Di[s>>16&255]+Di[s>>24&255]).toLowerCase()}function qi(t,e,i){return Math.max(e,Math.min(i,t))}function Xi(t,e){return(t%e+e)%e}function Yi(t,e,i){return(1-i)*t+i*e}function Zi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Hi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("THREE.MathUtils: Invalid component type.")}}var Gi={DEG2RAD:Ui,RAD2DEG:ji,generateUUID:Ji,clamp:qi,euclideanModulo:Xi,mapLinear:function(t,e,i,s,r){return s+(t-e)*(r-s)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:Yi,damp:function(t,e,i,s){return Yi(t,e,1-Math.exp(-i*s))},pingpong:function(t,e=1){return e-Math.abs(Xi(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Wi=t);let e=Wi+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Ui},radToDeg:function(t){return t*ji},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,s,r){let a=Math.cos,n=Math.sin,h=a(i/2),o=n(i/2),l=a((e+s)/2),u=n((e+s)/2),c=a((e-s)/2),p=n((e-s)/2),d=a((s-e)/2),m=n((s-e)/2);switch(r){case"XYX":t.set(h*u,o*c,o*p,h*l);break;case"YZY":t.set(o*p,h*u,o*c,h*l);break;case"ZXZ":t.set(o*c,o*p,h*u,h*l);break;case"XZX":t.set(h*u,o*m,o*d,h*l);break;case"YXY":t.set(o*d,h*u,o*m,h*l);break;case"ZYZ":t.set(o*m,o*d,h*u,h*l);break;default:Ni("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Hi,denormalize:Zi},Qi=class{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("THREE.Vector2: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=qi(this.x,t.x,e.x),this.y=qi(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=qi(this.x,t,e),this.y=qi(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(qi(i,t,e))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;let i=this.dot(t)/e;return Math.acos(qi(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},$i=Qi;Qi.prototype.isVector2=!0;var Ki=class{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,a,n){let h=i[s+0],o=i[s+1],l=i[s+2],u=i[s+3],c=r[a+0],p=r[a+1],d=r[a+2],m=r[a+3];if(u!==m||h!==c||o!==p||l!==d){let t=h*c+o*p+l*d+u*m;t<0&&(c=-c,p=-p,d=-d,m=-m,t=-t);let e=1-n;if(t<.9995){let i=Math.acos(t),s=Math.sin(i);e=Math.sin(e*i)/s,h=h*e+c*(n=Math.sin(n*i)/s),o=o*e+p*n,l=l*e+d*n,u=u*e+m*n}else{h=h*e+c*n,o=o*e+p*n,l=l*e+d*n,u=u*e+m*n;let t=1/Math.sqrt(h*h+o*o+l*l+u*u);h*=t,o*=t,l*=t,u*=t}}t[e]=h,t[e+1]=o,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,a){let n=i[s],h=i[s+1],o=i[s+2],l=i[s+3],u=r[a],c=r[a+1],p=r[a+2],d=r[a+3];return t[e]=n*d+l*u+h*p-o*c,t[e+1]=h*d+l*c+o*u-n*p,t[e+2]=o*d+l*p+n*c-h*u,t[e+3]=l*d-n*u-h*c-o*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let i=t._x,s=t._y,r=t._z,a=t._order,n=Math.cos,h=Math.sin,o=n(i/2),l=n(s/2),u=n(r/2),c=h(i/2),p=h(s/2),d=h(r/2);switch(a){case"XYZ":this._x=c*l*u+o*p*d,this._y=o*p*u-c*l*d,this._z=o*l*d+c*p*u,this._w=o*l*u-c*p*d;break;case"YXZ":this._x=c*l*u+o*p*d,this._y=o*p*u-c*l*d,this._z=o*l*d-c*p*u,this._w=o*l*u+c*p*d;break;case"ZXY":this._x=c*l*u-o*p*d,this._y=o*p*u+c*l*d,this._z=o*l*d+c*p*u,this._w=o*l*u-c*p*d;break;case"ZYX":this._x=c*l*u-o*p*d,this._y=o*p*u+c*l*d,this._z=o*l*d-c*p*u,this._w=o*l*u+c*p*d;break;case"YZX":this._x=c*l*u+o*p*d,this._y=o*p*u+c*l*d,this._z=o*l*d-c*p*u,this._w=o*l*u-c*p*d;break;case"XZY":this._x=c*l*u-o*p*d,this._y=o*p*u-c*l*d,this._z=o*l*d+c*p*u,this._w=o*l*u+c*p*d;break;default:Ni("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],s=e[4],r=e[8],a=e[1],n=e[5],h=e[9],o=e[2],l=e[6],u=e[10],c=i+n+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-h)*t,this._y=(r-o)*t,this._z=(a-s)*t}else if(i>n&&i>u){let t=2*Math.sqrt(1+i-n-u);this._w=(l-h)/t,this._x=.25*t,this._y=(s+a)/t,this._z=(r+o)/t}else if(n>u){let t=2*Math.sqrt(1+n-i-u);this._w=(r-o)/t,this._x=(s+a)/t,this._y=.25*t,this._z=(h+l)/t}else{let t=2*Math.sqrt(1+u-i-n);this._w=(a-s)/t,this._x=(r+o)/t,this._y=(h+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(qi(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let s=Math.min(1,e/i);return this.slerp(t,s),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=e._x,h=e._y,o=e._z,l=e._w;return this._x=i*l+a*n+s*o-r*h,this._y=s*l+a*h+r*n-i*o,this._z=r*l+a*o+i*h-s*n,this._w=a*l-i*n-s*h-r*o,this._onChangeCallback(),this}slerp(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=this.dot(t);n<0&&(i=-i,s=-s,r=-r,a=-a,n=-n);let h=1-e;if(n<.9995){let t=Math.acos(n),o=Math.sin(t);h=Math.sin(h*t)/o,e=Math.sin(e*t)/o,this._x=this._x*h+i*e,this._y=this._y*h+s*e,this._z=this._z*h+r*e,this._w=this._w*h+a*e,this._onChangeCallback()}else this._x=this._x*h+i*e,this._y=this._y*h+s*e,this._z=this._z*h+r*e,this._w=this._w*h+a*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ts=class{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("THREE.Vector3: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ss.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ss.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,n=t.z,h=t.w,o=2*(a*s-n*i),l=2*(n*e-r*s),u=2*(r*i-a*e);return this.x=e+h*o+a*u-n*l,this.y=i+h*l+n*o-r*u,this.z=s+h*u+r*l-a*o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=qi(this.x,t.x,e.x),this.y=qi(this.y,t.y,e.y),this.z=qi(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=qi(this.x,t,e),this.y=qi(this.y,t,e),this.z=qi(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(qi(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,s=t.y,r=t.z,a=e.x,n=e.y,h=e.z;return this.x=s*h-r*n,this.y=r*a-i*h,this.z=i*n-s*a,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return is.copy(this).projectOnVector(t),this.sub(is)}reflect(t){return this.sub(is.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;let i=this.dot(t)/e;return Math.acos(qi(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){let s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},es=ts;ts.prototype.isVector3=!0;var is=new es,ss=new Ki,rs=class{constructor(t,e,i,s,r,a,n,h,o){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,h,o)}set(t,e,i,s,r,a,n,h,o){let l=this.elements;return l[0]=t,l[1]=s,l[2]=n,l[3]=e,l[4]=r,l[5]=h,l[6]=i,l[7]=a,l[8]=o,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[3],h=i[6],o=i[1],l=i[4],u=i[7],c=i[2],p=i[5],d=i[8],m=s[0],y=s[3],f=s[6],g=s[1],x=s[4],v=s[7],b=s[2],M=s[5],w=s[8];return r[0]=a*m+n*g+h*b,r[3]=a*y+n*x+h*M,r[6]=a*f+n*v+h*w,r[1]=o*m+l*g+u*b,r[4]=o*y+l*x+u*M,r[7]=o*f+l*v+u*w,r[2]=c*m+p*g+d*b,r[5]=c*y+p*x+d*M,r[8]=c*f+p*v+d*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8];return e*a*l-e*n*o-i*r*l+i*n*h+s*r*o-s*a*h}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8],u=l*a-n*o,c=n*h-l*r,p=o*r-a*h,d=e*u+i*c+s*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);let m=1/d;return t[0]=u*m,t[1]=(s*o-l*i)*m,t[2]=(n*i-s*a)*m,t[3]=c*m,t[4]=(l*e-s*h)*m,t[5]=(s*r-n*e)*m,t[6]=p*m,t[7]=(i*h-o*e)*m,t[8]=(a*e-i*r)*m,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,a,n){let h=Math.cos(r),o=Math.sin(r);return this.set(i*h,i*o,-i*(h*a+o*n)+a+t,-s*o,s*h,-s*(-o*a+h*n)+n+e,0,0,1),this}scale(t,e){return Vi("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(ns.makeScale(t,e)),this}rotate(t){return Vi("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(ns.makeRotation(-t)),this}translate(t,e){return Vi("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(ns.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}},as=rs;rs.prototype.isMatrix3=!0;var ns=new as,hs=(new as).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),os=(new as).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),ls=function(){let t={enabled:!1,workingColorSpace:We,spaces:{},convert:function(t,e,i){return!1===this.enabled||e===i||!e||!i||(this.spaces[e].transfer===je&&(t.r=us(t.r),t.g=us(t.g),t.b=us(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===je&&(t.r=cs(t.r),t.g=cs(t.g),t.b=cs(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?Ue:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,i){return Vi("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(e,i)},toWorkingColorSpace:function(e,i){return Vi("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(e,i)}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return t.define({[We]:{primaries:e,whitePoint:s,transfer:Ue,toXYZ:hs,fromXYZ:os,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:De},outputColorSpaceConfig:{drawingBufferColorSpace:De}},[De]:{primaries:e,whitePoint:s,transfer:je,toXYZ:hs,fromXYZ:os,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:De}}}),t}();function us(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function cs(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var ps,ds=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{void 0===ps&&(ps=Ii("canvas")),ps.width=t.width,ps.height=t.height;let e=ps.getContext("2d");t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),i=ps}return i.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Ii("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let t=0;t<r.length;t++)r[t]=255*us(r[t]/255);return i.putImageData(s,0,0),e}if(t.data){let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*us(e[t]/255)):e[t]=us(e[t]);return{data:e,width:t.width,height:t.height}}return Ni("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},ms=0,ys=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ms++}),this.uuid=Ji(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):typeof VideoFrame<"u"&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},s=this.data;if(null!==s){let t;if(Array.isArray(s)){t=[];for(let e=0,i=s.length;e<i;e++)s[e].isDataTexture?t.push(fs(s[e].image)):t.push(fs(s[e]))}else t=fs(s);i.url=t}return e||(t.images[this.uuid]=i),i}};function fs(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?ds.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(Ni("Texture: Unable to serialize Texture."),{})}var gs=0,xs=new es,vs=class extends Li{constructor(t=vs.DEFAULT_IMAGE,e=vs.DEFAULT_MAPPING,i=ct,s=ct,r=ft,a=xt,n=Rt,h=bt,o=vs.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:gs++}),this.uuid=Ji(),this.name="",this.source=new ys(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=o,this.format=n,this.internalFormat=null,this.type=h,this.offset=new $i(0,0),this.repeat=new $i(1,1),this.center=new $i(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new as,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(xs).x}get height(){return this.source.getSize(xs).y}get depth(){return this.source.getSize(xs).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){Ni(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];void 0!==s?s&&i&&s.isVector2&&i.isVector2||s&&i&&s.isVector3&&i.isVector3||s&&i&&s.isMatrix3&&i.isMatrix3?s.copy(i):this[e]=i:Ni(`Texture.setValues(): property '${e}' does not exist.`)}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ut:t.x=t.x-Math.floor(t.x);break;case ct:t.x=t.x<0?0:1;break;case pt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case ut:t.y=t.y-Math.floor(t.y);break;case ct:t.y=t.y<0?0:1;break;case pt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}};vs.DEFAULT_IMAGE=null,vs.DEFAULT_MAPPING=300,vs.DEFAULT_ANISOTROPY=1;var bs=class{constructor(t=0,e=0,i=0,s=1){this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("THREE.Vector4: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r,a=t.elements,n=a[0],h=a[4],o=a[8],l=a[1],u=a[5],c=a[9],p=a[2],d=a[6],m=a[10];if(Math.abs(h-l)<.01&&Math.abs(o-p)<.01&&Math.abs(c-d)<.01){if(Math.abs(h+l)<.1&&Math.abs(o+p)<.1&&Math.abs(c+d)<.1&&Math.abs(n+u+m-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let t=(n+1)/2,a=(u+1)/2,y=(m+1)/2,f=(h+l)/4,g=(o+p)/4,x=(c+d)/4;return t>a&&t>y?t<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(t),s=f/i,r=g/i):a>y?a<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(a),i=f/s,r=x/s):y<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(y),i=g/r,s=x/r),this.set(i,s,r,e),this}let y=Math.sqrt((d-c)*(d-c)+(o-p)*(o-p)+(l-h)*(l-h));return Math.abs(y)<.001&&(y=1),this.x=(d-c)/y,this.y=(o-p)/y,this.z=(l-h)/y,this.w=Math.acos((n+u+m-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=qi(this.x,t.x,e.x),this.y=qi(this.y,t.y,e.y),this.z=qi(this.z,t.z,e.z),this.w=qi(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=qi(this.x,t,e),this.y=qi(this.y,t,e),this.z=qi(this.z,t,e),this.w=qi(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(qi(i,t,e))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}},Ms=bs;bs.prototype.isVector4=!0;var ws=class extends Li{constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ft,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new Ms(0,0,t,e),this.scissorTest=!1,this.viewport=new Ms(0,0,t,e),this.textures=[];let s={width:t,height:e,depth:i.depth},r=new vs(s),a=i.count;for(let t=0;t<a;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview,this.useArrayDepthTexture=i.useArrayDepthTexture}_setTextureOptions(t={}){let e={minFilter:ft,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==t&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=t,this.textures[s].image.height=e,this.textures[s].image.depth=i,!0!==this.textures[s].isData3DTexture&&(this.textures[s].isArrayTexture=this.textures[s].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new ys(i)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this.multiview=t.multiview,this.useArrayDepthTexture=t.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ss=class extends ws{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}},_s=class extends vs{constructor(t=null,e=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=dt,this.minFilter=dt,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}},As=class extends vs{constructor(t=null,e=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=dt,this.minFilter=dt,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},zs=class{constructor(t,e,i,s,r,a,n,h,o,l,u,c,p,d,m,y){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,h,o,l,u,c,p,d,m,y)}set(t,e,i,s,r,a,n,h,o,l,u,c,p,d,m,y){let f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=a,f[9]=n,f[13]=h,f[2]=o,f[6]=l,f[10]=u,f[14]=c,f[3]=p,f[7]=d,f[11]=m,f[15]=y,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 zs).fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return 0===this.determinantAffine()?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1),this):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinantAffine())return this.identity();let e=this.elements,i=t.elements,s=1/Cs.setFromMatrixColumn(t,0).length(),r=1/Cs.setFromMatrixColumn(t,1).length(),a=1/Cs.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,i=t.x,s=t.y,r=t.z,a=Math.cos(i),n=Math.sin(i),h=Math.cos(s),o=Math.sin(s),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=h*l,e[4]=-h*u,e[8]=o,e[1]=i+s*o,e[5]=t-r*o,e[9]=-n*h,e[2]=r-t*o,e[6]=s+i*o,e[10]=a*h}else if("YXZ"===t.order){let t=h*l,i=h*u,s=o*l,r=o*u;e[0]=t+r*n,e[4]=s*n-i,e[8]=a*o,e[1]=a*u,e[5]=a*l,e[9]=-n,e[2]=i*n-s,e[6]=r+t*n,e[10]=a*h}else if("ZXY"===t.order){let t=h*l,i=h*u,s=o*l,r=o*u;e[0]=t-r*n,e[4]=-a*u,e[8]=s+i*n,e[1]=i+s*n,e[5]=a*l,e[9]=r-t*n,e[2]=-a*o,e[6]=n,e[10]=a*h}else if("ZYX"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=h*l,e[4]=s*o-i,e[8]=t*o+r,e[1]=h*u,e[5]=r*o+t,e[9]=i*o-s,e[2]=-o,e[6]=n*h,e[10]=a*h}else if("YZX"===t.order){let t=a*h,i=a*o,s=n*h,r=n*o;e[0]=h*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=a*l,e[9]=-n*l,e[2]=-o*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=a*h,i=a*o,s=n*h,r=n*o;e[0]=h*l,e[4]=-u,e[8]=o*l,e[1]=t*u+r,e[5]=a*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=n*l,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ks,t,Bs)}lookAt(t,e,i){let s=this.elements;return Ns.subVectors(t,e),0===Ns.lengthSq()&&(Ns.z=1),Ns.normalize(),Os.crossVectors(i,Ns),0===Os.lengthSq()&&(1===Math.abs(i.z)?Ns.x+=1e-4:Ns.z+=1e-4,Ns.normalize(),Os.crossVectors(i,Ns)),Os.normalize(),Ps.crossVectors(Ns,Os),s[0]=Os.x,s[4]=Ps.x,s[8]=Ns.x,s[1]=Os.y,s[5]=Ps.y,s[9]=Ns.y,s[2]=Os.z,s[6]=Ps.z,s[10]=Ns.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[4],h=i[8],o=i[12],l=i[1],u=i[5],c=i[9],p=i[13],d=i[2],m=i[6],y=i[10],f=i[14],g=i[3],x=i[7],v=i[11],b=i[15],M=s[0],w=s[4],S=s[8],_=s[12],A=s[1],z=s[5],T=s[9],C=s[13],I=s[2],k=s[6],B=s[10],O=s[14],P=s[3],N=s[7],R=s[11],V=s[15];return r[0]=a*M+n*A+h*I+o*P,r[4]=a*w+n*z+h*k+o*N,r[8]=a*S+n*T+h*B+o*R,r[12]=a*_+n*C+h*O+o*V,r[1]=l*M+u*A+c*I+p*P,r[5]=l*w+u*z+c*k+p*N,r[9]=l*S+u*T+c*B+p*R,r[13]=l*_+u*C+c*O+p*V,r[2]=d*M+m*A+y*I+f*P,r[6]=d*w+m*z+y*k+f*N,r[10]=d*S+m*T+y*B+f*R,r[14]=d*_+m*C+y*O+f*V,r[3]=g*M+x*A+v*I+b*P,r[7]=g*w+x*z+v*k+b*N,r[11]=g*S+x*T+v*B+b*R,r[15]=g*_+x*C+v*O+b*V,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],a=t[1],n=t[5],h=t[9],o=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3],m=t[7],y=t[11],f=t[15],g=h*p-o*c,x=n*p-o*u,v=n*c-h*u,b=a*p-o*l,M=a*c-h*l,w=a*u-n*l;return e*(m*g-y*x+f*v)-i*(d*g-y*b+f*M)+s*(d*x-m*b+f*w)-r*(d*v-m*M+y*w)}determinantAffine(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[1],a=t[5],n=t[9],h=t[2],o=t[6],l=t[10];return e*(a*l-n*o)-i*(r*l-n*h)+s*(r*o-a*h)}transpose(){let t,e=this.elements;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(t,e,i){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8],u=t[9],c=t[10],p=t[11],d=t[12],m=t[13],y=t[14],f=t[15],g=e*n-i*a,x=e*h-s*a,v=e*o-r*a,b=i*h-s*n,M=i*o-r*n,w=s*o-r*h,S=l*m-u*d,_=l*y-c*d,A=l*f-p*d,z=u*y-c*m,T=u*f-p*m,C=c*f-p*y,I=g*C-x*T+v*z+b*A-M*_+w*S;if(0===I)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let k=1/I;return t[0]=(n*C-h*T+o*z)*k,t[1]=(s*T-i*C-r*z)*k,t[2]=(m*w-y*M+f*b)*k,t[3]=(c*M-u*w-p*b)*k,t[4]=(h*A-a*C-o*_)*k,t[5]=(e*C-s*A+r*_)*k,t[6]=(y*v-d*w-f*x)*k,t[7]=(l*w-c*v+p*x)*k,t[8]=(a*T-n*A+o*S)*k,t[9]=(i*A-e*T-r*S)*k,t[10]=(d*M-m*v+f*g)*k,t[11]=(u*v-l*M-p*g)*k,t[12]=(n*_-a*z-h*S)*k,t[13]=(e*z-i*_+s*S)*k,t[14]=(m*x-d*b-y*g)*k,t[15]=(l*b-u*x+c*g)*k,this}scale(t){let e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),s=Math.sin(e),r=1-i,a=t.x,n=t.y,h=t.z,o=r*a,l=r*n;return this.set(o*a+i,o*n-s*h,o*h+s*n,0,o*n+s*h,l*n+i,l*h-s*a,0,o*h-s*n,l*h+s*a,r*h*h+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,a=e._y,n=e._z,h=e._w,o=r+r,l=a+a,u=n+n,c=r*o,p=r*l,d=r*u,m=a*l,y=a*u,f=n*u,g=h*o,x=h*l,v=h*u,b=i.x,M=i.y,w=i.z;return s[0]=(1-(m+f))*b,s[1]=(p+v)*b,s[2]=(d-x)*b,s[3]=0,s[4]=(p-v)*M,s[5]=(1-(c+f))*M,s[6]=(y+g)*M,s[7]=0,s[8]=(d+x)*w,s[9]=(y-g)*w,s[10]=(1-(c+m))*w,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){let s=this.elements;t.x=s[12],t.y=s[13],t.z=s[14];let r=this.determinantAffine();if(0===r)return i.set(1,1,1),e.identity(),this;let a=Cs.set(s[0],s[1],s[2]).length(),n=Cs.set(s[4],s[5],s[6]).length(),h=Cs.set(s[8],s[9],s[10]).length();r<0&&(a=-a),Is.copy(this);let o=1/a,l=1/n,u=1/h;return Is.elements[0]*=o,Is.elements[1]*=o,Is.elements[2]*=o,Is.elements[4]*=l,Is.elements[5]*=l,Is.elements[6]*=l,Is.elements[8]*=u,Is.elements[9]*=u,Is.elements[10]*=u,e.setFromRotationMatrix(Is),i.x=a,i.y=n,i.z=h,this}makePerspective(t,e,i,s,r,a,n=bi,h=!1){let o,l,u=this.elements,c=2*r/(e-t),p=2*r/(i-s),d=(e+t)/(e-t),m=(i+s)/(i-s);if(h)o=r/(a-r),l=a*r/(a-r);else if(n===bi)o=-(a+r)/(a-r),l=-2*a*r/(a-r);else{if(n!==Mi)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+n);o=-a/(a-r),l=-a*r/(a-r)}return u[0]=c,u[4]=0,u[8]=d,u[12]=0,u[1]=0,u[5]=p,u[9]=m,u[13]=0,u[2]=0,u[6]=0,u[10]=o,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,i,s,r,a,n=bi,h=!1){let o,l,u=this.elements,c=2/(e-t),p=2/(i-s),d=-(e+t)/(e-t),m=-(i+s)/(i-s);if(h)o=1/(a-r),l=a/(a-r);else if(n===bi)o=-2/(a-r),l=-(a+r)/(a-r);else{if(n!==Mi)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+n);o=-1/(a-r),l=-r/(a-r)}return u[0]=c,u[4]=0,u[8]=0,u[12]=d,u[1]=0,u[5]=p,u[9]=0,u[13]=m,u[2]=0,u[6]=0,u[10]=o,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}},Ts=zs;zs.prototype.isMatrix4=!0;var Cs=new es,Is=new Ts,ks=new es(0,0,0),Bs=new es(1,1,1),Os=new es,Ps=new es,Ns=new es,Rs=new Ts,Vs=new Ki,Es=class{constructor(t=0,e=0,i=0,s=Es.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){let s=t.elements,r=s[0],a=s[4],n=s[8],h=s[1],o=s[5],l=s[9],u=s[2],c=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(qi(n,-1,1)),Math.abs(n)<.9999999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,o),this._z=0);break;case"YXZ":this._x=Math.asin(-qi(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(n,p),this._z=Math.atan2(h,o)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(qi(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._y=0,this._z=Math.atan2(h,r));break;case"ZYX":this._y=Math.asin(-qi(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,p),this._z=Math.atan2(h,r)):(this._x=0,this._z=Math.atan2(-a,o));break;case"YZX":this._z=Math.asin(qi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-l,o),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(n,p));break;case"XZY":this._z=Math.asin(-qi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(c,o),this._y=Math.atan2(n,r)):(this._x=Math.atan2(-l,p),this._y=0);break;default:Ni("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Rs.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Rs,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Vs.setFromEuler(this),this.setFromQuaternion(Vs,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Es.DEFAULT_ORDER="XYZ";var Fs=class{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}},Ls=0,Ds=new es,Ws=new Ki,Us=new Ts,js=new es,Js=new es,qs=new es,Xs=new Ki,Ys=new es(1,0,0),Zs=new es(0,1,0),Hs=new es(0,0,1),Gs={type:"added"},Qs={type:"removed"},$s={type:"childadded",child:null},Ks={type:"childremoved",child:null},tr=class extends Li{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Ls++}),this.uuid=Ji(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=tr.DEFAULT_UP.clone();let t=new es,e=new Es,i=new Ki,s=new es(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new Ts},normalMatrix:{value:new as}}),this.matrix=new Ts,this.matrixWorld=new Ts,this.matrixAutoUpdate=tr.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=tr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Fs,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ws.setFromAxisAngle(t,e),this.quaternion.multiply(Ws),this}rotateOnWorldAxis(t,e){return Ws.setFromAxisAngle(t,e),this.quaternion.premultiply(Ws),this}rotateX(t){return this.rotateOnAxis(Ys,t)}rotateY(t){return this.rotateOnAxis(Zs,t)}rotateZ(t){return this.rotateOnAxis(Hs,t)}translateOnAxis(t,e){return Ds.copy(t).applyQuaternion(this.quaternion),this.position.add(Ds.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Ys,t)}translateY(t){return this.translateOnAxis(Zs,t)}translateZ(t){return this.translateOnAxis(Hs,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Us.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?js.copy(t):js.set(t,e,i);let s=this.parent;this.updateWorldMatrix(!0,!1),Js.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Us.lookAt(Js,js,this.up):Us.lookAt(js,Js,this.up),this.quaternion.setFromRotationMatrix(Us),s&&(Us.extractRotation(s.matrixWorld),Ws.setFromRotationMatrix(Us),this.quaternion.premultiply(Ws.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(Ri("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Gs),$s.child=t,this.dispatchEvent($s),$s.child=null):Ri("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}let e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Qs),Ks.child=t,this.dispatchEvent(Ks),Ks.child=null),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Us.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Us.multiply(t.parent.matrixWorld)),t.applyMatrix4(Us),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Gs),$s.child=t,this.dispatchEvent($s),$s.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,s=this.children.length;i<s;i++){let s=this.children[i].getObjectByProperty(t,e);if(void 0!==s)return s}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);let s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Js,t,qs),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Js,Xs,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,i=t.y,s=t.z,r=this.matrix.elements;r[12]+=e-r[0]*e-r[4]*i-r[8]*s,r[13]+=i-r[1]*e-r[5]*i-r[9]*s,r[14]+=s-r[2]*e-r[6]*i-r[10]*s}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e,i=!1){let s=this.parent;if(!0===t&&null!==s&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0),!0===e){let t=this.children;for(let e=0,s=t.length;e<s;e++)t[e].updateWorldMatrix(!1,!0,i)}}toJSON(t){let e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let s={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),!1!==this.static&&(s.static=this.static),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),null!==this.pivot&&(s.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(s.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(s.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(t=>({...t})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(s.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,s=i.length;e<s;e++){let s=i[e];r(t.shapes,s)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let i=0,s=this.material.length;i<s;i++)e.push(r(t.materials,this.material[i]));s.material=e}else s.material=r(t.materials,this.material);if(this.children.length>0){s.children=[];for(let e=0;e<this.children.length;e++)s.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];s.animations.push(r(t.animations,i))}}if(e){let e=a(t.geometries),s=a(t.materials),r=a(t.textures),n=a(t.images),h=a(t.shapes),o=a(t.skeletons),l=a(t.animations),u=a(t.nodes);e.length>0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),n.length>0&&(i.images=n),h.length>0&&(i.shapes=h),o.length>0&&(i.skeletons=o),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=s,i;function a(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let i=t.children[e];this.add(i.clone())}return this}};tr.DEFAULT_UP=new es(0,1,0),tr.DEFAULT_MATRIX_AUTO_UPDATE=!0,tr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var er=class extends tr{constructor(){super(),this.isGroup=!0,this.type="Group"}},ir={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},sr={h:0,s:0,l:0},rr={h:0,s:0,l:0};function ar(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}var nr=class{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(void 0===e&&void 0===i){let e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=De){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ls.colorSpaceToWorking(this,e),this}setRGB(t,e,i,s=ls.workingColorSpace){return this.r=t,this.g=e,this.b=i,ls.colorSpaceToWorking(this,s),this}setHSL(t,e,i,s=ls.workingColorSpace){if(t=Xi(t,1),e=qi(e,0,1),i=qi(i,0,1),0===e)this.r=this.g=this.b=i;else{let s=i<=.5?i*(1+e):i+e-i*e,r=2*i-s;this.r=ar(r,s,t+1/3),this.g=ar(r,s,t),this.b=ar(r,s,t-1/3)}return ls.colorSpaceToWorking(this,s),this}setStyle(t,e=De){function i(e){void 0!==e&&parseFloat(e)<1&&Ni("Color: Alpha component of "+t+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=s[1],n=s[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:Ni("Color: Unknown color model "+t)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(t)){let i=s[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(i,16),e);Ni("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=De){let i=ir[t.toLowerCase()];return void 0!==i?this.setHex(i,e):Ni("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=us(t.r),this.g=us(t.g),this.b=us(t.b),this}copyLinearToSRGB(t){return this.r=cs(t.r),this.g=cs(t.g),this.b=cs(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=De){return ls.workingToColorSpace(hr.copy(this),t),65536*Math.round(qi(255*hr.r,0,255))+256*Math.round(qi(255*hr.g,0,255))+Math.round(qi(255*hr.b,0,255))}getHexString(t=De){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ls.workingColorSpace){ls.workingToColorSpace(hr.copy(this),e);let i,s,r=hr.r,a=hr.g,n=hr.b,h=Math.max(r,a,n),o=Math.min(r,a,n),l=(o+h)/2;if(o===h)i=0,s=0;else{let t=h-o;switch(s=l<=.5?t/(h+o):t/(2-h-o),h){case r:i=(a-n)/t+(a<n?6:0);break;case a:i=(n-r)/t+2;break;case n:i=(r-a)/t+4}i/=6}return t.h=i,t.s=s,t.l=l,t}getRGB(t,e=ls.workingColorSpace){return ls.workingToColorSpace(hr.copy(this),e),t.r=hr.r,t.g=hr.g,t.b=hr.b,t}getStyle(t=De){ls.workingToColorSpace(hr.copy(this),t);let e=hr.r,i=hr.g,s=hr.b;return t!==De?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*s)})`}offsetHSL(t,e,i){return this.getHSL(sr),this.setHSL(sr.h+t,sr.s+e,sr.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(sr),t.getHSL(rr);let i=Yi(sr.h,rr.h,e),s=Yi(sr.s,rr.s,e),r=Yi(sr.l,rr.l,e);return this.setHSL(i,s,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,i=this.g,s=this.b,r=t.elements;return this.r=r[0]*e+r[3]*i+r[6]*s,this.g=r[1]*e+r[4]*i+r[7]*s,this.b=r[2]*e+r[5]*i+r[8]*s,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},hr=new nr;nr.NAMES=ir;var or=class{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new nr(t),this.near=e,this.far=i}clone(){return new or(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},lr=class extends tr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Es,this.environmentIntensity=1,this.environmentRotation=new Es,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}},ur=new es,cr=new es,pr=new es,dr=new es,mr=new es,yr=new es,fr=new es,gr=new es,xr=new es,vr=new es,br=new Ms,Mr=new Ms,wr=new Ms,Sr=class{constructor(t=new es,e=new es,i=new es){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,s){s.subVectors(i,e),ur.subVectors(t,e),s.cross(ur);let r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){ur.subVectors(s,e),cr.subVectors(i,e),pr.subVectors(t,e);let a=ur.dot(ur),n=ur.dot(cr),h=ur.dot(pr),o=cr.dot(cr),l=cr.dot(pr),u=a*o-n*n;if(0===u)return r.set(0,0,0),null;let c=1/u,p=(o*h-n*l)*c,d=(a*l-n*h)*c;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,dr)&&dr.x>=0&&dr.y>=0&&dr.x+dr.y<=1}static getInterpolation(t,e,i,s,r,a,n,h){return null===this.getBarycoord(t,e,i,s,dr)?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(r,dr.x),h.addScaledVector(a,dr.y),h.addScaledVector(n,dr.z),h)}static getInterpolatedAttribute(t,e,i,s,r,a){return br.setScalar(0),Mr.setScalar(0),wr.setScalar(0),br.fromBufferAttribute(t,e),Mr.fromBufferAttribute(t,i),wr.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(br,r.x),a.addScaledVector(Mr,r.y),a.addScaledVector(wr,r.z),a}static isFrontFacing(t,e,i,s){return ur.subVectors(i,e),cr.subVectors(t,e),ur.cross(cr).dot(s)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ur.subVectors(this.c,this.b),cr.subVectors(this.a,this.b),.5*ur.cross(cr).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Sr.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Sr.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return Sr.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return Sr.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Sr.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s,r=this.a,a=this.b,n=this.c;mr.subVectors(a,r),yr.subVectors(n,r),gr.subVectors(t,r);let h=mr.dot(gr),o=yr.dot(gr);if(h<=0&&o<=0)return e.copy(r);xr.subVectors(t,a);let l=mr.dot(xr),u=yr.dot(xr);if(l>=0&&u<=l)return e.copy(a);let c=h*u-l*o;if(c<=0&&h>=0&&l<=0)return i=h/(h-l),e.copy(r).addScaledVector(mr,i);vr.subVectors(t,n);let p=mr.dot(vr),d=yr.dot(vr);if(d>=0&&p<=d)return e.copy(n);let m=p*o-h*d;if(m<=0&&o>=0&&d<=0)return s=o/(o-d),e.copy(r).addScaledVector(yr,s);let y=l*d-p*u;if(y<=0&&u-l>=0&&p-d>=0)return fr.subVectors(n,a),s=(u-l)/(u-l+(p-d)),e.copy(a).addScaledVector(fr,s);let f=1/(y+m+c);return i=m*f,s=c*f,e.copy(r).addScaledVector(mr,i).addScaledVector(yr,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},_r=class{constructor(t=new es(1/0,1/0,1/0),e=new es(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(zr.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(zr.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=zr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let i=t.geometry;if(void 0!==i){let s=i.getAttribute("position");if(!0===e&&void 0!==s&&!0!==t.isInstancedMesh)for(let e=0,i=s.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,zr):zr.fromBufferAttribute(s,e),zr.applyMatrix4(t.matrixWorld),this.expandByPoint(zr);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),Tr.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),Tr.copy(i.boundingBox)),Tr.applyMatrix4(t.matrixWorld),this.union(Tr)}let s=t.children;for(let t=0,i=s.length;t<i;t++)this.expandByObject(s[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,zr),zr.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Nr),Rr.subVectors(this.max,Nr),Cr.subVectors(t.a,Nr),Ir.subVectors(t.b,Nr),kr.subVectors(t.c,Nr),Br.subVectors(Ir,Cr),Or.subVectors(kr,Ir),Pr.subVectors(Cr,kr);let e=[0,-Br.z,Br.y,0,-Or.z,Or.y,0,-Pr.z,Pr.y,Br.z,0,-Br.x,Or.z,0,-Or.x,Pr.z,0,-Pr.x,-Br.y,Br.x,0,-Or.y,Or.x,0,-Pr.y,Pr.x,0];return!(!Fr(e,Cr,Ir,kr,Rr)||(e=[1,0,0,0,1,0,0,0,1],!Fr(e,Cr,Ir,kr,Rr)))&&(Vr.crossVectors(Br,Or),e=[Vr.x,Vr.y,Vr.z],Fr(e,Cr,Ir,kr,Rr))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,zr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(zr).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Ar[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ar[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ar[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ar[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ar[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ar[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ar[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ar[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ar)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}},Ar=[new es,new es,new es,new es,new es,new es,new es,new es],zr=new es,Tr=new _r,Cr=new es,Ir=new es,kr=new es,Br=new es,Or=new es,Pr=new es,Nr=new es,Rr=new es,Vr=new es,Er=new es;function Fr(t,e,i,s,r){for(let a=0,n=t.length-3;a<=n;a+=3){Er.fromArray(t,a);let n=r.x*Math.abs(Er.x)+r.y*Math.abs(Er.y)+r.z*Math.abs(Er.z),h=e.dot(Er),o=i.dot(Er),l=s.dot(Er);if(Math.max(-Math.max(h,o,l),Math.min(h,o,l))>n)return!1}return!0}var Lr=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),s=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(s[t]=0,s[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(s[t]=1024>>-e-14,s[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(s[t]=e+15<<10,s[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(s[t]=31744,s[256|t]=64512,r[t]=24,r[256|t]=24):(s[t]=31744,s[256|t]=64512,r[t]=13,r[256|t]=13)}let a=new Uint32Array(2048),n=new Uint32Array(64),h=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,a[t]=e|i}for(let t=1024;t<2048;++t)a[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)n[t]=t<<23;n[31]=1199570944,n[32]=2147483648;for(let t=33;t<63;++t)n[t]=2147483648+(t-32<<23);n[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(h[t]=1024);return{floatView:e,uint32View:i,baseTable:s,shiftTable:r,mantissaTable:a,exponentTable:n,offsetTable:h}}();function Dr(t){Math.abs(t)>65504&&Ni("DataUtils.toHalfFloat(): Value out of range."),t=qi(t,-65504,65504),Lr.floatView[0]=t;let e=Lr.uint32View[0],i=e>>23&511;return Lr.baseTable[i]+((8388607&e)>>Lr.shiftTable[i])}function Wr(t){let e=t>>10;return Lr.uint32View[0]=Lr.mantissaTable[Lr.offsetTable[e]+(1023&t)]+Lr.exponentTable[e],Lr.floatView[0]}var Ur,jr=class{static toHalfFloat(t){return Dr(t)}static fromHalfFloat(t){return Wr(t)}},Jr=new es,qr=new $i,Xr=0,Yr=class extends Li{constructor(t,e,i=!1){if(super(),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Xr++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=gi,this.updateRanges=[],this.gpuType=zt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[t+s]=e.array[i+s];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)qr.fromBufferAttribute(this,e),qr.applyMatrix3(t),this.setXY(e,qr.x,qr.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Jr.fromBufferAttribute(this,e),Jr.applyMatrix3(t),this.setXYZ(e,Jr.x,Jr.y,Jr.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Jr.fromBufferAttribute(this,e),Jr.applyMatrix4(t),this.setXYZ(e,Jr.x,Jr.y,Jr.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Jr.fromBufferAttribute(this,e),Jr.applyNormalMatrix(t),this.setXYZ(e,Jr.x,Jr.y,Jr.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Jr.fromBufferAttribute(this,e),Jr.transformDirection(t),this.setXYZ(e,Jr.x,Jr.y,Jr.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=Zi(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Hi(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Zi(e,this.array)),e}setX(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Zi(e,this.array)),e}setY(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Zi(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Zi(e,this.array)),e}setW(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array),r=Hi(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==gi&&(t.usage=this.usage),t}dispose(){this.dispatchEvent({type:"dispose"})}},Zr=class extends Yr{constructor(t,e,i){super(new Uint16Array(t),e,i)}},Hr=class extends Yr{constructor(t,e,i){super(new Uint32Array(t),e,i)}},Gr=class extends Yr{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=Wr(this.array[t*this.itemSize]);return this.normalized&&(e=Zi(e,this.array)),e}setX(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize]=Dr(e),this}getY(t){let e=Wr(this.array[t*this.itemSize+1]);return this.normalized&&(e=Zi(e,this.array)),e}setY(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+1]=Dr(e),this}getZ(t){let e=Wr(this.array[t*this.itemSize+2]);return this.normalized&&(e=Zi(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+2]=Dr(e),this}getW(t){let e=Wr(this.array[t*this.itemSize+3]);return this.normalized&&(e=Zi(e,this.array)),e}setW(t,e){return this.normalized&&(e=Hi(e,this.array)),this.array[t*this.itemSize+3]=Dr(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array)),this.array[t+0]=Dr(e),this.array[t+1]=Dr(i),this}setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array)),this.array[t+0]=Dr(e),this.array[t+1]=Dr(i),this.array[t+2]=Dr(s),this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array),r=Hi(r,this.array)),this.array[t+0]=Dr(e),this.array[t+1]=Dr(i),this.array[t+2]=Dr(s),this.array[t+3]=Dr(r),this}},Qr=class extends Yr{constructor(t,e,i){super(new Float32Array(t),e,i)}},$r=new _r,Kr=new es,ta=new es,ea=class{constructor(t=new es,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):$r.setFromPoints(t).getCenter(i);let s=0;for(let e=0,r=t.length;e<r;e++)s=Math.max(s,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(s),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Kr.subVectors(t,this.center);let e=Kr.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(Kr,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(ta.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Kr.copy(t.center).add(ta)),this.expandByPoint(Kr.copy(t.center).sub(ta))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}},ia=0,sa=new Ts,ra=new tr,aa=new es,na=new _r,ha=new _r,oa=new es,la=class extends Li{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ia++}),this.uuid=Ji(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?Hr:Zr)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let e=(new as).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let s=this.attributes.tangent;return void 0!==s&&(s.transformDirection(t),s.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(t){return sa.makeRotationFromQuaternion(t),this.applyMatrix4(sa),this}rotateX(t){return sa.makeRotationX(t),this.applyMatrix4(sa),this}rotateY(t){return sa.makeRotationY(t),this.applyMatrix4(sa),this}rotateZ(t){return sa.makeRotationZ(t),this.applyMatrix4(sa),this}translate(t,e,i){return sa.makeTranslation(t,e,i),this.applyMatrix4(sa),this}scale(t,e,i){return sa.makeScale(t,e,i),this.applyMatrix4(sa),this}lookAt(t){return ra.lookAt(t),ra.updateMatrix(),this.applyMatrix4(ra.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let i=0,s=t.length;i<s;i++){let s=t[i];e.push(s.x,s.y,s.z||0)}this.setAttribute("position",new Qr(e,3))}else{let i=Math.min(t.length,e.count);for(let s=0;s<i;s++){let i=t[s];e.setXYZ(s,i.x,i.y,i.z||0)}t.length>e.count&&Ni("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new _r);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return Ri("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new es(-1/0,-1/0,-1/0),new es(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];na.setFromBufferAttribute(i),this.morphTargetsRelative?(oa.addVectors(this.boundingBox.min,na.min),this.boundingBox.expandByPoint(oa),oa.addVectors(this.boundingBox.max,na.max),this.boundingBox.expandByPoint(oa)):(this.boundingBox.expandByPoint(na.min),this.boundingBox.expandByPoint(na.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Ri('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new ea);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return Ri("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new es,1/0);if(t){let i=this.boundingSphere.center;if(na.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];ha.setFromBufferAttribute(i),this.morphTargetsRelative?(oa.addVectors(na.min,ha.min),na.expandByPoint(oa),oa.addVectors(na.max,ha.max),na.expandByPoint(oa)):(na.expandByPoint(ha.min),na.expandByPoint(ha.max))}na.getCenter(i);let s=0;for(let e=0,r=t.count;e<r;e++)oa.fromBufferAttribute(t,e),s=Math.max(s,i.distanceToSquared(oa));if(e)for(let r=0,a=e.length;r<a;r++){let a=e[r],n=this.morphTargetsRelative;for(let e=0,r=a.count;e<r;e++)oa.fromBufferAttribute(a,e),n&&(aa.fromBufferAttribute(t,e),oa.add(aa)),s=Math.max(s,i.distanceToSquared(oa))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&Ri('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void Ri("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.position,s=e.normal,r=e.uv,a=this.getAttribute("tangent");(void 0===a||a.count!==i.count)&&(a=new Yr(new Float32Array(4*i.count),4),this.setAttribute("tangent",a));let n=[],h=[];for(let t=0;t<i.count;t++)n[t]=new es,h[t]=new es;let o=new es,l=new es,u=new es,c=new $i,p=new $i,d=new $i,m=new es,y=new es;function f(t,e,s){o.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,s),c.fromBufferAttribute(r,t),p.fromBufferAttribute(r,e),d.fromBufferAttribute(r,s),l.sub(o),u.sub(o),p.sub(c),d.sub(c);let a=1/(p.x*d.y-d.x*p.y);!isFinite(a)||(m.copy(l).multiplyScalar(d.y).addScaledVector(u,-p.y).multiplyScalar(a),y.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(a),n[t].add(m),n[e].add(m),n[s].add(m),h[t].add(y),h[e].add(y),h[s].add(y))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,i=g.length;e<i;++e){let i=g[e],s=i.start;for(let e=s,r=s+i.count;e<r;e+=3)f(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let x=new es,v=new es,b=new es,M=new es;function w(t){b.fromBufferAttribute(s,t),M.copy(b);let e=n[t];x.copy(e),x.sub(b.multiplyScalar(b.dot(e))).normalize(),v.crossVectors(M,e);let i=v.dot(h[t])<0?-1:1;a.setXYZW(t,x.x,x.y,x.z,i)}for(let e=0,i=g.length;e<i;++e){let i=g[e],s=i.start;for(let e=s,r=s+i.count;e<r;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}this._transformed=!0}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i||i.count!==e.count)i=new Yr(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);let s=new es,r=new es,a=new es,n=new es,h=new es,o=new es,l=new es,u=new es;if(t)for(let c=0,p=t.count;c<p;c+=3){let p=t.getX(c+0),d=t.getX(c+1),m=t.getX(c+2);s.fromBufferAttribute(e,p),r.fromBufferAttribute(e,d),a.fromBufferAttribute(e,m),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),n.fromBufferAttribute(i,p),h.fromBufferAttribute(i,d),o.fromBufferAttribute(i,m),n.add(l),h.add(l),o.add(l),i.setXYZ(p,n.x,n.y,n.z),i.setXYZ(d,h.x,h.y,h.z),i.setXYZ(m,o.x,o.y,o.z)}else for(let t=0,n=e.count;t<n;t+=3)s.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)oa.fromBufferAttribute(t,e),oa.normalize(),t.setXYZ(e,oa.x,oa.y,oa.z)}toNonIndexed(){function t(t,e){let i=t.array,s=t.itemSize,r=t.normalized,a=new i.constructor(e.length*s),n=0,h=0;for(let r=0,o=e.length;r<o;r++){n=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*s;for(let t=0;t<s;t++)a[h++]=i[n++]}return new Yr(a,s,r)}if(null===this.index)return Ni("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new la,i=this.index.array,s=this.attributes;for(let r in s){let a=t(s[r],i);e.setAttribute(r,a)}let r=this.morphAttributes;for(let s in r){let a=[],n=r[s];for(let e=0,s=n.length;e<s;e++){let s=t(n[e],i);a.push(s)}e.morphAttributes[s]=a}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let t=0,i=a.length;t<i;t++){let i=a[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let s=i[e];t.data.attributes[e]=s.toJSON(t.data)}let s={},r=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],a=[];for(let e=0,s=i.length;e<s;e++){let s=i[e];a.push(s.toJSON(t.data))}a.length>0&&(s[e]=a,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let n=this.boundingSphere;return null!==n&&(t.data.boundingSphere=n.toJSON()),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let s=t.attributes;for(let t in s){let i=s[t];this.setAttribute(t,i.clone(e))}let r=t.morphAttributes;for(let t in r){let i=[],s=r[t];for(let t=0,r=s.length;t<r;t++)i.push(s[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let t=0,e=a.length;t<e;t++){let e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}let n=t.boundingBox;null!==n&&(this.boundingBox=n.clone());let h=t.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this._transformed=t._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}},ua=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=gi,this.updateRanges=[],this.version=0,this.uuid=Ji()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;s<r;s++)this.array[t+s]=e.array[i+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ji()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ji()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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}}},ca=new es,pa=class{constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)ca.fromBufferAttribute(this,e),ca.applyMatrix4(t),this.setXYZ(e,ca.x,ca.y,ca.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)ca.fromBufferAttribute(this,e),ca.applyNormalMatrix(t),this.setXYZ(e,ca.x,ca.y,ca.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)ca.fromBufferAttribute(this,e),ca.transformDirection(t),this.setXYZ(e,ca.x,ca.y,ca.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=Zi(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Hi(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=Hi(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Hi(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Hi(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Hi(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Zi(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Zi(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Zi(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Zi(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Hi(e,this.array),i=Hi(i,this.array),s=Hi(s,this.array),r=Hi(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=r,this}clone(t){if(void 0===t){Oi("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new Yr(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new pa(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){Oi("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},da=0,ma=class extends Li{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:da++}),this.uuid=Ji(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new nr(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ze,this.stencilZFail=Ze,this.stencilZPass=Ze,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.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let i=t[e];if(void 0===i){Ni(`Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];void 0!==s?s&&s.isColor?s.set(i):s&&s.isVector2&&i&&i.isVector2||s&&s.isEuler&&i&&i.isEuler||s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i:Ni(`Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function s(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ze&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ze&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ze&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){let e=s(t.textures),r=s(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}fromJSON(t,e){if(void 0!==t.uuid&&(this.uuid=t.uuid),void 0!==t.name&&(this.name=t.name),void 0!==t.color&&void 0!==this.color&&this.color.setHex(t.color),void 0!==t.roughness&&(this.roughness=t.roughness),void 0!==t.metalness&&(this.metalness=t.metalness),void 0!==t.sheen&&(this.sheen=t.sheen),void 0!==t.sheenColor&&(this.sheenColor=(new nr).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(this.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==this.emissive&&this.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==this.specular&&this.specular.setHex(t.specular),void 0!==t.specularIntensity&&(this.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(this.shininess=t.shininess),void 0!==t.clearcoat&&(this.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(this.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(this.dispersion=t.dispersion),void 0!==t.iridescence&&(this.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(this.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(this.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(this.transmission=t.transmission),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.attenuationDistance&&(this.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(this.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(this.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(this.fog=t.fog),void 0!==t.flatShading&&(this.flatShading=t.flatShading),void 0!==t.blending&&(this.blending=t.blending),void 0!==t.combine&&(this.combine=t.combine),void 0!==t.side&&(this.side=t.side),void 0!==t.shadowSide&&(this.shadowSide=t.shadowSide),void 0!==t.opacity&&(this.opacity=t.opacity),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.alphaTest&&(this.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(this.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(this.depthFunc=t.depthFunc),void 0!==t.depthTest&&(this.depthTest=t.depthTest),void 0!==t.depthWrite&&(this.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(this.colorWrite=t.colorWrite),void 0!==t.blendSrc&&(this.blendSrc=t.blendSrc),void 0!==t.blendDst&&(this.blendDst=t.blendDst),void 0!==t.blendEquation&&(this.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(this.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(this.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(this.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(this.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(this.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(this.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(this.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(this.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(this.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(this.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(this.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(this.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(this.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(this.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(this.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.linewidth&&(this.linewidth=t.linewidth),void 0!==t.dashSize&&(this.dashSize=t.dashSize),void 0!==t.gapSize&&(this.gapSize=t.gapSize),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.polygonOffset&&(this.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(this.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(this.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(this.dithering=t.dithering),void 0!==t.alphaToCoverage&&(this.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(this.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(this.forceSinglePass=t.forceSinglePass),void 0!==t.allowOverride&&(this.allowOverride=t.allowOverride),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.toneMapped&&(this.toneMapped=t.toneMapped),void 0!==t.userData&&(this.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?this.vertexColors=t.vertexColors>0:this.vertexColors=t.vertexColors),void 0!==t.size&&(this.size=t.size),void 0!==t.sizeAttenuation&&(this.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(this.map=e[t.map]||null),void 0!==t.matcap&&(this.matcap=e[t.matcap]||null),void 0!==t.alphaMap&&(this.alphaMap=e[t.alphaMap]||null),void 0!==t.bumpMap&&(this.bumpMap=e[t.bumpMap]||null),void 0!==t.bumpScale&&(this.bumpScale=t.bumpScale),void 0!==t.normalMap&&(this.normalMap=e[t.normalMap]||null),void 0!==t.normalMapType&&(this.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),this.normalScale=(new $i).fromArray(e)}return void 0!==t.displacementMap&&(this.displacementMap=e[t.displacementMap]||null),void 0!==t.displacementScale&&(this.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(this.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(this.roughnessMap=e[t.roughnessMap]||null),void 0!==t.metalnessMap&&(this.metalnessMap=e[t.metalnessMap]||null),void 0!==t.emissiveMap&&(this.emissiveMap=e[t.emissiveMap]||null),void 0!==t.emissiveIntensity&&(this.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(this.specularMap=e[t.specularMap]||null),void 0!==t.specularIntensityMap&&(this.specularIntensityMap=e[t.specularIntensityMap]||null),void 0!==t.specularColorMap&&(this.specularColorMap=e[t.specularColorMap]||null),void 0!==t.envMap&&(this.envMap=e[t.envMap]||null),void 0!==t.envMapRotation&&this.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(this.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(this.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(this.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(this.lightMap=e[t.lightMap]||null),void 0!==t.lightMapIntensity&&(this.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(this.aoMap=e[t.aoMap]||null),void 0!==t.aoMapIntensity&&(this.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(this.gradientMap=e[t.gradientMap]||null),void 0!==t.clearcoatMap&&(this.clearcoatMap=e[t.clearcoatMap]||null),void 0!==t.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=e[t.clearcoatRoughnessMap]||null),void 0!==t.clearcoatNormalMap&&(this.clearcoatNormalMap=e[t.clearcoatNormalMap]||null),void 0!==t.clearcoatNormalScale&&(this.clearcoatNormalScale=(new $i).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(this.iridescenceMap=e[t.iridescenceMap]||null),void 0!==t.iridescenceThicknessMap&&(this.iridescenceThicknessMap=e[t.iridescenceThicknessMap]||null),void 0!==t.transmissionMap&&(this.transmissionMap=e[t.transmissionMap]||null),void 0!==t.thicknessMap&&(this.thicknessMap=e[t.thicknessMap]||null),void 0!==t.anisotropyMap&&(this.anisotropyMap=e[t.anisotropyMap]||null),void 0!==t.sheenColorMap&&(this.sheenColorMap=e[t.sheenColorMap]||null),void 0!==t.sheenRoughnessMap&&(this.sheenRoughnessMap=e[t.sheenRoughnessMap]||null),this}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=new Array(t);for(let s=0;s!==t;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}},ya=class extends ma{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new nr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},fa=new es,ga=new es,xa=new es,va=new $i,ba=new $i,Ma=new Ts,wa=new es,Sa=new es,_a=new es,Aa=new $i,za=new $i,Ta=new $i,Ca=class extends tr{constructor(t=new ya){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Ur){Ur=new la;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new ua(t,5);Ur.setIndex([0,1,2,0,2,3]),Ur.setAttribute("position",new pa(e,3,0,!1)),Ur.setAttribute("uv",new pa(e,2,3,!1))}this.geometry=Ur,this.material=t,this.center=new $i(.5,.5),this.count=1}raycast(t,e){null===t.camera&&Ri('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),ga.setFromMatrixScale(this.matrixWorld),Ma.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),xa.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&ga.multiplyScalar(-xa.z);let i,s,r=this.material.rotation;0!==r&&(s=Math.cos(r),i=Math.sin(r));let a=this.center;Ia(wa.set(-.5,-.5,0),xa,a,ga,i,s),Ia(Sa.set(.5,-.5,0),xa,a,ga,i,s),Ia(_a.set(.5,.5,0),xa,a,ga,i,s),Aa.set(0,0),za.set(1,0),Ta.set(1,1);let n=t.ray.intersectTriangle(wa,Sa,_a,!1,fa);if(null===n&&(Ia(Sa.set(-.5,.5,0),xa,a,ga,i,s),za.set(0,1),n=t.ray.intersectTriangle(wa,_a,Sa,!1,fa),null===n))return;let h=t.ray.origin.distanceTo(fa);h<t.near||h>t.far||e.push({distance:h,point:fa.clone(),uv:Sr.getInterpolation(fa,wa,Sa,_a,Aa,za,Ta,new $i),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}};function Ia(t,e,i,s,r,a){va.subVectors(t,i).addScalar(.5).multiply(s),void 0!==r?(ba.x=a*va.x-r*va.y,ba.y=r*va.x+a*va.y):ba.copy(va),t.copy(e),t.x+=ba.x,t.y+=ba.y,t.applyMatrix4(Ma)}var ka=new es,Ba=new es,Oa=new es,Pa=new es,Na=new es,Ra=new es,Va=new es,Ea=class{constructor(t=new es,e=new es(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ka)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=ka.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ka.copy(this.origin).addScaledVector(this.direction,e),ka.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){Ba.copy(t).add(e).multiplyScalar(.5),Oa.copy(e).sub(t).normalize(),Pa.copy(this.origin).sub(Ba);let r,a,n,h,o=.5*t.distanceTo(e),l=-this.direction.dot(Oa),u=Pa.dot(this.direction),c=-Pa.dot(Oa),p=Pa.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(r=l*c-u,a=l*u-c,h=o*d,r>=0)if(a>=-h)if(a<=h){let t=1/d;r*=t,a*=t,n=r*(r+l*a+2*u)+a*(l*r+a+2*c)+p}else a=o,r=Math.max(0,-(l*a+u)),n=-r*r+a*(a+2*c)+p;else a=-o,r=Math.max(0,-(l*a+u)),n=-r*r+a*(a+2*c)+p;else a<=-h?(r=Math.max(0,-(-l*o+u)),a=r>0?-o:Math.min(Math.max(-o,-c),o),n=-r*r+a*(a+2*c)+p):a<=h?(r=0,a=Math.min(Math.max(-o,-c),o),n=a*(a+2*c)+p):(r=Math.max(0,-(l*o+u)),a=r>0?o:Math.min(Math.max(-o,-c),o),n=-r*r+a*(a+2*c)+p);else a=l>0?-o:o,r=Math.max(0,-(l*a+u)),n=-r*r+a*(a+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(Ba).addScaledVector(Oa,a),n}intersectSphere(t,e){ka.subVectors(t.center,this.origin);let i=ka.dot(this.direction),s=ka.dot(ka)-i*i,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),n=i-a,h=i+a;return h<0?null:n<0?this.at(h,e):this.at(n,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,s,r,a,n,h,o=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return o>=0?(i=(t.min.x-c.x)*o,s=(t.max.x-c.x)*o):(i=(t.max.x-c.x)*o,s=(t.min.x-c.x)*o),l>=0?(r=(t.min.y-c.y)*l,a=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,a=(t.min.y-c.y)*l),i>a||r>s||((r>i||isNaN(i))&&(i=r),(a<s||isNaN(s))&&(s=a),u>=0?(n=(t.min.z-c.z)*u,h=(t.max.z-c.z)*u):(n=(t.max.z-c.z)*u,h=(t.min.z-c.z)*u),i>h||n>s)||((n>i||i!=i)&&(i=n),(h<s||s!=s)&&(s=h),s<0)?null:this.at(i>=0?i:s,e)}intersectsBox(t){return null!==this.intersectBox(t,ka)}intersectTriangle(t,e,i,s,r){Na.subVectors(e,t),Ra.subVectors(i,t),Va.crossVectors(Na,Ra);let a,n=this.direction.dot(Va);if(n>0){if(s)return null;a=1}else{if(!(n<0))return null;a=-1,n=-n}Pa.subVectors(this.origin,t);let h=a*this.direction.dot(Ra.crossVectors(Pa,Ra));if(h<0)return null;let o=a*this.direction.dot(Na.cross(Pa));if(o<0||h+o>n)return null;let l=-a*Pa.dot(Va);return l<0?null:this.at(l/n,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}},Fa=class extends ma{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nr(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 Es,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},La=new Ts,Da=new Ea,Wa=new ea,Ua=new es,ja=new es,Ja=new es,qa=new es,Xa=new es,Ya=new es,Za=new es,Ha=new es,Ga=class extends tr{constructor(t=new la,e=new Fa){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let i=this.geometry,s=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;e.fromBufferAttribute(s,t);let n=this.morphTargetInfluences;if(r&&n){Ya.set(0,0,0);for(let i=0,s=r.length;i<s;i++){let s=n[i],h=r[i];0!==s&&(Xa.fromBufferAttribute(h,t),a?Ya.addScaledVector(Xa,s):Ya.addScaledVector(Xa.sub(e),s))}e.add(Ya)}return e}raycast(t,e){let i=this.geometry,s=this.material,r=this.matrixWorld;void 0!==s&&(null===i.boundingSphere&&i.computeBoundingSphere(),Wa.copy(i.boundingSphere),Wa.applyMatrix4(r),Da.copy(t.ray).recast(t.near),(!1!==Wa.containsPoint(Da.origin)||!(null===Da.intersectSphere(Wa,Ua)||Da.origin.distanceToSquared(Ua)>(t.far-t.near)**2))&&(La.copy(r).invert(),Da.copy(t.ray).applyMatrix4(La),(null===i.boundingBox||!1!==Da.intersectsBox(i.boundingBox))&&this._computeIntersections(t,e,Da)))}_computeIntersections(t,e,i){let s,r=this.geometry,a=this.material,n=r.index,h=r.attributes.position,o=r.attributes.uv,l=r.attributes.uv1,u=r.attributes.normal,c=r.groups,p=r.drawRange;if(null!==n)if(Array.isArray(a))for(let r=0,h=c.length;r<h;r++){let h=c[r],d=a[h.materialIndex];for(let r=Math.max(h.start,p.start),a=Math.min(n.count,Math.min(h.start+h.count,p.start+p.count));r<a;r+=3)s=Qa(this,d,t,i,o,l,u,n.getX(r),n.getX(r+1),n.getX(r+2)),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=h.materialIndex,e.push(s))}else for(let r=Math.max(0,p.start),h=Math.min(n.count,p.start+p.count);r<h;r+=3)s=Qa(this,a,t,i,o,l,u,n.getX(r),n.getX(r+1),n.getX(r+2)),s&&(s.faceIndex=Math.floor(r/3),e.push(s));else if(void 0!==h)if(Array.isArray(a))for(let r=0,n=c.length;r<n;r++){let n=c[r],d=a[n.materialIndex];for(let r=Math.max(n.start,p.start),a=Math.min(h.count,Math.min(n.start+n.count,p.start+p.count));r<a;r+=3)s=Qa(this,d,t,i,o,l,u,r,r+1,r+2),s&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=n.materialIndex,e.push(s))}else for(let r=Math.max(0,p.start),n=Math.min(h.count,p.start+p.count);r<n;r+=3)s=Qa(this,a,t,i,o,l,u,r,r+1,r+2),s&&(s.faceIndex=Math.floor(r/3),e.push(s))}};function Qa(t,e,i,s,r,a,n,h,o,l){t.getVertexPosition(h,ja),t.getVertexPosition(o,Ja),t.getVertexPosition(l,qa);let u=function(t,e,i,s,r,a,n,h){let o;if(o=1===e.side?s.intersectTriangle(n,a,r,!0,h):s.intersectTriangle(r,a,n,0===e.side,h),null===o)return null;Ha.copy(h),Ha.applyMatrix4(t.matrixWorld);let l=i.ray.origin.distanceTo(Ha);return l<i.near||l>i.far?null:{distance:l,point:Ha.clone(),object:t}}(t,e,i,s,ja,Ja,qa,Za);if(u){let t=new es;Sr.getBarycoord(Za,ja,Ja,qa,t),r&&(u.uv=Sr.getInterpolatedAttribute(r,h,o,l,t,new $i)),a&&(u.uv1=Sr.getInterpolatedAttribute(a,h,o,l,t,new $i)),n&&(u.normal=Sr.getInterpolatedAttribute(n,h,o,l,t,new es),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:h,b:o,c:l,normal:new es,materialIndex:0};Sr.getNormal(ja,Ja,qa,e.normal),u.face=e,u.barycoord=t}return u}var $a=class extends tr{constructor(){super(),this.isBone=!0,this.type="Bone"}},Ka=class extends vs{constructor(t=null,e=1,i=1,s,r,a,n,h,o=dt,l=dt,u,c){super(null,a,n,h,o,l,s,r,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},tn=new Ts,en=new Ts,sn=class{constructor(t=[],e=[]){this.uuid=Ji(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){Ni("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new Ts)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new Ts;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,i=this.boneMatrices,s=this.boneTexture;for(let s=0,r=t.length;s<r;s++){let r=t[s]?t[s].matrixWorld:en;tn.multiplyMatrices(r,e[s]),tn.toArray(i,16*s)}null!==s&&(s.needsUpdate=!0)}clone(){return new sn(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=4*Math.ceil(t/4),t=Math.max(t,4);let e=new Float32Array(t*t*4);e.set(this.boneMatrices);let i=new Ka(e,t,t,Rt,zt);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){let i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,s=t.bones.length;i<s;i++){let s=t.bones[i],r=e[s];void 0===r&&(Ni("Skeleton: No bone found with UUID:",s),r=new $a),this.bones.push(r),this.boneInverses.push((new Ts).fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,i=this.boneInverses;for(let s=0,r=e.length;s<r;s++){let r=e[s];t.bones.push(r.uuid);let a=i[s];t.boneInverses.push(a.toArray())}return t}},rn=class extends Yr{constructor(t,e,i,s=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}},an=new Ts,nn=new Ts,hn=[],on=new _r,ln=new Ts,un=new Ga,cn=new ea,pn=class extends Ga{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new rn(new Float32Array(16*i),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<i;t++)this.setMatrixAt(t,ln)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new _r),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,an),on.copy(t.boundingBox).applyMatrix4(an),this.boundingBox.union(on)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new ea),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,an),cn.copy(t.boundingSphere).applyMatrix4(an),this.boundingSphere.union(cn)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let i=e.morphTargetInfluences,s=this.morphTexture.source.data.data,r=t*(i.length+1)+1;for(let t=0;t<i.length;t++)i[t]=s[r+t]}raycast(t,e){let i=this.matrixWorld,s=this.count;if(un.geometry=this.geometry,un.material=this.material,void 0!==un.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),cn.copy(this.boundingSphere),cn.applyMatrix4(i),!1!==t.ray.intersectsSphere(cn)))for(let r=0;r<s;r++){this.getMatrixAt(r,an),nn.multiplyMatrices(i,an),un.matrixWorld=nn,un.raycast(t,hn);for(let t=0,i=hn.length;t<i;t++){let i=hn[t];i.instanceId=r,i.object=this,e.push(i)}hn.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new rn(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let i=e.morphTargetInfluences,s=i.length+1;null===this.morphTexture&&(this.morphTexture=new Ka(new Float32Array(s*this.count),s,this.count,Ft,zt));let r=this.morphTexture.source.data.data,a=0;for(let t=0;t<i.length;t++)a+=i[t];let n=this.geometry.morphTargetsRelative?1:1-a,h=s*t;return r[h]=n,r.set(i,h+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}},dn=new es,mn=new es,yn=new as,fn=class{constructor(t=new es(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,s){return this.normal.set(t,e,i),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let s=dn.subVectors(i,e).cross(mn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,i=!0){let s=t.delta(dn),r=this.normal.dot(s);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let a=-(t.start.dot(this.normal)+this.constant)/r;return!0===i&&(a<0||a>1)?null:e.copy(t.start).addScaledVector(s,a)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||yn.getNormalMatrix(t),s=this.coplanarPoint(dn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}},gn=new ea,xn=new $i(.5,.5),vn=new es,bn=class{constructor(t=new fn,e=new fn,i=new fn,s=new fn,r=new fn,a=new fn){this.planes=[t,e,i,s,r,a]}set(t,e,i,s,r,a){let n=this.planes;return n[0].copy(t),n[1].copy(e),n[2].copy(i),n[3].copy(s),n[4].copy(r),n[5].copy(a),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=bi,i=!1){let s=this.planes,r=t.elements,a=r[0],n=r[1],h=r[2],o=r[3],l=r[4],u=r[5],c=r[6],p=r[7],d=r[8],m=r[9],y=r[10],f=r[11],g=r[12],x=r[13],v=r[14],b=r[15];if(s[0].setComponents(o-a,p-l,f-d,b-g).normalize(),s[1].setComponents(o+a,p+l,f+d,b+g).normalize(),s[2].setComponents(o+n,p+u,f+m,b+x).normalize(),s[3].setComponents(o-n,p-u,f-m,b-x).normalize(),i)s[4].setComponents(h,c,y,v).normalize(),s[5].setComponents(o-h,p-c,f-y,b-v).normalize();else if(s[4].setComponents(o-h,p-c,f-y,b-v).normalize(),e===bi)s[5].setComponents(o+h,p+c,f+y,b+v).normalize();else{if(e!==Mi)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);s[5].setComponents(h,c,y,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),gn.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),gn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(gn)}intersectsSprite(t){gn.center.set(0,0,0);let e=xn.distanceTo(t.center);return gn.radius=.7071067811865476+e,gn.applyMatrix4(t.matrixWorld),this.intersectsSphere(gn)}intersectsSphere(t){let e=this.planes,i=t.center,s=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<s)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let s=e[i];if(vn.x=s.normal.x>0?t.max.x:t.min.x,vn.y=s.normal.y>0?t.max.y:t.min.y,vn.z=s.normal.z>0?t.max.z:t.min.z,s.distanceToPoint(vn)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}},Mn=new Ts,wn=class{constructor(){this.coordinateSystem=bi,this._frustums=[],this._count=0}setFromArrayCamera(t){let e=t.cameras,i=this._frustums;for(let t=0;t<e.length;t++){let s=e[t];Mn.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),void 0===i[t]&&(i[t]=new bn),i[t].setFromProjectionMatrix(Mn,s.coordinateSystem,s.reversedDepth)}return this._count=e.length,this}intersectsObject(t){let e=this._frustums;for(let i=0;i<this._count;i++)if(e[i].intersectsObject(t))return!0;return!1}intersectsSprite(t){let e=this._frustums;for(let i=0;i<this._count;i++)if(e[i].intersectsSprite(t))return!0;return!1}intersectsSphere(t){let e=this._frustums;for(let i=0;i<this._count;i++)if(e[i].intersectsSphere(t))return!0;return!1}intersectsBox(t){let e=this._frustums;for(let i=0;i<this._count;i++)if(e[i].intersectsBox(t))return!0;return!1}containsPoint(t){let e=this._frustums;for(let i=0;i<this._count;i++)if(e[i].containsPoint(t))return!0;return!1}copy(t){this.coordinateSystem=t.coordinateSystem;let e=this._frustums,i=t._frustums;for(let s=0;s<t._count;s++)void 0===e[s]&&(e[s]=new bn),e[s].copy(i[s]);return this._count=t._count,this}clone(){return(new wn).copy(this)}},Sn=class extends ma{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new nr(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},_n=new es,An=new es,zn=new Ts,Tn=new Ea,Cn=new ea,In=new es,kn=new es,Bn=class extends tr{constructor(t=new la,e=new Sn){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[0];for(let t=1,s=e.count;t<s;t++)_n.fromBufferAttribute(e,t-1),An.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=_n.distanceTo(An);t.setAttribute("lineDistance",new Qr(i,1))}else Ni("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){let i=this.geometry,s=this.matrixWorld,r=t.params.Line.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),Cn.copy(i.boundingSphere),Cn.applyMatrix4(s),Cn.radius+=r,!1===t.ray.intersectsSphere(Cn))return;zn.copy(s).invert(),Tn.copy(t.ray).applyMatrix4(zn);let n=r/((this.scale.x+this.scale.y+this.scale.z)/3),h=n*n,o=this.isLineSegments?2:1,l=i.index,u=i.attributes.position;if(null!==l){let i=Math.max(0,a.start),s=Math.min(l.count,a.start+a.count);for(let r=i,a=s-1;r<a;r+=o){let i=l.getX(r),s=l.getX(r+1),a=On(this,t,Tn,h,i,s,r);a&&e.push(a)}if(this.isLineLoop){let r=l.getX(s-1),a=l.getX(i),n=On(this,t,Tn,h,r,a,s-1);n&&e.push(n)}}else{let i=Math.max(0,a.start),s=Math.min(u.count,a.start+a.count);for(let r=i,a=s-1;r<a;r+=o){let i=On(this,t,Tn,h,r,r+1,r);i&&e.push(i)}if(this.isLineLoop){let r=On(this,t,Tn,h,s-1,i,s-1);r&&e.push(r)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}};function On(t,e,i,s,r,a,n){let h=t.geometry.attributes.position;if(_n.fromBufferAttribute(h,r),An.fromBufferAttribute(h,a),i.distanceSqToSegment(_n,An,In,kn)>s)return;In.applyMatrix4(t.matrixWorld);let o=e.ray.origin.distanceTo(In);return o<e.near||o>e.far?void 0:{distance:o,point:kn.clone().applyMatrix4(t.matrixWorld),index:n,face:null,faceIndex:null,barycoord:null,object:t}}var Pn=new es,Nn=new es,Rn=class extends Bn{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,s=e.count;t<s;t+=2)Pn.fromBufferAttribute(e,t),Nn.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Pn.distanceTo(Nn);t.setAttribute("lineDistance",new Qr(i,1))}else Ni("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},Vn=class extends ma{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new nr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},En=class extends vs{constructor(t,e,i,s,r=ft,a=ft,n,h,o){super(t,e,i,s,r,a,n,h,o),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let l=this;"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;"requestVideoFrameCallback"in t==0&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},Fn=class extends vs{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=dt,this.minFilter=dt,this.generateMipmaps=!1,this.needsUpdate=!0}},Ln=class extends vs{constructor(t=[],e=301,i,s,r,a,n,h,o,l){super(t,e,i,s,r,a,n,h,o,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Dn=class extends vs{constructor(t,e,i,s,r,a,n,h,o){super(t,e,i,s,r,a,n,h,o),this.isCanvasTexture=!0,this.needsUpdate=!0}},Wn=class extends vs{constructor(t,e,i=At,s,r,a,n=dt,h=dt,o,l=Vt,u=1){if(l!==Vt&&1027!==l)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},s,r,a,n,h,l,i,o),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new ys(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}},Un=class extends Wn{constructor(t,e=At,i=301,s,r,a=dt,n=dt,h,o=Vt){let l={width:t,height:t,depth:1},u=[l,l,l,l,l,l];super(t,t,e,i,s,r,a,n,h,o),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}},jn=class extends la{constructor(t=1,e=1,i=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:a};let n=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);let h=[],o=[],l=[],u=[],c=0,p=0;function d(t,e,i,s,r,a,d,m,y,f,g){let x=a/y,v=d/f,b=a/2,M=d/2,w=m/2,S=y+1,_=f+1,A=0,z=0,T=new es;for(let a=0;a<_;a++){let n=a*v-M;for(let h=0;h<S;h++){let c=h*x-b;T[t]=c*s,T[e]=n*r,T[i]=w,o.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[i]=m>0?1:-1,l.push(T.x,T.y,T.z),u.push(h/y),u.push(1-a/f),A+=1}}for(let t=0;t<f;t++)for(let e=0;e<y;e++){let i=c+e+S*t,s=c+e+S*(t+1),r=c+(e+1)+S*(t+1),a=c+(e+1)+S*t;h.push(i,s,a),h.push(s,r,a),z+=6}n.addGroup(p,z,g),p+=z,c+=A}d("z","y","x",-1,-1,i,e,t,a,r,0),d("z","y","x",1,-1,i,e,-t,a,r,1),d("x","z","y",1,1,t,i,e,s,a,2),d("x","z","y",1,-1,t,i,-e,s,a,3),d("x","y","z",1,-1,t,e,i,s,r,4),d("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(h),this.setAttribute("position",new Qr(o,3)),this.setAttribute("normal",new Qr(l,3)),this.setAttribute("uv",new Qr(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new jn(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},Jn=class extends la{constructor(t=1,e=1,i=1,s=32,r=1,a=!1,n=0,h=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:s,heightSegments:r,openEnded:a,thetaStart:n,thetaLength:h};let o=this;s=Math.floor(s),r=Math.floor(r);let l=[],u=[],c=[],p=[],d=0,m=[],y=i/2,f=0;function g(i){let r=d,a=new $i,m=new es,g=0,x=!0===i?t:e,v=!0===i?1:-1;for(let t=1;t<=s;t++)u.push(0,y*v,0),c.push(0,v,0),p.push(.5,.5),d++;let b=d;for(let t=0;t<=s;t++){let e=t/s*h+n,i=Math.cos(e),r=Math.sin(e);m.x=x*r,m.y=y*v,m.z=x*i,u.push(m.x,m.y,m.z),c.push(0,v,0),a.x=.5*i+.5,a.y=.5*r*v+.5,p.push(a.x,a.y),d++}for(let t=0;t<s;t++){let e=r+t,s=b+t;!0===i?l.push(s,s+1,e):l.push(s+1,s,e),g+=3}o.addGroup(f,g,!0===i?1:2),f+=g}(function(){let a=new es,g=new es,x=0,v=(e-t)/i;for(let o=0;o<=r;o++){let l=[],f=o/r,x=f*(e-t)+t;for(let t=0;t<=s;t++){let e=t/s,r=e*h+n,o=Math.sin(r),m=Math.cos(r);g.x=x*o,g.y=-f*i+y,g.z=x*m,u.push(g.x,g.y,g.z),a.set(o,v,m).normalize(),c.push(a.x,a.y,a.z),p.push(e,1-f),l.push(d++)}m.push(l)}for(let i=0;i<s;i++)for(let s=0;s<r;s++){let a=m[s][i],n=m[s+1][i],h=m[s+1][i+1],o=m[s][i+1];(t>0||0!==s)&&(l.push(a,n,o),x+=3),(e>0||s!==r-1)&&(l.push(n,h,o),x+=3)}o.addGroup(f,x,0),f+=x})(),!1===a&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new Qr(u,3)),this.setAttribute("normal",new Qr(c,3)),this.setAttribute("uv",new Qr(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Jn(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},qn=class extends Jn{constructor(t=1,e=1,i=32,s=1,r=!1,a=0,n=2*Math.PI){super(0,t,e,i,s,r,a,n),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:s,openEnded:r,thetaStart:a,thetaLength:n}}static fromJSON(t){return new qn(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},Xn=class extends la{constructor(t=[],e=[],i=1,s=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:s};let r=[],a=[];function n(t,e,i,s){let r=s+1,a=[];for(let s=0;s<=r;s++){a[s]=[];let n=t.clone().lerp(i,s/r),h=e.clone().lerp(i,s/r),o=r-s;for(let t=0;t<=o;t++)a[s][t]=0===t&&s===r?n:n.clone().lerp(h,t/o)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){let i=Math.floor(e/2);e%2==0?(h(a[t][i+1]),h(a[t+1][i]),h(a[t][i])):(h(a[t][i+1]),h(a[t+1][i+1]),h(a[t+1][i]))}}function h(t){r.push(t.x,t.y,t.z)}function o(e,i){let s=3*e;i.x=t[s+0],i.y=t[s+1],i.z=t[s+2]}function l(t,e,i,s){s<0&&1===t.x&&(a[e]=t.x-1),0===i.x&&0===i.z&&(a[e]=s/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}function c(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}(function(t){let i=new es,s=new es,r=new es;for(let a=0;a<e.length;a+=3)o(e[a+0],i),o(e[a+1],s),o(e[a+2],r),n(i,s,r,t)})(s),function(t){let e=new es;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){let t=new es;for(let e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];let i=u(t)/2/Math.PI+.5,s=c(t)/Math.PI+.5;a.push(i,1-s)}(function(){let t=new es,e=new es,i=new es,s=new es,n=new $i,h=new $i,o=new $i;for(let c=0,p=0;c<r.length;c+=9,p+=6){t.set(r[c+0],r[c+1],r[c+2]),e.set(r[c+3],r[c+4],r[c+5]),i.set(r[c+6],r[c+7],r[c+8]),n.set(a[p+0],a[p+1]),h.set(a[p+2],a[p+3]),o.set(a[p+4],a[p+5]),s.copy(t).add(e).add(i).divideScalar(3);let d=u(s);l(n,p+0,t,d),l(h,p+2,e,d),l(o,p+4,i,d)}})(),function(){for(let t=0;t<a.length;t+=6){let e=a[t+0],i=a[t+2],s=a[t+4],r=Math.max(e,i,s),n=Math.min(e,i,s);r>.9&&n<.1&&(e<.2&&(a[t+0]+=1),i<.2&&(a[t+2]+=1),s<.2&&(a[t+4]+=1))}}()}(),this.setAttribute("position",new Qr(r,3)),this.setAttribute("normal",new Qr(r.slice(),3)),this.setAttribute("uv",new Qr(a,2)),0===s?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Xn(t.vertices,t.indices,t.radius,t.detail)}},Yn=class extends Xn{constructor(t=1,e=0){let i=(1+Math.sqrt(5))/2,s=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Yn(t.radius,t.detail)}},Zn=class{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){Ni("Curve: .getPoint() not implemented.")}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e,i=[],s=this.getPoint(0),r=0;i.push(0);for(let a=1;a<=t;a++)e=this.getPoint(a/t),r+=e.distanceTo(s),i.push(r),s=e;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let i,s=this.getLengths(),r=0,a=s.length;i=e||t*s[a-1];let n,h=0,o=a-1;for(;h<=o;)if(r=Math.floor(h+(o-h)/2),n=s[r]-i,n<0)h=r+1;else{if(!(n>0)){o=r;break}o=r-1}if(r=o,s[r]===i)return r/(a-1);let l=s[r];return(r+(i-l)/(s[r+1]-l))/(a-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);let r=this.getPoint(i),a=this.getPoint(s),n=e||(r.isVector2?new $i:new es);return n.copy(a).sub(r).normalize(),n}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){let i=new es,s=[],r=[],a=[],n=new es,h=new Ts;for(let e=0;e<=t;e++){let i=e/t;s[e]=this.getTangentAt(i,new es)}r[0]=new es,a[0]=new es;let o=Number.MAX_VALUE,l=Math.abs(s[0].x),u=Math.abs(s[0].y),c=Math.abs(s[0].z);l<=o&&(o=l,i.set(1,0,0)),u<=o&&(o=u,i.set(0,1,0)),c<=o&&i.set(0,0,1),n.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],n),a[0].crossVectors(s[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),a[e]=a[e-1].clone(),n.crossVectors(s[e-1],s[e]),n.length()>Number.EPSILON){n.normalize();let t=Math.acos(qi(s[e-1].dot(s[e]),-1,1));r[e].applyMatrix4(h.makeRotationAxis(n,t))}a[e].crossVectors(s[e],r[e])}if(!0===e){let e=Math.acos(qi(r[0].dot(r[t]),-1,1));e/=t,s[0].dot(n.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(h.makeRotationAxis(s[i],e*i)),a[i].crossVectors(s[i],r[i])}return{tangents:s,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},Hn=class extends Zn{constructor(t=0,e=0,i=1,s=1,r=0,a=2*Math.PI,n=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=n,this.aRotation=h}getPoint(t,e=new $i){let i=e,s=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=s;for(;r>s;)r-=s;r<Number.EPSILON&&(r=a?0:s),!0===this.aClockwise&&!a&&(r===s?r=-s:r-=s);let n=this.aStartAngle+t*r,h=this.aX+this.xRadius*Math.cos(n),o=this.aY+this.yRadius*Math.sin(n);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=h-this.aX,s=o-this.aY;h=i*t-s*e+this.aX,o=i*e+s*t+this.aY}return i.set(h,o)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}};function Gn(){let t=0,e=0,i=0,s=0;function r(r,a,n,h){t=r,e=n,i=-3*r+3*a-2*n-h,s=2*r-2*a+n+h}return{initCatmullRom:function(t,e,i,s,a){r(e,i,a*(i-t),a*(s-e))},initNonuniformCatmullRom:function(t,e,i,s,a,n,h){let o=(e-t)/a-(i-t)/(a+n)+(i-e)/n,l=(i-e)/n-(s-e)/(n+h)+(s-i)/h;o*=n,l*=n,r(e,i,o,l)},calc:function(r){let a=r*r;return t+e*r+i*a+s*(a*r)}}}var Qn=new es,$n=new es,Kn=new Gn,th=new Gn,eh=new Gn;function ih(t,e,i,s,r){let a=.5*(s-e),n=.5*(r-i),h=t*t;return(2*i-2*s+a+n)*(t*h)+(-3*i+3*s-2*a-n)*h+a*t+i}function sh(t,e,i,s){return function(t,e){let i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}function rh(t,e,i,s,r){return function(t,e){let i=1-t;return i*i*i*e}(t,e)+function(t,e){let i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,r)}var ah=class extends Zn{constructor(t=new $i,e=new $i,i=new $i,s=new $i){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new $i){let i=e,s=this.v0,r=this.v1,a=this.v2,n=this.v3;return i.set(rh(t,s.x,r.x,a.x,n.x),rh(t,s.y,r.y,a.y,n.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},nh=class extends Zn{constructor(t=new es,e=new es,i=new es,s=new es){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new es){let i=e,s=this.v0,r=this.v1,a=this.v2,n=this.v3;return i.set(rh(t,s.x,r.x,a.x,n.x),rh(t,s.y,r.y,a.y,n.y),rh(t,s.z,r.z,a.z,n.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},hh=class extends Zn{constructor(t=new $i,e=new $i){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new $i){let i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new $i){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},oh=class extends Zn{constructor(t=new es,e=new es){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new es){let i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new es){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},lh=class extends Zn{constructor(t=new $i,e=new $i,i=new $i){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new $i){let i=e,s=this.v0,r=this.v1,a=this.v2;return i.set(sh(t,s.x,r.x,a.x),sh(t,s.y,r.y,a.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},uh=class extends Zn{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new $i){let i=e,s=this.points,r=(s.length-1)*t,a=Math.floor(r),n=r-a,h=s[0===a?a:a-1],o=s[a],l=s[a>s.length-2?s.length-1:a+1],u=s[a>s.length-3?s.length-1:a+2];return i.set(ih(n,h.x,o.x,l.x,u.x),ih(n,h.y,o.y,l.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push((new $i).fromArray(i))}return this}},ch=Object.freeze({__proto__:null,ArcCurve:class extends Hn{constructor(t,e,i,s,r,a){super(t,e,i,i,s,r,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Zn{constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}getPoint(t,e=new es){let i,s,r=e,a=this.points,n=a.length,h=(n-(this.closed?0:1))*t,o=Math.floor(h),l=h-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===l&&o===n-1&&(o=n-2,l=1),this.closed||o>0?i=a[(o-1)%n]:($n.subVectors(a[0],a[1]).add(a[0]),i=$n);let u=a[o%n],c=a[(o+1)%n];if(this.closed||o+2<n?s=a[(o+2)%n]:(Qn.subVectors(a[n-1],a[n-2]).add(a[n-1]),s=Qn),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(i.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(c),t),a=Math.pow(c.distanceToSquared(s),t);r<1e-4&&(r=1),e<1e-4&&(e=r),a<1e-4&&(a=r),Kn.initNonuniformCatmullRom(i.x,u.x,c.x,s.x,e,r,a),th.initNonuniformCatmullRom(i.y,u.y,c.y,s.y,e,r,a),eh.initNonuniformCatmullRom(i.z,u.z,c.z,s.z,e,r,a)}else"catmullrom"===this.curveType&&(Kn.initCatmullRom(i.x,u.x,c.x,s.x,this.tension),th.initCatmullRom(i.y,u.y,c.y,s.y,this.tension),eh.initCatmullRom(i.z,u.z,c.z,s.z,this.tension));return r.set(Kn.calc(l),th.calc(l),eh.calc(l)),r}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push((new es).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:ah,CubicBezierCurve3:nh,EllipseCurve:Hn,LineCurve:hh,LineCurve3:oh,QuadraticBezierCurve:lh,QuadraticBezierCurve3:class extends Zn{constructor(t=new es,e=new es,i=new es){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new es){let i=e,s=this.v0,r=this.v1,a=this.v2;return i.set(sh(t,s.x,r.x,a.x),sh(t,s.y,r.y,a.y),sh(t,s.z,r.z,a.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},SplineCurve:uh}),ph=class extends Zn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new ch[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),s=this.getCurveLengths(),r=0;for(;r<s.length;){if(s[r]>=i){let t=s[r]-i,a=this.curves[r],n=a.getLength(),h=0===n?0:1-t/n;return a.getPointAt(h,e)}r++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let i=0,s=this.curves.length;i<s;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e,i=[];for(let s=0,r=this.curves;s<r.length;s++){let a=r[s],n=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,h=a.getPoints(n);for(let t=0;t<h.length;t++){let s=h[t];e&&e.equals(s)||(i.push(s),e=s)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push((new ch[i.type]).fromJSON(i))}return this}},dh=class extends ph{constructor(t){super(),this.type="Path",this.currentPoint=new $i,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new hh(this.currentPoint.clone(),new $i(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,s){let r=new lh(this.currentPoint.clone(),new $i(t,e),new $i(i,s));return this.curves.push(r),this.currentPoint.set(i,s),this}bezierCurveTo(t,e,i,s,r,a){let n=new ah(this.currentPoint.clone(),new $i(t,e),new $i(i,s),new $i(r,a));return this.curves.push(n),this.currentPoint.set(r,a),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),i=new uh(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,s,r,a){let n=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(t+n,e+h,i,s,r,a),this}absarc(t,e,i,s,r,a){return this.absellipse(t,e,i,i,s,r,a),this}ellipse(t,e,i,s,r,a,n,h){let o=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+o,e+l,i,s,r,a,n,h),this}absellipse(t,e,i,s,r,a,n,h){let o=new Hn(t,e,i,s,r,a,n,h);if(this.curves.length>0){let t=o.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(o);let l=o.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}},mh=class extends dh{constructor(t){super(t),this.uuid=Ji(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,s=this.holes.length;i<s;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push((new dh).fromJSON(i))}return this}};function yh(t,e,i,s,r){let a;if(r===function(t,e,i,s){let r=0;for(let a=e,n=i-s;a<i;a+=s)r+=(t[n]-t[a])*(t[a+1]+t[n+1]),n=a;return r}(t,e,i,s)>0)for(let r=e;r<i;r+=s)a=Eh(r/s|0,t[r],t[r+1],a);else for(let r=i-s;r>=e;r-=s)a=Eh(r/s|0,t[r],t[r+1],a);return a&&Bh(a,a.next)&&(Fh(a),a=a.next),a}function fh(t,e){if(!t)return t;e||(e=t);let i,s=t;do{if(i=!1,s.steiner||!Bh(s,s.next)&&0!==kh(s.prev,s,s.next))s=s.next;else{if(Fh(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function gh(t,e,i,s,r,a,n){if(!t)return;!n&&a&&function(t,e,i,s){let r=t;do{0===r.z&&(r.z=Ah(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i=1;do{let s,r=t;t=null;let a=null;for(e=0;r;){e++;let n=r,h=0;for(let t=0;t<i&&(h++,n=n.nextZ,n);t++);let o=i;for(;h>0||o>0&&n;)0!==h&&(0===o||!n||r.z<=n.z)?(s=r,r=r.nextZ,h--):(s=n,n=n.nextZ,o--),a?a.nextZ=s:t=s,s.prevZ=a,a=s;r=n}a.nextZ=null,i*=2}while(e>1)}(r)}(t,s,r,a);let h=t;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(a?vh(t,s,r,a):xh(t))e.push(o.i,t.i,l.i),Fh(t),t=l.next,h=l.next;else if((t=l)===h){n?1===n?gh(t=bh(fh(t),e),e,i,s,r,a,2):2===n&&Mh(t,e,i,s,r,a):gh(fh(t),e,i,s,r,a,1);break}}}function xh(t){let e=t.prev,i=t,s=t.next;if(kh(e,i,s)>=0)return!1;let r=e.x,a=i.x,n=s.x,h=e.y,o=i.y,l=s.y,u=Math.min(r,a,n),c=Math.min(h,o,l),p=Math.max(r,a,n),d=Math.max(h,o,l),m=s.next;for(;m!==e;){if(m.x>=u&&m.x<=p&&m.y>=c&&m.y<=d&&Ch(r,h,a,o,n,l,m.x,m.y)&&kh(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function vh(t,e,i,s){let r=t.prev,a=t,n=t.next;if(kh(r,a,n)>=0)return!1;let h=r.x,o=a.x,l=n.x,u=r.y,c=a.y,p=n.y,d=Math.min(h,o,l),m=Math.min(u,c,p),y=Math.max(h,o,l),f=Math.max(u,c,p),g=Ah(d,m,e,i,s),x=Ah(y,f,e,i,s),v=t.prevZ,b=t.nextZ;for(;v&&v.z>=g&&b&&b.z<=x;){if(v.x>=d&&v.x<=y&&v.y>=m&&v.y<=f&&v!==r&&v!==n&&Ch(h,u,o,c,l,p,v.x,v.y)&&kh(v.prev,v,v.next)>=0||(v=v.prevZ,b.x>=d&&b.x<=y&&b.y>=m&&b.y<=f&&b!==r&&b!==n&&Ch(h,u,o,c,l,p,b.x,b.y)&&kh(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=y&&v.y>=m&&v.y<=f&&v!==r&&v!==n&&Ch(h,u,o,c,l,p,v.x,v.y)&&kh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=d&&b.x<=y&&b.y>=m&&b.y<=f&&b!==r&&b!==n&&Ch(h,u,o,c,l,p,b.x,b.y)&&kh(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function bh(t,e){let i=t;do{let s=i.prev,r=i.next.next;!Bh(s,r)&&Oh(s,i,i.next,r)&&Rh(s,r)&&Rh(r,s)&&(e.push(s.i,i.i,r.i),Fh(i),Fh(i.next),i=t=r),i=i.next}while(i!==t);return fh(i)}function Mh(t,e,i,s,r,a){let n=t;do{let t=n.next.next;for(;t!==n.prev;){if(n.i!==t.i&&Ih(n,t)){let h=Vh(n,t);return n=fh(n,n.next),h=fh(h,h.next),gh(n,e,i,s,r,a,0),void gh(h,e,i,s,r,a,0)}t=t.next}n=n.next}while(n!==t)}function wh(t,e){let i=t.x-e.x;return 0===i&&(i=t.y-e.y,0===i)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function Sh(t,e){let i=function(t,e){let i,s=e,r=t.x,a=t.y,n=-1/0;if(Bh(t,s))return s;do{if(Bh(t,s.next))return s.next;if(a<=s.y&&a>=s.next.y&&s.next.y!==s.y){let t=s.x+(a-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=r&&t>n&&(n=t,i=s.x<s.next.x?s:s.next,t===r))return i}s=s.next}while(s!==e);if(!i)return null;let h=i,o=i.x,l=i.y,u=1/0;s=i;do{if(r>=s.x&&s.x>=o&&r!==s.x&&Th(a<l?r:n,a,o,l,a<l?n:r,a,s.x,s.y)){let e=Math.abs(a-s.y)/(r-s.x);Rh(s,t)&&(e<u||e===u&&(s.x>i.x||s.x===i.x&&_h(i,s)))&&(i=s,u=e)}s=s.next}while(s!==h);return i}(t,e);if(!i)return e;let s=Vh(i,t);return fh(s,s.next),fh(i,i.next)}function _h(t,e){return kh(t.prev,t,e.prev)<0&&kh(e.next,t,t.next)<0}function Ah(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zh(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Th(t,e,i,s,r,a,n,h){return(r-n)*(e-h)>=(t-n)*(a-h)&&(t-n)*(s-h)>=(i-n)*(e-h)&&(i-n)*(a-h)>=(r-n)*(s-h)}function Ch(t,e,i,s,r,a,n,h){return!(t===n&&e===h)&&Th(t,e,i,s,r,a,n,h)}function Ih(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Oh(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Rh(t,e)&&Rh(e,t)&&function(t,e){let i=t,s=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(kh(t.prev,t,e.prev)||kh(t,e.prev,e))||Bh(t,e)&&kh(t.prev,t,t.next)>0&&kh(e.prev,e,e.next)>0)}function kh(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Bh(t,e){return t.x===e.x&&t.y===e.y}function Oh(t,e,i,s){let r=Nh(kh(t,e,i)),a=Nh(kh(t,e,s)),n=Nh(kh(i,s,t)),h=Nh(kh(i,s,e));return!!(r!==a&&n!==h||0===r&&Ph(t,i,e)||0===a&&Ph(t,s,e)||0===n&&Ph(i,t,s)||0===h&&Ph(i,e,s))}function Ph(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Nh(t){return t>0?1:t<0?-1:0}function Rh(t,e){return kh(t.prev,t,t.next)<0?kh(t,e,t.next)>=0&&kh(t,t.prev,e)>=0:kh(t,e,t.prev)<0||kh(t,t.next,e)<0}function Vh(t,e){let i=Lh(t.i,t.x,t.y),s=Lh(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,a.next=s,s.prev=a,s}function Eh(t,e,i,s){let r=Lh(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function Fh(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Lh(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var Dh=class{static triangulate(t,e,i=2){return function(t,e,i=2){let s,r,a,n=e&&e.length,h=n?e[0]*i:t.length,o=yh(t,0,h,i,!0),l=[];if(!o||o.next===o.prev)return l;if(n&&(o=function(t,e,i,s){let r=[];for(let i=0,a=e.length;i<a;i++){let n=yh(t,e[i]*s,i<a-1?e[i+1]*s:t.length,s,!1);n===n.next&&(n.steiner=!0),r.push(zh(n))}r.sort(wh);for(let t=0;t<r.length;t++)i=Sh(r[t],i);return i}(t,e,o,i)),t.length>80*i){s=t[0],r=t[1];let e=s,n=r;for(let a=i;a<h;a+=i){let i=t[a],h=t[a+1];i<s&&(s=i),h<r&&(r=h),i>e&&(e=i),h>n&&(n=h)}a=Math.max(e-s,n-r),a=0!==a?32767/a:0}return gh(o,l,i,s,r,a,0),l}(t,e,i)}},Wh=class{static area(t){let e=t.length,i=0;for(let s=e-1,r=0;r<e;s=r++)i+=t[s].x*t[r].y-t[r].x*t[s].y;return.5*i}static isClockWise(t){return Wh.area(t)<0}static triangulateShape(t,e){let i=[],s=[],r=[];Uh(t),jh(i,t);let a=t.length;e.forEach(Uh);for(let t=0;t<e.length;t++)s.push(a),a+=e[t].length,jh(i,e[t]);let n=Dh.triangulate(i,s);for(let t=0;t<n.length;t+=3)r.push(n.slice(t,t+3));return r}};function Uh(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function jh(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}var Jh=class extends Xn{constructor(t=1,e=0){let i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Jh(t.radius,t.detail)}},qh=class extends la{constructor(t=[new $i(0,-.5),new $i(.5,0),new $i(0,.5)],e=12,i=0,s=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:s},e=Math.floor(e),s=qi(s,0,2*Math.PI);let r=[],a=[],n=[],h=[],o=[],l=1/e,u=new es,c=new $i,p=new es,d=new es,m=new es,y=0,f=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:y=t[e+1].x-t[e].x,f=t[e+1].y-t[e].y,p.x=1*f,p.y=-y,p.z=0*f,m.copy(p),p.normalize(),h.push(p.x,p.y,p.z);break;case t.length-1:h.push(m.x,m.y,m.z);break;default:y=t[e+1].x-t[e].x,f=t[e+1].y-t[e].y,p.x=1*f,p.y=-y,p.z=0*f,d.copy(p),p.x+=m.x,p.y+=m.y,p.z+=m.z,p.normalize(),h.push(p.x,p.y,p.z),m.copy(d)}for(let r=0;r<=e;r++){let p=i+r*l*s,d=Math.sin(p),m=Math.cos(p);for(let i=0;i<=t.length-1;i++){u.x=t[i].x*d,u.y=t[i].y,u.z=t[i].x*m,a.push(u.x,u.y,u.z),c.x=r/e,c.y=i/(t.length-1),n.push(c.x,c.y);let s=h[3*i+0]*d,l=h[3*i+1],p=h[3*i+0]*m;o.push(s,l,p)}}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){let s=e+i*t.length,a=s,n=s+t.length,h=s+t.length+1,o=s+1;r.push(a,n,o),r.push(h,o,n)}this.setIndex(r),this.setAttribute("position",new Qr(a,3)),this.setAttribute("uv",new Qr(n,2)),this.setAttribute("normal",new Qr(o,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new qh(t.points,t.segments,t.phiStart,t.phiLength)}},Xh=class extends la{constructor(t=1,e=1,i=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:s};let r=t/2,a=e/2,n=Math.floor(i),h=Math.floor(s),o=n+1,l=h+1,u=t/n,c=e/h,p=[],d=[],m=[],y=[];for(let t=0;t<l;t++){let e=t*c-a;for(let i=0;i<o;i++){let s=i*u-r;d.push(s,-e,0),m.push(0,0,1),y.push(i/n),y.push(1-t/h)}}for(let t=0;t<h;t++)for(let e=0;e<n;e++){let i=e+o*t,s=e+o*(t+1),r=e+1+o*(t+1),a=e+1+o*t;p.push(i,s,a),p.push(s,r,a)}this.setIndex(p),this.setAttribute("position",new Qr(d,3)),this.setAttribute("normal",new Qr(m,3)),this.setAttribute("uv",new Qr(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Xh(t.width,t.height,t.widthSegments,t.heightSegments)}},Yh=class extends la{constructor(t=1,e=32,i=16,s=0,r=2*Math.PI,a=0,n=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:s,phiLength:r,thetaStart:a,thetaLength:n},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));let h=Math.min(a+n,Math.PI),o=0,l=[],u=new es,c=new es,p=[],d=[],m=[],y=[];for(let p=0;p<=i;p++){let f=[],g=p/i,x=a+g*n,v=t*Math.cos(x),b=Math.sqrt(t*t-v*v),M=0;0===p&&0===a?M=.5/e:p===i&&h===Math.PI&&(M=-.5/e);for(let t=0;t<=e;t++){let i=t/e,a=s+i*r;u.x=-b*Math.cos(a),u.y=v,u.z=b*Math.sin(a),d.push(u.x,u.y,u.z),c.copy(u).normalize(),m.push(c.x,c.y,c.z),y.push(i+M,1-g),f.push(o++)}l.push(f)}for(let t=0;t<i;t++)for(let s=0;s<e;s++){let e=l[t][s+1],r=l[t][s],n=l[t+1][s],o=l[t+1][s+1];(0!==t||a>0)&&p.push(e,r,o),(t!==i-1||h<Math.PI)&&p.push(r,n,o)}this.setIndex(p),this.setAttribute("position",new Qr(d,3)),this.setAttribute("normal",new Qr(m,3)),this.setAttribute("uv",new Qr(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Yh(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},Zh=class extends la{constructor(t=1,e=.4,i=12,s=48,r=2*Math.PI,a=0,n=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:s,arc:r,thetaStart:a,thetaLength:n},i=Math.floor(i),s=Math.floor(s);let h=[],o=[],l=[],u=[],c=new es,p=new es,d=new es;for(let h=0;h<=i;h++){let m=a+h/i*n;for(let a=0;a<=s;a++){let n=a/s*r;p.x=(t+e*Math.cos(m))*Math.cos(n),p.y=(t+e*Math.cos(m))*Math.sin(n),p.z=e*Math.sin(m),o.push(p.x,p.y,p.z),c.x=t*Math.cos(n),c.y=t*Math.sin(n),d.subVectors(p,c).normalize(),l.push(d.x,d.y,d.z),u.push(a/s),u.push(h/i)}}for(let t=1;t<=i;t++)for(let e=1;e<=s;e++){let i=(s+1)*t+e-1,r=(s+1)*(t-1)+e-1,a=(s+1)*(t-1)+e,n=(s+1)*t+e;h.push(i,r,n),h.push(r,a,n)}this.setIndex(h),this.setAttribute("position",new Qr(o,3)),this.setAttribute("normal",new Qr(l,3)),this.setAttribute("uv",new Qr(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Zh(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}},Hh=class extends la{constructor(t=1,e=.4,i=64,s=8,r=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:s,p:r,q:a},i=Math.floor(i),s=Math.floor(s);let n=[],h=[],o=[],l=[],u=new es,c=new es,p=new es,d=new es,m=new es,y=new es,f=new es;for(let n=0;n<=i;++n){let x=n/i*r*Math.PI*2;g(x,r,a,t,p),g(x+.01,r,a,t,d),y.subVectors(d,p),f.addVectors(d,p),m.crossVectors(y,f),f.crossVectors(m,y),m.normalize(),f.normalize();for(let t=0;t<=s;++t){let r=t/s*Math.PI*2,a=-e*Math.cos(r),d=e*Math.sin(r);u.x=p.x+(a*f.x+d*m.x),u.y=p.y+(a*f.y+d*m.y),u.z=p.z+(a*f.z+d*m.z),h.push(u.x,u.y,u.z),c.subVectors(u,p).normalize(),o.push(c.x,c.y,c.z),l.push(n/i),l.push(t/s)}}for(let t=1;t<=i;t++)for(let e=1;e<=s;e++){let i=(s+1)*(t-1)+(e-1),r=(s+1)*t+(e-1),a=(s+1)*t+e,h=(s+1)*(t-1)+e;n.push(i,r,h),n.push(r,a,h)}function g(t,e,i,s,r){let a=Math.cos(t),n=Math.sin(t),h=i/e*t,o=Math.cos(h);r.x=s*(2+o)*.5*a,r.y=s*(2+o)*n*.5,r.z=s*Math.sin(h)*.5}this.setIndex(n),this.setAttribute("position",new Qr(h,3)),this.setAttribute("normal",new Qr(o,3)),this.setAttribute("uv",new Qr(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Hh(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}},Gh=class extends ma{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new nr(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}};function Qh(t){let e={};for(let i in t){e[i]={};for(let s in t[i]){let r=t[i][s];if(Kh(r))r.isRenderTargetTexture?(Ni("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=r.clone();else if(Array.isArray(r))if(Kh(r[0])){let t=[];for(let e=0,i=r.length;e<i;e++)t[e]=r[e].clone();e[i][s]=t}else e[i][s]=r.slice();else e[i][s]=r}}return e}function $h(t){let e={};for(let i=0;i<t.length;i++){let s=Qh(t[i]);for(let t in s)e[t]=s[t]}return e}function Kh(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}function to(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:ls.workingColorSpace}var eo={clone:Qh,merge:$h},io=class extends ma{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Qh(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let s=this.uniforms[i].value;s&&s.isTexture?e.uniforms[i]={type:"t",value:s.toJSON(t).uuid}:s&&s.isColor?e.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?e.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?e.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?e.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?e.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?e.uniforms[i]={type:"m4",value:s.toArray()}:e.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}fromJSON(t,e){if(super.fromJSON(t,e),void 0!==t.uniforms)for(let i in t.uniforms){let s=t.uniforms[i];switch(this.uniforms[i]={},s.type){case"t":this.uniforms[i].value=e[s.value]||null;break;case"c":this.uniforms[i].value=(new nr).setHex(s.value);break;case"v2":this.uniforms[i].value=(new $i).fromArray(s.value);break;case"v3":this.uniforms[i].value=(new es).fromArray(s.value);break;case"v4":this.uniforms[i].value=(new Ms).fromArray(s.value);break;case"m3":this.uniforms[i].value=(new as).fromArray(s.value);break;case"m4":this.uniforms[i].value=(new Ts).fromArray(s.value);break;default:this.uniforms[i].value=s.value}}if(void 0!==t.defines&&(this.defines=t.defines),void 0!==t.vertexShader&&(this.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(this.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(this.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)this.extensions[e]=t.extensions[e];return void 0!==t.lights&&(this.lights=t.lights),void 0!==t.clipping&&(this.clipping=t.clipping),this}},so=class extends io{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}},ro=class extends ma{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new nr(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 nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(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 Es,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},ao=class extends ro{constructor(t){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 $i(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return qi(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 nr(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 nr(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new nr(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(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}},no=class extends ma{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new nr(16777215),this.specular=new nr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Es,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},ho=class extends ma{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new nr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},oo=class extends ma{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}},lo=class extends ma{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new nr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Es,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},uo=class extends ma{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},co=class extends ma{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},po=class extends ma{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new nr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this.fog=t.fog,this}},mo=class extends Sn{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}};function yo(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function fo(t){let e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}function go(t,e,i){let s=t.length,r=new t.constructor(s);for(let a=0,n=0;n!==s;++a){let s=i[a]*e;for(let i=0;i!==e;++i)r[n++]=t[s+i]}return r}var xo=class{constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==s?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],r=e[i-1];t:{e:{let a;i:{s:if(!(t<s)){for(let a=i+2;;){if(void 0===s){if(t<r)break s;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(r=s,s=e[++i],t<s)break e}a=e.length;break i}if(!(t>=r)){let n=e[1];t<n&&(i=2,r=n);for(let a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===a)break;if(s=r,r=e[--i-1],t>=r)break e}a=i,i=0;break i}break t}for(;i<a;){let s=i+a>>>1;t<e[s]?a=s:i=s+1}if(s=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===s)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,s)}return this.interpolate_(i,r,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=t*s;for(let t=0;t!==s;++t)e[t]=i[r+t];return e}interpolate_(){throw new Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}},vo=class extends xo{constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Oe,endingEnd:Oe}}intervalChanged_(t,e,i){let s=this.parameterPositions,r=t-2,a=t+1,n=s[r],h=s[a];if(void 0===n)switch(this.getSettings_().endingStart){case Pe:r=t,n=2*e-i;break;case Ne:r=s.length-2,n=e+s[r]-s[r+1];break;default:r=t,n=i}if(void 0===h)switch(this.getSettings_().endingEnd){case Pe:a=t,h=2*i-e;break;case Ne:a=1,h=i+s[1]-s[0];break;default:a=t-1,h=e}let o=.5*(i-e),l=this.valueSize;this._weightPrev=o/(e-n),this._weightNext=o/(h-i),this._offsetPrev=r*l,this._offsetNext=a*l}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,p=this._weightNext,d=(i-e)/(s-e),m=d*d,y=m*d,f=-c*y+2*c*m-c*d,g=(1+c)*y+(-1.5-2*c)*m+(-.5+c)*d+1,x=(-1-p)*y+(1.5+p)*m+.5*d,v=p*y-p*m;for(let t=0;t!==n;++t)r[t]=f*a[l+t]+g*a[o+t]+x*a[h+t]+v*a[u+t];return r}},bo=class extends xo{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=(i-e)/(s-e),u=1-l;for(let t=0;t!==n;++t)r[t]=a[o+t]*u+a[h+t]*l;return r}},Mo=class extends xo{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t){return this.copySampleValue_(t-1)}},wo=class extends xo{interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=this.inTangents,u=this.outTangents;if(!l||!u){let t=(i-e)/(s-e),l=1-t;for(let e=0;e!==n;++e)r[e]=a[o+e]*l+a[h+e]*t;return r}let c=2*n,p=t-1;for(let d=0;d!==n;++d){let n,m,y,f,g,x=a[o+d],v=a[h+d],b=p*c+2*d,M=u[b],w=u[b+1],S=t*c+2*d,_=l[S],A=l[S+1],z=(i-e)/(s-e);for(let t=0;t<8;t++){n=z*z,m=n*z,y=1-z,f=y*y,g=f*y;let t=g*e+3*f*z*M+3*y*n*_+m*s-i;if(Math.abs(t)<1e-10)break;let r=3*f*(M-e)+6*y*z*(_-M)+3*n*(s-_);if(Math.abs(r)<1e-10)break;z-=t/r,z=Math.max(0,Math.min(1,z))}r[d]=g*x+3*f*z*w+3*y*n*A+m*v}return r}},So=class{constructor(t,e,i,s){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=yo(e,this.TimeBufferType),this.values=yo(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:yo(t.times,Array),values:yo(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new Mo(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new bo(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new vo(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new wo(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.inTangents=this.settings.inTangents,e.outTangents=this.settings.outTangents),e}setInterpolation(t){let e;switch(t){case Ie:e=this.InterpolantFactoryMethodDiscrete;break;case ke:e=this.InterpolantFactoryMethodLinear;break;case Be:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return Ni("KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ie;case this.InterpolantFactoryMethodLinear:return ke;case this.InterpolantFactoryMethodSmooth:return Be;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t}return this}trim(t,e){let i=this.times,s=i.length,r=0,a=s-1;for(;r!==s&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;if(++a,0!==r||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);let t=this.getValueSize();this.times=i.slice(r,a),this.values=this.values.slice(r*t,a*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(Ri("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,s=this.values,r=i.length;0===r&&(Ri("KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let e=0;e!==r;e++){let s=i[e];if("number"==typeof s&&isNaN(s)){Ri("KeyframeTrack: Time is not a valid number.",this,e,s),t=!1;break}if(null!==a&&a>s){Ri("KeyframeTrack: Out of order keys.",this,e,s,a),t=!1;break}a=s}if(void 0!==s&&Ci(s))for(let e=0,i=s.length;e!==i;++e){let i=s[e];if(isNaN(i)){Ri("KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Be,r=t.length-1,a=1;for(let n=1;n<r;++n){let r=!1,h=t[n];if(h!==t[n+1]&&(1!==n||h!==t[0]))if(s)r=!0;else{let t=n*i,s=t-i,a=t+i;for(let n=0;n!==i;++n){let i=e[t+n];if(i!==e[s+n]||i!==e[a+n]){r=!0;break}}}if(r){if(n!==a){t[a]=t[n];let s=n*i,r=a*i;for(let t=0;t!==i;++t)e[r+t]=e[s+t]}++a}}if(r>0){t[a]=t[r];for(let t=r*i,s=a*i,n=0;n!==i;++n)e[s+n]=e[t+n];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};So.prototype.ValueTypeName="",So.prototype.TimeBufferType=Float32Array,So.prototype.ValueBufferType=Float32Array,So.prototype.DefaultInterpolation=ke;var _o=class extends So{constructor(t,e,i){super(t,e,i)}};_o.prototype.ValueTypeName="bool",_o.prototype.ValueBufferType=Array,_o.prototype.DefaultInterpolation=Ie,_o.prototype.InterpolantFactoryMethodLinear=void 0,_o.prototype.InterpolantFactoryMethodSmooth=void 0;var Ao=class extends So{constructor(t,e,i,s){super(t,e,i,s)}};Ao.prototype.ValueTypeName="color";var zo=class extends So{constructor(t,e,i,s){super(t,e,i,s)}};zo.prototype.ValueTypeName="number";var To=class extends xo{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=(i-e)/(s-e),o=t*n;for(let t=o+n;o!==t;o+=4)Ki.slerpFlat(r,0,a,o-n,a,o,h);return r}},Co=class extends So{constructor(t,e,i,s){super(t,e,i,s)}InterpolantFactoryMethodLinear(t){return new To(this.times,this.values,this.getValueSize(),t)}};Co.prototype.ValueTypeName="quaternion",Co.prototype.InterpolantFactoryMethodSmooth=void 0;var Io=class extends So{constructor(t,e,i){super(t,e,i)}};Io.prototype.ValueTypeName="string",Io.prototype.ValueBufferType=Array,Io.prototype.DefaultInterpolation=Ie,Io.prototype.InterpolantFactoryMethodLinear=void 0,Io.prototype.InterpolantFactoryMethodSmooth=void 0;var ko=class extends So{constructor(t,e,i,s){super(t,e,i,s)}};ko.prototype.ValueTypeName="vector";var Bo=class{constructor(t="",e=-1,i=[],s=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=Ji(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,s=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(Oo(i[t]).scale(s));let r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r.userData=JSON.parse(t.userData||"{}"),r}static toJSON(t){let e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,s=i.length;t!==s;++t)e.push(So.toJSON(i[t]));return s}static CreateFromMorphTargetSequence(t,e,i,s){let r=e.length,a=[];for(let t=0;t<r;t++){let n=[],h=[];n.push((t+r-1)%r,t,(t+1)%r),h.push(0,1,0);let o=fo(n);n=go(n,1,o),h=go(h,1,o),!s&&0===n[0]&&(n.push(r),h.push(h[0])),a.push(new zo(".morphTargetInfluences["+e[t].name+"]",n,h).scale(1/i))}return new this(t,-1,a)}static findByName(t,e){let i=t;if(!Array.isArray(t)){let e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){let s={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.name.match(r);if(a&&a.length>1){let t=a[1],e=s[t];e||(s[t]=e=[]),e.push(i)}}let a=[];for(let t in s)a.push(this.CreateFromMorphTargetSequence(t,s[t],e,i));return a}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){let i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}};function Oo(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return zo;case"vector":case"vector2":case"vector3":case"vector4":return ko;case"color":return Ao;case"quaternion":return Co;case"bool":case"boolean":return _o;case"string":return Io}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],i=[];(function(t,e,i,s){let r=1,a=t[0];for(;void 0!==a&&void 0===a[s];)a=t[r++];if(void 0===a)return;let n=a[s];if(void 0!==n)if(Array.isArray(n))do{n=a[s],void 0!==n&&(e.push(a.time),i.push(...n)),a=t[r++]}while(void 0!==a);else if(void 0!==n.toArray)do{n=a[s],void 0!==n&&(e.push(a.time),n.toArray(i,i.length)),a=t[r++]}while(void 0!==a);else do{n=a[s],void 0!==n&&(e.push(a.time),i.push(n)),a=t[r++]}while(void 0!==a)})(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}var Po={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(No(t)||(this.files[t]=e))},get:function(t){if(!1!==this.enabled&&!No(t))return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function No(t){try{let e=t.slice(t.indexOf(":")+1);return"blob:"===new URL(e).protocol}catch{return!1}}var Ro=class{constructor(t,e,i){let s,r=this,a=!1,n=0,h=0,o=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(t){h++,!1===a&&void 0!==r.onStart&&r.onStart(t,n,h),a=!0},this.itemEnd=function(t){n++,void 0!==r.onProgress&&r.onProgress(t,n,h),n===h&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return t=t.normalize("NFC"),s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return o.push(t,e),this},this.removeHandler=function(t){let e=o.indexOf(t);return-1!==e&&o.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=o.length;e<i;e+=2){let i=o[e],s=o[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return s}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}},Vo=new Ro,Eo=class{constructor(t){this.manager=void 0!==t?t:Vo,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){let i=this;return new Promise(function(s,r){i.load(t,s,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}};Eo.DEFAULT_MATERIAL_NAME="__DEFAULT";var Fo={},Lo=class extends Error{constructor(t,e){super(t),this.response=e}},Do=class extends Eo{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,i,s){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=Po.get(`file:${t}`);if(void 0!==r)return this.manager.itemStart(t),void setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0);if(void 0!==Fo[t])return void Fo[t].push({onLoad:e,onProgress:i,onError:s});Fo[t]=[],Fo[t].push({onLoad:e,onProgress:i,onError:s});let a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),n=this.mimeType,h=this.responseType;fetch(a).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&Ni("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||void 0===e.body||void 0===e.body.getReader)return e;let i=Fo[t],s=e.body.getReader(),r=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),a=r?parseInt(r):0,n=0!==a,h=0,o=new ReadableStream({start(t){!function e(){s.read().then(({done:s,value:r})=>{if(s)t.close();else{h+=r.byteLength;let s=new ProgressEvent("progress",{lengthComputable:n,loaded:h,total:a});for(let t=0,e=i.length;t<e;t++){let e=i[t];e.onProgress&&e.onProgress(s)}t.enqueue(r),e()}},e=>{t.error(e)})}()}});return new Response(o)}throw new Lo(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(h){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,n));case"json":return t.json();default:if(""===n)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(n),i=e&&e[1]?e[1].toLowerCase():void 0,s=new TextDecoder(i);return t.arrayBuffer().then(t=>s.decode(t))}}}).then(e=>{Po.add(`file:${t}`,e);let i=Fo[t];delete Fo[t];for(let t=0,s=i.length;t<s;t++){let s=i[t];s.onLoad&&s.onLoad(e)}}).catch(e=>{let i=Fo[t];if(void 0===i)throw this.manager.itemError(t),e;delete Fo[t];for(let t=0,s=i.length;t<s;t++){let s=i[t];s.onError&&s.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Wo=new WeakMap,Uo=class extends Eo{constructor(t){super(t)}load(t,e,i,s){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,a=Po.get(`image:${t}`);if(void 0!==a){if(!0===a.complete)r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0);else{let t=Wo.get(a);void 0===t&&(t=[],Wo.set(a,t)),t.push({onLoad:e,onError:s})}return a}let n=Ii("img");function h(){l(),e&&e(this);let i=Wo.get(this)||[];for(let t=0;t<i.length;t++){let e=i[t];e.onLoad&&e.onLoad(this)}Wo.delete(this),r.manager.itemEnd(t)}function o(e){l(),s&&s(e),Po.remove(`image:${t}`);let i=Wo.get(this)||[];for(let t=0;t<i.length;t++){let s=i[t];s.onError&&s.onError(e)}Wo.delete(this),r.manager.itemError(t),r.manager.itemEnd(t)}function l(){n.removeEventListener("load",h,!1),n.removeEventListener("error",o,!1)}return n.addEventListener("load",h,!1),n.addEventListener("error",o,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(n.crossOrigin=this.crossOrigin),Po.add(`image:${t}`,n),r.manager.itemStart(t),n.src=t,n}},jo=class extends Eo{constructor(t){super(t)}load(t,e,i,s){let r=this,a=new Ka,n=new Do(this.manager);return n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setPath(this.path),n.setWithCredentials(r.withCredentials),n.load(t,function(t){let i;try{i=r.parse(t)}catch(t){return void(void 0!==s?s(t):Ri(t))}r._applyTexData(a,i),e&&e(a,i)},i,s),a}createDataTexture(t){let e=new Ka;return this._applyTexData(e,this.parse(t)),e}_applyTexData(t,e){void 0!==e.image?t.image=e.image:void 0!==e.data&&(t.image.width=e.width,t.image.height=e.height,t.image.data=e.data),t.wrapS=void 0!==e.wrapS?e.wrapS:ct,t.wrapT=void 0!==e.wrapT?e.wrapT:ct,t.magFilter=void 0!==e.magFilter?e.magFilter:ft,t.minFilter=void 0!==e.minFilter?e.minFilter:ft,t.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.mipmaps&&(t.mipmaps=e.mipmaps,t.minFilter=xt),1===e.mipmapCount&&(t.minFilter=ft),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),t.needsUpdate=!0}},Jo=class extends Eo{constructor(t){super(t)}load(t,e,i,s){let r=new vs,a=new Uo(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)},i,s),r}},qo=class extends tr{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new nr(t),this.intensity=e}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}},Xo=class extends qo{constructor(t,e,i){super(t,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(tr.DEFAULT_UP),this.updateMatrix(),this.groundColor=new nr(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}toJSON(t){let e=super.toJSON(t);return e.object.groundColor=this.groundColor.getHex(),e}},Yo=new Ts,Zo=new es,Ho=new es,Go=class{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new $i(512,512),this.mapType=bt,this.map=null,this.mapPass=null,this.matrix=new Ts,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new bn,this._frameExtents=new $i(1,1),this._viewportCount=1,this._viewports=[new Ms(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,i=this.matrix;Zo.setFromMatrixPosition(t.matrixWorld),e.position.copy(Zo),Ho.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Ho),e.updateMatrixWorld(),Yo.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yo,e.coordinateSystem,e.reversedDepth),e.coordinateSystem===Mi||e.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Yo)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return(new this.constructor).copy(this)}toJSON(){let t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}},Qo=new es,$o=new Ki,Ko=new es,tl=class extends tr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ts,this.projectionMatrix=new Ts,this.projectionMatrixInverse=new Ts,this.coordinateSystem=bi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(Qo,$o,Ko),1===Ko.x&&1===Ko.y&&1===Ko.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Qo,$o,Ko.set(1,1,1)).invert()}updateWorldMatrix(t,e,i=!1){super.updateWorldMatrix(t,e,i),this.matrixWorld.decompose(Qo,$o,Ko),1===Ko.x&&1===Ko.y&&1===Ko.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Qo,$o,Ko.set(1,1,1)).invert()}clone(){return(new this.constructor).copy(this)}},el=new es,il=new $i,sl=new $i,rl=class extends tl{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*ji*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*Ui*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ji*Math.atan(Math.tan(.5*Ui*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){el.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(el.x,el.y).multiplyScalar(-t/el.z),el.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(el.x,el.y).multiplyScalar(-t/el.z)}getViewSize(t,e){return this.getViewBounds(t,il,sl),e.subVectors(sl,il)}setViewOffset(t,e,i,s,r,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*Ui*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,a=this.view;if(null!==this.view&&this.view.enabled){let t=a.fullWidth,n=a.fullHeight;r+=a.offsetX*s/t,e-=a.offsetY*i/n,s*=a.width/t,i*=a.height/n}let n=this.filmOffset;0!==n&&(r+=t*n/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},al=class extends Go{constructor(){super(new rl(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,i=2*ji*t.angle*this.focus,s=this.mapSize.width/this.mapSize.height*this.aspect,r=t.distance||e.far;(i!==e.fov||s!==e.aspect||r!==e.far)&&(e.fov=i,e.aspect=s,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}},nl=class extends qo{constructor(t,e,i=0,s=Math.PI/3,r=0,a=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(tr.DEFAULT_UP),this.updateMatrix(),this.target=new tr,this.distance=i,this.angle=s,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new al}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}},hl=new es,ol=class extends Go{constructor(){super(new rl(90,1,.5,500)),this.isPointLightShadow=!0}updateMatrices(t){let e=this.camera,i=this.matrix,s=t.distance||e.far;s!==e.far&&(e.far=s,e.updateProjectionMatrix()),hl.setFromMatrixPosition(t.matrixWorld),e.position.copy(hl),i.makeTranslation(-hl.x,-hl.y,-hl.z)}},ll=class extends qo{constructor(t,e,i=0,s=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new ol}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}},ul=class extends tl{constructor(t=-1,e=1,i=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,s,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2,r=i-t,a=i+t,n=s+e,h=s-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,a=r+t*this.view.width,n-=e*this.view.offsetY,h=n-e*this.view.height}this.projectionMatrix.makeOrthographic(r,a,n,h,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}},cl=class extends Go{constructor(){super(new ul(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},pl=class extends qo{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tr.DEFAULT_UP),this.updateMatrix(),this.target=new tr,this.shadow=new cl}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}},dl=class extends qo{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},ml=class extends qo{constructor(t,e,i=10,s=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=s}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}},yl=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new es)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){let i=t.x,s=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScaledVector(a[1],.488603*s),e.addScaledVector(a[2],.488603*r),e.addScaledVector(a[3],.488603*i),e.addScaledVector(a[4],i*s*1.092548),e.addScaledVector(a[5],s*r*1.092548),e.addScaledVector(a[6],.315392*(3*r*r-1)),e.addScaledVector(a[7],i*r*1.092548),e.addScaledVector(a[8],.546274*(i*i-s*s)),e}getIrradianceAt(t,e){let i=t.x,s=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScaledVector(a[1],1.023328*s),e.addScaledVector(a[2],1.023328*r),e.addScaledVector(a[3],1.023328*i),e.addScaledVector(a[4],.858086*i*s),e.addScaledVector(a[5],.858086*s*r),e.addScaledVector(a[6],.743125*r*r-.247708),e.addScaledVector(a[7],.858086*i*r),e.addScaledVector(a[8],.429043*(i*i-s*s)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){let i=this.coefficients;for(let s=0;s<9;s++)i[s].fromArray(t,e+3*s);return this}toArray(t=[],e=0){let i=this.coefficients;for(let s=0;s<9;s++)i[s].toArray(t,e+3*s);return t}static getBasisAt(t,e){let i=t.x,s=t.y,r=t.z;e[0]=.282095,e[1]=.488603*s,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*s,e[5]=1.092548*s*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-s*s)}},fl=class extends qo{constructor(t=new yl,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}toJSON(t){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}},gl=class{static extractUrlBase(t){let e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}},xl=class extends la{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},vl=class extends Eo{constructor(t){super(t)}load(t,e,i,s){let r=this,a=new Do(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(t,function(i){try{e(r.parse(JSON.parse(i)))}catch(e){s?s(e):Ri(e),r.manager.itemError(t)}},i,s)}parse(t){let e={},i={};function s(t,s){if(void 0!==e[s])return e[s];let r=t.interleavedBuffers[s],a=function(t,e){if(void 0!==i[e])return i[e];let s=t.arrayBuffers[e],r=new Uint32Array(s).buffer;return i[e]=r,r}(t,r.buffer),n=Ti(r.type,a),h=new ua(n,r.stride);return h.uuid=r.uuid,e[s]=h,h}let r=t.isInstancedBufferGeometry?new xl:new la,a=t.data.index;if(void 0!==a){let t=Ti(a.type,a.array);r.setIndex(new Yr(t,1))}let n=t.data.attributes;for(let e in n){let i,a=n[e];if(a.isInterleavedBufferAttribute){let e=s(t.data,a.data);i=new pa(e,a.itemSize,a.offset,a.normalized)}else{let t=Ti(a.type,a.array);i=new(a.isInstancedBufferAttribute?rn:Yr)(t,a.itemSize,a.normalized)}void 0!==a.name&&(i.name=a.name),void 0!==a.usage&&i.setUsage(a.usage),r.setAttribute(e,i)}let h=t.data.morphAttributes;if(h)for(let e in h){let i=h[e],a=[];for(let e=0,r=i.length;e<r;e++){let r,n=i[e];if(n.isInterleavedBufferAttribute){let e=s(t.data,n.data);r=new pa(e,n.itemSize,n.offset,n.normalized)}else{let t=Ti(n.type,n.array);r=new Yr(t,n.itemSize,n.normalized)}void 0!==n.name&&(r.name=n.name),a.push(r)}r.morphAttributes[e]=a}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);let o=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==o)for(let t=0,e=o.length;t!==e;++t){let e=o[t];r.addGroup(e.start,e.count,e.materialIndex)}let l=t.data.boundingSphere;return void 0!==l&&(r.boundingSphere=(new ea).fromJSON(l)),t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}},bl=-90,Ml=class extends tr{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new rl(bl,1,t,e);s.layers=this.layers,this.add(s);let r=new rl(bl,1,t,e);r.layers=this.layers,this.add(r);let a=new rl(bl,1,t,e);a.layers=this.layers,this.add(a);let n=new rl(bl,1,t,e);n.layers=this.layers,this.add(n);let h=new rl(bl,1,t,e);h.layers=this.layers,this.add(h);let o=new rl(bl,1,t,e);o.layers=this.layers,this.add(o)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,a,n,h]=e;for(let t of e)this.remove(t);if(t===bi)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),n.up.set(0,1,0),n.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else{if(t!==Mi)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),n.up.set(0,-1,0),n.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1)}for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,n,h,o,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let y=!1;y=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(i,0,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,r),t.setRenderTarget(i,1,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(i,2,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(i,3,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),t.setRenderTarget(i,4,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}},wl=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(t){this._document=t,void 0!==t.hidden&&(this._pageVisibilityHandler=Sl.bind(this),t.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(t){return this._timescale=t,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(t){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==t?t:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function Sl(){!1===this._document.hidden&&this.reset()}var _l=class{constructor(t,e,i){let s,r,a;switch(this.binding=t,this.valueSize=i,e){case"quaternion":s=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":s=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:s=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){let i=this.buffer,s=this.valueSize,r=t*s+s,a=this.cumulativeWeight;if(0===a){for(let t=0;t!==s;++t)i[r+t]=i[t];a=e}else{a+=e;let t=e/a;this._mixBufferRegion(i,r,0,t,s)}this.cumulativeWeight=a}accumulateAdditive(t){let e=this.buffer,i=this.valueSize,s=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,s,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){let e=this.valueSize,i=this.buffer,s=t*e+e,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,n=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let t=e*this._origIndex;this._mixBufferRegion(i,s,t,1-r,e)}a>0&&this._mixBufferRegionAdditive(i,s,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){n.setValue(i,s);break}}saveOriginalState(){let t=this.binding,e=this.buffer,i=this.valueSize,s=i*this._origIndex;t.getValue(e,s);for(let t=i,r=s;t!==r;++t)e[t]=e[s+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,s,r){if(s>=.5)for(let s=0;s!==r;++s)t[e+s]=t[i+s]}_slerp(t,e,i,s){Ki.slerpFlat(t,e,t,e,t,i,s)}_slerpAdditive(t,e,i,s,r){let a=this._workIndex*r;Ki.multiplyQuaternionsFlat(t,a,t,e,t,i),Ki.slerpFlat(t,e,t,e,t,a,s)}_lerp(t,e,i,s,r){let a=1-s;for(let n=0;n!==r;++n){let r=e+n;t[r]=t[r]*a+t[i+n]*s}}_lerpAdditive(t,e,i,s,r){for(let a=0;a!==r;++a){let r=e+a;t[r]=t[r]+t[i+a]*s}}},Al="\\[\\]\\.:\\/",zl=new RegExp("["+Al+"]","g"),Tl="[^"+Al+"]",Cl="[^"+Al.replace("\\.","")+"]",Il=/((?:WC+[\/:])*)/.source.replace("WC",Tl),kl=/(WCOD+)?/.source.replace("WCOD",Cl),Bl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Tl),Ol=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Tl),Pl=new RegExp("^"+Il+kl+Bl+Ol+"$"),Nl=["material","materials","bones","map"],Rl=class{constructor(t,e,i){this.path=e,this.parsedPath=i||Rl.parseTrackName(e),this.node=Rl.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Rl.Composite(t,e,i):new Rl(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(zl,"")}static parseTrackName(t){let e=Pl.exec(t);if(null===e)throw new Error("THREE.PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s){let t=i.nodeName.substring(s+1);-1!==Nl.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){let i=function(t){for(let s=0;s<t.length;s++){let r=t[s];if(r.name===e||r.uuid===e)return r;let a=i(r.children);if(a)return a}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)t[e++]=i[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,s=e.propertyName,r=e.propertyIndex;if(t||(t=Rl.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void Ni("PropertyBinding: No target node found for track: "+this.path+".");if(i){let s=e.objectIndex;switch(i){case"materials":if(!t.material)return void Ri("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void Ri("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void Ri("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===s){s=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void Ri("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void Ri("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void Ri("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==s){if(void 0===t[s])return void Ri("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[s]}}let a=t[s];if(void 0===a)return void Ri("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+s+" but it wasn't found.",t);let n=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?n=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(n=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===s){if(!t.geometry)return void Ri("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void Ri("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}h=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(h=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=s;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][n]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Rl.Composite=class{constructor(t,e,i){let s=i||Rl.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];void 0!==s&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Rl.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Rl.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Rl.prototype.GetterByBindingType=[Rl.prototype._getValue_direct,Rl.prototype._getValue_array,Rl.prototype._getValue_arrayElement,Rl.prototype._getValue_toArray],Rl.prototype.SetterByBindingTypeAndVersioning=[[Rl.prototype._setValue_direct,Rl.prototype._setValue_direct_setNeedsUpdate,Rl.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Rl.prototype._setValue_array,Rl.prototype._setValue_array_setNeedsUpdate,Rl.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Rl.prototype._setValue_arrayElement,Rl.prototype._setValue_arrayElement_setNeedsUpdate,Rl.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Rl.prototype._setValue_fromArray,Rl.prototype._setValue_fromArray_setNeedsUpdate,Rl.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Vl=class{constructor(t,e,i=null,s=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=s;let r=e.tracks,a=r.length,n=new Array(a),h={endingStart:Oe,endingEnd:Oe};for(let t=0;t!==a;++t){let e=r[t].createInterpolant(null);n[t]=e,e.settings=h}this._interpolantSettings=h,this._interpolants=n,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i=!1){if(t.fadeOut(e),this.fadeIn(e),!0===i){let i=this._clip.duration,s=t._clip.duration,r=s/i,a=i/s;t._restoreTimeScale=t.timeScale,this._restoreTimeScale=this.timeScale,t.warp(1,r,e),this.warp(a,1,e)}return this}crossFadeTo(t,e,i=!1){return t.crossFadeFrom(this,e,i)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){let s=this._mixer,r=s.time,a=this.timeScale,n=this._timeScaleInterpolant;null===n&&(n=s._lendControlInterpolant(),this._timeScaleInterpolant=n);let h=n.parameterPositions,o=n.sampleValues;return h[0]=r,h[1]=r+i,o[0]=t/a,o[1]=e/a,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this._restoreTimeScale=null,this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,s){if(!this.enabled)return void this._updateWeight(t);let r=this._startTime;if(null!==r){let s=(t-r)*i;s<0||0===i?e=0:(this._startTime=null,e=i*s)}e*=this._updateTimeScale(t);let a=this._updateTime(e),n=this._updateWeight(t);if(n>0){let t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(a),e[i].accumulateAdditive(n);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(a),e[i].accumulate(s,n)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let i=this._weightInterpolant;if(null!==i){let s=i.evaluate(t)[0];e*=s,t>i.parameterPositions[1]&&(this.stopFading(),0===s&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(0===e?this.paused=!0:(null!==this._restoreTimeScale&&(e=this._restoreTimeScale),this.timeScale=e),this.stopWarping()))}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,i=this.loop,s=this.time+t,r=this._loopCount,a=2202===i;if(0===t)return-1===r||!a||1&~r?s:e-s;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(s>=e)s=e;else{if(!(s<0)){this.time=s;break t}s=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),s>=e||s<0){let i=Math.floor(s/e);s-=e*i,r+=Math.abs(i);let n=this.repetitions-r;if(n<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=t>0?e:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===n){let e=t<0;this._setEndings(e,!e,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this._loopCount=r,this.time=s;if(a&&!(1&~r))return e-s}return s}_setEndings(t,e,i){let s=this._interpolantSettings;i?(s.endingStart=Pe,s.endingEnd=Pe):(s.endingStart=t?this.zeroSlopeAtStart?Pe:Oe:Ne,s.endingEnd=e?this.zeroSlopeAtEnd?Pe:Oe:Ne)}_scheduleFading(t,e,i){let s=this._mixer,r=s.time,a=this._weightInterpolant;null===a&&(a=s._lendControlInterpolant(),this._weightInterpolant=a);let n=a.parameterPositions,h=a.sampleValues;return n[0]=r,h[0]=e,n[1]=r+t,h[1]=i,this}},El=new Float32Array(1),Fl=class extends Li{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(t,e){let i=t._localRoot||this._root,s=t._clip.tracks,r=s.length,a=t._propertyBindings,n=t._interpolants,h=i.uuid,o=this._bindingsByRootAndName,l=o[h];void 0===l&&(l={},o[h]=l);for(let t=0;t!==r;++t){let r=s[t],o=r.name,u=l[o];if(void 0!==u)++u.referenceCount,a[t]=u;else{if(u=a[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,h,o));continue}let s=e&&e._propertyBindings[t].binding.parsedPath;u=new _l(Rl.create(i,o,s),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,h,o),a[t]=u}n[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,i=t._clip.uuid,s=this._actionsByClip[i];this._bindAction(t,s&&s.knownActions[0]),this._addInactiveAction(t,i,e)}let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0===i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){let s=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{let e=a.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=s.length,s.push(t),a.actionByRoot[i]=t}_removeInactiveAction(t){let e=this._actions,i=e[e.length-1],s=t._cacheIndex;i._cacheIndex=s,e[s]=i,e.pop(),t._cacheIndex=null;let r=t._clip.uuid,a=this._actionsByClip,n=a[r],h=n.knownActions,o=h[h.length-1],l=t._byClipCacheIndex;o._byClipCacheIndex=l,h[l]=o,h.pop(),t._byClipCacheIndex=null,delete n.actionByRoot[(t._localRoot||this._root).uuid],0===h.length&&delete a[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0===--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){let e=this._actions,i=t._cacheIndex,s=this._nActiveActions++,r=e[s];t._cacheIndex=s,e[s]=t,r._cacheIndex=i,e[i]=r}_takeBackAction(t){let e=this._actions,i=t._cacheIndex,s=--this._nActiveActions,r=e[s];t._cacheIndex=s,e[s]=t,r._cacheIndex=i,e[i]=r}_addInactiveBinding(t,e,i){let s=this._bindingsByRootAndName,r=this._bindings,a=s[e];void 0===a&&(a={},s[e]=a),a[i]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){let e=this._bindings,i=t.binding,s=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,n=a[s],h=e[e.length-1],o=t._cacheIndex;h._cacheIndex=o,e[o]=h,e.pop(),delete n[r],0===Object.keys(n).length&&delete a[s]}_lendBinding(t){let e=this._bindings,i=t._cacheIndex,s=this._nActiveBindings++,r=e[s];t._cacheIndex=s,e[s]=t,r._cacheIndex=i,e[i]=r}_takeBackBinding(t){let e=this._bindings,i=t._cacheIndex,s=--this._nActiveBindings,r=e[s];t._cacheIndex=s,e[s]=t,r._cacheIndex=i,e[i]=r}_lendControlInterpolant(){let t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(i=new bo(new Float32Array(2),new Float32Array(2),1,El),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){let e=this._controlInterpolants,i=t.__cacheIndex,s=--this._nActiveControlInterpolants,r=e[s];t.__cacheIndex=s,e[s]=t,r.__cacheIndex=i,e[i]=r}clipAction(t,e,i){let s=e||this._root,r=s.uuid,a="string"==typeof t?Bo.findByName(s,t):t,n=null!==a?a.uuid:t,h=this._actionsByClip[n],o=null;if(void 0===i&&(i=null!==a?a.blendMode:2500),void 0!==h){let t=h.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;o=h.knownActions[0],null===a&&(a=o._clip)}if(null===a)return null;let l=new Vl(this,a,e,i);return this._bindAction(l,o),this._addInactiveAction(l,n,r),l}existingAction(t,e){let i=e||this._root,s=i.uuid,r="string"==typeof t?Bo.findByName(i,t):t,a=r?r.uuid:t,n=this._actionsByClip[a];return void 0!==n&&n.actionByRoot[s]||null}stopAllAction(){let t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;let e=this._actions,i=this._nActiveActions,s=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1;for(let n=0;n!==i;++n)e[n]._update(s,t,r,a);let n=this._bindings,h=this._nActiveBindings;for(let t=0;t!==h;++t)n[t].apply(a);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let e=this._actions,i=t.uuid,s=this._actionsByClip,r=s[i];if(void 0!==r){let t=r.knownActions;for(let i=0,s=t.length;i!==s;++i){let s=t[i];this._deactivateAction(s);let r=s._cacheIndex,a=e[e.length-1];s._cacheIndex=null,s._byClipCacheIndex=null,a._cacheIndex=r,e[r]=a,e.pop(),this._removeInactiveBindingsForAction(s)}delete s[i]}}uncacheRoot(t){let e=t.uuid,i=this._actionsByClip;for(let t in i){let s=i[t].actionByRoot[e];void 0!==s&&(this._deactivateAction(s),this._removeInactiveAction(s))}let s=this._bindingsByRootAndName[e];if(void 0!==s)for(let t in s){let e=s[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){let i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},Ll=class{constructor(t){this.value=t}clone(){return new Ll(void 0===this.value.clone?this.value:this.value.clone())}},Dl=class extends ua{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},Wl=new Ts,Ul=class{constructor(t,e,i=0,s=1/0){this.ray=new Ea(t,e),this.near=i,this.far=s,this.camera=null,this.layers=new Fs,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,e.projectionMatrix.elements[14]).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):Ri("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Wl.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Wl),this}intersectObject(t,e=!0,i=[]){return Jl(t,this,i,e),i.sort(jl),i}intersectObjects(t,e=!0,i=[]){for(let s=0,r=t.length;s<r;s++)Jl(t[s],this,i,e);return i.sort(jl),i}};function jl(t,e){return t.distance-e.distance}function Jl(t,e,i,s){let r=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,i)&&(r=!1),!0===r&&!0===s){let s=t.children;for(let t=0,r=s.length;t<r;t++)Jl(s[t],e,i,!0)}}var ql=class{constructor(t=1,e=0,i=0){this.radius=t,this.phi=e,this.theta=i}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=qi(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(qi(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},Xl=class{constructor(t,e,i,s){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,i,s)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let i=0;i<4;i++)this.elements[i]=t[i+e];return this}set(t,e,i,s){let r=this.elements;return r[0]=t,r[2]=e,r[1]=i,r[3]=s,this}},Yl=Xl;Xl.prototype.isMatrix2=!0;var Zl=new $i,Hl=class{constructor(t=new $i(1/0,1/0),e=new $i(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=Zl.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Zl).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Gl=new es,Ql=new es,$l=new es,Kl=new es,tu=new es,eu=new es,iu=new es,su=class{constructor(t=new es,e=new es){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Gl.subVectors(t,this.start),Ql.subVectors(this.end,this.start);let i=Ql.dot(Ql);if(0===i)return 0;let s=Ql.dot(Gl)/i;return e&&(s=qi(s,0,1)),s}closestPointToPoint(t,e,i){let s=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(s).add(this.start)}distanceSqToLine3(t,e=eu,i=iu){let s,r,a=10000000000000001e-32,n=this.start,h=t.start,o=this.end,l=t.end;$l.subVectors(o,n),Kl.subVectors(l,h),tu.subVectors(n,h);let u=$l.dot($l),c=Kl.dot(Kl),p=Kl.dot(tu);if(u<=a&&c<=a)return e.copy(n),i.copy(h),e.sub(i),e.dot(e);if(u<=a)s=0,r=p/c,r=qi(r,0,1);else{let t=$l.dot(tu);if(c<=a)r=0,s=qi(-t/u,0,1);else{let e=$l.dot(Kl),i=u*c-e*e;s=0!==i?qi((e*p-t*c)/i,0,1):0,r=(e*s+p)/c,r<0?(r=0,s=qi(-t/u,0,1)):r>1&&(r=1,s=qi((e-t)/u,0,1))}}return e.copy(n).addScaledVector($l,s),i.copy(h).addScaledVector(Kl,r),e.distanceToSquared(i)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},ru=new es,au=class extends tr{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";let i=new la,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,i=32;t<i;t++,e++){let r=t/i*Math.PI*2,a=e/i*Math.PI*2;s.push(Math.cos(r),Math.sin(r),1,Math.cos(a),Math.sin(a),1)}i.setAttribute("position",new Qr(s,3));let r=new Sn({fog:!1,toneMapped:!1});this.cone=new Rn(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;let t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),ru.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ru),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},nu=class extends Ga{constructor(t,e,i){super(new Yh(e,4,2),new Fa({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},hu=new es,ou=new es,lu=new es,uu=class extends tr{constructor(t,e,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===e&&(e=1);let s=new la;s.setAttribute("position",new Qr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));let r=new Sn({fog:!1,toneMapped:!1});this.lightPlane=new Bn(s,r),this.add(this.lightPlane),s=new la,s.setAttribute("position",new Qr([0,0,0,0,0,1],3)),this.targetLine=new Bn(s,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),hu.setFromMatrixPosition(this.light.matrixWorld),ou.setFromMatrixPosition(this.light.target.matrixWorld),lu.subVectors(ou,hu),this.lightPlane.lookAt(ou),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ou),this.targetLine.scale.z=lu.length()}},cu=new es,pu=new tl,du=class extends Rn{constructor(t){let e=new la,i=new Sn({color:16777215,vertexColors:!0,toneMapped:!1}),s=[],r=[],a={};function n(t,e){h(t),h(e)}function h(t){s.push(0,0,0),r.push(0,0,0),void 0===a[t]&&(a[t]=[]),a[t].push(s.length/3-1)}n("n1","n2"),n("n2","n4"),n("n4","n3"),n("n3","n1"),n("f1","f2"),n("f2","f4"),n("f4","f3"),n("f3","f1"),n("n1","f1"),n("n2","f2"),n("n3","f3"),n("n4","f4"),n("p","n1"),n("p","n2"),n("p","n3"),n("p","n4"),n("u1","u2"),n("u2","u3"),n("u3","u1"),n("c","t"),n("p","c"),n("cn1","cn2"),n("cn3","cn4"),n("cf1","cf2"),n("cf3","cf4"),e.setAttribute("position",new Qr(s,3)),e.setAttribute("color",new Qr(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();let o=new nr(16755200),l=new nr(16711680),u=new nr(43775),c=new nr(16777215),p=new nr(3355443);this.setColors(o,l,u,c,p)}setColors(t,e,i,s,r){let a=this.geometry.getAttribute("color");return a.setXYZ(0,t.r,t.g,t.b),a.setXYZ(1,t.r,t.g,t.b),a.setXYZ(2,t.r,t.g,t.b),a.setXYZ(3,t.r,t.g,t.b),a.setXYZ(4,t.r,t.g,t.b),a.setXYZ(5,t.r,t.g,t.b),a.setXYZ(6,t.r,t.g,t.b),a.setXYZ(7,t.r,t.g,t.b),a.setXYZ(8,t.r,t.g,t.b),a.setXYZ(9,t.r,t.g,t.b),a.setXYZ(10,t.r,t.g,t.b),a.setXYZ(11,t.r,t.g,t.b),a.setXYZ(12,t.r,t.g,t.b),a.setXYZ(13,t.r,t.g,t.b),a.setXYZ(14,t.r,t.g,t.b),a.setXYZ(15,t.r,t.g,t.b),a.setXYZ(16,t.r,t.g,t.b),a.setXYZ(17,t.r,t.g,t.b),a.setXYZ(18,t.r,t.g,t.b),a.setXYZ(19,t.r,t.g,t.b),a.setXYZ(20,t.r,t.g,t.b),a.setXYZ(21,t.r,t.g,t.b),a.setXYZ(22,t.r,t.g,t.b),a.setXYZ(23,t.r,t.g,t.b),a.setXYZ(24,e.r,e.g,e.b),a.setXYZ(25,e.r,e.g,e.b),a.setXYZ(26,e.r,e.g,e.b),a.setXYZ(27,e.r,e.g,e.b),a.setXYZ(28,e.r,e.g,e.b),a.setXYZ(29,e.r,e.g,e.b),a.setXYZ(30,e.r,e.g,e.b),a.setXYZ(31,e.r,e.g,e.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,s.r,s.g,s.b),a.setXYZ(39,s.r,s.g,s.b),a.setXYZ(40,r.r,r.g,r.b),a.setXYZ(41,r.r,r.g,r.b),a.setXYZ(42,r.r,r.g,r.b),a.setXYZ(43,r.r,r.g,r.b),a.setXYZ(44,r.r,r.g,r.b),a.setXYZ(45,r.r,r.g,r.b),a.setXYZ(46,r.r,r.g,r.b),a.setXYZ(47,r.r,r.g,r.b),a.setXYZ(48,r.r,r.g,r.b),a.setXYZ(49,r.r,r.g,r.b),a.needsUpdate=!0,this}update(){let t,e,i=this.geometry,s=this.pointMap;if(pu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)t=1,e=0;else if(this.camera.coordinateSystem===bi)t=-1,e=1;else{if(this.camera.coordinateSystem!==Mi)throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);t=0,e=1}mu("c",s,i,pu,0,0,t),mu("t",s,i,pu,0,0,e),mu("n1",s,i,pu,-1,-1,t),mu("n2",s,i,pu,1,-1,t),mu("n3",s,i,pu,-1,1,t),mu("n4",s,i,pu,1,1,t),mu("f1",s,i,pu,-1,-1,e),mu("f2",s,i,pu,1,-1,e),mu("f3",s,i,pu,-1,1,e),mu("f4",s,i,pu,1,1,e),mu("u1",s,i,pu,.7,1.1,t),mu("u2",s,i,pu,-.7,1.1,t),mu("u3",s,i,pu,0,2,t),mu("cf1",s,i,pu,-1,0,e),mu("cf2",s,i,pu,1,0,e),mu("cf3",s,i,pu,0,-1,e),mu("cf4",s,i,pu,0,1,e),mu("cn1",s,i,pu,-1,0,t),mu("cn2",s,i,pu,1,0,t),mu("cn3",s,i,pu,0,-1,t),mu("cn4",s,i,pu,0,1,t),i.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function mu(t,e,i,s,r,a,n){cu.set(r,a,n).unproject(s);let h=e[t];if(void 0!==h){let t=i.getAttribute("position");for(let e=0,i=h.length;e<i;e++)t.setXYZ(h[e],cu.x,cu.y,cu.z)}}var yu=class extends Rn{constructor(t,e=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=new la;s.setIndex(new Yr(i,1)),s.setAttribute("position",new Qr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(s,new Sn({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},fu=class extends Rn{constructor(t=1){let e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new la;i.setAttribute("position",new Qr(e,3)),i.setAttribute("color",new Qr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new Sn({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){let s=new nr,r=this.geometry.attributes.color.array;return s.set(t),s.toArray(r,0),s.toArray(r,3),s.set(e),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}};function gu(t,e,i,s){let r=function(t){switch(t){case bt:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case At:case 1013:case zt:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${t}.`)}(s);switch(i){case 1021:return t*e;case Ft:case 1029:return t*e/r.components*r.byteLength;case 1030:case 1031:return t*e*2/r.components*r.byteLength;case 1022:return t*e*3/r.components*r.byteLength;case Rt:case 1033:return t*e*4/r.components*r.byteLength;case 33776:case 33777:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case 33778:case 33779:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case 35841:case 35843:return Math.max(t,16)*Math.max(e,8)/4;case 35840:case 35842:return Math.max(t,8)*Math.max(e,8)/2;case 36196:case 37492:case 37488:case 37489:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case 37496:case 37490:case 37491:case 37808:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case 37809:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case 37810:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case 37811:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case 37812:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case 37813:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case 37814:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case 37815:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case 37816:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case 37817:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case 37818:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case 37819:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case 37820:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case 37821:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case 36492:case 36494:case 36495:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case 36284:return Math.ceil(t/4)*Math.ceil(e/4)*8;case 36285:case 36286:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:t}})),typeof window<"u"&&(window.__THREE__?Ni("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=t);export{t as a,e as b,i as c,s as d,r as e,a as f,n as g,h,o as i,l as j,u as k,c as l,p as m,d as n,m as o,y as p,f as q,g as r,x as s,v as t,b as u,M as v,w,S as x,_ as y,A as z,z as A,T as B,C,I as D,k as E,B as F,O as G,P as H,N as I,R as J,V as K,E as L,F as M,L as N,D as O,W as P,U as Q,j as R,J as S,q as T,X as U,Y as V,Z as W,H as X,G as Y,Q as Z,$ as _,K as $,tt as aa,et as ba,it as ca,st as da,rt as ea,at as fa,nt as ga,ht as ha,ot as ia,lt as ja,ut as ka,ct as la,pt as ma,dt as na,mt as oa,yt as pa,ft as qa,gt as ra,xt as sa,vt as ta,bt as ua,Mt as va,wt as wa,St as xa,_t as ya,At as za,zt as Aa,Tt as Ba,Ct as Ca,It as Da,kt as Ea,Bt as Fa,Ot as Ga,Pt as Ha,Nt as Ia,Rt as Ja,Vt as Ka,Et as La,Ft as Ma,Lt as Na,Dt as Oa,Wt as Pa,Ut as Qa,jt as Ra,Jt as Sa,qt as Ta,Xt as Ua,Yt as Va,Zt as Wa,Ht as Xa,Gt as Ya,Qt as Za,$t as _a,Kt as $a,te as ab,ee as bb,ie as cb,se as db,re as eb,ae as fb,ne as gb,he as hb,oe as ib,le as jb,ue as kb,ce as lb,pe as mb,de as nb,me as ob,ye as pb,fe as qb,ge as rb,xe as sb,ve as tb,be as ub,Me as vb,we as wb,Se as xb,_e as yb,Ae as zb,ze as Ab,Te as Bb,Ce as Cb,Re as Db,Ve as Eb,Ee as Fb,Fe as Gb,Le as Hb,De as Ib,We as Jb,Ue as Kb,je as Lb,Je as Mb,qe as Nb,Xe as Ob,Ye as Pb,Ze as Qb,He as Rb,Ge as Sb,Qe as Tb,$e as Ub,Ke as Vb,ti as Wb,ei as Xb,ii as Yb,si as Zb,ri as _b,ai as $b,ni as ac,hi as bc,oi as cc,li as dc,ui as ec,ci as fc,pi as gc,di as hc,mi as ic,yi as jc,fi as kc,gi as lc,xi as mc,vi as nc,bi as oc,Mi as pc,wi as qc,Si as rc,_i as sc,Ai as tc,Ci as uc,Ii as vc,ki as wc,Oi as xc,Ni as yc,Ri as zc,Vi as Ac,Ei as Bc,Fi as Cc,Li as Dc,Gi as Ec,$i as Fc,Ki as Gc,es as Hc,as as Ic,ls as Jc,vs as Kc,Ms as Lc,ws as Mc,Ss as Nc,_s as Oc,As as Pc,Ts as Qc,Es as Rc,Fs as Sc,tr as Tc,er as Uc,nr as Vc,or as Wc,lr as Xc,Sr as Yc,_r as Zc,jr as _c,Yr as $c,Zr as ad,Hr as bd,Gr as cd,Qr as dd,ea as ed,la as fd,ua as gd,pa as hd,ma as id,ya as jd,Ca as kd,Ea as ld,Fa as md,Ga as nd,$a as od,Ka as pd,sn as qd,rn as rd,pn as sd,fn as td,bn as ud,wn as vd,Sn as wd,Bn as xd,Rn as yd,Vn as zd,En as Ad,Fn as Bd,Ln as Cd,Dn as Dd,Wn as Ed,Un as Fd,jn as Gd,Jn as Hd,qn as Id,Yn as Jd,Hn as Kd,ah as Ld,nh as Md,hh as Nd,oh as Od,lh as Pd,uh as Qd,ph as Rd,dh as Sd,mh as Td,Wh as Ud,Jh as Vd,qh as Wd,Xh as Xd,Yh as Yd,Zh as Zd,Hh as _d,Gh as $d,Qh as ae,$h as be,to as ce,eo as de,io as ee,so as fe,ro as ge,ao as he,no as ie,ho as je,oo as ke,lo as le,uo as me,co as ne,po as oe,mo as pe,Bo as qe,Ro as re,Eo as se,Do as te,jo as ue,Jo as ve,qo as we,Xo as xe,tl as ye,rl as ze,nl as Ae,ll as Be,ul as Ce,pl as De,dl as Ee,ml as Fe,fl as Ge,gl as He,xl as Ie,vl as Je,Ml as Ke,wl as Le,Fl as Me,Ll as Ne,Dl as Oe,Ul as Pe,ql as Qe,Yl as Re,Hl as Se,su as Te,au as Ue,nu as Ve,uu as We,du as Xe,yu as Ye,fu as Ze,gu as _e};
|