@splinetool/runtime 2.0.62 → 2.0.63

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 (267) hide show
  1. package/build/{runtime-chunk-YDJBLHAS.js → runtime-chunk-2JD7RQUT.js} +1 -1
  2. package/build/runtime-chunk-2JD7RQUT.js.br +0 -0
  3. package/build/runtime-chunk-2JD7RQUT.js.gz +0 -0
  4. package/build/{runtime-chunk-CXXEDL4D.js → runtime-chunk-2MJ7PCLB.js} +1 -1
  5. package/build/runtime-chunk-2MJ7PCLB.js.br +0 -0
  6. package/build/runtime-chunk-2MJ7PCLB.js.gz +0 -0
  7. package/build/{runtime-chunk-MLSGRRBI.js → runtime-chunk-462PSYFK.js} +1 -1
  8. package/build/runtime-chunk-462PSYFK.js.br +1 -0
  9. package/build/runtime-chunk-462PSYFK.js.gz +0 -0
  10. package/build/{runtime-chunk-AASXNCLC.js → runtime-chunk-4BGTCDLP.js} +1 -1
  11. package/build/runtime-chunk-4BGTCDLP.js.br +0 -0
  12. package/build/runtime-chunk-4BGTCDLP.js.gz +0 -0
  13. package/build/{runtime-chunk-7GJTQZHN.js → runtime-chunk-BFFQY3CG.js} +1 -1
  14. package/build/runtime-chunk-BFFQY3CG.js.br +0 -0
  15. package/build/runtime-chunk-BFFQY3CG.js.gz +0 -0
  16. package/build/{runtime-chunk-MPHBANVQ.js → runtime-chunk-F4XMOADV.js} +1 -1
  17. package/build/runtime-chunk-F4XMOADV.js.br +0 -0
  18. package/build/runtime-chunk-F4XMOADV.js.gz +0 -0
  19. package/build/runtime-chunk-FNNRPWF7.js +1 -0
  20. package/build/runtime-chunk-FNNRPWF7.js.br +0 -0
  21. package/build/runtime-chunk-FNNRPWF7.js.gz +0 -0
  22. package/build/{runtime-chunk-GUIPUTN7.js → runtime-chunk-HKTFFRM3.js} +1 -1
  23. package/build/runtime-chunk-HKTFFRM3.js.br +0 -0
  24. package/build/runtime-chunk-HKTFFRM3.js.gz +0 -0
  25. package/build/{runtime-chunk-YFK3OQ3S.js → runtime-chunk-IDKFOADO.js} +1 -1
  26. package/build/runtime-chunk-IDKFOADO.js.br +0 -0
  27. package/build/runtime-chunk-IDKFOADO.js.gz +0 -0
  28. package/build/{runtime-chunk-DCHCPETD.js → runtime-chunk-INLZ4T6V.js} +1 -1
  29. package/build/runtime-chunk-INLZ4T6V.js.br +0 -0
  30. package/build/runtime-chunk-INLZ4T6V.js.gz +0 -0
  31. package/build/{runtime-chunk-4BMKE6ES.js → runtime-chunk-ISDQFD3B.js} +1 -1
  32. package/build/runtime-chunk-ISDQFD3B.js.br +0 -0
  33. package/build/runtime-chunk-ISDQFD3B.js.gz +0 -0
  34. package/build/{runtime-chunk-24H3WFTK.js → runtime-chunk-IVETVBB5.js} +1 -1
  35. package/build/runtime-chunk-IVETVBB5.js.br +0 -0
  36. package/build/runtime-chunk-IVETVBB5.js.gz +0 -0
  37. package/build/{runtime-chunk-WIHWNZGM.js → runtime-chunk-JFIELPCR.js} +1 -1
  38. package/build/runtime-chunk-JFIELPCR.js.br +0 -0
  39. package/build/runtime-chunk-JFIELPCR.js.gz +0 -0
  40. package/build/{runtime-chunk-UKC3GXYR.js → runtime-chunk-KGT64R74.js} +1 -1
  41. package/build/runtime-chunk-KGT64R74.js.br +0 -0
  42. package/build/runtime-chunk-KGT64R74.js.gz +0 -0
  43. package/build/{runtime-chunk-AELGHW4P.js → runtime-chunk-MVS4EJZ3.js} +1 -1
  44. package/build/runtime-chunk-MVS4EJZ3.js.br +0 -0
  45. package/build/runtime-chunk-MVS4EJZ3.js.gz +0 -0
  46. package/build/{runtime-chunk-YZOZISIF.js → runtime-chunk-NBPUHLWO.js} +1 -1
  47. package/build/runtime-chunk-NBPUHLWO.js.br +0 -0
  48. package/build/runtime-chunk-NBPUHLWO.js.gz +0 -0
  49. package/build/{runtime-chunk-QEQMFHXP.js → runtime-chunk-NHROOVYJ.js} +1 -1
  50. package/build/runtime-chunk-NHROOVYJ.js.br +0 -0
  51. package/build/runtime-chunk-NHROOVYJ.js.gz +0 -0
  52. package/build/{runtime-chunk-FVFP62G4.js → runtime-chunk-NMNYFTLO.js} +1 -1
  53. package/build/runtime-chunk-NMNYFTLO.js.br +0 -0
  54. package/build/runtime-chunk-NMNYFTLO.js.gz +0 -0
  55. package/build/{runtime-chunk-QZSA6WBT.js → runtime-chunk-OYIE77GW.js} +1 -1
  56. package/build/runtime-chunk-OYIE77GW.js.br +0 -0
  57. package/build/runtime-chunk-OYIE77GW.js.gz +0 -0
  58. package/build/{runtime-chunk-L6BTAFWG.js → runtime-chunk-Q7IYVDLG.js} +1 -1
  59. package/build/runtime-chunk-Q7IYVDLG.js.br +0 -0
  60. package/build/runtime-chunk-Q7IYVDLG.js.gz +0 -0
  61. package/build/{runtime-chunk-IIHOKKLP.js → runtime-chunk-SKYMJ662.js} +1 -1
  62. package/build/runtime-chunk-SKYMJ662.js.br +0 -0
  63. package/build/runtime-chunk-SKYMJ662.js.gz +0 -0
  64. package/build/{runtime-chunk-N4O4HFFU.js → runtime-chunk-U4SSOL4Z.js} +1 -1
  65. package/build/runtime-chunk-U4SSOL4Z.js.br +0 -0
  66. package/build/runtime-chunk-U4SSOL4Z.js.gz +0 -0
  67. package/build/{runtime-chunk-XXDRC64C.js → runtime-chunk-WCFTACIP.js} +1 -1
  68. package/build/runtime-chunk-WCFTACIP.js.br +0 -0
  69. package/build/runtime-chunk-WCFTACIP.js.gz +0 -0
  70. package/build/{runtime-chunk-G5CDJ5A2.js → runtime-chunk-WLH55Q7G.js} +1 -1
  71. package/build/runtime-chunk-WLH55Q7G.js.br +0 -0
  72. package/build/runtime-chunk-WLH55Q7G.js.gz +0 -0
  73. package/build/{runtime-chunk-WPORMQ43.js → runtime-chunk-WNPU65HI.js} +1 -1
  74. package/build/runtime-chunk-WNPU65HI.js.br +0 -0
  75. package/build/runtime-chunk-WNPU65HI.js.gz +0 -0
  76. package/build/{runtime-classicRuntime-DOC667AS.js → runtime-classicRuntime-36WWMRVL.js} +1 -1
  77. package/build/runtime-classicRuntime-36WWMRVL.js.br +0 -0
  78. package/build/runtime-classicRuntime-36WWMRVL.js.gz +0 -0
  79. package/build/{runtime-cloners-XTTGDCQH.js → runtime-cloners-7VQZGKRO.js} +1 -1
  80. package/build/runtime-cloners-7VQZGKRO.js.br +0 -0
  81. package/build/runtime-cloners-7VQZGKRO.js.gz +0 -0
  82. package/build/{runtime-components-OQZNW7GX.js → runtime-components-Q4ZHSM3G.js} +1 -1
  83. package/build/runtime-components-Q4ZHSM3G.js.br +0 -0
  84. package/build/runtime-components-Q4ZHSM3G.js.gz +0 -0
  85. package/build/{runtime-createDestroy-GD7OF7E7.js → runtime-createDestroy-H2L4DV2Q.js} +1 -1
  86. package/build/runtime-createDestroy-H2L4DV2Q.js.br +0 -0
  87. package/build/runtime-createDestroy-H2L4DV2Q.js.gz +0 -0
  88. package/build/{runtime-dragDrop-GZC5GEI3.js → runtime-dragDrop-TMCWI4AX.js} +1 -1
  89. package/build/runtime-dragDrop-TMCWI4AX.js.br +0 -0
  90. package/build/runtime-dragDrop-TMCWI4AX.js.gz +0 -0
  91. package/build/{runtime-gameControls-AB4FKVHF.js → runtime-gameControls-K3EET7EB.js} +1 -1
  92. package/build/runtime-gameControls-K3EET7EB.js.br +0 -0
  93. package/build/runtime-gameControls-K3EET7EB.js.gz +0 -0
  94. package/build/{runtime-hair-32VUKQJV.js → runtime-hair-UNCJEHMZ.js} +1 -1
  95. package/build/runtime-hair-UNCJEHMZ.js.br +2 -0
  96. package/build/runtime-hair-UNCJEHMZ.js.gz +0 -0
  97. package/build/{runtime-mergeStaticGeometries-CW7DRGM4.js → runtime-mergeStaticGeometries-U6HXCKAF.js} +1 -1
  98. package/build/runtime-mergeStaticGeometries-U6HXCKAF.js.br +0 -0
  99. package/build/runtime-mergeStaticGeometries-U6HXCKAF.js.gz +0 -0
  100. package/build/{runtime-miscActions-UNNG55JX.js → runtime-miscActions-MIHRP2IA.js} +1 -1
  101. package/build/runtime-miscActions-MIHRP2IA.js.br +0 -0
  102. package/build/runtime-miscActions-MIHRP2IA.js.gz +0 -0
  103. package/build/{runtime-mouseHover-VQCDWUJM.js → runtime-mouseHover-O7UOREGV.js} +1 -1
  104. package/build/runtime-mouseHover-O7UOREGV.js.br +0 -0
  105. package/build/runtime-mouseHover-O7UOREGV.js.gz +0 -0
  106. package/build/{runtime-particles-OAV5RWDA.js → runtime-particles-TNUIYZTS.js} +1 -1
  107. package/build/runtime-particles-TNUIYZTS.js.br +0 -0
  108. package/build/runtime-particles-TNUIYZTS.js.gz +0 -0
  109. package/build/{runtime-paths-3EGLFCCN.js → runtime-paths-BWFGUOH6.js} +1 -1
  110. package/build/runtime-paths-BWFGUOH6.js.br +0 -0
  111. package/build/runtime-paths-BWFGUOH6.js.gz +0 -0
  112. package/build/{runtime-resize-K3R7V2A3.js → runtime-resize-62A3W2SA.js} +1 -1
  113. package/build/runtime-resize-62A3W2SA.js.br +0 -0
  114. package/build/runtime-resize-62A3W2SA.js.gz +0 -0
  115. package/build/{runtime-sceneTransition-E3VERGJC.js → runtime-sceneTransition-3YMHQAIS.js} +1 -1
  116. package/build/runtime-sceneTransition-3YMHQAIS.js.br +0 -0
  117. package/build/runtime-sceneTransition-3YMHQAIS.js.gz +0 -0
  118. package/build/{runtime-scroll-RH7RUN3F.js → runtime-scroll-LRDQXDHP.js} +1 -1
  119. package/build/runtime-scroll-LRDQXDHP.js.br +0 -0
  120. package/build/runtime-scroll-LRDQXDHP.js.gz +0 -0
  121. package/build/runtime-shapeBlends-3GG2WNW2.js +1 -0
  122. package/build/runtime-shapeBlends-3GG2WNW2.js.br +2 -0
  123. package/build/runtime-shapeBlends-3GG2WNW2.js.gz +0 -0
  124. package/build/{runtime-text-M4YX657N.js → runtime-text-IYSXDHOW.js} +1 -1
  125. package/build/runtime-text-IYSXDHOW.js.br +0 -0
  126. package/build/runtime-text-IYSXDHOW.js.gz +0 -0
  127. package/build/{runtime-textInputs-SJB42NO3.js → runtime-textInputs-QAX5AYI7.js} +1 -1
  128. package/build/runtime-textInputs-QAX5AYI7.js.br +0 -0
  129. package/build/runtime-textInputs-QAX5AYI7.js.gz +0 -0
  130. package/build/{runtime-timeline-WII5EDYV.js → runtime-timeline-5ZWFKEVA.js} +1 -1
  131. package/build/runtime-timeline-5ZWFKEVA.js.br +0 -0
  132. package/build/runtime-timeline-5ZWFKEVA.js.gz +0 -0
  133. package/build/{runtime-tracking-PQDPSVNJ.js → runtime-tracking-4ZBAGCUN.js} +1 -1
  134. package/build/runtime-tracking-4ZBAGCUN.js.br +0 -0
  135. package/build/runtime-tracking-4ZBAGCUN.js.gz +0 -0
  136. package/build/{runtime-transitions-JHTBNVJX.js → runtime-transitions-LHIFZQV6.js} +1 -1
  137. package/build/runtime-transitions-LHIFZQV6.js.br +0 -0
  138. package/build/runtime-transitions-LHIFZQV6.js.gz +0 -0
  139. package/build/{runtime-ui2d-ATOCKBMJ.js → runtime-ui2d-MAIQOS5J.js} +1 -1
  140. package/build/runtime-ui2d-MAIQOS5J.js.br +0 -0
  141. package/build/runtime-ui2d-MAIQOS5J.js.gz +0 -0
  142. package/build/{runtime-vectorShapes-7ZXGKNXC.js → runtime-vectorShapes-6DZHHP7B.js} +1 -1
  143. package/build/runtime-vectorShapes-6DZHHP7B.js.br +0 -0
  144. package/build/runtime-vectorShapes-6DZHHP7B.js.gz +0 -0
  145. package/build/{runtime-webgpu-2SQXM6FH.js → runtime-webgpu-TV56PJIX.js} +1 -1
  146. package/build/runtime-webgpu-TV56PJIX.js.br +0 -0
  147. package/build/runtime-webgpu-TV56PJIX.js.gz +0 -0
  148. package/build/runtime.cjs +37 -37
  149. package/build/runtime.js +1 -1
  150. package/build/runtime.js.br +0 -0
  151. package/build/runtime.js.gz +0 -0
  152. package/build/runtime.standalone.js +1 -1
  153. package/build/runtime.standalone.js.br +0 -0
  154. package/build/runtime.standalone.js.gz +0 -0
  155. package/build/runtime.standalone.webgl.js +1 -1
  156. package/build/runtime.standalone.webgl.js.br +0 -0
  157. package/build/runtime.standalone.webgl.js.gz +0 -0
  158. package/build/runtime.standalone.webgpu.js +1 -1
  159. package/build/runtime.standalone.webgpu.js.br +0 -0
  160. package/build/runtime.standalone.webgpu.js.gz +0 -0
  161. package/build/runtime.standalone.webgpu.micro.js +1 -1
  162. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  163. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  164. package/build/runtime.standalone.webgpu.min.js +1 -1
  165. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  166. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  167. package/package.json +1 -1
  168. package/build/runtime-chunk-24H3WFTK.js.br +0 -0
  169. package/build/runtime-chunk-24H3WFTK.js.gz +0 -0
  170. package/build/runtime-chunk-4BMKE6ES.js.br +0 -0
  171. package/build/runtime-chunk-4BMKE6ES.js.gz +0 -0
  172. package/build/runtime-chunk-7GJTQZHN.js.br +0 -0
  173. package/build/runtime-chunk-7GJTQZHN.js.gz +0 -0
  174. package/build/runtime-chunk-AASXNCLC.js.br +0 -0
  175. package/build/runtime-chunk-AASXNCLC.js.gz +0 -0
  176. package/build/runtime-chunk-AELGHW4P.js.br +0 -0
  177. package/build/runtime-chunk-AELGHW4P.js.gz +0 -0
  178. package/build/runtime-chunk-CXXEDL4D.js.br +0 -0
  179. package/build/runtime-chunk-CXXEDL4D.js.gz +0 -0
  180. package/build/runtime-chunk-DCHCPETD.js.br +0 -0
  181. package/build/runtime-chunk-DCHCPETD.js.gz +0 -0
  182. package/build/runtime-chunk-FVFP62G4.js.br +0 -0
  183. package/build/runtime-chunk-FVFP62G4.js.gz +0 -0
  184. package/build/runtime-chunk-G5CDJ5A2.js.br +0 -0
  185. package/build/runtime-chunk-G5CDJ5A2.js.gz +0 -0
  186. package/build/runtime-chunk-GUIPUTN7.js.br +0 -0
  187. package/build/runtime-chunk-GUIPUTN7.js.gz +0 -0
  188. package/build/runtime-chunk-IIHOKKLP.js.br +0 -0
  189. package/build/runtime-chunk-IIHOKKLP.js.gz +0 -0
  190. package/build/runtime-chunk-KG3PGFA5.js +0 -1
  191. package/build/runtime-chunk-KG3PGFA5.js.br +0 -0
  192. package/build/runtime-chunk-KG3PGFA5.js.gz +0 -0
  193. package/build/runtime-chunk-L6BTAFWG.js.br +0 -0
  194. package/build/runtime-chunk-L6BTAFWG.js.gz +0 -0
  195. package/build/runtime-chunk-MLSGRRBI.js.br +0 -0
  196. package/build/runtime-chunk-MLSGRRBI.js.gz +0 -0
  197. package/build/runtime-chunk-MPHBANVQ.js.br +0 -0
  198. package/build/runtime-chunk-MPHBANVQ.js.gz +0 -0
  199. package/build/runtime-chunk-N4O4HFFU.js.br +0 -0
  200. package/build/runtime-chunk-N4O4HFFU.js.gz +0 -0
  201. package/build/runtime-chunk-QEQMFHXP.js.br +0 -0
  202. package/build/runtime-chunk-QEQMFHXP.js.gz +0 -0
  203. package/build/runtime-chunk-QZSA6WBT.js.br +0 -0
  204. package/build/runtime-chunk-QZSA6WBT.js.gz +0 -0
  205. package/build/runtime-chunk-UKC3GXYR.js.br +0 -0
  206. package/build/runtime-chunk-UKC3GXYR.js.gz +0 -0
  207. package/build/runtime-chunk-WIHWNZGM.js.br +0 -0
  208. package/build/runtime-chunk-WIHWNZGM.js.gz +0 -0
  209. package/build/runtime-chunk-WPORMQ43.js.br +0 -0
  210. package/build/runtime-chunk-WPORMQ43.js.gz +0 -0
  211. package/build/runtime-chunk-XXDRC64C.js.br +0 -0
  212. package/build/runtime-chunk-XXDRC64C.js.gz +0 -0
  213. package/build/runtime-chunk-YDJBLHAS.js.br +0 -0
  214. package/build/runtime-chunk-YDJBLHAS.js.gz +0 -0
  215. package/build/runtime-chunk-YFK3OQ3S.js.br +0 -0
  216. package/build/runtime-chunk-YFK3OQ3S.js.gz +0 -0
  217. package/build/runtime-chunk-YZOZISIF.js.br +0 -0
  218. package/build/runtime-chunk-YZOZISIF.js.gz +0 -0
  219. package/build/runtime-classicRuntime-DOC667AS.js.br +0 -0
  220. package/build/runtime-classicRuntime-DOC667AS.js.gz +0 -0
  221. package/build/runtime-cloners-XTTGDCQH.js.br +0 -0
  222. package/build/runtime-cloners-XTTGDCQH.js.gz +0 -0
  223. package/build/runtime-components-OQZNW7GX.js.br +0 -0
  224. package/build/runtime-components-OQZNW7GX.js.gz +0 -0
  225. package/build/runtime-createDestroy-GD7OF7E7.js.br +0 -0
  226. package/build/runtime-createDestroy-GD7OF7E7.js.gz +0 -0
  227. package/build/runtime-dragDrop-GZC5GEI3.js.br +0 -0
  228. package/build/runtime-dragDrop-GZC5GEI3.js.gz +0 -0
  229. package/build/runtime-gameControls-AB4FKVHF.js.br +0 -0
  230. package/build/runtime-gameControls-AB4FKVHF.js.gz +0 -0
  231. package/build/runtime-hair-32VUKQJV.js.br +0 -2
  232. package/build/runtime-hair-32VUKQJV.js.gz +0 -0
  233. package/build/runtime-mergeStaticGeometries-CW7DRGM4.js.br +0 -0
  234. package/build/runtime-mergeStaticGeometries-CW7DRGM4.js.gz +0 -0
  235. package/build/runtime-miscActions-UNNG55JX.js.br +0 -0
  236. package/build/runtime-miscActions-UNNG55JX.js.gz +0 -0
  237. package/build/runtime-mouseHover-VQCDWUJM.js.br +0 -0
  238. package/build/runtime-mouseHover-VQCDWUJM.js.gz +0 -0
  239. package/build/runtime-particles-OAV5RWDA.js.br +0 -0
  240. package/build/runtime-particles-OAV5RWDA.js.gz +0 -0
  241. package/build/runtime-paths-3EGLFCCN.js.br +0 -0
  242. package/build/runtime-paths-3EGLFCCN.js.gz +0 -0
  243. package/build/runtime-resize-K3R7V2A3.js.br +0 -0
  244. package/build/runtime-resize-K3R7V2A3.js.gz +0 -0
  245. package/build/runtime-sceneTransition-E3VERGJC.js.br +0 -0
  246. package/build/runtime-sceneTransition-E3VERGJC.js.gz +0 -0
  247. package/build/runtime-scroll-RH7RUN3F.js.br +0 -0
  248. package/build/runtime-scroll-RH7RUN3F.js.gz +0 -0
  249. package/build/runtime-shapeBlends-TI6ZZTFP.js +0 -1
  250. package/build/runtime-shapeBlends-TI6ZZTFP.js.br +0 -0
  251. package/build/runtime-shapeBlends-TI6ZZTFP.js.gz +0 -0
  252. package/build/runtime-text-M4YX657N.js.br +0 -0
  253. package/build/runtime-text-M4YX657N.js.gz +0 -0
  254. package/build/runtime-textInputs-SJB42NO3.js.br +0 -0
  255. package/build/runtime-textInputs-SJB42NO3.js.gz +0 -0
  256. package/build/runtime-timeline-WII5EDYV.js.br +0 -0
  257. package/build/runtime-timeline-WII5EDYV.js.gz +0 -0
  258. package/build/runtime-tracking-PQDPSVNJ.js.br +0 -0
  259. package/build/runtime-tracking-PQDPSVNJ.js.gz +0 -0
  260. package/build/runtime-transitions-JHTBNVJX.js.br +0 -0
  261. package/build/runtime-transitions-JHTBNVJX.js.gz +0 -0
  262. package/build/runtime-ui2d-ATOCKBMJ.js.br +0 -0
  263. package/build/runtime-ui2d-ATOCKBMJ.js.gz +0 -0
  264. package/build/runtime-vectorShapes-7ZXGKNXC.js.br +0 -0
  265. package/build/runtime-vectorShapes-7ZXGKNXC.js.gz +0 -0
  266. package/build/runtime-webgpu-2SQXM6FH.js.br +0 -0
  267. package/build/runtime-webgpu-2SQXM6FH.js.gz +0 -0
