@splinetool/runtime 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{runtime-chunk-NHLFGFU5.js → runtime-chunk-2LTYI3AN.js} +1 -1
- package/build/runtime-chunk-2LTYI3AN.js.br +0 -0
- package/build/runtime-chunk-2LTYI3AN.js.gz +0 -0
- package/build/{runtime-chunk-T7HEAOAP.js → runtime-chunk-3A4X5B7V.js} +1 -1
- package/build/runtime-chunk-3A4X5B7V.js.br +0 -0
- package/build/runtime-chunk-3A4X5B7V.js.gz +0 -0
- package/build/{runtime-chunk-FYQSEYL5.js → runtime-chunk-3CMVQQOR.js} +1 -1
- package/build/runtime-chunk-3CMVQQOR.js.br +0 -0
- package/build/runtime-chunk-3CMVQQOR.js.gz +0 -0
- package/build/{runtime-chunk-Q23Z6MJP.js → runtime-chunk-3O7PY43O.js} +1 -1
- package/build/runtime-chunk-3O7PY43O.js.br +0 -0
- package/build/runtime-chunk-3O7PY43O.js.gz +0 -0
- package/build/{runtime-chunk-HLXTXF7I.js → runtime-chunk-5IABHLHS.js} +1 -1
- package/build/runtime-chunk-5IABHLHS.js.br +0 -0
- package/build/runtime-chunk-5IABHLHS.js.gz +0 -0
- package/build/{runtime-chunk-MQKKQEK3.js → runtime-chunk-6ARRPM23.js} +1 -1
- package/build/{runtime-chunk-MQKKQEK3.js.br → runtime-chunk-6ARRPM23.js.br} +0 -0
- package/build/{runtime-chunk-MQKKQEK3.js.gz → runtime-chunk-6ARRPM23.js.gz} +0 -0
- package/build/{runtime-chunk-DQMOB5OU.js → runtime-chunk-AAGXG7XK.js} +1 -1
- package/build/runtime-chunk-AAGXG7XK.js.br +0 -0
- package/build/runtime-chunk-AAGXG7XK.js.gz +0 -0
- package/build/{runtime-chunk-FJ3HZ257.js → runtime-chunk-AYLDDUAZ.js} +1 -1
- package/build/runtime-chunk-AYLDDUAZ.js.br +0 -0
- package/build/runtime-chunk-AYLDDUAZ.js.gz +0 -0
- package/build/{runtime-chunk-K3MY5TZT.js → runtime-chunk-BZJCMBUI.js} +1 -1
- package/build/runtime-chunk-BZJCMBUI.js.br +0 -0
- package/build/runtime-chunk-BZJCMBUI.js.gz +0 -0
- package/build/{runtime-chunk-DA36J6OU.js → runtime-chunk-DMDTTYNN.js} +1 -1
- package/build/runtime-chunk-DMDTTYNN.js.br +0 -0
- package/build/runtime-chunk-DMDTTYNN.js.gz +0 -0
- package/build/{runtime-chunk-FBNDPGTS.js → runtime-chunk-E3QYEXEP.js} +1 -1
- package/build/runtime-chunk-E3QYEXEP.js.br +0 -0
- package/build/runtime-chunk-E3QYEXEP.js.gz +0 -0
- package/build/{runtime-chunk-4ENGAWL7.js → runtime-chunk-E753C25I.js} +1 -1
- package/build/runtime-chunk-E753C25I.js.br +0 -0
- package/build/runtime-chunk-E753C25I.js.gz +0 -0
- package/build/{runtime-chunk-O6F5QJHF.js → runtime-chunk-FGRW5LUR.js} +1 -1
- package/build/runtime-chunk-FGRW5LUR.js.br +0 -0
- package/build/runtime-chunk-FGRW5LUR.js.gz +0 -0
- package/build/{runtime-chunk-XT53PDQV.js → runtime-chunk-HN7CSPUY.js} +1 -1
- package/build/runtime-chunk-HN7CSPUY.js.br +0 -0
- package/build/runtime-chunk-HN7CSPUY.js.gz +0 -0
- package/build/{runtime-chunk-I5YVCEFL.js → runtime-chunk-K67GTQLJ.js} +1 -1
- package/build/runtime-chunk-K67GTQLJ.js.br +0 -0
- package/build/runtime-chunk-K67GTQLJ.js.gz +0 -0
- package/build/{runtime-chunk-AVO7AFZY.js → runtime-chunk-M424ONWP.js} +1 -1
- package/build/runtime-chunk-M424ONWP.js.br +0 -0
- package/build/runtime-chunk-M424ONWP.js.gz +0 -0
- package/build/{runtime-chunk-CUGQPKPQ.js → runtime-chunk-POTYLEGO.js} +1 -1
- package/build/runtime-chunk-POTYLEGO.js.br +0 -0
- package/build/runtime-chunk-POTYLEGO.js.gz +0 -0
- package/build/{runtime-chunk-OWPKF7IL.js → runtime-chunk-SFPD5AFA.js} +1 -1
- package/build/runtime-chunk-SFPD5AFA.js.br +0 -0
- package/build/runtime-chunk-SFPD5AFA.js.gz +0 -0
- package/build/{runtime-chunk-DX665HUE.js → runtime-chunk-SIC5B7QX.js} +1 -1
- package/build/runtime-chunk-SIC5B7QX.js.br +0 -0
- package/build/runtime-chunk-SIC5B7QX.js.gz +0 -0
- package/build/{runtime-chunk-5GCT2MXQ.js → runtime-chunk-SNCE2TY4.js} +1 -1
- package/build/runtime-chunk-SNCE2TY4.js.br +0 -0
- package/build/runtime-chunk-SNCE2TY4.js.gz +0 -0
- package/build/{runtime-chunk-7UK5TXXX.js → runtime-chunk-SRQQYOPW.js} +1 -1
- package/build/runtime-chunk-SRQQYOPW.js.br +0 -0
- package/build/runtime-chunk-SRQQYOPW.js.gz +0 -0
- package/build/{runtime-chunk-CSQ34B7E.js → runtime-chunk-TD5YRDN7.js} +1 -1
- package/build/runtime-chunk-TD5YRDN7.js.br +0 -0
- package/build/runtime-chunk-TD5YRDN7.js.gz +0 -0
- package/build/{runtime-chunk-BY4Y72LZ.js → runtime-chunk-UBSXIKOG.js} +1 -1
- package/build/runtime-chunk-UBSXIKOG.js.br +0 -0
- package/build/runtime-chunk-UBSXIKOG.js.gz +0 -0
- package/build/{runtime-chunk-LEHYVJOU.js → runtime-chunk-UX2PD5MY.js} +1 -1
- package/build/runtime-chunk-UX2PD5MY.js.br +0 -0
- package/build/runtime-chunk-UX2PD5MY.js.gz +0 -0
- package/build/{runtime-chunk-H3NZ2DPE.js → runtime-chunk-W44H46BZ.js} +1 -1
- package/build/runtime-chunk-W44H46BZ.js.br +4 -0
- package/build/runtime-chunk-W44H46BZ.js.gz +0 -0
- package/build/{runtime-chunk-ALDD75EK.js → runtime-chunk-WGMSWSKD.js} +1 -1
- package/build/runtime-chunk-WGMSWSKD.js.br +0 -0
- package/build/runtime-chunk-WGMSWSKD.js.gz +0 -0
- package/build/{runtime-classicRuntime-K34VIFGP.js → runtime-classicRuntime-XD52Z3ID.js} +1 -1
- package/build/runtime-classicRuntime-XD52Z3ID.js.br +0 -0
- package/build/runtime-classicRuntime-XD52Z3ID.js.gz +0 -0
- package/build/{runtime-cloners-3Y3EIRQD.js → runtime-cloners-7P25TLWX.js} +1 -1
- package/build/runtime-cloners-7P25TLWX.js.br +0 -0
- package/build/runtime-cloners-7P25TLWX.js.gz +0 -0
- package/build/{runtime-components-OIRGNZ53.js → runtime-components-KE6NSJIH.js} +1 -1
- package/build/runtime-components-KE6NSJIH.js.br +0 -0
- package/build/runtime-components-KE6NSJIH.js.gz +0 -0
- package/build/{runtime-createDestroy-IXF6AHPT.js → runtime-createDestroy-HT4FKH5P.js} +1 -1
- package/build/runtime-createDestroy-HT4FKH5P.js.br +0 -0
- package/build/runtime-createDestroy-HT4FKH5P.js.gz +0 -0
- package/build/{runtime-dragDrop-XMMLZ4DN.js → runtime-dragDrop-FB4BVR5B.js} +1 -1
- package/build/runtime-dragDrop-FB4BVR5B.js.br +0 -0
- package/build/runtime-dragDrop-FB4BVR5B.js.gz +0 -0
- package/build/{runtime-gameControls-AJVDYQ34.js → runtime-gameControls-KXHLXQUL.js} +1 -1
- package/build/runtime-gameControls-KXHLXQUL.js.br +0 -0
- package/build/runtime-gameControls-KXHLXQUL.js.gz +0 -0
- package/build/{runtime-hair-LL7HBW3N.js → runtime-hair-RGFARTLM.js} +1 -1
- package/build/runtime-hair-RGFARTLM.js.br +1 -0
- package/build/runtime-hair-RGFARTLM.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-SLURKUQL.js → runtime-mergeStaticGeometries-GWJX3PTU.js} +1 -1
- package/build/runtime-mergeStaticGeometries-GWJX3PTU.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-GWJX3PTU.js.gz +0 -0
- package/build/{runtime-miscActions-MYXVSOXT.js → runtime-miscActions-QTP3QTK2.js} +1 -1
- package/build/runtime-miscActions-QTP3QTK2.js.br +0 -0
- package/build/runtime-miscActions-QTP3QTK2.js.gz +0 -0
- package/build/{runtime-mouseHover-VNG5G3EV.js → runtime-mouseHover-ATG5LR7E.js} +1 -1
- package/build/runtime-mouseHover-ATG5LR7E.js.br +0 -0
- package/build/runtime-mouseHover-ATG5LR7E.js.gz +0 -0
- package/build/{runtime-particles-WY5ERTQY.js → runtime-particles-E7XPFZHE.js} +1 -1
- package/build/runtime-particles-E7XPFZHE.js.br +0 -0
- package/build/runtime-particles-E7XPFZHE.js.gz +0 -0
- package/build/{runtime-paths-EBK4AK5D.js → runtime-paths-EZZ2EKYD.js} +1 -1
- package/build/runtime-paths-EZZ2EKYD.js.br +0 -0
- package/build/runtime-paths-EZZ2EKYD.js.gz +0 -0
- package/build/{runtime-resize-ARFL653M.js → runtime-resize-MUZH7MEA.js} +1 -1
- package/build/runtime-resize-MUZH7MEA.js.br +0 -0
- package/build/runtime-resize-MUZH7MEA.js.gz +0 -0
- package/build/{runtime-sceneTransition-U767Q26P.js → runtime-sceneTransition-RUIJWZQL.js} +1 -1
- package/build/runtime-sceneTransition-RUIJWZQL.js.br +0 -0
- package/build/runtime-sceneTransition-RUIJWZQL.js.gz +0 -0
- package/build/{runtime-scroll-PJN2KY5P.js → runtime-scroll-2YNJT2VF.js} +1 -1
- package/build/runtime-scroll-2YNJT2VF.js.br +0 -0
- package/build/runtime-scroll-2YNJT2VF.js.gz +0 -0
- package/build/runtime-shapeBlends-KRYJJPAK.js +1 -0
- package/build/runtime-shapeBlends-KRYJJPAK.js.br +3 -0
- package/build/runtime-shapeBlends-KRYJJPAK.js.gz +0 -0
- package/build/{runtime-text-BIQDLMVM.js → runtime-text-FMV3CA36.js} +1 -1
- package/build/runtime-text-FMV3CA36.js.br +0 -0
- package/build/runtime-text-FMV3CA36.js.gz +0 -0
- package/build/{runtime-textInputs-PBVRLIAG.js → runtime-textInputs-CYBDVKZW.js} +1 -1
- package/build/runtime-textInputs-CYBDVKZW.js.br +0 -0
- package/build/runtime-textInputs-CYBDVKZW.js.gz +0 -0
- package/build/{runtime-timeline-FZBQAKBM.js → runtime-timeline-3FHFLHWF.js} +1 -1
- package/build/runtime-timeline-3FHFLHWF.js.br +0 -0
- package/build/runtime-timeline-3FHFLHWF.js.gz +0 -0
- package/build/{runtime-tracking-OGGWBM2F.js → runtime-tracking-EMTZIN3W.js} +1 -1
- package/build/runtime-tracking-EMTZIN3W.js.br +0 -0
- package/build/runtime-tracking-EMTZIN3W.js.gz +0 -0
- package/build/{runtime-transitions-UZMSVIQQ.js → runtime-transitions-VL46OOZE.js} +1 -1
- package/build/runtime-transitions-VL46OOZE.js.br +0 -0
- package/build/runtime-transitions-VL46OOZE.js.gz +0 -0
- package/build/{runtime-ui2d-3SFWWIHX.js → runtime-ui2d-KV2KXS4A.js} +1 -1
- package/build/runtime-ui2d-KV2KXS4A.js.br +0 -0
- package/build/runtime-ui2d-KV2KXS4A.js.gz +0 -0
- package/build/{runtime-vectorShapes-LG23IGW6.js → runtime-vectorShapes-5G7BQGJ6.js} +1 -1
- package/build/runtime-vectorShapes-5G7BQGJ6.js.br +0 -0
- package/build/runtime-vectorShapes-5G7BQGJ6.js.gz +0 -0
- package/build/{runtime-webgpu-HA7LX6HX.js → runtime-webgpu-2J3TE4FB.js} +1 -1
- package/build/runtime-webgpu-2J3TE4FB.js.br +0 -0
- package/build/runtime-webgpu-2J3TE4FB.js.gz +0 -0
- package/build/runtime.cjs +5 -5
- package/build/runtime.js +1 -1
- package/build/runtime.js.br +0 -0
- package/build/runtime.js.gz +0 -0
- package/build/runtime.standalone.js +1 -1
- package/build/runtime.standalone.js.br +0 -0
- package/build/runtime.standalone.js.gz +0 -0
- package/build/runtime.standalone.webgl.js +1 -1
- package/build/runtime.standalone.webgl.js.br +0 -0
- package/build/runtime.standalone.webgl.js.gz +0 -0
- package/build/runtime.standalone.webgpu.js +1 -1
- package/build/runtime.standalone.webgpu.js.br +0 -0
- package/build/runtime.standalone.webgpu.js.gz +0 -0
- package/build/runtime.standalone.webgpu.micro.js +1 -1
- package/build/runtime.standalone.webgpu.micro.js.br +0 -0
- package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
- package/build/runtime.standalone.webgpu.min.js +1 -1
- package/build/runtime.standalone.webgpu.min.js.br +0 -0
- package/build/runtime.standalone.webgpu.min.js.gz +0 -0
- package/package.json +1 -1
- package/build/runtime-chunk-4ENGAWL7.js.br +0 -0
- package/build/runtime-chunk-4ENGAWL7.js.gz +0 -0
- package/build/runtime-chunk-5GCT2MXQ.js.br +0 -0
- package/build/runtime-chunk-5GCT2MXQ.js.gz +0 -0
- package/build/runtime-chunk-7UK5TXXX.js.br +0 -0
- package/build/runtime-chunk-7UK5TXXX.js.gz +0 -0
- package/build/runtime-chunk-ALDD75EK.js.br +0 -0
- package/build/runtime-chunk-ALDD75EK.js.gz +0 -0
- package/build/runtime-chunk-AVO7AFZY.js.br +0 -0
- package/build/runtime-chunk-AVO7AFZY.js.gz +0 -0
- package/build/runtime-chunk-BY4Y72LZ.js.br +0 -0
- package/build/runtime-chunk-BY4Y72LZ.js.gz +0 -0
- package/build/runtime-chunk-CSQ34B7E.js.br +0 -0
- package/build/runtime-chunk-CSQ34B7E.js.gz +0 -0
- package/build/runtime-chunk-CUGQPKPQ.js.br +0 -0
- package/build/runtime-chunk-CUGQPKPQ.js.gz +0 -0
- package/build/runtime-chunk-DA36J6OU.js.br +0 -0
- package/build/runtime-chunk-DA36J6OU.js.gz +0 -0
- package/build/runtime-chunk-DQMOB5OU.js.br +0 -0
- package/build/runtime-chunk-DQMOB5OU.js.gz +0 -0
- package/build/runtime-chunk-DX665HUE.js.br +0 -0
- package/build/runtime-chunk-DX665HUE.js.gz +0 -0
- package/build/runtime-chunk-FBNDPGTS.js.br +0 -0
- package/build/runtime-chunk-FBNDPGTS.js.gz +0 -0
- package/build/runtime-chunk-FJ3HZ257.js.br +0 -0
- package/build/runtime-chunk-FJ3HZ257.js.gz +0 -0
- package/build/runtime-chunk-FYQSEYL5.js.br +0 -0
- package/build/runtime-chunk-FYQSEYL5.js.gz +0 -0
- package/build/runtime-chunk-H3NZ2DPE.js.br +0 -0
- package/build/runtime-chunk-H3NZ2DPE.js.gz +0 -0
- package/build/runtime-chunk-HLXTXF7I.js.br +0 -0
- package/build/runtime-chunk-HLXTXF7I.js.gz +0 -0
- package/build/runtime-chunk-I5YVCEFL.js.br +0 -0
- package/build/runtime-chunk-I5YVCEFL.js.gz +0 -0
- package/build/runtime-chunk-K3MY5TZT.js.br +0 -0
- package/build/runtime-chunk-K3MY5TZT.js.gz +0 -0
- package/build/runtime-chunk-LEHYVJOU.js.br +0 -0
- package/build/runtime-chunk-LEHYVJOU.js.gz +0 -0
- package/build/runtime-chunk-NHLFGFU5.js.br +0 -0
- package/build/runtime-chunk-NHLFGFU5.js.gz +0 -0
- package/build/runtime-chunk-O6F5QJHF.js.br +0 -0
- package/build/runtime-chunk-O6F5QJHF.js.gz +0 -0
- package/build/runtime-chunk-OWPKF7IL.js.br +0 -0
- package/build/runtime-chunk-OWPKF7IL.js.gz +0 -0
- package/build/runtime-chunk-Q23Z6MJP.js.br +0 -0
- package/build/runtime-chunk-Q23Z6MJP.js.gz +0 -0
- package/build/runtime-chunk-T7HEAOAP.js.br +0 -0
- package/build/runtime-chunk-T7HEAOAP.js.gz +0 -0
- package/build/runtime-chunk-XT53PDQV.js.br +0 -0
- package/build/runtime-chunk-XT53PDQV.js.gz +0 -0
- package/build/runtime-classicRuntime-K34VIFGP.js.br +0 -0
- package/build/runtime-classicRuntime-K34VIFGP.js.gz +0 -0
- package/build/runtime-cloners-3Y3EIRQD.js.br +0 -1
- package/build/runtime-cloners-3Y3EIRQD.js.gz +0 -0
- package/build/runtime-components-OIRGNZ53.js.br +0 -0
- package/build/runtime-components-OIRGNZ53.js.gz +0 -0
- package/build/runtime-createDestroy-IXF6AHPT.js.br +0 -0
- package/build/runtime-createDestroy-IXF6AHPT.js.gz +0 -0
- package/build/runtime-dragDrop-XMMLZ4DN.js.br +0 -0
- package/build/runtime-dragDrop-XMMLZ4DN.js.gz +0 -0
- package/build/runtime-gameControls-AJVDYQ34.js.br +0 -0
- package/build/runtime-gameControls-AJVDYQ34.js.gz +0 -0
- package/build/runtime-hair-LL7HBW3N.js.br +0 -2
- package/build/runtime-hair-LL7HBW3N.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-SLURKUQL.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-SLURKUQL.js.gz +0 -0
- package/build/runtime-miscActions-MYXVSOXT.js.br +0 -0
- package/build/runtime-miscActions-MYXVSOXT.js.gz +0 -0
- package/build/runtime-mouseHover-VNG5G3EV.js.br +0 -0
- package/build/runtime-mouseHover-VNG5G3EV.js.gz +0 -0
- package/build/runtime-particles-WY5ERTQY.js.br +0 -0
- package/build/runtime-particles-WY5ERTQY.js.gz +0 -0
- package/build/runtime-paths-EBK4AK5D.js.br +0 -0
- package/build/runtime-paths-EBK4AK5D.js.gz +0 -0
- package/build/runtime-resize-ARFL653M.js.br +0 -0
- package/build/runtime-resize-ARFL653M.js.gz +0 -0
- package/build/runtime-sceneTransition-U767Q26P.js.br +0 -0
- package/build/runtime-sceneTransition-U767Q26P.js.gz +0 -0
- package/build/runtime-scroll-PJN2KY5P.js.br +0 -0
- package/build/runtime-scroll-PJN2KY5P.js.gz +0 -0
- package/build/runtime-shapeBlends-QL2RV3WU.js +0 -1
- package/build/runtime-shapeBlends-QL2RV3WU.js.br +0 -4
- package/build/runtime-shapeBlends-QL2RV3WU.js.gz +0 -0
- package/build/runtime-text-BIQDLMVM.js.br +0 -0
- package/build/runtime-text-BIQDLMVM.js.gz +0 -0
- package/build/runtime-textInputs-PBVRLIAG.js.br +0 -0
- package/build/runtime-textInputs-PBVRLIAG.js.gz +0 -0
- package/build/runtime-timeline-FZBQAKBM.js.br +0 -0
- package/build/runtime-timeline-FZBQAKBM.js.gz +0 -0
- package/build/runtime-tracking-OGGWBM2F.js.br +0 -0
- package/build/runtime-tracking-OGGWBM2F.js.gz +0 -0
- package/build/runtime-transitions-UZMSVIQQ.js.br +0 -0
- package/build/runtime-transitions-UZMSVIQQ.js.gz +0 -0
- package/build/runtime-ui2d-3SFWWIHX.js.br +0 -0
- package/build/runtime-ui2d-3SFWWIHX.js.gz +0 -0
- package/build/runtime-vectorShapes-LG23IGW6.js.br +0 -0
- package/build/runtime-vectorShapes-LG23IGW6.js.gz +0 -0
- package/build/runtime-webgpu-HA7LX6HX.js.br +0 -0
- package/build/runtime-webgpu-HA7LX6HX.js.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-O6F5QJHF.js";import{a as e}from"./runtime-chunk-H3NZ2DPE.js";import{$ as i,ea as a}from"./runtime-chunk-BY4Y72LZ.js";import{e as n,h as s}from"./runtime-chunk-MQKKQEK3.js";import{a as r}from"./runtime-chunk-2PT2WH66.js";import{Aa as o,Dc as l,Ec as h,Fc as p,Ja as d,Jc as c,Lc as f,Ma as u,Oc as v,Qe as m,Vc as x,Vd as y,Zc as g,ce as S,dd as b,de as T,ld as P,na as _,nc as z,nd as w,we as R}from"./runtime-chunk-BVVSZMXD.js";var O=new b;O.setAttribute("position",new g(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));var L=class extends T{constructor(t){super({...t,depthTest:!1,depthWrite:!1,glslVersion:z,vertexShader:"\n\t\t\t\tprecision highp float;\n\t\t\t\tin vec3 position;\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = vec4(position, 1);\n\t\t\t\t}\n\t\t\t"})}customProgramCacheKey(){return""}};function k(){return{shapeInput:()=>"\n\t\t\tconst float posRowCoord = 0.1; \n\t\t\tconst float quatRowCoord = 0.3; \n\t\t\tconst float param1RowCoord = 0.5;\n\t\t\tconst float param2RowCoord = 0.7;\n\t\t\tconst float colorRowCoord = 0.9; \n\t\t\tuniform sampler2D shapesDataTexture;\n\t\t\tvec4 shapePos(float iin) { \n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, posRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeQuat(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, quatRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams1(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param1RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams2(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param2RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeColor(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, colorRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",getxyzi:"\n\t\t\t// this code must complement lookup\n\t\t\tfloat xi = mod(gl_FragCoord.x - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat yi = mod(gl_FragCoord.y - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat zi = floor((gl_FragCoord.x - 0.5) * INV_VOXEL_RESOLUTION) + floor((gl_FragCoord.y - 0.5) * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t",lookup:"\n\t\t\tuniform sampler2D potentialPassTexture;\n\t\t\tuniform sampler2D voxelPassTexture; \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvec4 look(float xi, float yi, float zi, sampler2D rt) {\n\t\t\t\tvec2 uv = vec2(\n\t\t\t\t\tmod(zi, Z_LAYERS_PER_ROW) + (xi + 0.5) / VOXEL_RESOLUTION,\n\t\t\t\t\tfloor(zi / Z_LAYERS_PER_ROW) + (yi + 0.5) / VOXEL_RESOLUTION\n\t\t\t\t); \n\t\t\t\tuv /= Z_LAYERS_PER_ROW;\n\t\t\t\treturn texture(rt, uv);\n\t\t\t}\n\t\t",getpart:"\n\t\t\tfloat getpart(inout float a, float b) {\n\t\t\t\tfloat t = floor(a/b);\n\t\t\t\tfloat r = a - t*b;\n\t\t\t\ta = t;\n\t\t\t\treturn r;\n\t\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,5,4,2,1,2,3,3,4,3,4,4,5,3,4,4,5,2,3,3,2,3,4,4,5,4,5,5,2,4,3,5,4,3,2,4,1,3,4,4,5,4,5,3,4,4,5,5,2,3,4,2,1,2,3,3,2,3,4,2,1,3,2,4,1,2,1,1,0])}}var D=new R,E=null;function U(t){E=t}function M(){return E}var C=null;function F(t){C=t}function N(){return C}var I=null;function V(t){I=t}function B(){return I}var X=k(),A=24,W=96,H=!1,q=!0;try{let t=new URLSearchParams(window.location.search);H="0"===t.get("dbgsbstatic"),q="0"!==t.get("sb512")}catch{}function K(t){let e=t.getAttribute("position");return void 0===e?-1:1048576*(e.version??e.data?.version??0)+(e.count??0)%1048576}var j=class extends a{constructor(t,e,i){super(t,e,i),this.data=e,this.isShapeBlendEntity=!0,this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!1,this._prevShapeData=null,this._prevSpan=-1,this._reach=new Float32Array(96),this._prevReach=new Float32Array(96),this._fieldDirtyFull=!0,this._fieldDirtyMin=new p,this._fieldDirtyMax=new p,this._maxBlendK=0,this._meshSdfBaked=new Map,this._meshSdfWanted=new Map,this._passesRenderer=null,this._npart=-1,this.spatialn=1,this.drawRangeNeedsForceUpdate=!0,this._resolutionLevel=-1,this._authoredResolutionLevel=-1,this.ultraFieldResolution=0,this.resolution=64,this.spatialDivisions=25,this.zLayersPerRow=8,this.basePyramidSize=512,this.pyramidTexture1Width=341,this.pyramidTexture1Height=256,this.pyramidTexture2Width=170,this.pyramidTexture2Height=128,this.numLevels=9,this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=0,this.bboxOffset=0,this.shapesDataTexture={value:void 0},this.spatialscene=new x,this.potentialPassScene=new x,this.voxelPassScene=new x,this._spatialPassRenderTargets=[],this._potentialPassRenderTargets=[],this._voxelPassRenderTargets=[],this._pyramidRenderTargets=[],this.geometry=new b,this.geometry.drawRange.count=0,this.spatialPassUniforms={span:{value:-1},shapesDataTexture:this.shapesDataTexture,npart:{value:this.npart},spatialn:{value:this.spatialn}},this.spatialMesh=new P(O,this.spatialPassMaterial()),this.spatialMesh.frustumCulled=!1,this.spatialscene.add(this.spatialMesh);let a=new w(X.triTable,16,256,u,o);a.needsUpdate=!0;let n=new w(X.numTrisTable,256,1,u,o);n.needsUpdate=!0,this.voxelPassUniforms={potentialPassTexture:{value:void 0},numTrisTable:{value:n}},this.voxelMesh=new P(O,this.voxelPassMaterial()),this.voxelMesh.frustumCulled=!1,this.voxelPassScene.add(this.voxelMesh),this.potentialPassUniforms={shapesDataTexture:this.shapesDataTexture,spatialPassTexture:{value:void 0},npart:{value:this.npart},spatialn:{value:this.spatialn}},this.potentialMesh=new P(O,this.potentialPassMaterial()),this.potentialMesh.frustumCulled=!1,this.potentialPassScene.add(this.potentialMesh),this.marchPassUniforms={triTable:{value:a},potentialPassTexture:{value:void 0},voxelPassTexture:{value:void 0},pyramidTexture1:{value:void 0},pyramidTexture1Size:{value:void 0},pyramidTexture2:{value:void 0},pyramidTexture2Size:{value:void 0}},this.frustumCulled=!1,this.onBeforeShadowPass=t=>{let e=at.call(this);if(0===this.npart)return void(this.geometry.drawRange.count=0);let i=this.material.root;if(i.shadersPatchedForShapeBlend){if(this.customDepthMaterialNeedsUpdate){this.customDepthMaterialNeedsUpdate=!1,this.customDepthMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t\t#include <packing>\n\t\t\t\t\t\tvoid main()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t",uniforms:i.uniforms,defines:this.material.defines}),this.isMeshDepthMaterial=!0,this.customDistanceMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t#include <common>\n\t\t\t\t\t#include <packing>\n\t\t\t\t\tuniform vec3 referencePosition;\n\t\t\t\t\tuniform float nearDistance;\n\t\t\t\t\tuniform float farDistance;\n\t\t\t\t\t\n\t\t\t\t\tvarying vec3 vWPosition;\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dist = length(vWPosition - referencePosition);\n\t\t\t\t\t\tdist = (dist - nearDistance) / (farDistance - nearDistance);\n\t\t\t\t\t\tdist = saturate(dist);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = packDepthToRGBA( dist );\n\t\t\t\t\t}",uniforms:{nearDistance:{value:0},farDistance:{value:0},referencePosition:{value:new p},opacity:{value:0},...i.uniforms},defines:this.material.defines});let t=this.customDistanceMaterial;t.referencePosition=new p,t.nearDistance=0,t.farDistance=0,t.opacity=1,t.isMeshDistanceMaterial=!0}}else this.patchVertexShaderForShapeBlend(i),i.shadersPatchedForShapeBlend=!0,this.customDepthMaterialNeedsUpdate=!0;this.spatialPassUniforms.npart.value=this.npart,this.spatialPassUniforms.spatialn.value=this.spatialn,this.potentialPassUniforms.npart.value=this.npart,this.potentialPassUniforms.spatialn.value=this.spatialn;let a=this.needsRebuild;if(this.needsRebuild){this.needsRebuild=!1,this.spatialMesh.material.defines.RES=this.resolutionLevel,this.spatialMesh.material.needsUpdate=!0,this.potentialMesh.material.defines.RES=this.resolutionLevel,this.potentialPassUniforms.spatialPassTexture.value=this.spatialPassRenderTarget.texture,this.potentialMesh.material.needsUpdate=!0,this.voxelMesh.material.defines.RES=this.resolutionLevel,this.voxelMesh.material.needsUpdate=!0,this.voxelPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.voxelPassTexture.value=this.voxelPassRenderTarget.textures[0],this.material.defines.RES=this.resolutionLevel,this.material.defines.LEVELS=this.pyramidLevelSizes.length,this.material.defines.LOOP=this.pyramidLevelSizes.length%2==0?this.pyramidLevelSizes.length-3:this.pyramidLevelSizes.length-2,this.material.defines.HALF=this.pyramidLevelSizes.length%2==0?1:0,this.material.needsUpdate=!0;let t=this.pyramidLevelSizes.length%2==0?0:1,e=this.pyramidLevelSizes.length%2==0?1:0;this.marchPassUniforms.pyramidTexture2.value=this.pyramidRenderTarget[t].texture,this.marchPassUniforms.pyramidTexture2Size.value=new l(this.pyramidRenderTarget[t].width,this.pyramidRenderTarget[t].height),this.marchPassUniforms.pyramidTexture1.value=this.pyramidRenderTarget[e].texture,this.marchPassUniforms.pyramidTexture1Size.value=new l(this.pyramidRenderTarget[e].width,this.pyramidRenderTarget[e].height),Object.assign(this.material.uniforms,this.marchPassUniforms)}if(!e&&!a&&!this.drawRangeNeedsForceUpdate&&this._passesRenderer===t)return;this._passesRenderer=t;let n=t.shadowMap.enabled;t.shadowMap.enabled=!1;let s=t.getRenderTarget();t.setRenderTarget(this.spatialPassRenderTarget),t.render(this.spatialscene,D),t.setRenderTarget(this.potentialPassRenderTarget),t.render(this.potentialPassScene,D),t.setRenderTarget(this.voxelPassRenderTarget),t.render(this.voxelPassScene,D),j.streamCompaction.renderPyramid(this.resolutionLevel,this.pyramidLevelSizes,t,this.voxelPassRenderTarget,this.pyramidRenderTarget).then(t=>{this.material.wireframe&&(3*t>this.geometry.attributes.position.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.dispose(),this.geometry=new b,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.geometry.attributes.position=new g(new Float32Array(3*t*2),3)),(3*t>this.geometry.drawRange.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.drawRange.count=3*Math.floor(1.2*t),this.markSceneShadowsDirty()),this.drawRangeNeedsForceUpdate=!1}),t.shadowMap.enabled=n,t.setRenderTarget(s)}}markSceneShadowsDirty(){let t=this.parent;if(null!==t){for(;t.parent;)t=t.parent;t.markShadowsDirty?.()}}set npart(t){t!==this._npart&&(this.drawRangeNeedsForceUpdate=!0,this._npart=t,this.spatialn=Math.ceil(t/96))}get npart(){return this._npart}set resolutionLevel(t){let e=Math.min(q?9:8,Math.max(5,t));if(e===this._authoredResolutionLevel)return;this._authoredResolutionLevel=e,this.ultraFieldResolution=Math.pow(2,e);let i=Math.min(8,e);switch(this._resolutionLevel=i,this.resolution=Math.pow(2,i),this.resolutionLevel){case 5:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192],this.bboxSize=496,this.bboxOffset=-8;break;case 6:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=504,this.bboxOffset=-4;break;case 7:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192,384,768,1536],this.bboxSize=508,this.bboxOffset=-2;break;case 8:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096],this.bboxSize=510,this.bboxOffset=-1}this.pyramidTexture1Width=0,this.pyramidTexture2Width=0,this.pyramidTexture1Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-2],this.pyramidTexture2Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-3];for(let t=this.pyramidLevelSizes.length-2;t>=0;t--)(this.pyramidLevelSizes.length-2)%2==t%2?this.pyramidTexture1Width+=this.pyramidLevelSizes[t]:this.pyramidTexture2Width+=this.pyramidLevelSizes[t];this.basePyramidSize=this.pyramidLevelSizes[this.pyramidLevelSizes.length-1],this.zLayersPerRow=this.basePyramidSize/this.resolution,this.numLevels=this.pyramidLevelSizes.length-1,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!0}get resolutionLevel(){return this._resolutionLevel}get spatialPassRenderTarget(){let t=this._spatialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.spatialDivisions*this.spatialn,this.spatialDivisions**2,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._spatialPassRenderTargets[this.resolutionLevel]=t),t}get potentialPassRenderTarget(){let t=this._potentialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._potentialPassRenderTargets[this.resolutionLevel]=t),t}get voxelPassRenderTarget(){let t=this._voxelPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{count:2,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),t.textures[0].format=d,t.textures[0].type=o,t.textures[1].format=u,t.textures[1].type=o,this._voxelPassRenderTargets[this.resolutionLevel]=t),t}get pyramidRenderTarget(){let t=this._pyramidRenderTargets[this.resolutionLevel];return t||(t=[new f(this.pyramidTexture1Width,this.pyramidTexture1Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_}),new f(this.pyramidTexture2Width,this.pyramidTexture2Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_})],this._pyramidRenderTargets[this.resolutionLevel]=t),t}updateState(t,e){let i=this.material;super.updateState(t,e),i!==this.material&&(this.needsRebuild=!0),t.geometry&&(this.resolutionLevel=t.geometry.resolutionLevel,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]}),t.wireframe&&!this.geometry.getAttribute("position")?this.geometry.setAttribute("position",new g(new Float32Array(3*this.geometry.drawRange.count),3)):!t.wireframe&&this.geometry.getAttribute("position")&&this.geometry.deleteAttribute("position")}spatialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tuniform float span;\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\t${X.shapeInput()}\n\n\t\t\tvec3 low, high; \n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfloat spatialKey(float lowi) {\n\t\t\t\tfloat t = 0.;\n\t\t\t\tfor (float ii = 23.; ii >= 0.; ii--) {\n\t\t\t\t\tfloat i = ii + lowi;\n\t\t\t\t\tfloat iin = (i + 0.5) / 96.;\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec3 d = shape.xyz;\n\t\t\t\t\tfloat op = shape.w;\n\t\n\t\t\t\t\tt *= 2.;\n\t\t\t\t\tt += (\n\t\t\t\t\t\tlow.x < d.x && d.x < high.x &&\n\t\t\t\t\t\tlow.y < d.y && d.y < high.y &&\n\t\t\t\t\t\tlow.z < d.z && d.z < high.z &&\n\t\t\t\t\t\ti < npart || op == -2. \n\t\t\t\t\t) ? 1. : 0.;\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t}\n\n\t\t\t${X.getpart}\n\n\t\t\tvoid main() { \n\t\t\t\t\n\t\t\t\tvec3 div; \n\t\t\t\t\n\t\t\t\tfloat yz = float(gl_FragCoord.y - 0.5); \n\t\t\t\tdiv.y = getpart(yz, spatialDivisions);\n\t\t\t\tdiv.z = yz; \n\n\t\t\t\tfloat lx = float(gl_FragCoord.x - 0.5); \n\t\t\t\tfloat lowi = getpart(lx, spatialn) * 96.;\n\t\t\t\tdiv.x = lx;\n\n\t\t\t\tlow = div / spatialDivisions * 2. - 1. - span;\n\t\t\t\thigh = (div+1.) / spatialDivisions * 2. - 1. + span;\n\n\t\t\t\t\n\t\t\t\tpc_FragColor.x = spatialKey(lowi);\n\t\t\t\tpc_FragColor.y = spatialKey(lowi+24.);\n\t\t\t\tpc_FragColor.z = spatialKey(lowi+48.);\n\t\t\t\tpc_FragColor.w = spatialKey(lowi+72.);\n\t\t\t}\n\t\t`;return new L({name:"Spatial Pass",fragmentShader:t,uniforms:this.spatialPassUniforms})}potentialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\n\t\t\t${X.shapeInput()}\n\t\t\tuniform sampler2D spatialPassTexture;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.;\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tconst float spatialDivisions2 = spatialDivisions * spatialDivisions;\n\t\t\tconst float spatialDivisionsSub1 = spatialDivisions - 1.;\n\n\t\t\t${X.getpart}\n\n\t\t\tvec3 packRGBAToVec3(vec4 color) {\n\t\t\t\tuint r = uint(color.r * 255.);\n\t\t\t\tuint g = uint(color.g * 255.);\n\t\t\t\tuint combined = (r << 8) | g; \n\t\t\t\treturn vec3(float(combined) * 0.00001525902, color.b, color.a); \n\t\t\t}\n\n\t\t\tvoid applyQuaternionToVector(in vec4 q, inout vec3 v) {\n\t\t\t\tv += 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t\n\t\t\tfloat smoothOperation(float op, float sdf, float d, float k) {\n\t\t\t \n\t\t\t \n\t\t\t\t\n\n\t\t\t\tfloat signSubtract = clamp(op, -1., 1.);\n\t\t\t\tfloat signIntersection = 2. * (op - signSubtract) + 1.;\n\t\t\t\tfloat h = clamp(\n\t\t\t\t\t0.5 + signSubtract * 0.5 * (sdf - signSubtract * signIntersection * d) / k,\n\t\t\t\t\t0.0,\n\t\t\t\t\t1.0\n\t\t\t\t);\n\t\t\t\treturn mix(sdf, signSubtract * signIntersection * d, h) - \n\t\t\t\t\t\t\t signSubtract * k * h * (1.0 - h);\n\t\t\t}\n\n\t\t\tfloat sdSphere( vec3 p, float s )\n\t\t\t{\n\t\t\t\treturn length(p)-s;\n\t\t\t}\n\n\t\t\tfloat sdEllipsoid( vec3 p, vec3 r )\n\t\t\t{\n\t\t\t\tfloat k0 = length(p/r);\n\t\t\t\tfloat k1 = length(p/(r*r));\n\t\t\t\treturn k0*(k0-1.0)/k1;\n\t\t\t}\n\n\t\t\tfloat sdBox( vec3 p, vec3 b )\n\t\t\t{\n\t\t\t\tvec3 q = abs(p) - b;\n\t\t\t\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n\t\t\t}\n\n\t\t\tfloat sdTorus( vec3 p, vec2 t )\n\t\t\t{\n\t\t\t\tvec2 q = vec2(length(p.xy)-t.x,p.z);\n\t\t\t\treturn length(q)-t.y;\n\t\t\t}\n\n\t\t\tfloat sdCappedTorus( vec3 p, vec2 sc, float ra, float rb)\n\t\t\t{\n\t\t\t\tp.x = abs(p.x);\n\t\t\t\tfloat k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy);\n\t\t\t\treturn sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb;\n\t\t\t}\n\n\t\t\tfloat dot2( in vec2 v ) { return dot(v,v); }\n\t\t\tfloat sdCappedCone( vec3 p, float h, float r1, float r2 )\n\t\t\t{\n\t\t\t\tvec2 q = vec2( length(p.xz), p.y );\n\t\t\t\tvec2 k1 = vec2(r2,h);\n\t\t\t\tvec2 k2 = vec2(r2-r1,2.0*h);\n\t\t\t\tvec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);\n\t\t\t\tvec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );\n\t\t\t\tfloat s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;\n\t\t\t\treturn s*sqrt( min(dot2(ca),dot2(cb)) );\n\t\t\t}\n\n\t\t\tfloat sdCappedCylinder( vec3 p, float h, float r )\n\t\t\t{\n\t\t\t\tvec2 d = abs(vec2(length(p.xz),p.y)) - vec2(r,h);\n\t\t\t\treturn min(max(d.x,d.y),0.0) + length(max(d,0.0));\n\t\t\t}\n\n\t\t\tfloat maxBlend = 0.0;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvoid fillSpatialInner(\n\t\t\t\tfloat ii,\n\t\t\t\tfloat activeKey,\n\t\t\t\tvec3 corner,\n\t\t\t\tinout float sdf,\n\t\t\t\tinout float colorDivisor,\n\t\t\t\tinout vec4 trackColor\n\t\t\t) {\n\t\t\t\tfor (float i = 0.; i < 24.; i++) {\n\t\t\t\t\tif (activeKey < 1.) break; \n\t\t\t\t\tactiveKey *= 0.5;\n\t\t\t\t\tif (fract(activeKey) < 0.5) continue;\n\n\t\t\t\t\tfloat iin = (i + ii + 0.5) * ${1/96};\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec4 quat = shapeQuat(iin);\n\t\t\t\t\tvec4 params1 = shapeParams1(iin);\n\t\t\t\t\tvec4 params2 = shapeParams2(iin);\n\n\t\t\t\t\tvec3 p = corner - shape.xyz;\n\t\t\t\t\tapplyQuaternionToVector(quat, p);\n\t\t\t\t\tp /= params2.z; // scale\n\t\t\t\t\tfloat d; // d in -1..1 coordinates\n\t\t\t\t\tswitch (int(params1.x)) {\n\t\t\t\t\t\tcase 0: d = sdSphere(p, params1.y); break;\n\t\t\t\t\t\tcase 1: d = sdEllipsoid(p, params1.yzw); break;\n\t\t\t\t\t\tcase 2: d = sdBox(p, params1.yzw); break;\n\t\t\t\t\t\tcase 3: d = sdCappedCylinder(p, params1.y, params1.z); break;\n\t\t\t\t\t\tcase 4: d = sdCappedCone(p, params1.y, params1.z, params1.w); break;\n\t\t\t\t\t\tcase 5: d = sdTorus(p, params1.yz); break;\n\t\t\t\t\t\tcase 6: d = sdCappedTorus(p, params1.yz, params1.w, params2.w); break;\n\t\t\t\t\t\t// Mesh children (type 7) live in a WebGPU-only baked SDF\n\t\t\t\t\t\t// atlas — the GLSL evaluator skips the shape entirely\n\t\t\t\t\t\t// (also closes the latent uninitialized-d default).\n\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t}\n\t\t\t\t\td -= params2.y; // rounded edge\n\t\t\t\t\td *= params2.z; // scale\n\n\t\t\t\t\tfloat k = params2.x;\n\t\t\t\t\tfloat op = shape.w;\n\n\t\t\t\t\tsdf = smoothOperation(shape.w, sdf, d, k);\n\n\t\t\t\t\tfloat isNegativeOne = step(-1.5, op) * step(op, -0.5); // 1 when op == -1, 0 otherwise\n\t\t\t\t\tfloat colorCull = smoothstep(maxBlend, 0., -d);\n\t\t\t\t\tfloat cullFactor = mix(1.0, colorCull, isNegativeOne);\n\t\t\t\t\ttrackColor *= cullFactor;\n\t\t\t\t\tcolorDivisor *= cullFactor;\n\n\t\t\t\t\tmaxBlend = max(maxBlend, k);\n\n\t\t\t\t\tk += 2. * INV_VOXEL_RESOLUTION; // avoid division by zero, and other color artifacts with very small k\n\t\t\t\t\tfloat nearness = smoothstep(k, 0., d);\n\n\t\t\t\t\tvec4 color = shapeColor(iin);\n\t\t\t\t\tnearness *= float(color.a >= 0.);\n\n\t\t\t\t\tcolorDivisor += nearness;\n\t\t\t\t\ttrackColor += color * nearness;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvec3 div;\n\t\t\t// compute potential from all spheres; collect +ve and =ve values separately\n\t\t\t// work in blocks of A*4 (=96) spheres, using the bit flags in 4 float channel 'activeKey' values\n\t\t\t// TODO check if extra vec3 output useful, not really used at present\n\t\t\tfloat fillSpatial(vec3 corner, inout vec4 trackColor) {\n\t\t\t\tfloat sdf = 1e3; // hack: initialize to large value\n\t\t\t\tfloat colorDivisor = 0.;\n\t\t\t\t// spatialPassTexture holds x=> lowi, x faster moving and y=> z, y faster moving\n\t\t\t\tfloat divyz = (div.y + div.z * spatialDivisions + 0.5) / (spatialDivisions2);\n\t\t\t\tfor (float ii = 0.; ii < spatialn; ii++) {\n\t\t\t\t\tfloat i = ii * 96.;\n\n\t\t\t\t\tvec4 activeKey = texture(spatialPassTexture, vec2((div.x * spatialn + ii + 0.5)/(spatialn * spatialDivisions), divyz));\n\t\t\t\t\tfillSpatialInner(i, activeKey.x, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+24., activeKey.y, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+48., activeKey.z, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+72., activeKey.w, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t}\n\n\t\t\t\ttrackColor /= colorDivisor;\n\t\t\t\treturn mix(sdf, 0.0, step(1e20 - 0.1, sdf));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 xyzi = vec3(xi,yi,zi);\n\t\t\t\tvec3 corner = xyzi / VOXEL_RESOLUTION_SUB1 * 2. - 1.; \n\n\t\t\t\tdiv = floor(xyzi / VOXEL_RESOLUTION_SUB1 * spatialDivisionsSub1);\n\n\t\t\t\tvec4 c = vec4(0.);\n\t\t\t\tfloat t = fillSpatial(corner, c);\n\n\t\t\t\tpc_FragColor = vec4(t, packRGBAToVec3(c)); \n\t\t\t}\n\t\t`;return new L({name:"PotentialPass",fragmentShader:t,uniforms:this.potentialPassUniforms})}voxelPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tlayout(location = 1) out vec4 numTris;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.; \n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\t\t\tuniform sampler2D numTrisTable; \n\n\t\t\tfloat keyi(float f000, float f100, float f010, float f110, float f001, float f101, float f011, float f111) {\n\t\t\t\treturn (float(f000 < 0.) * 1.) +\n\t\t\t\t\t\t\t (float(f100 < 0.) * 2.) +\n\t\t\t\t\t\t\t (float(f010 < 0.) * 8.) +\n\t\t\t\t\t\t\t (float(f110 < 0.) * 4.) +\n\t\t\t\t\t\t\t (float(f001 < 0.) * 16.) +\n\t\t\t\t\t\t\t (float(f101 < 0.) * 32.) +\n\t\t\t\t\t\t\t (float(f011 < 0.) * 128.) +\n\t\t\t\t\t\t\t (float(f111 < 0.) * 64.);\n\t\t\t}\n\n\t\t\t${X.lookup}\n\n\t\t\tvec3 compNormi(float xi, float yi, float zi) {\n\t\t\t\tfloat dx = look(xi + 1., yi, zi, potentialPassTexture).r - look(xi - 1., yi, zi, potentialPassTexture).r;\n\t\t\t\tfloat dy = look(xi, yi + 1., zi, potentialPassTexture).r - look(xi, yi - 1., zi, potentialPassTexture).r;\n\t\t\t\tfloat dz = look(xi, yi, zi + 1., potentialPassTexture).r - look(xi, yi, zi - 1., potentialPassTexture).r;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (dx == 0.0 && dy == 0.0 && dz == 0.0) {\n\t\t\t\t\treturn vec3(0.199, 0.299, 0.399);\n\t\t\t\t}\n\t\t\t\treturn normalize(vec3(dx, dy, dz));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 normal = compNormi(xi, yi, zi); \n\n\t\t\t\tif (xi >= VOXEL_RESOLUTION_SUB1 || yi >= VOXEL_RESOLUTION_SUB1 || zi >= VOXEL_RESOLUTION_SUB1) {\n\t\t\t\t\tpc_FragColor = vec4(normal, 0.);\n\t\t\t\t\tnumTris = vec4(0.);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfloat\n\t\t\t\t\tf000 = look(xi, yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf100 = look(xi+1., yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf010 = look(xi, yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf110 = look(xi+1., yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf001 = look(xi, yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf101 = look(xi+1., yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf011 = look(xi, yi+1., zi+1., potentialPassTexture).r,\n\t\t\t\t\tf111 = look(xi+1., yi+1., zi+1., potentialPassTexture).r;\n\t\t\t\tfloat key = keyi(f000, f100, f010, f110, f001, f101, f011, f111);\n\n\t\t\t\tpc_FragColor = vec4(normal, key);\n\n\t\t\t\tnumTris = texture(numTrisTable, vec2((key + 0.5) / 256., 0.5));\n\t\t\t}\n\t\t`;return new L({name:"VoxelPass",fragmentShader:t,uniforms:this.voxelPassUniforms})}patchVertexShaderForShapeBlend(t){let e=`\n\t\t#ifdef SHAPEBLEND \n\t\t\tprecision highp sampler2D;\n\n\t\t\tuniform float isol;\n\n\t\t\tuniform sampler2D triTable; \n\t\t\tuniform sampler2D pyramidTexture1;\n\t\t\tuniform vec2 pyramidTexture1Size;\n\t\t\tuniform sampler2D pyramidTexture2;\n\t\t\tuniform vec2 pyramidTexture2Size;\n\n\t\t\tconst vec2 halfPixelOffset = vec2(0.5, 0.5);\n\n\t\t\tconst vec2 rShift = vec2(0., 1.);\n\t\t\tconst vec2 gShift = vec2(1., 1.);\n\t\t\tconst vec2 bShift = vec2(1., 0.);\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tconst float scale_factor = 2.;\n\n\t\t\t#if SHAPEBLEND == 5\n\t\t\t\tconst float levelShiftX[7] = float[7](4., 6., 12., 24., 48., 96., 192.);\n\t\t\t\tconst float scale = 8. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(16.);\n\t\t\t#elif SHAPEBLEND == 7\n\t\t\t\tconst float levelShiftX[10] = float[10](4., 6., 12., 24., 48., 96., 192., 384., 768., 1536.); \n\t\t\t\tconst float scale = 2. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(64.);\n\t\t\t#elif SHAPEBLEND == 8\n\t\t\t\tconst float levelShiftX[11] = float[11](4., 8., 16., 32., 64., 128., 256., 512., 1024., 2048., 4096.);\n\t\t\t\tconst float scale = scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(128.);\n\t\t\t#else\n\t\t\t\tconst float levelShiftX[8] = float[8](4., 8., 16., 32., 64., 128., 256., 512.);\n\t\t\t\tconst float scale = 4. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(32.);\n\t\t\t#endif\n\n\t\t\t${X.lookup}\n\n\t\t\tconst vec3 offsets[24] = vec3[](\n\t\t\t\tvec3(0., 0., 0.), vec3(1., 0., 0.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 1., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 1., 0.),\n\t\t\t\tvec3(0., 0., 1.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 0., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 0., 1.), vec3(0., 1., 1.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 0., 1.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 1., 0.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 0.), vec3(0., 1., 1.)\n\t\t\t);\n\n\t\t\tvec2 computeShiftedPosition1(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture1Size;\n\t\t\t}\n\n\t\t\tvec2 computeShiftedPosition2(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture2Size;\n\t\t\t}\n\n\t\t\tvec4 unpackVec3ToRGBA(vec3 vec) {\n\t\t\t\tuint combined = uint(vec.x * 65535.0 + 0.5); \n\t\t\t\tfloat g = float(combined & uint(0xFF)) * 0.00392156862; \n\t\t\t\tfloat r = float((combined >> 8) & uint(0xFF)) * 0.00392156862; \n\t\t\n\t\t\t\treturn vec4(r, g, vec.y, vec.z);\n\t\t\t}\n\n\t\t\tout vec4 marchColor;\n\t\t\t\n\t\t#endif\n\t\t`;t.vertexShader=e+t.vertexShader.replace("#include <project_vertex>","\n\t\t#ifdef SHAPEBLEND\n\t\t\tfloat triIndex = floor(float(gl_VertexID/3));\n\t\t\tfloat vertexIndex = float(gl_VertexID);\n\t\t\t\n\t\t\t\n\t\t\tfloat levelOriginX1 = pyramidTexture1Size.x - 2.;\n\t\t\tfloat levelOriginX2 = pyramidTexture2Size.x - 1.;\n\t\t\tvec2 xy = vec2(0.);\n\t\t\tvec4 lookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\t\t\t\n\t\t\t\n\t\t\tif (triIndex >= lookUp.r) return;\n\t\t\t\n\t\t\t\n\t\t\tfloat start = 0.;\n\t\t\tvec4 triIndexVec = vec4(triIndex);\n\t\t\t\n\t\t\t\n\t\t\tfor (int i = 0; i < LOOP;) {\n\t\t\t\t\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX2 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture1, computeShiftedPosition1(xy, levelOriginX1));\n\t\t\t\ti++;\n\n\t\t\t\tends = lookUp + vec4(start);\n\t\t\t\tstarts = vec4(ends.gba, start);\n\t\t\t\tcheck = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX1 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t#if HALF == 1\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * vec4(lessThan(triIndexVec, ends));\n\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t#endif\n\t\t\t\n\t\t\t\n\t\t\tvec3 gridPos;\n\t\t\tgridPos.x = mod(xy.x, VOXEL_RESOLUTION);\n\t\t\tgridPos.y = mod(xy.y, VOXEL_RESOLUTION);\n\t\t\tgridPos.z = floor(xy.x * INV_VOXEL_RESOLUTION) + \n\t\t\t\t\t\t\t\t\tfloor(xy.y * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t\t\n\t\t\t\n\t\t\tvertexIndex -= start * 3.;\n\t\t\tfloat vk = vertexIndex * 0.0625 + 0.03125; \n\t\t\t\n\t\t\t\n\t\t\tvec4 voxel = look(gridPos.x, gridPos.y, gridPos.z, voxelPassTexture);\n\t\t\tfloat key = (voxel.w + 0.5) * 0.00390625; \n\t\t\t\n\t\t\t\n\t\t\tfloat edgeNum = texture(triTable, vec2(vk, key)).x;\n\t\t\tint edgeIndex = int(edgeNum) * 2;\n\t\t\t\n\t\t\t\n\t\t\tvec3 p1 = gridPos + offsets[edgeIndex];\n\t\t\tvec3 p2 = gridPos + offsets[edgeIndex + 1];\n\t\t\t\n\t\t\t\n\t\t\tvec4 potential1 = look(p1.x, p1.y, p1.z, potentialPassTexture);\n\t\t\tvec4 potential2 = look(p2.x, p2.y, p2.z, potentialPassTexture);\n\t\t\t\n\t\t\t\n\t\t\tfloat mu = potential1.r / (potential1.r - potential2.r);\n\n\t\t\tmarchColor = mix(\n\t\t\t\tunpackVec3ToRGBA(potential1.gba),\n\t\t\t\tunpackVec3ToRGBA(potential2.gba),\n\t\t\t\tmu\n\t\t\t);\n\n\t\t\ttransformed = p1 + (p2 - p1) * mu;\n\t\t\ttransformed -= originOffset;\n\t\t\ttransformed *= scale;\n\t\t\tvec4 data1 = look(p1.x, p1.y, p1.z, voxelPassTexture);\n\t\t\tvec4 data2 = look(p2.x, p2.y, p2.z, voxelPassTexture);\n\t\t\tobjectNormal = normalize(mix(data1.xyz, data2.xyz, mu));\n\t\t\ttransformedNormal = normalMatrix * objectNormal;\n\t\t\t#ifndef FLAT_SHADED\n\t\t\t\tvNormal = transformedNormal;\n\t\t\t#endif\n\t\t#endif\n\t\t\n#include <project_vertex>");let i=t.fragmentShader.match(/vec3 diffuseColor[^\n]*\n/);if(!i)return;let a=`\n\t\t#ifdef SHAPEBLEND_C\n\t\t\t#if SHAPEBLEND_C == 1\n\t\t\t\t${i[0].replace(/nodeU0,/g,"marchColor.rgb,").replace(/nodeU\d+(?=,g_uid\d+_calpha\))/g,"marchColor.a")}\n\t\t\t#else\n\t\t\t\t${i[0]}\n\t\t\t#endif\n\t\t#else\n\t\t\t${i[0]}\n\t\t#endif\n\t\t`;t.fragmentShader="in vec4 marchColor;\n"+t.fragmentShader.replace(i[0],a),Object.assign(t.uniforms,this.marchPassUniforms)}initDebugPass(t){console.log("fboToDebug.width",t.width,t.height),this.geometry=new y(t.width,t.height),this.geometry.userData={parameters:{width:4,height:4}};let e={inputTexture:{value:t.textures.length>1?t.textures[1]:t.texture},pyramidTextureSize:{value:void 0}},i=t=>{t.vertexShader="\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\t\tvUv = uv;\n\t\t\t\t}\n\t\t\t",t.fragmentShader="\n\t\t\t\tlayout(location = 1) out vec4 gVelocity;\n\n\t\t\t\tprecision highp float;\n\t\t\t\t\n\t\t\t\tuniform sampler2D inputTexture;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tuniform vec2 pyramidTextureSize;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = texture(inputTexture, vUv);\n\t\t\t\t\t\tgVelocity = vec4(0.0);\n\t\t\t\t}\n\t\t\t",e.pyramidTextureSize.value=new l(this.pyramidRenderTarget[0].width,this.pyramidRenderTarget[0].height),Object.assign(t.uniforms,e)};this.material.shapeBlendhack=i,this.material.root.shapeBlendhack=i}dispose(){super.dispose(),B()?.release(this)}},G=j;G.streamCompaction=new class{constructor(){this.pyramidPassScene=new x,this.pyramidPassMaterial=new L({name:"PyramidPass"}),this.pyramidPassUniforms={inputTexture:{value:void 0},inputWidth:{value:0},inputHeight:{value:0},inputShiftX:{value:0},outputShiftX:{value:0}},this.pyramidTopLevelReadPixelBuffer=new Float32Array(4),this.pyramidPassMaterial.fragmentShader="\n\t\t\tprecision highp float;\n\t\t\tprecision highp sampler2D;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tuniform sampler2D inputTexture;\n\t\t\tuniform float inputWidth;\n\t\t\tuniform float inputHeight;\n\t\t\tuniform float inputShiftX;\n\t\t\tuniform float outputShiftX;\n\t\t\tconst vec2 half_unit_coord = vec2(0.5);\n\t\t\tconst vec4 one = vec4(1.0);\n\t\t\tvoid main() {\n\t\t\t\tvec2 inputSize = vec2(inputWidth, inputHeight);\n\t\t\t\tvec2 input_pixel_uv = 1. / inputSize;\n\t\t\t\tvec2 coord = gl_FragCoord.xy - half_unit_coord;\n\t\t\t\tcoord.x -= outputShiftX;\n\t\t\t\tcoord = coord * 2. + half_unit_coord;\n\t\t\t\tcoord.x += inputShiftX;\n\n\t\t\t\t\n\t\t\t\tvec2 input_uv = coord / inputSize;\n\t\t\t\tfloat bl = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x += input_pixel_uv.x;\n\t\t\t\tfloat br = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.y += input_pixel_uv.y;\n\t\t\t\tfloat tr = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x -= input_pixel_uv.x;\n\t\t\t\tfloat tl = texture(inputTexture, input_uv).r;\n\n\t\t\t\tpc_FragColor.a = bl;\n\t\t\t\tpc_FragColor.b = pc_FragColor.a + br;\n\t\t\t\tpc_FragColor.g = pc_FragColor.b + tr;\n\t\t\t\tpc_FragColor.r = pc_FragColor.g + tl; \n\t\t\t}\n\t\t",this.pyramidPassMaterial.uniforms=this.pyramidPassUniforms,this.pyramidPassMaterial.depthTest=!1,this.pyramidPassMaterial.depthWrite=!1;let t=new P(O,this.pyramidPassMaterial);t.frustumCulled=!1,this.pyramidPassScene.add(t)}renderPyramid(t,e,i,a,n){(new m).min.setScalar(0);let s=e.length-1,r=new c;i.getViewport(r),this.pyramidPassUniforms.inputShiftX.value=0,this.pyramidPassUniforms.outputShiftX.value=0;let o=s-1;for(let s=o;s>=0;s--){let r=s%2==o%2?n[0]:n[1],l=s===o?a:s%2==o%2?n[1]:n[0];this.pyramidPassUniforms.inputTexture.value=l.textures.length>1?l.textures[1]:l.texture,this.pyramidPassUniforms.inputWidth.value="width"in l?l.width:1,this.pyramidPassUniforms.inputHeight.value="height"in l?l.height:1,i.setRenderTarget(r);let h=e[s],p=i.getPixelRatio();i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,h/p,h/p),2===s&&t%2!=0&&i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,3/p,3/p),i.render(this.pyramidPassScene,D);let d=this.pyramidPassUniforms.inputShiftX.value;this.pyramidPassUniforms.inputShiftX.value=this.pyramidPassUniforms.outputShiftX.value,this.pyramidPassUniforms.outputShiftX.value=d,s<o&&(this.pyramidPassUniforms.outputShiftX.value+=e[s+1])}i.setViewport(r);let l=e.length%2==0?0:1;return i.readRenderTargetPixelsAsync(n[l],n[l].width-1,0,1,1,this.pyramidTopLevelReadPixelBuffer).then(()=>this.pyramidTopLevelReadPixelBuffer[0])}};var $=new v,Z=new v,Y=new h,Q=new p,J=new p,tt=new h;function et(t,e=0){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}function it(t,e=0){if(!0!==t(this,e)){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}}function at(){if(void 0===this.shapesDataTexture.value){let t=new w(new Float32Array(1920),96,5,d,o);this.shapesDataTexture.value=t}let n=this.shapesDataTexture.value,l=n.image.data,h=0,p=0,c=this.data.geometry.blendRange,f=$.copy(this.matrixWorld).invert(),u=this._npart,v=0;this._meshSdfWanted.clear();let m=null;if(et.call(this,n=>{if(!1===n.visible)return!0;let o;if(n instanceof t)return;if(n instanceof e||r(n))return;o=n instanceof i?n.object:n;let d=n.data?.cloner;if(s.is(n)&&d&&!d.hideBase&&"radial"!==d.type&&!0!==d.disabled||!(o instanceof a))return;let u=o.geometry.userData.parameters,x=u?.shapeBlendNode??o.dataPatched?.geometry?.shapeBlendNode;if(void 0===x)return;if(Z.multiplyMatrices(f,n.matrixWorld).decompose(J,Y,Q),"TorusGeometry"===u?.type&&360!==u.arc){let t=u.arc*Math.PI/180;t/=4,Y.multiply(tt.set(0,0,Math.sin(t),Math.cos(t)))}let y=x.overrideGlobalBlend?x.blendRange:c;y=y/this.bboxSize*2,l[4*v]=(J.x-this.bboxOffset)/this.bboxSize*2,l[4*v+1]=(J.y-this.bboxOffset)/this.bboxSize*2,l[4*v+2]=(J.z-this.bboxOffset)/this.bboxSize*2,l[4*v+3]=0===x.operation?1:2===x.operation?-1:-2,l[384+4*v]=-Y.x,l[384+4*v+1]=-Y.y,l[384+4*v+2]=-Y.z,l[384+4*v+3]=Y.w;let g=new Float32Array(4),S=0,b=y;if("SphereGeometry"===u?.type)u.width===u.height&&u.width===u.depth?g[0]=0:g[0]=1,g[1]=u.width/this.bboxSize,g[2]=u.height/this.bboxSize,g[3]=u.depth/this.bboxSize,b=Math.max(g[1],g[2],g[3])*Q.x+y;else if("CubeGeometry"===u?.type){S=u.cornerRadius;let t=u.width,e=u.height,i=u.depth;g[0]=2,g[1]=(t-2*S)/this.bboxSize,g[2]=(e-2*S)/this.bboxSize,g[3]=(i-2*S)/this.bboxSize,b=Math.sqrt(t**2+e**2+i**2)/this.bboxSize*Q.x+y}else if("CylinderGeometry"===u?.type){S=u.cornerRadius;let t=u.height,e=u.radiusBottom,i=u.radiusTop;if(i>=e){let a=Math.atan2(i-e,t),n=(Math.PI/2-a)/2;i-=S/Math.tan(n),e-=S*Math.tan(n)}else if(e>i){let a=Math.atan2(e-i,t),n=(Math.PI/2-a)/2;i-=S*Math.tan(n),e-=S/Math.tan(n)}g[1]=(u.height-2*S)/this.bboxSize,e===i?(g[0]=3,g[2]=e/this.bboxSize*2):(g[0]=4,g[2]=e/this.bboxSize*2,g[3]=i/this.bboxSize*2),b=(Math.hypot(g[1],Math.max(Math.abs(g[2]),Math.abs(g[3])))+S/this.bboxSize*2)*Q.x+y}else if("TorusGeometry"===u?.type){if(g[0]=5,g[1]=(u.width-u.depth)/this.bboxSize,g[2]=u.depth/this.bboxSize,360!==u.arc){g[0]=6,g[3]=g[1],l[1152+4*v+3]=g[2];let t=2*Math.atan2(g[2]/2,g[1]),e=u.arc*Math.PI/180/2-t;g[1]=Math.sin(e),g[2]=Math.cos(e)}b=u.width*Q.x/this.bboxSize+y}else{let t=o.geometry;(m??(m=new Set)).add(t.uuid);let e=this._meshSdfBaked.get(t.uuid),i=K(t);if((void 0===e||e.posVersion!==i)&&this._meshSdfWanted.set(t.uuid,t),void 0===e)return;g[0]=7,g[1]=e.slot,g[2]=e.boxHalf.x/this.bboxSize*2,g[3]=e.boxHalf.y/this.bboxSize*2,l[1152+4*v+3]=e.boxHalf.z/this.bboxSize*2,b=Math.hypot(e.boxHalf.x,e.boxHalf.y,e.boxHalf.z)/this.bboxSize*2*Q.x+y}l.set(g,768+4*v),h=Math.max(h,b),p=Math.max(p,y),this._reach[v]=b,l[1152+4*v]=y,l[1152+4*v+1]=S/this.bboxSize*2,l[1152+4*v+2]=Q.x;let T,P,_=Array.isArray(o.material)?o.material[0]:o.material,z=_;if(z?.getShapeBlendBaseColor){let t=z.getShapeBlendBaseColor();T=t,P=t.a}else void 0!==_?.uniforms?.nodeU0?(T=_.uniforms.nodeU0.node.value,P=_.uniforms.nodeU1?.value??1):(T={r:1,g:1,b:1},P=1);0!==x.operation&&!x.useColor&&(P=-1),l[1536+4*v]=T.r,l[1536+4*v+1]=T.g,l[1536+4*v+2]=T.b,l[1536+4*v+3]=P,P<1&&1===this.material.defines?.SHAPEBLEND_C&&(this.material.transparent=!0),v++}),this._meshSdfBaked.size>0){let t=m??new Set;for(let e of this._meshSdfBaked.keys())t.has(e)||this._meshSdfBaked.delete(e)}this.npart=v,this._maxBlendK=p;let x=1.1*h+2/(this.spatialDivisions-1)+4/(this.resolution-1);this.spatialPassUniforms.span.value=x;let y=this._prevShapeData,g=u!==v,S=null===y||this._prevSpan!==x||g,b=S||H,T=this._fieldDirtyMin.set(1/0,1/0,1/0),P=this._fieldDirtyMax.set(-1/0,-1/0,-1/0);if(null!==y){let t=Math.max(v,u);for(let e=0;e<t;e++){let t=!1;for(let i=0;i<5;i++){let a=384*i+4*e;if(l[a]!==y[a]||l[a+1]!==y[a+1]||l[a+2]!==y[a+2]||l[a+3]!==y[a+3]){t=!0;break}}if(!t)continue;if(S=!0,b)break;let i=l[4*e],a=l[4*e+1],n=l[4*e+2],s=y[4*e],r=y[4*e+1],o=y[4*e+2],h=this._reach[e],p=this._prevReach[e];Number.isFinite(i+a+n+h)&&Number.isFinite(s+r+o+p)?(T.x=Math.min(T.x,i-h,s-p),T.y=Math.min(T.y,a-h,r-p),T.z=Math.min(T.z,n-h,o-p),P.x=Math.max(P.x,i+h,s+p),P.y=Math.max(P.y,a+h,r+p),P.z=Math.max(P.z,n+h,o+p)):b=!0}}return H&&(S=!0),this._fieldDirtyFull=b||T.x===1/0,S&&(null===y?this._prevShapeData=new Float32Array(l):y.set(l),this._prevReach.set(this._reach),this._prevSpan=x,n.needsUpdate=!0),S}function nt(t){return at.call(t)}export{k as a,U as b,M as c,F as d,N as e,V as f,B as g,A as h,W as i,K as j,G as k,nt as l};
|
|
1
|
+
import{a as t}from"./runtime-chunk-FGRW5LUR.js";import{a as e}from"./runtime-chunk-W44H46BZ.js";import{$ as i,ea as a}from"./runtime-chunk-UBSXIKOG.js";import{e as n,h as s}from"./runtime-chunk-6ARRPM23.js";import{a as r}from"./runtime-chunk-2PT2WH66.js";import{Aa as o,Dc as l,Ec as h,Fc as p,Ja as d,Jc as c,Lc as f,Ma as u,Oc as v,Qe as m,Vc as x,Vd as y,Zc as g,ce as S,dd as b,de as T,ld as P,na as _,nc as z,nd as w,we as R}from"./runtime-chunk-BVVSZMXD.js";var O=new b;O.setAttribute("position",new g(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));var L=class extends T{constructor(t){super({...t,depthTest:!1,depthWrite:!1,glslVersion:z,vertexShader:"\n\t\t\t\tprecision highp float;\n\t\t\t\tin vec3 position;\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = vec4(position, 1);\n\t\t\t\t}\n\t\t\t"})}customProgramCacheKey(){return""}};function k(){return{shapeInput:()=>"\n\t\t\tconst float posRowCoord = 0.1; \n\t\t\tconst float quatRowCoord = 0.3; \n\t\t\tconst float param1RowCoord = 0.5;\n\t\t\tconst float param2RowCoord = 0.7;\n\t\t\tconst float colorRowCoord = 0.9; \n\t\t\tuniform sampler2D shapesDataTexture;\n\t\t\tvec4 shapePos(float iin) { \n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, posRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeQuat(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, quatRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams1(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param1RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeParams2(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, param2RowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\tvec4 shapeColor(float iin) {\n\t\t\t\tvec4 r = texture(shapesDataTexture, vec2(iin, colorRowCoord));\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",getxyzi:"\n\t\t\t// this code must complement lookup\n\t\t\tfloat xi = mod(gl_FragCoord.x - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat yi = mod(gl_FragCoord.y - 0.5, VOXEL_RESOLUTION);\n\t\t\tfloat zi = floor((gl_FragCoord.x - 0.5) * INV_VOXEL_RESOLUTION) + floor((gl_FragCoord.y - 0.5) * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t",lookup:"\n\t\t\tuniform sampler2D potentialPassTexture;\n\t\t\tuniform sampler2D voxelPassTexture; \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvec4 look(float xi, float yi, float zi, sampler2D rt) {\n\t\t\t\tvec2 uv = vec2(\n\t\t\t\t\tmod(zi, Z_LAYERS_PER_ROW) + (xi + 0.5) / VOXEL_RESOLUTION,\n\t\t\t\t\tfloor(zi / Z_LAYERS_PER_ROW) + (yi + 0.5) / VOXEL_RESOLUTION\n\t\t\t\t); \n\t\t\t\tuv /= Z_LAYERS_PER_ROW;\n\t\t\t\treturn texture(rt, uv);\n\t\t\t}\n\t\t",getpart:"\n\t\t\tfloat getpart(inout float a, float b) {\n\t\t\t\tfloat t = floor(a/b);\n\t\t\t\tfloat r = a - t*b;\n\t\t\t\ta = t;\n\t\t\t\treturn r;\n\t\t\t}\n\t\t",triTable:new Float32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,1,1,8,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,2,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,0,10,2,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,2,9,9,2,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,8,2,8,10,2,8,9,10,-1,-1,-1,-1,-1,-1,-1,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,11,0,0,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,11,3,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,11,1,11,9,1,11,8,9,-1,-1,-1,-1,-1,-1,-1,1,10,3,3,10,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,10,0,10,8,0,10,11,8,-1,-1,-1,-1,-1,-1,-1,0,9,3,9,11,3,9,10,11,-1,-1,-1,-1,-1,-1,-1,10,8,9,11,8,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1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4,3,2,3,3,2,3,4,4,3,3,4,4,3,4,5,5,2,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,4,2,3,3,4,3,4,2,3,3,4,4,5,4,5,3,2,3,4,4,3,4,5,3,2,4,5,5,4,5,2,4,1,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,3,2,3,3,4,3,4,4,5,3,2,4,3,4,3,5,2,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,4,3,4,4,3,4,5,5,4,4,3,5,2,5,4,2,1,2,3,3,4,3,4,4,5,3,4,4,5,2,3,3,2,3,4,4,5,4,5,5,2,4,3,5,4,3,2,4,1,3,4,4,5,4,5,3,4,4,5,5,2,3,4,2,1,2,3,3,2,3,4,2,1,3,2,4,1,2,1,1,0])}}var D=new R,U=null;function E(t){U=t}function M(){return U}var C=null;function F(t){C=t}function I(){return C}var N=null;function V(t){N=t}function B(){return N}var X=k(),A=24,W=96,H=!1,q=!0;try{let t=new URLSearchParams(window.location.search);H="0"===t.get("dbgsbstatic"),q="0"!==t.get("sb512")}catch{}function K(t){let e=t.getAttribute("position");return void 0===e?-1:1048576*(e.version??e.data?.version??0)+(e.count??0)%1048576}var G=class extends a{constructor(t,e,i){super(t,e,i),this.data=e,this.isShapeBlendEntity=!0,this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!1,this._prevShapeData=null,this._prevSpan=-1,this._reach=new Float32Array(96),this._prevReach=new Float32Array(96),this._fieldDirtyFull=!0,this._fieldDirtyMin=new p,this._fieldDirtyMax=new p,this._maxBlendK=0,this._meshSdfBaked=new Map,this._meshSdfWanted=new Map,this._passesRenderer=null,this._npart=-1,this.spatialn=1,this.drawRangeNeedsForceUpdate=!0,this._resolutionLevel=-1,this._authoredResolutionLevel=-1,this.ultraFieldResolution=0,this.resolution=64,this.spatialDivisions=25,this.zLayersPerRow=8,this.basePyramidSize=512,this.pyramidTexture1Width=341,this.pyramidTexture1Height=256,this.pyramidTexture2Width=170,this.pyramidTexture2Height=128,this.numLevels=9,this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=0,this.bboxOffset=0,this.shapesDataTexture={value:void 0},this.spatialscene=new x,this.potentialPassScene=new x,this.voxelPassScene=new x,this._spatialPassRenderTargets=[],this._potentialPassRenderTargets=[],this._voxelPassRenderTargets=[],this._pyramidRenderTargets=[],this.geometry=new b,this.geometry.drawRange.count=0,this.spatialPassUniforms={span:{value:-1},shapesDataTexture:this.shapesDataTexture,npart:{value:this.npart},spatialn:{value:this.spatialn}},this.spatialMesh=new P(O,this.spatialPassMaterial()),this.spatialMesh.frustumCulled=!1,this.spatialscene.add(this.spatialMesh);let a=new w(X.triTable,16,256,u,o);a.needsUpdate=!0;let n=new w(X.numTrisTable,256,1,u,o);n.needsUpdate=!0,this.voxelPassUniforms={potentialPassTexture:{value:void 0},numTrisTable:{value:n}},this.voxelMesh=new P(O,this.voxelPassMaterial()),this.voxelMesh.frustumCulled=!1,this.voxelPassScene.add(this.voxelMesh),this.potentialPassUniforms={shapesDataTexture:this.shapesDataTexture,spatialPassTexture:{value:void 0},npart:{value:this.npart},spatialn:{value:this.spatialn}},this.potentialMesh=new P(O,this.potentialPassMaterial()),this.potentialMesh.frustumCulled=!1,this.potentialPassScene.add(this.potentialMesh),this.marchPassUniforms={triTable:{value:a},potentialPassTexture:{value:void 0},voxelPassTexture:{value:void 0},pyramidTexture1:{value:void 0},pyramidTexture1Size:{value:void 0},pyramidTexture2:{value:void 0},pyramidTexture2Size:{value:void 0}},this.frustumCulled=!1,this.onBeforeShadowPass=t=>{let e=at.call(this);if(0===this.npart)return void(this.geometry.drawRange.count=0);let i=this.material.root;if(i.shadersPatchedForShapeBlend){if(this.customDepthMaterialNeedsUpdate){this.customDepthMaterialNeedsUpdate=!1,this.customDepthMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t\t#include <packing>\n\t\t\t\t\t\tvoid main()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t",uniforms:i.uniforms,defines:this.material.defines}),this.isMeshDepthMaterial=!0,this.customDistanceMaterial=new S({vertexShader:i.vertexShader,fragmentShader:"\n\t\t\t\t\t#include <common>\n\t\t\t\t\t#include <packing>\n\t\t\t\t\tuniform vec3 referencePosition;\n\t\t\t\t\tuniform float nearDistance;\n\t\t\t\t\tuniform float farDistance;\n\t\t\t\t\t\n\t\t\t\t\tvarying vec3 vWPosition;\n\t\t\t\t\tvoid main()\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dist = length(vWPosition - referencePosition);\n\t\t\t\t\t\tdist = (dist - nearDistance) / (farDistance - nearDistance);\n\t\t\t\t\t\tdist = saturate(dist);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = packDepthToRGBA( dist );\n\t\t\t\t\t}",uniforms:{nearDistance:{value:0},farDistance:{value:0},referencePosition:{value:new p},opacity:{value:0},...i.uniforms},defines:this.material.defines});let t=this.customDistanceMaterial;t.referencePosition=new p,t.nearDistance=0,t.farDistance=0,t.opacity=1,t.isMeshDistanceMaterial=!0}}else this.patchVertexShaderForShapeBlend(i),i.shadersPatchedForShapeBlend=!0,this.customDepthMaterialNeedsUpdate=!0;this.spatialPassUniforms.npart.value=this.npart,this.spatialPassUniforms.spatialn.value=this.spatialn,this.potentialPassUniforms.npart.value=this.npart,this.potentialPassUniforms.spatialn.value=this.spatialn;let a=this.needsRebuild;if(this.needsRebuild){this.needsRebuild=!1,this.spatialMesh.material.defines.RES=this.resolutionLevel,this.spatialMesh.material.needsUpdate=!0,this.potentialMesh.material.defines.RES=this.resolutionLevel,this.potentialPassUniforms.spatialPassTexture.value=this.spatialPassRenderTarget.texture,this.potentialMesh.material.needsUpdate=!0,this.voxelMesh.material.defines.RES=this.resolutionLevel,this.voxelMesh.material.needsUpdate=!0,this.voxelPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.potentialPassTexture.value=this.potentialPassRenderTarget.texture,this.marchPassUniforms.voxelPassTexture.value=this.voxelPassRenderTarget.textures[0],this.material.defines.RES=this.resolutionLevel,this.material.defines.LEVELS=this.pyramidLevelSizes.length,this.material.defines.LOOP=this.pyramidLevelSizes.length%2==0?this.pyramidLevelSizes.length-3:this.pyramidLevelSizes.length-2,this.material.defines.HALF=this.pyramidLevelSizes.length%2==0?1:0,this.material.needsUpdate=!0;let t=this.pyramidLevelSizes.length%2==0?0:1,e=this.pyramidLevelSizes.length%2==0?1:0;this.marchPassUniforms.pyramidTexture2.value=this.pyramidRenderTarget[t].texture,this.marchPassUniforms.pyramidTexture2Size.value=new l(this.pyramidRenderTarget[t].width,this.pyramidRenderTarget[t].height),this.marchPassUniforms.pyramidTexture1.value=this.pyramidRenderTarget[e].texture,this.marchPassUniforms.pyramidTexture1Size.value=new l(this.pyramidRenderTarget[e].width,this.pyramidRenderTarget[e].height),Object.assign(this.material.uniforms,this.marchPassUniforms)}if(!e&&!a&&!this.drawRangeNeedsForceUpdate&&this._passesRenderer===t)return;this._passesRenderer=t;let n=t.shadowMap.enabled;t.shadowMap.enabled=!1;let s=t.getRenderTarget();t.setRenderTarget(this.spatialPassRenderTarget),t.render(this.spatialscene,D),t.setRenderTarget(this.potentialPassRenderTarget),t.render(this.potentialPassScene,D),t.setRenderTarget(this.voxelPassRenderTarget),t.render(this.voxelPassScene,D),G.streamCompaction.renderPyramid(this.resolutionLevel,this.pyramidLevelSizes,t,this.voxelPassRenderTarget,this.pyramidRenderTarget).then(t=>{this.material.wireframe&&(3*t>this.geometry.attributes.position.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.dispose(),this.geometry=new b,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.geometry.attributes.position=new g(new Float32Array(3*t*2),3)),(3*t>this.geometry.drawRange.count||this.drawRangeNeedsForceUpdate)&&(this.geometry.drawRange.count=3*Math.floor(1.2*t),this.markSceneShadowsDirty()),this.drawRangeNeedsForceUpdate=!1}),t.shadowMap.enabled=n,t.setRenderTarget(s)}}markSceneShadowsDirty(){let t=this.parent;if(null!==t){for(;t.parent;)t=t.parent;t.markShadowsDirty?.()}}set npart(t){t!==this._npart&&(this.drawRangeNeedsForceUpdate=!0,this._npart=t,this.spatialn=Math.ceil(t/96))}get npart(){return this._npart}set resolutionLevel(t){let e=Math.min(q?9:8,Math.max(5,t));if(e===this._authoredResolutionLevel)return;this._authoredResolutionLevel=e,this.ultraFieldResolution=Math.pow(2,e);let i=Math.min(8,e);switch(this._resolutionLevel=i,this.resolution=Math.pow(2,i),this.resolutionLevel){case 5:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192],this.bboxSize=496,this.bboxOffset=-8;break;case 6:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512],this.bboxSize=504,this.bboxOffset=-4;break;case 7:this.pyramidLevelSizes=[1,2,4,6,12,24,48,96,192,384,768,1536],this.bboxSize=508,this.bboxOffset=-2;break;case 8:this.pyramidLevelSizes=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096],this.bboxSize=510,this.bboxOffset=-1}this.pyramidTexture1Width=0,this.pyramidTexture2Width=0,this.pyramidTexture1Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-2],this.pyramidTexture2Height=this.pyramidLevelSizes[this.pyramidLevelSizes.length-3];for(let t=this.pyramidLevelSizes.length-2;t>=0;t--)(this.pyramidLevelSizes.length-2)%2==t%2?this.pyramidTexture1Width+=this.pyramidLevelSizes[t]:this.pyramidTexture2Width+=this.pyramidLevelSizes[t];this.basePyramidSize=this.pyramidLevelSizes[this.pyramidLevelSizes.length-1],this.zLayersPerRow=this.basePyramidSize/this.resolution,this.numLevels=this.pyramidLevelSizes.length-1,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]},this.needsRebuild=!0,this.customDepthMaterialNeedsUpdate=!0}get resolutionLevel(){return this._resolutionLevel}get spatialPassRenderTarget(){let t=this._spatialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.spatialDivisions*this.spatialn,this.spatialDivisions**2,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._spatialPassRenderTargets[this.resolutionLevel]=t),t}get potentialPassRenderTarget(){let t=this._potentialPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),this._potentialPassRenderTargets[this.resolutionLevel]=t),t}get voxelPassRenderTarget(){let t=this._voxelPassRenderTargets[this.resolutionLevel];return t||(t=new f(this.basePyramidSize,this.basePyramidSize,{count:2,stencilBuffer:!1,depthBuffer:!1,generateMipmaps:!1,minFilter:_,magFilter:_}),t.textures[0].format=d,t.textures[0].type=o,t.textures[1].format=u,t.textures[1].type=o,this._voxelPassRenderTargets[this.resolutionLevel]=t),t}get pyramidRenderTarget(){let t=this._pyramidRenderTargets[this.resolutionLevel];return t||(t=[new f(this.pyramidTexture1Width,this.pyramidTexture1Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_}),new f(this.pyramidTexture2Width,this.pyramidTexture2Height,{format:d,type:o,stencilBuffer:!1,depthBuffer:!1,magFilter:_,minFilter:_})],this._pyramidRenderTargets[this.resolutionLevel]=t),t}updateState(t,e){let i=this.material;super.updateState(t,e),i!==this.material&&(this.needsRebuild=!0),t.geometry&&(this.resolutionLevel=t.geometry.resolutionLevel,this.geometry.userData.parameters={width:this.bboxSize,height:this.bboxSize,depth:this.bboxSize,centerOffset:[this.bboxOffset,this.bboxOffset,this.bboxOffset]}),t.wireframe&&!this.geometry.getAttribute("position")?this.geometry.setAttribute("position",new g(new Float32Array(3*this.geometry.drawRange.count),3)):!t.wireframe&&this.geometry.getAttribute("position")&&this.geometry.deleteAttribute("position")}spatialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tuniform float span;\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\t${X.shapeInput()}\n\n\t\t\tvec3 low, high; \n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfloat spatialKey(float lowi) {\n\t\t\t\tfloat t = 0.;\n\t\t\t\tfor (float ii = 23.; ii >= 0.; ii--) {\n\t\t\t\t\tfloat i = ii + lowi;\n\t\t\t\t\tfloat iin = (i + 0.5) / 96.;\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec3 d = shape.xyz;\n\t\t\t\t\tfloat op = shape.w;\n\t\n\t\t\t\t\tt *= 2.;\n\t\t\t\t\tt += (\n\t\t\t\t\t\tlow.x < d.x && d.x < high.x &&\n\t\t\t\t\t\tlow.y < d.y && d.y < high.y &&\n\t\t\t\t\t\tlow.z < d.z && d.z < high.z &&\n\t\t\t\t\t\ti < npart || op == -2. \n\t\t\t\t\t) ? 1. : 0.;\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t}\n\n\t\t\t${X.getpart}\n\n\t\t\tvoid main() { \n\t\t\t\t\n\t\t\t\tvec3 div; \n\t\t\t\t\n\t\t\t\tfloat yz = float(gl_FragCoord.y - 0.5); \n\t\t\t\tdiv.y = getpart(yz, spatialDivisions);\n\t\t\t\tdiv.z = yz; \n\n\t\t\t\tfloat lx = float(gl_FragCoord.x - 0.5); \n\t\t\t\tfloat lowi = getpart(lx, spatialn) * 96.;\n\t\t\t\tdiv.x = lx;\n\n\t\t\t\tlow = div / spatialDivisions * 2. - 1. - span;\n\t\t\t\thigh = (div+1.) / spatialDivisions * 2. - 1. + span;\n\n\t\t\t\t\n\t\t\t\tpc_FragColor.x = spatialKey(lowi);\n\t\t\t\tpc_FragColor.y = spatialKey(lowi+24.);\n\t\t\t\tpc_FragColor.z = spatialKey(lowi+48.);\n\t\t\t\tpc_FragColor.w = spatialKey(lowi+72.);\n\t\t\t}\n\t\t`;return new L({name:"Spatial Pass",fragmentShader:t,uniforms:this.spatialPassUniforms})}potentialPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tout vec4 pc_FragColor;\n\n\t\t\t${X.shapeInput()}\n\t\t\tuniform sampler2D spatialPassTexture;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.;\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tuniform float npart;\n\t\t\tuniform float spatialn;\n\t\t\tconst float spatialDivisions = ${this.spatialDivisions}.;\n\t\t\tconst float spatialDivisions2 = spatialDivisions * spatialDivisions;\n\t\t\tconst float spatialDivisionsSub1 = spatialDivisions - 1.;\n\n\t\t\t${X.getpart}\n\n\t\t\tvec3 packRGBAToVec3(vec4 color) {\n\t\t\t\tuint r = uint(color.r * 255.);\n\t\t\t\tuint g = uint(color.g * 255.);\n\t\t\t\tuint combined = (r << 8) | g; \n\t\t\t\treturn vec3(float(combined) * 0.00001525902, color.b, color.a); \n\t\t\t}\n\n\t\t\tvoid applyQuaternionToVector(in vec4 q, inout vec3 v) {\n\t\t\t\tv += 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t\n\t\t\tfloat smoothOperation(float op, float sdf, float d, float k) {\n\t\t\t \n\t\t\t \n\t\t\t\t\n\n\t\t\t\tfloat signSubtract = clamp(op, -1., 1.);\n\t\t\t\tfloat signIntersection = 2. * (op - signSubtract) + 1.;\n\t\t\t\tfloat h = clamp(\n\t\t\t\t\t0.5 + signSubtract * 0.5 * (sdf - signSubtract * signIntersection * d) / k,\n\t\t\t\t\t0.0,\n\t\t\t\t\t1.0\n\t\t\t\t);\n\t\t\t\treturn mix(sdf, signSubtract * signIntersection * d, h) - \n\t\t\t\t\t\t\t signSubtract * k * h * (1.0 - h);\n\t\t\t}\n\n\t\t\tfloat sdSphere( vec3 p, float s )\n\t\t\t{\n\t\t\t\treturn length(p)-s;\n\t\t\t}\n\n\t\t\tfloat sdEllipsoid( vec3 p, vec3 r )\n\t\t\t{\n\t\t\t\tfloat k0 = length(p/r);\n\t\t\t\tfloat k1 = length(p/(r*r));\n\t\t\t\treturn k0*(k0-1.0)/k1;\n\t\t\t}\n\n\t\t\tfloat sdBox( vec3 p, vec3 b )\n\t\t\t{\n\t\t\t\tvec3 q = abs(p) - b;\n\t\t\t\treturn length(max(q,0.0)) + min(max(q.x,max(q.y,q.z)),0.0);\n\t\t\t}\n\n\t\t\tfloat sdTorus( vec3 p, vec2 t )\n\t\t\t{\n\t\t\t\tvec2 q = vec2(length(p.xy)-t.x,p.z);\n\t\t\t\treturn length(q)-t.y;\n\t\t\t}\n\n\t\t\tfloat sdCappedTorus( vec3 p, vec2 sc, float ra, float rb)\n\t\t\t{\n\t\t\t\tp.x = abs(p.x);\n\t\t\t\tfloat k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy);\n\t\t\t\treturn sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb;\n\t\t\t}\n\n\t\t\tfloat dot2( in vec2 v ) { return dot(v,v); }\n\t\t\tfloat sdCappedCone( vec3 p, float h, float r1, float r2 )\n\t\t\t{\n\t\t\t\tvec2 q = vec2( length(p.xz), p.y );\n\t\t\t\tvec2 k1 = vec2(r2,h);\n\t\t\t\tvec2 k2 = vec2(r2-r1,2.0*h);\n\t\t\t\tvec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);\n\t\t\t\tvec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );\n\t\t\t\tfloat s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;\n\t\t\t\treturn s*sqrt( min(dot2(ca),dot2(cb)) );\n\t\t\t}\n\n\t\t\tfloat sdCappedCylinder( vec3 p, float h, float r )\n\t\t\t{\n\t\t\t\tvec2 d = abs(vec2(length(p.xz),p.y)) - vec2(r,h);\n\t\t\t\treturn min(max(d.x,d.y),0.0) + length(max(d,0.0));\n\t\t\t}\n\n\t\t\tfloat maxBlend = 0.0;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tvoid fillSpatialInner(\n\t\t\t\tfloat ii,\n\t\t\t\tfloat activeKey,\n\t\t\t\tvec3 corner,\n\t\t\t\tinout float sdf,\n\t\t\t\tinout float colorDivisor,\n\t\t\t\tinout vec4 trackColor\n\t\t\t) {\n\t\t\t\tfor (float i = 0.; i < 24.; i++) {\n\t\t\t\t\tif (activeKey < 1.) break; \n\t\t\t\t\tactiveKey *= 0.5;\n\t\t\t\t\tif (fract(activeKey) < 0.5) continue;\n\n\t\t\t\t\tfloat iin = (i + ii + 0.5) * ${1/96};\n\t\t\t\t\tvec4 shape = shapePos(iin);\n\t\t\t\t\tvec4 quat = shapeQuat(iin);\n\t\t\t\t\tvec4 params1 = shapeParams1(iin);\n\t\t\t\t\tvec4 params2 = shapeParams2(iin);\n\n\t\t\t\t\tvec3 p = corner - shape.xyz;\n\t\t\t\t\tapplyQuaternionToVector(quat, p);\n\t\t\t\t\tp /= params2.z; // scale\n\t\t\t\t\tfloat d; // d in -1..1 coordinates\n\t\t\t\t\tswitch (int(params1.x)) {\n\t\t\t\t\t\tcase 0: d = sdSphere(p, params1.y); break;\n\t\t\t\t\t\tcase 1: d = sdEllipsoid(p, params1.yzw); break;\n\t\t\t\t\t\tcase 2: d = sdBox(p, params1.yzw); break;\n\t\t\t\t\t\tcase 3: d = sdCappedCylinder(p, params1.y, params1.z); break;\n\t\t\t\t\t\tcase 4: d = sdCappedCone(p, params1.y, params1.z, params1.w); break;\n\t\t\t\t\t\tcase 5: d = sdTorus(p, params1.yz); break;\n\t\t\t\t\t\tcase 6: d = sdCappedTorus(p, params1.yz, params1.w, params2.w); break;\n\t\t\t\t\t\t// Mesh children (type 7) live in a WebGPU-only baked SDF\n\t\t\t\t\t\t// atlas — the GLSL evaluator skips the shape entirely\n\t\t\t\t\t\t// (also closes the latent uninitialized-d default).\n\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t}\n\t\t\t\t\td -= params2.y; // rounded edge\n\t\t\t\t\td *= params2.z; // scale\n\n\t\t\t\t\tfloat k = params2.x;\n\t\t\t\t\tfloat op = shape.w;\n\n\t\t\t\t\tsdf = smoothOperation(shape.w, sdf, d, k);\n\n\t\t\t\t\tfloat isNegativeOne = step(-1.5, op) * step(op, -0.5); // 1 when op == -1, 0 otherwise\n\t\t\t\t\tfloat colorCull = smoothstep(maxBlend, 0., -d);\n\t\t\t\t\tfloat cullFactor = mix(1.0, colorCull, isNegativeOne);\n\t\t\t\t\ttrackColor *= cullFactor;\n\t\t\t\t\tcolorDivisor *= cullFactor;\n\n\t\t\t\t\tmaxBlend = max(maxBlend, k);\n\n\t\t\t\t\tk += 2. * INV_VOXEL_RESOLUTION; // avoid division by zero, and other color artifacts with very small k\n\t\t\t\t\tfloat nearness = smoothstep(k, 0., d);\n\n\t\t\t\t\tvec4 color = shapeColor(iin);\n\t\t\t\t\tnearness *= float(color.a >= 0.);\n\n\t\t\t\t\tcolorDivisor += nearness;\n\t\t\t\t\ttrackColor += color * nearness;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvec3 div;\n\t\t\t// compute potential from all spheres; collect +ve and =ve values separately\n\t\t\t// work in blocks of A*4 (=96) spheres, using the bit flags in 4 float channel 'activeKey' values\n\t\t\t// TODO check if extra vec3 output useful, not really used at present\n\t\t\tfloat fillSpatial(vec3 corner, inout vec4 trackColor) {\n\t\t\t\tfloat sdf = 1e3; // hack: initialize to large value\n\t\t\t\tfloat colorDivisor = 0.;\n\t\t\t\t// spatialPassTexture holds x=> lowi, x faster moving and y=> z, y faster moving\n\t\t\t\tfloat divyz = (div.y + div.z * spatialDivisions + 0.5) / (spatialDivisions2);\n\t\t\t\tfor (float ii = 0.; ii < spatialn; ii++) {\n\t\t\t\t\tfloat i = ii * 96.;\n\n\t\t\t\t\tvec4 activeKey = texture(spatialPassTexture, vec2((div.x * spatialn + ii + 0.5)/(spatialn * spatialDivisions), divyz));\n\t\t\t\t\tfillSpatialInner(i, activeKey.x, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+24., activeKey.y, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+48., activeKey.z, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t\tfillSpatialInner(i+72., activeKey.w, corner, sdf, colorDivisor, trackColor);\n\t\t\t\t}\n\n\t\t\t\ttrackColor /= colorDivisor;\n\t\t\t\treturn mix(sdf, 0.0, step(1e20 - 0.1, sdf));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 xyzi = vec3(xi,yi,zi);\n\t\t\t\tvec3 corner = xyzi / VOXEL_RESOLUTION_SUB1 * 2. - 1.; \n\n\t\t\t\tdiv = floor(xyzi / VOXEL_RESOLUTION_SUB1 * spatialDivisionsSub1);\n\n\t\t\t\tvec4 c = vec4(0.);\n\t\t\t\tfloat t = fillSpatial(corner, c);\n\n\t\t\t\tpc_FragColor = vec4(t, packRGBAToVec3(c)); \n\t\t\t}\n\t\t`;return new L({name:"PotentialPass",fragmentShader:t,uniforms:this.potentialPassUniforms})}voxelPassMaterial(){let t=`\n\t\t\tprecision highp float;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tlayout(location = 1) out vec4 numTris;\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float VOXEL_RESOLUTION_SUB1 = VOXEL_RESOLUTION - 1.; \n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\t\t\tuniform sampler2D numTrisTable; \n\n\t\t\tfloat keyi(float f000, float f100, float f010, float f110, float f001, float f101, float f011, float f111) {\n\t\t\t\treturn (float(f000 < 0.) * 1.) +\n\t\t\t\t\t\t\t (float(f100 < 0.) * 2.) +\n\t\t\t\t\t\t\t (float(f010 < 0.) * 8.) +\n\t\t\t\t\t\t\t (float(f110 < 0.) * 4.) +\n\t\t\t\t\t\t\t (float(f001 < 0.) * 16.) +\n\t\t\t\t\t\t\t (float(f101 < 0.) * 32.) +\n\t\t\t\t\t\t\t (float(f011 < 0.) * 128.) +\n\t\t\t\t\t\t\t (float(f111 < 0.) * 64.);\n\t\t\t}\n\n\t\t\t${X.lookup}\n\n\t\t\tvec3 compNormi(float xi, float yi, float zi) {\n\t\t\t\tfloat dx = look(xi + 1., yi, zi, potentialPassTexture).r - look(xi - 1., yi, zi, potentialPassTexture).r;\n\t\t\t\tfloat dy = look(xi, yi + 1., zi, potentialPassTexture).r - look(xi, yi - 1., zi, potentialPassTexture).r;\n\t\t\t\tfloat dz = look(xi, yi, zi + 1., potentialPassTexture).r - look(xi, yi, zi - 1., potentialPassTexture).r;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (dx == 0.0 && dy == 0.0 && dz == 0.0) {\n\t\t\t\t\treturn vec3(0.199, 0.299, 0.399);\n\t\t\t\t}\n\t\t\t\treturn normalize(vec3(dx, dy, dz));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\t${X.getxyzi} \n\n\t\t\t\tvec3 normal = compNormi(xi, yi, zi); \n\n\t\t\t\tif (xi >= VOXEL_RESOLUTION_SUB1 || yi >= VOXEL_RESOLUTION_SUB1 || zi >= VOXEL_RESOLUTION_SUB1) {\n\t\t\t\t\tpc_FragColor = vec4(normal, 0.);\n\t\t\t\t\tnumTris = vec4(0.);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfloat\n\t\t\t\t\tf000 = look(xi, yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf100 = look(xi+1., yi, zi, potentialPassTexture).r,\n\t\t\t\t\tf010 = look(xi, yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf110 = look(xi+1., yi+1., zi, potentialPassTexture).r,\n\t\t\t\t\tf001 = look(xi, yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf101 = look(xi+1., yi, zi+1., potentialPassTexture).r,\n\t\t\t\t\tf011 = look(xi, yi+1., zi+1., potentialPassTexture).r,\n\t\t\t\t\tf111 = look(xi+1., yi+1., zi+1., potentialPassTexture).r;\n\t\t\t\tfloat key = keyi(f000, f100, f010, f110, f001, f101, f011, f111);\n\n\t\t\t\tpc_FragColor = vec4(normal, key);\n\n\t\t\t\tnumTris = texture(numTrisTable, vec2((key + 0.5) / 256., 0.5));\n\t\t\t}\n\t\t`;return new L({name:"VoxelPass",fragmentShader:t,uniforms:this.voxelPassUniforms})}patchVertexShaderForShapeBlend(t){let e=`\n\t\t#ifdef SHAPEBLEND \n\t\t\tprecision highp sampler2D;\n\n\t\t\tuniform float isol;\n\n\t\t\tuniform sampler2D triTable; \n\t\t\tuniform sampler2D pyramidTexture1;\n\t\t\tuniform vec2 pyramidTexture1Size;\n\t\t\tuniform sampler2D pyramidTexture2;\n\t\t\tuniform vec2 pyramidTexture2Size;\n\n\t\t\tconst vec2 halfPixelOffset = vec2(0.5, 0.5);\n\n\t\t\tconst vec2 rShift = vec2(0., 1.);\n\t\t\tconst vec2 gShift = vec2(1., 1.);\n\t\t\tconst vec2 bShift = vec2(1., 0.);\n\n\t\t\tconst float res = float(RES);\n\t\t\tconst float VOXEL_RESOLUTION = pow(2., res);\n\t\t\tconst float Z_LAYERS_PER_ROW = ceil(pow(2., res / 2.));\n\t\t\tconst float INV_VOXEL_RESOLUTION = 1.0 / VOXEL_RESOLUTION;\n\n\t\t\tconst float scale_factor = 2.;\n\n\t\t\t#if SHAPEBLEND == 5\n\t\t\t\tconst float levelShiftX[7] = float[7](4., 6., 12., 24., 48., 96., 192.);\n\t\t\t\tconst float scale = 8. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(16.);\n\t\t\t#elif SHAPEBLEND == 7\n\t\t\t\tconst float levelShiftX[10] = float[10](4., 6., 12., 24., 48., 96., 192., 384., 768., 1536.); \n\t\t\t\tconst float scale = 2. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(64.);\n\t\t\t#elif SHAPEBLEND == 8\n\t\t\t\tconst float levelShiftX[11] = float[11](4., 8., 16., 32., 64., 128., 256., 512., 1024., 2048., 4096.);\n\t\t\t\tconst float scale = scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(128.);\n\t\t\t#else\n\t\t\t\tconst float levelShiftX[8] = float[8](4., 8., 16., 32., 64., 128., 256., 512.);\n\t\t\t\tconst float scale = 4. * scale_factor;\n\t\t\t\tconst vec3 originOffset = vec3(32.);\n\t\t\t#endif\n\n\t\t\t${X.lookup}\n\n\t\t\tconst vec3 offsets[24] = vec3[](\n\t\t\t\tvec3(0., 0., 0.), vec3(1., 0., 0.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 1., 0.), vec3(1., 1., 0.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 1., 0.),\n\t\t\t\tvec3(0., 0., 1.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 0., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 1.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 0., 1.), vec3(0., 1., 1.),\n\t\t\t\tvec3(0., 0., 0.), vec3(0., 0., 1.),\n\t\t\t\tvec3(1., 0., 0.), vec3(1., 0., 1.),\n\t\t\t\tvec3(1., 1., 0.), vec3(1., 1., 1.),\n\t\t\t\tvec3(0., 1., 0.), vec3(0., 1., 1.)\n\t\t\t);\n\n\t\t\tvec2 computeShiftedPosition1(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture1Size;\n\t\t\t}\n\n\t\t\tvec2 computeShiftedPosition2(vec2 xy, float levelOriginX) {\n\t\t\t\tvec2 xyShifted = xy;\n\t\t\t\txyShifted.x += levelOriginX;\n\t\t\t\treturn (xyShifted + halfPixelOffset) / pyramidTexture2Size;\n\t\t\t}\n\n\t\t\tvec4 unpackVec3ToRGBA(vec3 vec) {\n\t\t\t\tuint combined = uint(vec.x * 65535.0 + 0.5); \n\t\t\t\tfloat g = float(combined & uint(0xFF)) * 0.00392156862; \n\t\t\t\tfloat r = float((combined >> 8) & uint(0xFF)) * 0.00392156862; \n\t\t\n\t\t\t\treturn vec4(r, g, vec.y, vec.z);\n\t\t\t}\n\n\t\t\tout vec4 marchColor;\n\t\t\t\n\t\t#endif\n\t\t`;t.vertexShader=e+t.vertexShader.replace("#include <project_vertex>","\n\t\t#ifdef SHAPEBLEND\n\t\t\tfloat triIndex = floor(float(gl_VertexID/3));\n\t\t\tfloat vertexIndex = float(gl_VertexID);\n\t\t\t\n\t\t\t\n\t\t\tfloat levelOriginX1 = pyramidTexture1Size.x - 2.;\n\t\t\tfloat levelOriginX2 = pyramidTexture2Size.x - 1.;\n\t\t\tvec2 xy = vec2(0.);\n\t\t\tvec4 lookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\t\t\t\n\t\t\t\n\t\t\tif (triIndex >= lookUp.r) return;\n\t\t\t\n\t\t\t\n\t\t\tfloat start = 0.;\n\t\t\tvec4 triIndexVec = vec4(triIndex);\n\t\t\t\n\t\t\t\n\t\t\tfor (int i = 0; i < LOOP;) {\n\t\t\t\t\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX2 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture1, computeShiftedPosition1(xy, levelOriginX1));\n\t\t\t\ti++;\n\n\t\t\t\tends = lookUp + vec4(start);\n\t\t\t\tstarts = vec4(ends.gba, start);\n\t\t\t\tcheck = vec4(greaterThanEqual(triIndexVec, starts)) * \n\t\t\t\t\t\t\t\t\t\t\tvec4(lessThan(triIndexVec, ends));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t\tlevelOriginX1 -= levelShiftX[i];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tlookUp = texture(pyramidTexture2, computeShiftedPosition2(xy, levelOriginX2));\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\t#if HALF == 1\n\t\t\t\tvec4 ends = lookUp + vec4(start);\n\t\t\t\tvec4 starts = vec4(ends.gba, start);\n\t\t\t\tvec4 check = vec4(greaterThanEqual(triIndexVec, starts)) * vec4(lessThan(triIndexVec, ends));\n\t\t\t\n\t\t\t\t\n\t\t\t\txy *= 2.;\n\t\t\t\txy += check.r * rShift + check.g * gShift + check.b * bShift;\n\t\t\t\n\t\t\t\t\n\t\t\t\tstart = dot(check, starts);\n\t\t\t#endif\n\t\t\t\n\t\t\t\n\t\t\tvec3 gridPos;\n\t\t\tgridPos.x = mod(xy.x, VOXEL_RESOLUTION);\n\t\t\tgridPos.y = mod(xy.y, VOXEL_RESOLUTION);\n\t\t\tgridPos.z = floor(xy.x * INV_VOXEL_RESOLUTION) + \n\t\t\t\t\t\t\t\t\tfloor(xy.y * INV_VOXEL_RESOLUTION) * Z_LAYERS_PER_ROW;\n\t\t\t\n\t\t\t\n\t\t\tvertexIndex -= start * 3.;\n\t\t\tfloat vk = vertexIndex * 0.0625 + 0.03125; \n\t\t\t\n\t\t\t\n\t\t\tvec4 voxel = look(gridPos.x, gridPos.y, gridPos.z, voxelPassTexture);\n\t\t\tfloat key = (voxel.w + 0.5) * 0.00390625; \n\t\t\t\n\t\t\t\n\t\t\tfloat edgeNum = texture(triTable, vec2(vk, key)).x;\n\t\t\tint edgeIndex = int(edgeNum) * 2;\n\t\t\t\n\t\t\t\n\t\t\tvec3 p1 = gridPos + offsets[edgeIndex];\n\t\t\tvec3 p2 = gridPos + offsets[edgeIndex + 1];\n\t\t\t\n\t\t\t\n\t\t\tvec4 potential1 = look(p1.x, p1.y, p1.z, potentialPassTexture);\n\t\t\tvec4 potential2 = look(p2.x, p2.y, p2.z, potentialPassTexture);\n\t\t\t\n\t\t\t\n\t\t\tfloat mu = potential1.r / (potential1.r - potential2.r);\n\n\t\t\tmarchColor = mix(\n\t\t\t\tunpackVec3ToRGBA(potential1.gba),\n\t\t\t\tunpackVec3ToRGBA(potential2.gba),\n\t\t\t\tmu\n\t\t\t);\n\n\t\t\ttransformed = p1 + (p2 - p1) * mu;\n\t\t\ttransformed -= originOffset;\n\t\t\ttransformed *= scale;\n\t\t\tvec4 data1 = look(p1.x, p1.y, p1.z, voxelPassTexture);\n\t\t\tvec4 data2 = look(p2.x, p2.y, p2.z, voxelPassTexture);\n\t\t\tobjectNormal = normalize(mix(data1.xyz, data2.xyz, mu));\n\t\t\ttransformedNormal = normalMatrix * objectNormal;\n\t\t\t#ifndef FLAT_SHADED\n\t\t\t\tvNormal = transformedNormal;\n\t\t\t#endif\n\t\t#endif\n\t\t\n#include <project_vertex>");let i=t.fragmentShader.match(/vec3 diffuseColor[^\n]*\n/);if(!i)return;let a=`\n\t\t#ifdef SHAPEBLEND_C\n\t\t\t#if SHAPEBLEND_C == 1\n\t\t\t\t${i[0].replace(/nodeU0,/g,"marchColor.rgb,").replace(/nodeU\d+(?=,g_uid\d+_calpha\))/g,"marchColor.a")}\n\t\t\t#else\n\t\t\t\t${i[0]}\n\t\t\t#endif\n\t\t#else\n\t\t\t${i[0]}\n\t\t#endif\n\t\t`;t.fragmentShader="in vec4 marchColor;\n"+t.fragmentShader.replace(i[0],a),Object.assign(t.uniforms,this.marchPassUniforms)}initDebugPass(t){console.log("fboToDebug.width",t.width,t.height),this.geometry=new y(t.width,t.height),this.geometry.userData={parameters:{width:4,height:4}};let e={inputTexture:{value:t.textures.length>1?t.textures[1]:t.texture},pyramidTextureSize:{value:void 0}},i=t=>{t.vertexShader="\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\t\tvUv = uv;\n\t\t\t\t}\n\t\t\t",t.fragmentShader="\n\t\t\t\tlayout(location = 1) out vec4 gVelocity;\n\n\t\t\t\tprecision highp float;\n\t\t\t\t\n\t\t\t\tuniform sampler2D inputTexture;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tuniform vec2 pyramidTextureSize;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tgl_FragColor = texture(inputTexture, vUv);\n\t\t\t\t\t\tgVelocity = vec4(0.0);\n\t\t\t\t}\n\t\t\t",e.pyramidTextureSize.value=new l(this.pyramidRenderTarget[0].width,this.pyramidRenderTarget[0].height),Object.assign(t.uniforms,e)};this.material.shapeBlendhack=i,this.material.root.shapeBlendhack=i}dispose(){super.dispose(),B()?.release(this)}},j=G;j.streamCompaction=new class{constructor(){this.pyramidPassScene=new x,this.pyramidPassMaterial=new L({name:"PyramidPass"}),this.pyramidPassUniforms={inputTexture:{value:void 0},inputWidth:{value:0},inputHeight:{value:0},inputShiftX:{value:0},outputShiftX:{value:0}},this.pyramidTopLevelReadPixelBuffer=new Float32Array(4),this.pyramidPassMaterial.fragmentShader="\n\t\t\tprecision highp float;\n\t\t\tprecision highp sampler2D;\n\t\t\tlayout(location = 0) out vec4 pc_FragColor;\n\t\t\tuniform sampler2D inputTexture;\n\t\t\tuniform float inputWidth;\n\t\t\tuniform float inputHeight;\n\t\t\tuniform float inputShiftX;\n\t\t\tuniform float outputShiftX;\n\t\t\tconst vec2 half_unit_coord = vec2(0.5);\n\t\t\tconst vec4 one = vec4(1.0);\n\t\t\tvoid main() {\n\t\t\t\tvec2 inputSize = vec2(inputWidth, inputHeight);\n\t\t\t\tvec2 input_pixel_uv = 1. / inputSize;\n\t\t\t\tvec2 coord = gl_FragCoord.xy - half_unit_coord;\n\t\t\t\tcoord.x -= outputShiftX;\n\t\t\t\tcoord = coord * 2. + half_unit_coord;\n\t\t\t\tcoord.x += inputShiftX;\n\n\t\t\t\t\n\t\t\t\tvec2 input_uv = coord / inputSize;\n\t\t\t\tfloat bl = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x += input_pixel_uv.x;\n\t\t\t\tfloat br = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.y += input_pixel_uv.y;\n\t\t\t\tfloat tr = texture(inputTexture, input_uv).r;\n\n\t\t\t\t\n\t\t\t\tinput_uv.x -= input_pixel_uv.x;\n\t\t\t\tfloat tl = texture(inputTexture, input_uv).r;\n\n\t\t\t\tpc_FragColor.a = bl;\n\t\t\t\tpc_FragColor.b = pc_FragColor.a + br;\n\t\t\t\tpc_FragColor.g = pc_FragColor.b + tr;\n\t\t\t\tpc_FragColor.r = pc_FragColor.g + tl; \n\t\t\t}\n\t\t",this.pyramidPassMaterial.uniforms=this.pyramidPassUniforms,this.pyramidPassMaterial.depthTest=!1,this.pyramidPassMaterial.depthWrite=!1;let t=new P(O,this.pyramidPassMaterial);t.frustumCulled=!1,this.pyramidPassScene.add(t)}renderPyramid(t,e,i,a,n){(new m).min.setScalar(0);let s=e.length-1,r=new c;i.getViewport(r),this.pyramidPassUniforms.inputShiftX.value=0,this.pyramidPassUniforms.outputShiftX.value=0;let o=s-1;for(let s=o;s>=0;s--){let r=s%2==o%2?n[0]:n[1],l=s===o?a:s%2==o%2?n[1]:n[0];this.pyramidPassUniforms.inputTexture.value=l.textures.length>1?l.textures[1]:l.texture,this.pyramidPassUniforms.inputWidth.value="width"in l?l.width:1,this.pyramidPassUniforms.inputHeight.value="height"in l?l.height:1,i.setRenderTarget(r);let h=e[s],p=i.getPixelRatio();i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,h/p,h/p),2===s&&t%2!=0&&i.setViewport(this.pyramidPassUniforms.outputShiftX.value/p,0,3/p,3/p),i.render(this.pyramidPassScene,D);let d=this.pyramidPassUniforms.inputShiftX.value;this.pyramidPassUniforms.inputShiftX.value=this.pyramidPassUniforms.outputShiftX.value,this.pyramidPassUniforms.outputShiftX.value=d,s<o&&(this.pyramidPassUniforms.outputShiftX.value+=e[s+1])}i.setViewport(r);let l=e.length%2==0?0:1;return i.readRenderTargetPixelsAsync(n[l],n[l].width-1,0,1,1,this.pyramidTopLevelReadPixelBuffer).then(()=>this.pyramidTopLevelReadPixelBuffer[0])}};var $=new v,Z=new v,Y=new h,Q=new p,J=new p,tt=new h;function et(t,e=0){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}function it(t,e=0){if(!0!==t(this,e)){let i=this.children.length;for(;i--;){let a=this.children[i];n.is(a)&&it.call(a,t,e+1)}}}function at(){if(void 0===this.shapesDataTexture.value){let t=new w(new Float32Array(1920),96,5,d,o);this.shapesDataTexture.value=t}let n=this.shapesDataTexture.value,l=n.image.data,h=0,p=0,c=this.data.geometry.blendRange,f=$.copy(this.matrixWorld).invert(),u=this._npart,v=0;this._meshSdfWanted.clear();let m=null;if(et.call(this,n=>{if(!1===n.visible)return!0;let o;if(n instanceof t)return;if(n instanceof e||r(n))return;o=n instanceof i?n.object:n;let d=n.data?.cloner;if(s.is(n)&&d&&!d.hideBase&&"radial"!==d.type&&!0!==d.disabled||!(o instanceof a))return;let u=o.geometry.userData.parameters,x=u?.shapeBlendNode??o.dataPatched?.geometry?.shapeBlendNode;if(void 0===x)return;if(Z.multiplyMatrices(f,n.matrixWorld).decompose(J,Y,Q),"TorusGeometry"===u?.type&&360!==u.arc){let t=u.arc*Math.PI/180;t/=4,Y.multiply(tt.set(0,0,Math.sin(t),Math.cos(t)))}let y=x.overrideGlobalBlend?x.blendRange:c;y=y/this.bboxSize*2,l[4*v]=(J.x-this.bboxOffset)/this.bboxSize*2,l[4*v+1]=(J.y-this.bboxOffset)/this.bboxSize*2,l[4*v+2]=(J.z-this.bboxOffset)/this.bboxSize*2,l[4*v+3]=0===x.operation?1:2===x.operation?-1:-2,l[384+4*v]=-Y.x,l[384+4*v+1]=-Y.y,l[384+4*v+2]=-Y.z,l[384+4*v+3]=Y.w;let g=new Float32Array(4),S=0,b=y;if("SphereGeometry"===u?.type)u.width===u.height&&u.width===u.depth?g[0]=0:g[0]=1,g[1]=u.width/this.bboxSize,g[2]=u.height/this.bboxSize,g[3]=u.depth/this.bboxSize,b=Math.max(g[1],g[2],g[3])*Q.x+y;else if("CubeGeometry"===u?.type){S=u.cornerRadius;let t=u.width,e=u.height,i=u.depth;g[0]=2,g[1]=(t-2*S)/this.bboxSize,g[2]=(e-2*S)/this.bboxSize,g[3]=(i-2*S)/this.bboxSize,b=Math.sqrt(t**2+e**2+i**2)/this.bboxSize*Q.x+y}else if("CylinderGeometry"===u?.type){S=u.cornerRadius;let t=u.height,e=u.radiusBottom,i=u.radiusTop;if(i>=e){let a=Math.atan2(i-e,t),n=(Math.PI/2-a)/2;i-=S/Math.tan(n),e-=S*Math.tan(n)}else if(e>i){let a=Math.atan2(e-i,t),n=(Math.PI/2-a)/2;i-=S*Math.tan(n),e-=S/Math.tan(n)}g[1]=(u.height-2*S)/this.bboxSize,e===i?(g[0]=3,g[2]=e/this.bboxSize*2):(g[0]=4,g[2]=e/this.bboxSize*2,g[3]=i/this.bboxSize*2),b=(Math.hypot(g[1],Math.max(Math.abs(g[2]),Math.abs(g[3])))+S/this.bboxSize*2)*Q.x+y}else if("TorusGeometry"===u?.type){if(g[0]=5,g[1]=(u.width-u.depth)/this.bboxSize,g[2]=u.depth/this.bboxSize,360!==u.arc){g[0]=6,g[3]=g[1],l[1152+4*v+3]=g[2];let t=2*Math.atan2(g[2]/2,g[1]),e=u.arc*Math.PI/180/2-t;g[1]=Math.sin(e),g[2]=Math.cos(e)}b=u.width*Q.x/this.bboxSize+y}else{let t=o.geometry;(m??(m=new Set)).add(t.uuid);let e=this._meshSdfBaked.get(t.uuid),i=K(t);if((void 0===e||e.posVersion!==i)&&this._meshSdfWanted.set(t.uuid,t),void 0===e)return;g[0]=7,g[1]=e.slot,g[2]=e.boxHalf.x/this.bboxSize*2,g[3]=e.boxHalf.y/this.bboxSize*2,l[1152+4*v+3]=e.boxHalf.z/this.bboxSize*2,b=Math.hypot(e.boxHalf.x,e.boxHalf.y,e.boxHalf.z)/this.bboxSize*2*Q.x+y}l.set(g,768+4*v),h=Math.max(h,b),p=Math.max(p,y),this._reach[v]=b,l[1152+4*v]=y,l[1152+4*v+1]=S/this.bboxSize*2,l[1152+4*v+2]=Q.x;let T,P,_=Array.isArray(o.material)?o.material[0]:o.material,z=_;if(z?.getShapeBlendBaseColor){let t=z.getShapeBlendBaseColor();T=t,P=t.a}else void 0!==_?.uniforms?.nodeU0?(T=_.uniforms.nodeU0.node.value,P=_.uniforms.nodeU1?.value??1):(T={r:1,g:1,b:1},P=1);0!==x.operation&&!x.useColor&&(P=-1),l[1536+4*v]=T.r,l[1536+4*v+1]=T.g,l[1536+4*v+2]=T.b,l[1536+4*v+3]=P,P<1&&1===this.material.defines?.SHAPEBLEND_C&&(this.material.transparent=!0),v++}),this._meshSdfBaked.size>0){let t=m??new Set;for(let e of this._meshSdfBaked.keys())t.has(e)||this._meshSdfBaked.delete(e)}this.npart=v,this._maxBlendK=p;let x=1.1*h+2/(this.spatialDivisions-1)+4/(this.resolution-1);this.spatialPassUniforms.span.value=x;let y=this._prevShapeData,g=u!==v,S=null===y||this._prevSpan!==x||g,b=S||H,T=this._fieldDirtyMin.set(1/0,1/0,1/0),P=this._fieldDirtyMax.set(-1/0,-1/0,-1/0);if(null!==y){let t=Math.max(v,u);for(let e=0;e<t;e++){let t=!1;for(let i=0;i<5;i++){let a=384*i+4*e;if(l[a]!==y[a]||l[a+1]!==y[a+1]||l[a+2]!==y[a+2]||l[a+3]!==y[a+3]){t=!0;break}}if(!t)continue;if(S=!0,b)break;let i=l[4*e],a=l[4*e+1],n=l[4*e+2],s=y[4*e],r=y[4*e+1],o=y[4*e+2],h=this._reach[e],p=this._prevReach[e];Number.isFinite(i+a+n+h)&&Number.isFinite(s+r+o+p)?(T.x=Math.min(T.x,i-h,s-p),T.y=Math.min(T.y,a-h,r-p),T.z=Math.min(T.z,n-h,o-p),P.x=Math.max(P.x,i+h,s+p),P.y=Math.max(P.y,a+h,r+p),P.z=Math.max(P.z,n+h,o+p)):b=!0}}return H&&(S=!0),this._fieldDirtyFull=b||T.x===1/0,S&&(null===y?this._prevShapeData=new Float32Array(l):y.set(l),this._prevReach.set(this._reach),this._prevSpan=x,n.needsUpdate=!0),S}function nt(t){return at.call(t)}export{k as a,E as b,M as c,F as d,I as e,V as f,B as g,A as h,W as i,K as j,j as k,nt as l};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./runtime-chunk-NTUTXO7Q.js";import{b as e}from"./runtime-chunk-MQKKQEK3.js";import{b as i,c as r,d as s,e as n}from"./runtime-chunk-VGEECQH4.js";import{E as a,b as h,k as o,o as l}from"./runtime-chunk-D3BWEUN6.js";import{a as d,b as u}from"./runtime-chunk-ML3Z74BL.js";var c,p,f,x=d((t,e)=>{function i(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}!function(t,e){function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i}(i,Error),i.buildMessage=function(t,e){var i,r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e,i="";for(e=0;e<t.parts.length;e++)i+=t.parts[e]instanceof Array?a(t.parts[e][0])+"-"+a(t.parts[e][1]):a(t.parts[e]);return"["+(t.inverted?"^":"")+i+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function s(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function a(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function h(t){return r[t.type](t)}return"Expected "+function(t){var e,i,r=new Array(t.length);for(e=0;e<t.length;e++)r[e]=h(t[e]);if(r.sort(),r.length>0){for(e=1,i=1;e<r.length;e++)r[e-1]!==r[e]&&(r[i]=r[e],i++);r.length=i}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+((i=e)?'"'+n(i)+'"':"end of input")+" found."},e.exports={SyntaxError:i,parse:function(t,e){e=void 0!==e?e:{};var r,s={},n={svg_path:xt},a=xt,h=function(t){if(!t)return[];for(var e=[],i=0;i<t.length;i++)e=e.concat.apply(e,t[i]);var r=e[0];return r&&"m"==r.code&&(delete r.relative,r.code="M"),e},o=function(t,e){return function(t,e){if(!e)return[t];for(var i=[t],r=0,s=e.length;r<s;r++)i[r+1]=e[r][1];return i}(t,e)},l=/^[Mm]/,d=ut(["M","m"],!1,!1),u=function(t,e,i){var r=jt(t,[e]);return i&&(r=r.concat(jt("M"==t?"L":"l",i[1]))),r},c=/^[Zz]/,p=ut(["Z","z"],!1,!1),f=function(){return jt("Z")},x=/^[Ll]/,g=ut(["L","l"],!1,!1),m=function(t,e){return jt(t,e)},y=/^[Hh]/,v=ut(["H","h"],!1,!1),w=function(t,e){return jt(t,e.map(function(t){return{x:t}}))},_=/^[Vv]/,S=ut(["V","v"],!1,!1),B=function(t,e){return jt(t,e.map(function(t){return{y:t}}))},b=/^[Cc]/,M=ut(["C","c"],!1,!1),C=function(t,e,i){return{x1:t.x,y1:t.y,x2:e.x,y2:e.y,x:i.x,y:i.y}},k=/^[Ss]/,A=ut(["S","s"],!1,!1),T=function(t,e){return{x2:t.x,y2:t.y,x:e.x,y:e.y}},P=/^[Qq]/,z=ut(["Q","q"],!1,!1),R=function(t,e){return{x1:t.x,y1:t.y,x:e.x,y:e.y}},E=/^[Tt]/,O=ut(["T","t"],!1,!1),H=/^[Aa]/,L=ut(["A","a"],!1,!1),F=function(t,e,i,r,s,n){return{rx:t,ry:e,xAxisRotation:i,largeArc:r,sweep:s,x:n.x,y:n.y}},U=function(t,e){return{x:t,y:e}},N=function(t){return 1*t},j=function(t){return 1*t.join("")},I=/^[01]/,D=ut(["0","1"],!1,!1),W=function(t){return"1"==t},V=function(){return""},X=",",q=dt(",",!1),Y=function(t){return t.join("")},$=".",G=dt(".",!1),Q=/^[eE]/,K=ut(["e","E"],!1,!1),Z=/^[+\-]/,J=ut(["+","-"],!1,!1),tt=/^[0-9]/,et=ut([["0","9"]],!1,!1),it=function(t){return t.join("")},rt=/^[ \t\n\r]/,st=ut([" ","\t","\n","\r"],!1,!1),nt=0,at=[{line:1,column:1}],ht=0,ot=[],lt=0;if("startRule"in e){if(!(e.startRule in n))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=n[e.startRule]}function dt(t,e){return{type:"literal",text:t,ignoreCase:e}}function ut(t,e,i){return{type:"class",parts:t,inverted:e,ignoreCase:i}}function ct(e){var i,r=at[e];if(r)return r;for(i=e-1;!at[i];)i--;for(r={line:(r=at[i]).line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return at[e]=r,r}function pt(t,e){var i=ct(t),r=ct(e);return{start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:r.line,column:r.column}}}function ft(t){nt<ht||(nt>ht&&(ht=nt,ot=[]),ot.push(t))}function xt(){var t,e,i,r,n;for(t=nt,e=[],i=Ot();i!==s;)e.push(i),i=Ot();if(e!==s)if(i=function(){var t,e,i,r,n,a;if(t=nt,(e=gt())!==s){for(i=[],r=nt,n=[],a=Ot();a!==s;)n.push(a),a=Ot();for(n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;){for(i.push(r),r=nt,n=[],a=Ot();a!==s;)n.push(a),a=Ot();n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s)}i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),i===s&&(i=null),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?t=e=h(i):(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;return t}function gt(){var e,i,r,n,a,h;if(e=nt,i=function(){var e,i,r,n,a,h,o;if(e=nt,l.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(d)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=bt())!==s?(a=nt,(h=At())===s&&(h=null),h!==s&&(o=yt())!==s?a=h=[h,o]:(nt=a,a=s),a===s&&(a=null),a!==s?e=i=u(i,n,a):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}(),i!==s){for(r=[],n=nt,a=[],h=Ot();h!==s;)a.push(h),h=Ot();for(a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s);n!==s;){for(r.push(n),n=nt,a=[],h=Ot();h!==s;)a.push(h),h=Ot();a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s)}r!==s?e=i=o(i,r):(nt=e,e=s)}else nt=e,e=s;return e}function mt(){var e,i;return c.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(p)),i!==s&&(i=f()),(e=i)===s&&(e=function(){var e,i,r,n;if(e=nt,x.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(g)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=yt())!==s?e=i=m(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,y.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(v)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=vt())!==s?e=i=w(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,_.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(S)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=vt())!==s?e=i=B(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,b.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(M)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=wt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,k.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(A)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=_t())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,P.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(z)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=St())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,E.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(O)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,H.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(L)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=Bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}()),e}function yt(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function vt(){var t,e,i,r,n,a;if(t=nt,(e=Ct())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function wt(){var t,e,i,r,n,a;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?((n=At())===s&&(n=null),n!==s&&(a=bt())!==s?t=e=C(e,r,a):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function _t(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=T(e,r):(nt=t,t=s)):(nt=t,t=s),t}function St(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=R(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Bt(){var t,e,i,r,n,a,h,o,l,d,u;return t=nt,(e=Mt())!==s?((i=At())===s&&(i=null),i!==s&&(r=Mt())!==s?((n=At())===s&&(n=null),n!==s&&(a=Ct())!==s&&At()!==s&&(h=kt())!==s?((o=At())===s&&(o=null),o!==s&&(l=kt())!==s?((d=At())===s&&(d=null),d!==s&&(u=bt())!==s?t=e=F(e,r,a,h,l,u):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function bt(){var t,e,i,r;return t=nt,(e=Ct())!==s?((i=At())===s&&(i=null),i!==s&&(r=Ct())!==s?t=e=U(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Mt(){var t;return(t=Pt())===s&&(t=Et()),t!==s&&(t=N(t)),t}function Ct(){var t,e,i;return t=nt,(e=Rt())===s&&(e=null),e!==s&&(i=Pt())!==s?t=e=[e,i]:(nt=t,t=s),t===s&&(t=nt,(e=Rt())===s&&(e=null),e!==s&&(i=Et())!==s?t=e=[e,i]:(nt=t,t=s)),t!==s&&(t=j(t)),t}function kt(){var e;return I.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(D)),e!==s&&(e=W(e)),e}function At(){var t,e,i,r,n;if(t=nt,e=[],(i=Ot())!==s)for(;i!==s;)e.push(i),i=Ot();else e=s;if(e!==s)if((i=Tt())===s&&(i=null),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?t=e=[e,i,r]:(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;if(t===s){if(t=nt,e=nt,(i=Tt())!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?e=i=[i,r]:(nt=e,e=s)}else nt=e,e=s;e!==s&&(e=V()),t=e}return t}function Tt(){var e;return 44===t.charCodeAt(nt)?(e=X,nt++):(e=s,0===lt&&ft(q)),e}function Pt(){var e,i,r;return e=nt,i=function(){var e,i,r,n;return e=nt,(i=Et())===s&&(i=null),i!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s&&(n=Et())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Et())!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s)),e!==s&&(e=Y(e)),e}(),i!==s?((r=zt())===s&&(r=null),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Et())!==s&&(r=zt())!==s?e=i=[i,r]:(nt=e,e=s)),e!==s&&(e=Y(e)),e}function zt(){var e,i,r,n;return e=nt,Q.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(K)),i!==s?((r=Rt())===s&&(r=null),r!==s&&(n=Et())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e!==s&&(e=Y(e)),e}function Rt(){var e;return Z.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(J)),e}function Et(){var e,i;if(e=[],tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et)),i!==s)for(;i!==s;)e.push(i),tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et));else e=s;return e!==s&&(e=it(e)),e}function Ot(){var e;return rt.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(st)),e!==s&&(e=V()),e}var Ht,Lt,Ft,Ut={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Nt in Ut)Ut[Nt.toUpperCase()]=Ut[Nt];function jt(t,e){e||(e=[{}]);for(var i=e.length;i--;){var r={code:t,command:Ut[t]};for(var s in t==t.toLowerCase()&&(r.relative=!0),e[i])r[s]=e[i][s];e[i]=r}return e}if((r=a())!==s&&nt===t.length)return r;throw r!==s&&nt<t.length&&ft({type:"end"}),Ht=ot,Lt=ht<t.length?t.charAt(ht):null,Ft=ht<t.length?pt(ht,ht+1):pt(ht,ht),new i(i.buildMessage(Ht,Lt),Ht,Lt,Ft)}}}),g=d((t,e)=>{var i=x().parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,i={x:0,y:0},r={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach(function(t){for(var s in"moveto"===t.command&&(e=t),t.x0=i.x,t.y0=i.y,r)s in t&&(t[s]+=t.relative?t[r[s]]:0);"x"in t||(t.x=i.x),"y"in t||(t.y=i.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),i=t}),t},e.exports=i});function m(){if(!p){if(!c)return Promise.reject(new Error("HanaRenderer: no Hana UI loader registered. Call setHanaUILoader() from the host app before initializing a HanaRenderer."));(p=c()).catch(()=>{p=void 0})}return p}function y(t){f=t}function v(){return c||(c=async()=>async function(t,e){return await t.default(e?{module_or_path:e}:void 0),Object.getOwnPropertyDescriptor(t.Engine.prototype,"scene")||Object.defineProperty(t.Engine.prototype,"scene",{get:function(){let e=Object.create(t.SceneController.prototype);return e.__wbg_ptr=this.__wbg_ptr,e}}),{createEngine:e=>t.Engine.create(e,JSON.parse('{"schema":13,"scenes":[{"fi":0,"id":"32603ebf4-bd9a-54ba-c1e9-6645c3ee7a53","data":{"name":"Page","backgroundColor":[0,0,0,0],"objects":[]}}],"assets":{"images":{},"videos":{},"colors":{},"audios":{},"numbers":{},"booleans":{},"strings":{},"dynamicVariables":{"counters":{},"randoms":{},"timers":{},"times":{}},"fonts":{},"animations":{},"geometries":{},"emojiArt":{}},"publish":{"logo":true,"presentationSizing":"Contain","allowPageScroll":true,"showBackground":true},"framePublish":{},"components":{}}'),!0)}}(await import("./hana-ui.js"),f??function(){let t=typeof process<"u"?"2.0.11":void 0;return`https://cdn.spline.design/@splinetool/runtime${t?`@${t}`:""}/build/hana-ui.wasm`}())),m().then(()=>{})}var w=Math.PI/180;Math.PI;var _,S=1e-10;function B(t,e){let[[i,r],[s,n]]=t,[[a,h],[o,l]]=e,d=(i-s)*(h-l)-(r-n)*(a-o);if(0===d)return!1;let u=((i-a)*(h-l)-(r-h)*(a-o))/d,c=-((i-s)*(r-h)-(r-n)*(i-a))/d;return u>=0&&u<=1&&c>=0&&c<=1}(t=>{function e(t){return[t[0],t[3],t[1],t[4],t[2],t[5]]}t.identity=function(){return[1,0,0,0,1,0,0,0,1]},t.copy=function(e,i=t.identity()){for(let t=0,r=e.length;t<r;t++)i[t]=e[t];return i},t.create=function(e,i,r,s,n,a){return t.setAbcdef(t.identity(),e,i,r,s,n,a)},t.setAbcdef=function(t,e,i,r,s,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t},t.append=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=d*s+u*a,m=d*n+u*h,y=c*s+p*a,v=c*n+p*h,w=f*s+x*a+o,_=f*n+x*h+l;return t.create(g,m,y,v,w,_)},t.prepend=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=s,m=n,y=a,v=h;(1!==d||0!==u||0!==c||1!==p)&&(g=s*d+n*c,m=s*u+n*p,y=a*d+h*c,v=a*u+h*p);let w=o*d+l*c+f,_=o*u+l*p+x;return t.create(g,m,y,v,w,_)},t.getAbcdef=e,t.invert=function(e){let[i,r,s,n,a,h]=t.getAbcdef(e),o=i*n-r*s,l=n/o,d=-r/o,u=-s/o,c=i/o,p=(s*h-n*a)/o,f=-(i*h-r*a)/o;return t.create(l,d,u,c,p,f)},t.apply=function([e,i],r){let[s,n,a,h,o,l]=t.getAbcdef(r);return[s*e+a*i+o,n*e+h*i+l]},t.applyInverse=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(i),l=1/(r*a+n*-s),[d,u]=e;return[a*l*d+-n*l*u+(o*n-h*a)*l,r*l*u+-s*l*d+(-o*r+h*s)*l]},t.scale=function(e,i,r=i){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s*i,n*r,a*i,h*r,o*i,l*r),e},t.rotate=function(e,i){let r=Math.cos(i),s=Math.sin(i),[n,a,h,o,l,d]=t.getAbcdef(e);return t.setAbcdef(e,n*r-a*s,n*s+a*r,h*r-o*s,h*s+o*r,l*r-d*s,l*s+d*r),e},t.rotateAround=function(e,i,r){let[s,n]=r,a=t.translate(e,-s,-n);return a=t.rotate(a,i),a=t.translate(a,s,n),a},t.translate=function(e,i,r){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,o+i,l+r),e},t.setTranslate=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.setPosition=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.getScale=function(e){let[i,r,s,n]=t.getAbcdef(e);return[Math.sqrt(i*i+r*r),Math.sqrt(s*s+n*n)]},t.getPosition=function(e){let[,,,,i,r]=t.getAbcdef(e);return[i,r]},t.getRotation=function(e,i){return t.decompose(e,i).rotation},t.decompose=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(e),{rotation:l,scale:d,shear:u}=function(t){let e=t[0][0],i=t[1][0],r=t[0][1],s=t[1][1],n=Math.sqrt(e*e+i*i),a=n>S?e/n:1,h=n>S?i/n:0,o=a*e+h*i,l=a*s-h*r,d=a*r+h*s;return{rotation:Math.atan2(h,a),scale:[o,l],shear:[Math.abs(l)>S?d/l:0,0]}}([[r,n],[s,a]]);return{position:[h+(i[0]*r+i[1]*n)-i[0],o+(i[0]*s+i[1]*a)-i[1]],scale:d,rotation:l,shear:u,pivot:i}},t.compose=function(e,i,r,s,n=[0,0]){let[a,h]=e,[o,l]=s,[d,u,c,p]=function({rotation:t,scale:e,shear:i}){let r=Math.cos(t),s=Math.sin(t),n=i[0]*e[1],a=i[1]*e[0];return[r*e[0]-s*a,s*e[0]+r*a,r*n-s*e[1],s*n+r*e[1]]}({rotation:r,scale:i,shear:n}),f=a-(o*d+l*c)+o,x=h-(o*u+l*p)+l;return t.create(d,u,c,p,f,x)}})(_||(_={}));var b,M,C,k,A,T=[[-1,1],[-1,-1],[1,-1],[1,1]],P=(t,e,i)=>{let r=t.getCenter(),s=t.getHalfSize(),n=_.append(e,t.worldMatrix);0===s[0]&&0===s[1]?i.push(_.apply(r,n)):T.forEach(t=>{let e=[t[0]*s[0]+r[0],t[1]*s[1]+r[1]];i.push(_.apply(e,n))})},z=class{constructor(){this.matrix=_.identity(),this.min=[1/0,1/0],this.max=[-1/0,-1/0],this.vertices=[],this.edges=[]}setFromObjectSize(t,e=!1){t.updateWorldMatrix(),this.makeEmpty(),_.copy(t.worldMatrix,this.matrix);let i=_.invert(t.worldMatrix);this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[],s=!0===t.isBaseGroup?t:void 0;!0===i&&void 0!==s?s.traverse(t=>{t.visible&&P(t,e,r)}):P(t,e,r),this.setFromPoints(r)}setFromSize(t,e,i){this.makeEmpty(),_.copy(i,this.matrix),this.expandBySize(t,e,i)}expandBySize(t,e,i){[_.apply([0,0],i),_.apply([0,e],i),_.apply([t,e],i),_.apply([t,0],i)].forEach(t=>this.expandByPoint(t))}getCenter(){let[t,e]=this.min,[i,r]=this.getHalfSize();return _.apply([t+i,e+r],this.matrix)}getSize(){return[this.max[0]-this.min[0],this.max[1]-this.min[1]]}getHalfSize(){return[.5*(this.max[0]-this.min[0]),.5*(this.max[1]-this.min[1])]}makeEmpty(){this.min=[1/0,1/0],this.max=[-1/0,-1/0]}setFromPoints(t){this.makeEmpty();for(let e of t)this.expandByPoint(e)}expandByPoint(t){this.min=[Math.min(this.min[0],t[0]),Math.min(this.min[1],t[1])],this.max=[Math.max(this.max[0],t[0]),Math.max(this.max[1],t[1])]}computeVertices(){let[t,e]=this.getHalfSize(),i=this.getCenter(),[r,s,n,a]=_.getAbcdef(this.matrix),h=_.create(r,s,n,a,i[0],i[1]);this.vertices=T.map(([i,r])=>_.apply([i*t,r*e],h))}computeEdges(){this.edges=[];for(let t=0,e=this.vertices.length;t<e;++t)this.edges.push([this.vertices[t],this.vertices[(t+1)%e]])}project(t,e){let i=this.matrix;return e&&(i=_.append(e.worldMatrix,i)),_.applyInverse(t,i)}intersects(t,e,i){return this.intersectsInLocalSpace(...this.project([t,e],i))}intersectsInLocalSpace(t,e){let{min:i,max:r}=this;return t>=i[0]&&t<=r[0]&&e>=i[1]&&e<=r[1]}containsPoint(t){let[e,i]=t,[r,s]=this.min,[n,a]=this.max;return e>=r&&e<=n&&i>=s&&i<=a}intersectsBBox2D(t){for(let e=0,i=this.edges.length;e<i;e++){let i=this.edges[e];for(let e=0,r=t.edges.length;e<r;e++)if(B(i,t.edges[e]))return!0}for(let e=0,i=t.vertices.length;e<i;e++){let i=t.vertices[e];if(this.containsPoint(i))return!0}return!1}ensureMinMax(){let t=this.min,e=this.max;this.min=[Math.min(t[0],e[0]),Math.min(t[1],e[1])],this.max=[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}copy(t){this.min=[...t.min],this.max=[...t.max],_.copy(t.matrix,this.matrix),this.computeVertices(),this.computeEdges()}clone(){let t=new z;return t.copy(this),t}},R=class{constructor(e,i,r){this.uuid=e,this.data=i,this.isObject2D=!0,this.localMatrix=_.identity(),this.worldMatrix=_.identity(),this.ignoreCameraZoom=!1,this.visible=!0,this._singleBBox=new z,this._recursiveBBox=new z,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.stateSelection=null,this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this.name="",this.position=[0,0],this.scale=[1,1],this.rotation=0,this.shear=[0,0],this.emitter=t(),this.dpr=r.dpr??1,this.dataPatched=i}project(t,e){let i=this.worldMatrix;return e&&(i=_.append(e.worldMatrix,i)),_.applyInverse(t,i)}intersects(t,e,i,r=!1){return this.visible&&!this.data.raycastLock&&this.intersectsInLocalSpace(...this.project([t,e],i),r)}intersectsInLocalSpace(t,e,i=!1){let{min:r,max:s}=i?this.recursiveBBox:this.singleBBox;return t>=r[0]&&t<=s[0]&&e>=r[1]&&e<=s[1]}applyTransforms(t){t.setTransform(this.worldMatrix,this.ignoreCameraZoom)}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges()),this._recursiveBBox}updateLocalMatrix(){this.localMatrix=_.compose(this.position,this.scale,this.rotation*w,n.getPivot(this.dataPatched),this.shear)}updateWorldMatrix(t,e,i){let r=this.parent;e&&null!=r&&r.updateWorldMatrix(t,!0,!1),t&&this.updateLocalMatrix(),this.parent?this.worldMatrix=_.append(this.parent.worldMatrix,this.localMatrix):this.worldMatrix=_.copy(this.localMatrix),this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}get pivot(){return n.getPivot(this.data)}getCenter(){return[0,0]}getHalfSize(){return[0,0]}get id(){return this.uuid}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{t.resetBBoxNeedsUpdateSelf()})}updateTransformState(t){let e=!1;void 0!==t.position&&(e=!0,this.position=t.position),void 0!==t.rotation&&(e=!0,this.rotation=t.rotation),void 0!==t.scale&&(e=!0,this.scale=t.scale),void 0!==t.shear&&(e=!0,this.shear=t.shear),e&&(this.updateWorldMatrix(!0,!1,!0),this.resetBBoxNeedsUpdate())}updateByOp(t,r,s){0===t.type&&void 0!==t.props.visible&&(this.visible=t.props.visible),this.data=r,this.data=r;let n=t,a=e(t.path,["states","*"]);if(null!==a){if(0===t.type){let[e]=a;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=l.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}n={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}let i=l.removeOverridden(t.path,t.props,e);n={...t,props:i}}}this.updateByPatchedOpBase(n,i.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),s)}changeSelectedState(t,e,r=!1){if(0!==this.data.states.length||r){for(let t of this.data.states)i.toOps(this.data,t.data).forEach(t=>{let i=o.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let r=this.data.states.data(t);r&&(this.dataPatched=i.patch(this.data,r),i.toOps(this.data,r).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}r&&this.updateTransformState(this.dataPatched),this.stateSelection=t}}updateState(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.visible&&(this.visible=t.visible),this.updateTransformState(t)}updateByPatchedOpBase(t,e,i){this.dataPatched=e,this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){0===t.path.length&&0===t.type&&this.updateState(t.props,i),this.requestRender()}traverseFrameAncestors(t){this.traverseAncestors(e=>{"frame2d"===e.data.type&&t(e)})}traverseAncestors(t){let e=this.parent;for(;e;)t(e),e=e.parent}requestRender(){this.traverseFrameAncestors(t=>{t.requestRender()})}clone(t){let e=new R(this.uuid,this.data,t);return e.parent=void 0,e}addEventListener(t,e){this.emitter.on(t,e)}removeEventListener(t,e){this.emitter.off(t,e)}dispatchEvent(t){this.emitter.emit(t.type,{...t,target:t.target??this})}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children;if(e){let i=e.indexOf(this)+1;return e[i]?e[i]:t.traverseSortNextHelper()}}}sortNext(){let t=this.children;return t&&t.length>0&&t[0]?t[0]:this.traverseSortNextHelper()}isDescendantOf(t){t instanceof R&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}},E=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.blurRadius=0,this.offset=[0,0],this.spread=0,this.update(e)}update(t){void 0!==t.color&&(this.color=t.color),void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.blurRadius&&(this.blurRadius=t.blurRadius),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.spread&&(this.spread=t.spread)}},O=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.radius=0,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.radius&&(this.radius=t.radius)}},H=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color)}},L=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.thickness=0,this.mode="inside",this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.mode&&(this.mode=t.mode)}},F=class extends R{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.autoClose=!0,this.fill=new H(t+"-fill",e.fill,i),this.stroke=new L(t+"-stroke",e.stroke,i),this.dropShadow=new E(t+"-dropShadow",e.dropShadow,i),this.innerShadow=new E(t+"-innerShadow",e.innerShadow,i),this.backgroundBlur=new O(t+"-backgroundBlur",e.backgroundBlur,i),this.layerBlur=new O(t+"-layerBlur",e.layerBlur,i)}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:a.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:a.transparent,t.strokeMode=this.stroke.mode,t.lineWidth=this.stroke.thickness}applyFilters(t){this.layerBlur.enabled?t.layerBlur=5*this.layerBlur.radius:t.layerBlur=0,this.backgroundBlur.enabled?t.backgroundBlur=5*this.backgroundBlur.radius:t.backgroundBlur=0,this.dropShadow.enabled?(t.dropShadowBlur=5*this.dropShadow.blurRadius,t.dropShadowColor=this.dropShadow.color,t.dropShadowOffsetX=this.dropShadow.offset[0],t.dropShadowOffsetY=this.dropShadow.offset[1]):t.dropShadowColor=a.transparent,this.innerShadow.enabled?(t.innerShadowSpread=this.innerShadow.spread,t.innerShadowBlur=5*this.innerShadow.blurRadius,t.innerShadowColor=this.innerShadow.color,t.innerShadowOffsetX=this.innerShadow.offset[0],t.innerShadowOffsetY=this.innerShadow.offset[1]):t.innerShadowColor=a.transparent}innerDraw(t){}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.applyFilters(t),this.applyFillStroke(t),t.beginPath(),this.innerDraw(t),this.autoClose&&t.closePath(),this.fill.enabled&&t.fill(),this.stroke.enabled&&t.stroke(),t.restore())}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}updateState(t,e){super.updateState(t,e),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur)}clone(t){let e=new F(this.uuid,this.data,t);return e.parent=void 0,e}},U=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.updateState(e,i)}innerDraw(t){t.ellipse(.5*this.width,.5*this.height,.5*this.width,.5*this.height,0,0,2*Math.PI)}intersectsInLocalSpace(t,e){return function(t,e,i,r,s,n){let a=t-i,h=e-r;return a*a/(s*s)+h*h/(n*n)<=1}(t,e,.5*this.width,.5*this.height,.5*this.width,.5*this.height)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t)}clone(t){let e=new U(this.uuid,this.data,t);return e.parent=void 0,e}},N=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.cornerRadius=[0,0,0,0],this.updateState(e,i)}innerDraw(t){t.rect(0,0,this.width,this.height,...this.cornerRadius)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t)}clone(t){let e=new N(this.uuid,this.data,t);return e.parent=void 0,e}},j=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._textHeight=0,this._textHeightDirty=!0,this.width=0,this.height=0,this.updateState(e,i)}get textHeight(){return this._textHeight}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:a.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:a.transparent,t.strokeMode="center",t.lineWidth=this.stroke.thickness}innerDraw(t){this._fontHolder?.arrayBuffer&&this._fontHolder.arrayBuffer.byteLength>1&&this.data.font&&t.registerFont(this._fontHolder.arrayBuffer,this.data.font);let e=this.data.textTransform,i=this.data.text.textValue.toString(),r=2===e?i.toUpperCase():3===e?i.toLowerCase():i,{height:s}=t.drawText(r,{x:0,y:0,width:this.width,height:this.height,fontSize:this.data.fontSize,lineHeight:this.data.lineHeight??1,letterSpacing:this.data.letterSpacing??0,horizontalAlign:this.data.horizontalAlign,verticalAlign:this.data.verticalAlign,font:this.data.font});this._textHeight=s}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateFontState(t,{shared:e}){void 0!==t.font&&(this._fontHolder=e.getFont(t.font),this._fontHolder&&!this._fontHolder.isLoaded&&this._fontHolder.loadingPromise.then(()=>{this.requestRender()}))}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateFontState(t,e)}clone(t){let e=new j(this.uuid,this.data,t);return e.parent=void 0,e}},I=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.curves=[],this.extremasBBox={min:[0,0],max:[0,0]},this.updateState(e,i)}computeExtremas(){0===this.curves.length&&this.computeCurves();let t=this.curves.map(t=>b.extremas(t)),e=[1/0,1/0],i=[-1/0,-1/0];for(let r=0,s=t.length;r<s;r++){let s=t[r];s[0][0]<e[0]&&(e[0]=s[0][0]),s[0][1]<e[1]&&(e[1]=s[0][1]),s[1][0]>i[0]&&(i[0]=s[1][0]),s[1][1]>i[1]&&(i[1]=s[1][1])}return this.extremasBBox.min=[e[0],e[1]],this.extremasBBox.max=[i[0],i[1]],this.extremasBBox}computeCurves(){this.curves=[];for(let t=1,e=this.data.points.length;t<e;t++){let e=this.data.points[t].data,i=this.data.points[t-1].data,r={start:i.position,cp1:i.controlNext.position,cp2:e.controlPrevious.position,end:e.position};this.curves.push(r)}let t=this.data.points[0].data,e=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let i={start:e.position,cp1:e.controlNext.position,cp2:t.controlPrevious.position,end:t.position};this.curves.push(i)}}getCenter(){let[t,e]=this.extremasBBox.min,[i,r]=this.getHalfSize();return[t+i,e+r]}getHalfSize(){let{min:t,max:e}=this.extremasBBox;return[.5*(e[0]-t[0]),.5*(e[1]-t[1])]}innerDraw(t){for(let e=0,i=this.data.points.length;e<i;e++){let i=this.data.points[e].data;if(0===e){let[e,r]=i.position;t.moveTo(e,r)}else{let r=this.data.points[e-1].data,[s,n]=r.controlNext.position,[a,h]=i.controlPrevious.position,[o,l]=i.position,d={start:r.position,cp1:r.controlNext.position,cp2:i.controlPrevious.position,end:i.position};b.derive(d),t.bezierCurveTo(s,n,a,h,o,l)}}let e=this.data.points[0].data,i=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let[r,s]=i.controlNext.position,[n,a]=e.controlPrevious.position,[h,o]=e.position;t.bezierCurveTo(r,s,n,a,h,o)}}updateState(t,e){super.updateState(t,e),this.computeExtremas()}clone(t){let e=new I(this.uuid,this.data,t);return e.parent=void 0,e}};(t=>{function e(t,e,i,r=!1){let s=t-2*e+i;if(0!==s){let r=-Math.sqrt(Math.abs(e*e-t*i)),n=-t+e;return[-(r+n)/s,-(-r+n)/s]}return e!==i&&0===s?[(2*e-i)/(2*(e-i))]:[]}t.derive=function(t){let e=t.start,i=t.cp1,r=t.cp2,s=t.end,n={start:[3*(i[0]-e[0]),3*(i[1]-e[1])],cp:[3*(r[0]-i[0]),3*(r[1]-i[1])],end:[3*(s[0]-r[0]),3*(s[1]-r[1])]};return t.derivative=n,n.derivative=M.derive(n),n},t.droot=function(i){let r=i.derivative??t.derive(i),s=r.start,n=r.cp,a=r.end;return[e(s[0],n[0],a[0]),e(s[1],n[1],a[1])]},t.extremas=function(e){let[i,r]=t.droot(e),s=[e.start[0],e.end[0]],n=[e.start[1],e.end[1]];for(let r of i)s.push(t.compute(e,Math.min(1,Math.max(0,r)))[0]);for(let i of r)n.push(t.compute(e,Math.min(1,Math.max(0,i)))[1]);return s.sort((t,e)=>t-e),n.sort((t,e)=>t-e),[[s[0],n[0]],[s[s.length-1],n[n.length-1]]]},t.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=e*e,n=r*i,a=r*e*3,h=i*s*3,o=e*s;return[n*t.start[0]+a*t.cp1[0]+h*t.cp2[0]+o*t.end[0],n*t.start[1]+a*t.cp1[1]+h*t.cp2[1]+o*t.end[1]]}})(b||(b={})),(C=M||(M={})).derive=function(t){let e=t.start,i=t.cp,r=t.end,s={start:[2*(i[0]-e[0]),2*(i[1]-e[1])],end:[2*(r[0]-i[0]),2*(r[1]-i[1])]};return s.derivative=k.derive(s),t.derivative=s,s},C.droot=function(t){let e=t.derivative??C.derive(t),i=e.start,r=e.end;return[i[0]!==r[0]?i[0]/(i[0]-r[0]):0,i[1]!==r[1]?i[1]/(i[1]-r[1]):0]},C.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=i*e*2,n=e*e;return[r*t.start[0]+s*t.cp[0]+n*t.end[0],r*t.start[1]+s*t.cp[1]+n*t.end[1]]},(A=k||(k={})).derive=function(t){let e=t.start,i=t.end,r=[i[0]-e[0],i[1]-e[1]];return t.derivative=r,t.derivative},A.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=t.start,r=t.end;return[i[0]+(r[0]-i[0])*e,i[1]+(r[1]-i[1])*e]};var D=class extends R{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.context=i,this.isBaseGroup=!0,this.children=[]}add(t){t.parent&&t.parent instanceof D&&t.parent.remove(t),this.children.push(t),t.parent=this}remove(t){let e=this.children.indexOf(t);e>=0&&(this.children.splice(e,1),t.parent=void 0)}traverse(t){let e=t(this);if(!0!==e)for(let i of this.children)i instanceof D?i.traverse(t):e=t(i)}intersectsChildrenHelper(t,e,i,r,s){for(let n of this.children)if(n.intersects(t,e,i,!1)&&(s.push(n),r)||n instanceof D&&n.intersectsChildrenHelper(t,e,i,r,s))return!0;return!1}intersectsChildren(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelper(t,e,i,r,s),s}intersectsChildrenHelperReverse(t,e,i,r,s){for(let n of this.children)if(n instanceof D&&n.intersectsChildrenHelperReverse(t,e,i,r,s)||n.intersects(t,e,i,!1)&&(s.push(n),r))return!0;return!1}intersectsChildrenReverse(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelperReverse(t,e,i,r,s),s}updateWorldMatrix(t,e,i){if(super.updateWorldMatrix(t,e,i),i&&this.children)for(let e of this.children)e.updateWorldMatrix(t,!1,!0)}find(t){let e;return this.traverse(i=>{i.uuid===t&&(e=i)}),e}innerDrawChildren(t){for(let e=this.children.length-1;e>=0;e--)this.children[e].draw(t)}resetBBoxNeedsUpdate(){super.resetBBoxNeedsUpdate(),this.traverse(t=>{t.resetBBoxNeedsUpdateSelf()})}clone(t){let e=new D(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},W=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.updateState(e,i)}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.innerDrawChildren(t),t.restore())}clone(t){let e=new W(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},V=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.width=0,this.height=0,this.clipped=!0,this.background=new N(t+"-background",r.defaultData,i),this.background.parent=this,this.updateState(e,i)}get fill(){return this.background.fill}get stroke(){return this.background.stroke}get backgroundBlur(){return this.background.backgroundBlur}get layerBlur(){return this.background.layerBlur}get dropShadow(){return this.background.dropShadow}get innerShadow(){return this.background.innerShadow}get cornerRadius(){return this.background.cornerRadius}set cornerRadius(t){this.background.cornerRadius=t}updateLocalMatrix(){super.updateLocalMatrix(),this.background?.updateLocalMatrix()}updateWorldMatrix(t,e,i){super.updateWorldMatrix(t,e,i),this.background?.updateWorldMatrix(t,e,i)}draw(t){if(!this.visible)return;t.save();let e=this.width,i=this.height;this.applyTransforms(t),this.background.width=e,this.background.height=i,this.background.draw(t),this.clipped&&t.clipRect(0,0,e,i,...this.cornerRadius),this.innerDrawChildren(t),t.restore()}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur),void 0!==t.clipped&&(this.clipped=t.clipped)}requestRender(){super.requestRender(),this.dispatchEvent({type:"render"})}dispose(){this.removeEventListener("render")}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}clone(t){let e=new V(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},X=u(g(),1),q=new Map,Y=null,$=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._pathBBox=new DOMRect,this.path="",this.updateState(e,i),this.autoClose=!1,this.computeSVGBBox()}computeSVGBBox(){let t=this.path;G(this.path)&&(console.warn("Invalid SVG path",this.uuid),t=""),this._pathBBox=function(t){let e=q.get(t);if(void 0!==e)return e;if(null===Y||!Y.isConnected){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none",Y=document.createElementNS("http://www.w3.org/2000/svg","path"),t.appendChild(Y),document.body.appendChild(t)}Y.setAttribute("d",t);let i=Y.getBBox();return q.size>=4096&&q.clear(),q.set(t,i),i}(t)}innerDraw(t){t.path(this.path)}intersectsInLocalSpace(t,e){return t>=this._pathBBox.x&&t<=this._pathBBox.x+this._pathBBox.width&&e>=this._pathBBox.y&&e<=this._pathBBox.y+this._pathBBox.height}getCenter(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}getHalfSize(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}updateState(t,e){super.updateState(t,e),void 0!==t.path&&(this.path=t.path,this.computeSVGBBox())}clone(t){let e=new $(this.uuid,this.data,t);return e.parent=void 0,e}};function G(t){return/NaN/.test(t)}function Q(t,e=1,i=1){if(e<=0||i<=0)return t;if(G(t))return console.warn("Cannot scale invalid path",t),K([]);if(1===e&&1===i)return t;try{return K((0,X.parseSVG)(t).map(t=>{let r={...t};return"x"in r&&(r.x=r.x*e),"y"in r&&(r.y=r.y*i),"x1"in r&&(r.x1=r.x1*e),"x2"in r&&(r.x2=r.x2*e),"y1"in r&&(r.y1=r.y1*i),"y2"in r&&(r.y2=r.y2*i),"rx"in r&&(r.rx=r.rx*e),"ry"in r&&(r.ry=r.ry*i),r}))}catch(t){return console.warn("Error parsing SVG path",t),K([])}}function K(t){let e,i=["rx","ry","xAxisRotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(t=>{let r=[];i.forEach(e=>{if(e in t){let i=1*t[e];r.length&&i>=0&&r.push(","),r.push(i)}});let s=(e===t.code?r[0]<0?"":",":t.code)+r.join("");return e=t.code,s}).join("")}var Z=class{constructor(t,e,i){this.uuid=t,this.data=e,this.group=new W(Z.GROUP_ID,{...s.defaultData},i),this.createChildrenObjects(e.objects,this.group,i)}createObject(t,e,i,r,s,n){let a=function(t,e,i){switch(e.type){case"ellipse2d":return new U(t,e,i);case"rectangle2d":return new N(t,e,i);case"text2d":return new j(t,e,i);case"vector2d":return new I(t,e,i);case"path2d":return new $(t,e,i);case"frame2d":return new V(t,e,i);default:return new W(t,e,i)}}(t,e,n);a&&(r.add(a),r.children.splice(s,0,r.children.pop()),a.updateWorldMatrix(),i.length>0&&(a instanceof W||a instanceof V)&&this.createChildrenObjects(i,a,n))}createChildrenObjects(t,e,i){let r=0;for(let s of t)this.createObject(s.id,s.data,s.children,e,r,i),r+=1}draw(t){this.group.draw(t)}updateEntityByOp(t,e,i,r){let s=this.find(t);if(s)try{s.updateByOp(e,i,{shared:r})}catch(t){console.error(t)}}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let i=null===t.parent?this.group:this.find(t.parent);void 0!==i&&i instanceof D&&(this.createObject(t.id,t.data,t.children,i,t.localIndex,e),i.requestRender())}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0!==e&&void 0!==e.parent&&e.parent instanceof D){let t=e.parent;e.resetBBoxNeedsUpdate(),t?.remove(e),t?.requestRender()}}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0!==e){let i=e.parent,r=null===t.parent?this:this.find(t.parent);if(r instanceof D||r===this){r.add(e);let s=t.localIndex;r.children.splice(s,0,r.children.pop()),e.updateWorldMatrix(!0,!1,!0),i?.requestRender(),e.requestRender()}e.resetBBoxNeedsUpdate()}}}add(t){this.group.add(t)}remove(t){this.group.remove(t)}traverse(t){this.group.traverse(e=>{e!==this.group&&t(e)})}intersectsChildren(t,e,i,r=!1,s=[]){return this.group.intersectsChildren(t,e,i,r,s,!0)}intersectsChildrenReverse(t,e,i,r=!1,s=[]){return this.group.intersectsChildrenReverse(t,e,i,r,s,!0)}find(t){return this.group.find(t)}get children(){return this.group.children}project(t,e){return this.group.project(t,e)}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let i=[],r=e;for(;r!==this.group;){let t=r;r=r.parent;let e=r.children.indexOf(t);i.splice(0,0,e)}return{entity:e,sortKey:i}}getAllSorted(t){let e=[];for(let i of t){let t=this.getWithSortKey(i.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>h(t.sortKey,e.sortKey)),e.map(t=>t.entity)}},J=Z;J.GROUP_ID="scene2d";var tt=u(g(),1);function et(t,e,i,r,s,n,a,h,o,l){if(e===o&&i===l)return;if(r=Math.abs(r),s=Math.abs(s),0===r||0===s)return void t.push({LineTo:{x:o,y:l}});let d=n*Math.PI/180,u=Math.cos(d),c=Math.sin(d),p=(e-o)/2,f=(i-l)/2,x=u*p+c*f,g=-c*p+u*f,m=x*x/(r*r)+g*g/(s*s);if(m>1){let t=Math.sqrt(m);r*=t,s*=t}let y=r*r,v=s*s,w=y*v-y*g*g-v*x*x,_=y*g*g+v*x*x,S=(a!==h?1:-1)*Math.sqrt(Math.max(0,w/_)),B=S*(r*g)/s,b=S*(-s*x)/r,M=u*B-c*b+(e+o)/2,C=c*B+u*b+(i+l)/2,k=Math.atan2((g-b)/s,(x-B)/r),A=Math.atan2((-g-b)/s,(-x-B)/r)-k;!h&&A>0?A-=2*Math.PI:h&&A<0&&(A+=2*Math.PI);let T=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2))),P=A/T,z=4/3*Math.tan(P/4),R=k,E=e,O=i;for(let e=0;e<T;e++){let e=R+P,i=Math.cos(R),n=Math.sin(R),a=Math.cos(e),h=Math.sin(e),o=M+r*a*u-s*h*c,l=C+r*a*c+s*h*u,d=-r*n*u-s*i*c,p=-r*n*c+s*i*u,f=-r*h*u-s*a*c,x=-r*h*c+s*a*u;t.push({CurveTo:[{x:E+z*d,y:O+z*p},{x:o-z*f,y:l-z*x},{x:o,y:l}]}),R=e,E=o,O=l}}var it=.5522847498307936,rt=3408/2816,st=1536/2816,nt=!1;function at(){nt||(nt=!0,console.warn("[HanaRenderer] clipRect: precise clipping of rotated/complex content is not supported by the Hana UI overlay yet; drawing unclipped. (Axis-aligned rectangles are clipped geometrically.)"))}var ht=class{constructor(t,e=1){this.canvas=t,this._dpr=e,this._width=0,this._height=0,this._isSizeDirty=!1,this._crashed=!1,this._shapes=[],this._lastPushedJSON="",this._ctm=_.identity(),this._stack=[],this._clips=[],this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0,this._fillColor=a.transparent,this._strokeColor=a.transparent,this._lineWidth=1,this._strokeMode="inside",this._layerBlur=0,this._backgroundBlur=0,this._dropShadowBlur=0,this._dropShadowOffsetX=0,this._dropShadowOffsetY=0,this._dropShadowColor=a.transparent,this._innerShadowBlur=0,this._innerShadowOffsetX=0,this._innerShadowOffsetY=0,this._innerShadowSpread=0,this._innerShadowColor=a.transparent,this._fonts=new Map,this._fontsFlushed=new Set,this._fontXPerEm=new Map,this._measureCache=new Map;try{let i=t.getBoundingClientRect();t.width=i.width*e,t.height=i.height*e}catch{console.log(t.width,e)}}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this._isSizeDirty=!0}get width(){return this._width}get height(){return this._height}async init(){if(!this._engine&&!this._crashed){try{this._context=await m(),this._engine=await this._context.createEngine(this.canvas)}catch(t){return this._crashed=!0,void console.error("[HanaRenderer] Failed to load the Hana UI engine; UI scenes will not render.",t)}if(this._width>0&&this._height>0)this._syncViewport();else{let t=this.canvas.getBoundingClientRect();t.width>0&&t.height>0&&(this._width=t.width,this._height=t.height,this._syncViewport())}this._flushFonts(),this.uiFontReady=this._watchUiFont()}}_watchUiFont(){return new Promise(t=>{let e=this._engine;if(!e||"function"!=typeof e.scene.isUiFontLoaded)return void t();let i=()=>{let t=!1;return this._guard(()=>{t=e.scene.isUiFontLoaded()}),t};if(i())return void t();let r=Date.now(),s=setInterval(()=>{this._crashed||Date.now()-r>3e5?clearInterval(s):i()&&(clearInterval(s),t())},150)})}_syncViewport(){let t=this._engine;if(!t||this._crashed)return;let e=this._width,i=this._height;this.canvas.style.width=e+"px",this.canvas.style.height=i+"px",this.canvas.width=Math.max(1,Math.ceil(e*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(i*this._dpr)),this._guard(()=>{t.resize([e,i],this._dpr),t.scene.updateCamera({position:[e/2,i/2],zoom:1})})}setSize(t,e){!this._isSizeDirty&&t===this._width&&e===this._height||(this._isSizeDirty=!1,this._width=t,this._height=e,this._engine?this._syncViewport():(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",this.canvas.width=Math.max(1,Math.ceil(t*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(e*this._dpr))))}_guard(t){if(!this._crashed)try{t()}catch(t){this._crashed=!0,console.error("[HanaRenderer] Hana engine call failed; disabling this renderer instance.",t)}}async loadFont(t,e){try{let i=await fetch(t);if(!i.ok)return void console.error(`[HanaRenderer] loadFont: ${t} returned HTTP ${i.status}; skipping "${e}"`);let r=await i.arrayBuffer();if(0===r.byteLength)return void console.error(`[HanaRenderer] loadFont: ${t} was empty; skipping "${e}"`);this.registerFont(r,e)}catch(i){console.error(`[HanaRenderer] loadFont failed for "${e}" (${t}):`,i)}}registerFont(t,e){if(this._fonts.has(e))return;this._fonts.set(e,t);let i=function(t){try{let e=new DataView(t),i=e.getUint32(0);if(65536!==i&&1330926671!==i&&1953658213!==i)return;let r=e.getUint16(4),s=-1,n=-1;for(let t=0;t<r;t++){let i=12+16*t,r=e.getUint32(i);1751474532===r&&(s=e.getUint32(i+8)),1330851634===r&&(n=e.getUint32(i+8))}if(s<0||n<0)return;let a=e.getUint16(s+18),h=e.getUint16(n);if(0===a||h<2)return;let o=e.getInt16(n+86);return o>0?o/a:void 0}catch{return}}(t);void 0!==i&&this._fontXPerEm.set(e,i),this._flushFonts()}_flushFonts(){let t=this._engine;if(t)for(let[e,i]of this._fonts)this._fontsFlushed.has(e)||(this._fontsFlushed.add(e),this._guard(()=>{t.scene.addLocalFont(e,new Uint8Array(i))}))}set strokeColor(t){this._strokeColor=t}set fillColor(t){this._fillColor=t}set lineWidth(t){this._lineWidth=t}set strokeMode(t){this._strokeMode=t}set dropShadowBlur(t){this._dropShadowBlur=t}set dropShadowColor(t){this._dropShadowColor=t}set dropShadowOffsetX(t){this._dropShadowOffsetX=t}set dropShadowOffsetY(t){this._dropShadowOffsetY=t}set innerShadowBlur(t){this._innerShadowBlur=t}set innerShadowColor(t){this._innerShadowColor=t}set innerShadowOffsetX(t){this._innerShadowOffsetX=t}set innerShadowOffsetY(t){this._innerShadowOffsetY=t}set innerShadowSpread(t){this._innerShadowSpread=t}set layerBlur(t){this._layerBlur=t}set backgroundBlur(t){this._backgroundBlur=t}save(){this._stack.push({ctm:_.copy(this._ctm),clipLen:this._clips.length})}restore(){let t=this._stack.pop();!t||(this._ctm=t.ctm,this._clips.length=t.clipLen)}setTransform(t,e=!1){let i=_.identity();if(this.camera?.enabled&&(i=_.append(i,this.camera.worldMatrix),e)){let t=_.getScale(this.camera.worldMatrix);i=_.scale(i,1/t[0],1/t[1])}this._ctm=_.append(i,t)}transform(t){this._ctm=_.append(this._ctm,t)}beginPath(){this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0}closePath(){0!==this._pathEls.length&&"ClosePath"!==this._pathEls[this._pathEls.length-1]&&this._pathEls.push("ClosePath")}_startFreeform(){this._simpleShape=null,this._pathPrimitives++}moveTo(t,e){this._startFreeform(),this._pathEls.push({MoveTo:{x:t,y:e}})}lineTo(t,e){this._startFreeform(),this._pathEls.push({LineTo:{x:t,y:e}})}bezierCurveTo(t,e,i,r,s,n){this._startFreeform(),this._pathEls.push({CurveTo:[{x:t,y:e},{x:i,y:r},{x:s,y:n}]})}quadraticCurveTo(t,e,i,r){this._startFreeform(),this._pathEls.push({QuadTo:[{x:t,y:e},{x:i,y:r}]})}path(t){this._startFreeform(),this._pathEls.push(...function(t){let e,i=[];try{e=(0,tt.makeAbsolute)((0,tt.parseSVG)(t))}catch(t){return console.error("[HanaRenderer] Failed to parse SVG path:",t),i}let r=0,s=0,n=0,a=0,h=null,o=null;for(let t of e){let e=null,l=null;switch(t.code){case"M":r=n=t.x,s=a=t.y,i.push({MoveTo:{x:r,y:s}});break;case"L":r=t.x,s=t.y,i.push({LineTo:{x:r,y:s}});break;case"H":r=t.x,i.push({LineTo:{x:r,y:s}});break;case"V":s=t.y,i.push({LineTo:{x:r,y:s}});break;case"C":{let n={x:t.x1,y:t.y1},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"S":{let n=h?{x:2*r-h.x,y:2*s-h.y}:{x:r,y:s},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"Q":{let e={x:t.x1,y:t.y1};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"T":{let e=o?{x:2*r-o.x,y:2*s-o.y}:{x:r,y:s};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"A":{let e=r,n=s;r=t.x,s=t.y,et(i,e,n,t.rx,t.ry,t.xAxisRotation,t.largeArc,t.sweep,r,s);break}case"Z":r=n,s=a,i.push("ClosePath")}h=e,o=l}return i}(t))}rect(t,e,i,r,s=0,n=0,a=0,h=0){if(!ct([t,e,i,r]))return;let o={x:t,y:e,w:i,h:r,radii:[s,n,a,h]};this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"rect",rect:o,smoothing:0}:null,gt(this._pathEls,o)}ellipse(t,e,i,r,s,n,a,h){if(ct([t,e,i,r])){if(i<0||r<0)throw Error("radii cannot be negative");this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"ellipse",cx:t,cy:e,rx:i,ry:r}:null,function(t,e,i,r,s){let n=r*it,a=s*it;t.push({MoveTo:{x:e+r,y:i}},{CurveTo:[{x:e+r,y:i+a},{x:e+n,y:i+s},{x:e,y:i+s}]},{CurveTo:[{x:e-n,y:i+s},{x:e-r,y:i+a},{x:e-r,y:i}]},{CurveTo:[{x:e-r,y:i-a},{x:e-n,y:i-s},{x:e,y:i-s}]},{CurveTo:[{x:e+n,y:i-s},{x:e+r,y:i-a},{x:e+r,y:i}]},"ClosePath")}(this._pathEls,t,e,i,r)}}clipRect(t,e,i,r,s=0,n=0,a=0,h=0){let o=_.invert(this._ctm);!o||this._clips.push({m:_.copy(this._ctm),inv:o,rect:{x:t,y:e,w:i,h:r,radii:[s,n,a,h]}})}fill(){this._emit(!0)}stroke(){this._strokeColor.a<=0||this._lineWidth<=0||this._emit(!1)}_emit(t){let e=this._effectChain(t);if(t&&this._fillColor.a<=0&&!e)return;let i=this._classifyShape();if(!i)return;let r=this._applyClips(i);if("skip"===r)return;if(!t&&r!==i){let t=ft(i);if(t)return void this._emitClippedRectStroke(t,e)}i=r;let s={shape:i,color:t?ut(this._fillColor):[0,0,0,0],transform:_.getAbcdef(this._ctm)};t||(s.stroke=this._strokeDesc()),e&&(s.effect_chain=e),this._shapes.push(s)}_emitClippedRectStroke(t,e){let i=this._lineWidth,r="outside"===this._strokeMode?i:"center"===this._strokeMode?i/2:0,s=i-r,n=Math.min(t.w,t.h)/2,a=t.radii.map(t=>Math.max(0,Math.min(t,n))),h={x:t.x-r,y:t.y-r,w:t.w+2*r,h:t.h+2*r,radii:a.map(t=>t>0?t+r:0)},o=t.w-2*s,l=t.h-2*s,d=o>0&&l>0?{x:t.x+s,y:t.y+s,w:o,h:l,radii:a.map(t=>Math.max(0,t-s))}:null,u=this._applyClips(pt(h,0));if("skip"===u)return;let c=ft(u)??h,p=null;if(d){let t=this._applyClips(pt(d,0));p="skip"===t?null:ft(t)??d}let f=[];gt(f,c),p&&function(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i,y:r+n}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i+s,y:r}},"ClosePath");let u=1-it;t.push({MoveTo:{x:i+h,y:r}}),h>0&&t.push({CurveTo:[{x:i+h*u,y:r},{x:i,y:r+h*u},{x:i,y:r+h}]}),t.push({LineTo:{x:i,y:r+n-d}}),d>0&&t.push({CurveTo:[{x:i,y:r+n-d*u},{x:i+d*u,y:r+n},{x:i+d,y:r+n}]}),t.push({LineTo:{x:i+s-l,y:r+n}}),l>0&&t.push({CurveTo:[{x:i+s-l*u,y:r+n},{x:i+s,y:r+n-l*u},{x:i+s,y:r+n-l}]}),t.push({LineTo:{x:i+s,y:r+o}}),o>0&&t.push({CurveTo:[{x:i+s,y:r+o*u},{x:i+s-o*u,y:r},{x:i+s-o,y:r}]}),t.push("ClosePath")}(f,p);let x={shape:{Custom:f},color:ut(this._strokeColor),transform:_.getAbcdef(this._ctm)};e&&(x.effect_chain=e),this._shapes.push(x)}_classifyShape(){let t=this._simpleShape;return t?"rect"===t.kind?pt(t.rect,t.smoothing):{Ellipse:{center_x:t.cx,center_y:t.cy,rx:t.rx,ry:t.ry}}:0===this._pathEls.length?null:{Custom:this._pathEls.slice()}}_strokeDesc(){return{width:this._lineWidth,line_join:"Miter",color:ut(this._strokeColor),align:ot[this._strokeMode],cap:"Butt"}}_effectChain(t){let e=this.camera?.scale??1,i=[];if(t&&this._dropShadowColor.a>0&&i.push({DropShadow:{position:[this._dropShadowOffsetX*e,this._dropShadowOffsetY*e],blur:{Uniform:{size:2*this._dropShadowBlur*e}},spread:0,color:ut(this._dropShadowColor)}}),t&&this._backgroundBlur>0){let[t,e]=_.getScale(this._ctm),r=(t+e)/2;i.push({BackgroundBlur:{blur:{Uniform:{size:2*this._backgroundBlur*r}}}})}if(this._layerBlur>0&&i.push({LayerBlur:{blur:{Uniform:{size:2*this._layerBlur*e}}}}),t&&this._innerShadowColor.a>0){let[t,r,s,n]=_.getAbcdef(this._ctm),a=this._innerShadowOffsetX,h=this._innerShadowOffsetY;i.push({InnerShadow:{position:[t*a+s*h,r*a+n*h],blur:{Uniform:{size:2*this._innerShadowBlur*e}},spread:this._innerShadowSpread*e,color:ut(this._innerShadowColor)}})}return i.length>0?i:void 0}_applyClips(t){if(0===this._clips.length)return t;let e=t;for(let t of this._clips){let i=_.append(t.inv,this._ctm),[r,s,n,a,h,o]=_.getAbcdef(i),l=Math.abs(s)<=1e-6*(Math.abs(r)+Math.abs(a))&&Math.abs(n)<=1e-6*(Math.abs(r)+Math.abs(a)),d=xt(e);if(!d)return e;if(!l){at();continue}let u=r*d.minX+h,c=r*d.maxX+h,p=a*d.minY+o,f=a*d.maxY+o,x=Math.min(u,c),g=Math.max(u,c),m=Math.min(p,f),y=Math.max(p,f),v=t.rect,w=Math.max(x,v.x),S=Math.max(m,v.y),B=Math.min(g,v.x+v.w),b=Math.min(y,v.y+v.h);if(w>=B||S>=b)return"skip";if(w===x&&S===m&&B===g&&b===y)continue;let M=ft(e);if(!M||0===r||0===a){at();continue}let C=(w-h)/r,k=(B-h)/r,A=(S-o)/a,T=(b-o)/a,P=Math.min(C,k),z=Math.min(A,T),R=Math.abs(k-C),E=Math.abs(T-A),[O,H,L,F]=M.radii,U=P!==M.x,N=z!==M.y,j=P+R!==M.x+M.w,I=z+E!==M.y+M.h,D=Math.min(R,E)/2;e=pt({x:P,y:z,w:R,h:E,radii:[U||N?0:Math.min(O,D),j||N?0:Math.min(H,D),j||I?0:Math.min(L,D),U||I?0:Math.min(F,D)]},0)}return e}drawText(t,e){let i=this._fontXPerEm.get(e.font),r=i?i/st:1,s={TextSimple:{text:t,font_size:e.fontSize*rt*r,size:[e.width,e.height],horizontal_align:lt[e.horizontalAlign]??"Left",vertical_align:dt[e.verticalAlign]??"Top"}},n=this._effectChain(!0),a=this._fillColor.a>0,h=this._strokeColor.a>0&&this._lineWidth>0;if(a||h||n){let t={shape:s,color:a?ut(this._fillColor):[0,0,0,0],transform:_.getAbcdef(_.append(this._ctm,_.translate(_.identity(),e.x,e.y)))};h&&(t.stroke=this._strokeDesc()),n&&(t.effect_chain=n),this._shapes.push(t)}return{height:this._measureTextHeight(t,e)}}_measureTextHeight(t,e){let i=`${e.font}|${e.fontSize}|${e.lineHeight}|${e.letterSpacing}|${e.width}|${t}`,r=this._measureCache.get(i);if(void 0!==r)return r;let s=0,n=this._engine;if(n&&!this._crashed&&this._fontsFlushed.has(e.font))try{let[,i]=n.scene.measureTextNaturalSize({size:[e.width,e.height],text:t,fontSize:e.fontSize,horizontalAlign:lt[e.horizontalAlign]??"Left",verticalAlign:dt[e.verticalAlign]??"Top",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,textTransform:"None",font:e.font,version:0,autoSize:"None",truncate:"None"});s=i}catch{}if(!(s>0)){let i=.55*e.fontSize+Math.max(0,e.letterSpacing),r=Math.max(1,Math.floor(e.width/i)),n=0;for(let e of t.split("\n"))n+=Math.max(1,Math.ceil(e.length/r));s=n*e.fontSize*e.lineHeight}return this._measureCache.size>512&&this._measureCache.clear(),this._measureCache.set(i,s),s}clear(){this._shapes=[],this._ctm=_.identity(),this._stack.length=0,this._clips.length=0}render(){let t=this._engine;if(!t||this._crashed)return;let e=JSON.stringify(this._shapes);e!==this._lastPushedJSON&&(this._guard(()=>t.scene.updateUiShapes(this._shapes)),this._lastPushedJSON=e),this._guard(()=>t.onFrame())}},ot={inside:"Inside",outside:"Outside",center:"Center"},lt={1:"Left",2:"Right",3:"Center",4:"Justify"},dt={1:"Top",2:"Center",3:"Bottom"};function ut({r:t,g:e,b:i,a:r}){return[t,e,i,r]}function ct(t){for(let e=0;e<t.length;e++)if(void 0!==t[e]&&!Number.isFinite(t[e]))return!1;return!0}function pt(t,e){let[i,r,s,n]=t.radii;return 0===i&&0===r&&0===s&&0===n?{Rectangle:{x:t.x,y:t.y,width:t.w,height:t.h}}:{RoundedRectangle:{x:t.x,y:t.y,width:t.w,height:t.h,radius:[i,r,s,n],corner_smoothing:e}}}function ft(t){if("Rectangle"in t){let e=t.Rectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[0,0,0,0]}}if("RoundedRectangle"in t){let e=t.RoundedRectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[e.radius[0],e.radius[1],e.radius[2],e.radius[3]]}}return null}function xt(t){let e=ft(t);if(e)return{minX:e.x,minY:e.y,maxX:e.x+e.w,maxY:e.y+e.h};if("Ellipse"in t){let e=t.Ellipse;return{minX:e.center_x-e.rx,minY:e.center_y-e.ry,maxX:e.center_x+e.rx,maxY:e.center_y+e.ry}}if("TextSimple"in t){let e=t.TextSimple;return{minX:0,minY:0,maxX:e.size[0],maxY:e.size[1]}}if("Custom"in t){let e=1/0,i=1/0,r=-1/0,s=-1/0,n=t=>{t.x<e&&(e=t.x),t.y<i&&(i=t.y),t.x>r&&(r=t.x),t.y>s&&(s=t.y)};for(let e of t.Custom)"ClosePath"!==e&&("MoveTo"in e?n(e.MoveTo):"LineTo"in e?n(e.LineTo):"QuadTo"in e?e.QuadTo.forEach(n):"CurveTo"in e&&e.CurveTo.forEach(n));return e===1/0?null:{minX:e,minY:i,maxX:r,maxY:s}}return null}function gt(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i+s,y:r}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i,y:r+n}},"ClosePath");let u=1-it;t.push({MoveTo:{x:i+h,y:r}}),t.push({LineTo:{x:i+s-o,y:r}}),o>0&&t.push({CurveTo:[{x:i+s-o*u,y:r},{x:i+s,y:r+o*u},{x:i+s,y:r+o}]}),t.push({LineTo:{x:i+s,y:r+n-l}}),l>0&&t.push({CurveTo:[{x:i+s,y:r+n-l*u},{x:i+s-l*u,y:r+n},{x:i+s-l,y:r+n}]}),t.push({LineTo:{x:i+d,y:r+n}}),d>0&&t.push({CurveTo:[{x:i+d*u,y:r+n},{x:i,y:r+n-d*u},{x:i,y:r+n-d}]}),t.push({LineTo:{x:i,y:r+h}}),h>0&&t.push({CurveTo:[{x:i,y:r+h*u},{x:i+h*u,y:r},{x:i+h,y:r}]}),t.push("ClosePath")}function mt({constraints:t,newParentWidth:e,newParentHeight:i,initialParentWidth:r,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:a,objectInitialPosition:h}){let{horizontalConstraint:o,verticalConstraint:l}=t,d=e-r,u=i-s,c=n,p=a,f=h[0],x=h[1];if(0!==o)if(1===o)f+=d;else if(3===o)f+=d/2;else if(2===o)c=Math.max(1,c+d);else if(4===o){let t=e/r;c*=t,f*=t}if(0!==l)if(1===l)x+=u;else if(3===l)x+=u/2;else if(2===l)p=Math.max(1,p+u);else if(4===l){let t=i/s;p*=t,x*=t}return{width:c,height:p,position:[f,x]}}u(g(),1);export{_ as a,y as b,v as c,ht as d,F as e,U as f,N as g,j as h,W as i,V as j,$ as k,Q as l,J as m,mt as n};
|
|
1
|
+
import{a as t}from"./runtime-chunk-NTUTXO7Q.js";import{b as e}from"./runtime-chunk-6ARRPM23.js";import{b as i,c as r,d as s,e as n}from"./runtime-chunk-VGEECQH4.js";import{E as a,b as h,k as o,o as l}from"./runtime-chunk-D3BWEUN6.js";import{a as d,b as u}from"./runtime-chunk-ML3Z74BL.js";var c,p,f,x=d((t,e)=>{function i(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}!function(t,e){function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i}(i,Error),i.buildMessage=function(t,e){var i,r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e,i="";for(e=0;e<t.parts.length;e++)i+=t.parts[e]instanceof Array?a(t.parts[e][0])+"-"+a(t.parts[e][1]):a(t.parts[e]);return"["+(t.inverted?"^":"")+i+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function s(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function a(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function h(t){return r[t.type](t)}return"Expected "+function(t){var e,i,r=new Array(t.length);for(e=0;e<t.length;e++)r[e]=h(t[e]);if(r.sort(),r.length>0){for(e=1,i=1;e<r.length;e++)r[e-1]!==r[e]&&(r[i]=r[e],i++);r.length=i}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+((i=e)?'"'+n(i)+'"':"end of input")+" found."},e.exports={SyntaxError:i,parse:function(t,e){e=void 0!==e?e:{};var r,s={},n={svg_path:xt},a=xt,h=function(t){if(!t)return[];for(var e=[],i=0;i<t.length;i++)e=e.concat.apply(e,t[i]);var r=e[0];return r&&"m"==r.code&&(delete r.relative,r.code="M"),e},o=function(t,e){return function(t,e){if(!e)return[t];for(var i=[t],r=0,s=e.length;r<s;r++)i[r+1]=e[r][1];return i}(t,e)},l=/^[Mm]/,d=ut(["M","m"],!1,!1),u=function(t,e,i){var r=jt(t,[e]);return i&&(r=r.concat(jt("M"==t?"L":"l",i[1]))),r},c=/^[Zz]/,p=ut(["Z","z"],!1,!1),f=function(){return jt("Z")},x=/^[Ll]/,g=ut(["L","l"],!1,!1),m=function(t,e){return jt(t,e)},y=/^[Hh]/,v=ut(["H","h"],!1,!1),w=function(t,e){return jt(t,e.map(function(t){return{x:t}}))},_=/^[Vv]/,S=ut(["V","v"],!1,!1),B=function(t,e){return jt(t,e.map(function(t){return{y:t}}))},b=/^[Cc]/,M=ut(["C","c"],!1,!1),C=function(t,e,i){return{x1:t.x,y1:t.y,x2:e.x,y2:e.y,x:i.x,y:i.y}},k=/^[Ss]/,A=ut(["S","s"],!1,!1),T=function(t,e){return{x2:t.x,y2:t.y,x:e.x,y:e.y}},P=/^[Qq]/,R=ut(["Q","q"],!1,!1),z=function(t,e){return{x1:t.x,y1:t.y,x:e.x,y:e.y}},E=/^[Tt]/,O=ut(["T","t"],!1,!1),H=/^[Aa]/,L=ut(["A","a"],!1,!1),F=function(t,e,i,r,s,n){return{rx:t,ry:e,xAxisRotation:i,largeArc:r,sweep:s,x:n.x,y:n.y}},U=function(t,e){return{x:t,y:e}},N=function(t){return 1*t},j=function(t){return 1*t.join("")},I=/^[01]/,D=ut(["0","1"],!1,!1),W=function(t){return"1"==t},V=function(){return""},X=",",q=dt(",",!1),Y=function(t){return t.join("")},$=".",G=dt(".",!1),Q=/^[eE]/,Z=ut(["e","E"],!1,!1),J=/^[+\-]/,K=ut(["+","-"],!1,!1),tt=/^[0-9]/,et=ut([["0","9"]],!1,!1),it=function(t){return t.join("")},rt=/^[ \t\n\r]/,st=ut([" ","\t","\n","\r"],!1,!1),nt=0,at=[{line:1,column:1}],ht=0,ot=[],lt=0;if("startRule"in e){if(!(e.startRule in n))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=n[e.startRule]}function dt(t,e){return{type:"literal",text:t,ignoreCase:e}}function ut(t,e,i){return{type:"class",parts:t,inverted:e,ignoreCase:i}}function ct(e){var i,r=at[e];if(r)return r;for(i=e-1;!at[i];)i--;for(r={line:(r=at[i]).line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return at[e]=r,r}function pt(t,e){var i=ct(t),r=ct(e);return{start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:r.line,column:r.column}}}function ft(t){nt<ht||(nt>ht&&(ht=nt,ot=[]),ot.push(t))}function xt(){var t,e,i,r,n;for(t=nt,e=[],i=Ot();i!==s;)e.push(i),i=Ot();if(e!==s)if(i=function(){var t,e,i,r,n,a;if(t=nt,(e=gt())!==s){for(i=[],r=nt,n=[],a=Ot();a!==s;)n.push(a),a=Ot();for(n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;){for(i.push(r),r=nt,n=[],a=Ot();a!==s;)n.push(a),a=Ot();n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s)}i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),i===s&&(i=null),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?t=e=h(i):(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;return t}function gt(){var e,i,r,n,a,h;if(e=nt,i=function(){var e,i,r,n,a,h,o;if(e=nt,l.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(d)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=bt())!==s?(a=nt,(h=At())===s&&(h=null),h!==s&&(o=yt())!==s?a=h=[h,o]:(nt=a,a=s),a===s&&(a=null),a!==s?e=i=u(i,n,a):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}(),i!==s){for(r=[],n=nt,a=[],h=Ot();h!==s;)a.push(h),h=Ot();for(a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s);n!==s;){for(r.push(n),n=nt,a=[],h=Ot();h!==s;)a.push(h),h=Ot();a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s)}r!==s?e=i=o(i,r):(nt=e,e=s)}else nt=e,e=s;return e}function mt(){var e,i;return c.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(p)),i!==s&&(i=f()),(e=i)===s&&(e=function(){var e,i,r,n;if(e=nt,x.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(g)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=yt())!==s?e=i=m(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,y.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(v)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=vt())!==s?e=i=w(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,_.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(S)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s&&(n=vt())!==s?e=i=B(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,b.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(M)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=wt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,k.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(A)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=_t())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,P.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(R)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=St())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,E.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(O)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,H.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(L)),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=Bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}()),e}function yt(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function vt(){var t,e,i,r,n,a;if(t=nt,(e=Ct())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function wt(){var t,e,i,r,n,a;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?((n=At())===s&&(n=null),n!==s&&(a=bt())!==s?t=e=C(e,r,a):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function _t(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=T(e,r):(nt=t,t=s)):(nt=t,t=s),t}function St(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=z(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Bt(){var t,e,i,r,n,a,h,o,l,d,u;return t=nt,(e=Mt())!==s?((i=At())===s&&(i=null),i!==s&&(r=Mt())!==s?((n=At())===s&&(n=null),n!==s&&(a=Ct())!==s&&At()!==s&&(h=kt())!==s?((o=At())===s&&(o=null),o!==s&&(l=kt())!==s?((d=At())===s&&(d=null),d!==s&&(u=bt())!==s?t=e=F(e,r,a,h,l,u):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function bt(){var t,e,i,r;return t=nt,(e=Ct())!==s?((i=At())===s&&(i=null),i!==s&&(r=Ct())!==s?t=e=U(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Mt(){var t;return(t=Pt())===s&&(t=Et()),t!==s&&(t=N(t)),t}function Ct(){var t,e,i;return t=nt,(e=zt())===s&&(e=null),e!==s&&(i=Pt())!==s?t=e=[e,i]:(nt=t,t=s),t===s&&(t=nt,(e=zt())===s&&(e=null),e!==s&&(i=Et())!==s?t=e=[e,i]:(nt=t,t=s)),t!==s&&(t=j(t)),t}function kt(){var e;return I.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(D)),e!==s&&(e=W(e)),e}function At(){var t,e,i,r,n;if(t=nt,e=[],(i=Ot())!==s)for(;i!==s;)e.push(i),i=Ot();else e=s;if(e!==s)if((i=Tt())===s&&(i=null),i!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?t=e=[e,i,r]:(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;if(t===s){if(t=nt,e=nt,(i=Tt())!==s){for(r=[],n=Ot();n!==s;)r.push(n),n=Ot();r!==s?e=i=[i,r]:(nt=e,e=s)}else nt=e,e=s;e!==s&&(e=V()),t=e}return t}function Tt(){var e;return 44===t.charCodeAt(nt)?(e=X,nt++):(e=s,0===lt&&ft(q)),e}function Pt(){var e,i,r;return e=nt,i=function(){var e,i,r,n;return e=nt,(i=Et())===s&&(i=null),i!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s&&(n=Et())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Et())!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s)),e!==s&&(e=Y(e)),e}(),i!==s?((r=Rt())===s&&(r=null),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Et())!==s&&(r=Rt())!==s?e=i=[i,r]:(nt=e,e=s)),e!==s&&(e=Y(e)),e}function Rt(){var e,i,r,n;return e=nt,Q.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(Z)),i!==s?((r=zt())===s&&(r=null),r!==s&&(n=Et())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e!==s&&(e=Y(e)),e}function zt(){var e;return J.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(K)),e}function Et(){var e,i;if(e=[],tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et)),i!==s)for(;i!==s;)e.push(i),tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et));else e=s;return e!==s&&(e=it(e)),e}function Ot(){var e;return rt.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(st)),e!==s&&(e=V()),e}var Ht,Lt,Ft,Ut={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Nt in Ut)Ut[Nt.toUpperCase()]=Ut[Nt];function jt(t,e){e||(e=[{}]);for(var i=e.length;i--;){var r={code:t,command:Ut[t]};for(var s in t==t.toLowerCase()&&(r.relative=!0),e[i])r[s]=e[i][s];e[i]=r}return e}if((r=a())!==s&&nt===t.length)return r;throw r!==s&&nt<t.length&&ft({type:"end"}),Ht=ot,Lt=ht<t.length?t.charAt(ht):null,Ft=ht<t.length?pt(ht,ht+1):pt(ht,ht),new i(i.buildMessage(Ht,Lt),Ht,Lt,Ft)}}}),g=d((t,e)=>{var i=x().parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,i={x:0,y:0},r={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach(function(t){for(var s in"moveto"===t.command&&(e=t),t.x0=i.x,t.y0=i.y,r)s in t&&(t[s]+=t.relative?t[r[s]]:0);"x"in t||(t.x=i.x),"y"in t||(t.y=i.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),i=t}),t},e.exports=i});function m(){if(!p){if(!c)return Promise.reject(new Error("HanaRenderer: no Hana UI loader registered. Call setHanaUILoader() from the host app before initializing a HanaRenderer."));(p=c()).catch(()=>{p=void 0})}return p}function y(t){f=t}function v(){return c||(c=async()=>async function(t,e){return await t.default(e?{module_or_path:e}:void 0),Object.getOwnPropertyDescriptor(t.Engine.prototype,"scene")||Object.defineProperty(t.Engine.prototype,"scene",{get:function(){let e=Object.create(t.SceneController.prototype);return e.__wbg_ptr=this.__wbg_ptr,e}}),{createEngine:e=>t.Engine.create(e,JSON.parse('{"schema":13,"scenes":[{"fi":0,"id":"32603ebf4-bd9a-54ba-c1e9-6645c3ee7a53","data":{"name":"Page","backgroundColor":[0,0,0,0],"objects":[]}}],"assets":{"images":{},"videos":{},"colors":{},"audios":{},"numbers":{},"booleans":{},"strings":{},"dynamicVariables":{"counters":{},"randoms":{},"timers":{},"times":{}},"fonts":{},"animations":{},"geometries":{},"emojiArt":{}},"publish":{"logo":true,"presentationSizing":"Contain","allowPageScroll":true,"showBackground":true},"framePublish":{},"components":{}}'),!0)}}(await import("./hana-ui.js"),f??function(){let t=typeof process<"u"?"2.0.12":void 0;return`https://cdn.spline.design/@splinetool/runtime${t?`@${t}`:""}/build/hana-ui.wasm`}())),m().then(()=>{})}var w=Math.PI/180;Math.PI;var _,S=1e-10;function B(t,e){let[[i,r],[s,n]]=t,[[a,h],[o,l]]=e,d=(i-s)*(h-l)-(r-n)*(a-o);if(0===d)return!1;let u=((i-a)*(h-l)-(r-h)*(a-o))/d,c=-((i-s)*(r-h)-(r-n)*(i-a))/d;return u>=0&&u<=1&&c>=0&&c<=1}(t=>{function e(t){return[t[0],t[3],t[1],t[4],t[2],t[5]]}t.identity=function(){return[1,0,0,0,1,0,0,0,1]},t.copy=function(e,i=t.identity()){for(let t=0,r=e.length;t<r;t++)i[t]=e[t];return i},t.create=function(e,i,r,s,n,a){return t.setAbcdef(t.identity(),e,i,r,s,n,a)},t.setAbcdef=function(t,e,i,r,s,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t},t.append=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=d*s+u*a,m=d*n+u*h,y=c*s+p*a,v=c*n+p*h,w=f*s+x*a+o,_=f*n+x*h+l;return t.create(g,m,y,v,w,_)},t.prepend=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=s,m=n,y=a,v=h;(1!==d||0!==u||0!==c||1!==p)&&(g=s*d+n*c,m=s*u+n*p,y=a*d+h*c,v=a*u+h*p);let w=o*d+l*c+f,_=o*u+l*p+x;return t.create(g,m,y,v,w,_)},t.getAbcdef=e,t.invert=function(e){let[i,r,s,n,a,h]=t.getAbcdef(e),o=i*n-r*s,l=n/o,d=-r/o,u=-s/o,c=i/o,p=(s*h-n*a)/o,f=-(i*h-r*a)/o;return t.create(l,d,u,c,p,f)},t.apply=function([e,i],r){let[s,n,a,h,o,l]=t.getAbcdef(r);return[s*e+a*i+o,n*e+h*i+l]},t.applyInverse=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(i),l=1/(r*a+n*-s),[d,u]=e;return[a*l*d+-n*l*u+(o*n-h*a)*l,r*l*u+-s*l*d+(-o*r+h*s)*l]},t.scale=function(e,i,r=i){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s*i,n*r,a*i,h*r,o*i,l*r),e},t.rotate=function(e,i){let r=Math.cos(i),s=Math.sin(i),[n,a,h,o,l,d]=t.getAbcdef(e);return t.setAbcdef(e,n*r-a*s,n*s+a*r,h*r-o*s,h*s+o*r,l*r-d*s,l*s+d*r),e},t.rotateAround=function(e,i,r){let[s,n]=r,a=t.translate(e,-s,-n);return a=t.rotate(a,i),a=t.translate(a,s,n),a},t.translate=function(e,i,r){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,o+i,l+r),e},t.setTranslate=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.setPosition=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.getScale=function(e){let[i,r,s,n]=t.getAbcdef(e);return[Math.sqrt(i*i+r*r),Math.sqrt(s*s+n*n)]},t.getPosition=function(e){let[,,,,i,r]=t.getAbcdef(e);return[i,r]},t.getRotation=function(e,i){return t.decompose(e,i).rotation},t.decompose=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(e),{rotation:l,scale:d,shear:u}=function(t){let e=t[0][0],i=t[1][0],r=t[0][1],s=t[1][1],n=Math.sqrt(e*e+i*i),a=n>S?e/n:1,h=n>S?i/n:0,o=a*e+h*i,l=a*s-h*r,d=a*r+h*s;return{rotation:Math.atan2(h,a),scale:[o,l],shear:[Math.abs(l)>S?d/l:0,0]}}([[r,n],[s,a]]);return{position:[h+(i[0]*r+i[1]*n)-i[0],o+(i[0]*s+i[1]*a)-i[1]],scale:d,rotation:l,shear:u,pivot:i}},t.compose=function(e,i,r,s,n=[0,0]){let[a,h]=e,[o,l]=s,[d,u,c,p]=function({rotation:t,scale:e,shear:i}){let r=Math.cos(t),s=Math.sin(t),n=i[0]*e[1],a=i[1]*e[0];return[r*e[0]-s*a,s*e[0]+r*a,r*n-s*e[1],s*n+r*e[1]]}({rotation:r,scale:i,shear:n}),f=a-(o*d+l*c)+o,x=h-(o*u+l*p)+l;return t.create(d,u,c,p,f,x)}})(_||(_={}));var b,M,C,k,A,T=[[-1,1],[-1,-1],[1,-1],[1,1]],P=(t,e,i)=>{let r=t.getCenter(),s=t.getHalfSize(),n=_.append(e,t.worldMatrix);0===s[0]&&0===s[1]?i.push(_.apply(r,n)):T.forEach(t=>{let e=[t[0]*s[0]+r[0],t[1]*s[1]+r[1]];i.push(_.apply(e,n))})},R=class{constructor(){this.matrix=_.identity(),this.min=[1/0,1/0],this.max=[-1/0,-1/0],this.vertices=[],this.edges=[]}setFromObjectSize(t,e=!1){t.updateWorldMatrix(),this.makeEmpty(),_.copy(t.worldMatrix,this.matrix);let i=_.invert(t.worldMatrix);this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[],s=!0===t.isBaseGroup?t:void 0;!0===i&&void 0!==s?s.traverse(t=>{t.visible&&P(t,e,r)}):P(t,e,r),this.setFromPoints(r)}setFromSize(t,e,i){this.makeEmpty(),_.copy(i,this.matrix),this.expandBySize(t,e,i)}expandBySize(t,e,i){[_.apply([0,0],i),_.apply([0,e],i),_.apply([t,e],i),_.apply([t,0],i)].forEach(t=>this.expandByPoint(t))}getCenter(){let[t,e]=this.min,[i,r]=this.getHalfSize();return _.apply([t+i,e+r],this.matrix)}getSize(){return[this.max[0]-this.min[0],this.max[1]-this.min[1]]}getHalfSize(){return[.5*(this.max[0]-this.min[0]),.5*(this.max[1]-this.min[1])]}makeEmpty(){this.min=[1/0,1/0],this.max=[-1/0,-1/0]}setFromPoints(t){this.makeEmpty();for(let e of t)this.expandByPoint(e)}expandByPoint(t){this.min=[Math.min(this.min[0],t[0]),Math.min(this.min[1],t[1])],this.max=[Math.max(this.max[0],t[0]),Math.max(this.max[1],t[1])]}computeVertices(){let[t,e]=this.getHalfSize(),i=this.getCenter(),[r,s,n,a]=_.getAbcdef(this.matrix),h=_.create(r,s,n,a,i[0],i[1]);this.vertices=T.map(([i,r])=>_.apply([i*t,r*e],h))}computeEdges(){this.edges=[];for(let t=0,e=this.vertices.length;t<e;++t)this.edges.push([this.vertices[t],this.vertices[(t+1)%e]])}project(t,e){let i=this.matrix;return e&&(i=_.append(e.worldMatrix,i)),_.applyInverse(t,i)}intersects(t,e,i){return this.intersectsInLocalSpace(...this.project([t,e],i))}intersectsInLocalSpace(t,e){let{min:i,max:r}=this;return t>=i[0]&&t<=r[0]&&e>=i[1]&&e<=r[1]}containsPoint(t){let[e,i]=t,[r,s]=this.min,[n,a]=this.max;return e>=r&&e<=n&&i>=s&&i<=a}intersectsBBox2D(t){for(let e=0,i=this.edges.length;e<i;e++){let i=this.edges[e];for(let e=0,r=t.edges.length;e<r;e++)if(B(i,t.edges[e]))return!0}for(let e=0,i=t.vertices.length;e<i;e++){let i=t.vertices[e];if(this.containsPoint(i))return!0}return!1}ensureMinMax(){let t=this.min,e=this.max;this.min=[Math.min(t[0],e[0]),Math.min(t[1],e[1])],this.max=[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}copy(t){this.min=[...t.min],this.max=[...t.max],_.copy(t.matrix,this.matrix),this.computeVertices(),this.computeEdges()}clone(){let t=new R;return t.copy(this),t}},z=class{constructor(e,i,r){this.uuid=e,this.data=i,this.isObject2D=!0,this.localMatrix=_.identity(),this.worldMatrix=_.identity(),this.ignoreCameraZoom=!1,this.visible=!0,this._singleBBox=new R,this._recursiveBBox=new R,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.stateSelection=null,this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this.name="",this.position=[0,0],this.scale=[1,1],this.rotation=0,this.shear=[0,0],this.emitter=t(),this.dpr=r.dpr??1,this.dataPatched=i}project(t,e){let i=this.worldMatrix;return e&&(i=_.append(e.worldMatrix,i)),_.applyInverse(t,i)}intersects(t,e,i,r=!1){return this.visible&&!this.data.raycastLock&&this.intersectsInLocalSpace(...this.project([t,e],i),r)}intersectsInLocalSpace(t,e,i=!1){let{min:r,max:s}=i?this.recursiveBBox:this.singleBBox;return t>=r[0]&&t<=s[0]&&e>=r[1]&&e<=s[1]}applyTransforms(t){t.setTransform(this.worldMatrix,this.ignoreCameraZoom)}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges()),this._recursiveBBox}updateLocalMatrix(){this.localMatrix=_.compose(this.position,this.scale,this.rotation*w,n.getPivot(this.dataPatched),this.shear)}updateWorldMatrix(t,e,i){let r=this.parent;e&&null!=r&&r.updateWorldMatrix(t,!0,!1),t&&this.updateLocalMatrix(),this.parent?this.worldMatrix=_.append(this.parent.worldMatrix,this.localMatrix):this.worldMatrix=_.copy(this.localMatrix),this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}get pivot(){return n.getPivot(this.data)}getCenter(){return[0,0]}getHalfSize(){return[0,0]}get id(){return this.uuid}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{t.resetBBoxNeedsUpdateSelf()})}updateTransformState(t){let e=!1;void 0!==t.position&&(e=!0,this.position=t.position),void 0!==t.rotation&&(e=!0,this.rotation=t.rotation),void 0!==t.scale&&(e=!0,this.scale=t.scale),void 0!==t.shear&&(e=!0,this.shear=t.shear),e&&(this.updateWorldMatrix(!0,!1,!0),this.resetBBoxNeedsUpdate())}updateByOp(t,r,s){0===t.type&&void 0!==t.props.visible&&(this.visible=t.props.visible),this.data=r,this.data=r;let n=t,a=e(t.path,["states","*"]);if(null!==a){if(0===t.type){let[e]=a;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=l.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}n={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}let i=l.removeOverridden(t.path,t.props,e);n={...t,props:i}}}this.updateByPatchedOpBase(n,i.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),s)}changeSelectedState(t,e,r=!1){if(0!==this.data.states.length||r){for(let t of this.data.states)i.toOps(this.data,t.data).forEach(t=>{let i=o.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let r=this.data.states.data(t);r&&(this.dataPatched=i.patch(this.data,r),i.toOps(this.data,r).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}r&&this.updateTransformState(this.dataPatched),this.stateSelection=t}}updateState(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.visible&&(this.visible=t.visible),this.updateTransformState(t)}updateByPatchedOpBase(t,e,i){this.dataPatched=e,this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){0===t.path.length&&0===t.type&&this.updateState(t.props,i),this.requestRender()}traverseFrameAncestors(t){this.traverseAncestors(e=>{"frame2d"===e.data.type&&t(e)})}traverseAncestors(t){let e=this.parent;for(;e;)t(e),e=e.parent}requestRender(){this.traverseFrameAncestors(t=>{t.requestRender()})}clone(t){let e=new z(this.uuid,this.data,t);return e.parent=void 0,e}addEventListener(t,e){this.emitter.on(t,e)}removeEventListener(t,e){this.emitter.off(t,e)}dispatchEvent(t){this.emitter.emit(t.type,{...t,target:t.target??this})}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children;if(e){let i=e.indexOf(this)+1;return e[i]?e[i]:t.traverseSortNextHelper()}}}sortNext(){let t=this.children;return t&&t.length>0&&t[0]?t[0]:this.traverseSortNextHelper()}isDescendantOf(t){t instanceof z&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}},E=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.blurRadius=0,this.offset=[0,0],this.spread=0,this.update(e)}update(t){void 0!==t.color&&(this.color=t.color),void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.blurRadius&&(this.blurRadius=t.blurRadius),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.spread&&(this.spread=t.spread)}},O=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.radius=0,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.radius&&(this.radius=t.radius)}},H=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color)}},L=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=a.transparent,this.thickness=0,this.mode="inside",this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.mode&&(this.mode=t.mode)}},F=class extends z{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.autoClose=!0,this.fill=new H(t+"-fill",e.fill,i),this.stroke=new L(t+"-stroke",e.stroke,i),this.dropShadow=new E(t+"-dropShadow",e.dropShadow,i),this.innerShadow=new E(t+"-innerShadow",e.innerShadow,i),this.backgroundBlur=new O(t+"-backgroundBlur",e.backgroundBlur,i),this.layerBlur=new O(t+"-layerBlur",e.layerBlur,i)}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:a.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:a.transparent,t.strokeMode=this.stroke.mode,t.lineWidth=this.stroke.thickness}applyFilters(t){this.layerBlur.enabled?t.layerBlur=5*this.layerBlur.radius:t.layerBlur=0,this.backgroundBlur.enabled?t.backgroundBlur=5*this.backgroundBlur.radius:t.backgroundBlur=0,this.dropShadow.enabled?(t.dropShadowBlur=5*this.dropShadow.blurRadius,t.dropShadowColor=this.dropShadow.color,t.dropShadowOffsetX=this.dropShadow.offset[0],t.dropShadowOffsetY=this.dropShadow.offset[1]):t.dropShadowColor=a.transparent,this.innerShadow.enabled?(t.innerShadowSpread=this.innerShadow.spread,t.innerShadowBlur=5*this.innerShadow.blurRadius,t.innerShadowColor=this.innerShadow.color,t.innerShadowOffsetX=this.innerShadow.offset[0],t.innerShadowOffsetY=this.innerShadow.offset[1]):t.innerShadowColor=a.transparent}innerDraw(t){}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.applyFilters(t),this.applyFillStroke(t),t.beginPath(),this.innerDraw(t),this.autoClose&&t.closePath(),this.fill.enabled&&t.fill(),this.stroke.enabled&&t.stroke(),t.restore())}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}updateState(t,e){super.updateState(t,e),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur)}clone(t){let e=new F(this.uuid,this.data,t);return e.parent=void 0,e}},U=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.updateState(e,i)}innerDraw(t){t.ellipse(.5*this.width,.5*this.height,.5*this.width,.5*this.height,0,0,2*Math.PI)}intersectsInLocalSpace(t,e){return function(t,e,i,r,s,n){let a=t-i,h=e-r;return a*a/(s*s)+h*h/(n*n)<=1}(t,e,.5*this.width,.5*this.height,.5*this.width,.5*this.height)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t)}clone(t){let e=new U(this.uuid,this.data,t);return e.parent=void 0,e}},N=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.cornerRadius=[0,0,0,0],this.updateState(e,i)}innerDraw(t){t.rect(0,0,this.width,this.height,...this.cornerRadius)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t)}clone(t){let e=new N(this.uuid,this.data,t);return e.parent=void 0,e}},j=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._textHeight=0,this._textHeightDirty=!0,this.width=0,this.height=0,this.updateState(e,i)}get textHeight(){return this._textHeight}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:a.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:a.transparent,t.strokeMode="center",t.lineWidth=this.stroke.thickness}innerDraw(t){this._fontHolder?.arrayBuffer&&this._fontHolder.arrayBuffer.byteLength>1&&this.data.font&&t.registerFont(this._fontHolder.arrayBuffer,this.data.font);let e=this.data.textTransform,i=this.data.text.textValue.toString(),r=2===e?i.toUpperCase():3===e?i.toLowerCase():i,{height:s}=t.drawText(r,{x:0,y:0,width:this.width,height:this.height,fontSize:this.data.fontSize,lineHeight:this.data.lineHeight??1,letterSpacing:this.data.letterSpacing??0,horizontalAlign:this.data.horizontalAlign,verticalAlign:this.data.verticalAlign,font:this.data.font});this._textHeight=s}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateFontState(t,{shared:e}){void 0!==t.font&&(this._fontHolder=e.getFont(t.font),this._fontHolder&&!this._fontHolder.isLoaded&&this._fontHolder.loadingPromise.then(()=>{this.requestRender()}))}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateFontState(t,e)}clone(t){let e=new j(this.uuid,this.data,t);return e.parent=void 0,e}},I=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.curves=[],this.extremasBBox={min:[0,0],max:[0,0]},this.updateState(e,i)}computeExtremas(){0===this.curves.length&&this.computeCurves();let t=this.curves.map(t=>b.extremas(t)),e=[1/0,1/0],i=[-1/0,-1/0];for(let r=0,s=t.length;r<s;r++){let s=t[r];s[0][0]<e[0]&&(e[0]=s[0][0]),s[0][1]<e[1]&&(e[1]=s[0][1]),s[1][0]>i[0]&&(i[0]=s[1][0]),s[1][1]>i[1]&&(i[1]=s[1][1])}return this.extremasBBox.min=[e[0],e[1]],this.extremasBBox.max=[i[0],i[1]],this.extremasBBox}computeCurves(){this.curves=[];for(let t=1,e=this.data.points.length;t<e;t++){let e=this.data.points[t].data,i=this.data.points[t-1].data,r={start:i.position,cp1:i.controlNext.position,cp2:e.controlPrevious.position,end:e.position};this.curves.push(r)}let t=this.data.points[0].data,e=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let i={start:e.position,cp1:e.controlNext.position,cp2:t.controlPrevious.position,end:t.position};this.curves.push(i)}}getCenter(){let[t,e]=this.extremasBBox.min,[i,r]=this.getHalfSize();return[t+i,e+r]}getHalfSize(){let{min:t,max:e}=this.extremasBBox;return[.5*(e[0]-t[0]),.5*(e[1]-t[1])]}innerDraw(t){for(let e=0,i=this.data.points.length;e<i;e++){let i=this.data.points[e].data;if(0===e){let[e,r]=i.position;t.moveTo(e,r)}else{let r=this.data.points[e-1].data,[s,n]=r.controlNext.position,[a,h]=i.controlPrevious.position,[o,l]=i.position,d={start:r.position,cp1:r.controlNext.position,cp2:i.controlPrevious.position,end:i.position};b.derive(d),t.bezierCurveTo(s,n,a,h,o,l)}}let e=this.data.points[0].data,i=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let[r,s]=i.controlNext.position,[n,a]=e.controlPrevious.position,[h,o]=e.position;t.bezierCurveTo(r,s,n,a,h,o)}}updateState(t,e){super.updateState(t,e),this.computeExtremas()}clone(t){let e=new I(this.uuid,this.data,t);return e.parent=void 0,e}};(t=>{function e(t,e,i,r=!1){let s=t-2*e+i;if(0!==s){let r=-Math.sqrt(Math.abs(e*e-t*i)),n=-t+e;return[-(r+n)/s,-(-r+n)/s]}return e!==i&&0===s?[(2*e-i)/(2*(e-i))]:[]}t.derive=function(t){let e=t.start,i=t.cp1,r=t.cp2,s=t.end,n={start:[3*(i[0]-e[0]),3*(i[1]-e[1])],cp:[3*(r[0]-i[0]),3*(r[1]-i[1])],end:[3*(s[0]-r[0]),3*(s[1]-r[1])]};return t.derivative=n,n.derivative=M.derive(n),n},t.droot=function(i){let r=i.derivative??t.derive(i),s=r.start,n=r.cp,a=r.end;return[e(s[0],n[0],a[0]),e(s[1],n[1],a[1])]},t.extremas=function(e){let[i,r]=t.droot(e),s=[e.start[0],e.end[0]],n=[e.start[1],e.end[1]];for(let r of i)s.push(t.compute(e,Math.min(1,Math.max(0,r)))[0]);for(let i of r)n.push(t.compute(e,Math.min(1,Math.max(0,i)))[1]);return s.sort((t,e)=>t-e),n.sort((t,e)=>t-e),[[s[0],n[0]],[s[s.length-1],n[n.length-1]]]},t.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=e*e,n=r*i,a=r*e*3,h=i*s*3,o=e*s;return[n*t.start[0]+a*t.cp1[0]+h*t.cp2[0]+o*t.end[0],n*t.start[1]+a*t.cp1[1]+h*t.cp2[1]+o*t.end[1]]}})(b||(b={})),(C=M||(M={})).derive=function(t){let e=t.start,i=t.cp,r=t.end,s={start:[2*(i[0]-e[0]),2*(i[1]-e[1])],end:[2*(r[0]-i[0]),2*(r[1]-i[1])]};return s.derivative=k.derive(s),t.derivative=s,s},C.droot=function(t){let e=t.derivative??C.derive(t),i=e.start,r=e.end;return[i[0]!==r[0]?i[0]/(i[0]-r[0]):0,i[1]!==r[1]?i[1]/(i[1]-r[1]):0]},C.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=i*e*2,n=e*e;return[r*t.start[0]+s*t.cp[0]+n*t.end[0],r*t.start[1]+s*t.cp[1]+n*t.end[1]]},(A=k||(k={})).derive=function(t){let e=t.start,i=t.end,r=[i[0]-e[0],i[1]-e[1]];return t.derivative=r,t.derivative},A.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=t.start,r=t.end;return[i[0]+(r[0]-i[0])*e,i[1]+(r[1]-i[1])*e]};var D=class extends z{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.context=i,this.isBaseGroup=!0,this.children=[]}add(t){t.parent&&t.parent instanceof D&&t.parent.remove(t),this.children.push(t),t.parent=this}remove(t){let e=this.children.indexOf(t);e>=0&&(this.children.splice(e,1),t.parent=void 0)}traverse(t){let e=t(this);if(!0!==e)for(let i of this.children)i instanceof D?i.traverse(t):e=t(i)}intersectsChildrenHelper(t,e,i,r,s){for(let n of this.children)if(n.intersects(t,e,i,!1)&&(s.push(n),r)||n instanceof D&&n.intersectsChildrenHelper(t,e,i,r,s))return!0;return!1}intersectsChildren(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelper(t,e,i,r,s),s}intersectsChildrenHelperReverse(t,e,i,r,s){for(let n of this.children)if(n instanceof D&&n.intersectsChildrenHelperReverse(t,e,i,r,s)||n.intersects(t,e,i,!1)&&(s.push(n),r))return!0;return!1}intersectsChildrenReverse(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelperReverse(t,e,i,r,s),s}updateWorldMatrix(t,e,i){if(super.updateWorldMatrix(t,e,i),i&&this.children)for(let e of this.children)e.updateWorldMatrix(t,!1,!0)}find(t){let e;return this.traverse(i=>{i.uuid===t&&(e=i)}),e}innerDrawChildren(t){for(let e=this.children.length-1;e>=0;e--)this.children[e].draw(t)}resetBBoxNeedsUpdate(){super.resetBBoxNeedsUpdate(),this.traverse(t=>{t.resetBBoxNeedsUpdateSelf()})}clone(t){let e=new D(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},W=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.updateState(e,i)}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.innerDrawChildren(t),t.restore())}clone(t){let e=new W(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},V=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.width=0,this.height=0,this.clipped=!0,this.background=new N(t+"-background",r.defaultData,i),this.background.parent=this,this.updateState(e,i)}get fill(){return this.background.fill}get stroke(){return this.background.stroke}get backgroundBlur(){return this.background.backgroundBlur}get layerBlur(){return this.background.layerBlur}get dropShadow(){return this.background.dropShadow}get innerShadow(){return this.background.innerShadow}get cornerRadius(){return this.background.cornerRadius}set cornerRadius(t){this.background.cornerRadius=t}updateLocalMatrix(){super.updateLocalMatrix(),this.background?.updateLocalMatrix()}updateWorldMatrix(t,e,i){super.updateWorldMatrix(t,e,i),this.background?.updateWorldMatrix(t,e,i)}draw(t){if(!this.visible)return;t.save();let e=this.width,i=this.height;this.applyTransforms(t),this.background.width=e,this.background.height=i,this.background.draw(t),this.clipped&&t.clipRect(0,0,e,i,...this.cornerRadius),this.innerDrawChildren(t),t.restore()}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur),void 0!==t.clipped&&(this.clipped=t.clipped)}requestRender(){super.requestRender(),this.dispatchEvent({type:"render"})}dispose(){this.removeEventListener("render")}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}clone(t){let e=new V(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},X=u(g(),1),q=new Map,Y=null,$=class extends F{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._pathBBox=new DOMRect,this.path="",this.updateState(e,i),this.autoClose=!1,this.computeSVGBBox()}computeSVGBBox(){let t=this.path;G(this.path)&&(console.warn("Invalid SVG path",this.uuid),t=""),this._pathBBox=function(t){let e=q.get(t);if(void 0!==e)return e;if(null===Y||!Y.isConnected){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none",Y=document.createElementNS("http://www.w3.org/2000/svg","path"),t.appendChild(Y),document.body.appendChild(t)}Y.setAttribute("d",t);let i=Y.getBBox();return q.size>=4096&&q.clear(),q.set(t,i),i}(t)}innerDraw(t){t.path(this.path)}intersectsInLocalSpace(t,e){return t>=this._pathBBox.x&&t<=this._pathBBox.x+this._pathBBox.width&&e>=this._pathBBox.y&&e<=this._pathBBox.y+this._pathBBox.height}getCenter(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}getHalfSize(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}updateState(t,e){super.updateState(t,e),void 0!==t.path&&(this.path=t.path,this.computeSVGBBox())}clone(t){let e=new $(this.uuid,this.data,t);return e.parent=void 0,e}};function G(t){return/NaN/.test(t)}function Q(t,e=1,i=1){if(e<=0||i<=0)return t;if(G(t))return console.warn("Cannot scale invalid path",t),Z([]);if(1===e&&1===i)return t;try{return Z((0,X.parseSVG)(t).map(t=>{let r={...t};return"x"in r&&(r.x=r.x*e),"y"in r&&(r.y=r.y*i),"x1"in r&&(r.x1=r.x1*e),"x2"in r&&(r.x2=r.x2*e),"y1"in r&&(r.y1=r.y1*i),"y2"in r&&(r.y2=r.y2*i),"rx"in r&&(r.rx=r.rx*e),"ry"in r&&(r.ry=r.ry*i),r}))}catch(t){return console.warn("Error parsing SVG path",t),Z([])}}function Z(t){let e,i=["rx","ry","xAxisRotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(t=>{let r=[];i.forEach(e=>{if(e in t){let i=1*t[e];r.length&&i>=0&&r.push(","),r.push(i)}});let s=(e===t.code?r[0]<0?"":",":t.code)+r.join("");return e=t.code,s}).join("")}var J=class{constructor(t,e,i){this.uuid=t,this.data=e,this.group=new W(J.GROUP_ID,{...s.defaultData},i),this.createChildrenObjects(e.objects,this.group,i)}createObject(t,e,i,r,s,n){let a=function(t,e,i){switch(e.type){case"ellipse2d":return new U(t,e,i);case"rectangle2d":return new N(t,e,i);case"text2d":return new j(t,e,i);case"vector2d":return new I(t,e,i);case"path2d":return new $(t,e,i);case"frame2d":return new V(t,e,i);default:return new W(t,e,i)}}(t,e,n);a&&(r.add(a),r.children.splice(s,0,r.children.pop()),a.updateWorldMatrix(),i.length>0&&(a instanceof W||a instanceof V)&&this.createChildrenObjects(i,a,n))}createChildrenObjects(t,e,i){let r=0;for(let s of t)this.createObject(s.id,s.data,s.children,e,r,i),r+=1}draw(t){this.group.draw(t)}updateEntityByOp(t,e,i,r){let s=this.find(t);if(s)try{s.updateByOp(e,i,{shared:r})}catch(t){console.error(t)}}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let i=null===t.parent?this.group:this.find(t.parent);void 0!==i&&i instanceof D&&(this.createObject(t.id,t.data,t.children,i,t.localIndex,e),i.requestRender())}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0!==e&&void 0!==e.parent&&e.parent instanceof D){let t=e.parent;e.resetBBoxNeedsUpdate(),t?.remove(e),t?.requestRender()}}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0!==e){let i=e.parent,r=null===t.parent?this:this.find(t.parent);if(r instanceof D||r===this){r.add(e);let s=t.localIndex;r.children.splice(s,0,r.children.pop()),e.updateWorldMatrix(!0,!1,!0),i?.requestRender(),e.requestRender()}e.resetBBoxNeedsUpdate()}}}add(t){this.group.add(t)}remove(t){this.group.remove(t)}traverse(t){this.group.traverse(e=>{e!==this.group&&t(e)})}intersectsChildren(t,e,i,r=!1,s=[]){return this.group.intersectsChildren(t,e,i,r,s,!0)}intersectsChildrenReverse(t,e,i,r=!1,s=[]){return this.group.intersectsChildrenReverse(t,e,i,r,s,!0)}find(t){return this.group.find(t)}get children(){return this.group.children}project(t,e){return this.group.project(t,e)}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let i=[],r=e;for(;r!==this.group;){let t=r;r=r.parent;let e=r.children.indexOf(t);i.splice(0,0,e)}return{entity:e,sortKey:i}}getAllSorted(t){let e=[];for(let i of t){let t=this.getWithSortKey(i.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>h(t.sortKey,e.sortKey)),e.map(t=>t.entity)}},K=J;K.GROUP_ID="scene2d";var tt=u(g(),1);function et(t,e,i,r,s,n,a,h,o,l){if(e===o&&i===l)return;if(r=Math.abs(r),s=Math.abs(s),0===r||0===s)return void t.push({LineTo:{x:o,y:l}});let d=n*Math.PI/180,u=Math.cos(d),c=Math.sin(d),p=(e-o)/2,f=(i-l)/2,x=u*p+c*f,g=-c*p+u*f,m=x*x/(r*r)+g*g/(s*s);if(m>1){let t=Math.sqrt(m);r*=t,s*=t}let y=r*r,v=s*s,w=y*v-y*g*g-v*x*x,_=y*g*g+v*x*x,S=(a!==h?1:-1)*Math.sqrt(Math.max(0,w/_)),B=S*(r*g)/s,b=S*(-s*x)/r,M=u*B-c*b+(e+o)/2,C=c*B+u*b+(i+l)/2,k=Math.atan2((g-b)/s,(x-B)/r),A=Math.atan2((-g-b)/s,(-x-B)/r)-k;!h&&A>0?A-=2*Math.PI:h&&A<0&&(A+=2*Math.PI);let T=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2))),P=A/T,R=4/3*Math.tan(P/4),z=k,E=e,O=i;for(let e=0;e<T;e++){let e=z+P,i=Math.cos(z),n=Math.sin(z),a=Math.cos(e),h=Math.sin(e),o=M+r*a*u-s*h*c,l=C+r*a*c+s*h*u,d=-r*n*u-s*i*c,p=-r*n*c+s*i*u,f=-r*h*u-s*a*c,x=-r*h*c+s*a*u;t.push({CurveTo:[{x:E+R*d,y:O+R*p},{x:o-R*f,y:l-R*x},{x:o,y:l}]}),z=e,E=o,O=l}}var it=.5522847498307936,rt=3408/2816,st=1536/2816,nt=!1;function at(){nt||(nt=!0,console.warn("[HanaRenderer] clipRect: precise clipping of rotated/complex content is not supported by the Hana UI overlay yet; drawing unclipped. (Axis-aligned rectangles are clipped geometrically.)"))}var ht=class{constructor(t,e=1){this.canvas=t,this._dpr=e,this._width=0,this._height=0,this._isSizeDirty=!1,this._crashed=!1,this._shapes=[],this._lastPushedJSON="",this._ctm=_.identity(),this._stack=[],this._clips=[],this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0,this._fillColor=a.transparent,this._strokeColor=a.transparent,this._lineWidth=1,this._strokeMode="inside",this._layerBlur=0,this._backgroundBlur=0,this._dropShadowBlur=0,this._dropShadowOffsetX=0,this._dropShadowOffsetY=0,this._dropShadowColor=a.transparent,this._innerShadowBlur=0,this._innerShadowOffsetX=0,this._innerShadowOffsetY=0,this._innerShadowSpread=0,this._innerShadowColor=a.transparent,this._fonts=new Map,this._fontsFlushed=new Set,this._fontXPerEm=new Map,this._measureCache=new Map;try{let i=t.getBoundingClientRect();t.width=i.width*e,t.height=i.height*e}catch{console.log(t.width,e)}}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this._isSizeDirty=!0}get width(){return this._width}get height(){return this._height}async init(){if(!this._engine&&!this._crashed){try{this._context=await m(),this._engine=await this._context.createEngine(this.canvas)}catch(t){return this._crashed=!0,void console.error("[HanaRenderer] Failed to load the Hana UI engine; UI scenes will not render.",t)}if(this._width>0&&this._height>0)this._syncViewport();else{let t=this.canvas.getBoundingClientRect();t.width>0&&t.height>0&&(this._width=t.width,this._height=t.height,this._syncViewport())}this._flushFonts(),this.uiFontReady=this._watchUiFont()}}_watchUiFont(){return new Promise(t=>{let e=this._engine;if(!e||"function"!=typeof e.scene.isUiFontLoaded)return void t();let i=()=>{let t=!1;return this._guard(()=>{t=e.scene.isUiFontLoaded()}),t};if(i())return void t();let r=Date.now(),s=setInterval(()=>{this._crashed||Date.now()-r>3e5?clearInterval(s):i()&&(clearInterval(s),t())},150)})}_syncViewport(){let t=this._engine;if(!t||this._crashed)return;let e=this._width,i=this._height;this.canvas.style.width=e+"px",this.canvas.style.height=i+"px",this.canvas.width=Math.max(1,Math.ceil(e*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(i*this._dpr)),this._guard(()=>{t.resize([e,i],this._dpr),t.scene.updateCamera({position:[e/2,i/2],zoom:1})})}setSize(t,e){!this._isSizeDirty&&t===this._width&&e===this._height||(this._isSizeDirty=!1,this._width=t,this._height=e,this._engine?this._syncViewport():(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",this.canvas.width=Math.max(1,Math.ceil(t*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(e*this._dpr))))}_guard(t){if(!this._crashed)try{t()}catch(t){this._crashed=!0,console.error("[HanaRenderer] Hana engine call failed; disabling this renderer instance.",t)}}async loadFont(t,e){try{let i=await fetch(t);if(!i.ok)return void console.error(`[HanaRenderer] loadFont: ${t} returned HTTP ${i.status}; skipping "${e}"`);let r=await i.arrayBuffer();if(0===r.byteLength)return void console.error(`[HanaRenderer] loadFont: ${t} was empty; skipping "${e}"`);this.registerFont(r,e)}catch(i){console.error(`[HanaRenderer] loadFont failed for "${e}" (${t}):`,i)}}registerFont(t,e){if(this._fonts.has(e))return;this._fonts.set(e,t);let i=function(t){try{let e=new DataView(t),i=e.getUint32(0);if(65536!==i&&1330926671!==i&&1953658213!==i)return;let r=e.getUint16(4),s=-1,n=-1;for(let t=0;t<r;t++){let i=12+16*t,r=e.getUint32(i);1751474532===r&&(s=e.getUint32(i+8)),1330851634===r&&(n=e.getUint32(i+8))}if(s<0||n<0)return;let a=e.getUint16(s+18),h=e.getUint16(n);if(0===a||h<2)return;let o=e.getInt16(n+86);return o>0?o/a:void 0}catch{return}}(t);void 0!==i&&this._fontXPerEm.set(e,i),this._flushFonts()}_flushFonts(){let t=this._engine;if(t)for(let[e,i]of this._fonts)this._fontsFlushed.has(e)||(this._fontsFlushed.add(e),this._guard(()=>{t.scene.addLocalFont(e,new Uint8Array(i))}))}set strokeColor(t){this._strokeColor=t}set fillColor(t){this._fillColor=t}set lineWidth(t){this._lineWidth=t}set strokeMode(t){this._strokeMode=t}set dropShadowBlur(t){this._dropShadowBlur=t}set dropShadowColor(t){this._dropShadowColor=t}set dropShadowOffsetX(t){this._dropShadowOffsetX=t}set dropShadowOffsetY(t){this._dropShadowOffsetY=t}set innerShadowBlur(t){this._innerShadowBlur=t}set innerShadowColor(t){this._innerShadowColor=t}set innerShadowOffsetX(t){this._innerShadowOffsetX=t}set innerShadowOffsetY(t){this._innerShadowOffsetY=t}set innerShadowSpread(t){this._innerShadowSpread=t}set layerBlur(t){this._layerBlur=t}set backgroundBlur(t){this._backgroundBlur=t}save(){this._stack.push({ctm:_.copy(this._ctm),clipLen:this._clips.length})}restore(){let t=this._stack.pop();!t||(this._ctm=t.ctm,this._clips.length=t.clipLen)}setTransform(t,e=!1){let i=_.identity();if(this.camera?.enabled&&(i=_.append(i,this.camera.worldMatrix),e)){let t=_.getScale(this.camera.worldMatrix);i=_.scale(i,1/t[0],1/t[1])}this._ctm=_.append(i,t)}transform(t){this._ctm=_.append(this._ctm,t)}beginPath(){this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0}closePath(){0!==this._pathEls.length&&"ClosePath"!==this._pathEls[this._pathEls.length-1]&&this._pathEls.push("ClosePath")}_startFreeform(){this._simpleShape=null,this._pathPrimitives++}moveTo(t,e){this._startFreeform(),this._pathEls.push({MoveTo:{x:t,y:e}})}lineTo(t,e){this._startFreeform(),this._pathEls.push({LineTo:{x:t,y:e}})}bezierCurveTo(t,e,i,r,s,n){this._startFreeform(),this._pathEls.push({CurveTo:[{x:t,y:e},{x:i,y:r},{x:s,y:n}]})}quadraticCurveTo(t,e,i,r){this._startFreeform(),this._pathEls.push({QuadTo:[{x:t,y:e},{x:i,y:r}]})}path(t){this._startFreeform(),this._pathEls.push(...function(t){let e,i=[];try{e=(0,tt.makeAbsolute)((0,tt.parseSVG)(t))}catch(t){return console.error("[HanaRenderer] Failed to parse SVG path:",t),i}let r=0,s=0,n=0,a=0,h=null,o=null;for(let t of e){let e=null,l=null;switch(t.code){case"M":r=n=t.x,s=a=t.y,i.push({MoveTo:{x:r,y:s}});break;case"L":r=t.x,s=t.y,i.push({LineTo:{x:r,y:s}});break;case"H":r=t.x,i.push({LineTo:{x:r,y:s}});break;case"V":s=t.y,i.push({LineTo:{x:r,y:s}});break;case"C":{let n={x:t.x1,y:t.y1},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"S":{let n=h?{x:2*r-h.x,y:2*s-h.y}:{x:r,y:s},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"Q":{let e={x:t.x1,y:t.y1};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"T":{let e=o?{x:2*r-o.x,y:2*s-o.y}:{x:r,y:s};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"A":{let e=r,n=s;r=t.x,s=t.y,et(i,e,n,t.rx,t.ry,t.xAxisRotation,t.largeArc,t.sweep,r,s);break}case"Z":r=n,s=a,i.push("ClosePath")}h=e,o=l}return i}(t))}rect(t,e,i,r,s=0,n=0,a=0,h=0){if(!ct([t,e,i,r]))return;let o={x:t,y:e,w:i,h:r,radii:[s,n,a,h]};this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"rect",rect:o,smoothing:0}:null,gt(this._pathEls,o)}ellipse(t,e,i,r,s,n,a,h){if(ct([t,e,i,r])){if(i<0||r<0)throw Error("radii cannot be negative");this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"ellipse",cx:t,cy:e,rx:i,ry:r}:null,function(t,e,i,r,s){let n=r*it,a=s*it;t.push({MoveTo:{x:e+r,y:i}},{CurveTo:[{x:e+r,y:i+a},{x:e+n,y:i+s},{x:e,y:i+s}]},{CurveTo:[{x:e-n,y:i+s},{x:e-r,y:i+a},{x:e-r,y:i}]},{CurveTo:[{x:e-r,y:i-a},{x:e-n,y:i-s},{x:e,y:i-s}]},{CurveTo:[{x:e+n,y:i-s},{x:e+r,y:i-a},{x:e+r,y:i}]},"ClosePath")}(this._pathEls,t,e,i,r)}}clipRect(t,e,i,r,s=0,n=0,a=0,h=0){let o=_.invert(this._ctm);!o||this._clips.push({m:_.copy(this._ctm),inv:o,rect:{x:t,y:e,w:i,h:r,radii:[s,n,a,h]}})}fill(){this._emit(!0)}stroke(){this._strokeColor.a<=0||this._lineWidth<=0||this._emit(!1)}_emit(t){let e=this._effectChain(t);if(t&&this._fillColor.a<=0&&!e)return;let i=this._classifyShape();if(!i)return;let r=this._applyClips(i);if("skip"===r)return;if(!t&&r!==i){let t=ft(i);if(t)return void this._emitClippedRectStroke(t,e)}i=r;let s={shape:i,color:t?ut(this._fillColor):[0,0,0,0],transform:_.getAbcdef(this._ctm)};t||(s.stroke=this._strokeDesc()),e&&(s.effect_chain=e),this._shapes.push(s)}_emitClippedRectStroke(t,e){let i=this._lineWidth,r="outside"===this._strokeMode?i:"center"===this._strokeMode?i/2:0,s=i-r,n=Math.min(t.w,t.h)/2,a=t.radii.map(t=>Math.max(0,Math.min(t,n))),h={x:t.x-r,y:t.y-r,w:t.w+2*r,h:t.h+2*r,radii:a.map(t=>t>0?t+r:0)},o=t.w-2*s,l=t.h-2*s,d=o>0&&l>0?{x:t.x+s,y:t.y+s,w:o,h:l,radii:a.map(t=>Math.max(0,t-s))}:null,u=this._applyClips(pt(h,0));if("skip"===u)return;let c=ft(u)??h,p=null;if(d){let t=this._applyClips(pt(d,0));p="skip"===t?null:ft(t)??d}let f=[];gt(f,c),p&&function(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i,y:r+n}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i+s,y:r}},"ClosePath");let u=1-it;t.push({MoveTo:{x:i+h,y:r}}),h>0&&t.push({CurveTo:[{x:i+h*u,y:r},{x:i,y:r+h*u},{x:i,y:r+h}]}),t.push({LineTo:{x:i,y:r+n-d}}),d>0&&t.push({CurveTo:[{x:i,y:r+n-d*u},{x:i+d*u,y:r+n},{x:i+d,y:r+n}]}),t.push({LineTo:{x:i+s-l,y:r+n}}),l>0&&t.push({CurveTo:[{x:i+s-l*u,y:r+n},{x:i+s,y:r+n-l*u},{x:i+s,y:r+n-l}]}),t.push({LineTo:{x:i+s,y:r+o}}),o>0&&t.push({CurveTo:[{x:i+s,y:r+o*u},{x:i+s-o*u,y:r},{x:i+s-o,y:r}]}),t.push("ClosePath")}(f,p);let x={shape:{Custom:f},color:ut(this._strokeColor),transform:_.getAbcdef(this._ctm)};e&&(x.effect_chain=e),this._shapes.push(x)}_classifyShape(){let t=this._simpleShape;return t?"rect"===t.kind?pt(t.rect,t.smoothing):{Ellipse:{center_x:t.cx,center_y:t.cy,rx:t.rx,ry:t.ry}}:0===this._pathEls.length?null:{Custom:this._pathEls.slice()}}_strokeDesc(){return{width:this._lineWidth,line_join:"Miter",color:ut(this._strokeColor),align:ot[this._strokeMode],cap:"Butt"}}_effectChain(t){let e=this.camera?.scale??1,i=[];if(t&&this._dropShadowColor.a>0&&i.push({DropShadow:{position:[this._dropShadowOffsetX*e,this._dropShadowOffsetY*e],blur:{Uniform:{size:2*this._dropShadowBlur*e}},spread:0,color:ut(this._dropShadowColor)}}),t&&this._backgroundBlur>0){let[t,e]=_.getScale(this._ctm),r=(t+e)/2;i.push({BackgroundBlur:{blur:{Uniform:{size:2*this._backgroundBlur*r}}}})}if(this._layerBlur>0&&i.push({LayerBlur:{blur:{Uniform:{size:2*this._layerBlur*e}}}}),t&&this._innerShadowColor.a>0){let[t,r,s,n]=_.getAbcdef(this._ctm),a=this._innerShadowOffsetX,h=this._innerShadowOffsetY;i.push({InnerShadow:{position:[t*a+s*h,r*a+n*h],blur:{Uniform:{size:2*this._innerShadowBlur*e}},spread:this._innerShadowSpread*e,color:ut(this._innerShadowColor)}})}return i.length>0?i:void 0}_applyClips(t){if(0===this._clips.length)return t;let e=t;for(let t of this._clips){let i=_.append(t.inv,this._ctm),[r,s,n,a,h,o]=_.getAbcdef(i),l=Math.abs(s)<=1e-6*(Math.abs(r)+Math.abs(a))&&Math.abs(n)<=1e-6*(Math.abs(r)+Math.abs(a)),d=xt(e);if(!d)return e;if(!l){at();continue}let u=r*d.minX+h,c=r*d.maxX+h,p=a*d.minY+o,f=a*d.maxY+o,x=Math.min(u,c),g=Math.max(u,c),m=Math.min(p,f),y=Math.max(p,f),v=t.rect,w=Math.max(x,v.x),S=Math.max(m,v.y),B=Math.min(g,v.x+v.w),b=Math.min(y,v.y+v.h);if(w>=B||S>=b)return"skip";if(w===x&&S===m&&B===g&&b===y)continue;let M=ft(e);if(!M||0===r||0===a){at();continue}let C=(w-h)/r,k=(B-h)/r,A=(S-o)/a,T=(b-o)/a,P=Math.min(C,k),R=Math.min(A,T),z=Math.abs(k-C),E=Math.abs(T-A),[O,H,L,F]=M.radii,U=P!==M.x,N=R!==M.y,j=P+z!==M.x+M.w,I=R+E!==M.y+M.h,D=Math.min(z,E)/2;e=pt({x:P,y:R,w:z,h:E,radii:[U||N?0:Math.min(O,D),j||N?0:Math.min(H,D),j||I?0:Math.min(L,D),U||I?0:Math.min(F,D)]},0)}return e}drawText(t,e){let i=this._fontXPerEm.get(e.font),r=i?i/st:1,s={TextSimple:{text:t,font_size:e.fontSize*rt*r,size:[e.width,e.height],horizontal_align:lt[e.horizontalAlign]??"Left",vertical_align:dt[e.verticalAlign]??"Top"}},n=this._effectChain(!0),a=this._fillColor.a>0,h=this._strokeColor.a>0&&this._lineWidth>0;if(a||h||n){let t={shape:s,color:a?ut(this._fillColor):[0,0,0,0],transform:_.getAbcdef(_.append(this._ctm,_.translate(_.identity(),e.x,e.y)))};h&&(t.stroke=this._strokeDesc()),n&&(t.effect_chain=n),this._shapes.push(t)}return{height:this._measureTextHeight(t,e)}}_measureTextHeight(t,e){let i=`${e.font}|${e.fontSize}|${e.lineHeight}|${e.letterSpacing}|${e.width}|${t}`,r=this._measureCache.get(i);if(void 0!==r)return r;let s=0,n=this._engine;if(n&&!this._crashed&&this._fontsFlushed.has(e.font))try{let[,i]=n.scene.measureTextNaturalSize({size:[e.width,e.height],text:t,fontSize:e.fontSize,horizontalAlign:lt[e.horizontalAlign]??"Left",verticalAlign:dt[e.verticalAlign]??"Top",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,textTransform:"None",font:e.font,version:0,autoSize:"None",truncate:"None"});s=i}catch{}if(!(s>0)){let i=.55*e.fontSize+Math.max(0,e.letterSpacing),r=Math.max(1,Math.floor(e.width/i)),n=0;for(let e of t.split("\n"))n+=Math.max(1,Math.ceil(e.length/r));s=n*e.fontSize*e.lineHeight}return this._measureCache.size>512&&this._measureCache.clear(),this._measureCache.set(i,s),s}clear(){this._shapes=[],this._ctm=_.identity(),this._stack.length=0,this._clips.length=0}render(){let t=this._engine;if(!t||this._crashed)return;let e=JSON.stringify(this._shapes);e!==this._lastPushedJSON&&(this._guard(()=>t.scene.updateUiShapes(this._shapes)),this._lastPushedJSON=e),this._guard(()=>t.onFrame())}},ot={inside:"Inside",outside:"Outside",center:"Center"},lt={1:"Left",2:"Right",3:"Center",4:"Justify"},dt={1:"Top",2:"Center",3:"Bottom"};function ut({r:t,g:e,b:i,a:r}){return[t,e,i,r]}function ct(t){for(let e=0;e<t.length;e++)if(void 0!==t[e]&&!Number.isFinite(t[e]))return!1;return!0}function pt(t,e){let[i,r,s,n]=t.radii;return 0===i&&0===r&&0===s&&0===n?{Rectangle:{x:t.x,y:t.y,width:t.w,height:t.h}}:{RoundedRectangle:{x:t.x,y:t.y,width:t.w,height:t.h,radius:[i,r,s,n],corner_smoothing:e}}}function ft(t){if("Rectangle"in t){let e=t.Rectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[0,0,0,0]}}if("RoundedRectangle"in t){let e=t.RoundedRectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[e.radius[0],e.radius[1],e.radius[2],e.radius[3]]}}return null}function xt(t){let e=ft(t);if(e)return{minX:e.x,minY:e.y,maxX:e.x+e.w,maxY:e.y+e.h};if("Ellipse"in t){let e=t.Ellipse;return{minX:e.center_x-e.rx,minY:e.center_y-e.ry,maxX:e.center_x+e.rx,maxY:e.center_y+e.ry}}if("TextSimple"in t){let e=t.TextSimple;return{minX:0,minY:0,maxX:e.size[0],maxY:e.size[1]}}if("Custom"in t){let e=1/0,i=1/0,r=-1/0,s=-1/0,n=t=>{t.x<e&&(e=t.x),t.y<i&&(i=t.y),t.x>r&&(r=t.x),t.y>s&&(s=t.y)};for(let e of t.Custom)"ClosePath"!==e&&("MoveTo"in e?n(e.MoveTo):"LineTo"in e?n(e.LineTo):"QuadTo"in e?e.QuadTo.forEach(n):"CurveTo"in e&&e.CurveTo.forEach(n));return e===1/0?null:{minX:e,minY:i,maxX:r,maxY:s}}return null}function gt(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i+s,y:r}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i,y:r+n}},"ClosePath");let u=1-it;t.push({MoveTo:{x:i+h,y:r}}),t.push({LineTo:{x:i+s-o,y:r}}),o>0&&t.push({CurveTo:[{x:i+s-o*u,y:r},{x:i+s,y:r+o*u},{x:i+s,y:r+o}]}),t.push({LineTo:{x:i+s,y:r+n-l}}),l>0&&t.push({CurveTo:[{x:i+s,y:r+n-l*u},{x:i+s-l*u,y:r+n},{x:i+s-l,y:r+n}]}),t.push({LineTo:{x:i+d,y:r+n}}),d>0&&t.push({CurveTo:[{x:i+d*u,y:r+n},{x:i,y:r+n-d*u},{x:i,y:r+n-d}]}),t.push({LineTo:{x:i,y:r+h}}),h>0&&t.push({CurveTo:[{x:i,y:r+h*u},{x:i+h*u,y:r},{x:i+h,y:r}]}),t.push("ClosePath")}function mt({constraints:t,newParentWidth:e,newParentHeight:i,initialParentWidth:r,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:a,objectInitialPosition:h}){let{horizontalConstraint:o,verticalConstraint:l}=t,d=e-r,u=i-s,c=n,p=a,f=h[0],x=h[1];if(0!==o)if(1===o)f+=d;else if(3===o)f+=d/2;else if(2===o)c=Math.max(1,c+d);else if(4===o){let t=e/r;c*=t,f*=t}if(0!==l)if(1===l)x+=u;else if(3===l)x+=u/2;else if(2===l)p=Math.max(1,p+u);else if(4===l){let t=i/s;p*=t,x*=t}return{width:c,height:p,position:[f,x]}}u(g(),1);export{_ as a,y as b,v as c,ht as d,F as e,U as f,N as g,j as h,W as i,V as j,$ as k,Q as l,K as m,mt as n};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./runtime-chunk-
|
|
1
|
+
import{j as e}from"./runtime-chunk-6ARRPM23.js";import{Ed as t,Fc as r,Oc as i,We as n,cd as a,jd as o}from"./runtime-chunk-BVVSZMXD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=B(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function B(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
|