@splinetool/runtime 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/build/opentype.js +1 -1
  2. package/build/opentype.js.br +0 -0
  3. package/build/opentype.js.gz +0 -0
  4. package/build/{runtime-aiAssistant-RMA2DMFU.js → runtime-aiAssistant-KA7ZJ3F6.js} +1 -1
  5. package/build/runtime-aiAssistant-KA7ZJ3F6.js.br +0 -0
  6. package/build/runtime-aiAssistant-KA7ZJ3F6.js.gz +0 -0
  7. package/build/{runtime-apiServices-KA4FEP5Y.js → runtime-apiServices-CGMAW2B4.js} +1 -1
  8. package/build/runtime-apiServices-CGMAW2B4.js.br +0 -0
  9. package/build/runtime-apiServices-CGMAW2B4.js.gz +0 -0
  10. package/build/{runtime-audio-BQSRM3W2.js → runtime-audio-GCUGVRQ3.js} +1 -1
  11. package/build/runtime-audio-GCUGVRQ3.js.br +0 -0
  12. package/build/runtime-audio-GCUGVRQ3.js.gz +0 -0
  13. package/build/{runtime-chunk-R7NC6CZZ.js → runtime-chunk-3KIZF7P5.js} +1 -1
  14. package/build/runtime-chunk-3KIZF7P5.js.br +0 -0
  15. package/build/runtime-chunk-3KIZF7P5.js.gz +0 -0
  16. package/build/{runtime-chunk-TPKGBIJU.js → runtime-chunk-4DNX5FPP.js} +1 -1
  17. package/build/runtime-chunk-4DNX5FPP.js.br +0 -0
  18. package/build/runtime-chunk-4DNX5FPP.js.gz +0 -0
  19. package/build/{runtime-chunk-I5QFGBIU.js → runtime-chunk-4E4NQ6GS.js} +1 -1
  20. package/build/runtime-chunk-4E4NQ6GS.js.br +0 -0
  21. package/build/runtime-chunk-4E4NQ6GS.js.gz +0 -0
  22. package/build/{runtime-chunk-OOC7YSI5.js → runtime-chunk-4KX4KQWR.js} +1 -1
  23. package/build/runtime-chunk-4KX4KQWR.js.br +0 -0
  24. package/build/runtime-chunk-4KX4KQWR.js.gz +0 -0
  25. package/build/{runtime-chunk-MBBODDV7.js → runtime-chunk-5H2Z5KYI.js} +1 -1
  26. package/build/runtime-chunk-5H2Z5KYI.js.br +0 -0
  27. package/build/{runtime-chunk-MBBODDV7.js.gz → runtime-chunk-5H2Z5KYI.js.gz} +0 -0
  28. package/build/{runtime-chunk-RF63UVAU.js → runtime-chunk-AKWBEROQ.js} +1 -1
  29. package/build/runtime-chunk-AKWBEROQ.js.br +0 -0
  30. package/build/runtime-chunk-AKWBEROQ.js.gz +0 -0
  31. package/build/{runtime-chunk-4I22JDL6.js → runtime-chunk-BPYFB4BD.js} +1 -1
  32. package/build/runtime-chunk-BPYFB4BD.js.br +0 -0
  33. package/build/runtime-chunk-BPYFB4BD.js.gz +0 -0
  34. package/build/runtime-chunk-CCJD7IX7.js +1 -0
  35. package/build/runtime-chunk-CCJD7IX7.js.br +0 -0
  36. package/build/runtime-chunk-CCJD7IX7.js.gz +0 -0
  37. package/build/{runtime-chunk-W4ZCHGLQ.js → runtime-chunk-CEAWQBAS.js} +1 -1
  38. package/build/runtime-chunk-CEAWQBAS.js.br +0 -0
  39. package/build/runtime-chunk-CEAWQBAS.js.gz +0 -0
  40. package/build/{runtime-chunk-ZMXEX5NX.js → runtime-chunk-CX2MRLZA.js} +1 -1
  41. package/build/runtime-chunk-CX2MRLZA.js.br +0 -0
  42. package/build/runtime-chunk-CX2MRLZA.js.gz +0 -0
  43. package/build/{runtime-chunk-WHKBOV2O.js → runtime-chunk-FY3XD5P2.js} +1 -1
  44. package/build/runtime-chunk-FY3XD5P2.js.br +0 -0
  45. package/build/runtime-chunk-FY3XD5P2.js.gz +0 -0
  46. package/build/{runtime-chunk-DSJY3WL2.js → runtime-chunk-GN3HDYV2.js} +1 -1
  47. package/build/runtime-chunk-GN3HDYV2.js.br +0 -0
  48. package/build/runtime-chunk-GN3HDYV2.js.gz +0 -0
  49. package/build/{runtime-chunk-LT4UVXE2.js → runtime-chunk-GO25U5WN.js} +1 -1
  50. package/build/runtime-chunk-GO25U5WN.js.br +0 -0
  51. package/build/runtime-chunk-GO25U5WN.js.gz +0 -0
  52. package/build/{runtime-chunk-ESZD4IRS.js → runtime-chunk-H7D3VFTJ.js} +1 -1
  53. package/build/runtime-chunk-H7D3VFTJ.js.br +0 -0
  54. package/build/runtime-chunk-H7D3VFTJ.js.gz +0 -0
  55. package/build/runtime-chunk-HUFJRFTO.js +1 -0
  56. package/build/runtime-chunk-HUFJRFTO.js.br +0 -0
  57. package/build/runtime-chunk-HUFJRFTO.js.gz +0 -0
  58. package/build/{runtime-chunk-SL64ZYCB.js → runtime-chunk-ITLS6YIC.js} +1 -1
  59. package/build/runtime-chunk-ITLS6YIC.js.br +0 -0
  60. package/build/runtime-chunk-ITLS6YIC.js.gz +0 -0
  61. package/build/{runtime-chunk-V5NUL7BL.js → runtime-chunk-JQ3A6ENO.js} +1 -1
  62. package/build/runtime-chunk-JQ3A6ENO.js.br +1 -0
  63. package/build/runtime-chunk-JQ3A6ENO.js.gz +0 -0
  64. package/build/{runtime-chunk-36FZTFCC.js → runtime-chunk-KYA2CB5O.js} +1 -1
  65. package/build/runtime-chunk-KYA2CB5O.js.br +0 -0
  66. package/build/runtime-chunk-KYA2CB5O.js.gz +0 -0
  67. package/build/{runtime-chunk-NTW4X3NC.js → runtime-chunk-LX3KCQF6.js} +1 -1
  68. package/build/runtime-chunk-LX3KCQF6.js.br +0 -0
  69. package/build/runtime-chunk-LX3KCQF6.js.gz +0 -0
  70. package/build/{runtime-chunk-USXMESRF.js → runtime-chunk-M3ZKF7PK.js} +1 -1
  71. package/build/runtime-chunk-M3ZKF7PK.js.br +0 -0
  72. package/build/runtime-chunk-M3ZKF7PK.js.gz +0 -0
  73. package/build/{runtime-chunk-GPACKOH2.js → runtime-chunk-MM2G3DLE.js} +1 -1
  74. package/build/runtime-chunk-MM2G3DLE.js.br +0 -0
  75. package/build/runtime-chunk-MM2G3DLE.js.gz +0 -0
  76. package/build/runtime-chunk-NAJSQF6K.js +1 -0
  77. package/build/runtime-chunk-NAJSQF6K.js.br +0 -0
  78. package/build/runtime-chunk-NAJSQF6K.js.gz +0 -0
  79. package/build/{runtime-chunk-QVC5UDJO.js → runtime-chunk-NWCLOXDY.js} +1 -1
  80. package/build/runtime-chunk-NWCLOXDY.js.br +0 -0
  81. package/build/runtime-chunk-NWCLOXDY.js.gz +0 -0
  82. package/build/{runtime-chunk-V7XDOE2W.js → runtime-chunk-OF7IZ6BI.js} +1 -1
  83. package/build/runtime-chunk-OF7IZ6BI.js.br +0 -0
  84. package/build/runtime-chunk-OF7IZ6BI.js.gz +0 -0
  85. package/build/{runtime-chunk-ZJPGZKPX.js → runtime-chunk-PUBEJSJO.js} +1 -1
  86. package/build/runtime-chunk-PUBEJSJO.js.br +0 -0
  87. package/build/runtime-chunk-PUBEJSJO.js.gz +0 -0
  88. package/build/{runtime-chunk-5XUI4Z6R.js → runtime-chunk-R34HNX2O.js} +1 -1
  89. package/build/runtime-chunk-R34HNX2O.js.br +0 -0
  90. package/build/runtime-chunk-R34HNX2O.js.gz +0 -0
  91. package/build/runtime-chunk-RBM3UDQF.js +1 -0
  92. package/build/runtime-chunk-RBM3UDQF.js.br +0 -0
  93. package/build/runtime-chunk-RBM3UDQF.js.gz +0 -0
  94. package/build/{runtime-chunk-CIBY4YG3.js → runtime-chunk-RRXSRYPQ.js} +1 -1
  95. package/build/runtime-chunk-RRXSRYPQ.js.br +0 -0
  96. package/build/runtime-chunk-RRXSRYPQ.js.gz +0 -0
  97. package/build/{runtime-chunk-YFAATRJU.js → runtime-chunk-SXPM42HJ.js} +1 -1
  98. package/build/runtime-chunk-SXPM42HJ.js.br +0 -0
  99. package/build/runtime-chunk-SXPM42HJ.js.gz +0 -0
  100. package/build/{runtime-chunk-WMWQXAOH.js → runtime-chunk-XUM5HEC6.js} +1 -1
  101. package/build/runtime-chunk-XUM5HEC6.js.br +0 -0
  102. package/build/runtime-chunk-XUM5HEC6.js.gz +0 -0
  103. package/build/{runtime-chunk-3J5YHSQW.js → runtime-chunk-XXRCB3ME.js} +1 -1
  104. package/build/runtime-chunk-XXRCB3ME.js.br +0 -0
  105. package/build/runtime-chunk-XXRCB3ME.js.gz +0 -0
  106. package/build/{runtime-classicRuntime-UOZ6RID5.js → runtime-classicRuntime-PJ7JLKSY.js} +1 -1
  107. package/build/runtime-classicRuntime-PJ7JLKSY.js.br +0 -0
  108. package/build/runtime-classicRuntime-PJ7JLKSY.js.gz +0 -0
  109. package/build/runtime-cloners-SM2IKR3Q.js +1 -0
  110. package/build/runtime-cloners-SM2IKR3Q.js.br +3 -0
  111. package/build/runtime-cloners-SM2IKR3Q.js.gz +0 -0
  112. package/build/{runtime-components-IGNRKI6T.js → runtime-components-VRLLFORJ.js} +1 -1
  113. package/build/runtime-components-VRLLFORJ.js.br +0 -0
  114. package/build/runtime-components-VRLLFORJ.js.gz +0 -0
  115. package/build/{runtime-conditional-DCOFCW5I.js → runtime-conditional-VA7AKA6O.js} +1 -1
  116. package/build/runtime-conditional-VA7AKA6O.js.br +0 -0
  117. package/build/runtime-conditional-VA7AKA6O.js.gz +0 -0
  118. package/build/{runtime-createDestroy-JLB7IIQL.js → runtime-createDestroy-IQVBLQ24.js} +1 -1
  119. package/build/runtime-createDestroy-IQVBLQ24.js.br +0 -0
  120. package/build/runtime-createDestroy-IQVBLQ24.js.gz +0 -0
  121. package/build/{runtime-dragDrop-ERDSNA3S.js → runtime-dragDrop-XFI62H3C.js} +1 -1
  122. package/build/runtime-dragDrop-XFI62H3C.js.br +0 -0
  123. package/build/runtime-dragDrop-XFI62H3C.js.gz +0 -0
  124. package/build/{runtime-fxBloom-IGFV4KJD.js → runtime-fxBloom-KENIJKIM.js} +1 -1
  125. package/build/runtime-fxBloom-KENIJKIM.js.br +0 -0
  126. package/build/runtime-fxBloom-KENIJKIM.js.gz +0 -0
  127. package/build/runtime-fxDepthOfField-XNWQKT4G.js +1 -0
  128. package/build/runtime-fxDepthOfField-XNWQKT4G.js.br +0 -0
  129. package/build/runtime-fxDepthOfField-XNWQKT4G.js.gz +0 -0
  130. package/build/{runtime-gameControls-XKOQVZZC.js → runtime-gameControls-W3YS7OS2.js} +1 -1
  131. package/build/runtime-gameControls-W3YS7OS2.js.br +0 -0
  132. package/build/runtime-gameControls-W3YS7OS2.js.gz +0 -0
  133. package/build/runtime-hair-CWPDHNZF.js +1 -0
  134. package/build/runtime-hair-CWPDHNZF.js.br +1 -0
  135. package/build/runtime-hair-CWPDHNZF.js.gz +0 -0
  136. package/build/{runtime-mergeStaticGeometries-4Y3LE3VX.js → runtime-mergeStaticGeometries-KJFDZ7TP.js} +1 -1
  137. package/build/runtime-mergeStaticGeometries-KJFDZ7TP.js.br +0 -0
  138. package/build/runtime-mergeStaticGeometries-KJFDZ7TP.js.gz +0 -0
  139. package/build/{runtime-miscActions-KIRLTM7C.js → runtime-miscActions-UGVVC2QC.js} +1 -1
  140. package/build/runtime-miscActions-UGVVC2QC.js.br +0 -0
  141. package/build/runtime-miscActions-UGVVC2QC.js.gz +0 -0
  142. package/build/{runtime-mouseHover-WULIJFG2.js → runtime-mouseHover-O7Y26SM5.js} +1 -1
  143. package/build/runtime-mouseHover-O7Y26SM5.js.br +0 -0
  144. package/build/runtime-mouseHover-O7Y26SM5.js.gz +0 -0
  145. package/build/{runtime-particles-NNV35DLD.js → runtime-particles-GFRULQXO.js} +1 -1
  146. package/build/runtime-particles-GFRULQXO.js.br +0 -0
  147. package/build/runtime-particles-GFRULQXO.js.gz +0 -0
  148. package/build/{runtime-paths-RRXZ3PXM.js → runtime-paths-Q7I56BAX.js} +1 -1
  149. package/build/runtime-paths-Q7I56BAX.js.br +0 -0
  150. package/build/runtime-paths-Q7I56BAX.js.gz +0 -0
  151. package/build/{runtime-resize-V6LZSOZB.js → runtime-resize-2ZFLSK2M.js} +1 -1
  152. package/build/runtime-resize-2ZFLSK2M.js.br +0 -0
  153. package/build/runtime-resize-2ZFLSK2M.js.gz +0 -0
  154. package/build/{runtime-sceneTransition-CP5TI3VP.js → runtime-sceneTransition-Z65VROHI.js} +1 -1
  155. package/build/runtime-sceneTransition-Z65VROHI.js.br +0 -0
  156. package/build/runtime-sceneTransition-Z65VROHI.js.gz +0 -0
  157. package/build/{runtime-scroll-Q7VGS5NM.js → runtime-scroll-NWKW6A6L.js} +1 -1
  158. package/build/runtime-scroll-NWKW6A6L.js.br +0 -0
  159. package/build/runtime-scroll-NWKW6A6L.js.gz +0 -0
  160. package/build/runtime-shapeBlends-QB7JKEHC.js +1 -0
  161. package/build/runtime-shapeBlends-QB7JKEHC.js.br +5 -0
  162. package/build/runtime-shapeBlends-QB7JKEHC.js.gz +0 -0
  163. package/build/runtime-text-VK3OGBSY.js +1 -0
  164. package/build/runtime-text-VK3OGBSY.js.br +0 -0
  165. package/build/runtime-text-VK3OGBSY.js.gz +0 -0
  166. package/build/{runtime-textInputs-IW2E6BNU.js → runtime-textInputs-JJQSKO3C.js} +1 -1
  167. package/build/runtime-textInputs-JJQSKO3C.js.br +0 -0
  168. package/build/runtime-textInputs-JJQSKO3C.js.gz +0 -0
  169. package/build/{runtime-timeline-JA2JZIS7.js → runtime-timeline-WRAEBCRZ.js} +1 -1
  170. package/build/runtime-timeline-WRAEBCRZ.js.br +0 -0
  171. package/build/runtime-timeline-WRAEBCRZ.js.gz +0 -0
  172. package/build/{runtime-tracking-M57J2PGK.js → runtime-tracking-KYP5WOMH.js} +1 -1
  173. package/build/runtime-tracking-KYP5WOMH.js.br +0 -0
  174. package/build/runtime-tracking-KYP5WOMH.js.gz +0 -0
  175. package/build/{runtime-transitions-PELRDE7B.js → runtime-transitions-FDRKYMVP.js} +1 -1
  176. package/build/runtime-transitions-FDRKYMVP.js.br +0 -0
  177. package/build/runtime-transitions-FDRKYMVP.js.gz +0 -0
  178. package/build/runtime-ui2d-YO6M74VQ.js +1 -0
  179. package/build/runtime-ui2d-YO6M74VQ.js.br +0 -0
  180. package/build/runtime-ui2d-YO6M74VQ.js.gz +0 -0
  181. package/build/{runtime-updater-3ELP7WMM.js → runtime-updater-FS5YHXO4.js} +1 -1
  182. package/build/runtime-updater-FS5YHXO4.js.br +1 -0
  183. package/build/runtime-updater-FS5YHXO4.js.gz +0 -0
  184. package/build/{runtime-variables-Q6Q2JCGI.js → runtime-variables-CYDDC6HF.js} +1 -1
  185. package/build/runtime-variables-CYDDC6HF.js.br +0 -0
  186. package/build/runtime-variables-CYDDC6HF.js.gz +0 -0
  187. package/build/{runtime-vectorShapes-ISY7MWHY.js → runtime-vectorShapes-VMDJ36X2.js} +1 -1
  188. package/build/runtime-vectorShapes-VMDJ36X2.js.br +0 -0
  189. package/build/runtime-vectorShapes-VMDJ36X2.js.gz +0 -0
  190. package/build/{runtime-video-DUDXGADJ.js → runtime-video-MTXK33PT.js} +1 -1
  191. package/build/runtime-video-MTXK33PT.js.br +0 -0
  192. package/build/runtime-video-MTXK33PT.js.gz +0 -0
  193. package/build/runtime-webgpu-WDY6L7BV.js +1 -0
  194. package/build/runtime-webgpu-WDY6L7BV.js.br +0 -0
  195. package/build/runtime-webgpu-WDY6L7BV.js.gz +0 -0
  196. package/build/runtime.cjs +323 -323
  197. package/build/runtime.js +1 -1
  198. package/build/runtime.js.br +0 -0
  199. package/build/runtime.js.gz +0 -0
  200. package/build/runtime.standalone.js +1 -1
  201. package/build/runtime.standalone.js.br +0 -0
  202. package/build/runtime.standalone.js.gz +0 -0
  203. package/build/runtime.standalone.webgl.js +1 -1
  204. package/build/runtime.standalone.webgl.js.br +0 -0
  205. package/build/runtime.standalone.webgl.js.gz +0 -0
  206. package/build/runtime.standalone.webgpu.js +1 -1
  207. package/build/runtime.standalone.webgpu.js.br +0 -0
  208. package/build/runtime.standalone.webgpu.js.gz +0 -0
  209. package/build/runtime.standalone.webgpu.micro.js +1 -1
  210. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  211. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  212. package/build/runtime.standalone.webgpu.min.js +1 -1
  213. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  214. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  215. package/package.json +2 -1
  216. package/build/runtime-aiAssistant-RMA2DMFU.js.br +0 -0
  217. package/build/runtime-aiAssistant-RMA2DMFU.js.gz +0 -0
  218. package/build/runtime-apiServices-KA4FEP5Y.js.br +0 -0
  219. package/build/runtime-apiServices-KA4FEP5Y.js.gz +0 -0
  220. package/build/runtime-audio-BQSRM3W2.js.br +0 -0
  221. package/build/runtime-audio-BQSRM3W2.js.gz +0 -0
  222. package/build/runtime-chunk-36FZTFCC.js.br +0 -0
  223. package/build/runtime-chunk-36FZTFCC.js.gz +0 -0
  224. package/build/runtime-chunk-3J5YHSQW.js.br +0 -0
  225. package/build/runtime-chunk-3J5YHSQW.js.gz +0 -0
  226. package/build/runtime-chunk-4I22JDL6.js.br +0 -0
  227. package/build/runtime-chunk-4I22JDL6.js.gz +0 -0
  228. package/build/runtime-chunk-5XUI4Z6R.js.br +0 -0
  229. package/build/runtime-chunk-5XUI4Z6R.js.gz +0 -0
  230. package/build/runtime-chunk-6UUF5VIS.js +0 -1
  231. package/build/runtime-chunk-6UUF5VIS.js.br +0 -0
  232. package/build/runtime-chunk-6UUF5VIS.js.gz +0 -0
  233. package/build/runtime-chunk-CIBY4YG3.js.br +0 -0
  234. package/build/runtime-chunk-CIBY4YG3.js.gz +0 -0
  235. package/build/runtime-chunk-DKGQ6OYZ.js +0 -1
  236. package/build/runtime-chunk-DKGQ6OYZ.js.br +0 -0
  237. package/build/runtime-chunk-DKGQ6OYZ.js.gz +0 -0
  238. package/build/runtime-chunk-DSJY3WL2.js.br +0 -0
  239. package/build/runtime-chunk-DSJY3WL2.js.gz +0 -0
  240. package/build/runtime-chunk-ESZD4IRS.js.br +0 -0
  241. package/build/runtime-chunk-ESZD4IRS.js.gz +0 -0
  242. package/build/runtime-chunk-GPACKOH2.js.br +0 -0
  243. package/build/runtime-chunk-GPACKOH2.js.gz +0 -0
  244. package/build/runtime-chunk-I5QFGBIU.js.br +0 -0
  245. package/build/runtime-chunk-I5QFGBIU.js.gz +0 -0
  246. package/build/runtime-chunk-JNSHQPHC.js +0 -1
  247. package/build/runtime-chunk-JNSHQPHC.js.br +0 -0
  248. package/build/runtime-chunk-JNSHQPHC.js.gz +0 -0
  249. package/build/runtime-chunk-LT4UVXE2.js.br +0 -0
  250. package/build/runtime-chunk-LT4UVXE2.js.gz +0 -0
  251. package/build/runtime-chunk-MBBODDV7.js.br +0 -0
  252. package/build/runtime-chunk-NTW4X3NC.js.br +0 -0
  253. package/build/runtime-chunk-NTW4X3NC.js.gz +0 -0
  254. package/build/runtime-chunk-OOC7YSI5.js.br +0 -0
  255. package/build/runtime-chunk-OOC7YSI5.js.gz +0 -0
  256. package/build/runtime-chunk-OW6T4XFV.js +0 -1
  257. package/build/runtime-chunk-OW6T4XFV.js.br +0 -0
  258. package/build/runtime-chunk-OW6T4XFV.js.gz +0 -0
  259. package/build/runtime-chunk-QVC5UDJO.js.br +0 -0
  260. package/build/runtime-chunk-QVC5UDJO.js.gz +0 -0
  261. package/build/runtime-chunk-R7NC6CZZ.js.br +0 -0
  262. package/build/runtime-chunk-R7NC6CZZ.js.gz +0 -0
  263. package/build/runtime-chunk-RF63UVAU.js.br +0 -0
  264. package/build/runtime-chunk-RF63UVAU.js.gz +0 -0
  265. package/build/runtime-chunk-SL64ZYCB.js.br +0 -0
  266. package/build/runtime-chunk-SL64ZYCB.js.gz +0 -0
  267. package/build/runtime-chunk-TPKGBIJU.js.br +0 -0
  268. package/build/runtime-chunk-TPKGBIJU.js.gz +0 -0
  269. package/build/runtime-chunk-USXMESRF.js.br +0 -0
  270. package/build/runtime-chunk-USXMESRF.js.gz +0 -0
  271. package/build/runtime-chunk-V5NUL7BL.js.br +0 -1
  272. package/build/runtime-chunk-V5NUL7BL.js.gz +0 -0
  273. package/build/runtime-chunk-V7XDOE2W.js.br +0 -0
  274. package/build/runtime-chunk-V7XDOE2W.js.gz +0 -0
  275. package/build/runtime-chunk-W4ZCHGLQ.js.br +0 -0
  276. package/build/runtime-chunk-W4ZCHGLQ.js.gz +0 -0
  277. package/build/runtime-chunk-WHKBOV2O.js.br +0 -0
  278. package/build/runtime-chunk-WHKBOV2O.js.gz +0 -0
  279. package/build/runtime-chunk-WMWQXAOH.js.br +0 -0
  280. package/build/runtime-chunk-WMWQXAOH.js.gz +0 -0
  281. package/build/runtime-chunk-YFAATRJU.js.br +0 -0
  282. package/build/runtime-chunk-YFAATRJU.js.gz +0 -0
  283. package/build/runtime-chunk-ZJPGZKPX.js.br +0 -0
  284. package/build/runtime-chunk-ZJPGZKPX.js.gz +0 -0
  285. package/build/runtime-chunk-ZMXEX5NX.js.br +0 -0
  286. package/build/runtime-chunk-ZMXEX5NX.js.gz +0 -0
  287. package/build/runtime-classicRuntime-UOZ6RID5.js.br +0 -0
  288. package/build/runtime-classicRuntime-UOZ6RID5.js.gz +0 -0
  289. package/build/runtime-cloners-DALMNZYL.js +0 -1
  290. package/build/runtime-cloners-DALMNZYL.js.br +0 -0
  291. package/build/runtime-cloners-DALMNZYL.js.gz +0 -0
  292. package/build/runtime-components-IGNRKI6T.js.br +0 -0
  293. package/build/runtime-components-IGNRKI6T.js.gz +0 -0
  294. package/build/runtime-conditional-DCOFCW5I.js.br +0 -0
  295. package/build/runtime-conditional-DCOFCW5I.js.gz +0 -0
  296. package/build/runtime-createDestroy-JLB7IIQL.js.br +0 -0
  297. package/build/runtime-createDestroy-JLB7IIQL.js.gz +0 -0
  298. package/build/runtime-dragDrop-ERDSNA3S.js.br +0 -0
  299. package/build/runtime-dragDrop-ERDSNA3S.js.gz +0 -0
  300. package/build/runtime-fxBloom-IGFV4KJD.js.br +0 -0
  301. package/build/runtime-fxBloom-IGFV4KJD.js.gz +0 -0
  302. package/build/runtime-fxDepthOfField-WX7WD3K4.js +0 -1
  303. package/build/runtime-fxDepthOfField-WX7WD3K4.js.br +0 -0
  304. package/build/runtime-fxDepthOfField-WX7WD3K4.js.gz +0 -0
  305. package/build/runtime-gameControls-XKOQVZZC.js.br +0 -0
  306. package/build/runtime-gameControls-XKOQVZZC.js.gz +0 -0
  307. package/build/runtime-hair-EOZHA2BH.js +0 -1
  308. package/build/runtime-hair-EOZHA2BH.js.br +0 -0
  309. package/build/runtime-hair-EOZHA2BH.js.gz +0 -0
  310. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.br +0 -0
  311. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.gz +0 -0
  312. package/build/runtime-miscActions-KIRLTM7C.js.br +0 -0
  313. package/build/runtime-miscActions-KIRLTM7C.js.gz +0 -0
  314. package/build/runtime-mouseHover-WULIJFG2.js.br +0 -0
  315. package/build/runtime-mouseHover-WULIJFG2.js.gz +0 -0
  316. package/build/runtime-particles-NNV35DLD.js.br +0 -0
  317. package/build/runtime-particles-NNV35DLD.js.gz +0 -0
  318. package/build/runtime-paths-RRXZ3PXM.js.br +0 -0
  319. package/build/runtime-paths-RRXZ3PXM.js.gz +0 -0
  320. package/build/runtime-resize-V6LZSOZB.js.br +0 -0
  321. package/build/runtime-resize-V6LZSOZB.js.gz +0 -0
  322. package/build/runtime-sceneTransition-CP5TI3VP.js.br +0 -0
  323. package/build/runtime-sceneTransition-CP5TI3VP.js.gz +0 -0
  324. package/build/runtime-scroll-Q7VGS5NM.js.br +0 -0
  325. package/build/runtime-scroll-Q7VGS5NM.js.gz +0 -0
  326. package/build/runtime-shapeBlends-UN7GGFRG.js +0 -1
  327. package/build/runtime-shapeBlends-UN7GGFRG.js.br +0 -0
  328. package/build/runtime-shapeBlends-UN7GGFRG.js.gz +0 -0
  329. package/build/runtime-text-N6XLUSM2.js +0 -1
  330. package/build/runtime-text-N6XLUSM2.js.br +0 -0
  331. package/build/runtime-text-N6XLUSM2.js.gz +0 -0
  332. package/build/runtime-textInputs-IW2E6BNU.js.br +0 -0
  333. package/build/runtime-textInputs-IW2E6BNU.js.gz +0 -0
  334. package/build/runtime-timeline-JA2JZIS7.js.br +0 -0
  335. package/build/runtime-timeline-JA2JZIS7.js.gz +0 -0
  336. package/build/runtime-tracking-M57J2PGK.js.br +0 -0
  337. package/build/runtime-tracking-M57J2PGK.js.gz +0 -0
  338. package/build/runtime-transitions-PELRDE7B.js.br +0 -0
  339. package/build/runtime-transitions-PELRDE7B.js.gz +0 -0
  340. package/build/runtime-ui2d-IOB5Y76W.js +0 -1
  341. package/build/runtime-ui2d-IOB5Y76W.js.br +0 -0
  342. package/build/runtime-ui2d-IOB5Y76W.js.gz +0 -0
  343. package/build/runtime-updater-3ELP7WMM.js.br +0 -1
  344. package/build/runtime-updater-3ELP7WMM.js.gz +0 -0
  345. package/build/runtime-variables-Q6Q2JCGI.js.br +0 -0
  346. package/build/runtime-variables-Q6Q2JCGI.js.gz +0 -0
  347. package/build/runtime-vectorShapes-ISY7MWHY.js.br +0 -0
  348. package/build/runtime-vectorShapes-ISY7MWHY.js.gz +0 -0
  349. package/build/runtime-video-DUDXGADJ.js.br +0 -0
  350. package/build/runtime-video-DUDXGADJ.js.gz +0 -0
  351. package/build/runtime-webgpu-4ZCV5EAD.js +0 -1
  352. package/build/runtime-webgpu-4ZCV5EAD.js.br +0 -0
  353. package/build/runtime-webgpu-4ZCV5EAD.js.gz +0 -0