@@ -1 +1 @@
1
- import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Aa as r,Ba as s,C as a,Da as n,J as o,i as l,j as h,k as p,n as d}from"./runtime-chunk-K3UQCG3P.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-BVVSZMXD.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function O(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var V=new f,W=new f,_=new g,R=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],T=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],U=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=(t,e,i)=>{t.updateEntityBoxSize(V,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(_)):R.forEach(t=>{i.push(t.clone().multiply(W).add(V).applyMatrix4(_))})},z=class extends M{constructor(){super(...arguments),this.matrix=new g,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));L(t,e,r)}}),0===r.length&&r.push(...i)}else L(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(W).multiplyScalar(.5),this.getCenter(V),_.copy(this.matrix).setPosition(V),this.vertices=R.map(t=>t.clone().multiply(W).applyMatrix4(_))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=T.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=U.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},I=new f,F=new f,N=new f,j=new f,k=new f,q=new f,G=new g,H=1e-12,X=.01;function Z(t){let e=t.elements;I.set(e[0],e[1],e[2]),F.set(e[4],e[5],e[6]),N.set(e[8],e[9],e[10])}function K(){let t=Math.max(I.lengthSq(),F.lengthSq(),N.lengthSq());I.lengthSq()>H*t?j.copy(I).normalize():j.set(1,0,0),k.crossVectors(N,j),k.lengthSq()<=H*t&&(k.copy(F).addScaledVector(j,-F.dot(j)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,j)),k.normalize(),q.crossVectors(j,k)}function Q(t){return Z(t),K(),G.makeBasis(j,k,q)}var $,J=new g;($||($={})).is=function(t){return t&&t.__isSPEObject};var Y=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(J.copy(this.parent.matrixWorld).invert()),t.premultiply(J.copy(this.hiddenMatrix).invert()),t.multiply(J.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}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)}traverseChildren(t,e=0){for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return Z(t),K(),e.makeBasis(j,k,q),i.set(j.dot(I),j.dot(F),j.dot(N),0,k.dot(I),k.dot(F),k.dot(N),0,q.dot(I),q.dot(F),q.dot(N),0,0,0,0,1),function(){let t=I.length(),e=F.length(),i=N.length(),r=Math.max(t,e,i);if(r-t>X||r-e>X||r-i>X)return!0;let s=X*r*r;return Math.abs(I.dot(F))>s||Math.abs(I.dot(N))>s||Math.abs(F.dot(N))>s}()}(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct=new WeakMap;function ut(t){let e=ct.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ct.set(t.points,{isClosed:t.isClosed,curve:i}),i}var mt,ft=new g,yt=new m,gt=new m,vt=new v,xt=new f,St=new f(0,1,0);(mt||(mt={})).is=function(t){return t&&t.__isEntity};var wt=t=>mt.is(t),Mt={type:"completeState",isfromEntity:!0},bt=["x","y","z"],Bt=new f,Pt=new f(1,1,1),Et=new m,At=new v,Ct=new g,Dt=c=>class extends(Y(c)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(mt.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(mt.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!mt.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=h.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{wt(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(mt.is(e[i]))return e[i];if(mt.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&mt.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)wt(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{mt.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)wt(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>wt(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,bt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(Bt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(Bt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??a.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(Bt.fromArray(t.pivot).negate(),Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),Pt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=Bt.setFromMatrixPosition(this.pivotMatrix);Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,Et,Pt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)mt.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{mt.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,a){let o=this.data;this.data=e;let h=t,c=O(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),O(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;if(0===t.path.length&&0===t.type){let e;for(let i of s.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of s.rootOverrideProps)if(O(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)mt.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==O(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==O(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=ut(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?Ct.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix):Ct.copy(this.hiddenMatrix),d=function(t,e,i,r){yt.setFromRotationMatrix(ft.extractRotation(r));let s=t.clone().applyMatrix4(ft.copy(r).invert().multiply(i));if(null===e)gt.setFromRotationMatrix(ft.extractRotation(i));else{let t=e.clone().applyMatrix4(ft.extractRotation(i));gt.setFromRotationMatrix(ft.lookAt(xt.set(0,0,0),t,St))}return{position:s,rotation:(new f).setFromEuler(vt.setFromQuaternion(yt.invert().multiply(gt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(Mt)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(t=>e(t)&&"toObject"===t.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},Ot=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Tt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Vt=new c([0,0,0],1);function Wt(t){return"TorusGeometry"===t.type&&360===t.arc}var _t,Rt,Tt=class extends P{constructor(t=!0,e=1,i=1,r=1,s=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),V=M(),W=M(),_=M(),R=M(),T=M(),U=i-2*o+.001,L=U/a,z=Math.ceil(n*a),I=z+1,F=U/z,N=-U/2,j=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,X=0,Z=2*d+2,K=j*Z/2,Q=K+j*I,$=Math.max(0,j*(I+Z)),[J,Y,tt]=[3,3,2].map(t=>Array($*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*F,w=2*Math.PI*(x%L)/L+r,x+=N,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*z+2*at,ot=G,lt=nt-at;for(let e=0;e<=z;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),R.crossVectors(T,_).normalize();let i=0===e,r=e===z,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:Q,l=i?0:$-j,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(R).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(X=l+t,[0,1,2].forEach(t=>{J[3*X+t]=p.getComponent(t),Y[3*X+t]=u.getComponent(t)}),tt[2*X]=+r,tt[2*X+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(B.copy(T).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),X=n+e*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=W.getComponent(t)});let o=+i+Math.sin(r);tt[2*X]=(a+H*o)/nt,tt[2*X+1]=t/h}}P.addVectors(E,D),X=K+e*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=O.getComponent(t)}),tt[2*X]=(at+e*st)/nt,tt[2*X+1]=t/h}}let ht=I+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b(J,3)),this.setAttribute("normal",new b(Y,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return Vt.array=new Uint32Array(l),Vt.count=l.length,Vt}},Ut=new Map,Lt=0;function zt(t){return Rt||(Rt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.62/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),_t=r}())}function It(){if(void 0===_t)throw new Error("boolean-wasm is not loaded");return _t}function Ft(t){let e=Ut.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Nt(t){return Ut.set(++Lt,t),Lt}var jt={0:0,1:1,2:2};function kt(t,e,i){if(void 0===_t)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Wt(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return Nt(new _t.CsgMesh(r,s,a))}function qt(t,e){let i=It(),r=jt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Ft);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Gt(t,e,i,r){let s=It(),a=qt(t,e),n=s.mesh_render_data(a,Math.max(r,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new B),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return Nt(a)}function Ht(t,e){let i=It(),r=qt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function Xt(t,e){Ft(t).transform(new Float32Array(e.elements))}function Zt(t){let e=Ut.get(t);void 0!==e&&(e.free(),Ut.delete(t))}function Kt(t,e){return Nt(It().instanced_union(Ft(t),e))}function Qt(t){return null!==t&&"booleanOp"in t}var $t=class extends(Dt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Qt(this.parent)&&this.visible,Qt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Qt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Qt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof $t&&(t.freeBooleanPointer(),Qt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Jt=new M;function Yt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Jt.min.set(a,n,o),Jt.max.set(l,h,p),Jt.getCenter(r),Jt.getSize(s).multiplyScalar(.5)}var te=new P,ee=new E,ie=class extends $t{constructor(t,e){super(te,ee),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Yt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,O as b,C as c,Q as d,$ as e,Y as f,ut as g,mt as h,wt as i,Dt as j,Ot as k,Wt as l,Tt as m,zt as n,kt as o,Gt as p,Ht as q,Xt as r,Zt as s,Kt as t,Yt as u,ie as v};
1
+ import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Aa as r,Ba as s,C as a,Da as n,J as o,i as l,j as h,k as p,n as d}from"./runtime-chunk-K3UQCG3P.js";import{$c as c,Cc as u,Ec as m,Fc as f,Kd as y,Oc as g,Pc as v,Pd as x,Rc as S,Re as w,Xc as M,bd as b,cd as B,dd as P,kd as E,ld as A}from"./runtime-chunk-BVVSZMXD.js";var C={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function D(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function O(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var V=new f,W=new f,_=new g,R=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],T=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],U=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],L=(t,e,i)=>{t.updateEntityBoxSize(V,W),_.copy(e).multiply(t.matrixWorld),0===W.x&&0===W.y&&0===W.z?i.push(new f(V.x,V.y,V.z).applyMatrix4(_)):R.forEach(t=>{i.push(t.clone().multiply(W).add(V).applyMatrix4(_))})},z=class extends M{constructor(){super(...arguments),this.matrix=new g,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new g).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return _.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(_));L(t,e,r)}}),0===r.length&&r.push(...i)}else L(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(_.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(W).multiplyScalar(.5),this.getCenter(V),_.copy(this.matrix).setPosition(V),this.vertices=R.map(t=>t.clone().multiply(W).applyMatrix4(_))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=T.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=U.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},I=new f,F=new f,N=new f,j=new f,k=new f,q=new f,G=new g,H=1e-12,X=.01;function Z(t){let e=t.elements;I.set(e[0],e[1],e[2]),F.set(e[4],e[5],e[6]),N.set(e[8],e[9],e[10])}function K(){let t=Math.max(I.lengthSq(),F.lengthSq(),N.lengthSq());I.lengthSq()>H*t?j.copy(I).normalize():j.set(1,0,0),k.crossVectors(N,j),k.lengthSq()<=H*t&&(k.copy(F).addScaledVector(j,-F.dot(j)),k.lengthSq()<=H*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=H&&t.set(0,1,0).cross(e),t.normalize()}(k,j)),k.normalize(),q.crossVectors(j,k)}function Q(t){return Z(t),K(),G.makeBasis(j,k,q)}var $,J=new g;($||($={})).is=function(t){return t&&t.__isSPEObject};var Y=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new g,this.copyPreviousMatrix=!0,this.hiddenMatrix=new g,this.pivotMatrix=new g,this.matrixWorldRigid=new g,this.shearScale=new g,this.shearScaleInv=new g}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(J.copy(this.parent.matrixWorld).invert()),t.premultiply(J.copy(this.hiddenMatrix).invert()),t.multiply(J.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}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)}traverseChildren(t,e=0){for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)$.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return Z(t),K(),e.makeBasis(j,k,q),i.set(j.dot(I),j.dot(F),j.dot(N),0,k.dot(I),k.dot(F),k.dot(N),0,q.dot(I),q.dot(F),q.dot(N),0,0,0,0,1),function(){let t=I.length(),e=F.length(),i=N.length(),r=Math.max(t,e,i);if(r-t>X||r-e>X||r-i>X)return!0;let s=X*r*r;return Math.abs(I.dot(F))>s||Math.abs(I.dot(N))>s||Math.abs(F.dot(N))>s}()}(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new g).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof g?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},tt=class extends x{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},et=.001,it=new f,rt=new f,st=new f,at=new f,nt=new f,ot=new f,lt=new f,ht=new f,pt=new f;function dt(t,e,i){return it.subVectors(e,t),rt.subVectors(e,i),it.cross(rt).length()<=et}var ct=new WeakMap;function ut(t){let e=ct.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],r=[new f(...e[0].data.position)];st.copy(r[0]);for(let t=0;t<e.length-1;t++)it.fromArray(e[t].data.position),rt.fromArray(e[t+1].data.position),nt.subVectors(it,st),lt.subVectors(it,rt),nt.cross(lt).length()>et&&(i.push(e[t]),r.push((new f).copy(it)),st.copy(it));let s=e[e.length-1];i.push(s),r.push(new f(...s.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(dt(r[t],h[t],r[e])&&dt(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){at.addVectors(m,y).normalize();let t=st.crossVectors(at,m).length()/m.dot(at);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(st.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(st.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>et&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>et&&(s=new y(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;at.addVectors(e.prevDir,e.nextDir).normalize(),nt.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;pt.copy(at).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(nt),ot.copy(at).multiplyScalar(-a).add(pt);let o=i.distanceTo(ot)/i.distanceTo(nt);lt.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),ht.copy(lt).lerp(ot,2);let l=r.clone().lerp(lt,4/3),h=s.clone().lerp(ht,4/3);c[2*t]=new y(r,l,h,s)}let u=new tt;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return ct.set(t.points,{isClosed:t.isClosed,curve:i}),i}var mt,ft=new g,yt=new m,gt=new m,vt=new v,xt=new f,St=new f(0,1,0);(mt||(mt={})).is=function(t){return t&&t.__isEntity};var wt=t=>mt.is(t),Mt={type:"completeState",isfromEntity:!0},bt=["x","y","z"],Bt=new f,Pt=new f(1,1,1),Et=new m,At=new v,Ct=new g,Dt=c=>class extends(Y(c)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(mt.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(mt.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!mt.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)n.toOps(this.data,t.data).forEach(t=>{let i=h.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=n.patch(this.data,i),n.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{wt(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(mt.is(e[i]))return e[i];if(mt.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&mt.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)wt(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{mt.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)wt(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)wt(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>wt(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,bt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(Bt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(Bt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??a.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(Bt.fromArray(t.pivot).negate(),Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),Pt);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=Bt.setFromMatrixPosition(this.pivotMatrix);Et.setFromEuler(At.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,Et,Pt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)mt.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{mt.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,a){let o=this.data;this.data=e;let h=t,c=O(t.path,["states","*"]);if(null!==c){if(0===t.type){let[e]=c;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=d.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}h={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=d.removeOverridden(t.path,t.props,e);h={...t,props:i}}}if(this.updateByPatchedOpBase(h,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),O(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(l.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);if(n){let o=d.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=r.resolve(e.overrides,s),n.updateByOp(t,p.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;if(0===t.path.length&&0===t.type){let e;for(let i of s.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of s.rootOverrideProps)if(O(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=l.filterOp(t.overrideData,r);e&&t.updateByOp(e,p.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=l.filterOp(r.overrideData,t);if(s){let a;a=o===r.data&&t===s?e:p.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)mt.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==O(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==O(t.path,["cloner"])){let r=p.drop(t,1);0===r.path.length&&0===r.type&&!0===r.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=ut(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?Ct.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix):Ct.copy(this.hiddenMatrix),d=function(t,e,i,r){yt.setFromRotationMatrix(ft.extractRotation(r));let s=t.clone().applyMatrix4(ft.copy(r).invert().multiply(i));if(null===e)gt.setFromRotationMatrix(ft.extractRotation(i));else{let t=e.clone().applyMatrix4(ft.extractRotation(i));gt.setFromRotationMatrix(ft.lookAt(xt.set(0,0,0),t,St))}return{position:s,rotation:(new f).setFromEuler(vt.setFromQuaternion(yt.invert().multiply(gt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(Mt)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(t=>e(t)&&"toObject"===t.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},Ot=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Tt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Vt=new c([0,0,0],1);function Wt(t){return"TorusGeometry"===t.type&&360===t.arc}var _t,Rt,Tt=class extends P{constructor(t=!0,e=1,i=1,r=1,s=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,y,g,v,x,S,w,M=()=>new f,B=new f,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),V=M(),W=M(),_=M(),R=M(),T=M(),U=i-2*o+.001,L=U/a,z=Math.ceil(n*a),I=z+1,F=U/z,N=-U/2,j=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,X=0,Z=2*d+2,K=j*Z/2,Q=K+j*I,$=Math.max(0,j*(I+Z)),[J,Y,tt]=[3,3,2].map(t=>Array($*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*F,w=2*Math.PI*(x%L)/L+r,x+=N,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(B,-1e-10),rt(P,0),C.copy(B),rt(B,1);let st=B.distanceTo(P),at=c?0:H+G,nt=st*z+2*at,ot=G,lt=nt-at;for(let e=0;e<=z;e++){rt(E,e),T.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),R.crossVectors(T,_).normalize();let i=0===e,r=e===z,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?j:Q,l=i?0:$-j,p=T.clone().multiplyScalar(i?-H:H).add(E),u=T.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(D.addVectors(B.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(R).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(X=l+t,[0,1,2].forEach(t=>{J[3*X+t]=p.getComponent(t),Y[3*X+t]=u.getComponent(t)}),tt[2*X]=+r,tt[2*X+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(B.copy(T).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),X=n+e*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=W.getComponent(t)});let o=+i+Math.sin(r);tt[2*X]=(a+H*o)/nt,tt[2*X+1]=t/h}}P.addVectors(E,D),X=K+e*j+t,[0,1,2].forEach(t=>{J[3*X+t]=P.getComponent(t),Y[3*X+t]=O.getComponent(t)}),tt[2*X]=(at+e*st)/nt,tt[2*X+1]=t/h}}let ht=I+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,g=(e?i+1:m)+j,0===t?et.push(m,g,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,g,y)}this.setIndex(et),this.setAttribute("position",new b(J,3)),this.setAttribute("normal",new b(Y,3)),this.setAttribute("uv",new b(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return Vt.array=new Uint32Array(l),Vt.count=l.length,Vt}},Ut=new Map,Lt=0;function zt(t){return Rt||(Rt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.63/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),_t=r}())}function It(){if(void 0===_t)throw new Error("boolean-wasm is not loaded");return _t}function Ft(t){let e=Ut.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Nt(t){return Ut.set(++Lt,t),Lt}var jt={0:0,1:1,2:2};function kt(t,e,i){if(void 0===_t)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Wt(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return Nt(new _t.CsgMesh(r,s,a))}function qt(t,e){let i=It(),r=jt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(Ft);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Gt(t,e,i,r){let s=It(),a=qt(t,e),n=s.mesh_render_data(a,Math.max(r,0));if(i.setAttribute("position",new b(n.positions(),3)),i.setAttribute("normal",new b(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new B),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return Nt(a)}function Ht(t,e){let i=It(),r=qt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function Xt(t,e){Ft(t).transform(new Float32Array(e.elements))}function Zt(t){let e=Ut.get(t);void 0!==e&&(e.free(),Ut.delete(t))}function Kt(t,e){return Nt(It().instanced_union(Ft(t),e))}function Qt(t){return null!==t&&"booleanOp"in t}var $t=class extends(Dt(A)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new g}updateVisible(t){super.updateVisible(t),this.visible=!Qt(this.parent)&&this.visible,Qt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Qt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(Zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Qt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof $t&&(t.freeBooleanPointer(),Qt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Qt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Jt=new M;function Yt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Jt.min.set(a,n,o),Jt.max.set(l,h,p),Jt.getCenter(r),Jt.getSize(s).multiplyScalar(.5)}var te=new P,ee=new E,ie=class extends $t{constructor(t,e){super(te,ee),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Yt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{D as a,O as b,C as c,Q as d,$ as e,Y as f,ut as g,mt as h,wt as i,Dt as j,Ot as k,Wt as l,Tt as m,zt as n,kt as o,Gt as p,Ht as q,Xt as r,Zt as s,Kt as t,Yt as u,ie as v};
@@ -0,0 +1 @@
1
+ import{e,g as t,j as r}from"./runtime-chunk-WNPU65HI.js";import{a,b as n}from"./runtime-chunk-HD7WF3XN.js";import{c as i,e as s,f as o}from"./runtime-chunk-IVETVBB5.js";import{a as l}from"./runtime-chunk-ISDQFD3B.js";import{b as u}from"./runtime-chunk-4BGTCDLP.js";import{Y as d,aa as c,ba as p,ha as h,i as f,ia as g}from"./runtime-chunk-OYIE77GW.js";import{v as m}from"./runtime-chunk-F4XMOADV.js";import{d as b,e as y}from"./runtime-chunk-RTLL6WIB.js";import{c as v,d as w,e as S}from"./runtime-chunk-2PT2WH66.js";import{A as j,B as V,G as A,H as D,M,N as R,O as k,P as x,Q as E,R as O,ca as B,la as C,oa as P,z as G}from"./runtime-chunk-K3UQCG3P.js";import{Cc as N,Dc as I,Ec as F,Fc as z,Oc as T,Pc as q,Tc as W}from"./runtime-chunk-BVVSZMXD.js";var L=Math.fround,U=[.01,100],H=[.01,1e4],Q=[.01,1e3],X=[.01,1e3];function Y(e,[t,r]){return Math.min(Math.max(e,t),r)}function K(e,t,r,a,n){e=Y(e,U),t=Y(t,H),r=Y(r,Q),a=Y(a,X);let i=Math.sqrt(t/e),s=r/(2*Math.sqrt(t*e)),o=s<1?i*Math.sqrt(1-s*s):0,l=s<1?(s*i-a)/o:-a+i;return e=>{let t=void 0!==n?n*e:e;return t=s<1?Math.exp(-t*s*i)*(1*Math.cos(o*t)+l*Math.sin(o*t)):(1+l*t)*Math.exp(-t*i),0===e||1===e?e:1-t}}var Z=L(.001),$=L(1e-7),J=L(.1);function _(e,t){return L(L(1-L(3*t))+L(3*e))}function ee(e,t){return L(L(3*t)-L(6*e))}function te(e){return L(3*e)}function re(e,t,r){return L(L(L(L(L(_(t,r)*e)+ee(t,r))*e)+te(t))*e)}function ae(e,t,r){let a=L(L(L(3*_(t,r))*e)*e),n=L(L(2*ee(t,r))*e);return L(L(a+n)+te(t))}var ne=e=>e;function ie(e,t,r,a){if(e=L(e),t=L(t),r=L(r),a=L(a),e<0||e>1||r<0||r>1||e===t&&r===a)return ne;let n=new Float32Array(11);for(let t=0;t<11;t++)n[t]=re(L(t*J),e,r);return i=>0===(i=L(i))||1===i?i:re((t=>{let a=0,i=1;for(;10!==i&&n[i]<=t;)a=L(a+J),i+=1;i-=1;let s=L(L(t-n[i])/L(n[i+1]-n[i])),o=L(a+L(s*J)),l=ae(o,e,r);return l>=Z?function(e,t,r,a){for(let n=0;n<4;n++){let n=ae(t,r,a);if(0===n)return t;let i=L(re(t,r,a)-e);t=L(t-L(i/n))}return t}(t,o,e,r):0===l?o:function(e,t,r,a,n){let i,s=0,o=0;do{s=L(t+L(L(r-t)/2)),i=L(re(s,a,n)-e),i>0?r=s:t=s,o+=1}while(Math.abs(i)>$&&o<10);return s}(t,a,L(a+J),e,r)})(i),t,a)}var se=L(1.70158);function oe(e,t,r){switch(e.easing){case 0:default:return r;case 1:return ie(.25,.1,.25,1)(r);case 2:return ie(.42,0,1,1)(r);case 3:return ie(0,0,.58,1)(r);case 4:return ie(.42,0,.58,1)(r);case 7:return ie(.25,1,.5,1)(r);case 8:return Math.floor(r);case 5:{let{control1:t,control2:a}=e;return t&&a?ie(t[0],t[1],a[0],a[1])(r):r}case 6:{let{mass:a,stiffness:n,damping:i,velocity:s}=e;return void 0===a||void 0===n||void 0===i||void 0===s?r:L(K(a,n,i,s,t)(r))}}}L(se+1);var le=Math.fround,ue=class{constructor(e,t,r){this.apply=t,this.onStart=r,this.isPlaying=!1,this.isReversed=!1,this.endTime=0,this.startTime=0,this.isFirstLerpAfterStart=!1,this.config=e,this.duration=function(e,t){if(6!==e.easing)return t;let{mass:r,stiffness:a,damping:n,velocity:i}=e;return void 0===r||void 0===a||void 0===n||void 0===i?t:function(e,t,r,a){let n=.16666666666666666,i=0,s=0,o=K(e,t,r,a);for(let e=0;e<1e5;e++)if(i+=n,1===o(i)){if(s+=1,s>=16)break}else s=0;return L(i*n)}(r,a,n,i)}(e.ease,le(e.duration/1e3)),this.delay=le(e.delay/1e3),this.currentRepeat=e.repeat}get repeatDirection(){return this.overrideDirection??this.config.direction}get isPingpong(){let e=this.repeatDirection;return"pingpong"===e||"pingpong-rewind"===e}get actualDelayDirection(){return this.isReversed?"start"===this.config.delayDirection?"end":"end"===this.config.delayDirection?"start":this.config.delayDirection:this.config.delayDirection}start(e){this.isPlaying=!0,this.currentRepeat=this.config.repeat,this.isFirstLerpAfterStart=!0,this.startTime=e,this.onStart?.()}endAfterCurrentPass(){this.currentRepeat<0&&(this.currentRepeat=0)}stop(){this.isPlaying=!1}rearm(){this.onStart?.()}seek(e){this.lerp(e)}update(e){if(!this.isPlaying)return;let t=a(e,this.startTime),r=0;if(this.isFirstLerpAfterStart||!this.isPingpong){let e=this.actualDelayDirection;if("start-once"===this.config.delayDirection&&this.isFirstLerpAfterStart||"start"===e||"start-end"===e){if(t<this.delay)return;r=this.delay}}t=le(t-r);let i=0===this.duration?1:Math.min(Math.max(le(t/this.duration),0),1);if(this.lerp(i),!this.isPlaying||1!==i)return;let s=this.actualDelayDirection;if("end"===s||"start-end"===s){if(t<le(this.duration+this.delay))return;this.endTime=n(this.startTime,le(le(r+this.duration)+this.delay))}else this.endTime=n(this.startTime,le(r+this.duration));this.isFirstLerpAfterStart=!1,0!==this.currentRepeat?(this.currentRepeat>0&&(this.currentRepeat-=1),this.isPingpong?this.isReversed=!this.isReversed:this.lerp(0),this.startTime=e,this.onStart?.()):this.stop()}lerp(e){"pingpong-rewind"===this.repeatDirection&&this.isReversed?(e=le(1-e),e=this.ease(e),e=le(1-e)):e=this.ease(e),this.apply(e)}ease(e){return oe(this.config.ease,this.duration,e)}},{degToRad:de,radToDeg:ce}=N,pe=new z,he=new z,fe=new F;function ge(e,t,r,a,n,i){let s=void 0!==r[e]?r[e]:void 0,o=a[e];if(null==o)return;let l=null!=s?"string"==typeof s?Number(n.getVariable(s)??0):s:t[e],u="string"==typeof o?Number(n.getVariable(o)??0):o;return l!==u?{update:r=>{let a=N.lerp(l,u,r);t[e]=i?Math.trunc(a):a},start:()=>{t[e]=l},end:()=>{t[e]=u}}:void 0}function me(e,t,r,a,n,i){let s=r[e]?r[e]:void 0,o=a[e];if(!o)return;let l=t[e],u=[...s??l].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e),d=[...o].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e);return u.length!==d.length||b(u,d)?void 0:{update:r=>{u.forEach((a,n)=>{let s=N.lerp(a,d[n],r);t[e][n]=i?Math.trunc(s):s})},start:()=>{Object.assign(t[e],u)},end:()=>{Object.assign(t[e],d)}}}function be(e,t,r){return t.forEach((t,a)=>{e.setComponent(a,"string"==typeof t?Number(r.getVariable(t)??0):t)}),e}function ye(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=i?be(new z,i,n):o.clone(),u=be(new z,s,n);return l.equals(u)?void 0:{update:e=>{o.lerpVectors(l,u,e)},start:()=>{o.copy(l)},end:()=>{o.copy(u)}}}function ve(e,t,r){return t.forEach((t,a)=>{e.setComponent(a,"string"==typeof t?Number(r.getVariable(t)??0):t)}),e}function we(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=!(o instanceof I),u=o instanceof I?o:(new I).fromArray(o),d=i?ve(new I,i,n):u.clone(),c=ve(new I,s,n);return d.equals(c)?void 0:{update:r=>{u.lerpVectors(d,c,r),l&&(t[e]=u.toArray())},start:()=>{u.copy(d),l&&(t[e]=u.toArray())},end:()=>{u.copy(c),l&&(t[e]=u.toArray())}}}function Se(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=new f(o.r,o.g,o.b,o.a),u=i?"string"==typeof i?n.getColor(i).clone():new f(i.r,i.g,i.b,i.a):l.clone(),d="string"==typeof s?n.getColor(s).clone():new f(s.r,s.g,s.b,s.a);return u.equals(d)?void 0:{update:r=>{l.lerpColors(u,d,r);let a=N.lerp(u.a,d.a,r);l.a=a,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(u)},end:()=>{l.copy(d)}}}function je(e,t,r,a,n){return"number"==typeof t[e]?ge(e,t,r??{},a,n):Array.isArray(t[e])?me(e,t,r??{},a,n):void 0}function Ve(e,t){if(e)for(let[r,a]of Object.entries(t)){let t=e[r];if(Array.isArray(t)&&Array.isArray(a)){let e=Math.min(t.length,a.length);for(let r=0;r<e;r++)t[r]=a[r]}else e[r]=a}}function Ae(e,t,r,a){let n={};if(!t||!r)return n;for(let i of e){let e=t[i],s=r[i];if("number"==typeof e&&"number"==typeof s)n[i]=N.lerp(e,s,a);else if(Array.isArray(e)&&Array.isArray(s)){let t=Math.min(e.length,s.length);n[i]=Array.from({length:t},(t,r)=>N.lerp(e[r],s[r],a))}}return n}function De(e,t,r,a,n){let i=e.getValue(a);if(void 0!==i){if("colors"===a)return function(e,t,r,a="colors"){if(!e.hasValue(a)||!(a in r))return;let n=[],i=e.getValue(a),s=t?t[a]:i.map(e=>e.toArray()),o=r[a];for(let e=0;e<i.length;++e){let t=[...s[e]],r=[...o[e]];V.isEqual(t,r)||n.push({update:a=>{i[e].fromArray(V.lerp(t,r,a))},start:()=>{i[e].fromArray(t)},end:()=>{i[e].fromArray(r)}})}return n.length?n:void 0}(e,t,r,a);if(Array.isArray(i))return"steps"===a?function(e,t,r,a="steps"){if(!e.hasValue(a)||!(a in r))return;let n=[],i=e.getValue(a),s=t?t[a]:i,o=r[a];return b(s,o)||n.push({update:t=>{let r=[...i];for(let e=0;e<i.length;++e){let a=s[e],n=o[e];r[e]=N.lerp(a,n,t)}e.setValue(a,r)},start:()=>{e.setValue(a,s)},end:()=>{e.setValue(a,o)}}),n.length?n:void 0}(e,t,r,a):void 0;if("number"==typeof i)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:e.getValue(a),s=r[a],o="string"==typeof i?Number(n.getVariable(i)??0):i,l="string"==typeof s?Number(n.getVariable(s)??0):s;return{update:t=>{e.setValue(a,N.lerp(o,l,t))},start:()=>{e.setValue(a,o)},end:()=>{e.setValue(a,l)}}}(e,t,r,a,n);if("boolean"!=typeof i){if(i instanceof I)return function(e,t,r,a){if(!e.hasValue(a)||!(a in r))return;let n=e.getValue(a),i=t?(new I).fromArray(t[a]):n.clone(),s=(new I).fromArray(r[a]);return i.equals(s)?void 0:{update:e=>{n.lerpVectors(i,s,e)},start:()=>{n.copy(i)},end:()=>{n.copy(s)}}}(e,t,r,a);if(i instanceof z)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=e.getValue(a),s=t?t[a]:void 0,o=r[a],l=s?be(new z,s,n):i.clone(),u=be(new z,o,n);return l.equals(u)?void 0:{update:e=>{i.lerpVectors(l,u,e)},start:()=>{i.copy(l)},end:()=>{i.copy(u)}}}(e,t,r,a,n);if(i instanceof f)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:void 0,s=r[a],o=e.getValue(a),l=i?"string"==typeof i?n.color(i).clone():(new W).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.color(s).clone():new f(s.r,s.g,s.b,s.a);if(l.equals(u))return;let d=o.clone();return{update:t=>{e.getValue(a)!==d&&e.setValue(a,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,r,a,n);if(i instanceof W)return function(e,t,r,a,n){if(!e.hasValue(a)||!(a in r))return;let i=t?t[a]:void 0,s=r[a],o=e.getValue(a),l=i?"string"==typeof i?n.color(i).clone():(new W).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.color(s).clone():(new W).setRGB(s.r,s.g,s.b);if(l.equals(u))return;let d=o.clone();return{update:t=>{e.getValue(a)!==d&&e.setValue(a,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,r,a,n);if("isTexture"in i)return function(e,t,r,a="texture",n){if(!e.hasValue(a)||!(a in r))return;let i=e=>Number("string"==typeof e?n?.getVariable(e)??0:e??0),s=e.getNode("rotation"),o=t?i(t[a]?.rotation):(s?.value??0)*N.RAD2DEG,l=i(r[a]?.rotation);if(s&&Math.abs(o-l)>1e-9)return{update:e=>{s.value=N.lerp(o,l,e)*N.DEG2RAD},start:()=>{s.value=o*N.DEG2RAD},end:()=>{s.value=l*N.DEG2RAD}};let u=function(e){let t=e.getNode("mat");if("function"==typeof t?.updateMatrix)return t;let r=e.getValue("mat");return"function"==typeof r?.updateMatrix?r:void 0}(e);if(!u)return;let d=t?t[a]:u,c=r[a],p=[...d.repeat],h=[...d.offset],f=[...c.repeat],g=[...c.offset],m=d.rotation??0,b=c.rotation??0;return G.isEqual(p,f)&&G.isEqual(h,g)&&m===b?void 0:{update:e=>{u.repeat=G.lerp(p,f,e),u.offset=G.lerp(h,g,e),u.rotation=N.lerp(m,b,e),u.updateMatrix()},start:()=>{u.repeat=[...p],u.offset=[...h],u.rotation=m,u.updateMatrix()},end:()=>{u.repeat=[...f],u.offset=[...g],u.rotation=b,u.updateMatrix()}}}(e,t,r,a,n)}}}function Me(e,t,r,a){let n=[],i=d(r,a)||!!t.layers&&d(t,a);n.push(function(e,t){return{update:()=>{e.setTransparent(t)}}}(e,i)),function(e,t,r){let a=e.ensureRainbowNoiseCompiled;if("function"==typeof a)for(let n of[...e.layers]){if("rainbow"!==n.type)continue;let i=t.layers?.data(n.uuid),s=r.layers.data(n.uuid);(c(i?.noiseStrength)||c(s?.noiseStrength))&&a.call(e,n.uuid)}}(e,t,r);for(let i of e.layers){let e=t.layers?.data(i.uuid),s=r.layers.data(i.uuid);if(!s||"light"!==i.type&&(!(i.visible??1)||!(s.visible??1)))continue;let o=p[i.type]??[],l=i.getNames().filter(e=>!o.includes(e)&&!B.some(t=>e.includes(t)));for(let t of l)try{let r=De(i,e,s,t,a);r&&(Array.isArray(r)?n.push(...r):n.push(r))}catch(e){console.error(`lerpMaterial: unexpected material layer for ${t}`,e)}}return n}function Re(e,t,r,a,n,i){let s=De(t,r,a,e,i);!s||(Array.isArray(s)?s.forEach(e=>e.update(n)):s.update(n))}new q;var ke=new z,xe=new q;var Ee=[["radial",R],["linear",k],["grid",x],["toObject",E],["randomnessObject",O]];function Oe(e,t,r,a){if(!e)return{};let n=Ae(["count"],t,r,a);void 0!==n.count&&(n.count=Math.trunc(n.count));for(let[i,s]of Ee){if(!e[i])continue;let o=Ae(s,t[i],r[i],a);Object.keys(o).length&&(n[i]=o)}return n}function Be(e,t){if(e){void 0!==t.count&&(e.count=t.count);for(let[r]of Ee){let a=t[r];a&&Ve(e[r],a)}}}function Ce(a,n,d,c,p){let f=[];return a.data.visible&&f.push(...function(e,t,r,a,n){let i,l,u,d,c,p,h,f,g=[];if(S(e)?(i=we("position",e,t,r,n),i&&g.push(i),u=ge("rotation",e,t,r,n),u&&g.push(u),d=we("shear",e,t,r,n),d&&g.push(d)):(f={slide:t.pathSnapping?.slide??e.updatedPathSnapping?.slide??e.dataPatched.pathSnapping?.slide??0,offset:t.pathSnapping?.offset??e.updatedPathSnapping?.offset??e.dataPatched.pathSnapping?.offset??0},p=ge("slide",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,r.pathSnapping??e.dataPatched.pathSnapping,n),p&&g.push(p),h=ge("offset",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,r.pathSnapping??e.dataPatched.pathSnapping,n),h&&g.push(h),!p&&!h&&(i=ye("position",e,t,r,n),i&&g.push(i),l=ye("scale",e,t,r,n),l&&g.push(l),u=function(e,t,r,a,n){let i=t?.rotation?t.rotation.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*N.DEG2RAD):void 0,s=r.rotation?.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*N.DEG2RAD);if(!s)return;let o=i?(new z).fromArray(i):(new z).setFromEuler(e.rotation),l=(new z).fromArray(s);if(o.equals(l))return;let u=ke.subVectors(l,o);if(a&&u.toArray().every(e=>Math.abs(e)<2*Math.PI)){let t=(new F).setFromEuler(xe.setFromVector3(o)),r=(new F).setFromEuler(xe.setFromVector3(l));return{update:a=>{!function(e,t,r,a){if(0===a)return r.copy(e);if(1===a)return r.copy(t);let n=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(n>=1)return r.copy(e);let i=1-n*n;if(i<=Number.EPSILON){let n=1-a;return r.w=n*e.w+a*t.w,r.x=n*e.x+a*t.x,r.y=n*e.y+a*t.y,r.z=n*e.z+a*t.z,r.normalize(),r}let s=Math.sqrt(i),o=Math.atan2(s,n),l=Math.sin((1-a)*o)/s,u=Math.sin(a*o)/s;r.w=e.w*l+t.w*u,r.x=e.x*l+t.x*u,r.y=e.y*l+t.y*u,r.z=e.z*l+t.z*u}(t,r,e.quaternion,a)},start:()=>{e.rotation.setFromVector3(o)},end:()=>{e.rotation.setFromVector3(l)}}}return{update:t=>{ke.lerpVectors(o,l,t),e.rotation.setFromVector3(ke)},start:()=>{e.rotation.setFromVector3(o)},end:()=>{e.rotation.setFromVector3(l)}}}(e,t,r,a,n),u&&g.push(u),c=function(e,t,r,a){let n=r[e]?r[e]:void 0,i=a[e];if(!i)return;let s=t[e],o=n?(new T).fromArray(n):s.clone(),l=new z,u=new F,d=new z;o.decompose(l,u,d);let c=(new T).fromArray(i),p=new z,h=new F,f=new z;return c.decompose(p,h,f),o.equals(c)?void 0:{update:e=>{fe.slerpQuaternions(u,h,e),pe.lerpVectors(l,p,e),he.lerpVectors(d,f,e),s.compose(pe,fe,he)},start:()=>{s.compose(l,u,d)},end:()=>{s.compose(p,h,f)}}}("hiddenMatrix",e,t,r),c&&g.push(c))),i||l||u||c||p||h){let r=S(e)?()=>{e.updateWorldMatrix(!0,!1,!0),e.resetBBoxNeedsUpdate()}:()=>{e.updateMatrix(),e.hasNonUniformScale&&(e.updateMatrixWorld(),e.updateMatrixWorldRigid()),e.parent?.matrixWorldFusedFalse&&(e.matrixWorld.multiplyMatrices(e.parent.matrixWorldFusedFalse,e.matrix),e.matrixWorldNeedsUpdate=!1),s(e)&&o(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,f))};g.push({update:r,start:r,end:r})}return g}(a,n,d,p,c.shared)),S(a)?f.push(...function(a,n,i,s,o){let l,u,d,c,p,h,f,g,m,b,y,v,w,S,j,V=[];if("width"in a&&(l=ge("width",a,n,i,o),l&&V.push(l)),"height"in a&&(u=ge("height",a,n,i,o),u&&V.push(u)),a instanceof e||a instanceof r){let t={...n.fill},r={...i.fill};void 0!==t.enabled&&t.enabled!==r.enabled&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.fill.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),d=Se("color",a.fill,t,r,o),d&&V.push(d)}if(a instanceof e){let t={...n.stroke},r={...i.stroke};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.stroke.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),c=Se("color",a.stroke,t,r,o),c&&V.push(c),p=ge("thickness",a.stroke,t,r,o),p&&V.push(p)}if(a instanceof e){let t={...n.dropShadow},r={...i.dropShadow};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.dropShadow.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),h=Se("color",a.dropShadow,t,r,o),h&&V.push(h),f=ge("blurRadius",a.dropShadow,t,r,o),f&&V.push(f),m=ge("spread",a.dropShadow,t,r,o),m&&V.push(m),g=we("offset",a.dropShadow,t,r,o),g&&V.push(g)}if(a instanceof e){let t={...n.innerShadow},r={...i.innerShadow};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.innerShadow.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),r.enabled||Object.assign(r,{enabled:!0,color:{...r.color,a:0}})),b=Se("color",a.innerShadow,t,r,o),b&&V.push(b),y=ge("blurRadius",a.innerShadow,t,r,o),y&&V.push(y),w=ge("spread",a.innerShadow,t,r,o),w&&V.push(w),v=we("offset",a.innerShadow,t,r,o),v&&V.push(v)}if(a instanceof e||a instanceof r){let t={...n.backgroundBlur},r={...i.backgroundBlur};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.backgroundBlur.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),r.enabled||Object.assign(r,{enabled:!0,radius:0})),S=ge("radius",a.backgroundBlur,t,r,o),S&&V.push(S)}if(a instanceof e){let t={...n.layerBlur},r={...i.layerBlur};(t.enabled||r.enabled)&&(V.push(function(t){return{update:()=>{t instanceof e&&(t.layerBlur.enabled=!0)}}}(a)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),r.enabled||Object.assign(r,{enabled:!0,radius:0})),j=ge("radius",a.layerBlur,t,r,o),j&&V.push(j)}if(a instanceof r||a instanceof t){let e=me("cornerRadius",a,n,i,o);e&&V.push(e)}return V}(a,n,d,0,c.shared)):(a.data.visible&&f.push(...function(e,t,r,a){let n=[];if(!("cloner"in r)||!e.cloner)return n;let i=e.cloner,s="cloner"in t?t.cloner:{},o=r.cloner;M.forEach(e=>{let t;t="count"===e?ge("count",i.parameters,s,o,a.shared,!0):je(e,i.parameters,s??{},o,a.shared),t&&n.push(t)});let l=function(e,t,r,a){if("radial"!==e.parameters.type)return;let n=t.radial,i=r.radial;if(!i)return;let s=e.parameters.radial,o=[];return R.forEach(e=>{let t=je(e,s,n??{},i,a);t&&o.push(t)}),o}(i,s,o,a.shared);l?.length&&n.push(...l);let u=function(e,t,r,a){if("linear"!==e.parameters.type)return;let n=t.linear,i=r.linear;if(!i)return;let s=[],o=e.parameters.linear;return k.forEach(e=>{let t=je(e,o,n??{},i,a);t&&s.push(t)}),s}(i,s,o,a.shared);u?.length&&n.push(...u);let d=function(e,t,r,a){if("grid"!==e.parameters.type)return;let n=t.grid,i=r.grid;if(!i)return;let s=[],o=e.parameters.grid;return x.forEach(e=>{let t;t="count"===e?me(e,o,n??{},i,a,!0):je(e,o,n??{},i,a),t&&s.push(t)}),s}(i,s,o,a.shared);d?.length&&n.push(...d);let c=function(e,t,r,a){if("toObject"!==e.parameters.type)return;let n=t.toObject,i=r.toObject;if(!i)return;let s=[],o=e.parameters.toObject;return E.forEach(e=>{let t;t="count"===e?ge(e,o,n??{},i,a,!0):je(e,o,n??{},i,a),t&&s.push(t)}),s}(i,s,o,a.shared);c?.length&&n.push(...c);let p=function(e,t,r,a){if(!e.parameters.randomness)return;let n=t.randomnessObject,i=r.randomnessObject;if(!i)return;let s=[],o=e.parameters.randomnessObject;return O.forEach(e=>{let t=je(e,o,n??{},i,a);t&&s.push(t)}),s}(i,s,o,a.shared);return p?.length&&n.push(...p),n.length&&n.push({update:()=>{i.update(a)}}),n}(a,n,d,c)),a instanceof m?(a instanceof g&&a.data.visible&&f.push(...function(e,t,r,a){let n=[];if(!("geometry"in r)||v(e))return n;let i=e.geometry.userData.parameters,s="geometry"in t?t.geometry:{},o=r.geometry;if(e instanceof u){let t=function(e,t,r,a){if(void 0===r.scaleBaked)return;let n=(t.scaleBaked??e.appliedGeometrySize??e.data.geometry.scaleBaked).map(e=>"string"==typeof e?Number(a.shared.getVariable(e)??0):e),i=r.scaleBaked.map(e=>"string"==typeof e?Number(a.shared.getVariable(e)??0):e);if(j.isEqual(n,i))return;let s=[];return s.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[N.lerp(n[0],i[0],t),N.lerp(n[1],i[1],t),N.lerp(n[2],i[2],t)]},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)},start:()=>{e.updateGeometryInteractions({scaleBaked:n},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)},end:()=>{e.updateGeometryInteractions({scaleBaked:i},a.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(a)}}),s}(e,s,o,a);t&&n.push(...t)}else{let t={},r=e.appliedGeometrySize;if(Object.assign(t,y(i,P),r?{width:r[0],height:r[1],depth:r[2]}:{},y(s,P)),P.forEach(e=>{let r=je(e,t,s,o,a.shared);r&&n.push(r)}),w(e)){Object.assign(t,{extrusion:{...i.extrusion}});let e=function(e,t,r,a){if(!r.extrusion)return;let n=e.extrusion,i=t.extrusion??{},s=r.extrusion,o=[];return C.forEach(e=>{let t=je(e,n,i,s,a);t&&o.push(t)}),o}(t,s,o,a.shared);e&&n.push(...e)}n.length&&n.push({update:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)},start:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)},end:r=>{e.updateGeometryInteractions(t,a.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(a)}})}return n}(a,n,d,c)),a.data.visible&&!(a instanceof h&&a.materialOverride)&&f.push(...function(e,t,r,a){let n=[];if(Array.isArray(e.material)){if(!("materials"in r)||!r.materials)return n;let i="materials"in t&&t.materials?t.materials:[],s=r.materials;e.material.forEach((e,t)=>{if(!s[t])return;let r=i[t]??{},o=s[t];"string"==typeof r||"string"==typeof o||n.push(...Me(e,r,o,a))})}else{if(!("material"in r)||!r.material)return n;let i="material"in t&&t.material?t.material:{},s=r.material;if("string"==typeof i||"string"==typeof s)return n;n.push(...Me(e.material,i,s,a))}return n}(a,n,d,c.shared))):i.is(a)?a.data.visible&&f.push(...function(e,t,r,a){let n=[];if(void 0!==r.intensity){let i=ge("intensity",e,t,r,a);i&&n.push(i)}if(void 0!==r.color){let i=function(e,t,r,a,n){let i=r[e]?r[e]:void 0,s=a[e];if(!s)return;let o=t[e],l=i?"string"==typeof i?n.getColor(i).clone():(new W).setRGB(i.r,i.g,i.b):o.clone(),u="string"==typeof s?n.getColor(s).clone():(new W).setRGB(s.r,s.g,s.b);if(l.equals(u))return;let d=o.clone();return{update:r=>{d.lerpColors(l,u,r),t[e]?.copy?.(d)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}("color",e,t,r,a);i&&n.push(i)}return n}(a,n,d,c.shared)):a instanceof l&&f.push(...function(e,t,r,a){let n=[],i="OrthographicCamera"===e.cameraType?t.orthographic?.zoom:t.perspective?.zoom,s="OrthographicCamera"===e.cameraType?r.orthographic?.zoom:r.perspective?.zoom;if(void 0!==s){let t=i??e.zoom,r=s;t!==r&&n.push({update:a=>{e.zoom=N.lerp(t,r,a),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=r,e.updateProjectionMatrix()}})}if(void 0!==r.targetOffset){let i=ge("targetOffset",e,t,r,a);i&&n.push(i)}return n}(a,n,d,c.shared))),f.length?{update:e=>{f.forEach(t=>t.update(e))},start:e=>{f.forEach(t=>t.start?.(e))},end:e=>{f.forEach(t=>t.end?.(e))}}:void 0}var Pe={type:"beginState"};function Ge(e){if(5===e.easing){let{control1:t,control2:r}=e;return{easing:5,control1:t??D.defaultData.control1,control2:r??D.defaultData.control2}}if(6===e.easing){let{mass:t,stiffness:r,damping:a,velocity:n}=e;return{easing:6,mass:t??A.defaultData.mass,stiffness:r??A.defaultData.stiffness,damping:a??A.defaultData.damping,velocity:n??A.defaultData.velocity}}return{easing:e.easing}}function Ne(e){return{delay:e.delay,delayDirection:e.delayDirection??"start-end",direction:e.direction??"normal",repeat:e.repeat}}var Ie={type:"completeState",isfromEntity:!1};function Fe(e,t){let r,a;if("string"==typeof t?(r=t,a=e.states?.[r]):null===t&&(r=null,a=e.data),void 0!==r&&void 0!==a)return{id:r,data:a}}var ze=["position","rotation","scale","shear","hiddenMatrix"],Te=new Set;function qe(e){if(e.length<2)return Te;let t=new Set,[r,...a]=e;for(let e of ze){let n=r[e];void 0!==n&&a.every(t=>b(t[e],n))&&t.add(e)}return t}var We=class{constructor(e,t,r,a,n,i,s,o={},l=()=>Te){var u;this.object=e,this.fromRef=t,this.toRef=r,this.data=a,this.sharedAssets=n,this.allowSlerp=i,this.page=s,this.hooks=o,this.inert=l,this.builtReversed=!1,this.startStateId=null,this.buildCallback=()=>{this.builtReversed=this.runner.isReversed,this.startStateId=S(this.object)?null:this.object.transitionState.state,this.callback=Ce(this.object,{},function(e,t){if(0===t.size)return e;let r={...e};for(let e of t)delete r[e];return r}(this.end.data,this.inert()),{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp)},this.onChange=e=>{this.builtReversed!==this.runner.isReversed&&this.buildCallback(),this.callback&&(this.callback.update(e),this.object.requestRender()),this.writeState(e)},this.runner=new ue({duration:(u=a).duration,ease:Ge(u),...Ne(u)},this.onChange,this.buildCallback),this.rebind()}rebind(){let{fromRef:e,toRef:t}=this;if(void 0===e){let e=Fe(this.object,this.object.currentState===t?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let t=Fe(this.object,e);if(!t)throw new Error("Missing property");this.from=t}if(void 0===t)throw new Error("Missing property");let r=Fe(this.object,t);if(!r)throw new Error("Missing property");this.to=r,this.buildCallback()}refresh(){this.buildCallback()}get endpointData(){return[this.from.data,this.to.data]}get targetStateId(){return this.builtReversed?this.from.id:this.to.id}get start(){return this.builtReversed?this.to:this.from}get end(){return this.builtReversed?this.from:this.to}writeState(e){if(0===e||S(this.object))return;let t=1===e,r=e>.5?this.targetStateId:this.startStateId,a=this.object.transitionState;a.settled===t&&a.state===r||(this.object.transitionState={settled:t,state:r},this.object.reversibleToState=this.end.id,this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=r,this.object.dispatchEvent({type:"transitionState",settled:t,state:r}),this.object.dispatchEvent({type:t?"completeState":"beginState",state:r}),this.object.traverseEntity(e=>{e!==this.object&&e instanceof l&&e.dispatchEvent(t?Ie:Pe)}),t?this.hooks.onComplete?.(r):this.hooks.onBegin?.(r))}};export{oe as a,ue as b,Ae as c,Oe as d,Be as e,Re as f,Pe as g,Ge as h,Ne as i,Ie as j,Fe as k,Te as l,qe as m,We as n};
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-XXDRC64C.js";import{e}from"./runtime-chunk-24H3WFTK.js";import{c as i}from"./runtime-chunk-QZSA6WBT.js";import{i as r}from"./runtime-chunk-MPHBANVQ.js";import{j as s}from"./runtime-chunk-2PT2WH66.js";import{Fc as n,Ne as o,dd as a,ud as h,vd as c}from"./runtime-chunk-BVVSZMXD.js";var d=class extends o{constructor(){super(),i(this.layers)}setFromCamera(t,e){e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):e.isPerspectiveCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(t,e=!0,i=[]){return t.forEach(t=>{t.visible&&this.intersectObject(t,e,i)}),i}createRaycastLineHelper(){let t=new h({color:65280,linewidth:10}),e=new n(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new n(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),r=this.camera.far-this.camera.near,s=(new n).addVectors(e,i.multiplyScalar(r)),o=new a;return o.setFromPoints([e,s]),new c(o,t)}},u=e=>e instanceof t||s(e);function l(t,e){return t.distance-e.distance}function m(t,i,s){if(r(i)&&i.visible){e(i)&&i.raycast(t,s);for(let e of i.children)m(t,e,s)}}function f(t,e,i,r=!1){if(!r&&!i.some(e=>void 0!==w(t,e)))return[];let s=[];return e.children.forEach(e=>m(t,e,s)),s.sort(l),s}function p(t){let e=[];if(t.length){let i=t[0].object;r(i)&&e.push(i);let s=i.parent;for(;s;)u(s)&&e.push(s),s=s.parent}return e}function y(t,e,i,r){let s=t.frame;if(s){let t=e[0]*s.width,n=(1-e[1])*s.height;for(let e of i){let i=e===s.uuid?s:s.find(e);if(i?.intersects(t,n))return r(i),!0}}return!1}function w(t,i){if(e(i)){if(i.visible){let e=[];return i.raycast(t,e),e.length?e[0]:void 0}}else if(u(i))return g(t,i)}function g(t,i){if(r(i)&&i.visible){if(e(i)){let e=[];if(i.raycast(t,e),e.length)return e[0]}for(let e of i.children){let i=g(t,e);if(i)return i}}}var v=class{constructor(t,e,i,r,s,n,o,a){this.renderer=t,this.publish=e,this.scene=i,this.getCamera=r,this.sharedAssets=s,this.requestRender=n,this.isExport=o,this.frame=a,this.raycaster=new d,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===e.mouseEventTarget,this.domElement=t.domElement,this.eventElement=this._useWindowEvents?window:t.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(t){this._useWindowEvents=t,this.eventElement=t?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(t){this._domRect=t}get domRect(){return this._domRect}updateRaycaster(t){let{pageX:e,pageY:i}=t.touches?.length>0?t.touches[0]:t;this.pointerWorld=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width*2-1,y:-(e-(i.top+window.scrollY))/i.height*2+1}}(e,i,this._domRect),this.pointerScreen=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width,y:1-(e-(i.top+window.scrollY))/i.height}}(e,i,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}dispose(){this.scene=void 0,this.sharedAssets=void 0,this.publish=void 0,this.getCamera=void 0,this.requestRender=void 0,this.frame=void 0,this.isExport=void 0}};export{f as a,p as b,y as c,w as d,v as e};
1
+ import{a as t}from"./runtime-chunk-WCFTACIP.js";import{e}from"./runtime-chunk-IVETVBB5.js";import{c as i}from"./runtime-chunk-OYIE77GW.js";import{i as r}from"./runtime-chunk-F4XMOADV.js";import{j as s}from"./runtime-chunk-2PT2WH66.js";import{Fc as n,Ne as o,dd as a,ud as h,vd as c}from"./runtime-chunk-BVVSZMXD.js";var d=class extends o{constructor(){super(),i(this.layers)}setFromCamera(t,e){e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):e.isPerspectiveCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(t,e=!0,i=[]){return t.forEach(t=>{t.visible&&this.intersectObject(t,e,i)}),i}createRaycastLineHelper(){let t=new h({color:65280,linewidth:10}),e=new n(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new n(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),r=this.camera.far-this.camera.near,s=(new n).addVectors(e,i.multiplyScalar(r)),o=new a;return o.setFromPoints([e,s]),new c(o,t)}},u=e=>e instanceof t||s(e);function l(t,e){return t.distance-e.distance}function m(t,i,s){if(r(i)&&i.visible){e(i)&&i.raycast(t,s);for(let e of i.children)m(t,e,s)}}function f(t,e,i,r=!1){if(!r&&!i.some(e=>void 0!==w(t,e)))return[];let s=[];return e.children.forEach(e=>m(t,e,s)),s.sort(l),s}function p(t){let e=[];if(t.length){let i=t[0].object;r(i)&&e.push(i);let s=i.parent;for(;s;)u(s)&&e.push(s),s=s.parent}return e}function y(t,e,i,r){let s=t.frame;if(s){let t=e[0]*s.width,n=(1-e[1])*s.height;for(let e of i){let i=e===s.uuid?s:s.find(e);if(i?.intersects(t,n))return r(i),!0}}return!1}function w(t,i){if(e(i)){if(i.visible){let e=[];return i.raycast(t,e),e.length?e[0]:void 0}}else if(u(i))return g(t,i)}function g(t,i){if(r(i)&&i.visible){if(e(i)){let e=[];if(i.raycast(t,e),e.length)return e[0]}for(let e of i.children){let i=g(t,e);if(i)return i}}}var v=class{constructor(t,e,i,r,s,n,o,a){this.renderer=t,this.publish=e,this.scene=i,this.getCamera=r,this.sharedAssets=s,this.requestRender=n,this.isExport=o,this.frame=a,this.raycaster=new d,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===e.mouseEventTarget,this.domElement=t.domElement,this.eventElement=this._useWindowEvents?window:t.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(t){this._useWindowEvents=t,this.eventElement=t?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(t){this._domRect=t}get domRect(){return this._domRect}updateRaycaster(t){let{pageX:e,pageY:i}=t.touches?.length>0?t.touches[0]:t;this.pointerWorld=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width*2-1,y:-(e-(i.top+window.scrollY))/i.height*2+1}}(e,i,this._domRect),this.pointerScreen=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width,y:1-(e-(i.top+window.scrollY))/i.height}}(e,i,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}dispose(){this.scene=void 0,this.sharedAssets=void 0,this.publish=void 0,this.getCamera=void 0,this.requestRender=void 0,this.frame=void 0,this.isExport=void 0}};export{f as a,p as b,y as c,w as d,v as e};
@@ -1 +1 @@
1
- import{a as t,b as e}from"./runtime-chunk-N4O4HFFU.js";import{Ec as s,Fc as r,Sc as a,Xe as i}from"./runtime-chunk-BVVSZMXD.js";var o=new r(1,1,1),m=new r,d=new r,u=new s,c=class extends(t(i)){constructor(t,e=15){super(e),this.object=t,this.dummy=new a,this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=this.dummy.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(t,s){e(this.object,c.geometryHelper,t,s,!1,this.dummy)}update(){}updateMatrix(){}updateMatrixWorld(t){this.object.matrixWorld.decompose(m,u,d),this.matrix.compose(m,u,o),super.updateMatrixWorld(t)}updateWorldMatrix(t,e){}};export{c as a};
1
+ import{a as t,b as e}from"./runtime-chunk-U4SSOL4Z.js";import{Ec as s,Fc as r,Sc as a,Xe as i}from"./runtime-chunk-BVVSZMXD.js";var o=new r(1,1,1),m=new r,d=new r,u=new s,c=class extends(t(i)){constructor(t,e=15){super(e),this.object=t,this.dummy=new a,this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=this.dummy.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(t,s){e(this.object,c.geometryHelper,t,s,!1,this.dummy)}update(){}updateMatrix(){}updateMatrixWorld(t){this.object.matrixWorld.decompose(m,u,d),this.matrix.compose(m,u,o),super.updateMatrixWorld(t)}updateWorldMatrix(t,e){}};export{c as a};
@@ -1 +1 @@
1
- import{h as e,ia as t}from"./runtime-chunk-QZSA6WBT.js";import{Cc as r,Fc as a,Zc as o,bd as n}from"./runtime-chunk-BVVSZMXD.js";function i(r){if(Array.isArray(r.material)){for(let e of r.material)if(0===e.getLayersOfType("outline").length)return}else if(!e(r.material)||0===r.material.getLayersOfType("outline").length)return;r instanceof t&&r.is2DAndNoDepth?function(e){if(e.geometry.attributes.extrudeNormals||!e.geometry.attributes.position)return;let t=e.geometry.attributes.position.array,r=new Float32Array(t.length),o=new a;for(let e=0;e<t.length;e+=3)o.set(t[e],t[e+1],t[e+2]).normalize(),r[e]=o.x,r[e+1]=o.y,r[e+2]=o.z;e.geometry.setAttribute("extrudeNormal",new n(r,3))}(r):function(e){if(e.geometry.attributes.extrudeNormal||!e.geometry.attributes.position||!e.geometry.attributes.normal)return;let t=new Map,r=e.geometry.attributes,o=r.position.array,i=r.normal.array,l=new Float32Array(o.length);for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,n=new a(i[e],i[e+1],i[e+2]);t.has(r)?t.get(r)?.normals.push(n):t.set(r,{normals:[n],result:new a})}t.forEach((e,t)=>{for(let t of e.normals)e.result.add(t);e.result.divideScalar(e.normals.length)});for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,a=t.get(r)?.result;a&&(l[e]=a.x,l[e+1]=a.y,l[e+2]=a.z)}e.geometry.setAttribute("extrudeNormal",new n(l,3))}(r)}function l(e){return Math.min(2047,Math.max(1,Math.round(2048*e)))/2048}function s(e){if(!e.geometry.attributes.position)return;let t=e.geometry.attributes,a=t.position.array,n=t.randomColor;if(void 0!==n&&3*n.count===a.length)return;let i=new Float32Array(a.length),s=parseInt(e.uuid.replace(/\D/g,"")),u=[l(r.seededRandom(s)),l(r.seededRandom(s+1e4)),l(r.seededRandom(s+2e4))];for(let e=0;e<a.length;e++)i[e]=u[e%3];e.geometry.setAttribute("randomColor",new o(i,3))}export{i as a,s as b};
1
+ import{h as e,ia as t}from"./runtime-chunk-OYIE77GW.js";import{Cc as r,Fc as a,Zc as o,bd as n}from"./runtime-chunk-BVVSZMXD.js";function i(r){if(Array.isArray(r.material)){for(let e of r.material)if(0===e.getLayersOfType("outline").length)return}else if(!e(r.material)||0===r.material.getLayersOfType("outline").length)return;r instanceof t&&r.is2DAndNoDepth?function(e){if(e.geometry.attributes.extrudeNormals||!e.geometry.attributes.position)return;let t=e.geometry.attributes.position.array,r=new Float32Array(t.length),o=new a;for(let e=0;e<t.length;e+=3)o.set(t[e],t[e+1],t[e+2]).normalize(),r[e]=o.x,r[e+1]=o.y,r[e+2]=o.z;e.geometry.setAttribute("extrudeNormal",new n(r,3))}(r):function(e){if(e.geometry.attributes.extrudeNormal||!e.geometry.attributes.position||!e.geometry.attributes.normal)return;let t=new Map,r=e.geometry.attributes,o=r.position.array,i=r.normal.array,l=new Float32Array(o.length);for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,n=new a(i[e],i[e+1],i[e+2]);t.has(r)?t.get(r)?.normals.push(n):t.set(r,{normals:[n],result:new a})}t.forEach((e,t)=>{for(let t of e.normals)e.result.add(t);e.result.divideScalar(e.normals.length)});for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,a=t.get(r)?.result;a&&(l[e]=a.x,l[e+1]=a.y,l[e+2]=a.z)}e.geometry.setAttribute("extrudeNormal",new n(l,3))}(r)}function l(e){return Math.min(2047,Math.max(1,Math.round(2048*e)))/2048}function s(e){if(!e.geometry.attributes.position)return;let t=e.geometry.attributes,a=t.position.array,n=t.randomColor;if(void 0!==n&&3*n.count===a.length)return;let i=new Float32Array(a.length),s=parseInt(e.uuid.replace(/\D/g,"")),u=[l(r.seededRandom(s)),l(r.seededRandom(s+1e4)),l(r.seededRandom(s+2e4))];for(let e=0;e<a.length;e++)i[e]=u[e%3];e.geometry.setAttribute("randomColor",new o(i,3))}export{i as a,s as b};
@@ -1 +1 @@
1
- import{a as t,b as e,d as r}from"./runtime-chunk-N4O4HFFU.js";import{f as i}from"./runtime-chunk-RTLL6WIB.js";import{K as a,ya as o}from"./runtime-chunk-K3UQCG3P.js";import{Ae as s,Ec as n,Fc as p,Oc as h,Rc as c,Tc as m,bd as f,dd as u,ud as d,wd as l,we as g,xe as v}from"./runtime-chunk-BVVSZMXD.js";var C=new p,j=new g,T=class extends l{constructor(t){let e=new u,r=new d({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],a=[],o={},s=new m(15711266),n=new m(15711266),p=new m(2857471);function h(t,e,r){c(t,r),c(e,r)}function c(t,e){i.push(0,0,0),a.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",s),h("n2","n4",s),h("n4","n3",s),h("n3","n1",s),h("f1","f2",s),h("f2","f4",s),h("f4","f3",s),h("f3","f1",s),h("n1","f1",s),h("n2","f2",s),h("n3","f3",s),h("n4","f4",s),h("p","n1",n),h("p","n2",n),h("p","n3",n),h("p","n4",n),h("u1","u2",p),h("u2","u3",p),h("u3","u1",p),e.setAttribute("position",new f(i,3)),e.setAttribute("color",new f(a,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let t=this.geometry,e=this.pointMap;j.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;y("n1",e,t,j,-1,-1,r),y("n2",e,t,j,1,-1,r),y("n3",e,t,j,-1,1,r),y("n4",e,t,j,1,1,r);let i=r;y("f1",e,t,j,-1,-1,i),y("f2",e,t,j,1,-1,i),y("f3",e,t,j,-1,1,i),y("f4",e,t,j,1,1,i);let a=i;y("u1",e,t,j,.35,1.1,a),y("u2",e,t,j,-.35,1.1,a),y("u3",e,t,j,0,1.55,a),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function y(t,e,r,i,a,o,s){C.set(a,o,s).unproject(i);let n=e[t];if(void 0!==n){let t=r.getAttribute("position");for(let e=0,r=n.length;e<r;e++)t.setXYZ(n[e],C.x,C.y,C.z)}}var w=class extends(t(T)){constructor(t){super(t),this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){e(this.object,this.geometry,t,r,!0)}};function P(t){return 1-Math.pow(1-t,3)}var b=new p,x=new p,_=new n,M=new p,O=new p,F=new p,A=class extends(r(g,w)){constructor(t="",e={...o.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=a.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let t=this._projectionTransition;if(void 0===t)return;if(this.disposed)return void this._endProjectionTransition();t.raf=requestAnimationFrame(this._tickProjectionTransition);let e=A.projectionTransitionRequestRender??t.requestRender;this.updateProjectionMatrix(),e?.()},this.super_Entity(t,e),this.previousProjectionMatrix=new h,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new s(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new v(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(t){let e=A.projectionTransitionsEnabled;A.projectionTransitionsEnabled=!1;try{return t()}finally{A.projectionTransitionsEnabled=e}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(t){this.perspCamera.fov=t}get fov(){return this.perspCamera.fov}setNear(t,e){"PerspectiveCamera"===t?this.perspCamera.near=e:this.orthoCamera.near=e}setZoom(t,e){e>=0&&("PerspectiveCamera"===t?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}set cameraType(t){"PerspectiveCamera"===t?this.toPerspective():"OrthographicCamera"===t&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(t){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t,e,r){"number"==typeof t&&(t=new p(t,e,r)),super.lookAt(t),this.getWorldPosition(b),this.targetOffset=b.distanceTo(t)}getTarget(t=new p){return this.getWorldDirection(x),this.getWorldPosition(b),x.multiplyScalar(this.targetOffset),t.copy(b).add(x),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(b),b.distanceTo(t)}updateUp(){this.getWorldQuaternion(_),M.set(0,0,1).applyQuaternion(_),O.copy(c.DEFAULT_UP),this.isUpVectorFlipped&&O.negate(),O.applyQuaternion(_),F.copy(c.DEFAULT_UP).projectOnPlane(M),this.angleOffsetFromUp=F.angleTo(O),this.angleOffsetFromUp*=F.cross(O).dot(M)>=0?1:-1}updateTransformState(t,e){let r=super.updateTransformState(t,e);return void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(t){let e=t.getWorldPosition(new p),r=t.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:e.clone().add(r),target:e}}getViewToTarget(t){let e=this.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:t.clone().sub(e),target:t}}getViewToObject(t){let e=new p;return t.getWorldPosition(e),this.getViewToTarget(e)}setViewplaneSize(t,e,r=!1){if(this.aspect=t/e,r){let r=t>e?this.aspect:1,i=t>e?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-t,this.right=.5*t,this.top=.5*e,this.bottom=.5*-e;this.updateProjectionMatrix()}copyViewPlaneSize(t){this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let t=this._projectionTransition;if(void 0===t)return 1;let e=(performance.now()-t.start)/t.duration;return e>=1?1:e<=0?0:P(e)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return A.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=A.projectionTransitionMinAgeMs}_beginProjectionTransition(t){let e=this._projectionTransition;void 0===e&&(e={from:new h,blend:new h,blendInverse:new h,start:0,duration:A.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:t},this._projectionTransition=e),e.from.copy(this.projectionMatrix),e.start=performance.now(),e.duration=A.projectionTransitionDuration,e.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,t&&(e.requestRender=t),0!==e.raf&&cancelAnimationFrame(e.raf),e.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;let e=(performance.now()-t.start)/t.duration;if(e>=1)return void this._endProjectionTransition();let r=P(e),i=t.from.elements,a=this._activeSubCamera.projectionMatrix.elements,o=t.blend.elements,s=t.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*s),p=r*n/(r*n+(1-r)*Math.max(1e-6,a[15]-a[11]*s));for(let t=0;t<16;t++)o[t]=i[t]+(a[t]-i[t])*p;t.blendInverse.copy(t.blend).invert(),this.projectionMatrix=t.blend,this.projectionMatrixInverse=t.blendInverse}_endProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;0!==t.raf&&cancelAnimationFrame(t.raf),this._projectionTransition=void 0;let e=this._activeSubCamera;this.projectionMatrix=e.projectionMatrix,this.projectionMatrixInverse=e.projectionMatrixInverse}_syncProjectionTransition(t){let e=t._projectionTransition;if(void 0===e)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new h,blend:new h,blendInverse:new h,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(e.from),r.start=e.start,r.duration=e.duration,r.referenceDepth=e.referenceDepth,this._applyProjectionTransition()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,e,r,i,a,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(t,e,r,i,a,o):this.orthoCamera.setViewOffset(t,e,r,i,a,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,e){return super.copy(t,e),this.parent=t.parent,this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=null===t.view?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=a.sanitizeTargetOffset(t.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(t),this}toCameraState(t=[]){let e={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return i(e,t)}updateCameraSubtype(t,e){let r="perspective"===t?"PerspectiveCamera":"OrthographicCamera";void 0!==e.zoom&&this.setZoom(r,e.zoom),void 0!==e.near&&this.setNear(r,e.near),void 0!==e.fov&&"PerspectiveCamera"===r&&(this.fov=e.fov)}updateState(t,e){this.updateCameraState(t,e)}updateCameraState(t,e){this.updateState_Entity(t,e),void 0!==t.far&&(this.far=t.far),void 0!==t.orthographic&&this.updateCameraSubtype("orthographic",t.orthographic),void 0!==t.perspective&&this.updateCameraSubtype("perspective",t.perspective),void 0!==t.type&&(t.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(e?.shared.requestRender),this.cameraType=t.type),void 0!==t.up&&this.up.fromArray(t.up.map(t=>"number"==typeof t?t:0)),void 0!==t.targetOffset&&(this.targetOffset=a.sanitizeTargetOffset(t.targetOffset)),void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(t,e,r){super.updateByPatchedOp(t,e,r),1===t.path.length&&0===t.type&&this.updateCameraSubtype(t.path[0],t.props)}toState(t){return{...super.toState(t),...this.toCameraState(t),type:this.cameraType}}},V=A;V.projectionTransitionsEnabled=!1,V.projectionTransitionDuration=350,V.projectionTransitionMinAgeMs=1e3;export{V as a};
1
+ import{a as t,b as e,d as r}from"./runtime-chunk-U4SSOL4Z.js";import{f as i}from"./runtime-chunk-RTLL6WIB.js";import{K as a,ya as o}from"./runtime-chunk-K3UQCG3P.js";import{Ae as s,Ec as n,Fc as p,Oc as h,Rc as c,Tc as m,bd as f,dd as u,ud as d,wd as l,we as g,xe as v}from"./runtime-chunk-BVVSZMXD.js";var C=new p,j=new g,T=class extends l{constructor(t){let e=new u,r=new d({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],a=[],o={},s=new m(15711266),n=new m(15711266),p=new m(2857471);function h(t,e,r){c(t,r),c(e,r)}function c(t,e){i.push(0,0,0),a.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",s),h("n2","n4",s),h("n4","n3",s),h("n3","n1",s),h("f1","f2",s),h("f2","f4",s),h("f4","f3",s),h("f3","f1",s),h("n1","f1",s),h("n2","f2",s),h("n3","f3",s),h("n4","f4",s),h("p","n1",n),h("p","n2",n),h("p","n3",n),h("p","n4",n),h("u1","u2",p),h("u2","u3",p),h("u3","u1",p),e.setAttribute("position",new f(i,3)),e.setAttribute("color",new f(a,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let t=this.geometry,e=this.pointMap;j.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;y("n1",e,t,j,-1,-1,r),y("n2",e,t,j,1,-1,r),y("n3",e,t,j,-1,1,r),y("n4",e,t,j,1,1,r);let i=r;y("f1",e,t,j,-1,-1,i),y("f2",e,t,j,1,-1,i),y("f3",e,t,j,-1,1,i),y("f4",e,t,j,1,1,i);let a=i;y("u1",e,t,j,.35,1.1,a),y("u2",e,t,j,-.35,1.1,a),y("u3",e,t,j,0,1.55,a),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function y(t,e,r,i,a,o,s){C.set(a,o,s).unproject(i);let n=e[t];if(void 0!==n){let t=r.getAttribute("position");for(let e=0,r=n.length;e<r;e++)t.setXYZ(n[e],C.x,C.y,C.z)}}var w=class extends(t(T)){constructor(t){super(t),this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,r){e(this.object,this.geometry,t,r,!0)}};function P(t){return 1-Math.pow(1-t,3)}var b=new p,x=new p,_=new n,M=new p,O=new p,F=new p,A=class extends(r(g,w)){constructor(t="",e={...o.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=a.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let t=this._projectionTransition;if(void 0===t)return;if(this.disposed)return void this._endProjectionTransition();t.raf=requestAnimationFrame(this._tickProjectionTransition);let e=A.projectionTransitionRequestRender??t.requestRender;this.updateProjectionMatrix(),e?.()},this.super_Entity(t,e),this.previousProjectionMatrix=new h,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new s(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new v(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(t){let e=A.projectionTransitionsEnabled;A.projectionTransitionsEnabled=!1;try{return t()}finally{A.projectionTransitionsEnabled=e}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(t){this.perspCamera.fov=t}get fov(){return this.perspCamera.fov}setNear(t,e){"PerspectiveCamera"===t?this.perspCamera.near=e:this.orthoCamera.near=e}setZoom(t,e){e>=0&&("PerspectiveCamera"===t?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}set cameraType(t){"PerspectiveCamera"===t?this.toPerspective():"OrthographicCamera"===t&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(t){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t,e,r){"number"==typeof t&&(t=new p(t,e,r)),super.lookAt(t),this.getWorldPosition(b),this.targetOffset=b.distanceTo(t)}getTarget(t=new p){return this.getWorldDirection(x),this.getWorldPosition(b),x.multiplyScalar(this.targetOffset),t.copy(b).add(x),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(b),b.distanceTo(t)}updateUp(){this.getWorldQuaternion(_),M.set(0,0,1).applyQuaternion(_),O.copy(c.DEFAULT_UP),this.isUpVectorFlipped&&O.negate(),O.applyQuaternion(_),F.copy(c.DEFAULT_UP).projectOnPlane(M),this.angleOffsetFromUp=F.angleTo(O),this.angleOffsetFromUp*=F.cross(O).dot(M)>=0?1:-1}updateTransformState(t,e){let r=super.updateTransformState(t,e);return void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(t){let e=t.getWorldPosition(new p),r=t.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:e.clone().add(r),target:e}}getViewToTarget(t){let e=this.getWorldDirection(new p).multiplyScalar(this.targetOffset);return{position:t.clone().sub(e),target:t}}getViewToObject(t){let e=new p;return t.getWorldPosition(e),this.getViewToTarget(e)}setViewplaneSize(t,e,r=!1){if(this.aspect=t/e,r){let r=t>e?this.aspect:1,i=t>e?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-t,this.right=.5*t,this.top=.5*e,this.bottom=.5*-e;this.updateProjectionMatrix()}copyViewPlaneSize(t){this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let t=this._projectionTransition;if(void 0===t)return 1;let e=(performance.now()-t.start)/t.duration;return e>=1?1:e<=0?0:P(e)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return A.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=A.projectionTransitionMinAgeMs}_beginProjectionTransition(t){let e=this._projectionTransition;void 0===e&&(e={from:new h,blend:new h,blendInverse:new h,start:0,duration:A.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:t},this._projectionTransition=e),e.from.copy(this.projectionMatrix),e.start=performance.now(),e.duration=A.projectionTransitionDuration,e.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,t&&(e.requestRender=t),0!==e.raf&&cancelAnimationFrame(e.raf),e.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;let e=(performance.now()-t.start)/t.duration;if(e>=1)return void this._endProjectionTransition();let r=P(e),i=t.from.elements,a=this._activeSubCamera.projectionMatrix.elements,o=t.blend.elements,s=t.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*s),p=r*n/(r*n+(1-r)*Math.max(1e-6,a[15]-a[11]*s));for(let t=0;t<16;t++)o[t]=i[t]+(a[t]-i[t])*p;t.blendInverse.copy(t.blend).invert(),this.projectionMatrix=t.blend,this.projectionMatrixInverse=t.blendInverse}_endProjectionTransition(){let t=this._projectionTransition;if(void 0===t)return;0!==t.raf&&cancelAnimationFrame(t.raf),this._projectionTransition=void 0;let e=this._activeSubCamera;this.projectionMatrix=e.projectionMatrix,this.projectionMatrixInverse=e.projectionMatrixInverse}_syncProjectionTransition(t){let e=t._projectionTransition;if(void 0===e)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new h,blend:new h,blendInverse:new h,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(e.from),r.start=e.start,r.duration=e.duration,r.referenceDepth=e.referenceDepth,this._applyProjectionTransition()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,e,r,i,a,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(t,e,r,i,a,o):this.orthoCamera.setViewOffset(t,e,r,i,a,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,e){return super.copy(t,e),this.parent=t.parent,this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=null===t.view?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=a.sanitizeTargetOffset(t.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(t),this}toCameraState(t=[]){let e={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return i(e,t)}updateCameraSubtype(t,e){let r="perspective"===t?"PerspectiveCamera":"OrthographicCamera";void 0!==e.zoom&&this.setZoom(r,e.zoom),void 0!==e.near&&this.setNear(r,e.near),void 0!==e.fov&&"PerspectiveCamera"===r&&(this.fov=e.fov)}updateState(t,e){this.updateCameraState(t,e)}updateCameraState(t,e){this.updateState_Entity(t,e),void 0!==t.far&&(this.far=t.far),void 0!==t.orthographic&&this.updateCameraSubtype("orthographic",t.orthographic),void 0!==t.perspective&&this.updateCameraSubtype("perspective",t.perspective),void 0!==t.type&&(t.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(e?.shared.requestRender),this.cameraType=t.type),void 0!==t.up&&this.up.fromArray(t.up.map(t=>"number"==typeof t?t:0)),void 0!==t.targetOffset&&(this.targetOffset=a.sanitizeTargetOffset(t.targetOffset)),void 0!==t.isUpVectorFlipped&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(t,e,r){super.updateByPatchedOp(t,e,r),1===t.path.length&&0===t.type&&this.updateCameraSubtype(t.path[0],t.props)}toState(t){return{...super.toState(t),...this.toCameraState(t),type:this.cameraType}}},S=A;S.projectionTransitionsEnabled=!1,S.projectionTransitionDuration=350,S.projectionTransitionMinAgeMs=1e3;export{S as a};
@@ -1 +1 @@
1
- import{a as e,b as t}from"./runtime-chunk-DCHCPETD.js";import{c as s,d as o}from"./runtime-chunk-N4O4HFFU.js";import{ha as r}from"./runtime-chunk-QZSA6WBT.js";import{h as i,o as a,p as n,q as d,r as h,s as l,t as m,v as p}from"./runtime-chunk-MPHBANVQ.js";import{i as u}from"./runtime-chunk-2PT2WH66.js";import{Oc as c,bd as y,dd as g,ue as f}from"./runtime-chunk-BVVSZMXD.js";var b=new c,A=new c,M=new c,S=new c,v=new c;function w(e){let t=!1;return e.scene.objects.traverse((e,s)=>{"BooleanGeometry"===s.geometry?.type&&(t=!0)}),t}function D(e,t){let s=e.cloner;return void 0!==s&&s.parent===t?s:void 0}var x=new Float32Array(0);function B(e,t,s,o){let r=16*(t.children.length+1);x.length<r&&(x=new Float32Array(r));let i=0,a=e=>{e.toArray(x,16*i),i++},n=!0!==t.parameters.hideBase;n&&a(o),M.multiplyMatrices(e.hiddenMatrix,e.matrix);for(let e of t.children)!u(e)||!1===e.playModeVisible||(S.multiplyMatrices(e.hiddenMatrix,e.matrix).multiply(e.pivotMatrix),v.multiplyMatrices(M,S),(!n||!v.equals(o))&&a(v));try{return 0===i?0:m(s,x.subarray(0,16*i))}finally{l(s)}}var O,F=class extends r{constructor(e,t,s){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new g,this.onAfterRender=(e,t,s,o,r,i)=>{super.onAfterRender(e,t,s,o,r,i),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,s){super.updateByPatchedOp(e,t,s),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(s,o=!0){if(-1!==this.booleanMeshSetAddress&&!s)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof F&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===s,o)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof p&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){b.multiplyMatrices(t.hiddenMatrix,t.matrix).multiply(t.pivotMatrix);try{let e=D(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let r=a(t.geometry,!0===s,o);t.booleanMeshSetAddress=void 0===e||-1===r?r:B(t,e,r,b)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&h(t.booleanMeshSetAddress,b),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1}else t instanceof F&&!0===t.needsTransformForDownstream?(void 0===e?h(t.booleanMeshSetAddress,b):t.booleanMeshSetAddress=B(t,e,t.booleanMeshSetAddress,b),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(h(t.booleanMeshSetAddress,A.multiplyMatrices(b,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)continue;this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new g,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new y([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===s)return d(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new g,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=n(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}};(O||(O={})).is=function(e){return i.is(e)&&e instanceof f};var P=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}},T=e=>e instanceof p,j=e=>null!==e&&e instanceof F,k=e=>s.is(e);export{w as a,F as b,O as c,P as d,T as e,j as f,k as g};
1
+ import{a as e,b as t}from"./runtime-chunk-INLZ4T6V.js";import{c as s,d as o}from"./runtime-chunk-U4SSOL4Z.js";import{ha as r}from"./runtime-chunk-OYIE77GW.js";import{h as i,o as a,p as n,q as d,r as h,s as l,t as m,v as p}from"./runtime-chunk-F4XMOADV.js";import{i as u}from"./runtime-chunk-2PT2WH66.js";import{Oc as c,bd as y,dd as g,ue as f}from"./runtime-chunk-BVVSZMXD.js";var b=new c,A=new c,M=new c,S=new c,v=new c;function w(e){let t=!1;return e.scene.objects.traverse((e,s)=>{"BooleanGeometry"===s.geometry?.type&&(t=!0)}),t}function D(e,t){let s=e.cloner;return void 0!==s&&s.parent===t?s:void 0}var x=new Float32Array(0);function O(e,t,s,o){let r=16*(t.children.length+1);x.length<r&&(x=new Float32Array(r));let i=0,a=e=>{e.toArray(x,16*i),i++},n=!0!==t.parameters.hideBase;n&&a(o),M.multiplyMatrices(e.hiddenMatrix,e.matrix);for(let e of t.children)!u(e)||!1===e.playModeVisible||(S.multiplyMatrices(e.hiddenMatrix,e.matrix).multiply(e.pivotMatrix),v.multiplyMatrices(M,S),(!n||!v.equals(o))&&a(v));try{return 0===i?0:m(s,x.subarray(0,16*i))}finally{l(s)}}var B,F=class extends r{constructor(e,t,s){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new g,this.onAfterRender=(e,t,s,o,r,i)=>{super.onAfterRender(e,t,s,o,r,i),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,s){super.updateByPatchedOp(e,t,s),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(s,o=!0){if(-1!==this.booleanMeshSetAddress&&!s)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof F&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===s,o)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof p&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){b.multiplyMatrices(t.hiddenMatrix,t.matrix).multiply(t.pivotMatrix);try{let e=D(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let r=a(t.geometry,!0===s,o);t.booleanMeshSetAddress=void 0===e||-1===r?r:O(t,e,r,b)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&h(t.booleanMeshSetAddress,b),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1}else t instanceof F&&!0===t.needsTransformForDownstream?(void 0===e?h(t.booleanMeshSetAddress,b):t.booleanMeshSetAddress=O(t,e,t.booleanMeshSetAddress,b),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(h(t.booleanMeshSetAddress,A.multiplyMatrices(b,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(b).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)continue;this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new g,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new y([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===s)return d(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new g,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=n(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}};(B||(B={})).is=function(e){return i.is(e)&&e instanceof f};var P=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}},T=e=>e instanceof p,j=e=>null!==e&&e instanceof F,I=e=>s.is(e);export{w as a,F as b,B as c,P as d,T as e,j as f,I as g};
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-4BMKE6ES.js";import{ia as t}from"./runtime-chunk-QZSA6WBT.js";import{h as a}from"./runtime-chunk-MPHBANVQ.js";import{c as s,e as i,f as o}from"./runtime-chunk-2PT2WH66.js";import{c as r}from"./runtime-chunk-EFBUAWKV.js";import{Da as n,w as d}from"./runtime-chunk-K3UQCG3P.js";import{Fc as c}from"./runtime-chunk-BVVSZMXD.js";var l=new c;function u(e,t,s=!1){let i=[],c=a=>{let s=a.data;delete a.states,a.currentState=null,a.reversibleToState=null,a.currentTransitionEvent=null;for(let e of s.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=r.patch(s,t)}p(e.scene,a,null,t,void 0!==s.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),f(e)};e.scene.traverse2D(c),e.traverseChildren(r=>{if(s&&(r.rigidBody?.setTranslation(r.position0,!0),r.rigidBody?.setRotation(r.rotation0,!0),r.rigidBody?.setLinvel(l,!0),r.rigidBody?.setAngvel(l,!0)),!a.is(r))return;let u=r.uuid,f=r.data;if(delete r.states,r.uuid===d)return;let m=!1;i.some(t=>e.scene.find(u)?.isDescendantOf(t))?m=!0:!0===f.physics?.fusedBody&&"dynamic"===f.physics.rigidBody&&i.push(u),r.data=f,r.currentState=null,r.reversibleToState=null,r.currentTransitionEvent=null,r.transitionState={settled:!0,state:null};for(let t of f.states){let a={...t.data};!0===e.data.globalPhysics.usePhysics&&f.physics&&("dynamic"===f.physics.rigidBody||m)&&(void 0!==t.data.position&&delete a.position,void 0!==t.data.rotation&&delete a.rotation,void 0!==t.data.hiddenMatrix&&delete a.hiddenMatrix),r.states||(r.states={}),r.states[t.id]=n.patch(f,a)}p(e.scene,r,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),o(r)&&r.frame&&(r.frame.traverse(e=>c(e)),r.uiCanvas?.applySize())}),f(e),e.frame&&(e.frame.traverse(e=>c(e)),e.uiCanvas?.applySize())}function f(e){e.traverseEntity(t=>{for(let a of t.data.events){let t=[];switch(a.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...a.data.actions);break;case"GameControl":for(let e of Object.values(a.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...a.data.dragDropActions.drag,...a.data.dragDropActions.drop);break;case"Conditional":t.push(...a.data.inActions,...a.data.outActions)}for(let a of t)if("Create"===a.data.type&&"Yes"===a.data.hideBase){let t=e.scene.find(a.data.object);t&&(t.visible=!1)}}})}function p(a,o,r,n,d=!1){if(a.markShadowsDirty(),o instanceof t&&!s(o)&&o.removeInteractionGeometry(n),i(o)?o.changeSelectedState(r,{shared:n},d):o.changeSelectedState(r,{scene:a,shared:n},d),o instanceof t&&o.updateGeometryGroupsIfNeeded(),o instanceof e&&o.updateCameraState(o.dataPatched,{scene:a,shared:n}),!i(o)){if(o.cloner){let e=!1;for(let t of o.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(o),o.cloner.syncInstanceMatrices()}o.updateVisible()}}export{u as a};
1
+ import{a as e}from"./runtime-chunk-ISDQFD3B.js";import{ia as t}from"./runtime-chunk-OYIE77GW.js";import{h as a}from"./runtime-chunk-F4XMOADV.js";import{c as s,e as i,f as o}from"./runtime-chunk-2PT2WH66.js";import{c as r}from"./runtime-chunk-EFBUAWKV.js";import{Da as n,w as d}from"./runtime-chunk-K3UQCG3P.js";import{Fc as c}from"./runtime-chunk-BVVSZMXD.js";var l=new c;function u(e,t,s=!1){let i=[],c=a=>{let s=a.data;delete a.states,a.currentState=null,a.reversibleToState=null,a.currentTransitionEvent=null;for(let e of s.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=r.patch(s,t)}p(e.scene,a,null,t,void 0!==s.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),f(e)};e.scene.traverse2D(c),e.traverseChildren(r=>{if(s&&(r.rigidBody?.setTranslation(r.position0,!0),r.rigidBody?.setRotation(r.rotation0,!0),r.rigidBody?.setLinvel(l,!0),r.rigidBody?.setAngvel(l,!0)),!a.is(r))return;let u=r.uuid,f=r.data;if(delete r.states,r.uuid===d)return;let m=!1;i.some(t=>e.scene.find(u)?.isDescendantOf(t))?m=!0:!0===f.physics?.fusedBody&&"dynamic"===f.physics.rigidBody&&i.push(u),r.data=f,r.currentState=null,r.reversibleToState=null,r.currentTransitionEvent=null,r.transitionState={settled:!0,state:null};for(let t of f.states){let a={...t.data};!0===e.data.globalPhysics.usePhysics&&f.physics&&("dynamic"===f.physics.rigidBody||m)&&(void 0!==t.data.position&&delete a.position,void 0!==t.data.rotation&&delete a.rotation,void 0!==t.data.hiddenMatrix&&delete a.hiddenMatrix),r.states||(r.states={}),r.states[t.id]=n.patch(f,a)}p(e.scene,r,null,t,void 0!==f.events.find(e=>"Follow"===e.data.type||"LookAt"===e.data.type)),o(r)&&r.frame&&(r.frame.traverse(e=>c(e)),r.uiCanvas?.applySize())}),f(e),e.frame&&(e.frame.traverse(e=>c(e)),e.uiCanvas?.applySize())}function f(e){e.traverseEntity(t=>{for(let a of t.data.events){let t=[];switch(a.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":t.push(...a.data.actions);break;case"GameControl":for(let e of Object.values(a.data.gameActions))t.push(...e);break;case"DragDrop":t.push(...a.data.dragDropActions.drag,...a.data.dragDropActions.drop);break;case"Conditional":t.push(...a.data.inActions,...a.data.outActions)}for(let a of t)if("Create"===a.data.type&&"Yes"===a.data.hideBase){let t=e.scene.find(a.data.object);t&&(t.visible=!1)}}})}function p(a,o,r,n,d=!1){if(a.markShadowsDirty(),o instanceof t&&!s(o)&&o.removeInteractionGeometry(n),i(o)?o.changeSelectedState(r,{shared:n},d):o.changeSelectedState(r,{scene:a,shared:n},d),o instanceof t&&o.updateGeometryGroupsIfNeeded(),o instanceof e&&o.updateCameraState(o.dataPatched,{scene:a,shared:n}),!i(o)){if(o.cloner){let e=!1;for(let t of o.cloner.children)t.playModeVisible=void 0,void 0!==t.transformOverride&&(t.transformOverride=void 0,e=!0);e&&a.addPendingUpdateCloner(o),o.cloner.syncInstanceMatrices()}o.updateVisible()}}export{u as a};
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{_ as o}from"./runtime-chunk-QZSA6WBT.js";import{Dc as n,Fc as t,Jc as r}from"./runtime-chunk-BVVSZMXD.js";function s(e){return!0===e?.depthPrepass}var i=!0;try{i="0"!==new URLSearchParams(window.location.search).get("dbgdepthprepass")}catch{}function a(e){return i&&e.transparent&&e.depthTest&&!e.wireframe&&!e.shapeBlend&&!function(e){let o=e?.layers;if(!o)return!1;for(let e of o)if("transmission"===e.data.type&&e.data.visible)return!0;return!1}(e.data)}var c={enabled:!1},l=new WeakMap;function u(e){if(!c.enabled)return e;let o=l.get(e);return o||(o={...e,bloom:{...e.bloom,kernelSize:0},depthOfField:{...e.depthOfField,enabled:!1}},l.set(e,o)),o}var f=new WeakSet;function p(e){if(!e.isPointLight&&!e.isSpotLight&&!e.isDirectionalLight)return!1;if(c.enabled){if(!0===e.castShadow)return e.castShadow=!1,f.add(e),!0}else if(f.has(e)&&(f.delete(e),!1===e.castShadow))return e.castShadow=!0,!0;return!1}function h(s,i){switch(s.type){case"cavity":return function(e,o){return{...d(e,o),ridge:e.ridge,valley:e.valley}}(s,i);case"dust":return function(n,t){return{...d(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}}(s,i);case"fresnel":return function(o,n){let{bias:t,scale:r,intensity:s,factor:i,color:a}=o;return{...d(o,n),color:e(a,n),bias:t,scale:r,intensity:s,factor:i}}(s,i);case"gradient":return function(e,o){let{gradientType:t,smooth:s,colors:i,steps:a,angle:c,offset:l,morph:u}=e;return{...d(e,o),gradientType:t,smooth:s,colors:i.map(e=>new r(e[0],e[1],e[2],e[3])),num:i.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}}(s,i);case"depth":return function(e,o){let{gradientType:n,near:s,far:i,isVector:a,isWorldSpace:c,origin:l,direction:u,colors:f,steps:p,smooth:h}=e;return{...d(e,o),gradientType:n,near:s,far:i,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:h}}(s,i);case"normal":return function(e,o){let{cnormal:n}=e;return{...d(e,o),cnormal:new t(n[0],n[1],n[2])}}(s,i);case"noise":return function(o,r){return{...d(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}}(s,i);case"rainbow":return function(e,o){return{...d(e,o),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new t(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new t(...e.offset)}}(s,i);case"toon":return function(o,n){return{...d(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)}}(s,i);case"outline":return function(o,n){return{...d(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}}(s,i);case"transmission":return function(o,n){return{...d(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}}(s,i);case"reflection":return function(e,n){return{...d(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}}(s,i);case"pattern":return function(o,t){return{...d(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}}(s,i);case"vertexColor":return d(s,i);default:return function(o,n){return{...d(o,n),color:e(o.color,n)}}(s,i)}}function m(e){return{type:e.type}}function d(e,o){let{alpha:n,mode:t,isMask:r}=e,s="string"==typeof n?Number(o.getVariable(n)??100)/100:n;return{...m(e),alpha:s,mode:t,isMask:r}}export{s as a,a as b,c,u as d,p as e,h as f};
1
+ import{a as e}from"./runtime-chunk-TU4KDRKR.js";import{_ as o}from"./runtime-chunk-OYIE77GW.js";import{Dc as n,Fc as t,Jc as r}from"./runtime-chunk-BVVSZMXD.js";function s(e){return!0===e?.depthPrepass}var i=!0;try{i="0"!==new URLSearchParams(window.location.search).get("dbgdepthprepass")}catch{}function a(e){return i&&e.transparent&&e.depthTest&&!e.wireframe&&!e.shapeBlend&&!function(e){let o=e?.layers;if(!o)return!1;for(let e of o)if("transmission"===e.data.type&&e.data.visible)return!0;return!1}(e.data)}var c={enabled:!1},l=new WeakMap;function u(e){if(!c.enabled)return e;let o=l.get(e);return o||(o={...e,bloom:{...e.bloom,kernelSize:0},depthOfField:{...e.depthOfField,enabled:!1}},l.set(e,o)),o}var f=new WeakSet;function p(e){if(!e.isPointLight&&!e.isSpotLight&&!e.isDirectionalLight)return!1;if(c.enabled){if(!0===e.castShadow)return e.castShadow=!1,f.add(e),!0}else if(f.has(e)&&(f.delete(e),!1===e.castShadow))return e.castShadow=!0,!0;return!1}function h(s,i){switch(s.type){case"cavity":return function(e,o){return{...d(e,o),ridge:e.ridge,valley:e.valley}}(s,i);case"dust":return function(n,t){return{...d(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}}(s,i);case"fresnel":return function(o,n){let{bias:t,scale:r,intensity:s,factor:i,color:a}=o;return{...d(o,n),color:e(a,n),bias:t,scale:r,intensity:s,factor:i}}(s,i);case"gradient":return function(e,o){let{gradientType:t,smooth:s,colors:i,steps:a,angle:c,offset:l,morph:u}=e;return{...d(e,o),gradientType:t,smooth:s,colors:i.map(e=>new r(e[0],e[1],e[2],e[3])),num:i.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}}(s,i);case"depth":return function(e,o){let{gradientType:n,near:s,far:i,isVector:a,isWorldSpace:c,origin:l,direction:u,colors:f,steps:p,smooth:h}=e;return{...d(e,o),gradientType:n,near:s,far:i,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:h}}(s,i);case"normal":return function(e,o){let{cnormal:n}=e;return{...d(e,o),cnormal:new t(n[0],n[1],n[2])}}(s,i);case"noise":return function(o,r){return{...d(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}}(s,i);case"rainbow":return function(e,o){return{...d(e,o),filmThickness:e.filmThickness,movement:e.movement,wavelengths:new t(...e.wavelengths),noiseStrength:e.noiseStrength,noiseScale:e.noiseScale,offset:new t(...e.offset)}}(s,i);case"toon":return function(o,n){return{...d(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)}}(s,i);case"outline":return function(o,n){return{...d(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}}(s,i);case"transmission":return function(o,n){return{...d(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}}(s,i);case"reflection":return function(e,n){return{...d(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}}(s,i);case"pattern":return function(o,t){return{...d(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}}(s,i);case"vertexColor":return d(s,i);default:return function(o,n){return{...d(o,n),color:e(o.color,n)}}(s,i)}}function m(e){return{type:e.type}}function d(e,o){let{alpha:n,mode:t,isMask:r}=e,s="string"==typeof n?Number(o.getVariable(n)??100)/100:n;return{...m(e),alpha:s,mode:t,isMask:r}}export{s as a,a as b,c,u as d,p as e,h as f};
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-YDJBLHAS.js";import{b as e}from"./runtime-chunk-AASXNCLC.js";import{G as i,da as r}from"./runtime-chunk-QZSA6WBT.js";import{f as n,v as s}from"./runtime-chunk-MPHBANVQ.js";import{c as a}from"./runtime-chunk-RTLL6WIB.js";import{c as o}from"./runtime-chunk-2PT2WH66.js";import{L as l}from"./runtime-chunk-K3UQCG3P.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-BVVSZMXD.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,A=1/6,j=(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,z=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}},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},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},B=new c,T=new c,V=new c,k=new c;function R(t,e){let i=V.fromArray(t),r=k.fromArray(e);T.copy(r).sub(i);let n=T.length();return T.normalize().multiplyScalar(.5*n),B.copy(i).add(T).toArray()}var I,U,D,L,q=new f,E=new c,G=new c,$=new c,H=class extends y{},Q=class extends H{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){}},Z=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=Z(c),n=Z(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+=Z(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()}},J=1e-4,K=new c,Y=new c;i.then(t=>{U=[(I=t).get_face_center,I.get_edge_midpoint,I.get_vertex_position],D=[I.get_face_normal,I.get_edge_normal,I.get_vertex_normal],L=[I.face_count,I.edge_count,I.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=j(t+b),g=j(s+b),M=j(a+b),v=(x+g+M)*A,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+A,z=F-u+A,C=_-p+A,O=S-m+2*A,N=F-f+2*A,P=_-y+2*A,B=S-1+.5,T=F-1+.5,V=_-1+.5,k=255&x,R=255&g,I=255&M,U=.6-S*S-F*F-_*_;if(U<0)o=0;else{let t=k+e[R+e[I]];U*=U,o=U*U*(i[t]*S+r[t]*F+n[t]*_)}let D=.6-W*W-z*z-C*C;if(D<0)l=0;else{let t=k+c+e[R+u+e[I+p]];D*=D,l=D*D*(i[t]*W+r[t]*z+n[t]*C)}let L=.6-O*O-N*N-P*P;if(L<0)h=0;else{let t=k+m+e[R+f+e[I+y]];L*=L,h=L*L*(i[t]*O+r[t]*N+n[t]*P)}let q=.6-B*B-T*T-V*V;if(q<0)d=0;else{let t=k+1+e[R+1+e[I+1]];q*=q,d=q*q*(i[t]*B+r[t]*T+n[t]*V)}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=j(t+d),u=j(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,A=255&u,S=.5-m*m-f*f;if(S>=0){let t=w+e[A];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[A+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[A+1];_*=_,h=_*_*(i[t]*x+r[t]*g)}return 70*(o+l+h)}}((0,g.default)(t.seed??""))}},At=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 r&&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||o(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 Q(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 i;if(void 0!==e)i=e;else{let e=vt(this.parameters.grid.count,t);i="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 i=0;if(this.children.length!==i)if(this.children.length<i)for(let t=0,e=i-this.children.length;t<e;++t){let t=new r(this.object);t.expand(),this.add(t)}else for(;this.children.length>i;){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]))||J,e.scale.y=m[1]+M(l,P(a,y[1]))||J,e.scale.z=m[2]+M(l,P(a,y[2]))||J;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]))||J,e.scale.y=1+(n[1]-1)*t+m(l,P(r,d[1]))||J,e.scale.z=1+(n[2]-1)*t+m(l,P(r,d[2]))||J,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]))||J,c.scale.y=1+d(i,P(u,s[1]))||J,c.scale.z=1+d(i,P(u,s[2]))||J;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]))||J,l.scale.y=1+d(i,P(c,s[1]))||J,l.scale.z=1+d(i,P(c,s[2]))||J;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=C[n.axis],w=this.children;ot.fromArray(v),it.copy(this.object.hiddenMatrix).invert();let A=this.objectForSample instanceof e;A&&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)),A&&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 j=Math.acos(v.dot(ot)),S=ct.crossVectors(ot,v).normalize(),F=tt.makeRotationAxis(S,j);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]))||J,1+o[1]+y(s,P(r,m[1]))||J,1+o[2]+y(s,P(r,m[2]))||J),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 z(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=L[i],n=U[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);K.fromArray(i).applyMatrix4(e.matrixWorld),Y.fromArray(r),s(K.toArray(),Y.toArray())}}else(r.index?function(t){let e=[],i=Math.floor(t.index.count/3);for(let r=0;r<i;r++)if(E.fromArray(t.index.array,3*r),q.setFromAttributeAndIndices(t.attributes.position,E.x,E.y,E.z),q.getNormal(G),q.getMidpoint($),!(isNaN($.x)||isNaN($.y)||isNaN($.z))){let{a:t,b:i,c:r}=q,n=t.toArray(),s=i.toArray(),a=r.toArray(),o=t.distanceTo(i),l=i.distanceTo(r),h=r.distanceTo(t),d=R(n,s),c=R(s,a),u=R(a,n),p=[o,l,h],m=Math.max(...p),f=p.filter(t=>Math.round(t)===Math.round(m)).length>1,y=[],b=q.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:q.getNormal(G).toArray()})}return e}(r):function(t){let e=[],{position:i}=t.attributes;for(let t=0;t<i.count;t++){q.setFromAttributeAndIndices(i,3*t,3*t+1,3*t+2),q.getNormal(G),q.getMidpoint($);let r=q.a.toArray(),n=q.b.toArray(),s=q.c.toArray();e.push({vertices:[r,n,s],faceCenters:[R(r,n),R(n,s),R(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=a(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{At as a};
1
+ import{a as t}from"./runtime-chunk-2JD7RQUT.js";import{b as e}from"./runtime-chunk-4BGTCDLP.js";import{G as i,da as r}from"./runtime-chunk-OYIE77GW.js";import{f as n,v as s}from"./runtime-chunk-F4XMOADV.js";import{c as a}from"./runtime-chunk-RTLL6WIB.js";import{c as o}from"./runtime-chunk-2PT2WH66.js";import{L as l}from"./runtime-chunk-K3UQCG3P.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-BVVSZMXD.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,z=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}},O={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},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},T=new c,V=new c,B=new c,k=new c;function R(t,e){let i=B.fromArray(t),r=k.fromArray(e);V.copy(r).sub(i);let n=V.length();return V.normalize().multiplyScalar(.5*n),T.copy(i).add(V).toArray()}var D,I,U,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)),Z=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()}},J=1e-4,K=new c,Y=new c;i.then(t=>{I=[(D=t).get_face_center,D.get_edge_midpoint,D.get_vertex_position],U=[D.get_face_normal,D.get_edge_normal,D.get_vertex_normal],q=[D.face_count,D.edge_count,D.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 Z,"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,z=F-u+j,O=_-p+j,C=S-m+2*j,P=F-f+2*j,N=_-y+2*j,T=S-1+.5,V=F-1+.5,B=_-1+.5,k=255&x,R=255&g,D=255&M,I=.6-S*S-F*F-_*_;if(I<0)o=0;else{let t=k+e[R+e[D]];I*=I,o=I*I*(i[t]*S+r[t]*F+n[t]*_)}let U=.6-W*W-z*z-O*O;if(U<0)l=0;else{let t=k+c+e[R+u+e[D+p]];U*=U,l=U*U*(i[t]*W+r[t]*z+n[t]*O)}let q=.6-C*C-P*P-N*N;if(q<0)h=0;else{let t=k+m+e[R+f+e[D+y]];q*=q,h=q*q*(i[t]*C+r[t]*P+n[t]*N)}let E=.6-T*T-V*V-B*B;if(E<0)d=0;else{let t=k+1+e[R+1+e[D+1]];E*=E,d=E*E*(i[t]*T+r[t]*V+n[t]*B)}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 r&&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||o(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 i;if(void 0!==e)i=e;else{let e=vt(this.parameters.grid.count,t);i="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 i=0;if(this.children.length!==i)if(this.children.length<i)for(let t=0,e=i-this.children.length;t<e;++t){let t=new r(this.object);t.expand(),this.add(t)}else for(;this.children.length>i;){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]))||J,e.scale.y=m[1]+M(l,N(a,y[1]))||J,e.scale.z=m[2]+M(l,N(a,y[2]))||J;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]))||J,e.scale.y=1+(n[1]-1)*t+m(l,N(r,d[1]))||J,e.scale.z=1+(n[2]-1)*t+m(l,N(r,d[2]))||J,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]))||J,c.scale.y=1+d(i,N(u,s[1]))||J,c.scale.z=1+d(i,N(u,s[2]))||J;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]))||J,l.scale.y=1+d(i,N(c,s[1]))||J,l.scale.z=1+d(i,N(c,s[2]))||J;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=O[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 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,N(r,m[0]))||J,1+o[1]+y(s,N(r,m[1]))||J,1+o[2]+y(s,N(r,m[2]))||J),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 z(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=q[i],n=I[i],a=U[i],o=r(e.subdivPointerNew);for(let t=0;t<=o-1;t++){let i=n(e.subdivPointerNew,t),r=a(e.subdivPointerNew,t);K.fromArray(i).applyMatrix4(e.matrixWorld),Y.fromArray(r),s(K.toArray(),Y.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=R(n,s),c=R(s,a),u=R(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:[R(r,n),R(n,s),R(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=a(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};