@splinetool/runtime 2.0.5 → 2.0.7
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/hana-ui.js +44 -40
- package/build/hana-ui.js.br +0 -0
- package/build/hana-ui.js.gz +0 -0
- package/build/hana-ui.wasm +0 -0
- package/build/hana-ui.wasm.br +0 -0
- package/build/hana-ui.wasm.gz +0 -0
- package/build/opentype.js +1 -1
- package/build/opentype.js.br +0 -0
- package/build/opentype.js.gz +0 -0
- package/build/{runtime-aiAssistant-RMA2DMFU.js → runtime-aiAssistant-KCI2YU3F.js} +1 -1
- package/build/runtime-aiAssistant-KCI2YU3F.js.br +0 -0
- package/build/runtime-aiAssistant-KCI2YU3F.js.gz +0 -0
- package/build/{runtime-apiServices-KA4FEP5Y.js → runtime-apiServices-EYRJ5E55.js} +1 -1
- package/build/runtime-apiServices-EYRJ5E55.js.br +0 -0
- package/build/runtime-apiServices-EYRJ5E55.js.gz +0 -0
- package/build/{runtime-audio-BQSRM3W2.js → runtime-audio-TEHDPDRZ.js} +1 -1
- package/build/runtime-audio-TEHDPDRZ.js.br +4 -0
- package/build/runtime-audio-TEHDPDRZ.js.gz +0 -0
- package/build/{runtime-chunk-6WHNEYAL.js → runtime-chunk-3LIYAJXD.js} +1 -1
- package/build/runtime-chunk-3LIYAJXD.js.br +0 -0
- package/build/runtime-chunk-3LIYAJXD.js.gz +0 -0
- package/build/{runtime-chunk-QPB2TL3G.js → runtime-chunk-4DM3XFSJ.js} +1 -1
- package/build/runtime-chunk-4DM3XFSJ.js.br +0 -0
- package/build/runtime-chunk-4DM3XFSJ.js.gz +0 -0
- package/build/{runtime-chunk-MBBODDV7.js → runtime-chunk-5H2Z5KYI.js} +1 -1
- package/build/runtime-chunk-5H2Z5KYI.js.br +0 -0
- package/build/{runtime-chunk-MBBODDV7.js.gz → runtime-chunk-5H2Z5KYI.js.gz} +0 -0
- package/build/{runtime-chunk-P2QJHRIH.js → runtime-chunk-5P3HUPT4.js} +1 -1
- package/build/runtime-chunk-5P3HUPT4.js.br +0 -0
- package/build/runtime-chunk-5P3HUPT4.js.gz +0 -0
- package/build/{runtime-chunk-243VQV5T.js → runtime-chunk-72GELULA.js} +1 -1
- package/build/runtime-chunk-72GELULA.js.br +0 -0
- package/build/runtime-chunk-72GELULA.js.gz +0 -0
- package/build/{runtime-chunk-EGI7ABC6.js → runtime-chunk-BHBI2VFL.js} +1 -1
- package/build/runtime-chunk-BHBI2VFL.js.br +0 -0
- package/build/runtime-chunk-BHBI2VFL.js.gz +0 -0
- package/build/{runtime-chunk-IK4H7UNI.js → runtime-chunk-BR3T7PBD.js} +1 -1
- package/build/runtime-chunk-BR3T7PBD.js.br +0 -0
- package/build/runtime-chunk-BR3T7PBD.js.gz +0 -0
- package/build/{runtime-chunk-PLJ25O2X.js → runtime-chunk-DCPBSRSM.js} +1 -1
- package/build/runtime-chunk-DCPBSRSM.js.br +0 -0
- package/build/runtime-chunk-DCPBSRSM.js.gz +0 -0
- package/build/{runtime-chunk-U6S2BBR7.js → runtime-chunk-E3ZOKGVW.js} +1 -1
- package/build/runtime-chunk-E3ZOKGVW.js.br +0 -0
- package/build/runtime-chunk-E3ZOKGVW.js.gz +0 -0
- package/build/{runtime-chunk-NIDXMSZY.js → runtime-chunk-EKVJUEYP.js} +1 -1
- package/build/runtime-chunk-EKVJUEYP.js.br +0 -0
- package/build/runtime-chunk-EKVJUEYP.js.gz +0 -0
- package/build/{runtime-chunk-QVC5UDJO.js → runtime-chunk-EPHVY3XO.js} +1 -1
- package/build/runtime-chunk-EPHVY3XO.js.br +0 -0
- package/build/runtime-chunk-EPHVY3XO.js.gz +0 -0
- package/build/{runtime-chunk-IGBRWWDI.js → runtime-chunk-H7J7NLSC.js} +1 -1
- package/build/runtime-chunk-H7J7NLSC.js.br +0 -0
- package/build/runtime-chunk-H7J7NLSC.js.gz +0 -0
- package/build/{runtime-chunk-OTAMLWBD.js → runtime-chunk-HDFBDUFX.js} +1 -1
- package/build/runtime-chunk-HDFBDUFX.js.br +0 -0
- package/build/runtime-chunk-HDFBDUFX.js.gz +0 -0
- package/build/{runtime-chunk-DSGSWXCQ.js → runtime-chunk-ITMHVNES.js} +1 -1
- package/build/runtime-chunk-ITMHVNES.js.br +0 -0
- package/build/runtime-chunk-ITMHVNES.js.gz +0 -0
- package/build/{runtime-chunk-YWT6AWL4.js → runtime-chunk-JVRISZP3.js} +1 -1
- package/build/runtime-chunk-JVRISZP3.js.br +0 -0
- package/build/runtime-chunk-JVRISZP3.js.gz +0 -0
- package/build/{runtime-chunk-LALFWESO.js → runtime-chunk-LX7POLY3.js} +1 -1
- package/build/runtime-chunk-LX7POLY3.js.br +0 -0
- package/build/runtime-chunk-LX7POLY3.js.gz +0 -0
- package/build/{runtime-chunk-USXMESRF.js → runtime-chunk-M3ZKF7PK.js} +1 -1
- package/build/runtime-chunk-M3ZKF7PK.js.br +0 -0
- package/build/runtime-chunk-M3ZKF7PK.js.gz +0 -0
- package/build/{runtime-chunk-PRQYD4EW.js → runtime-chunk-NPNRGCX3.js} +1 -1
- package/build/runtime-chunk-NPNRGCX3.js.br +0 -0
- package/build/runtime-chunk-NPNRGCX3.js.gz +0 -0
- package/build/{runtime-chunk-DZOSSY2K.js → runtime-chunk-O37H7LZI.js} +1 -1
- package/build/runtime-chunk-O37H7LZI.js.br +0 -0
- package/build/runtime-chunk-O37H7LZI.js.gz +0 -0
- package/build/{runtime-chunk-SXDO5LXF.js → runtime-chunk-O5TGJH3R.js} +1 -1
- package/build/runtime-chunk-O5TGJH3R.js.br +0 -0
- package/build/runtime-chunk-O5TGJH3R.js.gz +0 -0
- package/build/{runtime-chunk-DNWPGXEC.js → runtime-chunk-PEOLFGBX.js} +1 -1
- package/build/runtime-chunk-PEOLFGBX.js.br +0 -0
- package/build/runtime-chunk-PEOLFGBX.js.gz +0 -0
- package/build/{runtime-chunk-F7OUYIT6.js → runtime-chunk-QPWV26TX.js} +1 -1
- package/build/runtime-chunk-QPWV26TX.js.br +0 -0
- package/build/runtime-chunk-QPWV26TX.js.gz +0 -0
- package/build/runtime-chunk-RDQUMMBI.js +1 -0
- package/build/runtime-chunk-RDQUMMBI.js.br +0 -0
- package/build/runtime-chunk-RDQUMMBI.js.gz +0 -0
- package/build/{runtime-chunk-V3U2TPGQ.js → runtime-chunk-SBMXYV5Q.js} +1 -1
- package/build/runtime-chunk-SBMXYV5Q.js.br +0 -0
- package/build/runtime-chunk-SBMXYV5Q.js.gz +0 -0
- package/build/{runtime-chunk-RSPDUS6G.js → runtime-chunk-TONK22EB.js} +1 -1
- package/build/runtime-chunk-TONK22EB.js.br +0 -0
- package/build/runtime-chunk-TONK22EB.js.gz +0 -0
- package/build/{runtime-chunk-5XUI4Z6R.js → runtime-chunk-U4QOT2PX.js} +1 -1
- package/build/runtime-chunk-U4QOT2PX.js.br +0 -0
- package/build/runtime-chunk-U4QOT2PX.js.gz +0 -0
- package/build/{runtime-chunk-J4FFQBNR.js → runtime-chunk-UYADWI5Q.js} +1 -1
- package/build/runtime-chunk-UYADWI5Q.js.br +0 -0
- package/build/runtime-chunk-UYADWI5Q.js.gz +0 -0
- package/build/runtime-chunk-VPEJ5BFD.js +1 -0
- package/build/runtime-chunk-VPEJ5BFD.js.br +0 -0
- package/build/runtime-chunk-VPEJ5BFD.js.gz +0 -0
- package/build/{runtime-chunk-2657LZHS.js → runtime-chunk-WZWD2YIG.js} +1 -1
- package/build/runtime-chunk-WZWD2YIG.js.br +0 -0
- package/build/runtime-chunk-WZWD2YIG.js.gz +0 -0
- package/build/{runtime-chunk-CDZQF4NV.js → runtime-chunk-XL37JGAH.js} +1 -1
- package/build/runtime-chunk-XL37JGAH.js.br +0 -0
- package/build/runtime-chunk-XL37JGAH.js.gz +0 -0
- package/build/{runtime-chunk-Y365A3K5.js → runtime-chunk-XYRJFDFM.js} +1 -1
- package/build/runtime-chunk-XYRJFDFM.js.br +0 -0
- package/build/runtime-chunk-XYRJFDFM.js.gz +0 -0
- package/build/{runtime-classicRuntime-BD2WFYXF.js → runtime-classicRuntime-T2PZUVVV.js} +1 -1
- package/build/runtime-classicRuntime-T2PZUVVV.js.br +0 -0
- package/build/runtime-classicRuntime-T2PZUVVV.js.gz +0 -0
- package/build/runtime-cloners-TRZ7JQLO.js +1 -0
- package/build/runtime-cloners-TRZ7JQLO.js.br +0 -0
- package/build/runtime-cloners-TRZ7JQLO.js.gz +0 -0
- package/build/{runtime-components-RLXFVT5A.js → runtime-components-VZOXPM65.js} +1 -1
- package/build/runtime-components-VZOXPM65.js.br +0 -0
- package/build/runtime-components-VZOXPM65.js.gz +0 -0
- package/build/{runtime-conditional-DCOFCW5I.js → runtime-conditional-HGOAXTBF.js} +1 -1
- package/build/{runtime-conditional-DCOFCW5I.js.br → runtime-conditional-HGOAXTBF.js.br} +0 -0
- package/build/runtime-conditional-HGOAXTBF.js.gz +0 -0
- package/build/{runtime-createDestroy-4PG4ZWLI.js → runtime-createDestroy-AXHU4HXJ.js} +1 -1
- package/build/runtime-createDestroy-AXHU4HXJ.js.br +0 -0
- package/build/runtime-createDestroy-AXHU4HXJ.js.gz +0 -0
- package/build/{runtime-dragDrop-CTXPZ6OW.js → runtime-dragDrop-CKSSHBJ2.js} +1 -1
- package/build/runtime-dragDrop-CKSSHBJ2.js.br +0 -0
- package/build/runtime-dragDrop-CKSSHBJ2.js.gz +0 -0
- package/build/{runtime-fxBloom-IGFV4KJD.js → runtime-fxBloom-KENIJKIM.js} +1 -1
- package/build/runtime-fxBloom-KENIJKIM.js.br +0 -0
- package/build/runtime-fxBloom-KENIJKIM.js.gz +0 -0
- package/build/runtime-fxDepthOfField-XNWQKT4G.js +1 -0
- package/build/runtime-fxDepthOfField-XNWQKT4G.js.br +0 -0
- package/build/runtime-fxDepthOfField-XNWQKT4G.js.gz +0 -0
- package/build/{runtime-gameControls-LUALVLF5.js → runtime-gameControls-Y42GYPNR.js} +1 -1
- package/build/runtime-gameControls-Y42GYPNR.js.br +0 -0
- package/build/runtime-gameControls-Y42GYPNR.js.gz +0 -0
- package/build/runtime-hair-FXERW4BM.js +1 -0
- package/build/runtime-hair-FXERW4BM.js.br +2 -0
- package/build/runtime-hair-FXERW4BM.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-QDKIDV27.js → runtime-mergeStaticGeometries-7CWREJDS.js} +1 -1
- package/build/runtime-mergeStaticGeometries-7CWREJDS.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-7CWREJDS.js.gz +0 -0
- package/build/{runtime-miscActions-FCQTXDEH.js → runtime-miscActions-UBT3FDIC.js} +1 -1
- package/build/runtime-miscActions-UBT3FDIC.js.br +0 -0
- package/build/runtime-miscActions-UBT3FDIC.js.gz +0 -0
- package/build/{runtime-mouseHover-GP5TEPLG.js → runtime-mouseHover-GDKHMRYT.js} +1 -1
- package/build/runtime-mouseHover-GDKHMRYT.js.br +0 -0
- package/build/runtime-mouseHover-GDKHMRYT.js.gz +0 -0
- package/build/{runtime-particles-VMYZZSAL.js → runtime-particles-H6ZGTDQ3.js} +1 -1
- package/build/runtime-particles-H6ZGTDQ3.js.br +0 -0
- package/build/runtime-particles-H6ZGTDQ3.js.gz +0 -0
- package/build/{runtime-paths-TGU7JOOY.js → runtime-paths-HN53AEBL.js} +1 -1
- package/build/runtime-paths-HN53AEBL.js.br +0 -0
- package/build/runtime-paths-HN53AEBL.js.gz +0 -0
- package/build/{runtime-resize-O3Y2XS2Q.js → runtime-resize-TUVUJVJY.js} +1 -1
- package/build/runtime-resize-TUVUJVJY.js.br +0 -0
- package/build/runtime-resize-TUVUJVJY.js.gz +0 -0
- package/build/{runtime-sceneTransition-4DDTFDJN.js → runtime-sceneTransition-DTM34VVE.js} +1 -1
- package/build/runtime-sceneTransition-DTM34VVE.js.br +0 -0
- package/build/runtime-sceneTransition-DTM34VVE.js.gz +0 -0
- package/build/{runtime-scroll-ET44H7JC.js → runtime-scroll-AFN3LCAC.js} +1 -1
- package/build/runtime-scroll-AFN3LCAC.js.br +0 -0
- package/build/runtime-scroll-AFN3LCAC.js.gz +0 -0
- package/build/runtime-shapeBlends-DOVFXT5Z.js +1 -0
- package/build/runtime-shapeBlends-DOVFXT5Z.js.br +0 -0
- package/build/runtime-shapeBlends-DOVFXT5Z.js.gz +0 -0
- package/build/runtime-text-HV7E4TSW.js +1 -0
- package/build/runtime-text-HV7E4TSW.js.br +0 -0
- package/build/runtime-text-HV7E4TSW.js.gz +0 -0
- package/build/{runtime-textInputs-E72WPYQU.js → runtime-textInputs-77LAXHNH.js} +1 -1
- package/build/runtime-textInputs-77LAXHNH.js.br +0 -0
- package/build/runtime-textInputs-77LAXHNH.js.gz +0 -0
- package/build/{runtime-timeline-2VAMFUOE.js → runtime-timeline-GUSMJD46.js} +1 -1
- package/build/runtime-timeline-GUSMJD46.js.br +0 -0
- package/build/runtime-timeline-GUSMJD46.js.gz +0 -0
- package/build/{runtime-tracking-E72XXGER.js → runtime-tracking-XZCI3RKR.js} +1 -1
- package/build/runtime-tracking-XZCI3RKR.js.br +0 -0
- package/build/runtime-tracking-XZCI3RKR.js.gz +0 -0
- package/build/{runtime-transitions-JOHZRI2L.js → runtime-transitions-SBVQ7DIZ.js} +1 -1
- package/build/runtime-transitions-SBVQ7DIZ.js.br +0 -0
- package/build/runtime-transitions-SBVQ7DIZ.js.gz +0 -0
- package/build/runtime-ui2d-KEK4JA3H.js +1 -0
- package/build/runtime-ui2d-KEK4JA3H.js.br +0 -0
- package/build/runtime-ui2d-KEK4JA3H.js.gz +0 -0
- package/build/{runtime-updater-3ELP7WMM.js → runtime-updater-GOXAMNAK.js} +1 -1
- package/build/runtime-updater-GOXAMNAK.js.br +5 -0
- package/build/runtime-updater-GOXAMNAK.js.gz +0 -0
- package/build/{runtime-variables-Q6Q2JCGI.js → runtime-variables-36KLHNE5.js} +1 -1
- package/build/runtime-variables-36KLHNE5.js.br +0 -0
- package/build/runtime-variables-36KLHNE5.js.gz +0 -0
- package/build/{runtime-vectorShapes-FKC6EQWI.js → runtime-vectorShapes-U7BI3CMD.js} +1 -1
- package/build/runtime-vectorShapes-U7BI3CMD.js.br +0 -0
- package/build/runtime-vectorShapes-U7BI3CMD.js.gz +0 -0
- package/build/{runtime-video-DUDXGADJ.js → runtime-video-XIULR4BY.js} +1 -1
- package/build/runtime-video-XIULR4BY.js.br +0 -0
- package/build/runtime-video-XIULR4BY.js.gz +0 -0
- package/build/runtime-webgpu-3QIPQDJ4.js +1 -0
- package/build/runtime-webgpu-3QIPQDJ4.js.br +0 -0
- package/build/runtime-webgpu-3QIPQDJ4.js.gz +0 -0
- package/build/runtime.cjs +323 -323
- 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 +2 -1
- package/build/runtime-aiAssistant-RMA2DMFU.js.br +0 -0
- package/build/runtime-aiAssistant-RMA2DMFU.js.gz +0 -0
- package/build/runtime-apiServices-KA4FEP5Y.js.br +0 -0
- package/build/runtime-apiServices-KA4FEP5Y.js.gz +0 -0
- package/build/runtime-audio-BQSRM3W2.js.br +0 -0
- package/build/runtime-audio-BQSRM3W2.js.gz +0 -0
- package/build/runtime-chunk-243VQV5T.js.br +0 -0
- package/build/runtime-chunk-243VQV5T.js.gz +0 -0
- package/build/runtime-chunk-2657LZHS.js.br +0 -0
- package/build/runtime-chunk-2657LZHS.js.gz +0 -0
- package/build/runtime-chunk-5XUI4Z6R.js.br +0 -0
- package/build/runtime-chunk-5XUI4Z6R.js.gz +0 -0
- package/build/runtime-chunk-6WHNEYAL.js.br +0 -0
- package/build/runtime-chunk-6WHNEYAL.js.gz +0 -0
- package/build/runtime-chunk-CDZQF4NV.js.br +0 -0
- package/build/runtime-chunk-CDZQF4NV.js.gz +0 -0
- package/build/runtime-chunk-DNWPGXEC.js.br +0 -0
- package/build/runtime-chunk-DNWPGXEC.js.gz +0 -0
- package/build/runtime-chunk-DSGSWXCQ.js.br +0 -0
- package/build/runtime-chunk-DSGSWXCQ.js.gz +0 -0
- package/build/runtime-chunk-DZOSSY2K.js.br +0 -0
- package/build/runtime-chunk-DZOSSY2K.js.gz +0 -0
- package/build/runtime-chunk-EGI7ABC6.js.br +0 -0
- package/build/runtime-chunk-EGI7ABC6.js.gz +0 -0
- package/build/runtime-chunk-F7OUYIT6.js.br +0 -0
- package/build/runtime-chunk-F7OUYIT6.js.gz +0 -0
- package/build/runtime-chunk-IGBRWWDI.js.br +0 -0
- package/build/runtime-chunk-IGBRWWDI.js.gz +0 -0
- package/build/runtime-chunk-IK4H7UNI.js.br +0 -0
- package/build/runtime-chunk-IK4H7UNI.js.gz +0 -0
- package/build/runtime-chunk-J4FFQBNR.js.br +0 -0
- package/build/runtime-chunk-J4FFQBNR.js.gz +0 -0
- package/build/runtime-chunk-LALFWESO.js.br +0 -0
- package/build/runtime-chunk-LALFWESO.js.gz +0 -0
- package/build/runtime-chunk-MBBODDV7.js.br +0 -0
- package/build/runtime-chunk-NIDXMSZY.js.br +0 -0
- package/build/runtime-chunk-NIDXMSZY.js.gz +0 -0
- package/build/runtime-chunk-OTAMLWBD.js.br +0 -0
- package/build/runtime-chunk-OTAMLWBD.js.gz +0 -0
- package/build/runtime-chunk-OW6T4XFV.js +0 -1
- package/build/runtime-chunk-OW6T4XFV.js.br +0 -0
- package/build/runtime-chunk-OW6T4XFV.js.gz +0 -0
- package/build/runtime-chunk-P2QJHRIH.js.br +0 -0
- package/build/runtime-chunk-P2QJHRIH.js.gz +0 -0
- package/build/runtime-chunk-PLJ25O2X.js.br +0 -0
- package/build/runtime-chunk-PLJ25O2X.js.gz +0 -0
- package/build/runtime-chunk-PRQYD4EW.js.br +0 -0
- package/build/runtime-chunk-PRQYD4EW.js.gz +0 -0
- package/build/runtime-chunk-QPB2TL3G.js.br +0 -0
- package/build/runtime-chunk-QPB2TL3G.js.gz +0 -0
- package/build/runtime-chunk-QVC5UDJO.js.br +0 -0
- package/build/runtime-chunk-QVC5UDJO.js.gz +0 -0
- package/build/runtime-chunk-RSPDUS6G.js.br +0 -0
- package/build/runtime-chunk-RSPDUS6G.js.gz +0 -0
- package/build/runtime-chunk-RWL6KR5S.js +0 -1
- package/build/runtime-chunk-RWL6KR5S.js.br +0 -0
- package/build/runtime-chunk-RWL6KR5S.js.gz +0 -0
- package/build/runtime-chunk-SXDO5LXF.js.br +0 -0
- package/build/runtime-chunk-SXDO5LXF.js.gz +0 -0
- package/build/runtime-chunk-U6S2BBR7.js.br +0 -0
- package/build/runtime-chunk-U6S2BBR7.js.gz +0 -0
- package/build/runtime-chunk-USXMESRF.js.br +0 -0
- package/build/runtime-chunk-USXMESRF.js.gz +0 -0
- package/build/runtime-chunk-V3U2TPGQ.js.br +0 -0
- package/build/runtime-chunk-V3U2TPGQ.js.gz +0 -0
- package/build/runtime-chunk-Y365A3K5.js.br +0 -0
- package/build/runtime-chunk-Y365A3K5.js.gz +0 -0
- package/build/runtime-chunk-YWT6AWL4.js.br +0 -0
- package/build/runtime-chunk-YWT6AWL4.js.gz +0 -0
- package/build/runtime-classicRuntime-BD2WFYXF.js.br +0 -0
- package/build/runtime-classicRuntime-BD2WFYXF.js.gz +0 -0
- package/build/runtime-cloners-ST66KGZH.js +0 -1
- package/build/runtime-cloners-ST66KGZH.js.br +0 -1
- package/build/runtime-cloners-ST66KGZH.js.gz +0 -0
- package/build/runtime-components-RLXFVT5A.js.br +0 -0
- package/build/runtime-components-RLXFVT5A.js.gz +0 -0
- package/build/runtime-conditional-DCOFCW5I.js.gz +0 -0
- package/build/runtime-createDestroy-4PG4ZWLI.js.br +0 -0
- package/build/runtime-createDestroy-4PG4ZWLI.js.gz +0 -0
- package/build/runtime-dragDrop-CTXPZ6OW.js.br +0 -0
- package/build/runtime-dragDrop-CTXPZ6OW.js.gz +0 -0
- package/build/runtime-fxBloom-IGFV4KJD.js.br +0 -0
- package/build/runtime-fxBloom-IGFV4KJD.js.gz +0 -0
- package/build/runtime-fxDepthOfField-WX7WD3K4.js +0 -1
- package/build/runtime-fxDepthOfField-WX7WD3K4.js.br +0 -0
- package/build/runtime-fxDepthOfField-WX7WD3K4.js.gz +0 -0
- package/build/runtime-gameControls-LUALVLF5.js.br +0 -0
- package/build/runtime-gameControls-LUALVLF5.js.gz +0 -0
- package/build/runtime-hair-JNRT3G3X.js +0 -1
- package/build/runtime-hair-JNRT3G3X.js.br +0 -1
- package/build/runtime-hair-JNRT3G3X.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-QDKIDV27.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-QDKIDV27.js.gz +0 -0
- package/build/runtime-miscActions-FCQTXDEH.js.br +0 -0
- package/build/runtime-miscActions-FCQTXDEH.js.gz +0 -0
- package/build/runtime-mouseHover-GP5TEPLG.js.br +0 -0
- package/build/runtime-mouseHover-GP5TEPLG.js.gz +0 -0
- package/build/runtime-particles-VMYZZSAL.js.br +0 -0
- package/build/runtime-particles-VMYZZSAL.js.gz +0 -0
- package/build/runtime-paths-TGU7JOOY.js.br +0 -0
- package/build/runtime-paths-TGU7JOOY.js.gz +0 -0
- package/build/runtime-resize-O3Y2XS2Q.js.br +0 -0
- package/build/runtime-resize-O3Y2XS2Q.js.gz +0 -0
- package/build/runtime-sceneTransition-4DDTFDJN.js.br +0 -0
- package/build/runtime-sceneTransition-4DDTFDJN.js.gz +0 -0
- package/build/runtime-scroll-ET44H7JC.js.br +0 -0
- package/build/runtime-scroll-ET44H7JC.js.gz +0 -0
- package/build/runtime-shapeBlends-3FCSH6PN.js +0 -1
- package/build/runtime-shapeBlends-3FCSH6PN.js.br +0 -2
- package/build/runtime-shapeBlends-3FCSH6PN.js.gz +0 -0
- package/build/runtime-text-UQIUL5X6.js +0 -1
- package/build/runtime-text-UQIUL5X6.js.br +0 -0
- package/build/runtime-text-UQIUL5X6.js.gz +0 -0
- package/build/runtime-textInputs-E72WPYQU.js.br +0 -0
- package/build/runtime-textInputs-E72WPYQU.js.gz +0 -0
- package/build/runtime-timeline-2VAMFUOE.js.br +0 -0
- package/build/runtime-timeline-2VAMFUOE.js.gz +0 -0
- package/build/runtime-tracking-E72XXGER.js.br +0 -0
- package/build/runtime-tracking-E72XXGER.js.gz +0 -0
- package/build/runtime-transitions-JOHZRI2L.js.br +0 -0
- package/build/runtime-transitions-JOHZRI2L.js.gz +0 -0
- package/build/runtime-ui2d-PJKKRE32.js +0 -1
- package/build/runtime-ui2d-PJKKRE32.js.br +0 -0
- package/build/runtime-ui2d-PJKKRE32.js.gz +0 -0
- package/build/runtime-updater-3ELP7WMM.js.br +0 -1
- package/build/runtime-updater-3ELP7WMM.js.gz +0 -0
- package/build/runtime-variables-Q6Q2JCGI.js.br +0 -0
- package/build/runtime-variables-Q6Q2JCGI.js.gz +0 -0
- package/build/runtime-vectorShapes-FKC6EQWI.js.br +0 -0
- package/build/runtime-vectorShapes-FKC6EQWI.js.gz +0 -0
- package/build/runtime-video-DUDXGADJ.js.br +0 -0
- package/build/runtime-video-DUDXGADJ.js.gz +0 -0
- package/build/runtime-webgpu-TBHSGHNI.js +0 -1
- package/build/runtime-webgpu-TBHSGHNI.js.br +0 -0
- package/build/runtime-webgpu-TBHSGHNI.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ac as e,
|
|
1
|
+
import{Ac as e,sc as n,zc as a}from"./runtime-chunk-5H2Z5KYI.js";import{Dc as t,Fc as r,Ic as s,Jc as i,Oc as o,nd as l,qa as d}from"./runtime-chunk-VGN7YHB7.js";var c=8,u=new s,p=(()=>{let e=new l(new Uint8Array([0,0,0,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),w=(()=>{let e=new l(new Uint8Array([0,0,0,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),m=(()=>{let e=new l(new Uint8Array([255,255,255,255]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})(),g=(()=>{let e=new l(new Uint8Array([0,0,0,0]),1,1);return e.minFilter=d,e.magFilter=d,e.needsUpdate=!0,e})();function h(){try{return"0"!==new URLSearchParams(window.location.search).get("dbgsrgb8")}catch{return!0}}function R(){try{return"0"!==new URLSearchParams(window.location.search).get("dbgoutguard")}catch{return!0}}var f={chainBuilds:0,lastChainBuildReason:"",taaResolves:0,taaJitterIndex:0,taaJitterApplies:0,taaHistoryValid:!1,taaResolveSize:"",helperOverlayMode:"",deviceLost:"",outputInterpositions:0,bundleChecks:0,bundleRebuilds:0,bundleDisabled:!1,bundleResourceRebuilds:0,bundleIncompleteRecords:0,bundleRecords:0,bundleReplays:0,instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{},skippedAsyncDraws:0,stalledSkipFrames:0,compilationBurst:!1,pcssLights:0,pcssInstalled:0,pcssForeignFilter:0,pcssPyramidBuilds:0,pcssPyramidActive:0,shadowMaskResolves:0,shadowMaskActive:0,pcssHookServes:0,pcssRadius0:0,pcssPenumbra0:0,nodeResurrections:0,shadowTypeSoft:!0};typeof window<"u"&&(window.__SPLINE_WEBGPU_STATS=f);var b={resolution:a(new t(1,1)),pixelRatio:a(1),frameIndex:a(0),aspectRatio:a(new t(1,1)),transmissionRenderTarget:n(u),normalRenderTarget:n(u),normalRenderTargetDepth:n(u),normalViewRenderTarget:n(u),aoRenderTarget:n(u),reflectionRenderTarget:n(p),reflectionDepthPyramid:n(p),reflectionDepthSize:a(new t(1,1)),reflectionDepthLevels:a(1,"int"),reflectionEnvMap:n(p),reflectionEnvEnabled:a(0),reflectionPlanarTarget:n(p),reflectionPlanarEnabled:a(0),reflectionMissColor:a(new r(0,0,0)),reflectionResolveTarget:n(w),reflectionResolveEnabled:a(0),shadowMaskTexture:n(m),shadowMaskGBuffer:n(g),shadowMaskEnabled:a(0),shadowMaskResolution:a(new t(1,1)),shadowMaskFullResolution:a(new t(1,1)),transmissionSamplerSize:a(new t(2048,2048)),transmissionActualSize:a(new t(1,1)),orthographicUniform:a(0),unjitteredProjection:a(new o),aoEnabledUniform:a(0),pcssHalton:a(new t(0,-.333334)),tapAngle:a(0),tapAngle2:a(0),cameraJitterPx:a(new t(0,0)),toonLightData:e(Array.from({length:8},()=>new i),"vec4"),toonLightCount:a(0,"int"),taaEnabled:{value:!1},aoEnabled:{value:!1},transmissionLod:{value:2}};export{c as a,u as b,p as c,w as d,h as e,R as f,f as g,b as h};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-J4FFQBNR.js";import{a as e}from"./runtime-chunk-RSPDUS6G.js";import{d as n,e as s,f as i,g as r,h as a}from"./runtime-chunk-EGI7ABC6.js";import{a as o,b as l}from"./runtime-chunk-IGBRWWDI.js";import{b as d,e as c,f as h,g as p}from"./runtime-chunk-DNWPGXEC.js";import{a as u}from"./runtime-chunk-DSGSWXCQ.js";import{a as m}from"./runtime-chunk-2657LZHS.js";import{a as f}from"./runtime-chunk-SXDO5LXF.js";import{b as y}from"./runtime-chunk-F7OUYIT6.js";import{a as g,b as x}from"./runtime-chunk-6WHNEYAL.js";import{a as v}from"./runtime-chunk-DZOSSY2K.js";import{d as A}from"./runtime-chunk-CDZQF4NV.js";import{K as b,da as C,ea as w,g as I}from"./runtime-chunk-LALFWESO.js";import{b as M,c as P,e as S,h as B,v as D}from"./runtime-chunk-PLJ25O2X.js";import{a as E,b as R,c as O,d as z,f as W,i as j,j as T}from"./runtime-chunk-2PT2WH66.js";import{c as _,e as k,g as U}from"./runtime-chunk-TZCHGFVF.js";import{Da as N,K as G,Ka as V,a as F,b as L,n as Y,o as q,w as Q,xa as X}from"./runtime-chunk-OW6T4XFV.js";import{Aa as Z,Ba as H,Dc as K,Ec as J,Fc as $,Gc as tt,Ge as et,Ja as nt,Oa as st,Oc as it,Ra as rt,Tc as at,Vc as ot,Xc as lt,Yc as dt,Zc as ct,bd as ht,cd as pt,ce as ut,dd as mt,kd as ft,l as yt,ld as gt,mc as xt,md as vt,n as At,nd as bt,od as Ct,pd as wt,qd as It,za as Mt}from"./runtime-chunk-VGN7YHB7.js";import{c as Pt}from"./runtime-chunk-ML3Z74BL.js";var St=null;function Bt(t){St=t}var Dt=new WeakMap,Et=1;function Rt(t){let e=Dt.get(t);return void 0===e&&(e=Et++,Dt.set(t,e)),e}function Ot(t,e,n,s){let i=t,r=e;return[Rt(n),Rt(s),i.layers?.mask??0,i.renderOrder??0,!0===(i.castShadow??r.castShadow)?1:0,!0===(i.receiveShadow??r.receiveShadow)?1:0].join(":")}var zt=[8,32,128,512],Wt=zt[zt.length-1],jt=(new it).makeScale(0,0,0),Tt=class extends It{constructor(t,e,n,s){super(t,e,n),this.isInstanceGroup=!0,this.members=new Array(n).fill(null),this.raycast=()=>{},this.matrixAutoUpdate=!1,this.frustumCulled=!1,this.adoptPassState(s);for(let t=0;t<n;t++)this.setMatrixAt(t,jt);this.instanceMatrix.needsUpdate=!0}adoptPassState(t){this.layers.mask=t.layers.mask,this.renderOrder=t.renderOrder,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow}assign(t,e){this.members[t]=e}writeSlot(t,e,n){return!1===n?(this.setMatrixAt(t,jt),!1):(this.setMatrixAt(t,e.matrixWorld),!0)}park(t){this.members[t]=null,this.setMatrixAt(t,jt)}get memberCount(){let t=0;for(let e of this.members)null!==e&&t++;return t}};function _t(t,e){let n=e.get(t);if(void 0!==n)return n;let s=t.visible&&(null===t.parent||_t(t.parent,e));return e.set(t,s),s}var kt=8,Ut=class{constructor(t=8){this.minGroupSize=t,this.groups=[],this.groupKeys=new WeakMap,this.placements=new Map,this.visibilityMemo=new Map,this.page=null,this.stats={instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{}}}update(t,e){this.page!==t&&(this.teardown(),this.page=t,e=!0),!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),e&&this.reconcile(t),this.refresh()}reconcile(t){let e={},n=new Map;t.traverse(t=>{if(!0===t.isInstanceGroup)return;let s=function(t){if(!0!==t.isMesh)return"not-a-mesh";if(O(t)||W(t)||R(t)||E(t))return"excluded-type";let e=function(t){let e=j(t)?t.object:t;return void 0!==e.geometry?e:void 0}(t);if(void 0===e)return"not-a-mesh";let n=e.material;if(void 0===n)return"not-a-mesh";if(Array.isArray(n))return"array-material";let s=e.builtSharedGeometry;if(void 0===s)return"unrealized-geometry";if(!function(t){return!0===t.isShared}(s))return"unshared-geometry";if(void 0===s.attributes.position)return"empty-geometry";if(void 0!==s.morphAttributes.position)return"morph";if(!0===e.isSkinnedMesh)return"skinned";let i=e.morphTargetInfluences;if(void 0!==i&&i.length>0)return"morph";if(0!==s.drawRange.start||s.drawRange.count!==Number.POSITIVE_INFINITY)return"draw-range";let r=n;return null!=r.positionNode||null!=r.castShadowPositionNode?"position-node":!0===r.transparent?"transparent":void 0!==e.userData?.__splinePlanarMirror?"reflection":function(t){let e=t;for(;null!==e;){let t=e.states;if(void 0!==t&&Object.keys(t).length>0)return!0;e=e.parent}return!1}(e)?"interaction-states":{object:t,owner:e,geometry:s,material:n,key:Ot(t,e,s,n)}}(t);if("string"==typeof s)return void(e[s]=(e[s]??0)+1);let i=n.get(s.key);void 0===i?n.set(s.key,[s]):i.push(s)});let s=new Map;for(let[t,e]of n)for(let n of e)s.set(n.object,t);let i=!1;for(let[t,e]of this.placements)s.get(t)!==this.groupKeys.get(e.group)&&this.parkPlacement(t,e);for(let t=this.groups.length-1;t>=0;t--){let e=this.groups[t];e.memberCount>=this.minGroupSize||(this.destroyGroup(e),this.groups.splice(t,1),i=!0)}for(let[e,s]of n){let n=s.filter(t=>!this.placements.has(t.object));if(0===n.length)continue;let r=0;for(let t of this.groups){if(r>=n.length)break;if(this.groupKeys.get(t)!==e)continue;let{members:s}=t;for(let e=0;e<s.length&&r<n.length;e++)null===s[e]&&this.place(t,e,n[r++].object)}for(;n.length-r>=this.minGroupSize;){let s=n.slice(r,r+Wt);this.groups.push(this.createGroup(t,e,s)),r+=s.length,i=!0}}i&&this.stats.instancingRegroups++,this.publishGroupStats(),this.stats.instancingIneligible=e}createGroup(t,e,n){let s=n[0],i=new Tt(s.geometry,s.material,function(t){for(let e of zt)if(t<=e)return e;return Wt}(n.length),s.object);this.groupKeys.set(i,e);for(let t=0;t<n.length;t++)this.place(i,t,n[t].object);return t.add(i),i}destroyGroup(t){for(let e=0;e<t.members.length;e++){let n=t.members[e];null!==n&&this.parkPlacement(n,{group:t,slot:e})}t.removeFromParent(),t.dispose()}place(t,e,n){t.assign(e,n),this.placements.set(n,{group:t,slot:e}),n.isDrawSuppressed=!0}parkPlacement(t,e){e.group.park(e.slot),e.group.instanceMatrix.needsUpdate=!0,this.placements.delete(t),t.isDrawSuppressed=!1,this.stats.instancingParks++}refresh(){this.visibilityMemo.clear();for(let t of this.groups){let{members:e}=t,n=null;for(let s=0;s<e.length;s++){let i=e[s];null!==i&&(null===n&&(n=i),t.writeSlot(s,i,_t(i,this.visibilityMemo)))}null!==n&&(t.adoptPassState(n),t.instanceMatrix.needsUpdate=!0)}}teardown(){for(let t of this.groups)this.destroyGroup(t);this.groups.length=0;for(let t of this.placements.keys())t.isDrawSuppressed=!1;this.placements.clear(),this.publishGroupStats()}dispose(){this.teardown(),this.page=null}publishGroupStats(){let t=0;for(let e of this.groups){let n=e.memberCount;n>0&&(t+=n-1)}this.stats.instancingGroups=this.groups.length,this.stats.instancedDrawsSaved=t}},Nt=function(){let t=new Float32Array(1),e=new Int32Array(t.buffer);return function(n){return t[0]=n,e[0]}}(),Gt=function(t,e,n,s){return t+(e<<8)+(n<<16)+(s<<24)},Vt=new K;function Ft(t){let e=!1;return t.scene.objects.traverse((t,n)=>{if(!1===n.visible)return!0;"Splat"===n.type&&(e=!0)}),e}var Lt,Yt,qt=class extends gt{constructor(t,e,n,s,i=!1,r=1,a,o){super(n,s),this.splatCount=e,this.meshIndexIntervals=a,this.meshMatrixWorlds=o,this.splatBuffers=t,this.geometry=n,this.material=s,this.splatDataTextures=null,this.halfPrecisionCovariancesOnGPU=i,this.devicePixelRatio=r,this.resetLocalSplatDataAndTexturesFromSplatBuffer()}static buildMesh(t,e,n=!1,s=1,i,r){let a=qt.buildGeomtery(e),o=qt.buildMaterial(i);return new qt(t,e,a,o,n,s,i,r)}static buildMaterial(t){if("webgpu"===b()&&St)return St.createSplatMaterial(t);let e={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:t},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new K},viewport:{type:"v2",value:new K},basisViewport:{type:"v2",value:new K},debugColor:{type:"v3",value:new at},covariancesTextureSize:{type:"v2",value:new K(1024,1024)},centersColorsTextureSize:{type:"v2",value:new K(1024,1024)},orthoZoom:{type:"f",value:-1}};return new ut({uniforms:e,vertexShader:"\n precision highp float;\n #include <common>\n\n attribute uint splatIndex;\n\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D centersColorsTexture;\n uniform vec2 focal;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 covariancesTextureSize;\n uniform vec2 centersColorsTextureSize;\n\t\t\t\t\t\tuniform highp sampler2D meshMatrixWorldsTexture;\n\t\t\t\t\t\tuniform uint meshIndexIntervals[257];\n\t\t\t\t\t\tuniform float orthoZoom;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n void main () {\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n vColor = uintToRGBAVec(sampledCenterColor.r);\n\n vPosition = position.xy * 2.0;\n\n\t\t\t\t\t\t\t\tuint meshIndex;\n\t\t\t\t\t\t\t\tfor (int i = 1; i < 257; i++) {\n\t\t\t\t\t\t\t\t\tif (splatIndex < meshIndexIntervals[i]) {\n\t\t\t\t\t\t\t\t\t\tmeshIndex = uint(i - 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfloat strideMulmeshIndex = float(4u*meshIndex);\n\t\t\t\t\t\t\t\tfloat meshMatrixWorldsTextureLength = float(256*4);\n\n\t\t\t\t\t\t\t\tmat4 modelMat = mat4(\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0))\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmat4 modelViewMat = viewMatrix * modelMat;\n\t\t\t\t\t\t\t\tvec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); \n vec4 clipCenter = projectionMatrix * viewCenter;\n\n vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg;\n vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg;\n vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg;\n\n vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r);\n vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg);\n\n \n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n\n mat3 W = transpose(mat3(modelViewMat));\n mat3 T = orthoZoom > 0.0 ? W : W * mat3(\n\t\t\t\t\t\t\t\t\tfocal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n\t\t\t\t\t\t\t\t\t0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n\t\t\t\t\t\t\t\t\t0., 0., 0.\n\t\t\t\t\t\t\t\t);\n mat3 cov2Dm = transpose(T) * Vrk * T;\n cov2Dm[0][0] += 0.3;\n cov2Dm[1][1] += 0.3;\n\n \n \n \n \n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n \n \n \n \n \n \n \n \n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(trace * trace / 4.0 - D);\n float eigenValue1 = traceOver2 + term2;\n\t\t\t\t\t\t\t\tfloat eigenValue2 = max(traceOver2 - term2, 0.00); \n\n const float maxSplatSize = 1024.0;\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n \n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize);\n vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize);\n\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport;\n\n\t\t\t\t\t\t\t\tif (orthoZoom > 0.0) {\n\t\t\t\t\t\t\t\t\tndcOffset *= orthoZoom;\n\t\t\t\t\t\t\t\t}\n\n gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n }",fragmentShader:"\n precision highp float;\n #include <common>\n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\t\t\t\t\t\tlayout(location = 1) out vec4 gVelocity; \n\n void main () {\n \n \n float A = -dot(vPosition, vPosition);\n if (A < -4.0) discard;\n vec3 color = vColor.rgb;\n A = exp(A) * vColor.a;\n gl_FragColor = vec4(color.rgb, A);\n\t\t\t\t\t\t\t\tgVelocity = vec4(0.0); \n }",transparent:!0,alphaTest:1,blending:At,depthTest:!0,depthWrite:!1,side:yt})}static buildGeomtery(t){let e=new mt;e.setIndex([0,1,2,0,2,3]);let n=new Float32Array(12),s=new ct(n,3);e.setAttribute("position",s),s.setXYZ(0,-1,-1,0),s.setXYZ(1,-1,1,0),s.setXYZ(2,1,1,0),s.setXYZ(3,1,-1,0),s.needsUpdate=!0;let i=(new et).copy(e),r=new Uint32Array(t),a=new wt(r,1,!1);return a.setUsage(xt),i.setAttribute("splatIndex",a),i.instanceCount=t,i}resetLocalSplatDataAndTexturesFromSplatBuffer(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}updateLocalSplatDataFromSplatBuffer(){this.splatBuffers.forEach(t=>t.buildPreComputedBuffers()),this.covariances=new Float32Array(6*this.splatCount),this.colors=new Uint8Array(4*this.splatCount),this.centers=new Float32Array(3*this.splatCount);let t=0,e=0,n=0;for(let s of this.splatBuffers){let i=s.nsplats;this.colors.subarray(t,t+4*i).set(s.colorsA),t+=4*i,this.centers.subarray(e,e+3*i).set(s.decoded.xyz.denormDequant().data),e+=3*i,this.covariances.subarray(n,n+6*i).set(new Float32Array(s.precomputedCovarianceBufferData)),n+=6*i}}allocateAndStoreLocalSplatDataInTextures(){let t=this.splatCount,e=new K(4096,1024);for(;e.x*e.y*2<6*t;)e.y*=2;let n,s,i=new K(4096,1024);for(;i.x*i.y*4<4*t;)i.y*=2;if(this.halfPrecisionCovariancesOnGPU){s=new Uint16Array(e.x*e.y*2);for(let t=0;t<this.covariances.length;t++)s[t]=dt.toHalfFloat(this.covariances[t]);n=new bt(s,e.x,e.y,st,H)}else s=new Float32Array(e.x*e.y*2),s.set(this.covariances),n=new bt(s,e.x,e.y,st,Z);n.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=n,this.material.uniforms.covariancesTextureSize.value.copy(e);let r=new Uint32Array(i.x*i.y*4);for(let e=0;e<t;e++){let t=4*e,n=3*e,s=4*e;r[s]=Gt(this.colors[t],this.colors[t+1],this.colors[t+2],this.colors[t+3]),r[s+1]=Nt(this.centers[n]),r[s+2]=Nt(this.centers[n+1]),r[s+3]=Nt(this.centers[n+2])}let a=new bt(r,i.x,i.y,rt,Mt);"webgpu"!==b()&&(a.internalFormat="RGBA32UI"),a.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=a,this.material.uniforms.centersColorsTextureSize.value.copy(i);let o=new Float32Array(4096);for(let t=0;t<this.meshMatrixWorlds.length;t++)o.set(this.meshMatrixWorlds[t].elements,16*t);let l=new bt(o,1024,1,nt,Z);l.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=l,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:s,texture:n,size:e},centerColors:{data:r,texture:a,size:i},meshMatrixWorlds:{data:o,texture:l}}}updateIndexes(t){let e=this.geometry;e.attributes.splatIndex.set(t),e.attributes.splatIndex.needsUpdate=!0,e.instanceCount=t.length}updateUniforms(t,e,n,s){this.splatCount>0&&(Vt.set(t.x*this.devicePixelRatio,t.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(Vt),this.material.uniforms.basisViewport.value.set(2/Vt.x,2/Vt.y),this.material.uniforms.focal.value.set(e,n),this.material.uniforms.orthoZoom.value=s,this.material.uniformsNeedUpdate=!0)}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(){return this.splatCount}getCenters(){return this.centers}getColors(){return this.colors}getCovariances(){return this.covariances}dispose(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose()),this.removeFromParent()}},Qt=new Promise(t=>{Lt=t}),Xt=!1;function Zt(){if(!Xt)return Yt||(Yt=async function(){let t=await import("./gaussian-splat-compression.js");Lt(t),Xt=!0}())}var Ht=new it,Kt=new tt,Jt=new $,$t=new $,te=new $,ee=new $,ne=new $,se=new $;function ie(t,e,n){n.length=0;let{axis:s,sign:i,limit:r}=e;for(let e=0;e<t.length;e++){let a=t[e],o=t[(e+1)%t.length],l=(0===s?a.px:1===s?a.py:a.pz)*i-r,d=(0===s?o.px:1===s?o.py:o.pz)*i-r,c=l<=0,h=d<=0;if(c&&n.push(a),c!==h){let t=l/(l-d);n.push({px:a.px+(o.px-a.px)*t,py:a.py+(o.py-a.py)*t,pz:a.pz+(o.pz-a.pz)*t,nx:a.nx+(o.nx-a.nx)*t,ny:a.ny+(o.ny-a.ny)*t,nz:a.nz+(o.nz-a.nz)*t})}}return n}function re(t,e,n,s,i,r,a,o,l){let d=t.geometry,c=d.getAttribute("position");if(void 0===c||0===c.count)return!0;let h=d.getAttribute("normal"),p=d.getIndex(),u=null!==p?p.count:c.count;if(u>15e5)return!0;let m=d.drawRange.start,f=m+(d.drawRange.count===1/0?u-m:Math.min(d.drawRange.count,u-m));Ht.copy(t.objectToDecal),Kt.getNormalMatrix(Ht);let y=[],g=[];for(let t=m;t+2<f;t+=3){let d=null!==p?p.getX(t):t,u=null!==p?p.getX(t+1):t+1,m=null!==p?p.getX(t+2):t+2;if(Jt.fromBufferAttribute(c,d).applyMatrix4(Ht),$t.fromBufferAttribute(c,u).applyMatrix4(Ht),te.fromBufferAttribute(c,m).applyMatrix4(Ht),Jt.z>n&&$t.z>n&&te.z>n||Jt.z<-n&&$t.z<-n&&te.z<-n)continue;ee.subVectors($t,Jt),ne.subVectors(te,Jt),se.crossVectors(ee,ne);let f=se.length();if(!(0===f||se.z/f<=.01)){if(y.length=0,void 0!==h)ee.fromBufferAttribute(h,d).applyMatrix3(Kt),y.push({px:Jt.x,py:Jt.y,pz:Jt.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,u).applyMatrix3(Kt),y.push({px:$t.x,py:$t.y,pz:$t.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,m).applyMatrix3(Kt),y.push({px:te.x,py:te.y,pz:te.z,nx:ee.x,ny:ee.y,nz:ee.z});else{se.divideScalar(f);for(let t of[Jt,$t,te])y.push({px:t.x,py:t.y,pz:t.z,nx:se.x,ny:se.y,nz:se.z})}for(let t of e){if(0===y.length)break;let e=ie(y,t,g);g=y,y=e}if(!(y.length<3)){if(a.length/3+3*(y.length-2)>3e5)return!1;for(let t=1;t+1<y.length;t++)for(let e of[y[0],y[t],y[t+1]]){l.push(e.px*s+.5,e.py*i+.5);let t=e.nx,n=e.ny,d=e.nz,c=Math.hypot(t,n,d);c>0?(t/=c,n/=c,d/=c):(t=0,n=0,d=1),a.push(e.px+t*r,e.py+n*r,e.pz+d*r),o.push(t,n,d)}}}}return!0}var ae=new lt,oe=new lt,le=new it,de=new $,ce=class extends C{constructor(t,e,n){super(t,e),this.data=e,this.geometry=new mt,this.lastSignature=[],this.nextSignature=[],this.scanned=[],this.lastParams={width:0,height:0,depth:0,offset:0},this.context=n;let s=this.data.geometry;this.lastParams={width:this.resolveNumber(s.width,0),height:this.resolveNumber(s.height,0),depth:this.resolveNumber(s.depth,0),offset:s.offset??0},this.geometry.userData={type:"DecalGeometry",parameters:{...this.lastParams}}}get isLOD(){return this.updateDecal(),!1}get isDecalObject(){return!0}resolveNumber(t,e){if("number"==typeof t)return t;let n=Number(this.context.shared.getVariable(t));return Number.isFinite(n)?n:e}currentParams(){let t=this.dataPatched.geometry;return{width:this.resolveNumber(t.width,this.lastParams.width),height:this.resolveNumber(t.height,this.lastParams.height),depth:this.resolveNumber(t.depth,this.lastParams.depth),offset:t.offset??0}}projectionRoot(){let t=this.parent;for(;null!==t&&B.is(t);){if("Page"===t.data?.type)return t;t=t.parent}return this.context.scene}scanTargets(t,e,n){let s=this.scanned;s.length=0;let i=this.projectionRoot();if(null===i)return s;ae.makeEmpty();for(let s=0;s<8;s++)de.set((1&s?.5:-.5)*t,(2&s?.5:-.5)*e,(4&s?.5:-.5)*n).applyMatrix4(this.matrixWorld),ae.expandByPoint(de);return i.traverse(t=>{if(t===this||!B.is(t)||!(t instanceof D)||t instanceof ce||"Mesh"!==t.dataPatched?.type||!t.visible||t.destroyedInAction||512&t.layers.mask)return;let e=t.geometry,n=e?.getAttribute("position");void 0===n||0===n.count||0!==e.drawRange.count&&(null===e.boundingBox&&e.computeBoundingBox(),oe.copy(e.boundingBox).applyMatrix4(t.matrixWorld),ae.intersectsBox(oe)&&s.push(t))}),s}collectSignature(t,e,n){t.length=0,t.push(n.width,n.height,n.depth,n.offset);for(let e of this.matrixWorld.elements)t.push(e);for(let n of e){t.push(n.id,n.geometry.id);let e=n.geometry.getAttribute("position");t.push(void 0===e?-1:"version"in e?e.version:e.data.version);let s=n.geometry.getIndex();t.push(null!==s?s.version:-1),t.push(n.geometry.drawRange.count===1/0?-1:n.geometry.drawRange.count);for(let e of n.matrixWorld.elements)t.push(e)}}signaturesEqual(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}updateDecal(){if(this.disposed)return!1;this.updateWorldMatrix(!0,!1);let t=this.currentParams(),e=this.scanTargets(t.width,t.height,t.depth);if(this.collectSignature(this.nextSignature,e,t),this.signaturesEqual(this.nextSignature,this.lastSignature))return!1;let n=this.lastSignature;this.lastSignature=this.nextSignature,this.nextSignature=n,this.lastParams=t,le.copy(this.matrixWorld).invert();let s=e.map(t=>({geometry:t.geometry,objectToDecal:(new it).multiplyMatrices(le,t.matrixWorld)}));return this.geometry.dispose(),this.geometry=function(t,e){let n=Math.max(Math.abs(e.width),1e-6),s=Math.max(Math.abs(e.height),1e-6),i=Math.max(Math.abs(e.depth),1e-6),r=[{axis:0,sign:1,limit:n/2},{axis:0,sign:-1,limit:n/2},{axis:1,sign:1,limit:s/2},{axis:1,sign:-1,limit:s/2},{axis:2,sign:1,limit:i/2},{axis:2,sign:-1,limit:i/2}],a=[],o=[],l=[];for(let d of t)if(!re(d,r,i/2,1/n,1/s,e.offset,a,o,l))break;let d=new mt;return d.setAttribute("position",new ht(a,3)),d.setAttribute("normal",new ht(o,3)),d.setAttribute("uv",new ht(l,2)),0===a.length?(d.setDrawRange(0,0),d.boundingSphere=new pt):d.computeBoundingSphere(),d}(s,t),this.geometry.userData={type:"DecalGeometry",parameters:{width:t.width,height:t.height,depth:t.depth}},g(this),x(this),this.resetBBoxNeedsUpdate(),!0}updateByPatchedOp(t,e,n){super.updateByPatchedOp(t,e,n),M(t.path,["geometry"])&&this.resetBBoxNeedsUpdate()}updateEntityBoxSize(t,e){let n=this.currentParams();t.setScalar(0),e.set(n.width,n.height,n.depth).multiplyScalar(.5)}dispose(){super.dispose(),this.geometry.dispose()}},he=class extends(A(vt,v)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),this.matrixAutoUpdate=!0}updateState(t,e){this.updateState_Entity(t,e)}},pe=function(){try{let t=window.location.href;if(t.includes("reducesubdiv=")){let e=t.indexOf("reducesubdiv=")+13;return parseInt(t.slice(e,e+1))}}catch{}}();function ue(n,s,i){if(console.assert(void 0!==s.type),"Mesh"===s.type)return function(t,e,n){let s;if(void 0!==pe&&e?.geometry&&"subdivisions"in e.geometry&&(e.geometry.subdivisions??0)>pe&&Object.assign(e.geometry,{subdivisions:pe}),"TextGeometry"===e.geometry.type||"InputGeometry"===e.geometry.type){let s=U(e.geometry.type);return s?s(t,e,n):(_("InputGeometry"===e.geometry.type?"textinputs":"text",`a Mesh with ${e.geometry.type}`),new w(t,e,n))}if("SubdivGeometry"===e.geometry.type)s=new y(t,e,n);else if("PathGeometry"===e.geometry.type||"VectorGeometry"===e.geometry.type||"ShapeBlendGeometry"===e.geometry.type){let i=U(e.geometry.type);i?s=i(t,e,n):(_("ShapeBlendGeometry"===e.geometry.type?"shape-blends":"PathGeometry"===e.geometry.type?"3d-paths":"vector-shapes",`a Mesh with ${e.geometry.type}`),s=new w(t,e,n))}else if("BooleanGeometry"===e.geometry.type)s=new d(t,e,n);else if("DecalGeometry"===e.geometry.type)s=new ce(t,e,n);else if("UIGeometry"===e.geometry.type){let i=U("UIGeometry");i?s=i(t,e,n):(_("ui-2d","a Mesh with UIGeometry"),s=new w(t,e,n))}else s=new w(t,e,n);return s}(n,s,i);if("Empty"===s.type)return new e(n,s);if("Particle"===s.type){let t=k("Particle");return t?t(n,s,i):(_("particles","a Particle system"),new e(n,s))}if("ParticleCollider"===s.type)return new f(n,s,i);if("Hair"===s.type){let t=k("Hair");return t?t(n,s,i):(_("hair","a Hair System"),new e(n,s))}if("Splat"===s.type)return new e(n,s);if("Bone"===s.type)return new he(n,s);if("Page"===s.type)return new a(n,s,i);if("PointLight"===s.type)return new t(n,s,i);if("SpotLight"===s.type)return new l(n,s,i);if("DirectionalLight"===s.type)return new o(n,s,i);if("Component"===s.type||"Instance"===s.type){let t=k(s.type);return t?t(n,s,i):(_("components",`a ${s.type}`),new e(n,s))}return G.is(s.type)?new m(n,s):(console.error(s),new e(n,s))}P.createEntity=ue,P.changeEntityProptotype=function(t,e,n){let s=ue(t.identity,e,n),i=t.children,r=t.attachedPaths,a=t.parent,o=t.component,l=t.instances,d=t.overrideData,c=t.uuid,h=t.stateSelection;t.dispose();for(let e of Object.keys(t))delete t[e];Object.setPrototypeOf(t,Object.getPrototypeOf(s));for(let e of Object.keys(s))t[e]=s[e];t.children=[...t.children,...i],t.attachedPaths=r,t.parent=a,t.component=o,t.instances=l,t.uuid=c,t.overrideData=d,t.updateState(t.data,n),h&&t.changeSelectedState(h,n),t.resetBBoxNeedsUpdate()};var me,fe=class{constructor(){this._constraints=new Map}setConstraint(t,e){null===e?this._constraints.delete(t):this._constraints.set(t,e)}removeDependencies(t){this._constraints.delete(t)}applyConstraints(t){let e=new Set;this._constraints.forEach((n,s)=>{let i=[s,n],r=n;for(;this._constraints.has(r);){if(r=this._constraints.get(r),i.includes(r)){console.warn(`circular dependency detected: ${i.join(" -> ")}`);break}e.has(r)||i.push(r)}for(let n=i.length-2;n>=0;n--)if(!e.has(i[n])){let s=t.find(i[n]);s?s.applyPathSnapping(t):console.warn(`missing entity ${i[n]}`),e.add(i[n])}})}findDependency(t,e){let n=t;for(;this._constraints.has(n);)if(n=this._constraints.get(n),n===e)return!0;return!1}},ye=class{};Pt(ye,"DepthMapRange",65536),Pt(ye,"MemoryPageSize",65536),Pt(ye,"BytesPerFloat",4),Pt(ye,"BytesPerInt",4),Qt.then(t=>me=t);var ge=class{constructor(t={}){Pt(this,"updateView",function(){let t=new it,e=[],n=new $(0,0,-1),s=new $(0,0,-1),i=new $,r=new $;return function(a=!1,o){let l=this.updateMatrixWorldsInWorkerIfNeeded(),d=this.cropsChanged();if(!a){s.set(0,0,-1).applyQuaternion(o.quaternion);let t=!1,e=!1;if(s.dot(n)<=.95&&(t=!0),r.copy(o.position).sub(i).length()>=1&&(e=!0),!(t||e||l||d||this.needsInitialRender))return}this.needsInitialRender=!1,i.copy(o.position),n.copy(s),t.copy(o.matrixWorld).invert(),t.premultiply(this.dummyPerspectiveMatrix),e[0]=o.position.x,e[1]=o.position.y,e[2]=o.position.z;let c={sort:{view:t.elements,cameraPosition:e,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount},...l?{newMatrixWorlds:this.meshMatrixWorlds}:{},...d?{newCropsArray:this.cropsArray}:{}};this.sortRunning?this.queuedMessage=c:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(c))}}()),this.scene=t.scene,this.currentPage=null,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null,this.needsInitialRender=!0,this.dummyPerspectiveMatrix=(new it).makePerspective(-1,1,-1,1,.1,1e3)}updateSplatMeshUniforms(t,e){let n=new K;null!==this.splatMesh&&this.splatMesh.getSplatCount()>0&&(t.getSize(n),this.cameraFocalLengthX=e.projectionMatrix.elements[0]*this.devicePixelRatio*n.x*.45,this.cameraFocalLengthY=e.projectionMatrix.elements[5]*this.devicePixelRatio*n.y*.45,this.splatMesh.updateUniforms(n,this.cameraFocalLengthX,this.cameraFocalLengthY,e.isPerspectiveCamera?-1:e.zoom*this.devicePixelRatio))}loadSplat(t={}){this.activePage=this.scene.activePage,t.position&&(t.position=(new $).fromArray(t.position)),t.orientation&&(t.orientation=(new J).fromArray(t.orientation)),t.halfPrecisionCovariances=!!t.halfPrecisionCovariances;let e=[];if(this.splatEntries=e,this.activePage.traverseVisibleEntity(t=>{"Splat"===t.data.type&&e.push(t)}),this.splatMesh&&this.splatMesh.dispose(),0===e.length)return this.splatMesh=null,!1;this.meshMatrixWorlds=e.map(t=>t.matrixWorld),this.meshMatrixWorldsOld=e.map(t=>t.matrixWorld.clone()),this.cropsArray=e.map(t=>t.data.crops.map(t=>t.data)),this._splatBufferCache??(this._splatBufferCache=new WeakMap);let n=e.map(t=>{let e=this._splatBufferCache.get(t.data.buffer);return void 0===e&&(e=new me.GSplineBuffer(new Uint8Array(t.data.buffer).buffer),this._splatBufferCache.set(t.data.buffer,e)),e}),s=0,i=[0];for(let t of n)s+=t.getSplatCount(),i.push(s);return this.setupSplatMesh(n,s,t.position,t.orientation,t.halfPrecisionCovariances,this.devicePixelRatio,i,this.meshMatrixWorlds),this.setupSortWorker(s),!0}updateMatrixWorldsInWorkerIfNeeded(){let t=this.splatDataTextures.meshMatrixWorlds.data;for(let e=0;e<this.meshMatrixWorlds.length;e++)t.set(this.meshMatrixWorlds[e].elements,16*e);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,!this.meshMatrixWorlds.every((t,e)=>t.equals(this.meshMatrixWorldsOld[e]))&&(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map(t=>t.clone()),!0)}cropsChanged(){let t=!1;return this.splatEntries.forEach((e,n)=>{e.data.crops.forEach((e,s)=>{void 0===this.cropsArray[n][s]?(t=!0,this.cropsArray[n][s]=e.data):Object.entries(e.data).forEach(([e,i])=>{(Array.isArray(i)&&i.some((t,i)=>t!==this.cropsArray[n][s][e][i])||i!==this.cropsArray[n][s]?.[e])&&(t=!0,this.cropsArray[n][s][e]=i)})}),e.data.crops.length!==this.cropsArray[n]?.length&&(this.cropsArray[n].length=e.data.crops.length,t=!0)}),t}setupSplatMesh(t,e,n=new $,s=new J,i=!1,r=1,a,o){this.splatMesh=qt.buildMesh(t,e,i,r,a,o),this.splatMesh.position.copy(n),this.splatMesh.quaternion.copy(s),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=99999,this.splatRenderCount=e,this.splatMesh.onBeforeRender=(t,e,n)=>this.update(t,n)}setupSortWorker(t){this.sortWorker=function(t){let e=new Worker(URL.createObjectURL(new Blob(["(","\nfunction sortWorker(self) {\n\tlet wasmInstance;\n\tlet splatCount;\n\tlet splatRC;\n\tlet indexesOffset;\n\tlet positionsOffset;\n\tlet viewProjOffset;\n\tlet frequenciesOffset;\n\tlet indexesOutOffset;\n\tlet sortBuffersOffset;\n\tlet wasmMemory;\n\tlet positions;\n\n\tlet Constants;\n\tlet floatPositions;\n\tlet meshIndexIntervals;\n\tlet meshMatrixWorlds;\n\tlet cropsArray;\n\n\tfunction sort(viewProj) {\n\t\t// console.time('WASM SORT');\n\t\tconst viewProjArray = new Float64Array(wasmMemory, viewProjOffset, 16);\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tviewProjArray[i] = viewProj[i];\n\t\t}\n\t\tlet indexesBuffer;\n\t\t// console.timeEnd('WASM SORT');\n\t\tif (splatRC > 1) {\n\t\t\twasmInstance.exports.sortIndexes(\n\t\t\t\tindexesOffset,\n\t\t\t\tpositionsOffset,\n\t\t\t\tsortBuffersOffset,\n\t\t\t\tviewProjOffset,\n\t\t\t\tfrequenciesOffset,\n\t\t\t\tindexesOutOffset,\n\t\t\t\tConstants.DepthMapRange,\n\t\t\t\tsplatRC\n\t\t\t);\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t\tindexes.set(new Uint32Array(wasmMemory, indexesOutOffset, splatRC));\n\t\t} else if (splatRC === 1) {\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexes[0] = new Uint32Array(wasmMemory, indexesOffset, splatCount)[0];\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t} else {\n\t\t\tindexesBuffer = new ArrayBuffer(0);\n\t\t}\n\n\t\tself.postMessage(\n\t\t\t{\n\t\t\t\tsortDone: true,\n\t\t\t\tindexesBuffer,\n\t\t\t},\n\t\t\t[indexesBuffer]\n\t\t);\n\t}\n\tfunction updateRenderedSplats(\n\t\tmeshMatrixWorlds,\n\t\tcropsArray,\n\t\tmeshIndexIntervals\n\t) {\n\t\tconst renderedPositions = new Float32Array(\n\t\t\twasmMemory,\n\t\t\tpositionsOffset,\n\t\t\tsplatCount * 3\n\t\t);\n\t\tsplatRC = 0;\n\t\tconst wasmMemoryIndexes = new Uint32Array(\n\t\t\twasmMemory,\n\t\t\tindexesOffset,\n\t\t\tsplatCount\n\t\t);\n\t\tfor (let i = 0; i < meshIndexIntervals.length - 1; i++) {\n\t\t\tconst crops = cropsArray[i];\n\t\t\tconst matrixWorld = meshMatrixWorlds[i].elements;\n\t\t\tconst paramsIn = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tconst paramsOut = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tfor (let j = meshIndexIntervals[i]; j < meshIndexIntervals[i + 1]; j++) {\n\t\t\t\tconst x = floatPositions[j * 3];\n\t\t\t\tconst y = floatPositions[j * 3 + 1];\n\t\t\t\tconst z = floatPositions[j * 3 + 2];\n\t\t\t\tif (\n\t\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t\t) {\n\t\t\t\t\tconst w =\n\t\t\t\t\t\t1 /\n\t\t\t\t\t\t(matrixWorld[3] * x +\n\t\t\t\t\t\t\tmatrixWorld[7] * y +\n\t\t\t\t\t\t\tmatrixWorld[11] * z +\n\t\t\t\t\t\t\tmatrixWorld[15]);\n\t\t\t\t\trenderedPositions[splatRC * 3] =\n\t\t\t\t\t\t(matrixWorld[0] * x +\n\t\t\t\t\t\t\tmatrixWorld[4] * y +\n\t\t\t\t\t\t\tmatrixWorld[8] * z +\n\t\t\t\t\t\t\tmatrixWorld[12]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 1] =\n\t\t\t\t\t\t(matrixWorld[1] * x +\n\t\t\t\t\t\t\tmatrixWorld[5] * y +\n\t\t\t\t\t\t\tmatrixWorld[9] * z +\n\t\t\t\t\t\t\tmatrixWorld[13]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 2] =\n\t\t\t\t\t\t(matrixWorld[2] * x +\n\t\t\t\t\t\t\tmatrixWorld[6] * y +\n\t\t\t\t\t\t\tmatrixWorld[10] * z +\n\t\t\t\t\t\t\tmatrixWorld[14]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\twasmMemoryIndexes[splatRC] = j;\n\t\t\t\t\tsplatRC++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction getOutOfBoundsIndexes(floatPositions, crops) {\n\t\tconst outOfBoundsIndexes = [];\n\t\tconst paramsIn = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\t\tconst paramsOut = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\n\t\tconst len = floatPositions.length;\n\t\tfor (let j = 0; j < len; j += 3) {\n\t\t\tconst x = floatPositions[j];\n\t\t\tconst y = floatPositions[j + 1];\n\t\t\tconst z = floatPositions[j + 2];\n\t\t\tif (\n\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t) {\n\t\t\t\t// in bounds: intentionally skip\n\t\t\t} else {\n\t\t\t\toutOfBoundsIndexes.push(j / 3);\n\t\t\t}\n\t\t}\n\t\t// console.log(outOfBoundsIndexes);\n\t\treturn outOfBoundsIndexes;\n\t}\n\n\tfunction isInBounds(x, y, z, params, mode) {\n\t\treturn params[mode === 'Intersect' ? 'every' : 'some']((param) => {\n\t\t\tconst t = applyRotationMatrix(\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\tz,\n\t\t\t\tparam.invRotationMatrix,\n\t\t\t\tparam.cropCenter\n\t\t\t);\n\t\t\treturn Array.isArray(param)\n\t\t\t\t? isVertexInsideBoundingBox(t.x, t.y, t.z, param)\n\t\t\t\t: isPointInsideEllipsoid(t.x, t.y, t.z, param);\n\t\t});\n\t}\n\tfunction applyRotationMatrix(_x, _y, _z, e, pivot) {\n\t\tconst x = _x - pivot[0];\n\t\tconst y = _y - pivot[1];\n\t\tconst z = _z - pivot[2];\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\treturn {\n\t\t\tx: (e[0] * x + e[4] * y + e[8] * z + e[12]) * w + pivot[0],\n\t\t\ty: (e[1] * x + e[5] * y + e[9] * z + e[13]) * w + pivot[1],\n\t\t\tz: (e[2] * x + e[6] * y + e[10] * z + e[14]) * w + pivot[2],\n\t\t};\n\t}\n\tfunction computeBoundingBoxVertices(box) {\n\t\tconst halfSizeX = box.cropSize[0] / 2;\n\t\tconst halfSizeY = box.cropSize[1] / 2;\n\t\tconst halfSizeZ = box.cropSize[2] / 2;\n\t\tconst bounds = [\n\t\t\tbox.cropCenter[0] - halfSizeX,\n\t\t\tbox.cropCenter[1] - halfSizeY,\n\t\t\tbox.cropCenter[2] - halfSizeZ,\n\t\t\tbox.cropCenter[0] + halfSizeX,\n\t\t\tbox.cropCenter[1] + halfSizeY,\n\t\t\tbox.cropCenter[2] + halfSizeZ,\n\t\t];\n\t\tconst invRotationMatrix = getInvRotationMatrix(box.cropRotation);\n\t\treturn Object.assign(bounds, {\n\t\t\tinvRotationMatrix,\n\t\t\tcropCenter: box.cropCenter,\n\t\t});\n\t}\n\tfunction getInvRotationMatrix(_rotation) {\n\t\tconst te = [];\n\t\tconst x = (_rotation[0] * Math.PI) / 180,\n\t\t\ty = (_rotation[1] * Math.PI) / 180,\n\t\t\tz = (_rotation[2] * Math.PI) / 180;\n\t\tconst a = Math.cos(x),\n\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\tf = Math.sin(z);\n\t\tconst ae = a * e,\n\t\t\taf = a * f,\n\t\t\tbe = b * e,\n\t\t\tbf = b * f;\n\n\t\tte[0] = c * e;\n\t\tte[1] = -c * f;\n\t\tte[2] = d;\n\n\t\tte[4] = af + be * d;\n\t\tte[5] = ae - bf * d;\n\t\tte[6] = -b * c;\n\n\t\tte[8] = bf - ae * d;\n\t\tte[9] = be + af * d;\n\t\tte[10] = a * c;\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\n\t\treturn te;\n\t}\n\tfunction isVertexInsideBoundingBox(x, y, z, bounds) {\n\t\treturn (\n\t\t\tx >= bounds[0] &&\n\t\t\tx <= bounds[3] &&\n\t\t\ty >= bounds[1] &&\n\t\t\ty <= bounds[4] &&\n\t\t\tz >= bounds[2] &&\n\t\t\tz <= bounds[5]\n\t\t);\n\t}\n\tfunction computeEllipsoidParams(ellipsoid) {\n\t\t// Precompute the scaling factors\n\t\tconst invRadiusX = 2 / ellipsoid.cropSize[0];\n\t\tconst invRadiusY = 2 / ellipsoid.cropSize[1];\n\t\tconst invRadiusZ = 2 / ellipsoid.cropSize[2];\n\t\tconst invRotationMatrix = getInvRotationMatrix(ellipsoid.cropRotation);\n\t\treturn {\n\t\t\tinvRadiusX,\n\t\t\tinvRadiusY,\n\t\t\tinvRadiusZ,\n\t\t\tcropCenter: ellipsoid.cropCenter,\n\t\t\tinvRotationMatrix,\n\t\t};\n\t}\n\tfunction isPointInsideEllipsoid(x, y, z, ellipsoidParams) {\n\t\tconst _x = (x - ellipsoidParams.cropCenter[0]) * ellipsoidParams.invRadiusX;\n\t\tconst _y = (y - ellipsoidParams.cropCenter[1]) * ellipsoidParams.invRadiusY;\n\t\tconst _z = (z - ellipsoidParams.cropCenter[2]) * ellipsoidParams.invRadiusZ;\n\t\treturn _x * _x + _y * _y + _z * _z <= 1;\n\t}\n\n\tself.onmessage = (e) => {\n\t\tif (e.data.getCroppedIndexes) {\n\t\t\tconst outOfBoundsIndexes = new Uint32Array(\n\t\t\t\tgetOutOfBoundsIndexes(new Float32Array(e.data.positions), e.data.crops)\n\t\t\t).buffer;\n\t\t\tself.postMessage(\n\t\t\t\t{\n\t\t\t\t\toutOfBoundsIndexes,\n\t\t\t\t},\n\t\t\t\t[outOfBoundsIndexes]\n\t\t\t);\n\t\t} else if (e.data.positions) {\n\t\t\tpositions = e.data.positions;\n\t\t\tfloatPositions = new Float32Array(positions);\n\t\t\tmeshMatrixWorlds = e.data.meshMatrixWorlds;\n\t\t\tcropsArray = e.data.cropsArray;\n\t\t\tmeshIndexIntervals = e.data.meshIndexIntervals;\n\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\tself.postMessage({\n\t\t\t\tsortSetupComplete: true,\n\t\t\t});\n\t\t} else if (e.data.sort || e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\tif (e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\t\tcropsArray = e.data.newCropsArray || cropsArray;\n\t\t\t\tmeshMatrixWorlds = e.data.newMatrixWorlds || meshMatrixWorlds;\n\t\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\t}\n\t\t\tsort(e.data.sort.view, e.data.sort.cameraPosition);\n\t\t} else if (e.data.init) {\n\t\t\t// Yep, this is super hacky and gross :(\n\t\t\tConstants = e.data.init.Constants;\n\n\t\t\tsplatCount = e.data.init.splatCount;\n\n\t\t\tconst INDEXES_BYTES_PER_ENTRY = Constants.BytesPerInt;\n\t\t\tconst POSITIONS_BYTES_PER_ENTRY = Constants.BytesPerFloat * 3;\n\n\t\t\tconst sorterWasmBytes = new Uint8Array(e.data.init.sorterWasmBytes);\n\t\t\tconst memoryBytesPerVertex =\n\t\t\t\tINDEXES_BYTES_PER_ENTRY + POSITIONS_BYTES_PER_ENTRY;\n\t\t\tconst memoryRequiredForVertices = splatCount * memoryBytesPerVertex;\n\t\t\tconst memoryRequiredForSortBuffers =\n\t\t\t\tsplatCount * Constants.BytesPerInt * 2 +\n\t\t\t\tConstants.DepthMapRange * Constants.BytesPerInt * 2;\n\t\t\tconst extraMemory = Constants.MemoryPageSize * 32;\n\t\t\tconst totalRequiredMemory =\n\t\t\t\tmemoryRequiredForVertices + memoryRequiredForSortBuffers + extraMemory;\n\t\t\tconst totalPagesRequired =\n\t\t\t\tMath.floor(totalRequiredMemory / Constants.MemoryPageSize) + 1;\n\t\t\tconst sorterWasmImport = {\n\t\t\t\tmodule: {},\n\t\t\t\tenv: {\n\t\t\t\t\tmemory: new WebAssembly.Memory({\n\t\t\t\t\t\tinitial: totalPagesRequired * 2,\n\t\t\t\t\t\tmaximum: totalPagesRequired * 3,\n\t\t\t\t\t\tshared: true,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t};\n\t\t\tWebAssembly.compile(sorterWasmBytes)\n\t\t\t\t.then((wasmModule) => {\n\t\t\t\t\treturn WebAssembly.instantiate(wasmModule, sorterWasmImport);\n\t\t\t\t})\n\t\t\t\t.then((instance) => {\n\t\t\t\t\twasmInstance = instance;\n\t\t\t\t\tindexesOffset = 0;\n\t\t\t\t\tpositionsOffset = splatCount * INDEXES_BYTES_PER_ENTRY;\n\t\t\t\t\tviewProjOffset =\n\t\t\t\t\t\tpositionsOffset + splatCount * POSITIONS_BYTES_PER_ENTRY;\n\t\t\t\t\tsortBuffersOffset = viewProjOffset + 16 * Constants.BytesPerFloat * 2;\n\t\t\t\t\tfrequenciesOffset =\n\t\t\t\t\t\tsortBuffersOffset + splatCount * Constants.BytesPerInt;\n\t\t\t\t\tindexesOutOffset =\n\t\t\t\t\t\tfrequenciesOffset + Constants.DepthMapRange * Constants.BytesPerInt;\n\t\t\t\t\twasmMemory = sorterWasmImport.env.memory.buffer;\n\t\t\t\t\tself.postMessage({\n\t\t\t\t\t\tsortSetupPhase1Complete: true,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\t};\n}\n",")(self)"],{type:"application/javascript"}))),n=atob("AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL"),s=new Uint8Array(n.length);for(let t=0;t<n.length;t++)s[t]=n.charCodeAt(t);return e.postMessage({init:{sorterWasmBytes:s.buffer,splatCount:t,Constants:{BytesPerFloat:ye.BytesPerFloat,BytesPerInt:ye.BytesPerInt,DepthMapRange:ye.DepthMapRange,MemoryPageSize:ye.MemoryPageSize}}}),e}(t),this.sortWorker.onmessage=t=>{t.data.sortDone?(this.sortRunning=!1,this.splatMesh?.updateIndexes(new Uint32Array(t.data.indexesBuffer)),this.lastSortTime=t.data.sortTime,this.queuedMessage&&(this.sortWorker.postMessage(this.queuedMessage),this.queuedMessage=null)):t.data.sortCanceled?this.sortRunning=!1:t.data.sortSetupPhase1Complete?this.sortWorker.postMessage({positions:this.splatMesh.getCenters().buffer,meshMatrixWorlds:this.splatMesh.meshMatrixWorlds,meshIndexIntervals:this.splatMesh.meshIndexIntervals,cropsArray:this.cropsArray}):t.data.sortSetupComplete&&(this.splatDataTextures=this.splatMesh.getSplatDataTextures(),this.scene.activePage.add(this.splatMesh),this.needsInitialRender=!0)}}update(t,e){null!==this.splatMesh&&(this.updateSplatMeshUniforms(t,e),this.updateView(!1,e))}getSplatMesh(){return this.splatMesh}},xe=new ft;xe.wireframe=!0;var ve=new $,Ae=class extends ot{constructor(t,n){super(),this.data=t,this.sharedAssets=n,this.enableHelpers=!1,this.wireframeState=!1,this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this._needsTransmission=!1,this._needsNormal=!1,this._normalPassNeeds={outline:!1,cavity:!1},this._needsReflection=!1,this.geometryCacheChanged=!1,this.splatViewer=null,this.shapeBlendIntances=[],this.hairInstances=[],this.shadowsDirty=!0,this.instanceGroupsDirty=!0,this._autoInstancing=null,this.entityByUuid={},this.entityIdentityToEntity={},this.toExpandCloner=new Set,this.toUpdateCloner=new Set,this.pendingCommands=[],this.pathConstraints=new fe,this.invisibleObjects=new e("jflkdsafjasdifjaslk",{...X.defaultData,visible:!1,name:"buildin invisible"}),this.needsRecomputeInstances=!1,this.init(t,n),this.matrixAutoUpdate=!1,this.errorPage=new a("fdasfa",{...N.defaultData,name:""},{shared:n,scene:this})}markGeometryCacheDirty(){this.geometryCacheChanged=!0}markShadowsDirty(){this.shadowsDirty=!0}markInstanceGroupsDirty(){this.instanceGroupsDirty=!0}get autoInstancing(){return this._autoInstancing}updateInstanceGroups(t,e){let n=this._autoInstancing;(null===n||n.minGroupSize!==e)&&(n?.dispose(),n=new Ut(e),this._autoInstancing=n);let s=this.instanceGroupsDirty;return this.instanceGroupsDirty=!1,n.update(t,s),n.stats}releaseInstanceGroups(){this._autoInstancing?.teardown(),this.instanceGroupsDirty=!0}markNeedsUpdateRendererDirty(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this.shadowsDirty=!0,this.instanceGroupsDirty=!0}needsTransmission(){return this.needsTransmissionDirty&&(this._needsTransmission=s(this),this.needsTransmissionDirty=!1),this._needsTransmission}needsNormal(){return this.needsNormalDirty&&(this._normalPassNeeds=n(this),this._needsNormal=this._normalPassNeeds.outline||this._normalPassNeeds.cavity,this.needsNormalDirty=!1),this._needsNormal}normalPassNeeds(){return this.needsNormal(),this._normalPassNeeds}needsReflection(){return this.needsReflectionDirty&&(this._needsReflection=i(this),this.needsReflectionDirty=!1),this._needsReflection}registerInstanceAndSetUuid(t){let e=t.identity.join("-"),n=this.entityIdentityToEntity[e];n&&(t.uuid=n.uuid),this.entityIdentityToEntity[e]=t,this.entityByUuid[t.uuid]=t}markPenumbraSizeDirty(){for(let t of this.children)t instanceof a&&(t.penumbraSizeArrayCache=null)}findInstance(t){return this.entityIdentityToEntity[t.join("-")]}get bgColor(){return this.activePage.bgColor}get postprocessing(){return this.activePage.data.postprocessing}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let n=[],s=e;for(;s!==this;){let t=s;s=s.parent;let e=s.children.indexOf(t);n.splice(0,0,e)}return{entity:e,sortKey:n}}getAllSorted(t){let e=[];for(let n of t){let t=this.getWithSortKey(n.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>L(t.sortKey,e.sortKey)),e.map(t=>t.entity)}nonExistOrDescendantOf(t,e){let n=this.find(t);if(void 0===n)return!0;for(;n;){if(n.uuid===e)return!0;n=n.parent}return!1}find(t){if(this.activePage&&this.activePage.personalCamera.parent){if("f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera"===t)return this.activePage.personalCamera;if(t===Q)return this.activePage.personalCamera}if(""===t||void 0===t)return;let e=this.entityByUuid[t];return void 0===e?this.getObjectByProperty("uuid",t):e}find2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene){let n=e.uiScene.find(t);if(n)return n}}findScene2DfromObject2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene&&e.uiScene.find(t))return e.uiScene}find2DInUIObjects(t){let e;return this.traverseEntity(n=>{void 0===e&&W(n)&&(e=n.uiCanvas.find(t))}),e}traverse2D(t){for(let e of this.children)e instanceof a&&e.uiScene&&e.uiScene.traverse(t)}debugEnsureEntity(t){let e=this.find(t);e?Array.isArray(e.identity)&&void 0===this.findInstance(e.identity)&&console.error("not found instance"):console.error("not found")}addPendingExpandCloner(t){this.toExpandCloner.add(t)}addPendingUpdateCloner(t){this.toUpdateCloner.add(t)}markToExpandCloner(t){this.toExpandCloner.add(t),t.traverseEntityAncestors(t=>{this.toExpandCloner.add(t)})}doPendingExpandCloner(t){this.toExpandCloner.forEach(e=>{e.expandCloner(t)}),this.toExpandCloner.clear()}doPendingUpdateCloner(t){this.toUpdateCloner.forEach(e=>{e.cloner?.update(t)}),this.toUpdateCloner.clear()}doPendingUpdates(t){this.doPendingExpandCloner(t),this.doPendingUpdateCloner(t),this.applyPendingCommands()}addPendingCommand(t){this.pendingCommands.push(t)}applyPendingCommands(){this.pendingCommands.forEach(t=>t()),this.pendingCommands.length=0}updateByLibOp(t,e){1===t.path.length&&"components"===t.path[0]&&1===t.type&&this.createChildrenObjects([{...t.data.asset,id:t.id}],this.invisibleObjects,e)}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let n=null===t.parent?this:this.find(t.parent);if(void 0===n)throw new Error(`scene tree add: parent ${t.parent} not found for object ${t.id}`);let s=this.createObject(t.id,t.data,t.children,n,t.localIndex,e);s.updateVisible(this),s.resetBBoxNeedsUpdate(),c(s)&&h(s.parent)&&(s.invalidateUpstreamBooleanData(),s.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(s),this.markToExpandCloner(s),this.markPenumbraSizeDirty(),s.updatePathSnapping()}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree delete: object ${t.id} not found`);e.traverseEntity(t=>{O(t)&&(this.shapeBlendIntances=this.shapeBlendIntances.filter(e=>e!==t)),R(t)&&(this.hairInstances=this.hairInstances.filter(e=>e!==t))}),this.markToExpandCloner(e),e.resetBBoxNeedsUpdate(),this.unregisterObject(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(e),this.markPenumbraSizeDirty(),e.parent.remove(e),h(e.parent)&&(e.parent.invalidateUpstreamBooleanData(),e.parent.invalidateDownstreamBooleanData().recomputeBoolean()),c(e)&&(e.freeBooleanPointer(),n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),z(e)&&e.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(e),this.pathConstraints.removeDependencies(e.uuid),e.updatePathSnapping()}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree move: object ${t.id} not found`);this.markNeedsRecomputeInstancesForChildren(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),e.cloner?.resetOnMove(),this.markToExpandCloner(e);let s=null===t.parent?this:this.find(t.parent);if(void 0===s)throw new Error(`scene tree move: new parent ${t.parent} not found for object ${t.id}`);s.add(e),this.markNeedsRecomputeInstancesForAncessors(s),this.markToExpandCloner(e),e.invalidateClonerTransform(e),e.updateVisible(this),e.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();let i=t.localIndex;s.children.splice(i,0,s.children.pop()),c(e)&&(e.invalidateUpstreamBooleanData(),h(e.parent)?e.parent.invalidateDownstreamBooleanData().recomputeBoolean():n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),e.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}get playPage(){return this.find(this.data.publish.playPage)??this.errorPage}updatePage(t){this.shadowsDirty=!0,this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;for(let e of this.children)e instanceof a&&(e.visible=e.uuid===t,e.visible&&(this.activePage=e,this.activePage.onActive(this)));this.activePage!==this.splatViewer?.activePage&&this.reloadSplats()}updateEntityByOp(t,e,n,s){if(this.shadowsDirty=!0,0===e.type){if(("overrides"in e.props||"component"in e.props)&&this.markNeedsRecomputeInstances(),"visible"in e.props&&this.markPenumbraSizeDirty(),e.path.includes("overrides")&&"states"in e.props){let{rest:t}=e.props;e={...e,props:t},this.markNeedsRecomputeInstances()}"pathSnapping"===e.path[0]&&void 0!==e.props.pathId&&this.pathConstraints.setConstraint(t,e.props.pathId)}let i=this.find(t);if(i)try{(function(t,e,n,s){t.updateByOp(e,n,s,!1)})(i,e,n,{scene:this,shared:s}),i instanceof w&&i.updateGeometryGroupsIfNeeded()}catch(t){console.error(t)}}updateEntity2DByOp(t,e,n,s,i,r=[]){t.updateEntityByOp(e,n,s,i),this.traverseEntity(t=>{(W(t)||t instanceof a)&&(r.includes(t.frameId??"")||t.frameId===e)&&t.updateEntity2DByOp(e,n,s,i)})}get activeCamera(){return this.activePage.activeCamera}switchActiveCamera(t){this.activePage.switchActiveCamera(t)}isInvisibleObjects(t){return t===this.invisibleObjects||t.hasAnccestor(this.invisibleObjects)}init(t,e){let n=Object.entries(e.data.lib.components).map((t,e)=>({data:t[1].asset.data,children:t[1].asset.children,id:t[0],fi:e}));this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:e}),this.add(this.invisibleObjects),this.createChildrenObjects(n,this.invisibleObjects,e),this.createChildrenObjects(t.objects,this,e),this.updatePage(t.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(e,!0),this.traverseEntity(t=>{t instanceof m&&t.updateUp()}),this.doPendingExpandCloner({scene:this,shared:e}),this.applyPendingCommands()}markNeedsRecomputeInstances(){this.needsRecomputeInstances=!0}markNeedsRecomputeInstancesForChildren(t){t.traverseEntity(t=>{("Component"===t.data.type||"Instance"===t.data.type)&&this.markNeedsRecomputeInstances()})}markNeedsRecomputeInstancesForAncessors(t){B.is(t)&&("Component"===t.data.type&&this.markNeedsRecomputeInstances(),t.traverseAncestors(t=>{B.is(t)&&"Component"===t.data.type&&this.markNeedsRecomputeInstances()}))}relativeizeInner(t,e,n,s,i,r,a){if(t){let o=s.find(t);o&&o!==s&&i.forInstancesRec(s=>{s.data=Y(s.data,i=>{let o=i.events.data(a.id),l=s.goUp(r);if(l){let s=[...F(l.identity),t].join("-"),i=this.entityIdentityToEntity[s];if(i){let t=i.uuid;q.zoom(o,e)[n]=t}else console.warn("cannot find instance")}}).data})}}rewriteActions(t,e,n,s,i,r){t.forEach(t=>{"Transition"===t.data.type||"Animation"===t.data.type?this.relativeizeInner(t.data.object,[...e,t.id],"object",n,s,i,r):"Conditional"===t.data.type&&(this.rewriteActions(t.data.ifActions,[...e,t.id,"ifActions"],n,s,i,r),this.rewriteActions(t.data.elseActions,[...e,t.id,"elseActions"],n,s,i,r))})}rewriteEventsBeforeGoToPlayMode(){this.traverseEntity(t=>{if(T(t)&&"string"==typeof t.identity&&"Component"===t.data.type)return t.traverseEntity((e,n)=>{e.data.events.forEach(s=>{if("GameControl"===s.data.type){let i=!1;if(e.forInstancesRec(t=>{t.data=Y(t.data,e=>{t.isInstanceRoot||(e.events.delete(s.id),i=!0)}).data}),!1===i)for(let i of V.list)this.rewriteActions(s.data.gameActions[i],["gameActions",i],t,e,n,s)}else"Conditional"===s.data.type?("Distance"===s.data.condition.type?(this.relativeizeInner(s.data.condition.fromObject,["condition"],"fromObject",t,e,n,s),this.relativeizeInner(s.data.condition.toObject,["condition"],"toObject",t,e,n,s)):"State"===s.data.condition.type?this.relativeizeInner(s.data.condition.object,["condition"],"object",t,e,n,s):"Comparison"===s.data.condition.type&&("Property"===s.data.condition.lOperand.type&&this.relativeizeInner(s.data.condition.lOperand.value[0],["condition","lOperand","value"],0,t,e,n,s),"Property"===s.data.condition.rOperand.type&&this.relativeizeInner(s.data.condition.rOperand.value[0],["condition","rOperand","value"],0,t,e,n,s)),this.rewriteActions(s.data.inActions,["inActions"],t,e,n,s),this.rewriteActions(s.data.outActions,["outActions"],t,e,n,s)):"actions"in s.data&&this.rewriteActions(s.data.actions,["actions"],t,e,n,s)})}),!0})}expandInstances(t,e,n){let s=new Set;this.traverseEntity(i=>{if(T(i)&&i.isInstanceRoot)return i.expandInstanceChildren({scene:this,shared:t,pendingDeletes:s}),e||i.resetBBoxNeedsUpdate(),n&&i.traverseEntity(t=>{n.addClip(t)}),!0});for(let t of s)this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(t),u(t)}recomputeInstances(t,e){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity(t=>{T(t)&&t.isInstanceRoot&&(t.component=void 0)}),this.expandInstances(t,!1,e))}disposeAndUnregisterEntityRecursivelyIfNotReregistered(t){t.traverseEntity(t=>{let e="string"==typeof t.identity?t.identity:t.identity.join("-");this.entityIdentityToEntity[e]===t&&(delete this.entityByUuid[t.uuid],delete this.entityIdentityToEntity[e]),t.dispose()})}clearScene(){this._autoInstancing?.dispose(),this._autoInstancing=null,this.instanceGroupsDirty=!0;for(let t of this.children)B.is(t)&&t.disposeRecursively();this.children.length=0}resetAfterClear(t,e){this.init(t,e)}raycast(t){return this.raycast1(t,!1)}raycast1(t,e){let n=[],s=i=>{for(let a of i.children){let i=a.cloner;if(B.is(a)&&!a.raycastLock&&(a.visible||i?.object.data.visible))if(!0===e&&a.isInstanceRoot){let e=[];if(t.intersectObject(a,!0,e),e.length){let t=e[0];t.object=a,t.point.applyMatrix4(t.object.matrixWorld);let s=a.matrixWorld.clone().invert();t.point.applyMatrix4(s),n.push(t)}}else(c(a)||p(a)&&this.enableHelpers&&a.objectHelper.visible)&&(t.intersectObject(a,!1,n),r(a,t,n)),s(a)}};return s(this.activePage),n}raycastWithClones(t){let e=[],n=s=>{for(let i of s.children){let s=i.cloner;B.is(i)&&(i.visible||s?.object.data.visible)&&((c(i)||p(i)&&this.enableHelpers&&i.objectHelper.visible)&&(t.intersectObject(i,!1,e),r(i,t,e,!0)),n(i))}};return n(this),e}forEachEntity(t){for(let e of this.children)B.is(e)&&t(e)}traverseConcreteEntity(t){for(let e of this.children)B.is(e)&&e.isConcreteEntity&&e.traverseEntity(t)}traverseEntity(t){for(let e of this.children)B.is(e)&&e.traverseEntity(t)}updateFont(t,e){this.traverseEntity(n=>{if(n instanceof w&&"Mesh"===n.data.type&&("TextGeometry"===n.data.geometry.type||"InputGeometry"===n.data.geometry.type)&&n.data.geometry.font===t){let s=n.geometry,i=n.data.geometry;s.updateFont(t,e).then(()=>{s.update(i,e);let t=n.invalidateDownstreamBooleanData();h(t)&&t.recomputeBoolean()})}})}traverseObject(t){for(let e of this.children)S.is(e)&&e.traverseObject(t)}traverseVisibleEntity(t){for(let e of this.children)B.is(e)&&e.visible&&e.traverseVisibleEntity(t)}dispose(){this.clearScene()}createChildrenObjects(t,e,n){let s=0;for(let i of t)this.createObject(i.id,i.data,i.children,e,s,n),s+=1}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let e of t.children)this.unregisterObject(e)}createObject(t,e,n,s,i,r){let a={scene:this,shared:r},o=ue(t,e,a);return O(o)&&this.shapeBlendIntances.push(o),R(o)&&this.hairInstances.push(o),o&&(this.entityByUuid[t]=o,s.add(o),s.children.splice(i,0,s.children.pop()),n.length>0&&(o.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(n,o,r)),o.updateState(e,a),o instanceof w&&o.updateGeometryGroupsIfNeeded(),o.updateVisible(this),o.cloner&&this.toExpandCloner.add(o),e.pathSnapping?.pathId&&this.pathConstraints.setConstraint(t,e.pathSnapping.pathId)),"Empty"===e.type&&e.animations&&o.traverseEntity(t=>{let e=t.dataPatched;if(t instanceof w&&e.bones&&e.boneInverses){let n=e.bones.map(t=>this.find(t)),s=e.boneInverses.map(t=>(new it).fromArray(t)),i=new Ct(n,s);t.bind(i,t.bindMatrix)}else t.matrixAutoUpdate=!0}),o}getCenter(t){let e=[];for(let n=0,s=t.length;n<s;++n){let{id:s,recursive:i}=t[n],r=this.find(s),a=i?r.recursiveBBox:r.singleBBox;e.push(...a.vertices)}let n=new lt;return n.setFromPoints(e),n.getCenter(ve),ve}copyMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t);n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}copyParentMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t)?.parent;n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}traverseMaterial(t){this.traverseEntity(e=>{if(e instanceof D)if(Array.isArray(e.material))for(let n=0;n<e.material.length;n++)I(e.material[n])&&t(e.material[n]);else I(e.material)&&t(e.material)})}updateViewPlaneSize(t,e,n=!1){this.traverseConcreteEntity(s=>{s instanceof m&&s.setViewplaneSize(t,e,n)})}initializeSplatViewer(){this.splatViewer=new ge({scene:this}),this.reloadSplats()}reloadSplats(){this.splatViewer?.loadSplat()}};export{kt as a,Bt as b,Ft as c,Zt as d,xe as e,Ae as f};
|
|
1
|
+
import{a as t}from"./runtime-chunk-UYADWI5Q.js";import{a as e}from"./runtime-chunk-TONK22EB.js";import{d as n,e as s,f as i,g as r,h as a}from"./runtime-chunk-BHBI2VFL.js";import{a as o,b as l}from"./runtime-chunk-H7J7NLSC.js";import{b as d,e as c,f as h,g as p}from"./runtime-chunk-PEOLFGBX.js";import{a as u}from"./runtime-chunk-ITMHVNES.js";import{a as m}from"./runtime-chunk-WZWD2YIG.js";import{a as f}from"./runtime-chunk-O5TGJH3R.js";import{b as y}from"./runtime-chunk-QPWV26TX.js";import{a as g,b as x}from"./runtime-chunk-3LIYAJXD.js";import{a as v}from"./runtime-chunk-O37H7LZI.js";import{d as A}from"./runtime-chunk-XL37JGAH.js";import{K as b,da as w,ea as C,g as I}from"./runtime-chunk-LX7POLY3.js";import{b as M,c as P,e as S,h as B,v as D}from"./runtime-chunk-DCPBSRSM.js";import{a as E,b as R,c as O,d as z,f as j,i as W,j as T}from"./runtime-chunk-2PT2WH66.js";import{c as _,e as k,g as U}from"./runtime-chunk-TZCHGFVF.js";import{Da as N,K as G,Ka as V,a as F,b as L,n as Y,o as q,w as Q,xa as X}from"./runtime-chunk-VPEJ5BFD.js";import{Aa as Z,Ba as H,Dc as K,Ec as J,Fc as $,Gc as tt,Ge as et,Ja as nt,Oa as st,Oc as it,Ra as rt,Tc as at,Vc as ot,Xc as lt,Yc as dt,Zc as ct,bd as ht,cd as pt,ce as ut,dd as mt,kd as ft,l as yt,ld as gt,mc as xt,md as vt,n as At,nd as bt,od as wt,pd as Ct,qd as It,za as Mt}from"./runtime-chunk-VGN7YHB7.js";import{c as Pt}from"./runtime-chunk-ML3Z74BL.js";var St=null;function Bt(t){St=t}var Dt=new WeakMap,Et=1;function Rt(t){let e=Dt.get(t);return void 0===e&&(e=Et++,Dt.set(t,e)),e}function Ot(t,e,n,s){let i=t,r=e;return[Rt(n),Rt(s),i.layers?.mask??0,i.renderOrder??0,!0===(i.castShadow??r.castShadow)?1:0,!0===(i.receiveShadow??r.receiveShadow)?1:0].join(":")}var zt=[8,32,128,512],jt=zt[zt.length-1],Wt=(new it).makeScale(0,0,0),Tt=class extends It{constructor(t,e,n,s){super(t,e,n),this.isInstanceGroup=!0,this.members=new Array(n).fill(null),this.raycast=()=>{},this.matrixAutoUpdate=!1,this.frustumCulled=!1,this.adoptPassState(s);for(let t=0;t<n;t++)this.setMatrixAt(t,Wt);this.instanceMatrix.needsUpdate=!0}adoptPassState(t){this.layers.mask=t.layers.mask,this.renderOrder=t.renderOrder,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow}assign(t,e){this.members[t]=e}writeSlot(t,e,n){return!1===n?(this.setMatrixAt(t,Wt),!1):(this.setMatrixAt(t,e.matrixWorld),!0)}park(t){this.members[t]=null,this.setMatrixAt(t,Wt)}get memberCount(){let t=0;for(let e of this.members)null!==e&&t++;return t}};function _t(t,e){let n=e.get(t);if(void 0!==n)return n;let s=t.visible&&(null===t.parent||_t(t.parent,e));return e.set(t,s),s}var kt=8,Ut=class{constructor(t=8){this.minGroupSize=t,this.groups=[],this.groupKeys=new WeakMap,this.placements=new Map,this.visibilityMemo=new Map,this.page=null,this.stats={instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{}}}update(t,e){this.page!==t&&(this.teardown(),this.page=t,e=!0),!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),e&&this.reconcile(t),this.refresh()}reconcile(t){let e={},n=new Map;t.traverse(t=>{if(!0===t.isInstanceGroup)return;let s=function(t){if(!0!==t.isMesh)return"not-a-mesh";if(O(t)||j(t)||R(t)||E(t))return"excluded-type";let e=function(t){let e=W(t)?t.object:t;return void 0!==e.geometry?e:void 0}(t);if(void 0===e)return"not-a-mesh";let n=e.material;if(void 0===n)return"not-a-mesh";if(Array.isArray(n))return"array-material";let s=e.builtSharedGeometry;if(void 0===s)return"unrealized-geometry";if(!function(t){return!0===t.isShared}(s))return"unshared-geometry";if(void 0===s.attributes.position)return"empty-geometry";if(void 0!==s.morphAttributes.position)return"morph";if(!0===e.isSkinnedMesh)return"skinned";let i=e.morphTargetInfluences;if(void 0!==i&&i.length>0)return"morph";if(0!==s.drawRange.start||s.drawRange.count!==Number.POSITIVE_INFINITY)return"draw-range";let r=n;return null!=r.positionNode||null!=r.castShadowPositionNode?"position-node":!0===r.transparent?"transparent":void 0!==e.userData?.__splinePlanarMirror?"reflection":function(t){let e=t;for(;null!==e;){let t=e.states;if(void 0!==t&&Object.keys(t).length>0)return!0;e=e.parent}return!1}(e)?"interaction-states":{object:t,owner:e,geometry:s,material:n,key:Ot(t,e,s,n)}}(t);if("string"==typeof s)return void(e[s]=(e[s]??0)+1);let i=n.get(s.key);void 0===i?n.set(s.key,[s]):i.push(s)});let s=new Map;for(let[t,e]of n)for(let n of e)s.set(n.object,t);let i=!1;for(let[t,e]of this.placements)s.get(t)!==this.groupKeys.get(e.group)&&this.parkPlacement(t,e);for(let t=this.groups.length-1;t>=0;t--){let e=this.groups[t];e.memberCount>=this.minGroupSize||(this.destroyGroup(e),this.groups.splice(t,1),i=!0)}for(let[e,s]of n){let n=s.filter(t=>!this.placements.has(t.object));if(0===n.length)continue;let r=0;for(let t of this.groups){if(r>=n.length)break;if(this.groupKeys.get(t)!==e)continue;let{members:s}=t;for(let e=0;e<s.length&&r<n.length;e++)null===s[e]&&this.place(t,e,n[r++].object)}for(;n.length-r>=this.minGroupSize;){let s=n.slice(r,r+jt);this.groups.push(this.createGroup(t,e,s)),r+=s.length,i=!0}}i&&this.stats.instancingRegroups++,this.publishGroupStats(),this.stats.instancingIneligible=e}createGroup(t,e,n){let s=n[0],i=new Tt(s.geometry,s.material,function(t){for(let e of zt)if(t<=e)return e;return jt}(n.length),s.object);this.groupKeys.set(i,e);for(let t=0;t<n.length;t++)this.place(i,t,n[t].object);return t.add(i),i}destroyGroup(t){for(let e=0;e<t.members.length;e++){let n=t.members[e];null!==n&&this.parkPlacement(n,{group:t,slot:e})}t.removeFromParent(),t.dispose()}place(t,e,n){t.assign(e,n),this.placements.set(n,{group:t,slot:e}),n.isDrawSuppressed=!0}parkPlacement(t,e){e.group.park(e.slot),e.group.instanceMatrix.needsUpdate=!0,this.placements.delete(t),t.isDrawSuppressed=!1,this.stats.instancingParks++}refresh(){this.visibilityMemo.clear();for(let t of this.groups){let{members:e}=t,n=null;for(let s=0;s<e.length;s++){let i=e[s];null!==i&&(null===n&&(n=i),t.writeSlot(s,i,_t(i,this.visibilityMemo)))}null!==n&&(t.adoptPassState(n),t.instanceMatrix.needsUpdate=!0)}}teardown(){for(let t of this.groups)this.destroyGroup(t);this.groups.length=0;for(let t of this.placements.keys())t.isDrawSuppressed=!1;this.placements.clear(),this.publishGroupStats()}dispose(){this.teardown(),this.page=null}publishGroupStats(){let t=0;for(let e of this.groups){let n=e.memberCount;n>0&&(t+=n-1)}this.stats.instancingGroups=this.groups.length,this.stats.instancedDrawsSaved=t}},Nt=function(){let t=new Float32Array(1),e=new Int32Array(t.buffer);return function(n){return t[0]=n,e[0]}}(),Gt=function(t,e,n,s){return t+(e<<8)+(n<<16)+(s<<24)},Vt=new K;function Ft(t){let e=!1;return t.scene.objects.traverse((t,n)=>{if(!1===n.visible)return!0;"Splat"===n.type&&(e=!0)}),e}var Lt,Yt,qt=class extends gt{constructor(t,e,n,s,i=!1,r=1,a,o){super(n,s),this.splatCount=e,this.meshIndexIntervals=a,this.meshMatrixWorlds=o,this.splatBuffers=t,this.geometry=n,this.material=s,this.splatDataTextures=null,this.halfPrecisionCovariancesOnGPU=i,this.devicePixelRatio=r,this.resetLocalSplatDataAndTexturesFromSplatBuffer()}static buildMesh(t,e,n=!1,s=1,i,r){let a=qt.buildGeomtery(e),o=qt.buildMaterial(i);return new qt(t,e,a,o,n,s,i,r)}static buildMaterial(t){if("webgpu"===b()&&St)return St.createSplatMaterial(t);let e={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:t},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new K},viewport:{type:"v2",value:new K},basisViewport:{type:"v2",value:new K},debugColor:{type:"v3",value:new at},covariancesTextureSize:{type:"v2",value:new K(1024,1024)},centersColorsTextureSize:{type:"v2",value:new K(1024,1024)},orthoZoom:{type:"f",value:-1}};return new ut({uniforms:e,vertexShader:"\n precision highp float;\n #include <common>\n\n attribute uint splatIndex;\n\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D centersColorsTexture;\n uniform vec2 focal;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 covariancesTextureSize;\n uniform vec2 centersColorsTextureSize;\n\t\t\t\t\t\tuniform highp sampler2D meshMatrixWorldsTexture;\n\t\t\t\t\t\tuniform uint meshIndexIntervals[257];\n\t\t\t\t\t\tuniform float orthoZoom;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n void main () {\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n vColor = uintToRGBAVec(sampledCenterColor.r);\n\n vPosition = position.xy * 2.0;\n\n\t\t\t\t\t\t\t\tuint meshIndex;\n\t\t\t\t\t\t\t\tfor (int i = 1; i < 257; i++) {\n\t\t\t\t\t\t\t\t\tif (splatIndex < meshIndexIntervals[i]) {\n\t\t\t\t\t\t\t\t\t\tmeshIndex = uint(i - 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfloat strideMulmeshIndex = float(4u*meshIndex);\n\t\t\t\t\t\t\t\tfloat meshMatrixWorldsTextureLength = float(256*4);\n\n\t\t\t\t\t\t\t\tmat4 modelMat = mat4(\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0))\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmat4 modelViewMat = viewMatrix * modelMat;\n\t\t\t\t\t\t\t\tvec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); \n vec4 clipCenter = projectionMatrix * viewCenter;\n\n vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg;\n vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg;\n vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg;\n\n vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r);\n vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg);\n\n \n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n\n mat3 W = transpose(mat3(modelViewMat));\n mat3 T = orthoZoom > 0.0 ? W : W * mat3(\n\t\t\t\t\t\t\t\t\tfocal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n\t\t\t\t\t\t\t\t\t0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n\t\t\t\t\t\t\t\t\t0., 0., 0.\n\t\t\t\t\t\t\t\t);\n mat3 cov2Dm = transpose(T) * Vrk * T;\n cov2Dm[0][0] += 0.3;\n cov2Dm[1][1] += 0.3;\n\n \n \n \n \n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n \n \n \n \n \n \n \n \n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(trace * trace / 4.0 - D);\n float eigenValue1 = traceOver2 + term2;\n\t\t\t\t\t\t\t\tfloat eigenValue2 = max(traceOver2 - term2, 0.00); \n\n const float maxSplatSize = 1024.0;\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n \n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize);\n vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize);\n\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport;\n\n\t\t\t\t\t\t\t\tif (orthoZoom > 0.0) {\n\t\t\t\t\t\t\t\t\tndcOffset *= orthoZoom;\n\t\t\t\t\t\t\t\t}\n\n gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n }",fragmentShader:"\n precision highp float;\n #include <common>\n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\t\t\t\t\t\tlayout(location = 1) out vec4 gVelocity; \n\n void main () {\n \n \n float A = -dot(vPosition, vPosition);\n if (A < -4.0) discard;\n vec3 color = vColor.rgb;\n A = exp(A) * vColor.a;\n gl_FragColor = vec4(color.rgb, A);\n\t\t\t\t\t\t\t\tgVelocity = vec4(0.0); \n }",transparent:!0,alphaTest:1,blending:At,depthTest:!0,depthWrite:!1,side:yt})}static buildGeomtery(t){let e=new mt;e.setIndex([0,1,2,0,2,3]);let n=new Float32Array(12),s=new ct(n,3);e.setAttribute("position",s),s.setXYZ(0,-1,-1,0),s.setXYZ(1,-1,1,0),s.setXYZ(2,1,1,0),s.setXYZ(3,1,-1,0),s.needsUpdate=!0;let i=(new et).copy(e),r=new Uint32Array(t),a=new Ct(r,1,!1);return a.setUsage(xt),i.setAttribute("splatIndex",a),i.instanceCount=t,i}resetLocalSplatDataAndTexturesFromSplatBuffer(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}updateLocalSplatDataFromSplatBuffer(){this.splatBuffers.forEach(t=>t.buildPreComputedBuffers()),this.covariances=new Float32Array(6*this.splatCount),this.colors=new Uint8Array(4*this.splatCount),this.centers=new Float32Array(3*this.splatCount);let t=0,e=0,n=0;for(let s of this.splatBuffers){let i=s.nsplats;this.colors.subarray(t,t+4*i).set(s.colorsA),t+=4*i,this.centers.subarray(e,e+3*i).set(s.decoded.xyz.denormDequant().data),e+=3*i,this.covariances.subarray(n,n+6*i).set(new Float32Array(s.precomputedCovarianceBufferData)),n+=6*i}}allocateAndStoreLocalSplatDataInTextures(){let t=this.splatCount,e=new K(4096,1024);for(;e.x*e.y*2<6*t;)e.y*=2;let n,s,i=new K(4096,1024);for(;i.x*i.y*4<4*t;)i.y*=2;if(this.halfPrecisionCovariancesOnGPU){s=new Uint16Array(e.x*e.y*2);for(let t=0;t<this.covariances.length;t++)s[t]=dt.toHalfFloat(this.covariances[t]);n=new bt(s,e.x,e.y,st,H)}else s=new Float32Array(e.x*e.y*2),s.set(this.covariances),n=new bt(s,e.x,e.y,st,Z);n.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=n,this.material.uniforms.covariancesTextureSize.value.copy(e);let r=new Uint32Array(i.x*i.y*4);for(let e=0;e<t;e++){let t=4*e,n=3*e,s=4*e;r[s]=Gt(this.colors[t],this.colors[t+1],this.colors[t+2],this.colors[t+3]),r[s+1]=Nt(this.centers[n]),r[s+2]=Nt(this.centers[n+1]),r[s+3]=Nt(this.centers[n+2])}let a=new bt(r,i.x,i.y,rt,Mt);"webgpu"!==b()&&(a.internalFormat="RGBA32UI"),a.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=a,this.material.uniforms.centersColorsTextureSize.value.copy(i);let o=new Float32Array(4096);for(let t=0;t<this.meshMatrixWorlds.length;t++)o.set(this.meshMatrixWorlds[t].elements,16*t);let l=new bt(o,1024,1,nt,Z);l.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=l,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:s,texture:n,size:e},centerColors:{data:r,texture:a,size:i},meshMatrixWorlds:{data:o,texture:l}}}updateIndexes(t){let e=this.geometry;e.attributes.splatIndex.set(t),e.attributes.splatIndex.needsUpdate=!0,e.instanceCount=t.length}updateUniforms(t,e,n,s){this.splatCount>0&&(Vt.set(t.x*this.devicePixelRatio,t.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(Vt),this.material.uniforms.basisViewport.value.set(2/Vt.x,2/Vt.y),this.material.uniforms.focal.value.set(e,n),this.material.uniforms.orthoZoom.value=s,this.material.uniformsNeedUpdate=!0)}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(){return this.splatCount}getCenters(){return this.centers}getColors(){return this.colors}getCovariances(){return this.covariances}dispose(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose()),this.removeFromParent()}},Qt=new Promise(t=>{Lt=t}),Xt=!1;function Zt(){if(!Xt)return Yt||(Yt=async function(){let t=await import("./gaussian-splat-compression.js");Lt(t),Xt=!0}())}var Ht=new it,Kt=new tt,Jt=new $,$t=new $,te=new $,ee=new $,ne=new $,se=new $;function ie(t,e,n){n.length=0;let{axis:s,sign:i,limit:r}=e;for(let e=0;e<t.length;e++){let a=t[e],o=t[(e+1)%t.length],l=(0===s?a.px:1===s?a.py:a.pz)*i-r,d=(0===s?o.px:1===s?o.py:o.pz)*i-r,c=l<=0,h=d<=0;if(c&&n.push(a),c!==h){let t=l/(l-d);n.push({px:a.px+(o.px-a.px)*t,py:a.py+(o.py-a.py)*t,pz:a.pz+(o.pz-a.pz)*t,nx:a.nx+(o.nx-a.nx)*t,ny:a.ny+(o.ny-a.ny)*t,nz:a.nz+(o.nz-a.nz)*t})}}return n}function re(t,e,n,s,i,r,a,o,l){let d=t.geometry,c=d.getAttribute("position");if(void 0===c||0===c.count)return!0;let h=d.getAttribute("normal"),p=d.getIndex(),u=null!==p?p.count:c.count;if(u>15e5)return!0;let m=d.drawRange.start,f=m+(d.drawRange.count===1/0?u-m:Math.min(d.drawRange.count,u-m));Ht.copy(t.objectToDecal),Kt.getNormalMatrix(Ht);let y=[],g=[];for(let t=m;t+2<f;t+=3){let d=null!==p?p.getX(t):t,u=null!==p?p.getX(t+1):t+1,m=null!==p?p.getX(t+2):t+2;if(Jt.fromBufferAttribute(c,d).applyMatrix4(Ht),$t.fromBufferAttribute(c,u).applyMatrix4(Ht),te.fromBufferAttribute(c,m).applyMatrix4(Ht),Jt.z>n&&$t.z>n&&te.z>n||Jt.z<-n&&$t.z<-n&&te.z<-n)continue;ee.subVectors($t,Jt),ne.subVectors(te,Jt),se.crossVectors(ee,ne);let f=se.length();if(!(0===f||se.z/f<=.01)){if(y.length=0,void 0!==h)ee.fromBufferAttribute(h,d).applyMatrix3(Kt),y.push({px:Jt.x,py:Jt.y,pz:Jt.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,u).applyMatrix3(Kt),y.push({px:$t.x,py:$t.y,pz:$t.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,m).applyMatrix3(Kt),y.push({px:te.x,py:te.y,pz:te.z,nx:ee.x,ny:ee.y,nz:ee.z});else{se.divideScalar(f);for(let t of[Jt,$t,te])y.push({px:t.x,py:t.y,pz:t.z,nx:se.x,ny:se.y,nz:se.z})}for(let t of e){if(0===y.length)break;let e=ie(y,t,g);g=y,y=e}if(!(y.length<3)){if(a.length/3+3*(y.length-2)>3e5)return!1;for(let t=1;t+1<y.length;t++)for(let e of[y[0],y[t],y[t+1]]){l.push(e.px*s+.5,e.py*i+.5);let t=e.nx,n=e.ny,d=e.nz,c=Math.hypot(t,n,d);c>0?(t/=c,n/=c,d/=c):(t=0,n=0,d=1),a.push(e.px+t*r,e.py+n*r,e.pz+d*r),o.push(t,n,d)}}}}return!0}var ae=new lt,oe=new lt,le=new it,de=new $,ce=class extends w{constructor(t,e,n){super(t,e),this.data=e,this.geometry=new mt,this.lastSignature=[],this.nextSignature=[],this.scanned=[],this.lastParams={width:0,height:0,depth:0,offset:0},this.context=n;let s=this.data.geometry;this.lastParams={width:this.resolveNumber(s.width,0),height:this.resolveNumber(s.height,0),depth:this.resolveNumber(s.depth,0),offset:s.offset??0},this.geometry.userData={type:"DecalGeometry",parameters:{...this.lastParams}}}get isLOD(){return this.updateDecal(),!1}get isDecalObject(){return!0}resolveNumber(t,e){if("number"==typeof t)return t;let n=Number(this.context.shared.getVariable(t));return Number.isFinite(n)?n:e}currentParams(){let t=this.dataPatched.geometry;return{width:this.resolveNumber(t.width,this.lastParams.width),height:this.resolveNumber(t.height,this.lastParams.height),depth:this.resolveNumber(t.depth,this.lastParams.depth),offset:t.offset??0}}projectionRoot(){let t=this.parent;for(;null!==t&&B.is(t);){if("Page"===t.data?.type)return t;t=t.parent}return this.context.scene}scanTargets(t,e,n){let s=this.scanned;s.length=0;let i=this.projectionRoot();if(null===i)return s;ae.makeEmpty();for(let s=0;s<8;s++)de.set((1&s?.5:-.5)*t,(2&s?.5:-.5)*e,(4&s?.5:-.5)*n).applyMatrix4(this.matrixWorld),ae.expandByPoint(de);return i.traverse(t=>{if(t===this||!B.is(t)||!(t instanceof D)||t instanceof ce||"Mesh"!==t.dataPatched?.type||!t.visible||t.destroyedInAction||512&t.layers.mask)return;let e=t.geometry,n=e?.getAttribute("position");void 0===n||0===n.count||0!==e.drawRange.count&&(null===e.boundingBox&&e.computeBoundingBox(),oe.copy(e.boundingBox).applyMatrix4(t.matrixWorld),ae.intersectsBox(oe)&&s.push(t))}),s}collectSignature(t,e,n){t.length=0,t.push(n.width,n.height,n.depth,n.offset);for(let e of this.matrixWorld.elements)t.push(e);for(let n of e){t.push(n.id,n.geometry.id);let e=n.geometry.getAttribute("position");t.push(void 0===e?-1:"version"in e?e.version:e.data.version);let s=n.geometry.getIndex();t.push(null!==s?s.version:-1),t.push(n.geometry.drawRange.count===1/0?-1:n.geometry.drawRange.count);for(let e of n.matrixWorld.elements)t.push(e)}}signaturesEqual(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}updateDecal(){if(this.disposed)return!1;this.updateWorldMatrix(!0,!1);let t=this.currentParams(),e=this.scanTargets(t.width,t.height,t.depth);if(this.collectSignature(this.nextSignature,e,t),this.signaturesEqual(this.nextSignature,this.lastSignature))return!1;let n=this.lastSignature;this.lastSignature=this.nextSignature,this.nextSignature=n,this.lastParams=t,le.copy(this.matrixWorld).invert();let s=e.map(t=>({geometry:t.geometry,objectToDecal:(new it).multiplyMatrices(le,t.matrixWorld)}));return this.geometry.dispose(),this.geometry=function(t,e){let n=Math.max(Math.abs(e.width),1e-6),s=Math.max(Math.abs(e.height),1e-6),i=Math.max(Math.abs(e.depth),1e-6),r=[{axis:0,sign:1,limit:n/2},{axis:0,sign:-1,limit:n/2},{axis:1,sign:1,limit:s/2},{axis:1,sign:-1,limit:s/2},{axis:2,sign:1,limit:i/2},{axis:2,sign:-1,limit:i/2}],a=[],o=[],l=[];for(let d of t)if(!re(d,r,i/2,1/n,1/s,e.offset,a,o,l))break;let d=new mt;return d.setAttribute("position",new ht(a,3)),d.setAttribute("normal",new ht(o,3)),d.setAttribute("uv",new ht(l,2)),0===a.length?(d.setDrawRange(0,0),d.boundingSphere=new pt):d.computeBoundingSphere(),d}(s,t),this.geometry.userData={type:"DecalGeometry",parameters:{width:t.width,height:t.height,depth:t.depth}},g(this),x(this),this.resetBBoxNeedsUpdate(),!0}updateByPatchedOp(t,e,n){super.updateByPatchedOp(t,e,n),M(t.path,["geometry"])&&this.resetBBoxNeedsUpdate()}updateEntityBoxSize(t,e){let n=this.currentParams();t.setScalar(0),e.set(n.width,n.height,n.depth).multiplyScalar(.5)}dispose(){super.dispose(),this.geometry.dispose()}},he=class extends(A(vt,v)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),this.matrixAutoUpdate=!0}updateState(t,e){this.updateState_Entity(t,e)}},pe=function(){try{let t=window.location.href;if(t.includes("reducesubdiv=")){let e=t.indexOf("reducesubdiv=")+13;return parseInt(t.slice(e,e+1))}}catch{}}();function ue(n,s,i){if(console.assert(void 0!==s.type),"Mesh"===s.type)return function(t,e,n){let s;if(void 0!==pe&&e?.geometry&&"subdivisions"in e.geometry&&(e.geometry.subdivisions??0)>pe&&Object.assign(e.geometry,{subdivisions:pe}),"TextGeometry"===e.geometry.type||"InputGeometry"===e.geometry.type){let s=U(e.geometry.type);return s?s(t,e,n):(_("InputGeometry"===e.geometry.type?"textinputs":"text",`a Mesh with ${e.geometry.type}`),new C(t,e,n))}if("SubdivGeometry"===e.geometry.type)s=new y(t,e,n);else if("PathGeometry"===e.geometry.type||"VectorGeometry"===e.geometry.type||"ShapeBlendGeometry"===e.geometry.type){let i=U(e.geometry.type);i?s=i(t,e,n):(_("ShapeBlendGeometry"===e.geometry.type?"shape-blends":"PathGeometry"===e.geometry.type?"3d-paths":"vector-shapes",`a Mesh with ${e.geometry.type}`),s=new C(t,e,n))}else if("BooleanGeometry"===e.geometry.type)s=new d(t,e,n);else if("DecalGeometry"===e.geometry.type)s=new ce(t,e,n);else if("UIGeometry"===e.geometry.type){let i=U("UIGeometry");i?s=i(t,e,n):(_("ui-2d","a Mesh with UIGeometry"),s=new C(t,e,n))}else s=new C(t,e,n);return s}(n,s,i);if("Empty"===s.type)return new e(n,s);if("Particle"===s.type){let t=k("Particle");return t?t(n,s,i):(_("particles","a Particle system"),new e(n,s))}if("ParticleCollider"===s.type)return new f(n,s,i);if("Hair"===s.type){let t=k("Hair");return t?t(n,s,i):(_("hair","a Hair System"),new e(n,s))}if("Splat"===s.type)return new e(n,s);if("Bone"===s.type)return new he(n,s);if("Page"===s.type)return new a(n,s,i);if("PointLight"===s.type)return new t(n,s,i);if("SpotLight"===s.type)return new l(n,s,i);if("DirectionalLight"===s.type)return new o(n,s,i);if("Component"===s.type||"Instance"===s.type){let t=k(s.type);return t?t(n,s,i):(_("components",`a ${s.type}`),new e(n,s))}return G.is(s.type)?new m(n,s):(console.error(s),new e(n,s))}P.createEntity=ue,P.changeEntityProptotype=function(t,e,n){let s=ue(t.identity,e,n),i=t.children,r=t.attachedPaths,a=t.parent,o=t.component,l=t.instances,d=t.overrideData,c=t.uuid,h=t.stateSelection;t.dispose();for(let e of Object.keys(t))delete t[e];Object.setPrototypeOf(t,Object.getPrototypeOf(s));for(let e of Object.keys(s))t[e]=s[e];t.children=[...t.children,...i],t.attachedPaths=r,t.parent=a,t.component=o,t.instances=l,t.uuid=c,t.overrideData=d,t.updateState(t.data,n),h&&t.changeSelectedState(h,n),t.resetBBoxNeedsUpdate()};var me,fe=class{constructor(){this._constraints=new Map}setConstraint(t,e){null===e?this._constraints.delete(t):this._constraints.set(t,e)}removeDependencies(t){this._constraints.delete(t)}applyConstraints(t){let e=new Set;this._constraints.forEach((n,s)=>{let i=[s,n],r=n;for(;this._constraints.has(r);){if(r=this._constraints.get(r),i.includes(r)){console.warn(`circular dependency detected: ${i.join(" -> ")}`);break}e.has(r)||i.push(r)}for(let n=i.length-2;n>=0;n--)if(!e.has(i[n])){let s=t.find(i[n]);s?s.applyPathSnapping(t):console.warn(`missing entity ${i[n]}`),e.add(i[n])}})}findDependency(t,e){let n=t;for(;this._constraints.has(n);)if(n=this._constraints.get(n),n===e)return!0;return!1}},ye=class{};Pt(ye,"DepthMapRange",65536),Pt(ye,"MemoryPageSize",65536),Pt(ye,"BytesPerFloat",4),Pt(ye,"BytesPerInt",4),Qt.then(t=>me=t);var ge=class{constructor(t={}){Pt(this,"updateView",function(){let t=new it,e=[],n=new $(0,0,-1),s=new $(0,0,-1),i=new $,r=new $;return function(a=!1,o){let l=this.updateMatrixWorldsInWorkerIfNeeded(),d=this.cropsChanged();if(!a){s.set(0,0,-1).applyQuaternion(o.quaternion);let t=!1,e=!1;if(s.dot(n)<=.95&&(t=!0),r.copy(o.position).sub(i).length()>=1&&(e=!0),!(t||e||l||d||this.needsInitialRender))return}this.needsInitialRender=!1,i.copy(o.position),n.copy(s),t.copy(o.matrixWorld).invert(),t.premultiply(this.dummyPerspectiveMatrix),e[0]=o.position.x,e[1]=o.position.y,e[2]=o.position.z;let c={sort:{view:t.elements,cameraPosition:e,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount},...l?{newMatrixWorlds:this.meshMatrixWorlds}:{},...d?{newCropsArray:this.cropsArray}:{}};this.sortRunning?this.queuedMessage=c:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(c))}}()),this.scene=t.scene,this.currentPage=null,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null,this.needsInitialRender=!0,this.dummyPerspectiveMatrix=(new it).makePerspective(-1,1,-1,1,.1,1e3)}updateSplatMeshUniforms(t,e){let n=new K;null!==this.splatMesh&&this.splatMesh.getSplatCount()>0&&(t.getSize(n),this.cameraFocalLengthX=e.projectionMatrix.elements[0]*this.devicePixelRatio*n.x*.45,this.cameraFocalLengthY=e.projectionMatrix.elements[5]*this.devicePixelRatio*n.y*.45,this.splatMesh.updateUniforms(n,this.cameraFocalLengthX,this.cameraFocalLengthY,e.isPerspectiveCamera?-1:e.zoom*this.devicePixelRatio))}loadSplat(t={}){this.activePage=this.scene.activePage,t.position&&(t.position=(new $).fromArray(t.position)),t.orientation&&(t.orientation=(new J).fromArray(t.orientation)),t.halfPrecisionCovariances=!!t.halfPrecisionCovariances;let e=[];if(this.splatEntries=e,this.activePage.traverseVisibleEntity(t=>{"Splat"===t.data.type&&e.push(t)}),this.splatMesh&&this.splatMesh.dispose(),0===e.length)return this.splatMesh=null,!1;this.meshMatrixWorlds=e.map(t=>t.matrixWorld),this.meshMatrixWorldsOld=e.map(t=>t.matrixWorld.clone()),this.cropsArray=e.map(t=>t.data.crops.map(t=>t.data)),this._splatBufferCache??(this._splatBufferCache=new WeakMap);let n=e.map(t=>{let e=this._splatBufferCache.get(t.data.buffer);return void 0===e&&(e=new me.GSplineBuffer(new Uint8Array(t.data.buffer).buffer),this._splatBufferCache.set(t.data.buffer,e)),e}),s=0,i=[0];for(let t of n)s+=t.getSplatCount(),i.push(s);return this.setupSplatMesh(n,s,t.position,t.orientation,t.halfPrecisionCovariances,this.devicePixelRatio,i,this.meshMatrixWorlds),this.setupSortWorker(s),!0}updateMatrixWorldsInWorkerIfNeeded(){let t=this.splatDataTextures.meshMatrixWorlds.data;for(let e=0;e<this.meshMatrixWorlds.length;e++)t.set(this.meshMatrixWorlds[e].elements,16*e);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,!this.meshMatrixWorlds.every((t,e)=>t.equals(this.meshMatrixWorldsOld[e]))&&(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map(t=>t.clone()),!0)}cropsChanged(){let t=!1;return this.splatEntries.forEach((e,n)=>{e.data.crops.forEach((e,s)=>{void 0===this.cropsArray[n][s]?(t=!0,this.cropsArray[n][s]=e.data):Object.entries(e.data).forEach(([e,i])=>{(Array.isArray(i)&&i.some((t,i)=>t!==this.cropsArray[n][s][e][i])||i!==this.cropsArray[n][s]?.[e])&&(t=!0,this.cropsArray[n][s][e]=i)})}),e.data.crops.length!==this.cropsArray[n]?.length&&(this.cropsArray[n].length=e.data.crops.length,t=!0)}),t}setupSplatMesh(t,e,n=new $,s=new J,i=!1,r=1,a,o){this.splatMesh=qt.buildMesh(t,e,i,r,a,o),this.splatMesh.position.copy(n),this.splatMesh.quaternion.copy(s),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=99999,this.splatRenderCount=e,this.splatMesh.onBeforeRender=(t,e,n)=>this.update(t,n)}setupSortWorker(t){this.sortWorker=function(t){let e=new Worker(URL.createObjectURL(new Blob(["(","\nfunction sortWorker(self) {\n\tlet wasmInstance;\n\tlet splatCount;\n\tlet splatRC;\n\tlet indexesOffset;\n\tlet positionsOffset;\n\tlet viewProjOffset;\n\tlet frequenciesOffset;\n\tlet indexesOutOffset;\n\tlet sortBuffersOffset;\n\tlet wasmMemory;\n\tlet positions;\n\n\tlet Constants;\n\tlet floatPositions;\n\tlet meshIndexIntervals;\n\tlet meshMatrixWorlds;\n\tlet cropsArray;\n\n\tfunction sort(viewProj) {\n\t\t// console.time('WASM SORT');\n\t\tconst viewProjArray = new Float64Array(wasmMemory, viewProjOffset, 16);\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tviewProjArray[i] = viewProj[i];\n\t\t}\n\t\tlet indexesBuffer;\n\t\t// console.timeEnd('WASM SORT');\n\t\tif (splatRC > 1) {\n\t\t\twasmInstance.exports.sortIndexes(\n\t\t\t\tindexesOffset,\n\t\t\t\tpositionsOffset,\n\t\t\t\tsortBuffersOffset,\n\t\t\t\tviewProjOffset,\n\t\t\t\tfrequenciesOffset,\n\t\t\t\tindexesOutOffset,\n\t\t\t\tConstants.DepthMapRange,\n\t\t\t\tsplatRC\n\t\t\t);\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t\tindexes.set(new Uint32Array(wasmMemory, indexesOutOffset, splatRC));\n\t\t} else if (splatRC === 1) {\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexes[0] = new Uint32Array(wasmMemory, indexesOffset, splatCount)[0];\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t} else {\n\t\t\tindexesBuffer = new ArrayBuffer(0);\n\t\t}\n\n\t\tself.postMessage(\n\t\t\t{\n\t\t\t\tsortDone: true,\n\t\t\t\tindexesBuffer,\n\t\t\t},\n\t\t\t[indexesBuffer]\n\t\t);\n\t}\n\tfunction updateRenderedSplats(\n\t\tmeshMatrixWorlds,\n\t\tcropsArray,\n\t\tmeshIndexIntervals\n\t) {\n\t\tconst renderedPositions = new Float32Array(\n\t\t\twasmMemory,\n\t\t\tpositionsOffset,\n\t\t\tsplatCount * 3\n\t\t);\n\t\tsplatRC = 0;\n\t\tconst wasmMemoryIndexes = new Uint32Array(\n\t\t\twasmMemory,\n\t\t\tindexesOffset,\n\t\t\tsplatCount\n\t\t);\n\t\tfor (let i = 0; i < meshIndexIntervals.length - 1; i++) {\n\t\t\tconst crops = cropsArray[i];\n\t\t\tconst matrixWorld = meshMatrixWorlds[i].elements;\n\t\t\tconst paramsIn = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tconst paramsOut = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tfor (let j = meshIndexIntervals[i]; j < meshIndexIntervals[i + 1]; j++) {\n\t\t\t\tconst x = floatPositions[j * 3];\n\t\t\t\tconst y = floatPositions[j * 3 + 1];\n\t\t\t\tconst z = floatPositions[j * 3 + 2];\n\t\t\t\tif (\n\t\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t\t) {\n\t\t\t\t\tconst w =\n\t\t\t\t\t\t1 /\n\t\t\t\t\t\t(matrixWorld[3] * x +\n\t\t\t\t\t\t\tmatrixWorld[7] * y +\n\t\t\t\t\t\t\tmatrixWorld[11] * z +\n\t\t\t\t\t\t\tmatrixWorld[15]);\n\t\t\t\t\trenderedPositions[splatRC * 3] =\n\t\t\t\t\t\t(matrixWorld[0] * x +\n\t\t\t\t\t\t\tmatrixWorld[4] * y +\n\t\t\t\t\t\t\tmatrixWorld[8] * z +\n\t\t\t\t\t\t\tmatrixWorld[12]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 1] =\n\t\t\t\t\t\t(matrixWorld[1] * x +\n\t\t\t\t\t\t\tmatrixWorld[5] * y +\n\t\t\t\t\t\t\tmatrixWorld[9] * z +\n\t\t\t\t\t\t\tmatrixWorld[13]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 2] =\n\t\t\t\t\t\t(matrixWorld[2] * x +\n\t\t\t\t\t\t\tmatrixWorld[6] * y +\n\t\t\t\t\t\t\tmatrixWorld[10] * z +\n\t\t\t\t\t\t\tmatrixWorld[14]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\twasmMemoryIndexes[splatRC] = j;\n\t\t\t\t\tsplatRC++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction getOutOfBoundsIndexes(floatPositions, crops) {\n\t\tconst outOfBoundsIndexes = [];\n\t\tconst paramsIn = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\t\tconst paramsOut = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\n\t\tconst len = floatPositions.length;\n\t\tfor (let j = 0; j < len; j += 3) {\n\t\t\tconst x = floatPositions[j];\n\t\t\tconst y = floatPositions[j + 1];\n\t\t\tconst z = floatPositions[j + 2];\n\t\t\tif (\n\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t) {\n\t\t\t\t// in bounds: intentionally skip\n\t\t\t} else {\n\t\t\t\toutOfBoundsIndexes.push(j / 3);\n\t\t\t}\n\t\t}\n\t\t// console.log(outOfBoundsIndexes);\n\t\treturn outOfBoundsIndexes;\n\t}\n\n\tfunction isInBounds(x, y, z, params, mode) {\n\t\treturn params[mode === 'Intersect' ? 'every' : 'some']((param) => {\n\t\t\tconst t = applyRotationMatrix(\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\tz,\n\t\t\t\tparam.invRotationMatrix,\n\t\t\t\tparam.cropCenter\n\t\t\t);\n\t\t\treturn Array.isArray(param)\n\t\t\t\t? isVertexInsideBoundingBox(t.x, t.y, t.z, param)\n\t\t\t\t: isPointInsideEllipsoid(t.x, t.y, t.z, param);\n\t\t});\n\t}\n\tfunction applyRotationMatrix(_x, _y, _z, e, pivot) {\n\t\tconst x = _x - pivot[0];\n\t\tconst y = _y - pivot[1];\n\t\tconst z = _z - pivot[2];\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\treturn {\n\t\t\tx: (e[0] * x + e[4] * y + e[8] * z + e[12]) * w + pivot[0],\n\t\t\ty: (e[1] * x + e[5] * y + e[9] * z + e[13]) * w + pivot[1],\n\t\t\tz: (e[2] * x + e[6] * y + e[10] * z + e[14]) * w + pivot[2],\n\t\t};\n\t}\n\tfunction computeBoundingBoxVertices(box) {\n\t\tconst halfSizeX = box.cropSize[0] / 2;\n\t\tconst halfSizeY = box.cropSize[1] / 2;\n\t\tconst halfSizeZ = box.cropSize[2] / 2;\n\t\tconst bounds = [\n\t\t\tbox.cropCenter[0] - halfSizeX,\n\t\t\tbox.cropCenter[1] - halfSizeY,\n\t\t\tbox.cropCenter[2] - halfSizeZ,\n\t\t\tbox.cropCenter[0] + halfSizeX,\n\t\t\tbox.cropCenter[1] + halfSizeY,\n\t\t\tbox.cropCenter[2] + halfSizeZ,\n\t\t];\n\t\tconst invRotationMatrix = getInvRotationMatrix(box.cropRotation);\n\t\treturn Object.assign(bounds, {\n\t\t\tinvRotationMatrix,\n\t\t\tcropCenter: box.cropCenter,\n\t\t});\n\t}\n\tfunction getInvRotationMatrix(_rotation) {\n\t\tconst te = [];\n\t\tconst x = (_rotation[0] * Math.PI) / 180,\n\t\t\ty = (_rotation[1] * Math.PI) / 180,\n\t\t\tz = (_rotation[2] * Math.PI) / 180;\n\t\tconst a = Math.cos(x),\n\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\tf = Math.sin(z);\n\t\tconst ae = a * e,\n\t\t\taf = a * f,\n\t\t\tbe = b * e,\n\t\t\tbf = b * f;\n\n\t\tte[0] = c * e;\n\t\tte[1] = -c * f;\n\t\tte[2] = d;\n\n\t\tte[4] = af + be * d;\n\t\tte[5] = ae - bf * d;\n\t\tte[6] = -b * c;\n\n\t\tte[8] = bf - ae * d;\n\t\tte[9] = be + af * d;\n\t\tte[10] = a * c;\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\n\t\treturn te;\n\t}\n\tfunction isVertexInsideBoundingBox(x, y, z, bounds) {\n\t\treturn (\n\t\t\tx >= bounds[0] &&\n\t\t\tx <= bounds[3] &&\n\t\t\ty >= bounds[1] &&\n\t\t\ty <= bounds[4] &&\n\t\t\tz >= bounds[2] &&\n\t\t\tz <= bounds[5]\n\t\t);\n\t}\n\tfunction computeEllipsoidParams(ellipsoid) {\n\t\t// Precompute the scaling factors\n\t\tconst invRadiusX = 2 / ellipsoid.cropSize[0];\n\t\tconst invRadiusY = 2 / ellipsoid.cropSize[1];\n\t\tconst invRadiusZ = 2 / ellipsoid.cropSize[2];\n\t\tconst invRotationMatrix = getInvRotationMatrix(ellipsoid.cropRotation);\n\t\treturn {\n\t\t\tinvRadiusX,\n\t\t\tinvRadiusY,\n\t\t\tinvRadiusZ,\n\t\t\tcropCenter: ellipsoid.cropCenter,\n\t\t\tinvRotationMatrix,\n\t\t};\n\t}\n\tfunction isPointInsideEllipsoid(x, y, z, ellipsoidParams) {\n\t\tconst _x = (x - ellipsoidParams.cropCenter[0]) * ellipsoidParams.invRadiusX;\n\t\tconst _y = (y - ellipsoidParams.cropCenter[1]) * ellipsoidParams.invRadiusY;\n\t\tconst _z = (z - ellipsoidParams.cropCenter[2]) * ellipsoidParams.invRadiusZ;\n\t\treturn _x * _x + _y * _y + _z * _z <= 1;\n\t}\n\n\tself.onmessage = (e) => {\n\t\tif (e.data.getCroppedIndexes) {\n\t\t\tconst outOfBoundsIndexes = new Uint32Array(\n\t\t\t\tgetOutOfBoundsIndexes(new Float32Array(e.data.positions), e.data.crops)\n\t\t\t).buffer;\n\t\t\tself.postMessage(\n\t\t\t\t{\n\t\t\t\t\toutOfBoundsIndexes,\n\t\t\t\t},\n\t\t\t\t[outOfBoundsIndexes]\n\t\t\t);\n\t\t} else if (e.data.positions) {\n\t\t\tpositions = e.data.positions;\n\t\t\tfloatPositions = new Float32Array(positions);\n\t\t\tmeshMatrixWorlds = e.data.meshMatrixWorlds;\n\t\t\tcropsArray = e.data.cropsArray;\n\t\t\tmeshIndexIntervals = e.data.meshIndexIntervals;\n\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\tself.postMessage({\n\t\t\t\tsortSetupComplete: true,\n\t\t\t});\n\t\t} else if (e.data.sort || e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\tif (e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\t\tcropsArray = e.data.newCropsArray || cropsArray;\n\t\t\t\tmeshMatrixWorlds = e.data.newMatrixWorlds || meshMatrixWorlds;\n\t\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\t}\n\t\t\tsort(e.data.sort.view, e.data.sort.cameraPosition);\n\t\t} else if (e.data.init) {\n\t\t\t// Yep, this is super hacky and gross :(\n\t\t\tConstants = e.data.init.Constants;\n\n\t\t\tsplatCount = e.data.init.splatCount;\n\n\t\t\tconst INDEXES_BYTES_PER_ENTRY = Constants.BytesPerInt;\n\t\t\tconst POSITIONS_BYTES_PER_ENTRY = Constants.BytesPerFloat * 3;\n\n\t\t\tconst sorterWasmBytes = new Uint8Array(e.data.init.sorterWasmBytes);\n\t\t\tconst memoryBytesPerVertex =\n\t\t\t\tINDEXES_BYTES_PER_ENTRY + POSITIONS_BYTES_PER_ENTRY;\n\t\t\tconst memoryRequiredForVertices = splatCount * memoryBytesPerVertex;\n\t\t\tconst memoryRequiredForSortBuffers =\n\t\t\t\tsplatCount * Constants.BytesPerInt * 2 +\n\t\t\t\tConstants.DepthMapRange * Constants.BytesPerInt * 2;\n\t\t\tconst extraMemory = Constants.MemoryPageSize * 32;\n\t\t\tconst totalRequiredMemory =\n\t\t\t\tmemoryRequiredForVertices + memoryRequiredForSortBuffers + extraMemory;\n\t\t\tconst totalPagesRequired =\n\t\t\t\tMath.floor(totalRequiredMemory / Constants.MemoryPageSize) + 1;\n\t\t\tconst sorterWasmImport = {\n\t\t\t\tmodule: {},\n\t\t\t\tenv: {\n\t\t\t\t\tmemory: new WebAssembly.Memory({\n\t\t\t\t\t\tinitial: totalPagesRequired * 2,\n\t\t\t\t\t\tmaximum: totalPagesRequired * 3,\n\t\t\t\t\t\tshared: true,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t};\n\t\t\tWebAssembly.compile(sorterWasmBytes)\n\t\t\t\t.then((wasmModule) => {\n\t\t\t\t\treturn WebAssembly.instantiate(wasmModule, sorterWasmImport);\n\t\t\t\t})\n\t\t\t\t.then((instance) => {\n\t\t\t\t\twasmInstance = instance;\n\t\t\t\t\tindexesOffset = 0;\n\t\t\t\t\tpositionsOffset = splatCount * INDEXES_BYTES_PER_ENTRY;\n\t\t\t\t\tviewProjOffset =\n\t\t\t\t\t\tpositionsOffset + splatCount * POSITIONS_BYTES_PER_ENTRY;\n\t\t\t\t\tsortBuffersOffset = viewProjOffset + 16 * Constants.BytesPerFloat * 2;\n\t\t\t\t\tfrequenciesOffset =\n\t\t\t\t\t\tsortBuffersOffset + splatCount * Constants.BytesPerInt;\n\t\t\t\t\tindexesOutOffset =\n\t\t\t\t\t\tfrequenciesOffset + Constants.DepthMapRange * Constants.BytesPerInt;\n\t\t\t\t\twasmMemory = sorterWasmImport.env.memory.buffer;\n\t\t\t\t\tself.postMessage({\n\t\t\t\t\t\tsortSetupPhase1Complete: true,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\t};\n}\n",")(self)"],{type:"application/javascript"}))),n=atob("AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL"),s=new Uint8Array(n.length);for(let t=0;t<n.length;t++)s[t]=n.charCodeAt(t);return e.postMessage({init:{sorterWasmBytes:s.buffer,splatCount:t,Constants:{BytesPerFloat:ye.BytesPerFloat,BytesPerInt:ye.BytesPerInt,DepthMapRange:ye.DepthMapRange,MemoryPageSize:ye.MemoryPageSize}}}),e}(t),this.sortWorker.onmessage=t=>{t.data.sortDone?(this.sortRunning=!1,this.splatMesh?.updateIndexes(new Uint32Array(t.data.indexesBuffer)),this.lastSortTime=t.data.sortTime,this.queuedMessage&&(this.sortWorker.postMessage(this.queuedMessage),this.queuedMessage=null)):t.data.sortCanceled?this.sortRunning=!1:t.data.sortSetupPhase1Complete?this.sortWorker.postMessage({positions:this.splatMesh.getCenters().buffer,meshMatrixWorlds:this.splatMesh.meshMatrixWorlds,meshIndexIntervals:this.splatMesh.meshIndexIntervals,cropsArray:this.cropsArray}):t.data.sortSetupComplete&&(this.splatDataTextures=this.splatMesh.getSplatDataTextures(),this.scene.activePage.add(this.splatMesh),this.needsInitialRender=!0)}}update(t,e){null!==this.splatMesh&&(this.updateSplatMeshUniforms(t,e),this.updateView(!1,e))}getSplatMesh(){return this.splatMesh}},xe=new ft;xe.wireframe=!0;var ve=new $,Ae=class extends ot{constructor(t,n){super(),this.data=t,this.sharedAssets=n,this.enableHelpers=!1,this.wireframeState=!1,this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this._needsTransmission=!1,this._needsNormal=!1,this._normalPassNeeds={outline:!1,cavity:!1},this._needsReflection=!1,this.geometryCacheChanged=!1,this.splatViewer=null,this.shapeBlendIntances=[],this.hairInstances=[],this.shadowsDirty=!0,this.instanceGroupsDirty=!0,this._autoInstancing=null,this.entityByUuid={},this.entityIdentityToEntity={},this.toExpandCloner=new Set,this.toUpdateCloner=new Set,this.pendingCommands=[],this.pathConstraints=new fe,this.invisibleObjects=new e("jflkdsafjasdifjaslk",{...X.defaultData,visible:!1,name:"buildin invisible"}),this.needsRecomputeInstances=!1,this.init(t,n),this.matrixAutoUpdate=!1,this.errorPage=new a("fdasfa",{...N.defaultData,name:""},{shared:n,scene:this})}markGeometryCacheDirty(){this.geometryCacheChanged=!0}markShadowsDirty(){this.shadowsDirty=!0}markInstanceGroupsDirty(){this.instanceGroupsDirty=!0}get autoInstancing(){return this._autoInstancing}updateInstanceGroups(t,e){let n=this._autoInstancing;(null===n||n.minGroupSize!==e)&&(n?.dispose(),n=new Ut(e),this._autoInstancing=n);let s=this.instanceGroupsDirty;return this.instanceGroupsDirty=!1,n.update(t,s),n.stats}releaseInstanceGroups(){this._autoInstancing?.teardown(),this.instanceGroupsDirty=!0}markNeedsUpdateRendererDirty(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this.shadowsDirty=!0,this.instanceGroupsDirty=!0}needsTransmission(){return this.needsTransmissionDirty&&(this._needsTransmission=s(this),this.needsTransmissionDirty=!1),this._needsTransmission}needsNormal(){return this.needsNormalDirty&&(this._normalPassNeeds=n(this),this._needsNormal=this._normalPassNeeds.outline||this._normalPassNeeds.cavity,this.needsNormalDirty=!1),this._needsNormal}normalPassNeeds(){return this.needsNormal(),this._normalPassNeeds}needsReflection(){return this.needsReflectionDirty&&(this._needsReflection=i(this),this.needsReflectionDirty=!1),this._needsReflection}registerInstanceAndSetUuid(t){let e=t.identity.join("-"),n=this.entityIdentityToEntity[e];n&&(t.uuid=n.uuid),this.entityIdentityToEntity[e]=t,this.entityByUuid[t.uuid]=t}markPenumbraSizeDirty(){for(let t of this.children)t instanceof a&&(t.penumbraSizeArrayCache=null)}findInstance(t){return this.entityIdentityToEntity[t.join("-")]}get bgColor(){return this.activePage.bgColor}get postprocessing(){return this.activePage.data.postprocessing}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let n=[],s=e;for(;s!==this;){let t=s;s=s.parent;let e=s.children.indexOf(t);n.splice(0,0,e)}return{entity:e,sortKey:n}}getAllSorted(t){let e=[];for(let n of t){let t=this.getWithSortKey(n.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>L(t.sortKey,e.sortKey)),e.map(t=>t.entity)}nonExistOrDescendantOf(t,e){let n=this.find(t);if(void 0===n)return!0;for(;n;){if(n.uuid===e)return!0;n=n.parent}return!1}find(t){if(this.activePage&&this.activePage.personalCamera.parent){if("f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera"===t)return this.activePage.personalCamera;if(t===Q)return this.activePage.personalCamera}if(""===t||void 0===t)return;let e=this.entityByUuid[t];return void 0===e?this.getObjectByProperty("uuid",t):e}find2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene){let n=e.uiScene.find(t);if(n)return n}}findScene2DfromObject2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene&&e.uiScene.find(t))return e.uiScene}find2DInUIObjects(t){let e;return this.traverseEntity(n=>{void 0===e&&j(n)&&(e=n.uiCanvas.find(t))}),e}traverse2D(t){for(let e of this.children)e instanceof a&&e.uiScene&&e.uiScene.traverse(t)}debugEnsureEntity(t){let e=this.find(t);e?Array.isArray(e.identity)&&void 0===this.findInstance(e.identity)&&console.error("not found instance"):console.error("not found")}addPendingExpandCloner(t){this.toExpandCloner.add(t)}addPendingUpdateCloner(t){this.toUpdateCloner.add(t)}markToExpandCloner(t){this.toExpandCloner.add(t),t.traverseEntityAncestors(t=>{this.toExpandCloner.add(t)})}doPendingExpandCloner(t){this.toExpandCloner.forEach(e=>{e.expandCloner(t)}),this.toExpandCloner.clear()}doPendingUpdateCloner(t){this.toUpdateCloner.forEach(e=>{e.cloner?.update(t)}),this.toUpdateCloner.clear()}doPendingUpdates(t){this.doPendingExpandCloner(t),this.doPendingUpdateCloner(t),this.applyPendingCommands()}addPendingCommand(t){this.pendingCommands.push(t)}applyPendingCommands(){this.pendingCommands.forEach(t=>t()),this.pendingCommands.length=0}updateByLibOp(t,e){1===t.path.length&&"components"===t.path[0]&&1===t.type&&this.createChildrenObjects([{...t.data.asset,id:t.id}],this.invisibleObjects,e)}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let n=null===t.parent?this:this.find(t.parent);if(void 0===n)throw new Error(`scene tree add: parent ${t.parent} not found for object ${t.id}`);let s=this.createObject(t.id,t.data,t.children,n,t.localIndex,e);s.updateVisible(this),s.resetBBoxNeedsUpdate(),c(s)&&h(s.parent)&&(s.invalidateUpstreamBooleanData(),s.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(s),this.markToExpandCloner(s),this.markPenumbraSizeDirty(),s.updatePathSnapping()}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree delete: object ${t.id} not found`);e.traverseEntity(t=>{O(t)&&(this.shapeBlendIntances=this.shapeBlendIntances.filter(e=>e!==t)),R(t)&&(this.hairInstances=this.hairInstances.filter(e=>e!==t))}),this.markToExpandCloner(e),e.resetBBoxNeedsUpdate(),this.unregisterObject(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(e),this.markPenumbraSizeDirty(),e.parent.remove(e),h(e.parent)&&(e.parent.invalidateUpstreamBooleanData(),e.parent.invalidateDownstreamBooleanData().recomputeBoolean()),c(e)&&(e.freeBooleanPointer(),n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),z(e)&&e.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(e),this.pathConstraints.removeDependencies(e.uuid),e.updatePathSnapping()}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree move: object ${t.id} not found`);this.markNeedsRecomputeInstancesForChildren(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),e.cloner?.resetOnMove(),this.markToExpandCloner(e);let s=null===t.parent?this:this.find(t.parent);if(void 0===s)throw new Error(`scene tree move: new parent ${t.parent} not found for object ${t.id}`);s.add(e),this.markNeedsRecomputeInstancesForAncessors(s),this.markToExpandCloner(e),e.invalidateClonerTransform(e),e.updateVisible(this),e.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();let i=t.localIndex;s.children.splice(i,0,s.children.pop()),c(e)&&(e.invalidateUpstreamBooleanData(),h(e.parent)?e.parent.invalidateDownstreamBooleanData().recomputeBoolean():n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),e.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}get playPage(){return this.find(this.data.publish.playPage)??this.errorPage}updatePage(t){this.shadowsDirty=!0,this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;for(let e of this.children)e instanceof a&&(e.visible=e.uuid===t,e.visible&&(this.activePage=e,this.activePage.onActive(this)));this.activePage!==this.splatViewer?.activePage&&this.reloadSplats()}updateEntityByOp(t,e,n,s){if(this.shadowsDirty=!0,0===e.type){if(("overrides"in e.props||"component"in e.props)&&this.markNeedsRecomputeInstances(),"visible"in e.props&&this.markPenumbraSizeDirty(),e.path.includes("overrides")&&"states"in e.props){let{rest:t}=e.props;e={...e,props:t},this.markNeedsRecomputeInstances()}"pathSnapping"===e.path[0]&&void 0!==e.props.pathId&&this.pathConstraints.setConstraint(t,e.props.pathId)}let i=this.find(t);if(i)try{(function(t,e,n,s){t.updateByOp(e,n,s,!1)})(i,e,n,{scene:this,shared:s}),i instanceof C&&i.updateGeometryGroupsIfNeeded()}catch(t){console.error(t)}}updateEntity2DByOp(t,e,n,s,i,r=[]){t.updateEntityByOp(e,n,s,i),this.traverseEntity(t=>{(j(t)||t instanceof a)&&(r.includes(t.frameId??"")||t.frameId===e)&&t.updateEntity2DByOp(e,n,s,i)})}get activeCamera(){return this.activePage.activeCamera}switchActiveCamera(t){this.activePage.switchActiveCamera(t)}isInvisibleObjects(t){return t===this.invisibleObjects||t.hasAnccestor(this.invisibleObjects)}init(t,e){let n=Object.entries(e.data.lib.components).map((t,e)=>({data:t[1].asset.data,children:t[1].asset.children,id:t[0],fi:e}));this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:e}),this.add(this.invisibleObjects),this.createChildrenObjects(n,this.invisibleObjects,e),this.createChildrenObjects(t.objects,this,e),this.updatePage(t.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(e,!0),this.traverseEntity(t=>{t instanceof m&&t.updateUp()}),this.doPendingExpandCloner({scene:this,shared:e}),this.applyPendingCommands()}markNeedsRecomputeInstances(){this.needsRecomputeInstances=!0}markNeedsRecomputeInstancesForChildren(t){t.traverseEntity(t=>{("Component"===t.data.type||"Instance"===t.data.type)&&this.markNeedsRecomputeInstances()})}markNeedsRecomputeInstancesForAncessors(t){B.is(t)&&("Component"===t.data.type&&this.markNeedsRecomputeInstances(),t.traverseAncestors(t=>{B.is(t)&&"Component"===t.data.type&&this.markNeedsRecomputeInstances()}))}relativeizeInner(t,e,n,s,i,r,a){if(t){let o=s.find(t);o&&o!==s&&i.forInstancesRec(s=>{s.data=Y(s.data,i=>{let o=i.events.data(a.id),l=s.goUp(r);if(l){let s=[...F(l.identity),t].join("-"),i=this.entityIdentityToEntity[s];if(i){let t=i.uuid;q.zoom(o,e)[n]=t}else console.warn("cannot find instance")}}).data})}}rewriteActions(t,e,n,s,i,r){t.forEach(t=>{"Transition"===t.data.type||"Animation"===t.data.type?this.relativeizeInner(t.data.object,[...e,t.id],"object",n,s,i,r):"Conditional"===t.data.type&&(this.rewriteActions(t.data.ifActions,[...e,t.id,"ifActions"],n,s,i,r),this.rewriteActions(t.data.elseActions,[...e,t.id,"elseActions"],n,s,i,r))})}rewriteEventsBeforeGoToPlayMode(){this.traverseEntity(t=>{if(T(t)&&"string"==typeof t.identity&&"Component"===t.data.type)return t.traverseEntity((e,n)=>{e.data.events.forEach(s=>{if("GameControl"===s.data.type){let i=!1;if(e.forInstancesRec(t=>{t.data=Y(t.data,e=>{t.isInstanceRoot||(e.events.delete(s.id),i=!0)}).data}),!1===i)for(let i of V.list)this.rewriteActions(s.data.gameActions[i],["gameActions",i],t,e,n,s)}else"Conditional"===s.data.type?("Distance"===s.data.condition.type?(this.relativeizeInner(s.data.condition.fromObject,["condition"],"fromObject",t,e,n,s),this.relativeizeInner(s.data.condition.toObject,["condition"],"toObject",t,e,n,s)):"State"===s.data.condition.type?this.relativeizeInner(s.data.condition.object,["condition"],"object",t,e,n,s):"Comparison"===s.data.condition.type&&("Property"===s.data.condition.lOperand.type&&this.relativeizeInner(s.data.condition.lOperand.value[0],["condition","lOperand","value"],0,t,e,n,s),"Property"===s.data.condition.rOperand.type&&this.relativeizeInner(s.data.condition.rOperand.value[0],["condition","rOperand","value"],0,t,e,n,s)),this.rewriteActions(s.data.inActions,["inActions"],t,e,n,s),this.rewriteActions(s.data.outActions,["outActions"],t,e,n,s)):"actions"in s.data&&this.rewriteActions(s.data.actions,["actions"],t,e,n,s)})}),!0})}expandInstances(t,e,n){let s=new Set;this.traverseEntity(i=>{if(T(i)&&i.isInstanceRoot)return i.expandInstanceChildren({scene:this,shared:t,pendingDeletes:s}),e||i.resetBBoxNeedsUpdate(),n&&i.traverseEntity(t=>{n.addClip(t)}),!0});for(let t of s)this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(t),u(t)}recomputeInstances(t,e){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity(t=>{T(t)&&t.isInstanceRoot&&(t.component=void 0)}),this.expandInstances(t,!1,e))}disposeAndUnregisterEntityRecursivelyIfNotReregistered(t){t.traverseEntity(t=>{let e="string"==typeof t.identity?t.identity:t.identity.join("-");this.entityIdentityToEntity[e]===t&&(delete this.entityByUuid[t.uuid],delete this.entityIdentityToEntity[e]),t.dispose()})}clearScene(){this._autoInstancing?.dispose(),this._autoInstancing=null,this.instanceGroupsDirty=!0;for(let t of this.children)B.is(t)&&t.disposeRecursively();this.children.length=0}resetAfterClear(t,e){this.init(t,e)}raycast(t){return this.raycast1(t,!1)}raycast1(t,e){let n=[],s=i=>{for(let a of i.children){let i=a.cloner;if(B.is(a)&&!a.raycastLock&&(a.visible||i?.object.data.visible))if(!0===e&&a.isInstanceRoot){let e=[];if(t.intersectObject(a,!0,e),e.length){let t=e[0];t.object=a,t.point.applyMatrix4(t.object.matrixWorld);let s=a.matrixWorld.clone().invert();t.point.applyMatrix4(s),n.push(t)}}else(c(a)||p(a)&&this.enableHelpers&&a.objectHelper.visible)&&(t.intersectObject(a,!1,n),r(a,t,n)),s(a)}};return s(this.activePage),n}raycastWithClones(t){let e=[],n=s=>{for(let i of s.children){let s=i.cloner;B.is(i)&&(i.visible||s?.object.data.visible)&&((c(i)||p(i)&&this.enableHelpers&&i.objectHelper.visible)&&(t.intersectObject(i,!1,e),r(i,t,e,!0)),n(i))}};return n(this),e}forEachEntity(t){for(let e of this.children)B.is(e)&&t(e)}traverseConcreteEntity(t){for(let e of this.children)B.is(e)&&e.isConcreteEntity&&e.traverseEntity(t)}traverseEntity(t){for(let e of this.children)B.is(e)&&e.traverseEntity(t)}updateFont(t,e){this.traverseEntity(n=>{if(n instanceof C&&"Mesh"===n.data.type&&("TextGeometry"===n.data.geometry.type||"InputGeometry"===n.data.geometry.type)&&n.data.geometry.font===t){let s=n.geometry,i=n.data.geometry;s.updateFont(t,e).then(()=>{s.update(i,e);let t=n.invalidateDownstreamBooleanData();h(t)&&t.recomputeBoolean()})}})}traverseObject(t){for(let e of this.children)S.is(e)&&e.traverseObject(t)}traverseVisibleEntity(t){for(let e of this.children)B.is(e)&&e.visible&&e.traverseVisibleEntity(t)}dispose(){this.clearScene()}createChildrenObjects(t,e,n){let s=0;for(let i of t)this.createObject(i.id,i.data,i.children,e,s,n),s+=1}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let e of t.children)this.unregisterObject(e)}createObject(t,e,n,s,i,r){let a={scene:this,shared:r},o=ue(t,e,a);return O(o)&&this.shapeBlendIntances.push(o),R(o)&&this.hairInstances.push(o),o&&(this.entityByUuid[t]=o,s.add(o),s.children.splice(i,0,s.children.pop()),n.length>0&&(o.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(n,o,r)),o.updateState(e,a),o instanceof C&&o.updateGeometryGroupsIfNeeded(),o.updateVisible(this),o.cloner&&this.toExpandCloner.add(o),e.pathSnapping?.pathId&&this.pathConstraints.setConstraint(t,e.pathSnapping.pathId)),"Empty"===e.type&&e.animations&&o.traverseEntity(t=>{let e=t.dataPatched;if(t instanceof C&&e.bones&&e.boneInverses){let n=e.bones.map(t=>this.find(t)),s=e.boneInverses.map(t=>(new it).fromArray(t)),i=new wt(n,s);t.bind(i,t.bindMatrix)}else t.matrixAutoUpdate=!0}),o}getCenter(t){let e=[];for(let n=0,s=t.length;n<s;++n){let{id:s,recursive:i}=t[n],r=this.find(s),a=i?r.recursiveBBox:r.singleBBox;e.push(...a.vertices)}let n=new lt;return n.setFromPoints(e),n.getCenter(ve),ve}copyMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t);n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}copyParentMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t)?.parent;n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}traverseMaterial(t){this.traverseEntity(e=>{if(e instanceof D)if(Array.isArray(e.material))for(let n=0;n<e.material.length;n++)I(e.material[n])&&t(e.material[n]);else I(e.material)&&t(e.material)})}updateViewPlaneSize(t,e,n=!1){this.traverseConcreteEntity(s=>{s instanceof m&&s.setViewplaneSize(t,e,n)})}initializeSplatViewer(){this.splatViewer=new ge({scene:this}),this.reloadSplats()}reloadSplats(){this.splatViewer?.loadSplat()}};export{kt as a,Bt as b,Ft as c,Zt as d,xe as e,Ae as f};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as e}from"./runtime-chunk-
|
|
1
|
+
import{a as t,b as e}from"./runtime-chunk-XL37JGAH.js";import{Ec as s,Fc as r,Sc as a,Xe as i}from"./runtime-chunk-VGN7YHB7.js";var o=new r(1,1,1),m=new r,d=new r,u=new s,c=class extends(t(i)){constructor(t,e=15){super(e),this.object=t,this.dummy=new a,this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=this.dummy.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(t,s){e(this.object,c.geometryHelper,t,s,!1,this.dummy)}update(){}updateMatrix(){}updateMatrixWorld(t){this.object.matrixWorld.decompose(m,u,d),this.matrix.compose(m,u,o),super.updateMatrixWorld(t)}updateWorldMatrix(t,e){}};export{c as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-O37H7LZI.js";import{d as e}from"./runtime-chunk-XL37JGAH.js";import{Sc as s}from"./runtime-chunk-VGN7YHB7.js";var r=class extends(e(s,t)){constructor(t,e,s){super(),this.super_Entity(t,e),this.context=s,this.objectHelper.update()}updateState(t,e){this.updateState_Entity(t,e)}};export{r as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t}from"./runtime-chunk-
|
|
1
|
+
import{a as e,b as t}from"./runtime-chunk-3LIYAJXD.js";import{c as s,d as o}from"./runtime-chunk-XL37JGAH.js";import{da as r}from"./runtime-chunk-LX7POLY3.js";import{h as i,o as a,p as n,q as d,r as h,s as l,t as m,v as p}from"./runtime-chunk-DCPBSRSM.js";import{i as u}from"./runtime-chunk-2PT2WH66.js";import{Oc as c,bd as y,dd as g,ue as f}from"./runtime-chunk-VGN7YHB7.js";var b=new c,A=new c,M=new c,S=new c,v=new c;function w(e){let t=!1;return e.scene.objects.traverse((e,s)=>{"BooleanGeometry"===s.geometry?.type&&(t=!0)}),t}function D(e,t){let s=e.cloner;return void 0!==s&&s.parent===t?s:void 0}var x=new Float32Array(0);function B(e,t,s,o){let r=16*(t.children.length+1);x.length<r&&(x=new Float32Array(r));let i=0,a=e=>{e.toArray(x,16*i),i++},n=!0!==t.parameters.hideBase;n&&a(o),M.multiplyMatrices(e.hiddenMatrix,e.matrix);for(let e of t.children)!u(e)||!1===e.playModeVisible||(S.multiplyMatrices(e.hiddenMatrix,e.matrix).multiply(e.pivotMatrix),v.multiplyMatrices(M,S),(!n||!v.equals(o))&&a(v));try{return 0===i?0:m(s,x.subarray(0,16*i))}finally{l(s)}}var O,P=class extends r{constructor(e,t,s){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new g,this.onAfterRender=(e,t,s,o,r,i)=>{super.onAfterRender(e,t,s,o,r,i),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,s){super.updateByPatchedOp(e,t,s),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(s,o=!0){if(-1!==this.booleanMeshSetAddress&&!s)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof P&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===s,o)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof p&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){b.multiplyMatrices(t.hiddenMatrix,t.matrix).multiply(t.pivotMatrix);try{let e=D(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let r=a(t.geometry,!0===s,o);t.booleanMeshSetAddress=void 0===e||-1===r?r:B(t,e,r,b)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&h(t.booleanMeshSetAddress,b),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1}else t instanceof P&&!0===t.needsTransformForDownstream?(void 0===e?h(t.booleanMeshSetAddress,b):t.booleanMeshSetAddress=B(t,e,t.booleanMeshSetAddress,b),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(h(t.booleanMeshSetAddress,A.multiplyMatrices(b,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)continue;this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new g,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new y([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===s)return d(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new g,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=n(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}};(O||(O={})).is=function(e){return i.is(e)&&e instanceof f};var F=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}},T=e=>e instanceof p,j=e=>null!==e&&e instanceof P,k=e=>s.is(e);export{w as a,P as b,O as c,F as d,T as e,j as f,k as g};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as i}from"./runtime-chunk-
|
|
1
|
+
import{a as e,b as i}from"./runtime-chunk-3LIYAJXD.js";import{E as t,F as s,ea as o}from"./runtime-chunk-LX7POLY3.js";import{v as r}from"./runtime-chunk-DCPBSRSM.js";import{Fc as h,Oc as a,Xc as d,cd as n}from"./runtime-chunk-VGN7YHB7.js";var l=new d,u=new h;function m(e){let i=!1;return e.scene.objects.traverse((e,t)=>{"Mesh"===t.type&&"SubdivGeometry"===t.geometry.type&&(i=!0)}),i}var y=class extends o{constructor(e,i,t){super(e,i,t),this.data=i,this.hiddenMatrixOld=new a,this.smoothShading=!0,this.skipReactionUpdate=!1}chooseGeoemtryCache(e){return this.dataPatched.flatShading?e.geometryCache:e.geometryCache2}get subdivPointerNew(){return void 0!==this.localGeometry?this.subdivPointer:this.geometry.ensureSubdivPointer()}get originalGeometryNew(){return void 0!==this.localGeometry?this.originalGeometry:this.geometry.originalGeometry}get phongAngle(){return this.data.geometry.phongAngle??45}updateEntityBoxSize(e,i){let t=this.geometry.userData.parameters;e.copy(this.originalGeometryNew.boundingSphere.center),i.set(t.width,t.height,t.depth??0).multiplyScalar(.5)}createGeometryByControls(s){if(!0===this.skipReactionUpdate)return;let o=this.localGeometry?.uuid,{originalGeometry:r,subdividedGeometry:h,subdivPointer:a}=t.build(s,this.subdivPointer,this.smoothShading,this.hasNonUniformScale?this.shearScale:void 0);this.subdivPointer=a,void 0!==r&&(this.originalGeometry?.dispose(),this.originalGeometry=r),void 0!==h&&(this.subdividedGeometry?.dispose(),this.subdividedGeometry=h??void 0),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),this.calcBoundingBox(),o&&(this.localGeometry.uuid=o)}updateState(e,i){if(super.updateState(e,i),void 0!==e.flatShading){let t=this.material;this.material=Array.isArray(t)?t.map(e=>e.getFlavor(!1,e.side,e.wireframe)):t.getFlavor(!1,t.side,t.wireframe),this.smoothShading=!e.flatShading,this.createGeometryDelayed(i)}}updateMesh(e=!1,i=!1,s=!1){i&&this.subdividedGeometry||t.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0,s),this.subdividedGeometry&&t.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,e&&this.hasNonUniformScale?this.shearScaleInv:void 0)}updateTopology(){let s=this.localGeometry?.uuid;this.originalGeometry.dispose(),this.originalGeometry=t.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=t.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),this.calcBoundingBox(),s&&(this.localGeometry.uuid=s)}raycast(e,i){let t=this.localGeometry;this.localGeometry=this.originalGeometryNew,r.prototype.raycast.call(this,e,i),this.localGeometry=t}activateShearCompensation(){!this.hasNonUniformScale||(this.matrix.copy(this.matrixWorldRigid),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateShearCompensation(){!this.hasNonUniformScale||(this.updateMatrix(),this.hasNonUniformScale=void 0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let e=this.originalGeometry;null===e.boundingSphere&&(e.boundingSphere=new n,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=e.boundingSphere));let i=e.attributes.position,t=e.boundingSphere.center;l.setFromBufferAttribute(i),l.getCenter(t),e.boundingSphere.radius=t.distanceTo(l.max),isNaN(e.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),l.getSize(u),this.hasNonUniformScale&&u.divide(this.scale);let s={width:u.x,height:u.y,depth:u.z};return this.geometry.userData.parameters=s,s}updateBoundingSphere(e){let i=this.originalGeometry;l.min.set(e[0],e[2],e[4]),l.max.set(e[1],e[3],e[5]),this.hasNonUniformScale&&(l.min.applyMatrix4(this.shearScaleInv),l.max.applyMatrix4(this.shearScaleInv)),null===i.boundingSphere&&(i.boundingSphere=new n);let t=i.boundingSphere.center;l.getCenter(t),i.boundingSphere.radius=t.distanceTo(l.max)}freeSubdivPointer(){this.subdivPointer&&(t.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0),this.localGeometry=void 0,this.originalGeometry?.dispose(),this.subdividedGeometry?.dispose()}dispose(){super.dispose(),this.freeSubdivPointer()}updateSubdivisionLevel(s){if(!0===this.skipReactionUpdate)return;let o=this.localGeometry,r=o?.uuid,h=o?.userData.parameters,a=s.subdivisions>0?t.buildRefined(this.subdivPointer,s.subdivisions,this.smoothShading?s.phongAngle??35:-1):null;this.subdividedGeometry?.dispose(),this.subdividedGeometry=a??void 0,this.subdividedGeometry&&this.originalGeometry.boundingSphere&&(this.subdividedGeometry.boundingSphere=this.originalGeometry.boundingSphere),this.localGeometry=this.subdividedGeometry??this.originalGeometry,e(this),i(this),void 0!==h&&(this.localGeometry.userData.parameters=h),r&&(this.localGeometry.uuid=r)}updateByPatchedOpGeometry(e,i,t){super.updateByPatchedOpGeometry(e,i,t),this.localGeometry&&(0===e.type&&0===e.path.length&&s(e.props)&&this.subdivPointer?this.updateSubdivisionLevel(i):this.createGeometryByControls(i))}};export{m as a,y as b};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as e}from"./runtime-chunk-DCPBSRSM.js";import{Ec as t,Fc as s,Fd as a,Gc as i,Ge as r,Ib as n,Oc as h,Tc as o,Wd as l,Xd as d,Zc as c,kd as u,ld as g}from"./runtime-chunk-VGN7YHB7.js";var p=null;function b(e){p=e}function S(){return p}var m=null;function f(e){m=e}function M(){return m}var y=new o;function R(e,t,s){return y.setRGB(e,t,s,n),{r:y.r,g:y.g,b:y.b}}var w=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,x=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,s){let a,i=w(e.angle,0),[r,n]=x(e.offset),[h,o]=x(e.morph),l=e.colors??[],d=e.steps??[],c=Math.min(10,l.length,d.length);if(0===c)return[1,1,1,1];if(1===e.gradientType){let e=3*(t+h)-(t+r)-1,l=3*(s+o)-(s+n)-1;a=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,s+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;a=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==s?s:1e-6),d=Math.cos(i)*e-Math.sin(i)*l,c=Math.sin(i)*e+Math.cos(i)*l,u=d*d+c*c;a=u>1e-12?(((t-.5+r)/2+d/2)*d+((s-.5+n)/2+c/2)*c)/u:0}let u=l[0][0],g=l[0][1],p=l[0][2],b=l[0][3];for(let t=1;t<c;t++){let s=d[t-1],i=d[t]-s,r=0!==i?Math.min(1,Math.max(0,(a-s)/i)):a>=s?1:0;e.smooth&&(r=r*r*(3-2*r)),u+=(l[t][0]-u)*r,g+=(l[t][1]-g)*r,p+=(l[t][2]-p)*r,b+=(l[t][3]-b)*r}return[u,g,p,b]}function A(e,t){let s=e,a=s?.data?.layers;if(a&&"function"==typeof a.forEach){let e=t,s=[];return a.forEach(t=>{let a=t.data;if(!1===a.visible||!0===a.isMask)return;let i=w(a.alpha,1);if(!(i<=0))if("color"===a.type){let t,r=a.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&s.push({kind:"color",layer:a,rgb:{...R(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===a.type&&s.push({kind:"gradient",layer:a,alpha:i})}),0===s.length?null:(e,t)=>{let a=1,i=1,r=1,n=!0;for(let h of s){let s,o,l,d;if("color"===h.kind)({r:s,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[a,i,r,n]=v(h.layer,e,t);({r:s,g:o,b:l}=R(a,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));a+=(s-a)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:a,g:i,b:r}}}if(s?.color&&!0===s.color.isColor){let{r:e,g:t,b:a}=s.color;return()=>({r:e,g:t,b:a})}return null}var j=32,I=16384,B=32*I,F=100;function W(e,t){if("torus"===e){let e=t()*Math.PI*2,s=t()*Math.PI*2,a=Math.cos(e),i=Math.sin(e),r=Math.cos(s),n=Math.sin(s);return{x:(1.4+.7*r)*a,y:-(1.4+.7*r)*i,z:.7*n,nx:r*a,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,s=Math.cos(e),a=Math.sin(e);return{x:.8*s,y:1.6*(t()-.5),z:.8*a,nx:s,ny:0,nz:a,cr:1,cg:1,cb:1}}let s=t()*Math.PI*2,a=2*t()-1,i=Math.acos(a),r=Math.sin(i)*Math.cos(s),n=Math.cos(i),h=Math.sin(i)*Math.sin(s);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function k(e){let{geometry:t,matrix:s}=e,a=t.getAttribute("position");if(!a||a.count<3)return null;let r=t.getAttribute("normal"),n=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:a.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=s?s.elements:null,u=s?(new i).getNormalMatrix(s).elements:null,g=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[0]*t+c[4]*s+c[8]*i+c[12]:t},p=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[1]*t+c[5]*s+c[9]*i+c[13]:s},b=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[2]*t+c[6]*s+c[10]*i+c[14]:i},S=new Float64Array(l),m=0;for(let e=0;e<l;e++){let t=d(e,0),s=d(e,1),a=d(e,2),i=g(t),r=p(t),n=b(t),h=g(s)-i,o=p(s)-r,l=b(s)-n,c=g(a)-i,u=p(a)-r,f=b(a)-n,M=o*f-l*u,y=l*c-h*f,R=h*u-o*c;m+=.5*Math.sqrt(M*M+y*y+R*R),S[e]=m}return m<=0?null:{total:m,sample:(t,s)=>{let a=0,i=l-1;for(;a<i;){let e=a+i>>1;S[e]<t?a=e+1:i=e}let o=a,c=d(o,0),m=d(o,1),f=d(o,2),M=s(),y=s();M+y>1&&(M=1-M,y=1-y);let R,w,x,v=1-M-y,A=g(c)*v+g(m)*M+g(f)*y,j=p(c)*v+p(m)*M+p(f)*y,I=b(c)*v+b(m)*M+b(f)*y;if(r){if(R=r.getX(c)*v+r.getX(m)*M+r.getX(f)*y,w=r.getY(c)*v+r.getY(m)*M+r.getY(f)*y,x=r.getZ(c)*v+r.getZ(m)*M+r.getZ(f)*y,u){let e=u[0]*R+u[3]*w+u[6]*x,t=u[1]*R+u[4]*w+u[7]*x,s=u[2]*R+u[5]*w+u[8]*x;R=e,w=t,x=s}}else{let e=g(c),t=p(c),s=b(c),a=g(m)-e,i=p(m)-t,r=b(m)-s,n=g(f)-e,h=p(f)-t,o=b(f)-s;R=i*o-r*h,w=r*n-a*o,x=a*h-i*n}let B=Math.sqrt(R*R+w*w+x*x)||1,F=1,W=1,k=1;if(h)F=h.getX(c)*v+h.getX(m)*M+h.getX(f)*y,W=h.getY(c)*v+h.getY(m)*M+h.getY(f)*y,k=h.getZ(c)*v+h.getZ(m)*M+h.getZ(f)*y;else if(e.sampleColor){let t=n?n.getX(c)*v+n.getX(m)*M+n.getX(f)*y:.5,s=n?n.getY(c)*v+n.getY(m)*M+n.getY(f)*y:.5,a=e.sampleColor(t,s);a&&(F=a.r,W=a.g,k=a.b)}return{x:A,y:j,z:I,nx:R/B,ny:w/B,nz:x/B,cr:F,cg:W,cb:k}}}}function C(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),s=function(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}(e.seed??1337),a="object"===e.shape&&e.sampler,i=a?e.samplerRadius??F:F,r=new Float32Array(4*B),n=new Float32Array(B),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=a?e.sampler(s):W(e.shape,s),l=a?t.x:t.x*i,d=a?t.y:t.y*i,c=a?t.z:t.z*i,{nx:u,ny:g,nz:p}=t;h[4*o+0]=t.cr,h[4*o+1]=t.cg,h[4*o+2]=t.cb;let b,S,m,f=32*o,M=(1.8+.8*s())*e.hairLength*i/31,y=.5+1.5*s(),R=(.02+.06*s())*i;Math.abs(g)<.99?(b=-p,S=0,m=u):(b=1,S=0,m=0);let w=Math.sqrt(b*b+S*S+m*m)||1;for(let e=0;e<32;e++){let t=e/31,s=t*t*.4*i,a=R*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+a*b/w,r[h+1]=d+g*M*e-s+a*S/w,r[h+2]=c+p*M*e+a*m/w,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var H=1/60,O=4,P=new h,L=new t,z=new s,q=new s,G=class extends e{constructor(e,a,i){super(e,a),this.type="HairSystem",this.isHairSystem=!0,this.simRunning=!1,this.previewRequested=!1,this.playModeActive=!1,this.pendingSimSeconds=0,this.simTime=0,this.resetRequested=!0,this.generation=0,this.settledSimSeconds=0,this.lastMotionFingerprint=0,this.lastBoneQuat=new t,this.lastBonePos=new s,this.hasLastBone=!1,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=i,this.data=a,this.geometry.setAttribute("position",new c(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new l(F,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let n=new r;n.setAttribute("position",new c(new Float32Array(12),3)),n.setIndex([0,2,1,2,3,1]),n.instanceCount=0,this.ribbonMesh=new g(n,new u({visible:!1})),this.ribbonMesh.name="HairRibbons",this.ribbonMesh.frustumCulled=!1,this.ribbonMesh.visible=!1,this.ribbonMesh.matrixAutoUpdate=!1,this.ribbonMesh.updateMatrixWorld=()=>{this.ribbonMesh.matrixWorld.identity()},this.ribbonMesh.updateWorldMatrix=()=>{this.ribbonMesh.matrixWorld.identity()},this.add(this.ribbonMesh),this.activeGuideStrands=a.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:a.guideStrands,hairLength:a.hairLength,spreadRadius:a.spreadRadius,headShape:a.headShape,baseObjectId:a.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*H*2),this.trackMotionRest(e/1e3))}trackMotionRest(e){this.boneTransform(L,z);let t=this.hasLastBone&&(Math.abs(this.lastBoneQuat.dot(L))<.9999995||this.lastBonePos.distanceToSquared(z)>1e-8),s=this.motionFingerprint(),a=!this.hasLastBone||t||this.resetRequested||s!==this.lastMotionFingerprint||this.data.windStrength>.001;this.lastBoneQuat.copy(L),this.lastBonePos.copy(z),this.lastMotionFingerprint=s,this.hasLastBone=!0,this.settledSimSeconds=a?0:this.settledSimSeconds+e}motionFingerprint(){let e=this.data;return e.gravity+2*e.damping+3*e.localStiffness+4*e.globalStiffness+5*e.globalRange+6*e.stiffnessFalloff+7*e.windStrength+8*e.vspCoefficient+9*e.kink+10*e.kinkFrequency+11*e.clumpStrength+12*e.clumpSize+13*e.clumpTipScale}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}get isMotionSettled(){return this.settledSimSeconds>6}get isVisiblyAnimating(){return this.isSimulating&&!this.isMotionSettled}startPreview(){this.previewRequested=!0,this.syncSimRunning()}stopPreview(){this.previewRequested=!1,this.syncSimRunning()}setPlayMode(e){this.playModeActive=e,e&&this.resetSimulation(),this.syncSimRunning()}resetSimulation(){this.resetRequested=!0,this.pendingSimSeconds=0,this.simTime=0,this.settledSimSeconds=0}warnClassicFallbackOnce(){this.classicFallbackWarned||(this.classicFallbackWarned=!0,console.warn("[spline] Hair System strands require the WebGPU renderer — the WebGL fallback shows only the scalp. Reload with ?renderer=webgpu in a WebGPU-capable browser."))}syncSimRunning(){this.simRunning=this.playModeActive||this.previewRequested||this.data.autoPlay}updateState(e,t){super.updateState(e,t),this.updateHairState(e)}updateHairState(e){if((void 0!==e.guideStrands||void 0!==e.hairLength||void 0!==e.spreadRadius||void 0!==e.headShape||void 0!==e.baseObjectId)&&this.regenerate(),(void 0!==e.headShape||void 0!==e.baseObjectId)&&this.applyScalpState(),void 0!==e.headColor){let t=this.scalpMesh.material;!0===t.isMeshBasicMaterial&&t.color.setRGB(e.headColor.r,e.headColor.g,e.headColor.b,n)}(void 0!==e.castShadow||void 0!==e.receiveShadow)&&this.applyShadowState(),void 0!==e.autoPlay&&this.syncSimRunning()}applyShadowState(){let e=this.data.castShadow??!0,t=this.data.receiveShadow??!0;this.castShadow=e,this.receiveShadow=t,this.scalpMesh.castShadow=e,this.scalpMesh.receiveShadow=t,this.ribbonMesh.castShadow=e,this.ribbonMesh.receiveShadow=t}regenerate(){this.activeGuideStrands=Math.max(1,Math.min(Math.floor(this.data.guideStrands),16384)),this.roots=this.buildRoots(),this.generation++,this.regenSnapshot={guideStrands:this.data.guideStrands,hairLength:this.data.hairLength,spreadRadius:this.data.spreadRadius,headShape:this.data.headShape,baseObjectId:this.data.baseObjectId},this.resetSimulation()}checkDataDrift(){let e=this.data,t=this.regenSnapshot;if(null===t||t.guideStrands!==e.guideStrands||t.hairLength!==e.hairLength||t.spreadRadius!==e.spreadRadius||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId){let s=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),s&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:s,hairLength:a}=this.data;if(this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,"object"===e&&t){let e=this.context.scene.find(t);if(e){this.baseFoundAtRegen=!0,e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),i=t?function(e){let t=[];for(let s of e){let e=k(s);e&&t.push(e)}if(0===t.length)return null;let s=new Float64Array(t.length),a=0;for(let e=0;e<t.length;e++)a+=t[e].total,s[e]=a;return a<=0?null:e=>{let i=e()*a,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;s[e]<i?r=e+1:n=e}let h=0===r?i:i-s[r-1];return t[r].sample(h,e)}}(t.sources):null;if(this.baseSourceGeomsAtRegen=t?.sources.map(e=>e.geometry)??[],this.baseSourceHashesAtRegen=t?.hashes??[],this.baseColorHashAtRegen=t?.colorHash??0,t&&i){let r=this.baseWorldScale(e),n=Math.max(t.radius*r,.001);this.baseScaleAtRegen=r;let h=r;return C({shape:"object",guideStrands:s,hairLength:a,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return C({shape:"object"===e?"sphere":e,guideStrands:s,hairLength:a})}collectBaseSources(e){let t=[],s=[],a=0,i=0;P.copy(e.matrixWorld).invert();let r=P.clone(),n=o=>{if(!0===o.isHairSystem||o!==e&&!1===o.visible)return;let l=o.geometry;if(!0===o.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=o===e?void 0:(new h).multiplyMatrices(r,o.matrixWorld),d=Array.isArray(o.material)?o.material[0]:o.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),s.push(G.matrixHash(n)),i+=function(e,t){let s=e,a=0,i=1,r=e=>{a+=e*i,i+=1},n=s?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let s=t.data;if(!1!==s.visible)if("color"===s.type){let t=s.color,a="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;a&&"number"==typeof a.r&&(r(a.r),r(a.g),r(a.b)),r(w(s.alpha,1))}else if("gradient"===s.type){let e=s;for(let t of e.colors??[])r(t[0]),r(t[1]),r(t[2]),r(t[3]);for(let t of e.steps??[])r(t);r(w(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else s?.color&&!0===s.color.isColor&&(r(s.color.r),r(s.color.g),r(s.color.b));return a}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(z.copy(c.center).applyMatrix4(n),e=z.length(),t=G.matrixMaxScale(n)):e=c.center.length(),a=Math.max(a,e+c.radius*t)}}for(let e of o.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:s,radius:Math.max(a,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,s=0;for(let e=0;e<16;e++)s+=t[e]*(e+1);return s}static matrixMaxScale(e){let t=e.elements,s=Math.hypot(t[0],t[1],t[2]),a=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(s,a,i,1e-6)}baseWorldScale(e){return P.copy(e.matrixWorld).decompose(z,L,q),Math.max(Math.abs(q.x),Math.abs(q.y),Math.abs(q.z),1e-6)}get widthWorldScale(){return"object"===this.data.headShape&&this.data.baseObjectId&&this.baseScaleAtRegen>0?this.baseScaleAtRegen:1}checkBaseDrift(){if("object"!==this.data.headShape||!this.data.baseObjectId)return;let e=this.context.scene.find(this.data.baseObjectId);if(!e)return;if(!this.baseFoundAtRegen)return void this.regenerate();e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),s=t?.sources??[],a=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=s.length!==i.length;if(!n)for(let e=0;e<s.length;e++)if(s[e].geometry!==i[e]||Math.abs(a[e]-r[e])>1e-4*Math.max(Math.abs(r[e]),1)){n=!0;break}if(!n&&"object"===this.data.hairColorSource&&(t?.colorHash??0)!==this.baseColorHashAtRegen&&(n=!0),!n&&s.length>0){let t=this.baseWorldScale(e);n=Math.abs(t-this.baseScaleAtRegen)>.001*Math.max(this.baseScaleAtRegen,1e-6)}n&&this.regenerate()}applyScalpState(){let e=this.data.headShape,t="object"===e&&null!==this.data.baseObjectId;this.scalpMesh.visible=!t,!t&&(this.scalpMesh.geometry.dispose(),this.scalpMesh.geometry="torus"===e?new d(140,70,24,48):"cylinder"===e?new a(80,80,160,48,1):new l(F,48,32))}boneTransform(e,t){let s=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(s=e)}P.copy(s).decompose(t,e,q)}raycast(e,t){if(!this.scalpMesh.visible)return;let s=[];this.scalpMesh.raycast(e,s);for(let e of s)e.object=this,t.push(e)}get shadowBoundsRadius(){let e="torus"===this.data.headShape?2.6:1.5;return this.roots.unitScale*(e+2.6*Math.max(this.data.hairLength,0))}getShadowBoundsCenter(e){return this.boneTransform(L,e),e}updateEntityBoxSize(e,t){let s=this.shadowBoundsRadius;e.set(0,0,0),t.set(s,s,s)}dispose(){super.dispose(),this.scalpMesh.geometry.dispose(),this.scalpMesh.material.dispose(),this.ribbonMesh.geometry.dispose(),this.ribbonMesh.material.dispose?.(),M()?.release(this)}};export{b as a,S as b,f as c,M as d,j as e,I as f,B as g,F as h,H as i,O as j,G as k};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{W as o}from"./runtime-chunk-
|
|
1
|
+
import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{W as o}from"./runtime-chunk-LX7POLY3.js";import{Dc as n,Fc as t,Jc as r}from"./runtime-chunk-VGN7YHB7.js";var i={enabled:!1},s=new WeakMap;function a(e){if(!i.enabled)return e;let o=s.get(e);return o||(o={...e,bloom:{...e.bloom,kernelSize:0},depthOfField:{...e.depthOfField,enabled:!1}},s.set(e,o)),o}var c=new WeakSet;function l(e){if(!e.isPointLight&&!e.isSpotLight&&!e.isDirectionalLight)return!1;if(i.enabled){if(!0===e.castShadow)return e.castShadow=!1,c.add(e),!0}else if(c.has(e)&&(c.delete(e),!1===e.castShadow))return e.castShadow=!0,!0;return!1}function u(i,s){switch(i.type){case"cavity":return function(e,o){return{...h(e,o),ridge:e.ridge,valley:e.valley}}(i,s);case"dust":return function(n,t){return{...h(n,t),color:e(n.color,t),coverage:o(n.coverage,t)??.2,softness:o(n.softness,t)??.2,noiseStrength:o(n.noiseStrength,t)??.2,noiseScale:o(n.noiseScale,t)??1}}(i,s);case"fresnel":return function(o,n){let{bias:t,scale:r,intensity:i,factor:s,color:a}=o;return{...h(o,n),color:e(a,n),bias:t,scale:r,intensity:i,factor:s}}(i,s);case"gradient":return function(e,o){let{gradientType:t,smooth:i,colors:s,steps:a,angle:c,offset:l,morph:u}=e;return{...h(e,o),gradientType:t,smooth:i,colors:s.map(e=>new r(e[0],e[1],e[2],e[3])),num:s.length,steps:a,offset:new n(...l.map(e=>"number"==typeof e?e:0)),morph:new n(...u.map(e=>"number"==typeof e?e:0)),angle:c}}(i,s);case"depth":return function(e,o){let{gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:l,direction:u,colors:f,steps:p,smooth:m}=e;return{...h(e,o),gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:new t(...l),direction:u?new t(...u):new t(1,0,0),colors:f.map(e=>void 0!==e?new r(e[0],e[1],e[2],e[3]):new r(0,0,0,0)),steps:p.slice(0,f.length),smooth:m}}(i,s);case"normal":return function(e,o){let{cnormal:n}=e;return{...h(e,o),cnormal:new t(n[0],n[1],n[2])}}(i,s);case"noise":return function(o,r){return{...h(o,r),scale:o.scale,move:o.move,fA:new n(...o.fA.map(e=>"number"==typeof e?e:0)),fB:new n(...o.fB.map(e=>"number"==typeof e?e:0)),size:new t(...o.size),distortion:new n(...o.distortion.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,r),colorB:e(o.colorB,r),colorC:e(o.colorC,r),colorD:e(o.colorD,r),noiseType:o.noiseType,voronoiStyle:o.voronoiStyle,highCut:o.highCut,lowCut:o.lowCut,smoothness:o.smoothness,seed:o.seed,quality:o.quality}}(i,s);case"rainbow":return function(e,o){return{...h(e,o),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new t(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new t(...e.offset)}}(i,s);case"toon":return function(o,n){return{...h(o,n),positioning:o.positioning,colors:o.colors.map(e=>new r(e[0],e[1],e[2],e[3])),num:o.colors.length,steps:o.steps,source:new t(...o.source),isWorldSpace:o.isWorldSpace,noiseStrength:o.noiseStrength,noiseScale:o.noiseScale,shadowColor:e(o.shadowColor,n),offset:new t(...o.offset)}}(i,s);case"outline":return function(o,n){return{...h(o,n),outlineColor:e(o.outlineColor,n),contourColor:e(o.contourColor,n),outlineWidth:o.outlineWidth,contourWidth:o.contourWidth,outlineThreshold:o.outlineThreshold,contourThreshold:o.contourThreshold,outlineSmoothing:o.outlineSmoothing,contourFrequency:o.contourFrequency,contourDirection:new t(...o.contourDirection),positionalLines:o.positionalLines,compensation:o.compensation}}(i,s);case"transmission":return function(o,n){return{...h(o,n),thickness:o.thickness,ior:o.ior,roughness:o.roughness,attenuationColor:void 0!==o.attenuationColor?e(o.attenuationColor,n):{r:1,g:1,b:1,a:1},attenuationDistance:o.attenuationDistance??0}}(i,s);case"reflection":return function(e,n){return{...h(e,n),blur:o(e.blur,n)??0,thickness:o(e.thickness,n)??.001,steps:o(e.steps,n)??60,stepSize:o(e.stepSize,n)??.005,tracingMode:e.tracingMode,mirror:e.mirror??0}}(i,s);case"pattern":return function(o,t){return{...h(o,t),style:o.style,projection:o.projection,axis:o.axis,blending:o.blending,offset:new n(...o.offset.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,t),colorB:e(o.colorB,t),frequency:new n(...o.frequency.map(e=>"number"==typeof e?e:0)),size:o.size,variation:o.variation,smoothness:o.smoothness,zigzag:o.zigzag,rotation:o.rotation,vertical:new n(...o.vertical.map(e=>"number"==typeof e?e:0)),horizontal:new n(...o.horizontal.map(e=>"number"==typeof e?e:0)),sides:o.sides}}(i,s);case"vertexColor":return h(i,s);default:return function(o,n){return{...h(o,n),color:e(o.color,n)}}(i,s)}}function f(e){return{type:e.type}}function h(e,o){let{alpha:n,mode:t,isMask:r}=e,i="string"==typeof n?Number(o.getVariable(n)??100)/100:n;return{...f(e),alpha:i,mode:t,isMask:r}}export{i as a,a as b,l as c,u as d};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-
|
|
1
|
+
import{a as t}from"./runtime-chunk-O37H7LZI.js";import{d as e}from"./runtime-chunk-XL37JGAH.js";import{Sc as s}from"./runtime-chunk-VGN7YHB7.js";var r=class extends(e(s,t)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),"Empty"===this.data.type&&(this.objectHelper.visible=!1)}updateState(t,e){this.updateState_Entity(t,e),"buffer"in t&&1===Object.keys(t).length&&e.scene.reloadSplats()}};export{r as a};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,G as a,H as t,d as i,f as r,g as n,x as o,z as s}from"./runtime-chunk-
|
|
1
|
+
import{E as e,G as a,H as t,d as i,f as r,g as n,x as o,z as s}from"./runtime-chunk-VPEJ5BFD.js";var l,u,d,c,f,h,p,m,g,b,y,w,A,D,v,B,k,_,z,S,x,O,P,j;function C(e,a=[0,0]){return[e&&!isNaN(e[0])?e[0]:a[0],e&&!isNaN(e[1])?e[1]:a[1]]}function R(e,i,r){switch(e){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 7:return"cubicBezier( .25, 1, .5, 1 )";case 5:{let{control1:e,control2:a}=i??{...t.defaultData};return`cubicBezier( ${e[0]}, ${e[1]}, ${a[0]}, ${a[1]} )`}case 6:{let{mass:e,stiffness:t,damping:i,velocity:n}=r??{...a.defaultData},o=new G(e,t,i,n),s=o.solve(1);return()=>e=>o.solve(e)/s}case 8:return()=>e=>Math.floor(e)}}function E(e,a,t){return{id:a,fi:t,data:{id:a,path:e,keyframes:new n}}}(l||(l={})).emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"},(u||(u={})).is=function(e){return!0},(c=d||(d={})).defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]},c.merge=function(e,a){return{position:a?.position??e.position,rotation:a?.rotation??e.rotation,scale:a?.scale??e.scale,shear:a?.shear??e.shear}},c.diff=function(e,a){return i({position:s.isEqual(e.position,a.position)?void 0:a.position,rotation:e.rotation===a.rotation?void 0:a.rotation,scale:s.isEqual(e.scale,a.scale)?void 0:a.scale,shear:e.shear&&a.shear&&s.isEqual(e.shear,a.shear)?void 0:a.shear})},(f||(f={})).defaultData={horizontalConstraint:0,verticalConstraint:0},(h||(h={})).defaultData={direction:"row",wrap:"unwrap",align:"top-left",gap:10,rowGap:10,autoGap:!1,autoRowGap:!1,leftPadding:8,rightPadding:8,topPadding:8,bottomPadding:8},(p||(p={})).defaultData={opacity:1,fill:{color:e.fromHexAndA(o,1),enabled:!0},stroke:{color:e.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0}},(g=m||(m={})).newEmpty=function(e,a){return{name:a}},g.patch=function(e,a){if(void 0===a)return e;let t={...e};return Object.assign(t,d.merge(t,a)),t=function(e,a){if(void 0===a)return e;let t={...e},i=["width","height","cornerRadius"];for(let e of i)e in t&&e in a&&void 0!==a[e]&&Object.assign(t,{[e]:a[e]});return t}(t,a),t=function(e,a){if(void 0===a)return e;let t={...e};return"fill"in t&&"fill"in a&&void 0!==a.fill&&Object.assign(t,{fill:{...t.fill,...a.fill}}),"stroke"in t&&"stroke"in a&&void 0!==a.stroke&&Object.assign(t,{stroke:{...t.stroke,...a.stroke}}),"layerBlur"in t&&"layerBlur"in a&&void 0!==a.layerBlur&&Object.assign(t,{layerBlur:{...t.layerBlur,...a.layerBlur}}),"backgroundBlur"in t&&"backgroundBlur"in a&&void 0!==a.backgroundBlur&&Object.assign(t,{backgroundBlur:{...t.backgroundBlur,...a.backgroundBlur}}),"dropShadow"in t&&"dropShadow"in a&&void 0!==a.dropShadow&&Object.assign(t,{dropShadow:{...t.dropShadow,...a.dropShadow}}),"innerShadow"in t&&"innerShadow"in a&&void 0!==a.innerShadow&&Object.assign(t,{innerShadow:{...t.innerShadow,...a.innerShadow}}),t}(t,a),t},g.toOps=function(e,a){let t,i=[];for(let[e,r]of Object.entries(a))"name"!==e&&(void 0===t&&(t={path:[],props:{},type:0},i.push(t)),t.props[e]=r);return i},(b||(b={})).defaultData={...d.defaultData,...f.defaultData,states:new n,events:new n,visible:!0,raycastLock:!1},(y||(y={})).defaultData={...b.defaultData,...p.defaultData},(w||(w={})).defaultData={cornerRadius:[0,0,0,0]},(A||(A={})).defaultData={...y.defaultData,type:"ellipse2d",width:100,height:100,name:"Ellipse"},(D||(D={})).defaultData={...y.defaultData,...w.defaultData,type:"rectangle2d",width:100,height:100,name:"Rectangle"},(v||(v={})).defaultData={...y.defaultData,type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"},(B||(B={})).defaultData={...y.defaultData,type:"path2d",path:"",name:"Path"},(k||(k={})).is=function(e){return"ellipse2d"===e.type||"rectangle2d"===e.type||"text2d"===e.type||"vector2d"===e.type||"path2d"===e.type},(_||(_={})).defaultData={...b.defaultData,name:"Group",type:"group2d"},(z||(z={})).defaultData=()=>({...b.defaultData,...w.defaultData,...p.defaultData,name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:e.fromHexAndA(4737101,1),enabled:!0},stroke:{color:e.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}}),(e=>{e.defaultData=function(e){switch(e){case"rectangle2d":case"vector2d":return{...D.defaultData};case"ellipse2d":return{...A.defaultData};case"text2d":return{...v.defaultData};case"path2d":return{...B.defaultData};case"frame2d":return{...z.defaultData()};case"group2d":return{..._.defaultData}}},e.getPivot=function(e){return"width"in e&&"height"in e?["number"==typeof e.width?.5*e.width:0,"number"==typeof e.height?.5*e.height:0]:[0,0]},e.isResizeable=function(e){return"rectangle2d"===e.type||"ellipse2d"===e.type||"text2d"===e.type||"frame2d"===e.type},e.isAutoLayoutable=function(e){return"frame2d"===e.type&&void 0!==e.autoLayout},e.hasCorners=function(e){return"rectangle2d"===e.type||"frame2d"===e.type}})(S||(S={})),(O=x||(x={})).defaultData={name:"UI",type:"scene2d",objects:new r},O.emptyData=function(){return{type:"scene2d",objects:new r}},(P||(P={})).is=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z},(e=>{e.getControlsWithDefault=function(e,a){let t=[0,0],i=[1,1];if(e?.cubicControls)t=C(e.cubicControls.control1,t);else switch(e?.type){case 2:case 4:t=[.42,0];break;case 3:case 0:t=[0,0];break;case 1:t=[.25,.1];break;case 7:t=[.25,1]}if(a?.cubicControls)i=C(a.cubicControls.control2,i);else switch(a?.type){case 2:case 0:i=[1,1];break;case 3:case 4:i=[.58,1];break;case 1:i=[.25,1];break;case 7:i=[.5,1]}return{control1:t,control2:i}},e.defaultData=function(e,a){return{id:e,name:a,to:5,properties:new n}},e.createMaterialGroup=function(e){let a=new n;return e.forEach(({data:e,id:t,fi:i})=>{if("light"===e.type){let r=E(["material",`${e.category} lighting`],t,i);a.push(r)}else{let r=E(["material",e.type],t,i);a.push(r)}}),a},e.createName=function(e){return Object.entries(e).reduce((e,[a,t])=>("string"!=typeof t&&e.push({name:t.name}),e),[])},e.Presets=[{name:"Slide in",animationParams:{translateX:{value:[-20,0],easing:R(3),duration:1e3},opacity:{value:[0,1],easing:R(3),duration:1e3},endDelay:250,loop:!0}},{name:"Rotate",animationParams:{rotate:{value:[0,"1turn"],easing:R(5),duration:700},endDelay:250,loop:!0}},{name:"Scale Out",animationParams:{scale:{value:[1,1.5],easing:R(4),duration:1e3},endDelay:250,loop:!0}},{name:"Jump",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],endDelay:500,loop:!0}},{name:"Jump Rotate",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],rotate:{value:[0,"1turn"],easing:R(5),duration:500},endDelay:500,loop:!0}},{name:"Bounce",animationParams:{translateY:{value:["20px","-20px"],duration:575,easing:"easeOutQuad"},direction:"alternate",loop:!0}}]})(j||(j={}));var M=["x","y","z"],G=class{constructor(e=1,a=100,t=10,i=0){this.mass=e,this.stiffness=a,this.damping=t,this.initialVelocity=i,this.m_w0=Math.sqrt(a/e),this.m_zeta=t/(2*Math.sqrt(a*e)),this.m_zeta<1?(this.m_wd=this.m_w0*Math.sqrt(1-this.m_zeta*this.m_zeta),this.m_A=1,this.m_B=(this.m_zeta*this.m_w0-i)/this.m_wd):(this.m_wd=0,this.m_A=1,this.m_B=-i+this.m_w0)}solve(e){return 1-(this.m_zeta<1?Math.exp(-e*this.m_zeta*this.m_w0)*(this.m_A*Math.cos(this.m_wd*e)+this.m_B*Math.sin(this.m_wd*e)):(this.m_A+this.m_B*e)*Math.exp(-e*this.m_w0))}getDuration(){let e=.16666666666666666,a=0,t=0;for(;;)if(a+=e,1===this.solve(a)){if(t++,t>=16)break}else t=0;return a*e*1e3}};export{l as a,m as b,D as c,_ as d,S as e,x as f,C as g,R as h,M as i};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s}from"./runtime-chunk-
|
|
1
|
+
import{d as s}from"./runtime-chunk-PEOLFGBX.js";import{a as t,b as i}from"./runtime-chunk-XL37JGAH.js";import{Fc as a,Tc as o,Te as e,We as h,Xc as r,ze as d}from"./runtime-chunk-VGN7YHB7.js";var n=class extends(t(e)){constructor(s,t=15,i=6710886){super(s,t,i),this.object=s,this.name=`PointLightHelper: ${s.uuid}`}raycast(s,t){i(this.object,n.geometryHelper,s,t)}},p=class extends(s(d,n)){constructor(s,t,i){super(),this.super_Entity(s,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.fov=90,e.aspect=1,e.near=100,e.far=2500;let d=new a(-e.far+this.position.x,-e.far+this.position.y,-e.far+this.position.z),n=new a(e.far+this.position.x,e.far+this.position.y,e.far+this.position.z),p=new r(d,n),c=new h(p,new o(16755200));c.visible=!1,this.gizmos.shadowmap=c,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let s in this.gizmos){let t=this.gizmos[s];if(t instanceof h){let s=this.shadow.camera,i=new a(-s.far+this.position.x,-s.far+this.position.y,-s.far+this.position.z),o=new a(s.far+this.position.x,s.far+this.position.y,s.far+this.position.z);t.box.set(i,o),t.updateMatrixWorld(!0)}}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.objectHelper&&this.objectHelper.update()}updateState(s,t){this.updateState_Light(s,t),void 0!==s.distance&&(this.distance=s.distance),void 0!==s.decay&&(this.decay=s.decay),void 0!==s.shadowRadius&&(this.shadow.radius=s.shadowRadius),void 0!==s.shadowResolution&&(this.shadow.mapSize.set(s.shadowResolution,s.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};export{p as a};
|
|
Binary file
|
|
Binary file
|