@@ -1 +1 @@
1
- import{h as t,j as e,k as i}from"./runtime-chunk-6UUF5VIS.js";import{a as s}from"./runtime-chunk-R43XZP65.js";import{a}from"./runtime-chunk-ESZD4IRS.js";import{e as n}from"./runtime-chunk-QVC5UDJO.js";import{e as r}from"./runtime-chunk-2PT2WH66.js";import{q as o}from"./runtime-chunk-OW6T4XFV.js";import{Bc as h}from"./runtime-chunk-VGN7YHB7.js";var d=class extends h{constructor(t,e,i,s,a){if(super(),this.eventType=t,this.data=e,this.page=i,this.shared=s,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.pauseOnNextLoopEnd=!1,this.onTimelineChangeComplete=()=>{if(this.pauseOnNextLoopEnd)return this.pauseOnNextLoopEnd=!1,void this.timeline?.pause();"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let n=this.page.scene.find(e.object)??this.page.uiCanvas?.find(e.object)??this.page.scene.find2DInUIObjects(e.object);if(!n)throw new Error("Missing property");if(!n.states)throw new Error("Missing property");if(this.object=n,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){return!1===this.timeline?.paused}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=e(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return"Toggle"===this.data.runMode&&o(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:e=!0,needsRebuild:n=!1,isRebuild:r=!1}={}){try{let o=t(this.data.tweens[0].data);r&&"number"==typeof o.loop&&o.loop--,this.timeline?.pause(),this.timeline=s.timeline({autoplay:!1,...o,...!0===o.loop||o.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let h=this.tweens.findIndex(t=>t?.changeBegan);if(!0===n&&(this.timelineNeedsRebuild=!0),e){let t=-1===h?0:h;for(let e=t;e<this.data.tweens.length-1;e++){let s,n=this.data.tweens[e],r=this.data.tweens[e+1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.delay:0))}this.timeline.duration+=o.endDelay}else{let t=-1===h?this.data.tweens.length-1:h+1;for(let e=t;e>0;e--){let s,n=this.data.tweens[e],r=this.data.tweens[e-1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e-1]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.endDelay:0))}this.timeline.duration+=o.delay}}catch(t){t instanceof Error&&console.error(t.message)}!0===this.object.previousAction?.playing&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===n(this.shared,this.condition)||o(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;this.startTimeout?.pause();let e=t(this.data.tweens[0].data).pingPongDelayCorrection;this.startTimeout=s({targets:{},duration:this.startOnceDelay+e,easing:"linear",complete:()=>{this.startTimeout=void 0;try{this.buildTimeline(),this.timeline.play()}catch(t){t instanceof Error&&console.error(t.message)}}})}pause(){this.timeline?.pause(),this.startTimeout?.pause(),this.tweens=Array(this.data.tweens.length-1),delete this.startTimeout}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;r(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===n(this.shared,this.condition))return!1;void 0===this.timeline&&this.buildTimeline(),this.timeline?.seek(t*this.timeline.duration,!0)}toggle(t){if(!1===n(this.shared,this.condition))return!1;this.startTimeout?.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.playing?(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.pauseOnNextLoopEnd=!0,this.timeline.play()):this.startTimeout=s({targets:{},duration:this.startOnceDelay,easing:"linear",complete:()=>{this.startTimeout=void 0,this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}})}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};export{d as a};
1
+ import{h as t,j as e,k as i}from"./runtime-chunk-CCJD7IX7.js";import{a as s}from"./runtime-chunk-R43XZP65.js";import{a}from"./runtime-chunk-H7D3VFTJ.js";import{e as n}from"./runtime-chunk-NWCLOXDY.js";import{e as r}from"./runtime-chunk-2PT2WH66.js";import{q as o}from"./runtime-chunk-RBM3UDQF.js";import{Bc as h}from"./runtime-chunk-VGN7YHB7.js";var d=class extends h{constructor(t,e,i,s,a){if(super(),this.eventType=t,this.data=e,this.page=i,this.shared=s,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.pauseOnNextLoopEnd=!1,this.onTimelineChangeComplete=()=>{if(this.pauseOnNextLoopEnd)return this.pauseOnNextLoopEnd=!1,void this.timeline?.pause();"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let n=this.page.scene.find(e.object)??this.page.uiCanvas?.find(e.object)??this.page.scene.find2DInUIObjects(e.object);if(!n)throw new Error("Missing property");if(!n.states)throw new Error("Missing property");if(this.object=n,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){return!1===this.timeline?.paused}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=e(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return"Toggle"===this.data.runMode&&o(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:e=!0,needsRebuild:n=!1,isRebuild:r=!1}={}){try{let o=t(this.data.tweens[0].data);r&&"number"==typeof o.loop&&o.loop--,this.timeline?.pause(),this.timeline=s.timeline({autoplay:!1,...o,...!0===o.loop||o.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let h=this.tweens.findIndex(t=>t?.changeBegan);if(!0===n&&(this.timelineNeedsRebuild=!0),e){let t=-1===h?0:h;for(let e=t;e<this.data.tweens.length-1;e++){let s,n=this.data.tweens[e],r=this.data.tweens[e+1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.delay:0))}this.timeline.duration+=o.endDelay}else{let t=-1===h?this.data.tweens.length-1:h+1;for(let e=t;e>0;e--){let s,n=this.data.tweens[e],r=this.data.tweens[e-1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e-1]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.endDelay:0))}this.timeline.duration+=o.delay}}catch(t){t instanceof Error&&console.error(t.message)}!0===this.object.previousAction?.playing&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===n(this.shared,this.condition)||o(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;this.startTimeout?.pause();let e=t(this.data.tweens[0].data).pingPongDelayCorrection;this.startTimeout=s({targets:{},duration:this.startOnceDelay+e,easing:"linear",complete:()=>{this.startTimeout=void 0;try{this.buildTimeline(),this.timeline.play()}catch(t){t instanceof Error&&console.error(t.message)}}})}pause(){this.timeline?.pause(),this.startTimeout?.pause(),this.tweens=Array(this.data.tweens.length-1),delete this.startTimeout}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;r(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===n(this.shared,this.condition))return!1;void 0===this.timeline&&this.buildTimeline(),this.timeline?.seek(t*this.timeline.duration,!0)}toggle(t){if(!1===n(this.shared,this.condition))return!1;this.startTimeout?.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.playing?(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.pauseOnNextLoopEnd=!0,this.timeline.play()):this.startTimeout=s({targets:{},duration:this.startOnceDelay,easing:"linear",complete:()=>{this.startTimeout=void 0,this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}})}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};export{d as a};
@@ -0,0 +1 @@
1
+ import{a as t}from"./runtime-chunk-CX2MRLZA.js";import{a as e}from"./runtime-chunk-KYA2CB5O.js";import{d as n,e as s,f as i,g as r,h as a}from"./runtime-chunk-4DNX5FPP.js";import{a as o,b as l}from"./runtime-chunk-GN3HDYV2.js";import{b as d,e as c,f as h,g as p}from"./runtime-chunk-XXRCB3ME.js";import{a as u}from"./runtime-chunk-GO25U5WN.js";import{a as m}from"./runtime-chunk-H7D3VFTJ.js";import{a as f}from"./runtime-chunk-JQ3A6ENO.js";import{b as y}from"./runtime-chunk-XUM5HEC6.js";import{a as g,b as x}from"./runtime-chunk-ITLS6YIC.js";import{a as v}from"./runtime-chunk-4E4NQ6GS.js";import{d as A}from"./runtime-chunk-AKWBEROQ.js";import{K as b,da as C,ea as w,g as I}from"./runtime-chunk-SXPM42HJ.js";import{b as M,c as P,e as S,h as B,v as D}from"./runtime-chunk-4KX4KQWR.js";import{a as R,b as E,c as z,d as O,f as j,i as W,j as T}from"./runtime-chunk-2PT2WH66.js";import{c as _,e as k,g as U}from"./runtime-chunk-TZCHGFVF.js";import{Da as N,K as G,Ka as V,a as F,b as Q,n as Y,o as q,w as L,xa as X}from"./runtime-chunk-RBM3UDQF.js";import{Aa as Z,Ba as K,Dc as H,Ec as J,Fc as $,Gc as tt,Ge as et,Ja as nt,Oa as st,Oc as it,Ra as rt,Tc as at,Vc as ot,Xc as lt,Yc as dt,Zc as ct,bd as ht,cd as pt,ce as ut,dd as mt,kd as ft,l as yt,ld as gt,mc as xt,md as vt,n as At,nd as bt,od as Ct,pd as wt,qd as It,za as Mt}from"./runtime-chunk-VGN7YHB7.js";import{c as Pt}from"./runtime-chunk-ML3Z74BL.js";var St=null;function Bt(t){St=t}var Dt=new WeakMap,Rt=1;function Et(t){let e=Dt.get(t);return void 0===e&&(e=Rt++,Dt.set(t,e)),e}function zt(t,e,n,s){let i=t,r=e;return[Et(n),Et(s),i.layers?.mask??0,i.renderOrder??0,!0===(i.castShadow??r.castShadow)?1:0,!0===(i.receiveShadow??r.receiveShadow)?1:0].join(":")}var Ot=[8,32,128,512],jt=Ot[Ot.length-1],Wt=(new it).makeScale(0,0,0),Tt=class extends It{constructor(t,e,n,s){super(t,e,n),this.isInstanceGroup=!0,this.members=new Array(n).fill(null),this.raycast=()=>{},this.matrixAutoUpdate=!1,this.frustumCulled=!1,this.adoptPassState(s);for(let t=0;t<n;t++)this.setMatrixAt(t,Wt);this.instanceMatrix.needsUpdate=!0}adoptPassState(t){this.layers.mask=t.layers.mask,this.renderOrder=t.renderOrder,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow}assign(t,e){this.members[t]=e}writeSlot(t,e,n){return!1===n?(this.setMatrixAt(t,Wt),!1):(this.setMatrixAt(t,e.matrixWorld),!0)}park(t){this.members[t]=null,this.setMatrixAt(t,Wt)}get memberCount(){let t=0;for(let e of this.members)null!==e&&t++;return t}};function _t(t,e){let n=e.get(t);if(void 0!==n)return n;let s=t.visible&&(null===t.parent||_t(t.parent,e));return e.set(t,s),s}var kt=8,Ut=class{constructor(t=8){this.minGroupSize=t,this.groups=[],this.groupKeys=new WeakMap,this.placements=new Map,this.visibilityMemo=new Map,this.page=null,this.stats={instancingGroups:0,instancedDrawsSaved:0,instancingRegroups:0,instancingParks:0,instancingIneligible:{}}}update(t,e){this.page!==t&&(this.teardown(),this.page=t,e=!0),!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),e&&this.reconcile(t),this.refresh()}reconcile(t){let e={},n=new Map;t.traverse(t=>{if(!0===t.isInstanceGroup)return;let s=function(t){if(!0!==t.isMesh)return"not-a-mesh";if(z(t)||j(t)||E(t)||R(t))return"excluded-type";let e=function(t){let e=W(t)?t.object:t;return void 0!==e.geometry?e:void 0}(t);if(void 0===e)return"not-a-mesh";let n=e.material;if(void 0===n)return"not-a-mesh";if(Array.isArray(n))return"array-material";let s=e.builtSharedGeometry;if(void 0===s)return"unrealized-geometry";if(!function(t){return!0===t.isShared}(s))return"unshared-geometry";if(void 0===s.attributes.position)return"empty-geometry";if(void 0!==s.morphAttributes.position)return"morph";if(!0===e.isSkinnedMesh)return"skinned";let i=e.morphTargetInfluences;if(void 0!==i&&i.length>0)return"morph";if(0!==s.drawRange.start||s.drawRange.count!==Number.POSITIVE_INFINITY)return"draw-range";let r=n;return null!=r.positionNode||null!=r.castShadowPositionNode?"position-node":!0===r.transparent?"transparent":void 0!==e.userData?.__splinePlanarMirror?"reflection":function(t){let e=t;for(;null!==e;){let t=e.states;if(void 0!==t&&Object.keys(t).length>0)return!0;e=e.parent}return!1}(e)?"interaction-states":{object:t,owner:e,geometry:s,material:n,key:zt(t,e,s,n)}}(t);if("string"==typeof s)return void(e[s]=(e[s]??0)+1);let i=n.get(s.key);void 0===i?n.set(s.key,[s]):i.push(s)});let s=new Map;for(let[t,e]of n)for(let n of e)s.set(n.object,t);let i=!1;for(let[t,e]of this.placements)s.get(t)!==this.groupKeys.get(e.group)&&this.parkPlacement(t,e);for(let t=this.groups.length-1;t>=0;t--){let e=this.groups[t];e.memberCount>=this.minGroupSize||(this.destroyGroup(e),this.groups.splice(t,1),i=!0)}for(let[e,s]of n){let n=s.filter(t=>!this.placements.has(t.object));if(0===n.length)continue;let r=0;for(let t of this.groups){if(r>=n.length)break;if(this.groupKeys.get(t)!==e)continue;let{members:s}=t;for(let e=0;e<s.length&&r<n.length;e++)null===s[e]&&this.place(t,e,n[r++].object)}for(;n.length-r>=this.minGroupSize;){let s=n.slice(r,r+jt);this.groups.push(this.createGroup(t,e,s)),r+=s.length,i=!0}}i&&this.stats.instancingRegroups++,this.publishGroupStats(),this.stats.instancingIneligible=e}createGroup(t,e,n){let s=n[0],i=new Tt(s.geometry,s.material,function(t){for(let e of Ot)if(t<=e)return e;return jt}(n.length),s.object);this.groupKeys.set(i,e);for(let t=0;t<n.length;t++)this.place(i,t,n[t].object);return t.add(i),i}destroyGroup(t){for(let e=0;e<t.members.length;e++){let n=t.members[e];null!==n&&this.parkPlacement(n,{group:t,slot:e})}t.removeFromParent(),t.dispose()}place(t,e,n){t.assign(e,n),this.placements.set(n,{group:t,slot:e}),n.isDrawSuppressed=!0}parkPlacement(t,e){e.group.park(e.slot),e.group.instanceMatrix.needsUpdate=!0,this.placements.delete(t),t.isDrawSuppressed=!1,this.stats.instancingParks++}refresh(){this.visibilityMemo.clear();for(let t of this.groups){let{members:e}=t,n=null;for(let s=0;s<e.length;s++){let i=e[s];null!==i&&(null===n&&(n=i),t.writeSlot(s,i,_t(i,this.visibilityMemo)))}null!==n&&(t.adoptPassState(n),t.instanceMatrix.needsUpdate=!0)}}teardown(){for(let t of this.groups)this.destroyGroup(t);this.groups.length=0;for(let t of this.placements.keys())t.isDrawSuppressed=!1;this.placements.clear(),this.publishGroupStats()}dispose(){this.teardown(),this.page=null}publishGroupStats(){let t=0;for(let e of this.groups){let n=e.memberCount;n>0&&(t+=n-1)}this.stats.instancingGroups=this.groups.length,this.stats.instancedDrawsSaved=t}},Nt=function(){let t=new Float32Array(1),e=new Int32Array(t.buffer);return function(n){return t[0]=n,e[0]}}(),Gt=function(t,e,n,s){return t+(e<<8)+(n<<16)+(s<<24)},Vt=new H;function Ft(t){let e=!1;return t.scene.objects.traverse((t,n)=>{if(!1===n.visible)return!0;"Splat"===n.type&&(e=!0)}),e}var Qt,Yt,qt=class extends gt{constructor(t,e,n,s,i=!1,r=1,a,o){super(n,s),this.splatCount=e,this.meshIndexIntervals=a,this.meshMatrixWorlds=o,this.splatBuffers=t,this.geometry=n,this.material=s,this.splatDataTextures=null,this.halfPrecisionCovariancesOnGPU=i,this.devicePixelRatio=r,this.resetLocalSplatDataAndTexturesFromSplatBuffer()}static buildMesh(t,e,n=!1,s=1,i,r){let a=qt.buildGeomtery(e),o=qt.buildMaterial(i);return new qt(t,e,a,o,n,s,i,r)}static buildMaterial(t){if("webgpu"===b()&&St)return St.createSplatMaterial(t);let e={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:t},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new H},viewport:{type:"v2",value:new H},basisViewport:{type:"v2",value:new H},debugColor:{type:"v3",value:new at},covariancesTextureSize:{type:"v2",value:new H(1024,1024)},centersColorsTextureSize:{type:"v2",value:new H(1024,1024)},orthoZoom:{type:"f",value:-1}};return new ut({uniforms:e,vertexShader:"\n precision highp float;\n #include <common>\n\n attribute uint splatIndex;\n\n uniform highp sampler2D covariancesTexture;\n uniform highp usampler2D centersColorsTexture;\n uniform vec2 focal;\n uniform vec2 viewport;\n uniform vec2 basisViewport;\n uniform vec2 covariancesTextureSize;\n uniform vec2 centersColorsTextureSize;\n\t\t\t\t\t\tuniform highp sampler2D meshMatrixWorldsTexture;\n\t\t\t\t\t\tuniform uint meshIndexIntervals[257];\n\t\t\t\t\t\tuniform float orthoZoom;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\n const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000));\n const uvec4 shift4 = uvec4(0, 8, 16, 24);\n vec4 uintToRGBAVec (uint u) {\n uvec4 urgba = mask4 & u;\n urgba = urgba >> shift4;\n vec4 rgba = vec4(urgba) * encodeNorm4;\n return rgba;\n }\n\n vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) {\n vec2 samplerUV = vec2(0.0, 0.0);\n float d = float(splatIndex * uint(stride) + uint(offset)) / dimensions.x;\n samplerUV.y = float(floor(d)) / dimensions.y;\n samplerUV.x = fract(d);\n return samplerUV;\n }\n\n void main () {\n uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize));\n vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba));\n vColor = uintToRGBAVec(sampledCenterColor.r);\n\n vPosition = position.xy * 2.0;\n\n\t\t\t\t\t\t\t\tuint meshIndex;\n\t\t\t\t\t\t\t\tfor (int i = 1; i < 257; i++) {\n\t\t\t\t\t\t\t\t\tif (splatIndex < meshIndexIntervals[i]) {\n\t\t\t\t\t\t\t\t\t\tmeshIndex = uint(i - 1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfloat strideMulmeshIndex = float(4u*meshIndex);\n\t\t\t\t\t\t\t\tfloat meshMatrixWorldsTextureLength = float(256*4);\n\n\t\t\t\t\t\t\t\tmat4 modelMat = mat4(\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)),\n\t\t\t\t\t\t\t\t\ttexture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0))\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmat4 modelViewMat = viewMatrix * modelMat;\n\t\t\t\t\t\t\t\tvec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); \n vec4 clipCenter = projectionMatrix * viewCenter;\n\n vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg;\n vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg;\n vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg;\n\n vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r);\n vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg);\n\n \n mat3 Vrk = mat3(\n cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z,\n cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y,\n cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z\n );\n float s = 1.0 / (viewCenter.z * viewCenter.z);\n\n mat3 W = transpose(mat3(modelViewMat));\n mat3 T = orthoZoom > 0.0 ? W : W * mat3(\n\t\t\t\t\t\t\t\t\tfocal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s,\n\t\t\t\t\t\t\t\t\t0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s,\n\t\t\t\t\t\t\t\t\t0., 0., 0.\n\t\t\t\t\t\t\t\t);\n mat3 cov2Dm = transpose(T) * Vrk * T;\n cov2Dm[0][0] += 0.3;\n cov2Dm[1][1] += 0.3;\n\n \n \n \n \n vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]);\n\n vec3 ndcCenter = clipCenter.xyz / clipCenter.w;\n\n \n \n \n \n \n \n \n \n float a = cov2Dv.x;\n float d = cov2Dv.z;\n float b = cov2Dv.y;\n float D = a * d - b * b;\n float trace = a + d;\n float traceOver2 = 0.5 * trace;\n float term2 = sqrt(trace * trace / 4.0 - D);\n float eigenValue1 = traceOver2 + term2;\n\t\t\t\t\t\t\t\tfloat eigenValue2 = max(traceOver2 - term2, 0.00); \n\n const float maxSplatSize = 1024.0;\n vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a));\n \n vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x);\n vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize);\n vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize);\n\n vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport;\n\n\t\t\t\t\t\t\t\tif (orthoZoom > 0.0) {\n\t\t\t\t\t\t\t\t\tndcOffset *= orthoZoom;\n\t\t\t\t\t\t\t\t}\n\n gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0);\n }",fragmentShader:"\n precision highp float;\n #include <common>\n\n uniform vec3 debugColor;\n\n varying vec4 vColor;\n varying vec2 vUv;\n\n varying vec2 vPosition;\n\t\t\t\t\t\tlayout(location = 1) out vec4 gVelocity; \n\n void main () {\n \n \n float A = -dot(vPosition, vPosition);\n if (A < -4.0) discard;\n vec3 color = vColor.rgb;\n A = exp(A) * vColor.a;\n gl_FragColor = vec4(color.rgb, A);\n\t\t\t\t\t\t\t\tgVelocity = vec4(0.0); \n }",transparent:!0,alphaTest:1,blending:At,depthTest:!0,depthWrite:!1,side:yt})}static buildGeomtery(t){let e=new mt;e.setIndex([0,1,2,0,2,3]);let n=new Float32Array(12),s=new ct(n,3);e.setAttribute("position",s),s.setXYZ(0,-1,-1,0),s.setXYZ(1,-1,1,0),s.setXYZ(2,1,1,0),s.setXYZ(3,1,-1,0),s.needsUpdate=!0;let i=(new et).copy(e),r=new Uint32Array(t),a=new wt(r,1,!1);return a.setUsage(xt),i.setAttribute("splatIndex",a),i.instanceCount=t,i}resetLocalSplatDataAndTexturesFromSplatBuffer(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}updateLocalSplatDataFromSplatBuffer(){this.splatBuffers.forEach(t=>t.buildPreComputedBuffers()),this.covariances=new Float32Array(6*this.splatCount),this.colors=new Uint8Array(4*this.splatCount),this.centers=new Float32Array(3*this.splatCount);let t=0,e=0,n=0;for(let s of this.splatBuffers){let i=s.nsplats;this.colors.subarray(t,t+4*i).set(s.colorsA),t+=4*i,this.centers.subarray(e,e+3*i).set(s.decoded.xyz.denormDequant().data),e+=3*i,this.covariances.subarray(n,n+6*i).set(new Float32Array(s.precomputedCovarianceBufferData)),n+=6*i}}allocateAndStoreLocalSplatDataInTextures(){let t=this.splatCount,e=new H(4096,1024);for(;e.x*e.y*2<6*t;)e.y*=2;let n,s,i=new H(4096,1024);for(;i.x*i.y*4<4*t;)i.y*=2;if(this.halfPrecisionCovariancesOnGPU){s=new Uint16Array(e.x*e.y*2);for(let t=0;t<this.covariances.length;t++)s[t]=dt.toHalfFloat(this.covariances[t]);n=new bt(s,e.x,e.y,st,K)}else s=new Float32Array(e.x*e.y*2),s.set(this.covariances),n=new bt(s,e.x,e.y,st,Z);n.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=n,this.material.uniforms.covariancesTextureSize.value.copy(e);let r=new Uint32Array(i.x*i.y*4);for(let e=0;e<t;e++){let t=4*e,n=3*e,s=4*e;r[s]=Gt(this.colors[t],this.colors[t+1],this.colors[t+2],this.colors[t+3]),r[s+1]=Nt(this.centers[n]),r[s+2]=Nt(this.centers[n+1]),r[s+3]=Nt(this.centers[n+2])}let a=new bt(r,i.x,i.y,rt,Mt);"webgpu"!==b()&&(a.internalFormat="RGBA32UI"),a.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=a,this.material.uniforms.centersColorsTextureSize.value.copy(i);let o=new Float32Array(4096);for(let t=0;t<this.meshMatrixWorlds.length;t++)o.set(this.meshMatrixWorlds[t].elements,16*t);let l=new bt(o,1024,1,nt,Z);l.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=l,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:s,texture:n,size:e},centerColors:{data:r,texture:a,size:i},meshMatrixWorlds:{data:o,texture:l}}}updateIndexes(t){let e=this.geometry;e.attributes.splatIndex.set(t),e.attributes.splatIndex.needsUpdate=!0,e.instanceCount=t.length}updateUniforms(t,e,n,s){this.splatCount>0&&(Vt.set(t.x*this.devicePixelRatio,t.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(Vt),this.material.uniforms.basisViewport.value.set(2/Vt.x,2/Vt.y),this.material.uniforms.focal.value.set(e,n),this.material.uniforms.orthoZoom.value=s,this.material.uniformsNeedUpdate=!0)}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(){return this.splatCount}getCenters(){return this.centers}getColors(){return this.colors}getCovariances(){return this.covariances}dispose(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose()),this.removeFromParent()}},Lt=new Promise(t=>{Qt=t}),Xt=!1;function Zt(){if(!Xt)return Yt||(Yt=async function(){let t=await import("./gaussian-splat-compression.js");Qt(t),Xt=!0}())}var Kt=new it,Ht=new tt,Jt=new $,$t=new $,te=new $,ee=new $,ne=new $,se=new $;function ie(t,e,n){n.length=0;let{axis:s,sign:i,limit:r}=e;for(let e=0;e<t.length;e++){let a=t[e],o=t[(e+1)%t.length],l=(0===s?a.px:1===s?a.py:a.pz)*i-r,d=(0===s?o.px:1===s?o.py:o.pz)*i-r,c=l<=0,h=d<=0;if(c&&n.push(a),c!==h){let t=l/(l-d);n.push({px:a.px+(o.px-a.px)*t,py:a.py+(o.py-a.py)*t,pz:a.pz+(o.pz-a.pz)*t,nx:a.nx+(o.nx-a.nx)*t,ny:a.ny+(o.ny-a.ny)*t,nz:a.nz+(o.nz-a.nz)*t})}}return n}function re(t,e,n,s,i,r,a,o,l){let d=t.geometry,c=d.getAttribute("position");if(void 0===c||0===c.count)return!0;let h=d.getAttribute("normal"),p=d.getIndex(),u=null!==p?p.count:c.count;if(u>15e5)return!0;let m=d.drawRange.start,f=m+(d.drawRange.count===1/0?u-m:Math.min(d.drawRange.count,u-m));Kt.copy(t.objectToDecal),Ht.getNormalMatrix(Kt);let y=[],g=[];for(let t=m;t+2<f;t+=3){let d=null!==p?p.getX(t):t,u=null!==p?p.getX(t+1):t+1,m=null!==p?p.getX(t+2):t+2;if(Jt.fromBufferAttribute(c,d).applyMatrix4(Kt),$t.fromBufferAttribute(c,u).applyMatrix4(Kt),te.fromBufferAttribute(c,m).applyMatrix4(Kt),Jt.z>n&&$t.z>n&&te.z>n||Jt.z<-n&&$t.z<-n&&te.z<-n)continue;ee.subVectors($t,Jt),ne.subVectors(te,Jt),se.crossVectors(ee,ne);let f=se.length();if(!(0===f||se.z/f<=.01)){if(y.length=0,void 0!==h)ee.fromBufferAttribute(h,d).applyMatrix3(Ht),y.push({px:Jt.x,py:Jt.y,pz:Jt.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,u).applyMatrix3(Ht),y.push({px:$t.x,py:$t.y,pz:$t.z,nx:ee.x,ny:ee.y,nz:ee.z}),ee.fromBufferAttribute(h,m).applyMatrix3(Ht),y.push({px:te.x,py:te.y,pz:te.z,nx:ee.x,ny:ee.y,nz:ee.z});else{se.divideScalar(f);for(let t of[Jt,$t,te])y.push({px:t.x,py:t.y,pz:t.z,nx:se.x,ny:se.y,nz:se.z})}for(let t of e){if(0===y.length)break;let e=ie(y,t,g);g=y,y=e}if(!(y.length<3)){if(a.length/3+3*(y.length-2)>3e5)return!1;for(let t=1;t+1<y.length;t++)for(let e of[y[0],y[t],y[t+1]]){l.push(e.px*s+.5,e.py*i+.5);let t=e.nx,n=e.ny,d=e.nz,c=Math.hypot(t,n,d);c>0?(t/=c,n/=c,d/=c):(t=0,n=0,d=1),a.push(e.px+t*r,e.py+n*r,e.pz+d*r),o.push(t,n,d)}}}}return!0}var ae=new lt,oe=new lt,le=new it,de=new $,ce=class extends C{constructor(t,e,n){super(t,e),this.data=e,this.geometry=new mt,this.lastSignature=[],this.nextSignature=[],this.scanned=[],this.lastParams={width:0,height:0,depth:0,offset:0},this.context=n;let s=this.data.geometry;this.lastParams={width:this.resolveNumber(s.width,0),height:this.resolveNumber(s.height,0),depth:this.resolveNumber(s.depth,0),offset:s.offset??0},this.geometry.userData={type:"DecalGeometry",parameters:{...this.lastParams}}}get isLOD(){return this.updateDecal(),!1}get isDecalObject(){return!0}resolveNumber(t,e){if("number"==typeof t)return t;let n=Number(this.context.shared.getVariable(t));return Number.isFinite(n)?n:e}currentParams(){let t=this.dataPatched.geometry;return{width:this.resolveNumber(t.width,this.lastParams.width),height:this.resolveNumber(t.height,this.lastParams.height),depth:this.resolveNumber(t.depth,this.lastParams.depth),offset:t.offset??0}}projectionRoot(){let t=this.parent;for(;null!==t&&B.is(t);){if("Page"===t.data?.type)return t;t=t.parent}return this.context.scene}scanTargets(t,e,n){let s=this.scanned;s.length=0;let i=this.projectionRoot();if(null===i)return s;ae.makeEmpty();for(let s=0;s<8;s++)de.set((1&s?.5:-.5)*t,(2&s?.5:-.5)*e,(4&s?.5:-.5)*n).applyMatrix4(this.matrixWorld),ae.expandByPoint(de);return i.traverse(t=>{if(t===this||!B.is(t)||!(t instanceof D)||t instanceof ce||"Mesh"!==t.dataPatched?.type||!t.visible||t.destroyedInAction||512&t.layers.mask)return;let e=t.geometry,n=e?.getAttribute("position");void 0===n||0===n.count||0!==e.drawRange.count&&(null===e.boundingBox&&e.computeBoundingBox(),oe.copy(e.boundingBox).applyMatrix4(t.matrixWorld),ae.intersectsBox(oe)&&s.push(t))}),s}collectSignature(t,e,n){t.length=0,t.push(n.width,n.height,n.depth,n.offset);for(let e of this.matrixWorld.elements)t.push(e);for(let n of e){t.push(n.id,n.geometry.id);let e=n.geometry.getAttribute("position");t.push(void 0===e?-1:"version"in e?e.version:e.data.version);let s=n.geometry.getIndex();t.push(null!==s?s.version:-1),t.push(n.geometry.drawRange.count===1/0?-1:n.geometry.drawRange.count);for(let e of n.matrixWorld.elements)t.push(e)}}signaturesEqual(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}updateDecal(){if(this.disposed)return!1;this.updateWorldMatrix(!0,!1);let t=this.currentParams(),e=this.scanTargets(t.width,t.height,t.depth);if(this.collectSignature(this.nextSignature,e,t),this.signaturesEqual(this.nextSignature,this.lastSignature))return!1;let n=this.lastSignature;this.lastSignature=this.nextSignature,this.nextSignature=n,this.lastParams=t,le.copy(this.matrixWorld).invert();let s=e.map(t=>({geometry:t.geometry,objectToDecal:(new it).multiplyMatrices(le,t.matrixWorld)}));return this.geometry.dispose(),this.geometry=function(t,e){let n=Math.max(Math.abs(e.width),1e-6),s=Math.max(Math.abs(e.height),1e-6),i=Math.max(Math.abs(e.depth),1e-6),r=[{axis:0,sign:1,limit:n/2},{axis:0,sign:-1,limit:n/2},{axis:1,sign:1,limit:s/2},{axis:1,sign:-1,limit:s/2},{axis:2,sign:1,limit:i/2},{axis:2,sign:-1,limit:i/2}],a=[],o=[],l=[];for(let d of t)if(!re(d,r,i/2,1/n,1/s,e.offset,a,o,l))break;let d=new mt;return d.setAttribute("position",new ht(a,3)),d.setAttribute("normal",new ht(o,3)),d.setAttribute("uv",new ht(l,2)),0===a.length?(d.setDrawRange(0,0),d.boundingSphere=new pt):d.computeBoundingSphere(),d}(s,t),this.geometry.userData={type:"DecalGeometry",parameters:{width:t.width,height:t.height,depth:t.depth}},g(this),x(this),this.resetBBoxNeedsUpdate(),!0}updateByPatchedOp(t,e,n){super.updateByPatchedOp(t,e,n),M(t.path,["geometry"])&&this.resetBBoxNeedsUpdate()}updateEntityBoxSize(t,e){let n=this.currentParams();t.setScalar(0),e.set(n.width,n.height,n.depth).multiplyScalar(.5)}dispose(){super.dispose(),this.geometry.dispose()}},he=class extends(A(vt,v)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),this.matrixAutoUpdate=!0}updateState(t,e){this.updateState_Entity(t,e)}},pe=function(){try{let t=window.location.href;if(t.includes("reducesubdiv=")){let e=t.indexOf("reducesubdiv=")+13;return parseInt(t.slice(e,e+1))}}catch{}}();function ue(n,s,i){if(console.assert(void 0!==s.type),"Mesh"===s.type)return function(t,e,n){let s;if(void 0!==pe&&e?.geometry&&"subdivisions"in e.geometry&&(e.geometry.subdivisions??0)>pe&&Object.assign(e.geometry,{subdivisions:pe}),"TextGeometry"===e.geometry.type||"InputGeometry"===e.geometry.type){let s=U(e.geometry.type);return s?s(t,e,n):(_("InputGeometry"===e.geometry.type?"textinputs":"text",`a Mesh with ${e.geometry.type}`),new w(t,e,n))}if("SubdivGeometry"===e.geometry.type)s=new y(t,e,n);else if("PathGeometry"===e.geometry.type||"VectorGeometry"===e.geometry.type||"ShapeBlendGeometry"===e.geometry.type){let i=U(e.geometry.type);i?s=i(t,e,n):(_("ShapeBlendGeometry"===e.geometry.type?"shape-blends":"PathGeometry"===e.geometry.type?"3d-paths":"vector-shapes",`a Mesh with ${e.geometry.type}`),s=new w(t,e,n))}else if("BooleanGeometry"===e.geometry.type)s=new d(t,e,n);else if("DecalGeometry"===e.geometry.type)s=new ce(t,e,n);else if("UIGeometry"===e.geometry.type){let i=U("UIGeometry");i?s=i(t,e,n):(_("ui-2d","a Mesh with UIGeometry"),s=new w(t,e,n))}else s=new w(t,e,n);return s}(n,s,i);if("Empty"===s.type)return new e(n,s);if("Particle"===s.type){let t=k("Particle");return t?t(n,s,i):(_("particles","a Particle system"),new e(n,s))}if("ParticleCollider"===s.type)return new f(n,s,i);if("Hair"===s.type){let t=k("Hair");return t?t(n,s,i):(_("hair","a Hair System"),new e(n,s))}if("Splat"===s.type)return new e(n,s);if("Bone"===s.type)return new he(n,s);if("Page"===s.type)return new a(n,s,i);if("PointLight"===s.type)return new t(n,s,i);if("SpotLight"===s.type)return new l(n,s,i);if("DirectionalLight"===s.type)return new o(n,s,i);if("Component"===s.type||"Instance"===s.type){let t=k(s.type);return t?t(n,s,i):(_("components",`a ${s.type}`),new e(n,s))}return G.is(s.type)?new m(n,s):(console.error(s),new e(n,s))}P.createEntity=ue,P.changeEntityProptotype=function(t,e,n){let s=ue(t.identity,e,n),i=t.children,r=t.attachedPaths,a=t.parent,o=t.component,l=t.instances,d=t.overrideData,c=t.uuid,h=t.stateSelection;t.dispose();for(let e of Object.keys(t))delete t[e];Object.setPrototypeOf(t,Object.getPrototypeOf(s));for(let e of Object.keys(s))t[e]=s[e];t.children=[...t.children,...i],t.attachedPaths=r,t.parent=a,t.component=o,t.instances=l,t.uuid=c,t.overrideData=d,t.updateState(t.data,n),h&&t.changeSelectedState(h,n),t.resetBBoxNeedsUpdate()};var me,fe=class{constructor(){this._constraints=new Map}setConstraint(t,e){null===e?this._constraints.delete(t):this._constraints.set(t,e)}removeDependencies(t){this._constraints.delete(t)}applyConstraints(t){let e=new Set;this._constraints.forEach((n,s)=>{let i=[s,n],r=n;for(;this._constraints.has(r);){if(r=this._constraints.get(r),i.includes(r)){console.warn(`circular dependency detected: ${i.join(" -> ")}`);break}e.has(r)||i.push(r)}for(let n=i.length-2;n>=0;n--)if(!e.has(i[n])){let s=t.find(i[n]);s?s.applyPathSnapping(t):console.warn(`missing entity ${i[n]}`),e.add(i[n])}})}findDependency(t,e){let n=t;for(;this._constraints.has(n);)if(n=this._constraints.get(n),n===e)return!0;return!1}},ye=class{};Pt(ye,"DepthMapRange",65536),Pt(ye,"MemoryPageSize",65536),Pt(ye,"BytesPerFloat",4),Pt(ye,"BytesPerInt",4),Lt.then(t=>me=t);var ge=class{constructor(t={}){Pt(this,"updateView",function(){let t=new it,e=[],n=new $(0,0,-1),s=new $(0,0,-1),i=new $,r=new $;return function(a=!1,o){let l=this.updateMatrixWorldsInWorkerIfNeeded(),d=this.cropsChanged();if(!a){s.set(0,0,-1).applyQuaternion(o.quaternion);let t=!1,e=!1;if(s.dot(n)<=.95&&(t=!0),r.copy(o.position).sub(i).length()>=1&&(e=!0),!(t||e||l||d||this.needsInitialRender))return}this.needsInitialRender=!1,i.copy(o.position),n.copy(s),t.copy(o.matrixWorld).invert(),t.premultiply(this.dummyPerspectiveMatrix),e[0]=o.position.x,e[1]=o.position.y,e[2]=o.position.z;let c={sort:{view:t.elements,cameraPosition:e,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount},...l?{newMatrixWorlds:this.meshMatrixWorlds}:{},...d?{newCropsArray:this.cropsArray}:{}};this.sortRunning?this.queuedMessage=c:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(c))}}()),this.scene=t.scene,this.currentPage=null,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null,this.needsInitialRender=!0,this.dummyPerspectiveMatrix=(new it).makePerspective(-1,1,-1,1,.1,1e3)}updateSplatMeshUniforms(t,e){let n=new H;null!==this.splatMesh&&this.splatMesh.getSplatCount()>0&&(t.getSize(n),this.cameraFocalLengthX=e.projectionMatrix.elements[0]*this.devicePixelRatio*n.x*.45,this.cameraFocalLengthY=e.projectionMatrix.elements[5]*this.devicePixelRatio*n.y*.45,this.splatMesh.updateUniforms(n,this.cameraFocalLengthX,this.cameraFocalLengthY,e.isPerspectiveCamera?-1:e.zoom*this.devicePixelRatio))}loadSplat(t={}){this.activePage=this.scene.activePage,t.position&&(t.position=(new $).fromArray(t.position)),t.orientation&&(t.orientation=(new J).fromArray(t.orientation)),t.halfPrecisionCovariances=!!t.halfPrecisionCovariances;let e=[];if(this.splatEntries=e,this.activePage.traverseVisibleEntity(t=>{"Splat"===t.data.type&&e.push(t)}),this.splatMesh&&this.splatMesh.dispose(),0===e.length)return this.splatMesh=null,!1;this.meshMatrixWorlds=e.map(t=>t.matrixWorld),this.meshMatrixWorldsOld=e.map(t=>t.matrixWorld.clone()),this.cropsArray=e.map(t=>t.data.crops.map(t=>t.data)),this._splatBufferCache??(this._splatBufferCache=new WeakMap);let n=e.map(t=>{let e=this._splatBufferCache.get(t.data.buffer);return void 0===e&&(e=new me.GSplineBuffer(new Uint8Array(t.data.buffer).buffer),this._splatBufferCache.set(t.data.buffer,e)),e}),s=0,i=[0];for(let t of n)s+=t.getSplatCount(),i.push(s);return this.setupSplatMesh(n,s,t.position,t.orientation,t.halfPrecisionCovariances,this.devicePixelRatio,i,this.meshMatrixWorlds),this.setupSortWorker(s),!0}updateMatrixWorldsInWorkerIfNeeded(){let t=this.splatDataTextures.meshMatrixWorlds.data;for(let e=0;e<this.meshMatrixWorlds.length;e++)t.set(this.meshMatrixWorlds[e].elements,16*e);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,!this.meshMatrixWorlds.every((t,e)=>t.equals(this.meshMatrixWorldsOld[e]))&&(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map(t=>t.clone()),!0)}cropsChanged(){let t=!1;return this.splatEntries.forEach((e,n)=>{e.data.crops.forEach((e,s)=>{void 0===this.cropsArray[n][s]?(t=!0,this.cropsArray[n][s]=e.data):Object.entries(e.data).forEach(([e,i])=>{(Array.isArray(i)&&i.some((t,i)=>t!==this.cropsArray[n][s][e][i])||i!==this.cropsArray[n][s]?.[e])&&(t=!0,this.cropsArray[n][s][e]=i)})}),e.data.crops.length!==this.cropsArray[n]?.length&&(this.cropsArray[n].length=e.data.crops.length,t=!0)}),t}setupSplatMesh(t,e,n=new $,s=new J,i=!1,r=1,a,o){this.splatMesh=qt.buildMesh(t,e,i,r,a,o),this.splatMesh.position.copy(n),this.splatMesh.quaternion.copy(s),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=99999,this.splatRenderCount=e,this.splatMesh.onBeforeRender=(t,e,n)=>this.update(t,n)}setupSortWorker(t){this.sortWorker=function(t){let e=new Worker(URL.createObjectURL(new Blob(["(","\nfunction sortWorker(self) {\n\tlet wasmInstance;\n\tlet splatCount;\n\tlet splatRC;\n\tlet indexesOffset;\n\tlet positionsOffset;\n\tlet viewProjOffset;\n\tlet frequenciesOffset;\n\tlet indexesOutOffset;\n\tlet sortBuffersOffset;\n\tlet wasmMemory;\n\tlet positions;\n\n\tlet Constants;\n\tlet floatPositions;\n\tlet meshIndexIntervals;\n\tlet meshMatrixWorlds;\n\tlet cropsArray;\n\n\tfunction sort(viewProj) {\n\t\t// console.time('WASM SORT');\n\t\tconst viewProjArray = new Float64Array(wasmMemory, viewProjOffset, 16);\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tviewProjArray[i] = viewProj[i];\n\t\t}\n\t\tlet indexesBuffer;\n\t\t// console.timeEnd('WASM SORT');\n\t\tif (splatRC > 1) {\n\t\t\twasmInstance.exports.sortIndexes(\n\t\t\t\tindexesOffset,\n\t\t\t\tpositionsOffset,\n\t\t\t\tsortBuffersOffset,\n\t\t\t\tviewProjOffset,\n\t\t\t\tfrequenciesOffset,\n\t\t\t\tindexesOutOffset,\n\t\t\t\tConstants.DepthMapRange,\n\t\t\t\tsplatRC\n\t\t\t);\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t\tindexes.set(new Uint32Array(wasmMemory, indexesOutOffset, splatRC));\n\t\t} else if (splatRC === 1) {\n\t\t\tconst indexes = new Uint32Array(splatRC);\n\t\t\tindexes[0] = new Uint32Array(wasmMemory, indexesOffset, splatCount)[0];\n\t\t\tindexesBuffer = indexes.buffer;\n\t\t} else {\n\t\t\tindexesBuffer = new ArrayBuffer(0);\n\t\t}\n\n\t\tself.postMessage(\n\t\t\t{\n\t\t\t\tsortDone: true,\n\t\t\t\tindexesBuffer,\n\t\t\t},\n\t\t\t[indexesBuffer]\n\t\t);\n\t}\n\tfunction updateRenderedSplats(\n\t\tmeshMatrixWorlds,\n\t\tcropsArray,\n\t\tmeshIndexIntervals\n\t) {\n\t\tconst renderedPositions = new Float32Array(\n\t\t\twasmMemory,\n\t\t\tpositionsOffset,\n\t\t\tsplatCount * 3\n\t\t);\n\t\tsplatRC = 0;\n\t\tconst wasmMemoryIndexes = new Uint32Array(\n\t\t\twasmMemory,\n\t\t\tindexesOffset,\n\t\t\tsplatCount\n\t\t);\n\t\tfor (let i = 0; i < meshIndexIntervals.length - 1; i++) {\n\t\t\tconst crops = cropsArray[i];\n\t\t\tconst matrixWorld = meshMatrixWorlds[i].elements;\n\t\t\tconst paramsIn = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tconst paramsOut = crops\n\t\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t\t.map((c) =>\n\t\t\t\t\tc.type === 'Box'\n\t\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t\t);\n\t\t\tfor (let j = meshIndexIntervals[i]; j < meshIndexIntervals[i + 1]; j++) {\n\t\t\t\tconst x = floatPositions[j * 3];\n\t\t\t\tconst y = floatPositions[j * 3 + 1];\n\t\t\t\tconst z = floatPositions[j * 3 + 2];\n\t\t\t\tif (\n\t\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t\t) {\n\t\t\t\t\tconst w =\n\t\t\t\t\t\t1 /\n\t\t\t\t\t\t(matrixWorld[3] * x +\n\t\t\t\t\t\t\tmatrixWorld[7] * y +\n\t\t\t\t\t\t\tmatrixWorld[11] * z +\n\t\t\t\t\t\t\tmatrixWorld[15]);\n\t\t\t\t\trenderedPositions[splatRC * 3] =\n\t\t\t\t\t\t(matrixWorld[0] * x +\n\t\t\t\t\t\t\tmatrixWorld[4] * y +\n\t\t\t\t\t\t\tmatrixWorld[8] * z +\n\t\t\t\t\t\t\tmatrixWorld[12]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 1] =\n\t\t\t\t\t\t(matrixWorld[1] * x +\n\t\t\t\t\t\t\tmatrixWorld[5] * y +\n\t\t\t\t\t\t\tmatrixWorld[9] * z +\n\t\t\t\t\t\t\tmatrixWorld[13]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\trenderedPositions[splatRC * 3 + 2] =\n\t\t\t\t\t\t(matrixWorld[2] * x +\n\t\t\t\t\t\t\tmatrixWorld[6] * y +\n\t\t\t\t\t\t\tmatrixWorld[10] * z +\n\t\t\t\t\t\t\tmatrixWorld[14]) *\n\t\t\t\t\t\tw;\n\t\t\t\t\twasmMemoryIndexes[splatRC] = j;\n\t\t\t\t\tsplatRC++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfunction getOutOfBoundsIndexes(floatPositions, crops) {\n\t\tconst outOfBoundsIndexes = [];\n\t\tconst paramsIn = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Include')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\t\tconst paramsOut = crops\n\t\t\t.filter((a) => a.enabled && a.mode === 'Exclude')\n\t\t\t.map((c) =>\n\t\t\t\tc.type === 'Box'\n\t\t\t\t\t? computeBoundingBoxVertices(c)\n\t\t\t\t\t: computeEllipsoidParams(c)\n\t\t\t);\n\n\t\tconst len = floatPositions.length;\n\t\tfor (let j = 0; j < len; j += 3) {\n\t\t\tconst x = floatPositions[j];\n\t\t\tconst y = floatPositions[j + 1];\n\t\t\tconst z = floatPositions[j + 2];\n\t\t\tif (\n\t\t\t\t(paramsIn.length === 0 || isInBounds(x, y, z, paramsIn)) &&\n\t\t\t\t(paramsOut.length === 0 || !isInBounds(x, y, z, paramsOut))\n\t\t\t) {\n\t\t\t\t// in bounds: intentionally skip\n\t\t\t} else {\n\t\t\t\toutOfBoundsIndexes.push(j / 3);\n\t\t\t}\n\t\t}\n\t\t// console.log(outOfBoundsIndexes);\n\t\treturn outOfBoundsIndexes;\n\t}\n\n\tfunction isInBounds(x, y, z, params, mode) {\n\t\treturn params[mode === 'Intersect' ? 'every' : 'some']((param) => {\n\t\t\tconst t = applyRotationMatrix(\n\t\t\t\tx,\n\t\t\t\ty,\n\t\t\t\tz,\n\t\t\t\tparam.invRotationMatrix,\n\t\t\t\tparam.cropCenter\n\t\t\t);\n\t\t\treturn Array.isArray(param)\n\t\t\t\t? isVertexInsideBoundingBox(t.x, t.y, t.z, param)\n\t\t\t\t: isPointInsideEllipsoid(t.x, t.y, t.z, param);\n\t\t});\n\t}\n\tfunction applyRotationMatrix(_x, _y, _z, e, pivot) {\n\t\tconst x = _x - pivot[0];\n\t\tconst y = _y - pivot[1];\n\t\tconst z = _z - pivot[2];\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\treturn {\n\t\t\tx: (e[0] * x + e[4] * y + e[8] * z + e[12]) * w + pivot[0],\n\t\t\ty: (e[1] * x + e[5] * y + e[9] * z + e[13]) * w + pivot[1],\n\t\t\tz: (e[2] * x + e[6] * y + e[10] * z + e[14]) * w + pivot[2],\n\t\t};\n\t}\n\tfunction computeBoundingBoxVertices(box) {\n\t\tconst halfSizeX = box.cropSize[0] / 2;\n\t\tconst halfSizeY = box.cropSize[1] / 2;\n\t\tconst halfSizeZ = box.cropSize[2] / 2;\n\t\tconst bounds = [\n\t\t\tbox.cropCenter[0] - halfSizeX,\n\t\t\tbox.cropCenter[1] - halfSizeY,\n\t\t\tbox.cropCenter[2] - halfSizeZ,\n\t\t\tbox.cropCenter[0] + halfSizeX,\n\t\t\tbox.cropCenter[1] + halfSizeY,\n\t\t\tbox.cropCenter[2] + halfSizeZ,\n\t\t];\n\t\tconst invRotationMatrix = getInvRotationMatrix(box.cropRotation);\n\t\treturn Object.assign(bounds, {\n\t\t\tinvRotationMatrix,\n\t\t\tcropCenter: box.cropCenter,\n\t\t});\n\t}\n\tfunction getInvRotationMatrix(_rotation) {\n\t\tconst te = [];\n\t\tconst x = (_rotation[0] * Math.PI) / 180,\n\t\t\ty = (_rotation[1] * Math.PI) / 180,\n\t\t\tz = (_rotation[2] * Math.PI) / 180;\n\t\tconst a = Math.cos(x),\n\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\tf = Math.sin(z);\n\t\tconst ae = a * e,\n\t\t\taf = a * f,\n\t\t\tbe = b * e,\n\t\t\tbf = b * f;\n\n\t\tte[0] = c * e;\n\t\tte[1] = -c * f;\n\t\tte[2] = d;\n\n\t\tte[4] = af + be * d;\n\t\tte[5] = ae - bf * d;\n\t\tte[6] = -b * c;\n\n\t\tte[8] = bf - ae * d;\n\t\tte[9] = be + af * d;\n\t\tte[10] = a * c;\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\n\t\treturn te;\n\t}\n\tfunction isVertexInsideBoundingBox(x, y, z, bounds) {\n\t\treturn (\n\t\t\tx >= bounds[0] &&\n\t\t\tx <= bounds[3] &&\n\t\t\ty >= bounds[1] &&\n\t\t\ty <= bounds[4] &&\n\t\t\tz >= bounds[2] &&\n\t\t\tz <= bounds[5]\n\t\t);\n\t}\n\tfunction computeEllipsoidParams(ellipsoid) {\n\t\t// Precompute the scaling factors\n\t\tconst invRadiusX = 2 / ellipsoid.cropSize[0];\n\t\tconst invRadiusY = 2 / ellipsoid.cropSize[1];\n\t\tconst invRadiusZ = 2 / ellipsoid.cropSize[2];\n\t\tconst invRotationMatrix = getInvRotationMatrix(ellipsoid.cropRotation);\n\t\treturn {\n\t\t\tinvRadiusX,\n\t\t\tinvRadiusY,\n\t\t\tinvRadiusZ,\n\t\t\tcropCenter: ellipsoid.cropCenter,\n\t\t\tinvRotationMatrix,\n\t\t};\n\t}\n\tfunction isPointInsideEllipsoid(x, y, z, ellipsoidParams) {\n\t\tconst _x = (x - ellipsoidParams.cropCenter[0]) * ellipsoidParams.invRadiusX;\n\t\tconst _y = (y - ellipsoidParams.cropCenter[1]) * ellipsoidParams.invRadiusY;\n\t\tconst _z = (z - ellipsoidParams.cropCenter[2]) * ellipsoidParams.invRadiusZ;\n\t\treturn _x * _x + _y * _y + _z * _z <= 1;\n\t}\n\n\tself.onmessage = (e) => {\n\t\tif (e.data.getCroppedIndexes) {\n\t\t\tconst outOfBoundsIndexes = new Uint32Array(\n\t\t\t\tgetOutOfBoundsIndexes(new Float32Array(e.data.positions), e.data.crops)\n\t\t\t).buffer;\n\t\t\tself.postMessage(\n\t\t\t\t{\n\t\t\t\t\toutOfBoundsIndexes,\n\t\t\t\t},\n\t\t\t\t[outOfBoundsIndexes]\n\t\t\t);\n\t\t} else if (e.data.positions) {\n\t\t\tpositions = e.data.positions;\n\t\t\tfloatPositions = new Float32Array(positions);\n\t\t\tmeshMatrixWorlds = e.data.meshMatrixWorlds;\n\t\t\tcropsArray = e.data.cropsArray;\n\t\t\tmeshIndexIntervals = e.data.meshIndexIntervals;\n\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\tself.postMessage({\n\t\t\t\tsortSetupComplete: true,\n\t\t\t});\n\t\t} else if (e.data.sort || e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\tif (e.data.newMatrixWorlds || e.data.newCropsArray) {\n\t\t\t\tcropsArray = e.data.newCropsArray || cropsArray;\n\t\t\t\tmeshMatrixWorlds = e.data.newMatrixWorlds || meshMatrixWorlds;\n\t\t\t\tupdateRenderedSplats(meshMatrixWorlds, cropsArray, meshIndexIntervals);\n\t\t\t}\n\t\t\tsort(e.data.sort.view, e.data.sort.cameraPosition);\n\t\t} else if (e.data.init) {\n\t\t\t// Yep, this is super hacky and gross :(\n\t\t\tConstants = e.data.init.Constants;\n\n\t\t\tsplatCount = e.data.init.splatCount;\n\n\t\t\tconst INDEXES_BYTES_PER_ENTRY = Constants.BytesPerInt;\n\t\t\tconst POSITIONS_BYTES_PER_ENTRY = Constants.BytesPerFloat * 3;\n\n\t\t\tconst sorterWasmBytes = new Uint8Array(e.data.init.sorterWasmBytes);\n\t\t\tconst memoryBytesPerVertex =\n\t\t\t\tINDEXES_BYTES_PER_ENTRY + POSITIONS_BYTES_PER_ENTRY;\n\t\t\tconst memoryRequiredForVertices = splatCount * memoryBytesPerVertex;\n\t\t\tconst memoryRequiredForSortBuffers =\n\t\t\t\tsplatCount * Constants.BytesPerInt * 2 +\n\t\t\t\tConstants.DepthMapRange * Constants.BytesPerInt * 2;\n\t\t\tconst extraMemory = Constants.MemoryPageSize * 32;\n\t\t\tconst totalRequiredMemory =\n\t\t\t\tmemoryRequiredForVertices + memoryRequiredForSortBuffers + extraMemory;\n\t\t\tconst totalPagesRequired =\n\t\t\t\tMath.floor(totalRequiredMemory / Constants.MemoryPageSize) + 1;\n\t\t\tconst sorterWasmImport = {\n\t\t\t\tmodule: {},\n\t\t\t\tenv: {\n\t\t\t\t\tmemory: new WebAssembly.Memory({\n\t\t\t\t\t\tinitial: totalPagesRequired * 2,\n\t\t\t\t\t\tmaximum: totalPagesRequired * 3,\n\t\t\t\t\t\tshared: true,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t};\n\t\t\tWebAssembly.compile(sorterWasmBytes)\n\t\t\t\t.then((wasmModule) => {\n\t\t\t\t\treturn WebAssembly.instantiate(wasmModule, sorterWasmImport);\n\t\t\t\t})\n\t\t\t\t.then((instance) => {\n\t\t\t\t\twasmInstance = instance;\n\t\t\t\t\tindexesOffset = 0;\n\t\t\t\t\tpositionsOffset = splatCount * INDEXES_BYTES_PER_ENTRY;\n\t\t\t\t\tviewProjOffset =\n\t\t\t\t\t\tpositionsOffset + splatCount * POSITIONS_BYTES_PER_ENTRY;\n\t\t\t\t\tsortBuffersOffset = viewProjOffset + 16 * Constants.BytesPerFloat * 2;\n\t\t\t\t\tfrequenciesOffset =\n\t\t\t\t\t\tsortBuffersOffset + splatCount * Constants.BytesPerInt;\n\t\t\t\t\tindexesOutOffset =\n\t\t\t\t\t\tfrequenciesOffset + Constants.DepthMapRange * Constants.BytesPerInt;\n\t\t\t\t\twasmMemory = sorterWasmImport.env.memory.buffer;\n\t\t\t\t\tself.postMessage({\n\t\t\t\t\t\tsortSetupPhase1Complete: true,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\t};\n}\n",")(self)"],{type:"application/javascript"}))),n=atob("AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL"),s=new Uint8Array(n.length);for(let t=0;t<n.length;t++)s[t]=n.charCodeAt(t);return e.postMessage({init:{sorterWasmBytes:s.buffer,splatCount:t,Constants:{BytesPerFloat:ye.BytesPerFloat,BytesPerInt:ye.BytesPerInt,DepthMapRange:ye.DepthMapRange,MemoryPageSize:ye.MemoryPageSize}}}),e}(t),this.sortWorker.onmessage=t=>{t.data.sortDone?(this.sortRunning=!1,this.splatMesh?.updateIndexes(new Uint32Array(t.data.indexesBuffer)),this.lastSortTime=t.data.sortTime,this.queuedMessage&&(this.sortWorker.postMessage(this.queuedMessage),this.queuedMessage=null)):t.data.sortCanceled?this.sortRunning=!1:t.data.sortSetupPhase1Complete?this.sortWorker.postMessage({positions:this.splatMesh.getCenters().buffer,meshMatrixWorlds:this.splatMesh.meshMatrixWorlds,meshIndexIntervals:this.splatMesh.meshIndexIntervals,cropsArray:this.cropsArray}):t.data.sortSetupComplete&&(this.splatDataTextures=this.splatMesh.getSplatDataTextures(),this.scene.activePage.add(this.splatMesh),this.needsInitialRender=!0)}}update(t,e){null!==this.splatMesh&&(this.updateSplatMeshUniforms(t,e),this.updateView(!1,e))}getSplatMesh(){return this.splatMesh}},xe=new ft;xe.wireframe=!0;var ve=new $,Ae=class extends ot{constructor(t,n){super(),this.data=t,this.sharedAssets=n,this.enableHelpers=!1,this.wireframeState=!1,this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this._needsTransmission=!1,this._needsNormal=!1,this._normalPassNeeds={outline:!1,cavity:!1},this._needsReflection=!1,this.geometryCacheChanged=!1,this.splatViewer=null,this.shapeBlendIntances=[],this.hairInstances=[],this.shadowsDirty=!0,this.instanceGroupsDirty=!0,this._autoInstancing=null,this.entityByUuid={},this.entityIdentityToEntity={},this.toExpandCloner=new Set,this.toUpdateCloner=new Set,this.pendingCommands=[],this.pathConstraints=new fe,this.invisibleObjects=new e("jflkdsafjasdifjaslk",{...X.defaultData,visible:!1,name:"buildin invisible"}),this.needsRecomputeInstances=!1,this.init(t,n),this.matrixAutoUpdate=!1,this.errorPage=new a("fdasfa",{...N.defaultData,name:""},{shared:n,scene:this})}markGeometryCacheDirty(){this.geometryCacheChanged=!0}markShadowsDirty(){this.shadowsDirty=!0}markInstanceGroupsDirty(){this.instanceGroupsDirty=!0}get autoInstancing(){return this._autoInstancing}updateInstanceGroups(t,e){let n=this._autoInstancing;(null===n||n.minGroupSize!==e)&&(n?.dispose(),n=new Ut(e),this._autoInstancing=n);let s=this.instanceGroupsDirty;return this.instanceGroupsDirty=!1,n.update(t,s),n.stats}releaseInstanceGroups(){this._autoInstancing?.teardown(),this.instanceGroupsDirty=!0}markNeedsUpdateRendererDirty(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this.needsReflectionDirty=!0,this.shadowsDirty=!0,this.instanceGroupsDirty=!0}needsTransmission(){return this.needsTransmissionDirty&&(this._needsTransmission=s(this),this.needsTransmissionDirty=!1),this._needsTransmission}needsNormal(){return this.needsNormalDirty&&(this._normalPassNeeds=n(this),this._needsNormal=this._normalPassNeeds.outline||this._normalPassNeeds.cavity,this.needsNormalDirty=!1),this._needsNormal}normalPassNeeds(){return this.needsNormal(),this._normalPassNeeds}needsReflection(){return this.needsReflectionDirty&&(this._needsReflection=i(this),this.needsReflectionDirty=!1),this._needsReflection}registerInstanceAndSetUuid(t){let e=t.identity.join("-"),n=this.entityIdentityToEntity[e];n&&(t.uuid=n.uuid),this.entityIdentityToEntity[e]=t,this.entityByUuid[t.uuid]=t}markPenumbraSizeDirty(){for(let t of this.children)t instanceof a&&(t.penumbraSizeArrayCache=null)}findInstance(t){return this.entityIdentityToEntity[t.join("-")]}get bgColor(){return this.activePage.bgColor}get postprocessing(){return this.activePage.data.postprocessing}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let n=[],s=e;for(;s!==this;){let t=s;s=s.parent;let e=s.children.indexOf(t);n.splice(0,0,e)}return{entity:e,sortKey:n}}getAllSorted(t){let e=[];for(let n of t){let t=this.getWithSortKey(n.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>Q(t.sortKey,e.sortKey)),e.map(t=>t.entity)}nonExistOrDescendantOf(t,e){let n=this.find(t);if(void 0===n)return!0;for(;n;){if(n.uuid===e)return!0;n=n.parent}return!1}find(t){if(this.activePage&&this.activePage.personalCamera.parent){if("f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera"===t)return this.activePage.personalCamera;if(t===L)return this.activePage.personalCamera}if(""===t||void 0===t)return;let e=this.entityByUuid[t];return void 0===e?this.getObjectByProperty("uuid",t):e}find2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene){let n=e.uiScene.find(t);if(n)return n}}findScene2DfromObject2D(t){for(let e of this.children)if(e instanceof a&&e.uiScene&&e.uiScene.find(t))return e.uiScene}find2DInUIObjects(t){let e;return this.traverseEntity(n=>{void 0===e&&j(n)&&(e=n.uiCanvas.find(t))}),e}traverse2D(t){for(let e of this.children)e instanceof a&&e.uiScene&&e.uiScene.traverse(t)}debugEnsureEntity(t){let e=this.find(t);e?Array.isArray(e.identity)&&void 0===this.findInstance(e.identity)&&console.error("not found instance"):console.error("not found")}addPendingExpandCloner(t){this.toExpandCloner.add(t)}addPendingUpdateCloner(t){this.toUpdateCloner.add(t)}markToExpandCloner(t){this.toExpandCloner.add(t),t.traverseEntityAncestors(t=>{this.toExpandCloner.add(t)})}doPendingExpandCloner(t){this.toExpandCloner.forEach(e=>{e.expandCloner(t)}),this.toExpandCloner.clear()}doPendingUpdateCloner(t){this.toUpdateCloner.forEach(e=>{e.cloner?.update(t)}),this.toUpdateCloner.clear()}doPendingUpdates(t){this.doPendingExpandCloner(t),this.doPendingUpdateCloner(t),this.applyPendingCommands()}addPendingCommand(t){this.pendingCommands.push(t)}applyPendingCommands(){this.pendingCommands.forEach(t=>t()),this.pendingCommands.length=0}updateByLibOp(t,e){1===t.path.length&&"components"===t.path[0]&&1===t.type&&this.createChildrenObjects([{...t.data.asset,id:t.id}],this.invisibleObjects,e)}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let n=null===t.parent?this:this.find(t.parent);if(void 0===n)throw new Error(`scene tree add: parent ${t.parent} not found for object ${t.id}`);let s=this.createObject(t.id,t.data,t.children,n,t.localIndex,e);s.updateVisible(this),s.resetBBoxNeedsUpdate(),c(s)&&h(s.parent)&&(s.invalidateUpstreamBooleanData(),s.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(s),this.markToExpandCloner(s),this.markPenumbraSizeDirty(),s.updatePathSnapping()}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree delete: object ${t.id} not found`);e.traverseEntity(t=>{z(t)&&(this.shapeBlendIntances=this.shapeBlendIntances.filter(e=>e!==t)),E(t)&&(this.hairInstances=this.hairInstances.filter(e=>e!==t))}),this.markToExpandCloner(e),e.resetBBoxNeedsUpdate(),this.unregisterObject(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(e),this.markPenumbraSizeDirty(),e.parent.remove(e),h(e.parent)&&(e.parent.invalidateUpstreamBooleanData(),e.parent.invalidateDownstreamBooleanData().recomputeBoolean()),c(e)&&(e.freeBooleanPointer(),n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),O(e)&&e.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(e),this.pathConstraints.removeDependencies(e.uuid),e.updatePathSnapping()}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0===e)throw new Error(`scene tree move: object ${t.id} not found`);this.markNeedsRecomputeInstancesForChildren(e);let n=e.parent;this.markNeedsRecomputeInstancesForAncessors(n),e.cloner?.resetOnMove(),this.markToExpandCloner(e);let s=null===t.parent?this:this.find(t.parent);if(void 0===s)throw new Error(`scene tree move: new parent ${t.parent} not found for object ${t.id}`);s.add(e),this.markNeedsRecomputeInstancesForAncessors(s),this.markToExpandCloner(e),e.invalidateClonerTransform(e),e.updateVisible(this),e.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();let i=t.localIndex;s.children.splice(i,0,s.children.pop()),c(e)&&(e.invalidateUpstreamBooleanData(),h(e.parent)?e.parent.invalidateDownstreamBooleanData().recomputeBoolean():n instanceof d&&n.invalidateDownstreamBooleanData().recomputeBoolean()),e.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}get playPage(){return this.find(this.data.publish.playPage)??this.errorPage}updatePage(t){this.shadowsDirty=!0,this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;for(let e of this.children)e instanceof a&&(e.visible=e.uuid===t,e.visible&&(this.activePage=e,this.activePage.onActive(this)));this.activePage!==this.splatViewer?.activePage&&this.reloadSplats()}updateEntityByOp(t,e,n,s){if(this.shadowsDirty=!0,0===e.type){if(("overrides"in e.props||"component"in e.props)&&this.markNeedsRecomputeInstances(),"visible"in e.props&&this.markPenumbraSizeDirty(),e.path.includes("overrides")&&"states"in e.props){let{rest:t}=e.props;e={...e,props:t},this.markNeedsRecomputeInstances()}"pathSnapping"===e.path[0]&&void 0!==e.props.pathId&&this.pathConstraints.setConstraint(t,e.props.pathId)}let i=this.find(t);if(i)try{(function(t,e,n,s){t.updateByOp(e,n,s,!1)})(i,e,n,{scene:this,shared:s}),i instanceof w&&i.updateGeometryGroupsIfNeeded()}catch(t){console.error(t)}}updateEntity2DByOp(t,e,n,s,i,r=[]){t.updateEntityByOp(e,n,s,i),this.traverseEntity(t=>{(j(t)||t instanceof a)&&(r.includes(t.frameId??"")||t.frameId===e)&&t.updateEntity2DByOp(e,n,s,i)})}get activeCamera(){return this.activePage.activeCamera}switchActiveCamera(t){this.activePage.switchActiveCamera(t)}isInvisibleObjects(t){return t===this.invisibleObjects||t.hasAnccestor(this.invisibleObjects)}init(t,e){let n=Object.entries(e.data.lib.components).map((t,e)=>({data:t[1].asset.data,children:t[1].asset.children,id:t[0],fi:e}));this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:e}),this.add(this.invisibleObjects),this.createChildrenObjects(n,this.invisibleObjects,e),this.createChildrenObjects(t.objects,this,e),this.updatePage(t.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(e,!0),this.traverseEntity(t=>{t instanceof m&&t.updateUp()}),this.doPendingExpandCloner({scene:this,shared:e}),this.applyPendingCommands()}markNeedsRecomputeInstances(){this.needsRecomputeInstances=!0}markNeedsRecomputeInstancesForChildren(t){t.traverseEntity(t=>{("Component"===t.data.type||"Instance"===t.data.type)&&this.markNeedsRecomputeInstances()})}markNeedsRecomputeInstancesForAncessors(t){B.is(t)&&("Component"===t.data.type&&this.markNeedsRecomputeInstances(),t.traverseAncestors(t=>{B.is(t)&&"Component"===t.data.type&&this.markNeedsRecomputeInstances()}))}relativeizeInner(t,e,n,s,i,r,a){if(t){let o=s.find(t);o&&o!==s&&i.forInstancesRec(s=>{s.data=Y(s.data,i=>{let o=i.events.data(a.id),l=s.goUp(r);if(l){let s=[...F(l.identity),t].join("-"),i=this.entityIdentityToEntity[s];if(i){let t=i.uuid;q.zoom(o,e)[n]=t}else console.warn("cannot find instance")}}).data})}}rewriteActions(t,e,n,s,i,r){t.forEach(t=>{"Transition"===t.data.type||"Animation"===t.data.type?this.relativeizeInner(t.data.object,[...e,t.id],"object",n,s,i,r):"Conditional"===t.data.type&&(this.rewriteActions(t.data.ifActions,[...e,t.id,"ifActions"],n,s,i,r),this.rewriteActions(t.data.elseActions,[...e,t.id,"elseActions"],n,s,i,r))})}rewriteEventsBeforeGoToPlayMode(){this.traverseEntity(t=>{if(T(t)&&"string"==typeof t.identity&&"Component"===t.data.type)return t.traverseEntity((e,n)=>{e.data.events.forEach(s=>{if("GameControl"===s.data.type){let i=!1;if(e.forInstancesRec(t=>{t.data=Y(t.data,e=>{t.isInstanceRoot||(e.events.delete(s.id),i=!0)}).data}),!1===i)for(let i of V.list)this.rewriteActions(s.data.gameActions[i],["gameActions",i],t,e,n,s)}else"Conditional"===s.data.type?("Distance"===s.data.condition.type?(this.relativeizeInner(s.data.condition.fromObject,["condition"],"fromObject",t,e,n,s),this.relativeizeInner(s.data.condition.toObject,["condition"],"toObject",t,e,n,s)):"State"===s.data.condition.type?this.relativeizeInner(s.data.condition.object,["condition"],"object",t,e,n,s):"Comparison"===s.data.condition.type&&("Property"===s.data.condition.lOperand.type&&this.relativeizeInner(s.data.condition.lOperand.value[0],["condition","lOperand","value"],0,t,e,n,s),"Property"===s.data.condition.rOperand.type&&this.relativeizeInner(s.data.condition.rOperand.value[0],["condition","rOperand","value"],0,t,e,n,s)),this.rewriteActions(s.data.inActions,["inActions"],t,e,n,s),this.rewriteActions(s.data.outActions,["outActions"],t,e,n,s)):"actions"in s.data&&this.rewriteActions(s.data.actions,["actions"],t,e,n,s)})}),!0})}expandInstances(t,e,n){let s=new Set;this.traverseEntity(i=>{if(T(i)&&i.isInstanceRoot)return i.expandInstanceChildren({scene:this,shared:t,pendingDeletes:s}),e||i.resetBBoxNeedsUpdate(),n&&i.traverseEntity(t=>{n.addClip(t)}),!0});for(let t of s)this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(t),u(t)}recomputeInstances(t,e){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity(t=>{T(t)&&t.isInstanceRoot&&(t.component=void 0)}),this.expandInstances(t,!1,e))}disposeAndUnregisterEntityRecursivelyIfNotReregistered(t){t.traverseEntity(t=>{let e="string"==typeof t.identity?t.identity:t.identity.join("-");this.entityIdentityToEntity[e]===t&&(delete this.entityByUuid[t.uuid],delete this.entityIdentityToEntity[e]),t.dispose()})}clearScene(){this._autoInstancing?.dispose(),this._autoInstancing=null,this.instanceGroupsDirty=!0;for(let t of this.children)B.is(t)&&t.disposeRecursively();this.children.length=0}resetAfterClear(t,e){this.init(t,e)}raycast(t){return this.raycast1(t,!1)}raycast1(t,e){let n=[],s=i=>{for(let a of i.children){let i=a.cloner;if(B.is(a)&&!a.raycastLock&&(a.visible||i?.object.data.visible))if(!0===e&&a.isInstanceRoot){let e=[];if(t.intersectObject(a,!0,e),e.length){let t=e[0];t.object=a,t.point.applyMatrix4(t.object.matrixWorld);let s=a.matrixWorld.clone().invert();t.point.applyMatrix4(s),n.push(t)}}else(c(a)||p(a)&&this.enableHelpers&&a.objectHelper.visible)&&(t.intersectObject(a,!1,n),r(a,t,n)),s(a)}};return s(this.activePage),n}raycastWithClones(t){let e=[],n=s=>{for(let i of s.children){let s=i.cloner;B.is(i)&&(i.visible||s?.object.data.visible)&&((c(i)||p(i)&&this.enableHelpers&&i.objectHelper.visible)&&(t.intersectObject(i,!1,e),r(i,t,e,!0)),n(i))}};return n(this),e}forEachEntity(t){for(let e of this.children)B.is(e)&&t(e)}traverseConcreteEntity(t){for(let e of this.children)B.is(e)&&e.isConcreteEntity&&e.traverseEntity(t)}traverseEntity(t){for(let e of this.children)B.is(e)&&e.traverseEntity(t)}updateFont(t,e){this.traverseEntity(n=>{if(n instanceof w&&"Mesh"===n.data.type&&("TextGeometry"===n.data.geometry.type||"InputGeometry"===n.data.geometry.type)&&n.data.geometry.font===t){let s=n.geometry,i=n.data.geometry;s.updateFont(t,e).then(()=>{s.update(i,e);let t=n.invalidateDownstreamBooleanData();h(t)&&t.recomputeBoolean()})}})}traverseObject(t){for(let e of this.children)S.is(e)&&e.traverseObject(t)}traverseVisibleEntity(t){for(let e of this.children)B.is(e)&&e.visible&&e.traverseVisibleEntity(t)}dispose(){this.clearScene()}createChildrenObjects(t,e,n){let s=0;for(let i of t)this.createObject(i.id,i.data,i.children,e,s,n),s+=1}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let e of t.children)this.unregisterObject(e)}createObject(t,e,n,s,i,r){let a={scene:this,shared:r},o=ue(t,e,a);return z(o)&&this.shapeBlendIntances.push(o),E(o)&&this.hairInstances.push(o),o&&(this.entityByUuid[t]=o,s.add(o),s.children.splice(i,0,s.children.pop()),n.length>0&&(o.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(n,o,r)),o.updateState(e,a),o instanceof w&&o.updateGeometryGroupsIfNeeded(),o.updateVisible(this),o.cloner&&this.toExpandCloner.add(o),e.pathSnapping?.pathId&&this.pathConstraints.setConstraint(t,e.pathSnapping.pathId)),"Empty"===e.type&&e.animations&&o.traverseEntity(t=>{let e=t.dataPatched;if(t instanceof w&&e.bones&&e.boneInverses){let n=e.bones.map(t=>this.find(t)),s=e.boneInverses.map(t=>(new it).fromArray(t)),i=new Ct(n,s);t.bind(i,t.bindMatrix)}else t.matrixAutoUpdate=!0}),o}getCenter(t){let e=[];for(let n=0,s=t.length;n<s;++n){let{id:s,recursive:i}=t[n],r=this.find(s),a=i?r.recursiveBBox:r.singleBBox;e.push(...a.vertices)}let n=new lt;return n.setFromPoints(e),n.getCenter(ve),ve}copyMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t);n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}copyParentMatrixWorld(t,e){if(null===t)return void e.identity();let n=this.find(t)?.parent;n?(n.updateWorldMatrix(!0,!1),e.copy(n.matrixWorld)):e.identity()}traverseMaterial(t){this.traverseEntity(e=>{if(e instanceof D)if(Array.isArray(e.material))for(let n=0;n<e.material.length;n++)I(e.material[n])&&t(e.material[n]);else I(e.material)&&t(e.material)})}updateViewPlaneSize(t,e,n=!1){this.traverseConcreteEntity(s=>{s instanceof m&&s.setViewplaneSize(t,e,n)})}initializeSplatViewer(){this.splatViewer=new ge({scene:this}),this.reloadSplats()}reloadSplats(){this.splatViewer?.loadSplat()}};export{kt as a,Bt as b,Ft as c,Zt as d,xe as e,Ae as f};
@@ -1 +1 @@
1
- import{c as e}from"./runtime-chunk-TZCHGFVF.js";import{Ha as t,r}from"./runtime-chunk-OW6T4XFV.js";var i=new Map;function n(e,t){i.set(e,t)}var s=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+s.version}static addUnaryOp(e){return s.max_unop_len=Math.max(e.length,s.max_unop_len),s.unary_ops[e]=1,s}static addBinaryOp(e,t,r){return s.max_binop_len=Math.max(e.length,s.max_binop_len),s.binary_ops[e]=t,r?s.right_associative.add(e):s.right_associative.delete(e),s}static addIdentifierChar(e){return s.additional_identifier_chars.add(e),s}static addLiteral(e,t){return s.literals[e]=t,s}static removeUnaryOp(e){return delete s.unary_ops[e],e.length===s.max_unop_len&&(s.max_unop_len=s.getMaxKeyLen(s.unary_ops)),s}static removeAllUnaryOps(){return s.unary_ops={},s.max_unop_len=0,s}static removeIdentifierChar(e){return s.additional_identifier_chars.delete(e),s}static removeBinaryOp(e){return delete s.binary_ops[e],e.length===s.max_binop_len&&(s.max_binop_len=s.getMaxKeyLen(s.binary_ops)),s.right_associative.delete(e),s}static removeAllBinaryOps(){return s.binary_ops={},s.max_binop_len=0,s}static removeLiteral(e){return delete s.literals[e],s}static removeAllLiterals(){return s.literals={},s}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new s(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return s.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!s.binary_ops[String.fromCharCode(e)]||s.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return s.isIdentifierStart(e)||s.isDecimalDigit(e)}throwError(e){let t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(s.hooks[e]){let r={context:this,node:t};return s.hooks.run(e,r),r.node}return t}searchHook(e){if(s.hooks[e]){let t={context:this};return s.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===s.SPACE_CODE||e===s.TAB_CODE||e===s.LF_CODE||e===s.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:s.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,i=[];for(;this.index<this.expr.length;)if(t=this.code,t===s.SEMCOL_CODE||t===s.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())i.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return i}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,s.max_binop_len),t=e.length;for(;t>0;){if(s.binary_ops.hasOwnProperty(e)&&(!s.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!s.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,i,n,o,a,h,l;if(o=this.gobbleToken(),!o||(t=this.gobbleBinaryOp(),!t))return o;for(n={value:t,prec:s.binaryPrecedence(t),right_a:s.right_associative.has(t)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+t),i=[o,n,a];t=this.gobbleBinaryOp();){if(r=s.binaryPrecedence(t),0===r){this.index-=t.length;break}n={value:t,prec:r,right_a:s.right_associative.has(t)},l=t;let h=e=>n.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&h(i[i.length-2]);)a=i.pop(),t=i.pop().value,o=i.pop(),e={type:s.BINARY_EXP,operator:t,left:o,right:a},i.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),i.push(n,e)}for(h=i.length-1,e=i[h];h>1;)e={type:s.BINARY_EXP,operator:i[h-1].value,left:i[h-2],right:e},h-=2;return e}gobbleToken(){let e,t,r,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(e=this.code,s.isDecimalDigit(e)||e===s.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===s.SQUOTE_CODE||e===s.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(e===s.OBRACK_CODE)i=this.gobbleArray();else{for(t=this.expr.substr(this.index,s.max_unop_len),r=t.length;r>0;){if(s.unary_ops.hasOwnProperty(t)&&(!s.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!s.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:s.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}s.isIdentifierStart(e)?(i=this.gobbleIdentifier(),s.literals.hasOwnProperty(i.name)?i={type:s.LITERAL,value:s.literals[i.name],raw:i.name}:i.name===s.this_str&&(i={type:s.THIS_EXP})):e===s.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===s.PERIOD_CODE||t===s.OBRACK_CODE||t===s.OPAREN_CODE||t===s.QUMARK_CODE;){let r;if(t===s.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==s.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===s.OBRACK_CODE?(e={type:s.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),t=this.code,t!==s.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===s.OPAREN_CODE?e={type:s.CALL_EXP,arguments:this.gobbleArguments(s.CPAREN_CODE),callee:e}:(t===s.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:s.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===s.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,("+"===e||"-"===e)&&(r+=this.expr.charAt(this.index++));s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);s.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,s.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===s.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===s.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:s.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){i=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||this.throwError('Unclosed quote after "'+e+'"'),{type:s.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(s.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,s.isIdentifierPart(e));)this.index++;return{type:s.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let n=this.code;if(n===e){r=!0,this.index++,e===s.CPAREN_CODE&&i&&i>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(n===s.COMMA_CODE){if(this.index++,i++,i!==t.length)if(e===s.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===s.CBRACK_CODE)for(let e=t.length;e<i;e++)t.push(null)}else if(t.length!==i&&0!==i)this.throwError("Expected comma");else{let e=this.gobbleExpression();(!e||e.type===s.COMPOUND)&&this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(s.CPAREN_CODE);if(this.code===s.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:s.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:s.ARRAY_EXP,elements:this.gobbleArguments(s.CBRACK_CODE)}}},o=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(s,{hooks:o,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(s),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),s.max_unop_len=s.getMaxKeyLen(s.unary_ops),s.max_binop_len=s.getMaxKeyLen(s.binary_ops);var a=e=>new s(e).parse();Object.getOwnPropertyNames(s).forEach(e=>{void 0===a[e]&&"prototype"!==e&&(a[e]=s[e])}),a.Jsep=s;var h={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:i,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let i=r;for(;i.right.operator&&e.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};a.plugins.register(h);var l=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],c=["0","1","2","3","4","5","6","7","8","9","."],d=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function p(e){return"string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))}function u(e,r,i="number"){let n,s,o="";for(let n=0;n<e.length;n++){let s=e[n];if("objType"in s&&"api"===s.objType){let e=JSON.parse(s.id),t=e[0],i=r.getUserAPI(t);if(void 0!==i&&"function"==typeof i.retrieveValue){let t=i.retrieveValue(e.slice(1));void 0!==t&&(o+=t)}continue}if("objType"in s&&"webhook"===s.objType){let e=JSON.parse(s.id),[t,i]=e,n=r.getUserWebhook(t);if(void 0!==n){let e=n.getParameterValue(i);void 0!==e&&(o+=e)}continue}if("objType"in s&&"aiAssistant"===s.objType){let e=r.openAIRealtime;if("objId"in s&&void 0!==s.objId){let t;if(r.scene.data.objects.traverse((e,r)=>{let i=r.events?.find(e=>e.id===s.objId);i&&(t=i)}),void 0!==t&&"AIAssistantListener"===t.data.type){let r=e?.computeAnalysisForListenerEvent(t.data);if(void 0!==r){o+=r;continue}}}o+=e?.voice??0;continue}if("id"in s){let a=e[n-1];if(n>0&&"id"in a)return void console.error("Two variables in a row",e);let h=r.getVariable(s.id),l=t.getDisplayedValue(h);"number"===i&&t.isTextValue(h)&&Array.isArray(h.textValue)&&1===h.textValue.length?l=parseFloat(l).toString():"boolean"===i&&t.isBoolean(h)?l=h?"true":"false":"boolean"===i&&t.isTextValue(h)&&!Array.isArray(h.textValue)&&(l='"'+l+'"'),o+=l;continue}"string"!==i?"and"!==s.name?"or"!==s.name?"True"!==s.name?"False"!==s.name?"boolean"!==i||p(s.name)||c.includes(s.name)||l.includes(s.name)||d.includes(s.name.replace(/\($/g,""))?o+=s.name:o+='"'+s.name+'"':o+="false":o+="true":o+="||":o+="&&":('"'!==s.name&&("+"!==s.name||s.escaped)&&(o+=s.name),"+"===s.name&&!s.escaped&&"\\"===o[o.length-1]&&(o=o.slice(0,-1)+s.name))}if("string"===i)return o;if(0===e.length){if("number"===i)return 0;if("boolean"===i)return!1}try{n=a(o)}catch(e){return void console.error(o,e)}try{s=f(n)}catch(e){console.error(o,n,e)}return s}function f(e){switch(e.type){case"BinaryExpression":switch(e.operator){case"==":return Number(f(e.left)===f(e.right));case"!=":return Number(f(e.left)!==f(e.right));case">":return Number(f(e.left)>f(e.right));case">=":return Number(f(e.left)>=f(e.right));case"<":return Number(f(e.left)<f(e.right));case"<=":return Number(f(e.left)<=f(e.right));case"+":return f(e.left)+f(e.right);case"-":return f(e.left)-f(e.right);case"*":return f(e.left)*f(e.right);case"/":return f(e.left)/f(e.right);case"%":return f(e.left)%f(e.right);case"&&":return f(e.left)&&f(e.right);case"||":return f(e.left)||f(e.right);case"^":return Math.pow(f(e.left),f(e.right));default:throw new Error("Unknown operator: "+e.operator)}case"UnaryExpression":switch(e.operator){case"-":return-f(e.argument);case"!":return Number(!f(e.argument));default:throw new Error("Unknown operator: "+e.operator)}case"Identifier":throw new Error("Unknown identifier: "+e.name);case"Literal":return e.value;case"CallExpression":if("Identifier"===e.callee.type){if("random"===e.callee.name){let t=0,r=1;if(e.arguments.length>=1)try{t=f(e.arguments[0])}catch(e){console.warn(e)}if(e.arguments.length>=2)try{r=f(e.arguments[1])}catch(e){console.warn(e)}return t=Math.min(r,t),r=Math.max(r,t),t+Math.random()*(r-t)}return Math[e.callee.name].apply(null,e.arguments.map(f))}throw new Error("Unknown node");default:throw new Error("Unknown node type: "+e.type)}}a.addBinaryOp("^",11,!0);var b={mousehover:!0,scroll:!0,dragdrop:!0,tracking:!0,resize:!0,conditional:!0,variables:!0,"api-services":!0,"ai-assistant":!0,textinputs:!0,audio:!0,video:!0,"create-destroy":!0,"scene-transition":!0,timeline:!0,transitions:!0,"misc-actions":!0},g=Object.keys(b),E={MouseHover:"mousehover",Scroll:"scroll",DragDrop:"dragdrop",Follow:"tracking",LookAt:"tracking",Resize:"resize",Conditional:"conditional",VariableChange:"variables",API:"api-services",WEBHOOK:"api-services",AIAssistantListener:"ai-assistant",AIAssistantTrigger:"ai-assistant"},x={Audio:"audio",Video:"video",Particles:"particles",Link:"misc-actions",Reset:"misc-actions",SwitchCamera:"misc-actions",ClearLocalStorage:"misc-actions",Create:"create-destroy",Destroy:"create-destroy",Transition:"transitions",Animation:"transitions",TimelineAnimation:"timeline",SceneTransition:"scene-transition",SetVariable:"variables",DynamicVariablePlay:"variables",UserAPI:"api-services"};function y(e){return"object"==typeof e&&null!==e}var m=class extends Error{};function _(e,t){void 0!==t&&t in b&&e.add(t)}function A(e,t){let r=new Set,i=e=>{if(void 0!==e){if(!Array.isArray(e))throw new m;for(let t of e){if(!y(t))throw new m;n(t.data)}}},n=e=>{if(!y(e)||"string"!=typeof e.type)throw new m;_(r,x[e.type]),"Conditional"===e.type&&(i(e.ifActions),i(e.elseActions))},s=e=>{if(!y(e)||"string"!=typeof e.type)throw new m;if(!0!==e.disabled){if(t?.(e.type),_(r,E[e.type]),i(e.actions),i(e.inActions),i(e.outActions),i(e.successActions),i(e.errorActions),void 0!==e.dragDropActions){if(!y(e.dragDropActions))throw new m;for(let t of Object.values(e.dragDropActions))i(t)}if(void 0!==e.gameActions){if(!y(e.gameActions))throw new m;for(let t of Object.values(e.gameActions))i(t)}if(void 0!==e.breakpoints){if(!Array.isArray(e.breakpoints))throw new m;for(let t of e.breakpoints){if(!y(t)||!y(t.data))throw new m;i(t.data.actions)}}}},o=e=>{if(!y(e))throw new m;(e=>{let t=e.events;if(void 0!==t)if(Array.isArray(t))for(let e of t){if(!y(e))throw new m;s(e.data)}else{if(!y(t))throw new m;for(let e of Object.values(t))s(e)}})(e),"Mesh"===e.type&&y(e.geometry)&&"InputGeometry"===e.geometry.type&&r.add("textinputs"),"Page"===e.type&&y(e.uiScene)&&a(e.uiScene.objects)},a=e=>{if(!y(e)||"function"!=typeof e.traverse)throw new m;e.traverse((e,t)=>{o(t)})},h=e=>{if(!y(e))throw new m;void 0!==e.data&&o(e.data);let t=e.children;if(void 0!==t){if(!Array.isArray(t))throw new m;for(let e of t)h(e)}};try{a(e.scene.objects);let t=e.shared;if(void 0!==t){if(!y(t))throw new m;let e=t.variables;if(void 0!==e){if(!Array.isArray(e))throw new m;for(let t of e){if(!y(t)||!y(t.data))throw new m;"dynamicVariableType"in t.data&&r.add("variables")}}let i=t.userAPIs;if(void 0!==i){if(!y(i))throw new m;for(let e of Object.values(i)){let t=y(e)?e.integration:void 0;y(t)&&"VoiceAssistant"===t.type?r.add("ai-assistant"):r.add("api-services")}}let n=t.userWebhooks;if(void 0!==n){if(!y(n))throw new m;Object.keys(n).length>0&&r.add("api-services")}let s=t.lib;if(void 0!==s){if(!y(s))throw new m;let e=s.components;if(void 0!==e){if(!y(e))throw new m;for(let t of Object.values(e)){if(!y(t))throw new m;void 0!==t.asset&&h(t.asset)}}}}}catch{return new Set(g)}return r}function C(e,t){if(void 0===t)return!0;if(0===t.expression.length)return!1;let r=u(t.expression,e,"boolean");return t.negate?!r:!!r}function O(t,n,s,o,a,h){let l={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],TimelineAnimation:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[],ClearLocalStorage:[],UserAPI:[]},c=n=>({id:d,data:p})=>{try{if("Conditional"===p.type)return void(r[t.type].includes("Conditional")&&(p.ifActions.forEach(c({expression:p.condition,negate:!1})),p.elseActions.forEach(c({expression:p.condition,negate:!0}))));if(!r[t.type].includes(p.type))return;let u=function(e){return i.get(e)}(p.type);if(void 0===u)return void e(x[p.type]??"misc-actions",`a "${p.type}" action`);let f=u({id:d,data:p,object:h,page:s,shared:o,eventManager:a,eventType:t.type,actionCondition:n});null!=f&&p.type in l&&l[p.type].push(f)}catch(e){}};return n.forEach(c()),l}function w(e){Object.values(e).forEach(e=>{e.forEach(e=>{"function"==typeof e.dispose&&e.dispose()})})}export{u as a,n as b,E as c,A as d,C as e,O as f,w as g};
1
+ import{c as e}from"./runtime-chunk-TZCHGFVF.js";import{Ha as t,r}from"./runtime-chunk-RBM3UDQF.js";var i=new Map;function n(e,t){i.set(e,t)}var s=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+s.version}static addUnaryOp(e){return s.max_unop_len=Math.max(e.length,s.max_unop_len),s.unary_ops[e]=1,s}static addBinaryOp(e,t,r){return s.max_binop_len=Math.max(e.length,s.max_binop_len),s.binary_ops[e]=t,r?s.right_associative.add(e):s.right_associative.delete(e),s}static addIdentifierChar(e){return s.additional_identifier_chars.add(e),s}static addLiteral(e,t){return s.literals[e]=t,s}static removeUnaryOp(e){return delete s.unary_ops[e],e.length===s.max_unop_len&&(s.max_unop_len=s.getMaxKeyLen(s.unary_ops)),s}static removeAllUnaryOps(){return s.unary_ops={},s.max_unop_len=0,s}static removeIdentifierChar(e){return s.additional_identifier_chars.delete(e),s}static removeBinaryOp(e){return delete s.binary_ops[e],e.length===s.max_binop_len&&(s.max_binop_len=s.getMaxKeyLen(s.binary_ops)),s.right_associative.delete(e),s}static removeAllBinaryOps(){return s.binary_ops={},s.max_binop_len=0,s}static removeLiteral(e){return delete s.literals[e],s}static removeAllLiterals(){return s.literals={},s}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new s(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return s.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!s.binary_ops[String.fromCharCode(e)]||s.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return s.isIdentifierStart(e)||s.isDecimalDigit(e)}throwError(e){let t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(s.hooks[e]){let r={context:this,node:t};return s.hooks.run(e,r),r.node}return t}searchHook(e){if(s.hooks[e]){let t={context:this};return s.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===s.SPACE_CODE||e===s.TAB_CODE||e===s.LF_CODE||e===s.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:s.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,i=[];for(;this.index<this.expr.length;)if(t=this.code,t===s.SEMCOL_CODE||t===s.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())i.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return i}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,s.max_binop_len),t=e.length;for(;t>0;){if(s.binary_ops.hasOwnProperty(e)&&(!s.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!s.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,i,n,o,a,h,l;if(o=this.gobbleToken(),!o||(t=this.gobbleBinaryOp(),!t))return o;for(n={value:t,prec:s.binaryPrecedence(t),right_a:s.right_associative.has(t)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+t),i=[o,n,a];t=this.gobbleBinaryOp();){if(r=s.binaryPrecedence(t),0===r){this.index-=t.length;break}n={value:t,prec:r,right_a:s.right_associative.has(t)},l=t;let h=e=>n.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&h(i[i.length-2]);)a=i.pop(),t=i.pop().value,o=i.pop(),e={type:s.BINARY_EXP,operator:t,left:o,right:a},i.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),i.push(n,e)}for(h=i.length-1,e=i[h];h>1;)e={type:s.BINARY_EXP,operator:i[h-1].value,left:i[h-2],right:e},h-=2;return e}gobbleToken(){let e,t,r,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(e=this.code,s.isDecimalDigit(e)||e===s.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===s.SQUOTE_CODE||e===s.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(e===s.OBRACK_CODE)i=this.gobbleArray();else{for(t=this.expr.substr(this.index,s.max_unop_len),r=t.length;r>0;){if(s.unary_ops.hasOwnProperty(t)&&(!s.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!s.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:s.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}s.isIdentifierStart(e)?(i=this.gobbleIdentifier(),s.literals.hasOwnProperty(i.name)?i={type:s.LITERAL,value:s.literals[i.name],raw:i.name}:i.name===s.this_str&&(i={type:s.THIS_EXP})):e===s.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===s.PERIOD_CODE||t===s.OBRACK_CODE||t===s.OPAREN_CODE||t===s.QUMARK_CODE;){let r;if(t===s.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==s.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===s.OBRACK_CODE?(e={type:s.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),t=this.code,t!==s.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===s.OPAREN_CODE?e={type:s.CALL_EXP,arguments:this.gobbleArguments(s.CPAREN_CODE),callee:e}:(t===s.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:s.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===s.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,("+"===e||"-"===e)&&(r+=this.expr.charAt(this.index++));s.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);s.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,s.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===s.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===s.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:s.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){i=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||this.throwError('Unclosed quote after "'+e+'"'),{type:s.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(s.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,s.isIdentifierPart(e));)this.index++;return{type:s.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let n=this.code;if(n===e){r=!0,this.index++,e===s.CPAREN_CODE&&i&&i>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(n===s.COMMA_CODE){if(this.index++,i++,i!==t.length)if(e===s.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===s.CBRACK_CODE)for(let e=t.length;e<i;e++)t.push(null)}else if(t.length!==i&&0!==i)this.throwError("Expected comma");else{let e=this.gobbleExpression();(!e||e.type===s.COMPOUND)&&this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(s.CPAREN_CODE);if(this.code===s.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:s.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:s.ARRAY_EXP,elements:this.gobbleArguments(s.CBRACK_CODE)}}},o=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(s,{hooks:o,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(s),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),s.max_unop_len=s.getMaxKeyLen(s.unary_ops),s.max_binop_len=s.getMaxKeyLen(s.binary_ops);var a=e=>new s(e).parse();Object.getOwnPropertyNames(s).forEach(e=>{void 0===a[e]&&"prototype"!==e&&(a[e]=s[e])}),a.Jsep=s;var h={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:i,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let i=r;for(;i.right.operator&&e.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};a.plugins.register(h);var l=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],c=["0","1","2","3","4","5","6","7","8","9","."],d=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function p(e){return"string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))}function u(e,r,i="number"){let n,s,o="";for(let n=0;n<e.length;n++){let s=e[n];if("objType"in s&&"api"===s.objType){let e=JSON.parse(s.id),t=e[0],i=r.getUserAPI(t);if(void 0!==i&&"function"==typeof i.retrieveValue){let t=i.retrieveValue(e.slice(1));void 0!==t&&(o+=t)}continue}if("objType"in s&&"webhook"===s.objType){let e=JSON.parse(s.id),[t,i]=e,n=r.getUserWebhook(t);if(void 0!==n){let e=n.getParameterValue(i);void 0!==e&&(o+=e)}continue}if("objType"in s&&"aiAssistant"===s.objType){let e=r.openAIRealtime;if("objId"in s&&void 0!==s.objId){let t;if(r.scene.data.objects.traverse((e,r)=>{let i=r.events?.find(e=>e.id===s.objId);i&&(t=i)}),void 0!==t&&"AIAssistantListener"===t.data.type){let r=e?.computeAnalysisForListenerEvent(t.data);if(void 0!==r){o+=r;continue}}}o+=e?.voice??0;continue}if("id"in s){let a=e[n-1];if(n>0&&"id"in a)return void console.error("Two variables in a row",e);let h=r.getVariable(s.id),l=t.getDisplayedValue(h);"number"===i&&t.isTextValue(h)&&Array.isArray(h.textValue)&&1===h.textValue.length?l=parseFloat(l).toString():"boolean"===i&&t.isBoolean(h)?l=h?"true":"false":"boolean"===i&&t.isTextValue(h)&&!Array.isArray(h.textValue)&&(l='"'+l+'"'),o+=l;continue}"string"!==i?"and"!==s.name?"or"!==s.name?"True"!==s.name?"False"!==s.name?"boolean"!==i||p(s.name)||c.includes(s.name)||l.includes(s.name)||d.includes(s.name.replace(/\($/g,""))?o+=s.name:o+='"'+s.name+'"':o+="false":o+="true":o+="||":o+="&&":('"'!==s.name&&("+"!==s.name||s.escaped)&&(o+=s.name),"+"===s.name&&!s.escaped&&"\\"===o[o.length-1]&&(o=o.slice(0,-1)+s.name))}if("string"===i)return o;if(0===e.length){if("number"===i)return 0;if("boolean"===i)return!1}try{n=a(o)}catch(e){return void console.error(o,e)}try{s=f(n)}catch(e){console.error(o,n,e)}return s}function f(e){switch(e.type){case"BinaryExpression":switch(e.operator){case"==":return Number(f(e.left)===f(e.right));case"!=":return Number(f(e.left)!==f(e.right));case">":return Number(f(e.left)>f(e.right));case">=":return Number(f(e.left)>=f(e.right));case"<":return Number(f(e.left)<f(e.right));case"<=":return Number(f(e.left)<=f(e.right));case"+":return f(e.left)+f(e.right);case"-":return f(e.left)-f(e.right);case"*":return f(e.left)*f(e.right);case"/":return f(e.left)/f(e.right);case"%":return f(e.left)%f(e.right);case"&&":return f(e.left)&&f(e.right);case"||":return f(e.left)||f(e.right);case"^":return Math.pow(f(e.left),f(e.right));default:throw new Error("Unknown operator: "+e.operator)}case"UnaryExpression":switch(e.operator){case"-":return-f(e.argument);case"!":return Number(!f(e.argument));default:throw new Error("Unknown operator: "+e.operator)}case"Identifier":throw new Error("Unknown identifier: "+e.name);case"Literal":return e.value;case"CallExpression":if("Identifier"===e.callee.type){if("random"===e.callee.name){let t=0,r=1;if(e.arguments.length>=1)try{t=f(e.arguments[0])}catch(e){console.warn(e)}if(e.arguments.length>=2)try{r=f(e.arguments[1])}catch(e){console.warn(e)}return t=Math.min(r,t),r=Math.max(r,t),t+Math.random()*(r-t)}return Math[e.callee.name].apply(null,e.arguments.map(f))}throw new Error("Unknown node");default:throw new Error("Unknown node type: "+e.type)}}a.addBinaryOp("^",11,!0);var b={mousehover:!0,scroll:!0,dragdrop:!0,tracking:!0,resize:!0,conditional:!0,variables:!0,"api-services":!0,"ai-assistant":!0,textinputs:!0,audio:!0,video:!0,"create-destroy":!0,"scene-transition":!0,timeline:!0,transitions:!0,"misc-actions":!0},g=Object.keys(b),E={MouseHover:"mousehover",Scroll:"scroll",DragDrop:"dragdrop",Follow:"tracking",LookAt:"tracking",Resize:"resize",Conditional:"conditional",VariableChange:"variables",API:"api-services",WEBHOOK:"api-services",AIAssistantListener:"ai-assistant",AIAssistantTrigger:"ai-assistant"},x={Audio:"audio",Video:"video",Particles:"particles",Link:"misc-actions",Reset:"misc-actions",SwitchCamera:"misc-actions",ClearLocalStorage:"misc-actions",Create:"create-destroy",Destroy:"create-destroy",Transition:"transitions",Animation:"transitions",TimelineAnimation:"timeline",SceneTransition:"scene-transition",SetVariable:"variables",DynamicVariablePlay:"variables",UserAPI:"api-services"};function y(e){return"object"==typeof e&&null!==e}var m=class extends Error{};function _(e,t){void 0!==t&&t in b&&e.add(t)}function A(e,t){let r=new Set,i=e=>{if(void 0!==e){if(!Array.isArray(e))throw new m;for(let t of e){if(!y(t))throw new m;n(t.data)}}},n=e=>{if(!y(e)||"string"!=typeof e.type)throw new m;_(r,x[e.type]),"Conditional"===e.type&&(i(e.ifActions),i(e.elseActions))},s=e=>{if(!y(e)||"string"!=typeof e.type)throw new m;if(!0!==e.disabled){if(t?.(e.type),_(r,E[e.type]),i(e.actions),i(e.inActions),i(e.outActions),i(e.successActions),i(e.errorActions),void 0!==e.dragDropActions){if(!y(e.dragDropActions))throw new m;for(let t of Object.values(e.dragDropActions))i(t)}if(void 0!==e.gameActions){if(!y(e.gameActions))throw new m;for(let t of Object.values(e.gameActions))i(t)}if(void 0!==e.breakpoints){if(!Array.isArray(e.breakpoints))throw new m;for(let t of e.breakpoints){if(!y(t)||!y(t.data))throw new m;i(t.data.actions)}}}},o=e=>{if(!y(e))throw new m;(e=>{let t=e.events;if(void 0!==t)if(Array.isArray(t))for(let e of t){if(!y(e))throw new m;s(e.data)}else{if(!y(t))throw new m;for(let e of Object.values(t))s(e)}})(e),"Mesh"===e.type&&y(e.geometry)&&"InputGeometry"===e.geometry.type&&r.add("textinputs"),"Page"===e.type&&y(e.uiScene)&&a(e.uiScene.objects)},a=e=>{if(!y(e)||"function"!=typeof e.traverse)throw new m;e.traverse((e,t)=>{o(t)})},h=e=>{if(!y(e))throw new m;void 0!==e.data&&o(e.data);let t=e.children;if(void 0!==t){if(!Array.isArray(t))throw new m;for(let e of t)h(e)}};try{a(e.scene.objects);let t=e.shared;if(void 0!==t){if(!y(t))throw new m;let e=t.variables;if(void 0!==e){if(!Array.isArray(e))throw new m;for(let t of e){if(!y(t)||!y(t.data))throw new m;"dynamicVariableType"in t.data&&r.add("variables")}}let i=t.userAPIs;if(void 0!==i){if(!y(i))throw new m;for(let e of Object.values(i)){let t=y(e)?e.integration:void 0;y(t)&&"VoiceAssistant"===t.type?r.add("ai-assistant"):r.add("api-services")}}let n=t.userWebhooks;if(void 0!==n){if(!y(n))throw new m;Object.keys(n).length>0&&r.add("api-services")}let s=t.lib;if(void 0!==s){if(!y(s))throw new m;let e=s.components;if(void 0!==e){if(!y(e))throw new m;for(let t of Object.values(e)){if(!y(t))throw new m;void 0!==t.asset&&h(t.asset)}}}}}catch{return new Set(g)}return r}function C(e,t){if(void 0===t)return!0;if(0===t.expression.length)return!1;let r=u(t.expression,e,"boolean");return t.negate?!r:!!r}function O(t,n,s,o,a,h){let l={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],TimelineAnimation:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[],ClearLocalStorage:[],UserAPI:[]},c=n=>({id:d,data:p})=>{try{if("Conditional"===p.type)return void(r[t.type].includes("Conditional")&&(p.ifActions.forEach(c({expression:p.condition,negate:!1})),p.elseActions.forEach(c({expression:p.condition,negate:!0}))));if(!r[t.type].includes(p.type))return;let u=function(e){return i.get(e)}(p.type);if(void 0===u)return void e(x[p.type]??"misc-actions",`a "${p.type}" action`);let f=u({id:d,data:p,object:h,page:s,shared:o,eventManager:a,eventType:t.type,actionCondition:n});null!=f&&p.type in l&&l[p.type].push(f)}catch(e){}};return n.forEach(c()),l}function w(e){Object.values(e).forEach(e=>{e.forEach(e=>{"function"==typeof e.dispose&&e.dispose()})})}export{u as a,n as b,E as c,A as d,C as e,O as f,w as g};
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{W as o}from"./runtime-chunk-YFAATRJU.js";import{Dc as n,Fc as t,Jc as r}from"./runtime-chunk-VGN7YHB7.js";var i={enabled:!1},s=new WeakMap;function a(e){if(!i.enabled)return e;let o=s.get(e);return o||(o={...e,bloom:{...e.bloom,kernelSize:0},depthOfField:{...e.depthOfField,enabled:!1}},s.set(e,o)),o}var c=new WeakSet;function l(e){if(!e.isPointLight&&!e.isSpotLight&&!e.isDirectionalLight)return!1;if(i.enabled){if(!0===e.castShadow)return e.castShadow=!1,c.add(e),!0}else if(c.has(e)&&(c.delete(e),!1===e.castShadow))return e.castShadow=!0,!0;return!1}function u(i,s){switch(i.type){case"cavity":return function(e,o){return{...h(e,o),ridge:e.ridge,valley:e.valley}}(i,s);case"dust":return function(n,t){return{...h(n,t),color:e(n.color,t),coverage:o(n.coverage,t)??.2,softness:o(n.softness,t)??.2,noiseStrength:o(n.noiseStrength,t)??.2,noiseScale:o(n.noiseScale,t)??1}}(i,s);case"fresnel":return function(o,n){let{bias:t,scale:r,intensity:i,factor:s,color:a}=o;return{...h(o,n),color:e(a,n),bias:t,scale:r,intensity:i,factor:s}}(i,s);case"gradient":return function(e,o){let{gradientType:t,smooth:i,colors:s,steps:a,angle:c,offset:l,morph:u}=e;return{...h(e,o),gradientType:t,smooth:i,colors:s.map(e=>new r(e[0],e[1],e[2],e[3])),num:s.length,steps:a,offset:new n(...l.map(e=>"number"==typeof e?e:0)),morph:new n(...u.map(e=>"number"==typeof e?e:0)),angle:c}}(i,s);case"depth":return function(e,o){let{gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:l,direction:u,colors:f,steps:p,smooth:m}=e;return{...h(e,o),gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:new t(...l),direction:u?new t(...u):new t(1,0,0),colors:f.map(e=>void 0!==e?new r(e[0],e[1],e[2],e[3]):new r(0,0,0,0)),steps:p.slice(0,f.length),smooth:m}}(i,s);case"normal":return function(e,o){let{cnormal:n}=e;return{...h(e,o),cnormal:new t(n[0],n[1],n[2])}}(i,s);case"noise":return function(o,r){return{...h(o,r),scale:o.scale,move:o.move,fA:new n(...o.fA.map(e=>"number"==typeof e?e:0)),fB:new n(...o.fB.map(e=>"number"==typeof e?e:0)),size:new t(...o.size),distortion:new n(...o.distortion.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,r),colorB:e(o.colorB,r),colorC:e(o.colorC,r),colorD:e(o.colorD,r),noiseType:o.noiseType,voronoiStyle:o.voronoiStyle,highCut:o.highCut,lowCut:o.lowCut,smoothness:o.smoothness,seed:o.seed,quality:o.quality}}(i,s);case"rainbow":return function(e,o){return{...h(e,o),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new t(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new t(...e.offset)}}(i,s);case"toon":return function(o,n){return{...h(o,n),positioning:o.positioning,colors:o.colors.map(e=>new r(e[0],e[1],e[2],e[3])),num:o.colors.length,steps:o.steps,source:new t(...o.source),isWorldSpace:o.isWorldSpace,noiseStrength:o.noiseStrength,noiseScale:o.noiseScale,shadowColor:e(o.shadowColor,n),offset:new t(...o.offset)}}(i,s);case"outline":return function(o,n){return{...h(o,n),outlineColor:e(o.outlineColor,n),contourColor:e(o.contourColor,n),outlineWidth:o.outlineWidth,contourWidth:o.contourWidth,outlineThreshold:o.outlineThreshold,contourThreshold:o.contourThreshold,outlineSmoothing:o.outlineSmoothing,contourFrequency:o.contourFrequency,contourDirection:new t(...o.contourDirection),positionalLines:o.positionalLines,compensation:o.compensation}}(i,s);case"transmission":return function(o,n){return{...h(o,n),thickness:o.thickness,ior:o.ior,roughness:o.roughness,attenuationColor:void 0!==o.attenuationColor?e(o.attenuationColor,n):{r:1,g:1,b:1,a:1},attenuationDistance:o.attenuationDistance??0}}(i,s);case"reflection":return function(e,n){return{...h(e,n),blur:o(e.blur,n)??0,thickness:o(e.thickness,n)??.001,steps:o(e.steps,n)??60,stepSize:o(e.stepSize,n)??.005,tracingMode:e.tracingMode,mirror:e.mirror??0}}(i,s);case"pattern":return function(o,t){return{...h(o,t),style:o.style,projection:o.projection,axis:o.axis,blending:o.blending,offset:new n(...o.offset.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,t),colorB:e(o.colorB,t),frequency:new n(...o.frequency.map(e=>"number"==typeof e?e:0)),size:o.size,variation:o.variation,smoothness:o.smoothness,zigzag:o.zigzag,rotation:o.rotation,vertical:new n(...o.vertical.map(e=>"number"==typeof e?e:0)),horizontal:new n(...o.horizontal.map(e=>"number"==typeof e?e:0)),sides:o.sides}}(i,s);case"vertexColor":return h(i,s);default:return function(o,n){return{...h(o,n),color:e(o.color,n)}}(i,s)}}function f(e){return{type:e.type}}function h(e,o){let{alpha:n,mode:t,isMask:r}=e,i="string"==typeof n?Number(o.getVariable(n)??100)/100:n;return{...f(e),alpha:i,mode:t,isMask:r}}export{i as a,a as b,l as c,u as d};
1
+ import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{W as o}from"./runtime-chunk-SXPM42HJ.js";import{Dc as n,Fc as t,Jc as r}from"./runtime-chunk-VGN7YHB7.js";var i={enabled:!1},s=new WeakMap;function a(e){if(!i.enabled)return e;let o=s.get(e);return o||(o={...e,bloom:{...e.bloom,kernelSize:0},depthOfField:{...e.depthOfField,enabled:!1}},s.set(e,o)),o}var c=new WeakSet;function l(e){if(!e.isPointLight&&!e.isSpotLight&&!e.isDirectionalLight)return!1;if(i.enabled){if(!0===e.castShadow)return e.castShadow=!1,c.add(e),!0}else if(c.has(e)&&(c.delete(e),!1===e.castShadow))return e.castShadow=!0,!0;return!1}function u(i,s){switch(i.type){case"cavity":return function(e,o){return{...h(e,o),ridge:e.ridge,valley:e.valley}}(i,s);case"dust":return function(n,t){return{...h(n,t),color:e(n.color,t),coverage:o(n.coverage,t)??.2,softness:o(n.softness,t)??.2,noiseStrength:o(n.noiseStrength,t)??.2,noiseScale:o(n.noiseScale,t)??1}}(i,s);case"fresnel":return function(o,n){let{bias:t,scale:r,intensity:i,factor:s,color:a}=o;return{...h(o,n),color:e(a,n),bias:t,scale:r,intensity:i,factor:s}}(i,s);case"gradient":return function(e,o){let{gradientType:t,smooth:i,colors:s,steps:a,angle:c,offset:l,morph:u}=e;return{...h(e,o),gradientType:t,smooth:i,colors:s.map(e=>new r(e[0],e[1],e[2],e[3])),num:s.length,steps:a,offset:new n(...l.map(e=>"number"==typeof e?e:0)),morph:new n(...u.map(e=>"number"==typeof e?e:0)),angle:c}}(i,s);case"depth":return function(e,o){let{gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:l,direction:u,colors:f,steps:p,smooth:m}=e;return{...h(e,o),gradientType:n,near:i,far:s,isVector:a,isWorldSpace:c,origin:new t(...l),direction:u?new t(...u):new t(1,0,0),colors:f.map(e=>void 0!==e?new r(e[0],e[1],e[2],e[3]):new r(0,0,0,0)),steps:p.slice(0,f.length),smooth:m}}(i,s);case"normal":return function(e,o){let{cnormal:n}=e;return{...h(e,o),cnormal:new t(n[0],n[1],n[2])}}(i,s);case"noise":return function(o,r){return{...h(o,r),scale:o.scale,move:o.move,fA:new n(...o.fA.map(e=>"number"==typeof e?e:0)),fB:new n(...o.fB.map(e=>"number"==typeof e?e:0)),size:new t(...o.size),distortion:new n(...o.distortion.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,r),colorB:e(o.colorB,r),colorC:e(o.colorC,r),colorD:e(o.colorD,r),noiseType:o.noiseType,voronoiStyle:o.voronoiStyle,highCut:o.highCut,lowCut:o.lowCut,smoothness:o.smoothness,seed:o.seed,quality:o.quality}}(i,s);case"rainbow":return function(e,o){return{...h(e,o),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new t(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new t(...e.offset)}}(i,s);case"toon":return function(o,n){return{...h(o,n),positioning:o.positioning,colors:o.colors.map(e=>new r(e[0],e[1],e[2],e[3])),num:o.colors.length,steps:o.steps,source:new t(...o.source),isWorldSpace:o.isWorldSpace,noiseStrength:o.noiseStrength,noiseScale:o.noiseScale,shadowColor:e(o.shadowColor,n),offset:new t(...o.offset)}}(i,s);case"outline":return function(o,n){return{...h(o,n),outlineColor:e(o.outlineColor,n),contourColor:e(o.contourColor,n),outlineWidth:o.outlineWidth,contourWidth:o.contourWidth,outlineThreshold:o.outlineThreshold,contourThreshold:o.contourThreshold,outlineSmoothing:o.outlineSmoothing,contourFrequency:o.contourFrequency,contourDirection:new t(...o.contourDirection),positionalLines:o.positionalLines,compensation:o.compensation}}(i,s);case"transmission":return function(o,n){return{...h(o,n),thickness:o.thickness,ior:o.ior,roughness:o.roughness,attenuationColor:void 0!==o.attenuationColor?e(o.attenuationColor,n):{r:1,g:1,b:1,a:1},attenuationDistance:o.attenuationDistance??0}}(i,s);case"reflection":return function(e,n){return{...h(e,n),blur:o(e.blur,n)??0,thickness:o(e.thickness,n)??.001,steps:o(e.steps,n)??60,stepSize:o(e.stepSize,n)??.005,tracingMode:e.tracingMode,mirror:e.mirror??0}}(i,s);case"pattern":return function(o,t){return{...h(o,t),style:o.style,projection:o.projection,axis:o.axis,blending:o.blending,offset:new n(...o.offset.map(e=>"number"==typeof e?e:0)),colorA:e(o.colorA,t),colorB:e(o.colorB,t),frequency:new n(...o.frequency.map(e=>"number"==typeof e?e:0)),size:o.size,variation:o.variation,smoothness:o.smoothness,zigzag:o.zigzag,rotation:o.rotation,vertical:new n(...o.vertical.map(e=>"number"==typeof e?e:0)),horizontal:new n(...o.horizontal.map(e=>"number"==typeof e?e:0)),sides:o.sides}}(i,s);case"vertexColor":return h(i,s);default:return function(o,n){return{...h(o,n),color:e(o.color,n)}}(i,s)}}function f(e){return{type:e.type}}function h(e,o){let{alpha:n,mode:t,isMask:r}=e,i="string"==typeof n?Number(o.getVariable(n)??100)/100:n;return{...f(e),alpha:i,mode:t,isMask:r}}export{i as a,a as b,l as c,u as d};
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-CIBY4YG3.js";import{b as e}from"./runtime-chunk-WMWQXAOH.js";import{$ as i,C as r}from"./runtime-chunk-YFAATRJU.js";import{f as n,v as s}from"./runtime-chunk-OOC7YSI5.js";import{c as a}from"./runtime-chunk-2PT2WH66.js";import{c as o}from"./runtime-chunk-4KZXQGUQ.js";import{M as l}from"./runtime-chunk-OW6T4XFV.js";import{Cc as h,Ec as d,Fc as c,Oc as u,Pc as p,Rc as m,Wc as f,qd as y}from"./runtime-chunk-VGN7YHB7.js";import{a as b,b as x}from"./runtime-chunk-ML3Z74BL.js";var g=x(b((t,e)=>{var i,r;i=t,r=function(){return t.importState=function(e){var i=new t;return i.importState(e),i},t;function t(){return function(t){var e=0,i=0,r=0,n=1;0==t.length&&(t=[+new Date]);var s=function(){var t=4022871197,e=function(e){e=e.toString();for(var i=0;i<e.length;i++){var r=.02519603282416938*(t+=e.charCodeAt(i));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)};return e.version="Mash 0.9",e}();e=s(" "),i=s(" "),r=s(" ");for(var a=0;a<t.length;a++)(e-=s(t[a]))<0&&(e+=1),(i-=s(t[a]))<0&&(i+=1),(r-=s(t[a]))<0&&(r+=1);s=null;var o=function(){var t=2091639*e+2.3283064365386963e-10*n;return e=i,i=r,r=t-(n=0|t)};return o.next=o,o.uint32=function(){return 4294967296*o()},o.fract53=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.version="Alea 0.9",o.args=t,o.exportState=function(){return[e,i,r,n]},o.importState=function(t){e=+t[0]||0,i=+t[1]||0,r=+t[2]||0,n=+t[3]||0},o}(Array.prototype.slice.call(arguments))}},"object"==typeof t?e.exports=r():"function"==typeof define&&define.amd?define(r):i.Alea=r()})()),M=.5*(Math.sqrt(3)-1),v=(3-Math.sqrt(3))/6,w=1/3,j=1/6,A=(Math.sqrt(5),Math.sqrt(5),t=>0|Math.floor(t)),S=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),F=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function _(t){let e=new Uint8Array(512);for(let t=0;t<256;t++)e[t]=t;for(let i=0;i<255;i++){let r=i+~~(t()*(256-i)),n=e[i];e[i]=e[r],e[r]=n}for(let t=256;t<512;t++)e[t]=e[t-256];return e}var W=new f,O=class{constructor(t){this.weightAttribute=null;let e=t.geometry;if(!e.isBufferGeometry||3!==e.attributes.position.itemSize)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");e.index&&(e=e.toNonIndexed()),this.geometry=e,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.distribution=null}build(){let t=this.positionAttribute,e=new Float32Array(t.count/3);for(let i=0;i<t.count;i+=3){let r=1;W.a.fromBufferAttribute(t,i),W.b.fromBufferAttribute(t,i+1),W.c.fromBufferAttribute(t,i+2),r*=W.getArea(),e[i/3]=r}this.distribution=new Float32Array(t.count/3);let i=0;for(let t=0;t<e.length;t++)i+=e[t],this.distribution[t]=i;return this}setRandomGenerator(t){return this.randomFunction=t,this}sample(t,e){if(this.distribution){let i=this.distribution[this.distribution.length-1],r=this.binarySearch(this.randomFunction()*i);return this.sampleFace(r,t,e)}}binarySearch(t){if(!this.distribution)return 0;let e=this.distribution,i=0,r=e.length-1,n=-1;for(;i<=r;){let s=Math.ceil((i+r)/2);if(0===s||e[s-1]<=t&&e[s]>t){n=s;break}t<e[s]?r=s-1:i=s+1}return n}sampleFace(t,e,i){let r=this.randomFunction(),n=this.randomFunction();return r+n>1&&(r=1-r,n=1-n),W.a.fromBufferAttribute(this.positionAttribute,3*t),W.b.fromBufferAttribute(this.positionAttribute,3*t+1),W.c.fromBufferAttribute(this.positionAttribute,3*t+2),e.set(0,0,0).addScaledVector(W.a,r).addScaledVector(W.b,n).addScaledVector(W.c,1-(r+n)),W.getNormal(i),this}},z={x:[1,0,0],"-x":[-1,0,0],y:[0,1,0],"-y":[0,-1,0],z:[0,0,1],"-z":[0,0,-1]},C={polygon_center:0,edge:1,vertex:2},N=(t,e)=>(i,r)=>e&&0!==i&&0!==t?t*r/100:0,P=(t,e)=>{let i=Math.abs(e),r=-1*i;return(t- -1)*(i-r)/2+r},T=new c,V=new c,k=new c,B=new c;function I(t,e){let i=k.fromArray(t),r=B.fromArray(e);V.copy(r).sub(i);let n=V.length();return V.normalize().multiplyScalar(.5*n),T.copy(i).add(V).toArray()}var R,U,q,D,E=new f,G=new c,L=new c,$=new c,Y=class extends y{},H=class extends Y{constructor(t,e){super(void 0,void 0,e),this.source=t,this.isClonerInstancedMesh=!0,this.hiddenMatrix=new u,this.pivotMatrix=new u,this.previousModelViewMatrix=new u,this.copyPreviousMatrix=!0,this.capacity=e,this.count=0,this.matrixAutoUpdate=!1}raycast(t,e){}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}onAfterRender(t,e,i,r,n,s){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}get visible(){return!0!==this.source.cloner?.insideBoolean&&(this.source.visible||this.source.dataPatched.visible&&!0===this.source.dataPatched.cloner?.hideBase)}set visible(t){}get castShadow(){return this.source.castShadow}set castShadow(t){}get receiveShadow(){return this.source.receiveShadow}set receiveShadow(t){}get layers(){return this.source.layers}set layers(t){}get geometry(){return this.source.geometry}set geometry(t){}get material(){return this.source.material}set material(t){}get morphTargetInfluences(){return this.source.morphTargetInfluences}set morphTargetInfluences(t){}},Q=t=>.5*(1-Math.cos(t*Math.PI)),X=class{constructor(){this.perlin=new Array(4096)}noise(t,e=0,i=0){if(null==this.perlin){this.perlin=new Array(4096);for(let t=0;t<4096;t++)this.perlin[t]=Math.random()}t<0&&(t=-t),e<0&&(e=-e),i<0&&(i=-i);let r,n,s,a,o,l=Math.floor(t),h=Math.floor(e),d=Math.floor(i),c=t-l,u=e-h,p=i-d,m=0,f=.5;for(let t=0;t<4;t++){let t=l+(h<<4)+(d<<8);r=Q(c),n=Q(u),s=this.perlin[4095&t],s+=r*(this.perlin[t+1&4095]-s),a=this.perlin[t+16&4095],a+=r*(this.perlin[t+16+1&4095]-a),s+=n*(a-s),t+=256,a=this.perlin[4095&t],a+=r*(this.perlin[t+1&4095]-a),o=this.perlin[t+16&4095],o+=r*(this.perlin[t+16+1&4095]-o),a+=n*(o-a),s+=Q(p)*(a-s),m+=s*f,f*=.5,l<<=1,c*=2,h<<=1,u*=2,d<<=1,p*=2,c>=1&&(l++,c--),u>=1&&(h++,u--),p>=1&&(d++,p--)}return m}noiseSeed(t){let e=(()=>{let t,e;return{setSeed(i){e=t=(i??4294967296*Math.random())>>>0},getSeed:()=>t,rand:()=>(e=(1664525*e+1013904223)%4294967296,e/4294967296)}})();e.setSeed(t),this.perlin=new Array(4096);for(let t=0;t<4096;t++)this.perlin[t]=e.rand()}},Z=1e-4,J=new c,K=new c;r.then(t=>{U=[(R=t).get_face_center,R.get_edge_midpoint,R.get_vertex_position],q=[R.get_face_normal,R.get_edge_normal,R.get_vertex_normal],D=[R.face_count,R.edge_count,R.vertex_count]}),new u;var tt=new u,et=new u,it=new u,rt=new u,nt=new u,st=new u,at=new u,ot=new c,lt=new c,ht=new c,dt=new c,ct=new c,ut=new c,pt=new c,mt=new c,ft=new c,yt=new c,bt=new c,xt=new p,gt=new d;function Mt(t){return t?t.version??t.data?.version??0:-1}function vt(t,e){return["number"==typeof t?.[0]?t[0]:"string"==typeof t?.[0]&&e?parseFloat(String(e.shared.getVariable(t[0])??"0")):0,"number"==typeof t?.[1]?t[1]:"string"==typeof t?.[1]&&e?parseFloat(String(e.shared.getVariable(t[1])??"0")):0,"number"==typeof t?.[2]?t[2]:"string"==typeof t?.[2]&&e?parseFloat(String(e.shared.getVariable(t[2])??"0")):0]}var wt=class{constructor(t,e){this.data=t,this.is3D=e,this.perlin=new X,"perlin"===t.noiseType?(this.perlin.noiseSeed(t.seed),this.noise=e?(t,e,i)=>this.perlin.noise(t,e,i):t=>this.perlin.noise(t)):this.noise=e?function(t=Math.random){let e=_(t),i=new Float64Array(e).map(t=>F[t%12*3]),r=new Float64Array(e).map(t=>F[t%12*3+1]),n=new Float64Array(e).map(t=>F[t%12*3+2]);return function(t,s,a){let o,l,h,d,c,u,p,m,f,y,b=(t+s+a)*w,x=A(t+b),g=A(s+b),M=A(a+b),v=(x+g+M)*j,S=t-(x-v),F=s-(g-v),_=a-(M-v);S>=F?F>=_?(c=1,u=0,p=0,m=1,f=1,y=0):S>=_?(c=1,u=0,p=0,m=1,f=0,y=1):(c=0,u=0,p=1,m=1,f=0,y=1):F<_?(c=0,u=0,p=1,m=0,f=1,y=1):S<_?(c=0,u=1,p=0,m=0,f=1,y=1):(c=0,u=1,p=0,m=1,f=1,y=0);let W=S-c+j,O=F-u+j,z=_-p+j,C=S-m+2*j,N=F-f+2*j,P=_-y+2*j,T=S-1+.5,V=F-1+.5,k=_-1+.5,B=255&x,I=255&g,R=255&M,U=.6-S*S-F*F-_*_;if(U<0)o=0;else{let t=B+e[I+e[R]];U*=U,o=U*U*(i[t]*S+r[t]*F+n[t]*_)}let q=.6-W*W-O*O-z*z;if(q<0)l=0;else{let t=B+c+e[I+u+e[R+p]];q*=q,l=q*q*(i[t]*W+r[t]*O+n[t]*z)}let D=.6-C*C-N*N-P*P;if(D<0)h=0;else{let t=B+m+e[I+f+e[R+y]];D*=D,h=D*D*(i[t]*C+r[t]*N+n[t]*P)}let E=.6-T*T-V*V-k*k;if(E<0)d=0;else{let t=B+1+e[I+1+e[R+1]];E*=E,d=E*E*(i[t]*T+r[t]*V+n[t]*k)}return 32*(o+l+h+d)}}((0,g.default)(t.seed)):function(t=Math.random){let e=_(t),i=new Float64Array(e).map(t=>S[t%12*2]),r=new Float64Array(e).map(t=>S[t%12*2+1]);return function(t,n){let s,a,o=0,l=0,h=0,d=(t+n)*M,c=A(t+d),u=A(n+d),p=(c+u)*v,m=t-(c-p),f=n-(u-p);m>f?(s=1,a=0):(s=0,a=1);let y=m-s+v,b=f-a+v,x=m-1+2*v,g=f-1+2*v,w=255&c,j=255&u,S=.5-m*m-f*f;if(S>=0){let t=w+e[j];S*=S,o=S*S*(i[t]*m+r[t]*f)}let F=.5-y*y-b*b;if(F>=0){let t=w+s+e[j+a];F*=F,l=F*F*(i[t]*y+r[t]*b)}let _=.5-x*x-g*g;if(_>=0){let t=w+1+e[j+1];_*=_,h=_*_*(i[t]*x+r[t]*g)}return 70*(o+l+h)}}((0,g.default)(t.seed??""))}},jt=class extends(n(m)){constructor(t,e){super(),this.parameters=e,this.isCloner=!0,this.objectForSample=void 0,this._pendingMediaLoad=!1,this.random=null,this.surfaceSamplerCache=null,this.surfacePointsCache=null,this.object=t}resetOnMove(){this.removeFromParent(),this.parent=null}removeFromParent(){return super.removeFromParent(),this.instancedMesh?.removeFromParent(),this}dispose(){this.removeFromParent(),this._disposeInstancedMesh(),this._invalidateBoolean()}_invalidateBoolean(){this.object instanceof s&&this.object.onClonerLayoutUpdated()}expandClones(t){if(null===this.parent)this.updateState(this.parameters,t);else{for(let t of this.children)t instanceof i&&t.expand();this._syncInstancedMesh()}}invalidateTransform(t){this.matrixWorldNeedsUpdate=!0}onObjUpdateMatrix(){"toObject"!==this.parameters.type&&(this.matrixWorldNeedsUpdate=!0)}update(t){switch(this._updateCount(t),this.parameters.type){case"radial":this._updateRadial(this.parameters,t);break;case"linear":this._updateLinear(this.parameters,t);break;case"grid":this._updateGrid(this.parameters,t);break;case"toObject":this._updateToObject(this.parameters,t)}for(let t of this.children){let e=t.transformOverride;void 0!==e&&(t.position.fromArray(e.position),t.rotation.fromArray(e.rotation),t.scale.fromArray(e.scale)),t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldRigid())}this._syncInstancedMesh(),this._invalidateBoolean()}get instancingActive(){return void 0!==this.instancedMesh}get insideBoolean(){return null!==this.parent&&"booleanOp"in this.parent}_instancingEligible(){if(!0!==this.parameters.instanced)return!1;let t=this.object;return!(t.entityChildrenCount()>0||!0!==t.isMesh||a(t)||!0===t.isDecalObject)}_syncInstancedMesh(){if(!this._instancingEligible())return void this._disposeInstancedMesh();let t=this.instancedMesh;if(void 0!==t&&t.capacity<this.children.length&&(this._disposeInstancedMesh(),t=void 0),void 0===t){let e=Math.max(8,Math.ceil(1.5*this.children.length));t=this.instancedMesh=new H(this.object,e)}t.matrix=this.matrix,t.hiddenMatrix=this.hiddenMatrix,t.matrixWorldNeedsUpdate=!0,t.parent!==this.parent&&(t.removeFromParent(),this.parent?.add(t)),this.syncInstanceMatrices()}syncInstanceMatrices(){this._invalidateBoolean();let t=this.instancedMesh;if(void 0===t)return;let e=0;for(let i of this.children)!1!==i.playModeVisible&&(et.multiplyMatrices(i.hiddenMatrix,i.matrix).multiply(i.pivotMatrix),t.setMatrixAt(e++,et));t.count=e,t.instanceMatrix.needsUpdate=!0,t.boundingSphere=null}_disposeInstancedMesh(){let t=this.instancedMesh;void 0!==t&&(this.instancedMesh=void 0,t.removeFromParent(),t.dispose())}_updateCount(t,e){let r;if(void 0!==e)r=e;else{let e=vt(this.parameters.grid.count,t);r="grid"===this.parameters.type?Math.round(e[0])*Math.round(e[1])*Math.round(e[2]):this.parameters.count}if("toObject"===this.parameters.type)if(this.parameters.toObject.object){if(void 0===e&&"random"!==this.parameters.toObject.spreadType)return}else r=0;if(this.children.length!==r)if(this.children.length<r)for(let t=0,e=r-this.children.length;t<e;++t){let t=new i(this.object);t.expand(),this.add(t)}else for(;this.children.length>r;){let t=this.children.pop();t.parent=null,t.dispatchEvent({type:"removed"}),this.dispatchEvent({type:"childremoved",child:t})}}getRandom(t,e=!1){return(null===this.random||this.random.data.seed!==t.seed||this.random.data.noiseType!==t.noiseType||this.random.is3D!==e)&&(this.random=new wt(t,e)),this.random}_updateRadial(t,e){let i,r=t.radial,n=r.start*h.DEG2RAD,s=n-r.end*h.DEG2RAD,a=vt(r.rotation,e),o=new p(a[0],a[1],a[2]);switch(r.axis){case"z":i=new c(0,0,1);break;case"y":i=new c(0,1,0);break;default:i=new c(1,0,0)}let d=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,u=!0===this.parameters.randomness&&0!==d.strength?this.getRandom(d):null,m=vt(r.scale,e),f=vt(r.position,e),y=vt(d.scale,e),b=vt(d.position,e),x=vt(d.rotation,e),g=s/t.count,M=N(d.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let s=t*(d.freqScale/10)+d.movement,a=null===u?0:u.noise(s,s,s),l=t+1;e.scale.x=m[0]+M(l,P(a,y[0]))||Z,e.scale.y=m[1]+M(l,P(a,y[1]))||Z,e.scale.z=m[2]+M(l,P(a,y[2]))||Z;let h=g*t-n;switch(r.axis){default:case"x":xt.set(0,h,0);break;case"y":xt.set(0,0,h);break;case"z":xt.set(h,0,0)}pt.copy(i).applyQuaternion(gt.setFromEuler(xt)).multiplyScalar(r.radius),e.position.set(pt.x+(f[0]+M(l,P(a,b[0]))),pt.y+(f[1]+M(l,P(a,b[1]))),pt.z+(f[2]+M(l,P(a,b[2]))));let c=M(l,P(a,x[0])),p=M(l,P(a,x[1])),v=M(l,P(a,x[2]));!0===r.alignment?e.rotation.set(xt.x+(o.x+c),xt.y+(o.y+p),xt.z+(o.z+v)):e.rotation.set(o.x+c,o.y+p,o.z+v)}}_updateLinear(t,e){if("linear"!==t.type)throw new Error;let i=t.linear,r=vt(i.rotation,e),n=vt(i.scale,e),s=vt(i.position,e),a=new p(r[0]??0,r[1]??0,r[2]??0),o=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,h=vt(o.rotation,e),d=vt(o.scale,e),c=vt(o.position,e),u=!0===this.parameters.randomness&&0!==o.strength?this.getRandom(o):null,m=N(o.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let i=t*(o.freqScale/10)+o.movement,r=null===u?0:u.noise(i,i,i),l=t+1,p=m(l,P(r,h[0])),f=m(l,P(r,h[1])),y=m(l,P(r,h[2]));e.scale.x=1+(n[0]-1)*t+m(l,P(r,d[0]))||Z,e.scale.y=1+(n[1]-1)*t+m(l,P(r,d[1]))||Z,e.scale.z=1+(n[2]-1)*t+m(l,P(r,d[2]))||Z,e.rotation.set(a.x*t+p,a.y*t+f,a.z*t+y),e.position.x=s[0]*t+m(l,P(r,c[0])),e.position.y=s[1]*t+m(l,P(r,c[1])),e.position.z=s[2]*t+m(l,P(r,c[2]))}}_updateGrid(t,e){let i=0,r=t.grid,n=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,s=vt(n.scale,e),a=vt(n.rotation,e),o=vt(n.position,e),h=!0===this.parameters.randomness&&0!==n.strength?this.getRandom(n,!0):null,d=N(n.strength,this.parameters.randomness),u=vt(r.count,e),p=vt(r.size,e);if(!0===r.useCenter){let t={x:u[0]%2==0?2:1,y:u[1]%2==0?2:1,z:u[2]%2==0?2:1},e=new c(p[0]*(u[0]-t.x)*.5,p[1]*(u[1]-t.y)*.5,p[2]*(u[2]-t.z)*.5);for(let t=0;t<u[0];t++)for(let r=0;r<u[1];r++)for(let l=0;l<u[2];l++){let c=this.children[i++];if(!c)continue;let u=null===h?0:h.noise((t+1)*(n.freqScale/10)+n.movement,(r+1)*(n.freqScale/10)+n.movement,(l+1)*(n.freqScale/10)+n.movement);c.scale.x=1+d(i,P(u,s[0]))||Z,c.scale.y=1+d(i,P(u,s[1]))||Z,c.scale.z=1+d(i,P(u,s[2]))||Z;let m=d(i,P(u,a[0])),f=d(i,P(u,a[1])),y=d(i,P(u,a[2]));c.rotation.set(m,f,y),c.position.x=p[0]*t-e.x+d(i,P(u,o[0])),c.position.y=p[1]*r-e.y+d(i,P(u,o[1])),c.position.z=p[2]*l-e.z+d(i,P(u,o[2]))}}else for(let t=0;t<u[0];t++)for(let e=0;e<u[1];e++)for(let r=0;r<u[2];r++){let l=this.children[i++];if(!l)continue;let c=null===h?0:h.noise((t+1)*(n.freqScale/10)+n.movement,(e+1)*(n.freqScale/10)+n.movement,(r+1)*(n.freqScale/10)+n.movement);l.scale.x=1+d(i,P(c,s[0]))||Z,l.scale.y=1+d(i,P(c,s[1]))||Z,l.scale.z=1+d(i,P(c,s[2]))||Z;let u=d(i,P(c,a[0])),m=d(i,P(c,a[1])),f=d(i,P(c,a[2]));l.rotation.set(u,m,f),l.position.x=p[0]*t+d(i,P(c,o[0])),l.position.y=-p[1]*e+d(i,P(c,o[1])),l.position.z=-p[2]*r+d(i,P(c,o[2]))}}_updateToObject(i,r){if("toObject"!==i.type)throw new Error;let{toObject:n}=i,s=vt(n.rotation,r),a=vt(n.position,r),o=vt(n.scale,r),h=new p(s[0],s[1],s[2]),d=i.randomnessObject??l.defaultData([1,1,1]).randomnessObject,c=vt(d.rotation,r),u=vt(d.position,r),m=vt(d.scale,r),f=!0===this.parameters.randomness&&0!==d.strength?this.getRandom(d):null,y=N(d.strength,this.parameters.randomness);if(!n.object){for(let[,t]of this.children.entries())t.position.set(0,0,0),t.scale.setScalar(1),t.rotation.set(0,0,0);return this.objectForSample=void 0,void this.invalidateSurfaceCaches()}if(!this.objectForSample)return;if(this.objectForSample instanceof t){if(!this.objectForSample.font?.isLoaded||void 0===this.objectForSample.geometry.attributes.position)return void(this._pendingMediaLoad=!0);this._pendingMediaLoad=!1}if(void 0===this.objectForSample.geometry&&this.objectForSample.isAncestorOf(this.object.uuid))return void console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) seem to be a child/descendant of the object it's being cloned to. Please re-parent it so that they are siblings instead.`);let b=this.getSubdivData();if(b.length>0){let t=Math.round(b.length*n.count/100);this._updateCount(r,t)}else{let t=this.objectForSample.geometry.getAttribute("position");if(!t||isNaN(t.count)||0===t.count)return void console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) cannot be cloned on the surface of "${this.objectForSample.name}" (${this.objectForSample.uuid}) because the latter does not have a valid geometry.`)}this.objectForSample.updateMatrixWorld();let x="random"===n.spreadType,M=null;x&&(M=this.getSurfaceSampler(),M.setRandomGenerator((0,g.default)(this.object.uuid+n.seed)));let v=z[n.axis],w=this.children;ot.fromArray(v),it.copy(this.object.hiddenMatrix).invert();let j=this.objectForSample instanceof e;j&&rt.copy(this.objectForSample.matrixWorld).invert(),"normal"!==n.align&&this.object.getWorldDirection(ut),yt.set(ot.y,ot.z,ot.x).normalize(),bt.copy(yt).cross(ot).normalize(),st.makeBasis(yt,ot,bt).invert();for(let[t,e]of w.entries()){let i=t*(d.freqScale/10)+d.movement,r=null===f?0:f.noise(i,i,i),s=t+1,l=y(s,P(r,c[0])),p=y(s,P(r,c[1])),g=y(s,P(r,c[2]));x?M.sample(ht,dt):(b.length&&(ht.fromArray(b[t].pos),dt.fromArray(b[t].norm)),j&&ht.applyMatrix4(rt)),ht.applyMatrix4(it),e.position.copy(ht);let v="normal"===n.align?dt:ut,w=lt.fromArray(a);lt.x+=y(s,P(r,u[0])),lt.y+=y(s,P(r,u[1])),lt.z+=y(s,P(r,u[2]));let A=Math.acos(v.dot(ot)),S=ct.crossVectors(ot,v).normalize(),F=tt.makeRotationAxis(S,A);mt.copy(v).cross(this.object.up).normalize(),ft.copy(mt).cross(v).normalize(),nt.makeBasis(mt,v,ft),at.multiplyMatrices(nt,st),xt.setFromRotationMatrix(at),w.applyMatrix4(F),e.position.add(w),e.rotation.set(xt.x+h.x+l,xt.y+h.y+p,xt.z+h.z+g),e.scale.set(1+o[0]+y(s,P(r,m[0]))||Z,1+o[1]+y(s,P(r,m[1]))||Z,1+o[2]+y(s,P(r,m[2]))||Z),e.scale.multiply(this.object.scale),e.hiddenMatrix=this.object.hiddenMatrix}}getSurfaceSampler(){let t=this.objectForSample,e=t.geometry,i=e.getAttribute("position"),r=e.index,n=this.surfaceSamplerCache;if(null!==n&&n.geometry===e&&n.position===i&&n.positionVersion===Mt(i)&&n.index===r&&n.indexVersion===(null===r?-1:r.version))return n.sampler;let s=new O(t).build();return this.surfaceSamplerCache={geometry:e,position:i,positionVersion:Mt(i),index:r,indexVersion:null===r?-1:r.version,sampler:s},s}invalidateSurfaceCaches(){this.surfaceSamplerCache=null,this.surfacePointsCache=null}getSubdivData(){if(!this.objectForSample)return[];let t=this.parameters.toObject.spreadType;if("random"===t)return[];let i=this.objectForSample instanceof e,r=this.objectForSample.geometry;if(!i&&r){let e=this.surfacePointsCache,i=r.getAttribute("position");if(null!==e&&e.spreadType===t&&e.geometry===r&&e.position===i&&e.positionVersion===Mt(i)&&e.index===r.index&&e.indexVersion===(null===r.index?-1:r.index.version))return e.points}let n=new Map,s=(t,e)=>{let i=Math.round(1e4*t[0])+"_"+Math.round(1e4*t[1])+"_"+Math.round(1e4*t[2]),r=n.get(i);r?(r.pos[0]+=t[0],r.pos[1]+=t[1],r.pos[2]+=t[2],r.norm[0]+=e[0],r.norm[1]+=e[1],r.norm[2]+=e[2],r.count+=1):n.set(i,{pos:[...t],norm:[...e],count:1})};if(i){let e=this.objectForSample,i=C[t],r=D[i],n=U[i],a=q[i],o=r(e.subdivPointerNew);for(let t=0;t<=o-1;t++){let i=n(e.subdivPointerNew,t),r=a(e.subdivPointerNew,t);J.fromArray(i).applyMatrix4(e.matrixWorld),K.fromArray(r),s(J.toArray(),K.toArray())}}else(r.index?function(t){let e=[],i=Math.floor(t.index.count/3);for(let r=0;r<i;r++)if(G.fromArray(t.index.array,3*r),E.setFromAttributeAndIndices(t.attributes.position,G.x,G.y,G.z),E.getNormal(L),E.getMidpoint($),!(isNaN($.x)||isNaN($.y)||isNaN($.z))){let{a:t,b:i,c:r}=E,n=t.toArray(),s=i.toArray(),a=r.toArray(),o=t.distanceTo(i),l=i.distanceTo(r),h=r.distanceTo(t),d=I(n,s),c=I(s,a),u=I(a,n),p=[o,l,h],m=Math.max(...p),f=p.filter(t=>Math.round(t)===Math.round(m)).length>1,y=[],b=E.getMidpoint($).toArray();m===o&&!f&&(y=[c,u,u],b=d),m===l&&!f&&(y=[d,u,u],b=c),m===h&&!f&&(y=[d,c,c],b=u),f&&(y=[d,c,u]),e.push({vertices:[n,s,a],faceCenters:y,midpoint:b,norm:E.getNormal(L).toArray()})}return e}(r):function(t){let e=[],{position:i}=t.attributes;for(let t=0;t<i.count;t++){E.setFromAttributeAndIndices(i,3*t,3*t+1,3*t+2),E.getNormal(L),E.getMidpoint($);let r=E.a.toArray(),n=E.b.toArray(),s=E.c.toArray();e.push({vertices:[r,n,s],faceCenters:[I(r,n),I(n,s),I(s,r)],midpoint:$.toArray(),norm:L.toArray()})}return e}(r)).forEach((e,i)=>{"polygon_center"===t&&s(e.midpoint,e.norm),"vertex"===t&&(s(e.vertices[0],e.norm),s(e.vertices[1],e.norm),s(e.vertices[2],e.norm)),"edge"===t&&(s(e.faceCenters[0],e.norm),s(e.faceCenters[1],e.norm),s(e.faceCenters[2],e.norm))});let a=Array.from(n.values());for(let t of a)t.pos[0]/=t.count,t.pos[1]/=t.count,t.pos[2]/=t.count,t.norm[0]/=t.count,t.norm[1]/=t.count,t.norm[2]/=t.count;if(!i&&r){let e=r.getAttribute("position");this.surfacePointsCache={spreadType:t,geometry:r,position:e,positionVersion:Mt(e),index:r.index,indexVersion:null===r.index?-1:r.index.version,points:a}}return a}updateState(t,e){if(this.parameters=o(t),"toObject"!==this.parameters.type)this.invalidateSurfaceCaches(),(null===this.parent||this.parent!==this.object)&&(this.removeFromParent(),this.object.parent?.add(this),this.matrix=this.object.matrix,this.hiddenMatrix=this.object.hiddenMatrix,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1);else if(null===this.parent||this.parent.uuid!==this.parameters.toObject.object){this.removeFromParent(),this.invalidateSurfaceCaches();let t=e.scene.find(this.parameters.toObject.object);this.objectForSample=t instanceof s?t:void 0,this.matrix=new u,this.hiddenMatrix=new u,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1,t&&t.add(this)}this.update(e)}get pendingMediaLoad(){return this._pendingMediaLoad}};export{jt as a};
1
+ import{a as t}from"./runtime-chunk-RRXSRYPQ.js";import{b as e}from"./runtime-chunk-XUM5HEC6.js";import{$ as i,C as r}from"./runtime-chunk-SXPM42HJ.js";import{f as n,v as s}from"./runtime-chunk-4KX4KQWR.js";import{c as a}from"./runtime-chunk-2PT2WH66.js";import{c as o}from"./runtime-chunk-4KZXQGUQ.js";import{M as l}from"./runtime-chunk-RBM3UDQF.js";import{Cc as h,Ec as d,Fc as c,Oc as u,Pc as p,Rc as m,Wc as f,qd as y}from"./runtime-chunk-VGN7YHB7.js";import{a as b,b as x}from"./runtime-chunk-ML3Z74BL.js";var g=x(b((t,e)=>{var i,r;i=t,r=function(){return t.importState=function(e){var i=new t;return i.importState(e),i},t;function t(){return function(t){var e=0,i=0,r=0,n=1;0==t.length&&(t=[+new Date]);var s=function(){var t=4022871197,e=function(e){e=e.toString();for(var i=0;i<e.length;i++){var r=.02519603282416938*(t+=e.charCodeAt(i));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)};return e.version="Mash 0.9",e}();e=s(" "),i=s(" "),r=s(" ");for(var a=0;a<t.length;a++)(e-=s(t[a]))<0&&(e+=1),(i-=s(t[a]))<0&&(i+=1),(r-=s(t[a]))<0&&(r+=1);s=null;var o=function(){var t=2091639*e+2.3283064365386963e-10*n;return e=i,i=r,r=t-(n=0|t)};return o.next=o,o.uint32=function(){return 4294967296*o()},o.fract53=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.version="Alea 0.9",o.args=t,o.exportState=function(){return[e,i,r,n]},o.importState=function(t){e=+t[0]||0,i=+t[1]||0,r=+t[2]||0,n=+t[3]||0},o}(Array.prototype.slice.call(arguments))}},"object"==typeof t?e.exports=r():"function"==typeof define&&define.amd?define(r):i.Alea=r()})()),M=.5*(Math.sqrt(3)-1),v=(3-Math.sqrt(3))/6,w=1/3,j=1/6,S=(Math.sqrt(5),Math.sqrt(5),t=>0|Math.floor(t)),A=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),F=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function _(t){let e=new Uint8Array(512);for(let t=0;t<256;t++)e[t]=t;for(let i=0;i<255;i++){let r=i+~~(t()*(256-i)),n=e[i];e[i]=e[r],e[r]=n}for(let t=256;t<512;t++)e[t]=e[t-256];return e}var z=new f,W=class{constructor(t){this.weightAttribute=null;let e=t.geometry;if(!e.isBufferGeometry||3!==e.attributes.position.itemSize)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");e.index&&(e=e.toNonIndexed()),this.geometry=e,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.distribution=null}build(){let t=this.positionAttribute,e=new Float32Array(t.count/3);for(let i=0;i<t.count;i+=3){let r=1;z.a.fromBufferAttribute(t,i),z.b.fromBufferAttribute(t,i+1),z.c.fromBufferAttribute(t,i+2),r*=z.getArea(),e[i/3]=r}this.distribution=new Float32Array(t.count/3);let i=0;for(let t=0;t<e.length;t++)i+=e[t],this.distribution[t]=i;return this}setRandomGenerator(t){return this.randomFunction=t,this}sample(t,e){if(this.distribution){let i=this.distribution[this.distribution.length-1],r=this.binarySearch(this.randomFunction()*i);return this.sampleFace(r,t,e)}}binarySearch(t){if(!this.distribution)return 0;let e=this.distribution,i=0,r=e.length-1,n=-1;for(;i<=r;){let s=Math.ceil((i+r)/2);if(0===s||e[s-1]<=t&&e[s]>t){n=s;break}t<e[s]?r=s-1:i=s+1}return n}sampleFace(t,e,i){let r=this.randomFunction(),n=this.randomFunction();return r+n>1&&(r=1-r,n=1-n),z.a.fromBufferAttribute(this.positionAttribute,3*t),z.b.fromBufferAttribute(this.positionAttribute,3*t+1),z.c.fromBufferAttribute(this.positionAttribute,3*t+2),e.set(0,0,0).addScaledVector(z.a,r).addScaledVector(z.b,n).addScaledVector(z.c,1-(r+n)),z.getNormal(i),this}},C={x:[1,0,0],"-x":[-1,0,0],y:[0,1,0],"-y":[0,-1,0],z:[0,0,1],"-z":[0,0,-1]},O={polygon_center:0,edge:1,vertex:2},P=(t,e)=>(i,r)=>e&&0!==i&&0!==t?t*r/100:0,N=(t,e)=>{let i=Math.abs(e),r=-1*i;return(t- -1)*(i-r)/2+r},R=new c,T=new c,k=new c,B=new c;function U(t,e){let i=k.fromArray(t),r=B.fromArray(e);T.copy(r).sub(i);let n=T.length();return T.normalize().multiplyScalar(.5*n),R.copy(i).add(T).toArray()}var V,I,D,q,E=new f,L=new c,G=new c,$=new c,Q=class extends y{},H=class extends Q{constructor(t,e){super(void 0,void 0,e),this.source=t,this.isClonerInstancedMesh=!0,this.hiddenMatrix=new u,this.pivotMatrix=new u,this.previousModelViewMatrix=new u,this.copyPreviousMatrix=!0,this.capacity=e,this.count=0,this.matrixAutoUpdate=!1}raycast(t,e){}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}onAfterRender(t,e,i,r,n,s){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}get visible(){return!0!==this.source.cloner?.insideBoolean&&(this.source.visible||this.source.dataPatched.visible&&!0===this.source.dataPatched.cloner?.hideBase)}set visible(t){}get castShadow(){return this.source.castShadow}set castShadow(t){}get receiveShadow(){return this.source.receiveShadow}set receiveShadow(t){}get layers(){return this.source.layers}set layers(t){}get geometry(){return this.source.geometry}set geometry(t){}get material(){return this.source.material}set material(t){}get morphTargetInfluences(){return this.source.morphTargetInfluences}set morphTargetInfluences(t){}},X=t=>.5*(1-Math.cos(t*Math.PI)),K=class{constructor(){this.perlin=new Array(4096)}noise(t,e=0,i=0){if(null==this.perlin){this.perlin=new Array(4096);for(let t=0;t<4096;t++)this.perlin[t]=Math.random()}t<0&&(t=-t),e<0&&(e=-e),i<0&&(i=-i);let r,n,s,a,o,l=Math.floor(t),h=Math.floor(e),d=Math.floor(i),c=t-l,u=e-h,p=i-d,m=0,f=.5;for(let t=0;t<4;t++){let t=l+(h<<4)+(d<<8);r=X(c),n=X(u),s=this.perlin[4095&t],s+=r*(this.perlin[t+1&4095]-s),a=this.perlin[t+16&4095],a+=r*(this.perlin[t+16+1&4095]-a),s+=n*(a-s),t+=256,a=this.perlin[4095&t],a+=r*(this.perlin[t+1&4095]-a),o=this.perlin[t+16&4095],o+=r*(this.perlin[t+16+1&4095]-o),a+=n*(o-a),s+=X(p)*(a-s),m+=s*f,f*=.5,l<<=1,c*=2,h<<=1,u*=2,d<<=1,p*=2,c>=1&&(l++,c--),u>=1&&(h++,u--),p>=1&&(d++,p--)}return m}noiseSeed(t){let e=(()=>{let t,e;return{setSeed(i){e=t=(i??4294967296*Math.random())>>>0},getSeed:()=>t,rand:()=>(e=(1664525*e+1013904223)%4294967296,e/4294967296)}})();e.setSeed(t),this.perlin=new Array(4096);for(let t=0;t<4096;t++)this.perlin[t]=e.rand()}},Y=1e-4,Z=new c,J=new c;r.then(t=>{I=[(V=t).get_face_center,V.get_edge_midpoint,V.get_vertex_position],D=[V.get_face_normal,V.get_edge_normal,V.get_vertex_normal],q=[V.face_count,V.edge_count,V.vertex_count]}),new u;var tt=new u,et=new u,it=new u,rt=new u,nt=new u,st=new u,at=new u,ot=new c,lt=new c,ht=new c,dt=new c,ct=new c,ut=new c,pt=new c,mt=new c,ft=new c,yt=new c,bt=new c,xt=new p,gt=new d;function Mt(t){return t?t.version??t.data?.version??0:-1}function vt(t,e){return["number"==typeof t?.[0]?t[0]:"string"==typeof t?.[0]&&e?parseFloat(String(e.shared.getVariable(t[0])??"0")):0,"number"==typeof t?.[1]?t[1]:"string"==typeof t?.[1]&&e?parseFloat(String(e.shared.getVariable(t[1])??"0")):0,"number"==typeof t?.[2]?t[2]:"string"==typeof t?.[2]&&e?parseFloat(String(e.shared.getVariable(t[2])??"0")):0]}var wt=class{constructor(t,e){this.data=t,this.is3D=e,this.perlin=new K,"perlin"===t.noiseType?(this.perlin.noiseSeed(t.seed),this.noise=e?(t,e,i)=>this.perlin.noise(t,e,i):t=>this.perlin.noise(t)):this.noise=e?function(t=Math.random){let e=_(t),i=new Float64Array(e).map(t=>F[t%12*3]),r=new Float64Array(e).map(t=>F[t%12*3+1]),n=new Float64Array(e).map(t=>F[t%12*3+2]);return function(t,s,a){let o,l,h,d,c,u,p,m,f,y,b=(t+s+a)*w,x=S(t+b),g=S(s+b),M=S(a+b),v=(x+g+M)*j,A=t-(x-v),F=s-(g-v),_=a-(M-v);A>=F?F>=_?(c=1,u=0,p=0,m=1,f=1,y=0):A>=_?(c=1,u=0,p=0,m=1,f=0,y=1):(c=0,u=0,p=1,m=1,f=0,y=1):F<_?(c=0,u=0,p=1,m=0,f=1,y=1):A<_?(c=0,u=1,p=0,m=0,f=1,y=1):(c=0,u=1,p=0,m=1,f=1,y=0);let z=A-c+j,W=F-u+j,C=_-p+j,O=A-m+2*j,P=F-f+2*j,N=_-y+2*j,R=A-1+.5,T=F-1+.5,k=_-1+.5,B=255&x,U=255&g,V=255&M,I=.6-A*A-F*F-_*_;if(I<0)o=0;else{let t=B+e[U+e[V]];I*=I,o=I*I*(i[t]*A+r[t]*F+n[t]*_)}let D=.6-z*z-W*W-C*C;if(D<0)l=0;else{let t=B+c+e[U+u+e[V+p]];D*=D,l=D*D*(i[t]*z+r[t]*W+n[t]*C)}let q=.6-O*O-P*P-N*N;if(q<0)h=0;else{let t=B+m+e[U+f+e[V+y]];q*=q,h=q*q*(i[t]*O+r[t]*P+n[t]*N)}let E=.6-R*R-T*T-k*k;if(E<0)d=0;else{let t=B+1+e[U+1+e[V+1]];E*=E,d=E*E*(i[t]*R+r[t]*T+n[t]*k)}return 32*(o+l+h+d)}}((0,g.default)(t.seed)):function(t=Math.random){let e=_(t),i=new Float64Array(e).map(t=>A[t%12*2]),r=new Float64Array(e).map(t=>A[t%12*2+1]);return function(t,n){let s,a,o=0,l=0,h=0,d=(t+n)*M,c=S(t+d),u=S(n+d),p=(c+u)*v,m=t-(c-p),f=n-(u-p);m>f?(s=1,a=0):(s=0,a=1);let y=m-s+v,b=f-a+v,x=m-1+2*v,g=f-1+2*v,w=255&c,j=255&u,A=.5-m*m-f*f;if(A>=0){let t=w+e[j];A*=A,o=A*A*(i[t]*m+r[t]*f)}let F=.5-y*y-b*b;if(F>=0){let t=w+s+e[j+a];F*=F,l=F*F*(i[t]*y+r[t]*b)}let _=.5-x*x-g*g;if(_>=0){let t=w+1+e[j+1];_*=_,h=_*_*(i[t]*x+r[t]*g)}return 70*(o+l+h)}}((0,g.default)(t.seed??""))}},jt=class extends(n(m)){constructor(t,e){super(),this.parameters=e,this.isCloner=!0,this.objectForSample=void 0,this._pendingMediaLoad=!1,this.random=null,this.surfaceSamplerCache=null,this.surfacePointsCache=null,this.object=t}resetOnMove(){this.removeFromParent(),this.parent=null}removeFromParent(){return super.removeFromParent(),this.instancedMesh?.removeFromParent(),this}dispose(){this.removeFromParent(),this._disposeInstancedMesh(),this._invalidateBoolean()}_invalidateBoolean(){this.object instanceof s&&this.object.onClonerLayoutUpdated()}expandClones(t){if(null===this.parent)this.updateState(this.parameters,t);else{for(let t of this.children)t instanceof i&&t.expand();this._syncInstancedMesh()}}invalidateTransform(t){this.matrixWorldNeedsUpdate=!0}onObjUpdateMatrix(){"toObject"!==this.parameters.type&&(this.matrixWorldNeedsUpdate=!0)}update(t){switch(this._updateCount(t),this.parameters.type){case"radial":this._updateRadial(this.parameters,t);break;case"linear":this._updateLinear(this.parameters,t);break;case"grid":this._updateGrid(this.parameters,t);break;case"toObject":this._updateToObject(this.parameters,t)}for(let t of this.children){let e=t.transformOverride;void 0!==e&&(t.position.fromArray(e.position),t.rotation.fromArray(e.rotation),t.scale.fromArray(e.scale)),t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldRigid())}this._syncInstancedMesh(),this._invalidateBoolean()}get instancingActive(){return void 0!==this.instancedMesh}get insideBoolean(){return null!==this.parent&&"booleanOp"in this.parent}_instancingEligible(){if(!0!==this.parameters.instanced)return!1;let t=this.object;return!(t.entityChildrenCount()>0||!0!==t.isMesh||a(t)||!0===t.isDecalObject)}_syncInstancedMesh(){if(!this._instancingEligible())return void this._disposeInstancedMesh();let t=this.instancedMesh;if(void 0!==t&&t.capacity<this.children.length&&(this._disposeInstancedMesh(),t=void 0),void 0===t){let e=Math.max(8,Math.ceil(1.5*this.children.length));t=this.instancedMesh=new H(this.object,e)}t.matrix=this.matrix,t.hiddenMatrix=this.hiddenMatrix,t.matrixWorldNeedsUpdate=!0,t.parent!==this.parent&&(t.removeFromParent(),this.parent?.add(t)),this.syncInstanceMatrices()}syncInstanceMatrices(){this._invalidateBoolean();let t=this.instancedMesh;if(void 0===t)return;let e=0;for(let i of this.children)!1!==i.playModeVisible&&(et.multiplyMatrices(i.hiddenMatrix,i.matrix).multiply(i.pivotMatrix),t.setMatrixAt(e++,et));t.count=e,t.instanceMatrix.needsUpdate=!0,t.boundingSphere=null}_disposeInstancedMesh(){let t=this.instancedMesh;void 0!==t&&(this.instancedMesh=void 0,t.removeFromParent(),t.dispose())}_updateCount(t,e){let r;if(void 0!==e)r=e;else{let e=vt(this.parameters.grid.count,t);r="grid"===this.parameters.type?Math.round(e[0])*Math.round(e[1])*Math.round(e[2]):this.parameters.count}if("toObject"===this.parameters.type)if(this.parameters.toObject.object){if(void 0===e&&"random"!==this.parameters.toObject.spreadType)return}else r=0;if(this.children.length!==r)if(this.children.length<r)for(let t=0,e=r-this.children.length;t<e;++t){let t=new i(this.object);t.expand(),this.add(t)}else for(;this.children.length>r;){let t=this.children.pop();t.parent=null,t.dispatchEvent({type:"removed"}),this.dispatchEvent({type:"childremoved",child:t})}}getRandom(t,e=!1){return(null===this.random||this.random.data.seed!==t.seed||this.random.data.noiseType!==t.noiseType||this.random.is3D!==e)&&(this.random=new wt(t,e)),this.random}_updateRadial(t,e){let i,r=t.radial,n=r.start*h.DEG2RAD,s=n-r.end*h.DEG2RAD,a=vt(r.rotation,e),o=new p(a[0],a[1],a[2]);switch(r.axis){case"z":i=new c(0,0,1);break;case"y":i=new c(0,1,0);break;default:i=new c(1,0,0)}let d=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,u=!0===this.parameters.randomness&&0!==d.strength?this.getRandom(d):null,m=vt(r.scale,e),f=vt(r.position,e),y=vt(d.scale,e),b=vt(d.position,e),x=vt(d.rotation,e),g=s/t.count,M=P(d.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let s=t*(d.freqScale/10)+d.movement,a=null===u?0:u.noise(s,s,s),l=t+1;e.scale.x=m[0]+M(l,N(a,y[0]))||Y,e.scale.y=m[1]+M(l,N(a,y[1]))||Y,e.scale.z=m[2]+M(l,N(a,y[2]))||Y;let h=g*t-n;switch(r.axis){default:case"x":xt.set(0,h,0);break;case"y":xt.set(0,0,h);break;case"z":xt.set(h,0,0)}pt.copy(i).applyQuaternion(gt.setFromEuler(xt)).multiplyScalar(r.radius),e.position.set(pt.x+(f[0]+M(l,N(a,b[0]))),pt.y+(f[1]+M(l,N(a,b[1]))),pt.z+(f[2]+M(l,N(a,b[2]))));let c=M(l,N(a,x[0])),p=M(l,N(a,x[1])),v=M(l,N(a,x[2]));!0===r.alignment?e.rotation.set(xt.x+(o.x+c),xt.y+(o.y+p),xt.z+(o.z+v)):e.rotation.set(o.x+c,o.y+p,o.z+v)}}_updateLinear(t,e){if("linear"!==t.type)throw new Error;let i=t.linear,r=vt(i.rotation,e),n=vt(i.scale,e),s=vt(i.position,e),a=new p(r[0]??0,r[1]??0,r[2]??0),o=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,h=vt(o.rotation,e),d=vt(o.scale,e),c=vt(o.position,e),u=!0===this.parameters.randomness&&0!==o.strength?this.getRandom(o):null,m=P(o.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let i=t*(o.freqScale/10)+o.movement,r=null===u?0:u.noise(i,i,i),l=t+1,p=m(l,N(r,h[0])),f=m(l,N(r,h[1])),y=m(l,N(r,h[2]));e.scale.x=1+(n[0]-1)*t+m(l,N(r,d[0]))||Y,e.scale.y=1+(n[1]-1)*t+m(l,N(r,d[1]))||Y,e.scale.z=1+(n[2]-1)*t+m(l,N(r,d[2]))||Y,e.rotation.set(a.x*t+p,a.y*t+f,a.z*t+y),e.position.x=s[0]*t+m(l,N(r,c[0])),e.position.y=s[1]*t+m(l,N(r,c[1])),e.position.z=s[2]*t+m(l,N(r,c[2]))}}_updateGrid(t,e){let i=0,r=t.grid,n=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,s=vt(n.scale,e),a=vt(n.rotation,e),o=vt(n.position,e),h=!0===this.parameters.randomness&&0!==n.strength?this.getRandom(n,!0):null,d=P(n.strength,this.parameters.randomness),u=vt(r.count,e),p=vt(r.size,e);if(!0===r.useCenter){let t={x:u[0]%2==0?2:1,y:u[1]%2==0?2:1,z:u[2]%2==0?2:1},e=new c(p[0]*(u[0]-t.x)*.5,p[1]*(u[1]-t.y)*.5,p[2]*(u[2]-t.z)*.5);for(let t=0;t<u[0];t++)for(let r=0;r<u[1];r++)for(let l=0;l<u[2];l++){let c=this.children[i++];if(!c)continue;let u=null===h?0:h.noise((t+1)*(n.freqScale/10)+n.movement,(r+1)*(n.freqScale/10)+n.movement,(l+1)*(n.freqScale/10)+n.movement);c.scale.x=1+d(i,N(u,s[0]))||Y,c.scale.y=1+d(i,N(u,s[1]))||Y,c.scale.z=1+d(i,N(u,s[2]))||Y;let m=d(i,N(u,a[0])),f=d(i,N(u,a[1])),y=d(i,N(u,a[2]));c.rotation.set(m,f,y),c.position.x=p[0]*t-e.x+d(i,N(u,o[0])),c.position.y=p[1]*r-e.y+d(i,N(u,o[1])),c.position.z=p[2]*l-e.z+d(i,N(u,o[2]))}}else for(let t=0;t<u[0];t++)for(let e=0;e<u[1];e++)for(let r=0;r<u[2];r++){let l=this.children[i++];if(!l)continue;let c=null===h?0:h.noise((t+1)*(n.freqScale/10)+n.movement,(e+1)*(n.freqScale/10)+n.movement,(r+1)*(n.freqScale/10)+n.movement);l.scale.x=1+d(i,N(c,s[0]))||Y,l.scale.y=1+d(i,N(c,s[1]))||Y,l.scale.z=1+d(i,N(c,s[2]))||Y;let u=d(i,N(c,a[0])),m=d(i,N(c,a[1])),f=d(i,N(c,a[2]));l.rotation.set(u,m,f),l.position.x=p[0]*t+d(i,N(c,o[0])),l.position.y=-p[1]*e+d(i,N(c,o[1])),l.position.z=-p[2]*r+d(i,N(c,o[2]))}}_updateToObject(i,r){if("toObject"!==i.type)throw new Error;let{toObject:n}=i,s=vt(n.rotation,r),a=vt(n.position,r),o=vt(n.scale,r),h=new p(s[0],s[1],s[2]),d=i.randomnessObject??l.defaultData([1,1,1]).randomnessObject,c=vt(d.rotation,r),u=vt(d.position,r),m=vt(d.scale,r),f=!0===this.parameters.randomness&&0!==d.strength?this.getRandom(d):null,y=P(d.strength,this.parameters.randomness);if(!n.object){for(let[,t]of this.children.entries())t.position.set(0,0,0),t.scale.setScalar(1),t.rotation.set(0,0,0);return this.objectForSample=void 0,void this.invalidateSurfaceCaches()}if(!this.objectForSample)return;if(this.objectForSample instanceof t){if(!this.objectForSample.font?.isLoaded||void 0===this.objectForSample.geometry.attributes.position)return void(this._pendingMediaLoad=!0);this._pendingMediaLoad=!1}if(void 0===this.objectForSample.geometry&&this.objectForSample.isAncestorOf(this.object.uuid))return void console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) seem to be a child/descendant of the object it's being cloned to. Please re-parent it so that they are siblings instead.`);let b=this.getSubdivData();if(b.length>0){let t=Math.round(b.length*n.count/100);this._updateCount(r,t)}else{let t=this.objectForSample.geometry.getAttribute("position");if(!t||isNaN(t.count)||0===t.count)return void console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) cannot be cloned on the surface of "${this.objectForSample.name}" (${this.objectForSample.uuid}) because the latter does not have a valid geometry.`)}this.objectForSample.updateMatrixWorld();let x="random"===n.spreadType,M=null;x&&(M=this.getSurfaceSampler(),M.setRandomGenerator((0,g.default)(this.object.uuid+n.seed)));let v=C[n.axis],w=this.children;ot.fromArray(v),it.copy(this.object.hiddenMatrix).invert();let j=this.objectForSample instanceof e;j&&rt.copy(this.objectForSample.matrixWorld).invert(),"normal"!==n.align&&this.object.getWorldDirection(ut),yt.set(ot.y,ot.z,ot.x).normalize(),bt.copy(yt).cross(ot).normalize(),st.makeBasis(yt,ot,bt).invert();for(let[t,e]of w.entries()){let i=t*(d.freqScale/10)+d.movement,r=null===f?0:f.noise(i,i,i),s=t+1,l=y(s,N(r,c[0])),p=y(s,N(r,c[1])),g=y(s,N(r,c[2]));x?M.sample(ht,dt):(b.length&&(ht.fromArray(b[t].pos),dt.fromArray(b[t].norm)),j&&ht.applyMatrix4(rt)),ht.applyMatrix4(it),e.position.copy(ht);let v="normal"===n.align?dt:ut,w=lt.fromArray(a);lt.x+=y(s,N(r,u[0])),lt.y+=y(s,N(r,u[1])),lt.z+=y(s,N(r,u[2]));let S=Math.acos(v.dot(ot)),A=ct.crossVectors(ot,v).normalize(),F=tt.makeRotationAxis(A,S);mt.copy(v).cross(this.object.up).normalize(),ft.copy(mt).cross(v).normalize(),nt.makeBasis(mt,v,ft),at.multiplyMatrices(nt,st),xt.setFromRotationMatrix(at),w.applyMatrix4(F),e.position.add(w),e.rotation.set(xt.x+h.x+l,xt.y+h.y+p,xt.z+h.z+g),e.scale.set(1+o[0]+y(s,N(r,m[0]))||Y,1+o[1]+y(s,N(r,m[1]))||Y,1+o[2]+y(s,N(r,m[2]))||Y),e.scale.multiply(this.object.scale),e.hiddenMatrix=this.object.hiddenMatrix}}getSurfaceSampler(){let t=this.objectForSample,e=t.geometry,i=e.getAttribute("position"),r=e.index,n=this.surfaceSamplerCache;if(null!==n&&n.geometry===e&&n.position===i&&n.positionVersion===Mt(i)&&n.index===r&&n.indexVersion===(null===r?-1:r.version))return n.sampler;let s=new W(t).build();return this.surfaceSamplerCache={geometry:e,position:i,positionVersion:Mt(i),index:r,indexVersion:null===r?-1:r.version,sampler:s},s}invalidateSurfaceCaches(){this.surfaceSamplerCache=null,this.surfacePointsCache=null}getSubdivData(){if(!this.objectForSample)return[];let t=this.parameters.toObject.spreadType;if("random"===t)return[];let i=this.objectForSample instanceof e,r=this.objectForSample.geometry;if(!i&&r){let e=this.surfacePointsCache,i=r.getAttribute("position");if(null!==e&&e.spreadType===t&&e.geometry===r&&e.position===i&&e.positionVersion===Mt(i)&&e.index===r.index&&e.indexVersion===(null===r.index?-1:r.index.version))return e.points}let n=new Map,s=(t,e)=>{let i=Math.round(1e4*t[0])+"_"+Math.round(1e4*t[1])+"_"+Math.round(1e4*t[2]),r=n.get(i);r?(r.pos[0]+=t[0],r.pos[1]+=t[1],r.pos[2]+=t[2],r.norm[0]+=e[0],r.norm[1]+=e[1],r.norm[2]+=e[2],r.count+=1):n.set(i,{pos:[...t],norm:[...e],count:1})};if(i){let e=this.objectForSample,i=O[t],r=q[i],n=I[i],a=D[i],o=r(e.subdivPointerNew);for(let t=0;t<=o-1;t++){let i=n(e.subdivPointerNew,t),r=a(e.subdivPointerNew,t);Z.fromArray(i).applyMatrix4(e.matrixWorld),J.fromArray(r),s(Z.toArray(),J.toArray())}}else(r.index?function(t){let e=[],i=Math.floor(t.index.count/3);for(let r=0;r<i;r++)if(L.fromArray(t.index.array,3*r),E.setFromAttributeAndIndices(t.attributes.position,L.x,L.y,L.z),E.getNormal(G),E.getMidpoint($),!(isNaN($.x)||isNaN($.y)||isNaN($.z))){let{a:t,b:i,c:r}=E,n=t.toArray(),s=i.toArray(),a=r.toArray(),o=t.distanceTo(i),l=i.distanceTo(r),h=r.distanceTo(t),d=U(n,s),c=U(s,a),u=U(a,n),p=[o,l,h],m=Math.max(...p),f=p.filter(t=>Math.round(t)===Math.round(m)).length>1,y=[],b=E.getMidpoint($).toArray();m===o&&!f&&(y=[c,u,u],b=d),m===l&&!f&&(y=[d,u,u],b=c),m===h&&!f&&(y=[d,c,c],b=u),f&&(y=[d,c,u]),e.push({vertices:[n,s,a],faceCenters:y,midpoint:b,norm:E.getNormal(G).toArray()})}return e}(r):function(t){let e=[],{position:i}=t.attributes;for(let t=0;t<i.count;t++){E.setFromAttributeAndIndices(i,3*t,3*t+1,3*t+2),E.getNormal(G),E.getMidpoint($);let r=E.a.toArray(),n=E.b.toArray(),s=E.c.toArray();e.push({vertices:[r,n,s],faceCenters:[U(r,n),U(n,s),U(s,r)],midpoint:$.toArray(),norm:G.toArray()})}return e}(r)).forEach((e,i)=>{"polygon_center"===t&&s(e.midpoint,e.norm),"vertex"===t&&(s(e.vertices[0],e.norm),s(e.vertices[1],e.norm),s(e.vertices[2],e.norm)),"edge"===t&&(s(e.faceCenters[0],e.norm),s(e.faceCenters[1],e.norm),s(e.faceCenters[2],e.norm))});let a=Array.from(n.values());for(let t of a)t.pos[0]/=t.count,t.pos[1]/=t.count,t.pos[2]/=t.count,t.norm[0]/=t.count,t.norm[1]/=t.count,t.norm[2]/=t.count;if(!i&&r){let e=r.getAttribute("position");this.surfacePointsCache={spreadType:t,geometry:r,position:e,positionVersion:Mt(e),index:r.index,indexVersion:null===r.index?-1:r.index.version,points:a}}return a}updateState(t,e){if(this.parameters=o(t),"toObject"!==this.parameters.type)this.invalidateSurfaceCaches(),(null===this.parent||this.parent!==this.object)&&(this.removeFromParent(),this.object.parent?.add(this),this.matrix=this.object.matrix,this.hiddenMatrix=this.object.hiddenMatrix,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1);else if(null===this.parent||this.parent.uuid!==this.parameters.toObject.object){this.removeFromParent(),this.invalidateSurfaceCaches();let t=e.scene.find(this.parameters.toObject.object);this.objectForSample=t instanceof s?t:void 0,this.matrix=new u,this.hiddenMatrix=new u,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1,t&&t.add(this)}this.update(e)}get pendingMediaLoad(){return this._pendingMediaLoad}};export{jt as a};
@@ -1 +1 @@
1
- import{E as e,G as a,H as t,d as i,f as r,g as n,x as o,z as s}from"./runtime-chunk-OW6T4XFV.js";var l,u,d,c,f,h,p,m,g,b,y,w,A,D,v,B,k,_,z,S,x,O,j,C;function P(e,a=[0,0]){return[e&&!isNaN(e[0])?e[0]:a[0],e&&!isNaN(e[1])?e[1]:a[1]]}function R(e,i,r){switch(e){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 7:return"cubicBezier( .25, 1, .5, 1 )";case 5:{let{control1:e,control2:a}=i??{...t.defaultData};return`cubicBezier( ${e[0]}, ${e[1]}, ${a[0]}, ${a[1]} )`}case 6:{let{mass:e,stiffness:t,damping:i,velocity:n}=r??{...a.defaultData},o=new G(e,t,i,n),s=o.solve(1);return()=>e=>o.solve(e)/s}case 8:return()=>e=>Math.floor(e)}}function E(e,a,t){return{id:a,fi:t,data:{id:a,path:e,keyframes:new n}}}(l||(l={})).emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"},(u||(u={})).is=function(e){return!0},(c=d||(d={})).defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]},c.merge=function(e,a){return{position:a?.position??e.position,rotation:a?.rotation??e.rotation,scale:a?.scale??e.scale,shear:a?.shear??e.shear}},c.diff=function(e,a){return i({position:s.isEqual(e.position,a.position)?void 0:a.position,rotation:e.rotation===a.rotation?void 0:a.rotation,scale:s.isEqual(e.scale,a.scale)?void 0:a.scale,shear:e.shear&&a.shear&&s.isEqual(e.shear,a.shear)?void 0:a.shear})},(f||(f={})).defaultData={horizontalConstraint:0,verticalConstraint:0},(h||(h={})).defaultData={direction:"row",wrap:"unwrap",align:"top-left",gap:10,rowGap:10,autoGap:!1,autoRowGap:!1,leftPadding:8,rightPadding:8,topPadding:8,bottomPadding:8},(p||(p={})).defaultData={opacity:1,fill:{color:e.fromHexAndA(o,1),enabled:!0},stroke:{color:e.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0}},(g=m||(m={})).newEmpty=function(e,a){return{name:a}},g.patch=function(e,a){if(void 0===a)return e;let t={...e};return Object.assign(t,d.merge(t,a)),t=function(e,a){if(void 0===a)return e;let t={...e},i=["width","height","cornerRadius"];for(let e of i)e in t&&e in a&&void 0!==a[e]&&Object.assign(t,{[e]:a[e]});return t}(t,a),t=function(e,a){if(void 0===a)return e;let t={...e};return"fill"in t&&"fill"in a&&void 0!==a.fill&&Object.assign(t,{fill:{...t.fill,...a.fill}}),"stroke"in t&&"stroke"in a&&void 0!==a.stroke&&Object.assign(t,{stroke:{...t.stroke,...a.stroke}}),"layerBlur"in t&&"layerBlur"in a&&void 0!==a.layerBlur&&Object.assign(t,{layerBlur:{...t.layerBlur,...a.layerBlur}}),"backgroundBlur"in t&&"backgroundBlur"in a&&void 0!==a.backgroundBlur&&Object.assign(t,{backgroundBlur:{...t.backgroundBlur,...a.backgroundBlur}}),"dropShadow"in t&&"dropShadow"in a&&void 0!==a.dropShadow&&Object.assign(t,{dropShadow:{...t.dropShadow,...a.dropShadow}}),"innerShadow"in t&&"innerShadow"in a&&void 0!==a.innerShadow&&Object.assign(t,{innerShadow:{...t.innerShadow,...a.innerShadow}}),t}(t,a),t},g.toOps=function(e,a){let t,i=[];for(let[e,r]of Object.entries(a))"name"!==e&&(void 0===t&&(t={path:[],props:{},type:0},i.push(t)),t.props[e]=r);return i},(b||(b={})).defaultData={...d.defaultData,...f.defaultData,states:new n,events:new n,visible:!0,raycastLock:!1},(y||(y={})).defaultData={...b.defaultData,...p.defaultData},(w||(w={})).defaultData={cornerRadius:[0,0,0,0]},(A||(A={})).defaultData={...y.defaultData,type:"ellipse2d",width:100,height:100,name:"Ellipse"},(D||(D={})).defaultData={...y.defaultData,...w.defaultData,type:"rectangle2d",width:100,height:100,name:"Rectangle"},(v||(v={})).defaultData={...y.defaultData,type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"},(B||(B={})).defaultData={...y.defaultData,type:"path2d",path:"",name:"Path"},(k||(k={})).is=function(e){return"ellipse2d"===e.type||"rectangle2d"===e.type||"text2d"===e.type||"vector2d"===e.type||"path2d"===e.type},(_||(_={})).defaultData={...b.defaultData,name:"Group",type:"group2d"},(z||(z={})).defaultData=()=>({...b.defaultData,...w.defaultData,...p.defaultData,name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:e.fromHexAndA(4737101,1),enabled:!0},stroke:{color:e.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}}),(e=>{e.defaultData=function(e){switch(e){case"rectangle2d":case"vector2d":return{...D.defaultData};case"ellipse2d":return{...A.defaultData};case"text2d":return{...v.defaultData};case"path2d":return{...B.defaultData};case"frame2d":return{...z.defaultData()};case"group2d":return{..._.defaultData}}},e.getPivot=function(e){return"width"in e&&"height"in e?["number"==typeof e.width?.5*e.width:0,"number"==typeof e.height?.5*e.height:0]:[0,0]},e.isResizeable=function(e){return"rectangle2d"===e.type||"ellipse2d"===e.type||"text2d"===e.type||"frame2d"===e.type},e.isAutoLayoutable=function(e){return"frame2d"===e.type&&void 0!==e.autoLayout},e.hasCorners=function(e){return"rectangle2d"===e.type||"frame2d"===e.type}})(S||(S={})),(O=x||(x={})).defaultData={name:"UI",type:"scene2d",objects:new r},O.emptyData=function(){return{type:"scene2d",objects:new r}},(j||(j={})).is=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z},(e=>{e.getControlsWithDefault=function(e,a){let t=[0,0],i=[1,1];if(e?.cubicControls)t=P(e.cubicControls.control1,t);else switch(e?.type){case 2:case 4:t=[.42,0];break;case 3:case 0:t=[0,0];break;case 1:t=[.25,.1];break;case 7:t=[.25,1]}if(a?.cubicControls)i=P(a.cubicControls.control2,i);else switch(a?.type){case 2:case 0:i=[1,1];break;case 3:case 4:i=[.58,1];break;case 1:i=[.25,1];break;case 7:i=[.5,1]}return{control1:t,control2:i}},e.defaultData=function(e,a){return{id:e,name:a,to:5,properties:new n}},e.createMaterialGroup=function(e){let a=new n;return e.forEach(({data:e,id:t,fi:i})=>{if("light"===e.type){let r=E(["material",`${e.category} lighting`],t,i);a.push(r)}else{let r=E(["material",e.type],t,i);a.push(r)}}),a},e.createName=function(e){return Object.entries(e).reduce((e,[a,t])=>("string"!=typeof t&&e.push({name:t.name}),e),[])},e.Presets=[{name:"Slide in",animationParams:{translateX:{value:[-20,0],easing:R(3),duration:1e3},opacity:{value:[0,1],easing:R(3),duration:1e3},endDelay:250,loop:!0}},{name:"Rotate",animationParams:{rotate:{value:[0,"1turn"],easing:R(5),duration:700},endDelay:250,loop:!0}},{name:"Scale Out",animationParams:{scale:{value:[1,1.5],easing:R(4),duration:1e3},endDelay:250,loop:!0}},{name:"Jump",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],endDelay:500,loop:!0}},{name:"Jump Rotate",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],rotate:{value:[0,"1turn"],easing:R(5),duration:500},endDelay:500,loop:!0}},{name:"Bounce",animationParams:{translateY:{value:["20px","-20px"],duration:575,easing:"easeOutQuad"},direction:"alternate",loop:!0}}]})(C||(C={}));var M=["x","y","z"],G=class{constructor(e=1,a=100,t=10,i=0){this.mass=e,this.stiffness=a,this.damping=t,this.initialVelocity=i,this.m_w0=Math.sqrt(a/e),this.m_zeta=t/(2*Math.sqrt(a*e)),this.m_zeta<1?(this.m_wd=this.m_w0*Math.sqrt(1-this.m_zeta*this.m_zeta),this.m_A=1,this.m_B=(this.m_zeta*this.m_w0-i)/this.m_wd):(this.m_wd=0,this.m_A=1,this.m_B=-i+this.m_w0)}solve(e){return 1-(this.m_zeta<1?Math.exp(-e*this.m_zeta*this.m_w0)*(this.m_A*Math.cos(this.m_wd*e)+this.m_B*Math.sin(this.m_wd*e)):(this.m_A+this.m_B*e)*Math.exp(-e*this.m_w0))}getDuration(){let e=.16666666666666666,a=0,t=0;for(;;)if(a+=e,1===this.solve(a)){if(t++,t>=16)break}else t=0;return a*e*1e3}};export{l as a,m as b,D as c,_ as d,S as e,x as f,P as g,R as h,M as i};
1
+ import{E as e,G as a,H as t,d as i,f as r,g as n,x as o,z as s}from"./runtime-chunk-RBM3UDQF.js";var l,u,d,c,f,h,p,m,g,b,y,w,A,D,v,B,k,_,z,S,x,O,j,C;function P(e,a=[0,0]){return[e&&!isNaN(e[0])?e[0]:a[0],e&&!isNaN(e[1])?e[1]:a[1]]}function R(e,i,r){switch(e){case 0:return"cubicBezier( 0, 0, 1, 1 )";case 1:return"cubicBezier( .25, .1, .25, 1 )";case 2:return"cubicBezier( .42, 0, 1, 1 )";case 3:return"cubicBezier( 0, 0, .58, 1 )";case 4:return"cubicBezier( .42, 0, .58, 1 )";case 7:return"cubicBezier( .25, 1, .5, 1 )";case 5:{let{control1:e,control2:a}=i??{...t.defaultData};return`cubicBezier( ${e[0]}, ${e[1]}, ${a[0]}, ${a[1]} )`}case 6:{let{mass:e,stiffness:t,damping:i,velocity:n}=r??{...a.defaultData},o=new G(e,t,i,n),s=o.solve(1);return()=>e=>o.solve(e)/s}case 8:return()=>e=>Math.floor(e)}}function M(e,a,t){return{id:a,fi:t,data:{id:a,path:e,keyframes:new n}}}(l||(l={})).emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"},(u||(u={})).is=function(e){return!0},(c=d||(d={})).defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]},c.merge=function(e,a){return{position:a?.position??e.position,rotation:a?.rotation??e.rotation,scale:a?.scale??e.scale,shear:a?.shear??e.shear}},c.diff=function(e,a){return i({position:s.isEqual(e.position,a.position)?void 0:a.position,rotation:e.rotation===a.rotation?void 0:a.rotation,scale:s.isEqual(e.scale,a.scale)?void 0:a.scale,shear:e.shear&&a.shear&&s.isEqual(e.shear,a.shear)?void 0:a.shear})},(f||(f={})).defaultData={horizontalConstraint:0,verticalConstraint:0},(h||(h={})).defaultData={direction:"row",wrap:"unwrap",align:"top-left",gap:10,rowGap:10,autoGap:!1,autoRowGap:!1,leftPadding:8,rightPadding:8,topPadding:8,bottomPadding:8},(p||(p={})).defaultData={opacity:1,fill:{color:e.fromHexAndA(o,1),enabled:!0},stroke:{color:e.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:e.from0to1([0,0,0,1]),enabled:!1,spread:0}},(g=m||(m={})).newEmpty=function(e,a){return{name:a}},g.patch=function(e,a){if(void 0===a)return e;let t={...e};return Object.assign(t,d.merge(t,a)),t=function(e,a){if(void 0===a)return e;let t={...e},i=["width","height","cornerRadius"];for(let e of i)e in t&&e in a&&void 0!==a[e]&&Object.assign(t,{[e]:a[e]});return t}(t,a),t=function(e,a){if(void 0===a)return e;let t={...e};return"fill"in t&&"fill"in a&&void 0!==a.fill&&Object.assign(t,{fill:{...t.fill,...a.fill}}),"stroke"in t&&"stroke"in a&&void 0!==a.stroke&&Object.assign(t,{stroke:{...t.stroke,...a.stroke}}),"layerBlur"in t&&"layerBlur"in a&&void 0!==a.layerBlur&&Object.assign(t,{layerBlur:{...t.layerBlur,...a.layerBlur}}),"backgroundBlur"in t&&"backgroundBlur"in a&&void 0!==a.backgroundBlur&&Object.assign(t,{backgroundBlur:{...t.backgroundBlur,...a.backgroundBlur}}),"dropShadow"in t&&"dropShadow"in a&&void 0!==a.dropShadow&&Object.assign(t,{dropShadow:{...t.dropShadow,...a.dropShadow}}),"innerShadow"in t&&"innerShadow"in a&&void 0!==a.innerShadow&&Object.assign(t,{innerShadow:{...t.innerShadow,...a.innerShadow}}),t}(t,a),t},g.toOps=function(e,a){let t,i=[];for(let[e,r]of Object.entries(a))"name"!==e&&(void 0===t&&(t={path:[],props:{},type:0},i.push(t)),t.props[e]=r);return i},(b||(b={})).defaultData={...d.defaultData,...f.defaultData,states:new n,events:new n,visible:!0,raycastLock:!1},(y||(y={})).defaultData={...b.defaultData,...p.defaultData},(w||(w={})).defaultData={cornerRadius:[0,0,0,0]},(A||(A={})).defaultData={...y.defaultData,type:"ellipse2d",width:100,height:100,name:"Ellipse"},(D||(D={})).defaultData={...y.defaultData,...w.defaultData,type:"rectangle2d",width:100,height:100,name:"Rectangle"},(v||(v={})).defaultData={...y.defaultData,type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"},(B||(B={})).defaultData={...y.defaultData,type:"path2d",path:"",name:"Path"},(k||(k={})).is=function(e){return"ellipse2d"===e.type||"rectangle2d"===e.type||"text2d"===e.type||"vector2d"===e.type||"path2d"===e.type},(_||(_={})).defaultData={...b.defaultData,name:"Group",type:"group2d"},(z||(z={})).defaultData=()=>({...b.defaultData,...w.defaultData,...p.defaultData,name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:e.fromHexAndA(4737101,1),enabled:!0},stroke:{color:e.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}}),(e=>{e.defaultData=function(e){switch(e){case"rectangle2d":case"vector2d":return{...D.defaultData};case"ellipse2d":return{...A.defaultData};case"text2d":return{...v.defaultData};case"path2d":return{...B.defaultData};case"frame2d":return{...z.defaultData()};case"group2d":return{..._.defaultData}}},e.getPivot=function(e){return"width"in e&&"height"in e?["number"==typeof e.width?.5*e.width:0,"number"==typeof e.height?.5*e.height:0]:[0,0]},e.isResizeable=function(e){return"rectangle2d"===e.type||"ellipse2d"===e.type||"text2d"===e.type||"frame2d"===e.type},e.isAutoLayoutable=function(e){return"frame2d"===e.type&&void 0!==e.autoLayout},e.hasCorners=function(e){return"rectangle2d"===e.type||"frame2d"===e.type}})(S||(S={})),(O=x||(x={})).defaultData={name:"UI",type:"scene2d",objects:new r},O.emptyData=function(){return{type:"scene2d",objects:new r}},(j||(j={})).is=function(e){return e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z},(e=>{e.getControlsWithDefault=function(e,a){let t=[0,0],i=[1,1];if(e?.cubicControls)t=P(e.cubicControls.control1,t);else switch(e?.type){case 2:case 4:t=[.42,0];break;case 3:case 0:t=[0,0];break;case 1:t=[.25,.1];break;case 7:t=[.25,1]}if(a?.cubicControls)i=P(a.cubicControls.control2,i);else switch(a?.type){case 2:case 0:i=[1,1];break;case 3:case 4:i=[.58,1];break;case 1:i=[.25,1];break;case 7:i=[.5,1]}return{control1:t,control2:i}},e.defaultData=function(e,a){return{id:e,name:a,to:5,properties:new n}},e.createMaterialGroup=function(e){let a=new n;return e.forEach(({data:e,id:t,fi:i})=>{if("light"===e.type){let r=M(["material",`${e.category} lighting`],t,i);a.push(r)}else{let r=M(["material",e.type],t,i);a.push(r)}}),a},e.createName=function(e){return Object.entries(e).reduce((e,[a,t])=>("string"!=typeof t&&e.push({name:t.name}),e),[])},e.Presets=[{name:"Slide in",animationParams:{translateX:{value:[-20,0],easing:R(3),duration:1e3},opacity:{value:[0,1],easing:R(3),duration:1e3},endDelay:250,loop:!0}},{name:"Rotate",animationParams:{rotate:{value:[0,"1turn"],easing:R(5),duration:700},endDelay:250,loop:!0}},{name:"Scale Out",animationParams:{scale:{value:[1,1.5],easing:R(4),duration:1e3},endDelay:250,loop:!0}},{name:"Jump",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],endDelay:500,loop:!0}},{name:"Jump Rotate",animationParams:{translateY:[{value:0,duration:200,easing:"linear"},{value:-20,easing:"linear",duration:200},{value:0,easing:"linear",duration:100}],rotate:{value:[0,"1turn"],easing:R(5),duration:500},endDelay:500,loop:!0}},{name:"Bounce",animationParams:{translateY:{value:["20px","-20px"],duration:575,easing:"easeOutQuad"},direction:"alternate",loop:!0}}]})(C||(C={}));var E=["x","y","z"],G=class{constructor(e=1,a=100,t=10,i=0){this.mass=e,this.stiffness=a,this.damping=t,this.initialVelocity=i,this.m_w0=Math.sqrt(a/e),this.m_zeta=t/(2*Math.sqrt(a*e)),this.m_zeta<1?(this.m_wd=this.m_w0*Math.sqrt(1-this.m_zeta*this.m_zeta),this.m_A=1,this.m_B=(this.m_zeta*this.m_w0-i)/this.m_wd):(this.m_wd=0,this.m_A=1,this.m_B=-i+this.m_w0)}solve(e){return 1-(this.m_zeta<1?Math.exp(-e*this.m_zeta*this.m_w0)*(this.m_A*Math.cos(this.m_wd*e)+this.m_B*Math.sin(this.m_wd*e)):(this.m_A+this.m_B*e)*Math.exp(-e*this.m_w0))}getDuration(){let e=.16666666666666666,a=0,t=0;for(;;)if(a+=e,1===this.solve(a)){if(t++,t>=16)break}else t=0;return a*e*1e3}};export{l as a,m as b,D as c,_ as d,S as e,x as f,P as g,R as h,E as i};