@splinetool/runtime 2.0.2 → 2.0.4

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 (349) hide show
  1. package/build/boolean.js +24 -0
  2. package/build/boolean.js.br +0 -0
  3. package/build/boolean.js.gz +0 -0
  4. package/build/boolean.wasm +0 -0
  5. package/build/boolean.wasm.br +0 -0
  6. package/build/boolean.wasm.gz +0 -0
  7. package/build/hana-ui.js +78 -46
  8. package/build/hana-ui.js.br +0 -0
  9. package/build/hana-ui.js.gz +0 -0
  10. package/build/hana-ui.wasm +0 -0
  11. package/build/hana-ui.wasm.br +0 -0
  12. package/build/hana-ui.wasm.gz +0 -0
  13. package/build/runtime-aiAssistant-RMA2DMFU.js +1 -0
  14. package/build/runtime-aiAssistant-RMA2DMFU.js.br +0 -0
  15. package/build/runtime-aiAssistant-RMA2DMFU.js.gz +0 -0
  16. package/build/runtime-apiServices-KA4FEP5Y.js +1 -0
  17. package/build/runtime-apiServices-KA4FEP5Y.js.br +0 -0
  18. package/build/runtime-apiServices-KA4FEP5Y.js.gz +0 -0
  19. package/build/{runtime-audio-Y3GYW4YQ.js → runtime-audio-BQSRM3W2.js} +1 -1
  20. package/build/runtime-audio-BQSRM3W2.js.br +0 -0
  21. package/build/runtime-audio-BQSRM3W2.js.gz +0 -0
  22. package/build/runtime-chunk-2PT2WH66.js +1 -0
  23. package/build/runtime-chunk-2PT2WH66.js.br +0 -0
  24. package/build/runtime-chunk-2PT2WH66.js.gz +0 -0
  25. package/build/{runtime-chunk-P2XISQYQ.js → runtime-chunk-36FZTFCC.js} +1 -1
  26. package/build/runtime-chunk-36FZTFCC.js.br +0 -0
  27. package/build/runtime-chunk-36FZTFCC.js.gz +0 -0
  28. package/build/runtime-chunk-3J5YHSQW.js +1 -0
  29. package/build/runtime-chunk-3J5YHSQW.js.br +0 -0
  30. package/build/runtime-chunk-3J5YHSQW.js.gz +0 -0
  31. package/build/{runtime-chunk-FF5REN2J.js → runtime-chunk-4I22JDL6.js} +1 -1
  32. package/build/runtime-chunk-4I22JDL6.js.br +0 -0
  33. package/build/runtime-chunk-4I22JDL6.js.gz +0 -0
  34. package/build/{runtime-chunk-Z5OH244S.js → runtime-chunk-5XUI4Z6R.js} +1 -1
  35. package/build/runtime-chunk-5XUI4Z6R.js.br +0 -0
  36. package/build/runtime-chunk-5XUI4Z6R.js.gz +0 -0
  37. package/build/runtime-chunk-6UUF5VIS.js +1 -0
  38. package/build/runtime-chunk-6UUF5VIS.js.br +0 -0
  39. package/build/runtime-chunk-6UUF5VIS.js.gz +0 -0
  40. package/build/{runtime-chunk-P3254QGK.js → runtime-chunk-CIBY4YG3.js} +1 -1
  41. package/build/runtime-chunk-CIBY4YG3.js.br +0 -0
  42. package/build/runtime-chunk-CIBY4YG3.js.gz +0 -0
  43. package/build/{runtime-chunk-MRUNX43X.js → runtime-chunk-DKGQ6OYZ.js} +1 -1
  44. package/build/runtime-chunk-DKGQ6OYZ.js.br +0 -0
  45. package/build/runtime-chunk-DKGQ6OYZ.js.gz +0 -0
  46. package/build/{runtime-chunk-A2LYIKKC.js → runtime-chunk-DSJY3WL2.js} +1 -1
  47. package/build/{runtime-chunk-A2LYIKKC.js.br → runtime-chunk-DSJY3WL2.js.br} +0 -0
  48. package/build/runtime-chunk-DSJY3WL2.js.gz +0 -0
  49. package/build/{runtime-chunk-RQ3ZQR4P.js → runtime-chunk-ESZD4IRS.js} +1 -1
  50. package/build/runtime-chunk-ESZD4IRS.js.br +0 -0
  51. package/build/runtime-chunk-ESZD4IRS.js.gz +0 -0
  52. package/build/{runtime-chunk-OEXC34HT.js → runtime-chunk-GPACKOH2.js} +1 -1
  53. package/build/runtime-chunk-GPACKOH2.js.br +0 -0
  54. package/build/runtime-chunk-GPACKOH2.js.gz +0 -0
  55. package/build/{runtime-chunk-BJVCOW72.js → runtime-chunk-I5QFGBIU.js} +1 -1
  56. package/build/runtime-chunk-I5QFGBIU.js.br +0 -0
  57. package/build/runtime-chunk-I5QFGBIU.js.gz +0 -0
  58. package/build/{runtime-chunk-HJS3VFEN.js → runtime-chunk-JNSHQPHC.js} +1 -1
  59. package/build/runtime-chunk-JNSHQPHC.js.br +0 -0
  60. package/build/runtime-chunk-JNSHQPHC.js.gz +0 -0
  61. package/build/{runtime-chunk-JFYHGEDN.js → runtime-chunk-LT4UVXE2.js} +1 -1
  62. package/build/runtime-chunk-LT4UVXE2.js.br +0 -0
  63. package/build/runtime-chunk-LT4UVXE2.js.gz +0 -0
  64. package/build/{runtime-chunk-PPLLJM75.js → runtime-chunk-NTW4X3NC.js} +1 -1
  65. package/build/runtime-chunk-NTW4X3NC.js.br +0 -0
  66. package/build/runtime-chunk-NTW4X3NC.js.gz +0 -0
  67. package/build/runtime-chunk-OOC7YSI5.js +1 -0
  68. package/build/runtime-chunk-OOC7YSI5.js.br +0 -0
  69. package/build/runtime-chunk-OOC7YSI5.js.gz +0 -0
  70. package/build/runtime-chunk-QVC5UDJO.js +1 -0
  71. package/build/runtime-chunk-QVC5UDJO.js.br +0 -0
  72. package/build/runtime-chunk-QVC5UDJO.js.gz +0 -0
  73. package/build/runtime-chunk-R7NC6CZZ.js +1 -0
  74. package/build/runtime-chunk-R7NC6CZZ.js.br +0 -0
  75. package/build/runtime-chunk-R7NC6CZZ.js.gz +0 -0
  76. package/build/{runtime-chunk-VRVV54WH.js → runtime-chunk-RF63UVAU.js} +1 -1
  77. package/build/runtime-chunk-RF63UVAU.js.br +0 -0
  78. package/build/runtime-chunk-RF63UVAU.js.gz +0 -0
  79. package/build/{runtime-chunk-TDCFE5IE.js → runtime-chunk-SL64ZYCB.js} +1 -1
  80. package/build/runtime-chunk-SL64ZYCB.js.br +0 -0
  81. package/build/runtime-chunk-SL64ZYCB.js.gz +0 -0
  82. package/build/{runtime-chunk-I47C4XJU.js → runtime-chunk-TPKGBIJU.js} +1 -1
  83. package/build/runtime-chunk-TPKGBIJU.js.br +0 -0
  84. package/build/runtime-chunk-TPKGBIJU.js.gz +0 -0
  85. package/build/{runtime-chunk-LSURXI4Y.js → runtime-chunk-V5NUL7BL.js} +1 -1
  86. package/build/runtime-chunk-V5NUL7BL.js.br +1 -0
  87. package/build/runtime-chunk-V5NUL7BL.js.gz +0 -0
  88. package/build/{runtime-chunk-OLJVVNDS.js → runtime-chunk-V7XDOE2W.js} +1 -1
  89. package/build/runtime-chunk-V7XDOE2W.js.br +0 -0
  90. package/build/runtime-chunk-V7XDOE2W.js.gz +0 -0
  91. package/build/{runtime-chunk-QHPFAHXN.js → runtime-chunk-W4ZCHGLQ.js} +1 -1
  92. package/build/runtime-chunk-W4ZCHGLQ.js.br +0 -0
  93. package/build/runtime-chunk-W4ZCHGLQ.js.gz +0 -0
  94. package/build/runtime-chunk-WHKBOV2O.js +1 -0
  95. package/build/runtime-chunk-WHKBOV2O.js.br +0 -0
  96. package/build/runtime-chunk-WHKBOV2O.js.gz +0 -0
  97. package/build/{runtime-chunk-E6JCDSXC.js → runtime-chunk-WMWQXAOH.js} +1 -1
  98. package/build/runtime-chunk-WMWQXAOH.js.br +0 -0
  99. package/build/runtime-chunk-WMWQXAOH.js.gz +0 -0
  100. package/build/runtime-chunk-YFAATRJU.js +1 -0
  101. package/build/runtime-chunk-YFAATRJU.js.br +0 -0
  102. package/build/runtime-chunk-YFAATRJU.js.gz +0 -0
  103. package/build/runtime-chunk-ZJPGZKPX.js +1 -0
  104. package/build/runtime-chunk-ZJPGZKPX.js.br +0 -0
  105. package/build/runtime-chunk-ZJPGZKPX.js.gz +0 -0
  106. package/build/{runtime-chunk-2SYZJBYJ.js → runtime-chunk-ZMXEX5NX.js} +1 -1
  107. package/build/runtime-chunk-ZMXEX5NX.js.br +0 -0
  108. package/build/runtime-chunk-ZMXEX5NX.js.gz +0 -0
  109. package/build/{runtime-classicRuntime-AMAXBOXT.js → runtime-classicRuntime-UOZ6RID5.js} +1 -1
  110. package/build/runtime-classicRuntime-UOZ6RID5.js.br +0 -0
  111. package/build/runtime-classicRuntime-UOZ6RID5.js.gz +0 -0
  112. package/build/runtime-cloners-DALMNZYL.js +1 -0
  113. package/build/runtime-cloners-DALMNZYL.js.br +0 -0
  114. package/build/runtime-cloners-DALMNZYL.js.gz +0 -0
  115. package/build/{runtime-components-EPAMFKSB.js → runtime-components-IGNRKI6T.js} +1 -1
  116. package/build/runtime-components-IGNRKI6T.js.br +0 -0
  117. package/build/runtime-components-IGNRKI6T.js.gz +0 -0
  118. package/build/runtime-conditional-DCOFCW5I.js +1 -0
  119. package/build/runtime-conditional-DCOFCW5I.js.br +0 -0
  120. package/build/runtime-conditional-DCOFCW5I.js.gz +0 -0
  121. package/build/{runtime-createDestroy-HLHRAAC4.js → runtime-createDestroy-JLB7IIQL.js} +1 -1
  122. package/build/runtime-createDestroy-JLB7IIQL.js.br +0 -0
  123. package/build/runtime-createDestroy-JLB7IIQL.js.gz +0 -0
  124. package/build/{runtime-dragDrop-K6LWK7FL.js → runtime-dragDrop-ERDSNA3S.js} +1 -1
  125. package/build/runtime-dragDrop-ERDSNA3S.js.br +0 -0
  126. package/build/runtime-dragDrop-ERDSNA3S.js.gz +0 -0
  127. package/build/runtime-gameControls-XKOQVZZC.js +1 -0
  128. package/build/runtime-gameControls-XKOQVZZC.js.br +0 -0
  129. package/build/runtime-gameControls-XKOQVZZC.js.gz +0 -0
  130. package/build/runtime-hair-EOZHA2BH.js +1 -0
  131. package/build/runtime-hair-EOZHA2BH.js.br +0 -0
  132. package/build/runtime-hair-EOZHA2BH.js.gz +0 -0
  133. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js +1 -0
  134. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.br +0 -0
  135. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.gz +0 -0
  136. package/build/{runtime-miscActions-L7BIGLEB.js → runtime-miscActions-KIRLTM7C.js} +1 -1
  137. package/build/runtime-miscActions-KIRLTM7C.js.br +0 -0
  138. package/build/runtime-miscActions-KIRLTM7C.js.gz +0 -0
  139. package/build/runtime-mouseHover-WULIJFG2.js +1 -0
  140. package/build/runtime-mouseHover-WULIJFG2.js.br +0 -0
  141. package/build/runtime-mouseHover-WULIJFG2.js.gz +0 -0
  142. package/build/{runtime-particles-W7YEQWJI.js → runtime-particles-NNV35DLD.js} +1 -1
  143. package/build/runtime-particles-NNV35DLD.js.br +0 -0
  144. package/build/runtime-particles-NNV35DLD.js.gz +0 -0
  145. package/build/{runtime-paths-CK327WCT.js → runtime-paths-RRXZ3PXM.js} +1 -1
  146. package/build/runtime-paths-RRXZ3PXM.js.br +0 -0
  147. package/build/runtime-paths-RRXZ3PXM.js.gz +0 -0
  148. package/build/runtime-resize-V6LZSOZB.js +1 -0
  149. package/build/runtime-resize-V6LZSOZB.js.br +0 -0
  150. package/build/runtime-resize-V6LZSOZB.js.gz +0 -0
  151. package/build/{runtime-sceneTransition-7AG4A4P5.js → runtime-sceneTransition-CP5TI3VP.js} +1 -1
  152. package/build/runtime-sceneTransition-CP5TI3VP.js.br +0 -0
  153. package/build/runtime-sceneTransition-CP5TI3VP.js.gz +0 -0
  154. package/build/{runtime-scroll-MNQPPLQL.js → runtime-scroll-Q7VGS5NM.js} +1 -1
  155. package/build/runtime-scroll-Q7VGS5NM.js.br +0 -0
  156. package/build/runtime-scroll-Q7VGS5NM.js.gz +0 -0
  157. package/build/runtime-shapeBlends-UN7GGFRG.js +1 -0
  158. package/build/runtime-shapeBlends-UN7GGFRG.js.br +0 -0
  159. package/build/runtime-shapeBlends-UN7GGFRG.js.gz +0 -0
  160. package/build/{runtime-text-5RIKJ4US.js → runtime-text-N6XLUSM2.js} +1 -1
  161. package/build/runtime-text-N6XLUSM2.js.br +0 -0
  162. package/build/runtime-text-N6XLUSM2.js.gz +0 -0
  163. package/build/{runtime-textInputs-YBGYTAMD.js → runtime-textInputs-IW2E6BNU.js} +1 -1
  164. package/build/runtime-textInputs-IW2E6BNU.js.br +0 -0
  165. package/build/runtime-textInputs-IW2E6BNU.js.gz +0 -0
  166. package/build/runtime-timeline-JA2JZIS7.js +1 -0
  167. package/build/runtime-timeline-JA2JZIS7.js.br +0 -0
  168. package/build/runtime-timeline-JA2JZIS7.js.gz +0 -0
  169. package/build/{runtime-tracking-2BXFBQQY.js → runtime-tracking-M57J2PGK.js} +1 -1
  170. package/build/runtime-tracking-M57J2PGK.js.br +0 -0
  171. package/build/runtime-tracking-M57J2PGK.js.gz +0 -0
  172. package/build/{runtime-transitions-6PZW2QIW.js → runtime-transitions-PELRDE7B.js} +1 -1
  173. package/build/runtime-transitions-PELRDE7B.js.br +0 -0
  174. package/build/runtime-transitions-PELRDE7B.js.gz +0 -0
  175. package/build/runtime-ui2d-IOB5Y76W.js +1 -0
  176. package/build/runtime-ui2d-IOB5Y76W.js.br +0 -0
  177. package/build/runtime-ui2d-IOB5Y76W.js.gz +0 -0
  178. package/build/{runtime-variables-U36KPJ5V.js → runtime-variables-Q6Q2JCGI.js} +1 -1
  179. package/build/runtime-variables-Q6Q2JCGI.js.br +0 -0
  180. package/build/runtime-variables-Q6Q2JCGI.js.gz +0 -0
  181. package/build/{runtime-vectorShapes-4HPEEN3B.js → runtime-vectorShapes-ISY7MWHY.js} +1 -1
  182. package/build/runtime-vectorShapes-ISY7MWHY.js.br +0 -0
  183. package/build/runtime-vectorShapes-ISY7MWHY.js.gz +0 -0
  184. package/build/runtime-video-DUDXGADJ.js +1 -0
  185. package/build/runtime-video-DUDXGADJ.js.br +0 -0
  186. package/build/runtime-video-DUDXGADJ.js.gz +0 -0
  187. package/build/runtime-webgpu-4ZCV5EAD.js +1 -0
  188. package/build/runtime-webgpu-4ZCV5EAD.js.br +0 -0
  189. package/build/runtime-webgpu-4ZCV5EAD.js.gz +0 -0
  190. package/build/runtime.cjs +365 -365
  191. package/build/runtime.js +1 -1
  192. package/build/runtime.js.br +0 -0
  193. package/build/runtime.js.gz +0 -0
  194. package/build/runtime.standalone.js +1 -1
  195. package/build/runtime.standalone.js.br +0 -0
  196. package/build/runtime.standalone.js.gz +0 -0
  197. package/build/runtime.standalone.webgl.js +1 -1
  198. package/build/runtime.standalone.webgl.js.br +0 -0
  199. package/build/runtime.standalone.webgl.js.gz +0 -0
  200. package/build/runtime.standalone.webgpu.js +1 -1
  201. package/build/runtime.standalone.webgpu.js.br +0 -0
  202. package/build/runtime.standalone.webgpu.js.gz +0 -0
  203. package/build/runtime.standalone.webgpu.micro.js +1 -1
  204. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  205. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  206. package/build/runtime.standalone.webgpu.min.js +1 -1
  207. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  208. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  209. package/package.json +1 -1
  210. package/build/runtime-aiAssistant-XJVJ7TQB.js +0 -1
  211. package/build/runtime-aiAssistant-XJVJ7TQB.js.br +0 -0
  212. package/build/runtime-aiAssistant-XJVJ7TQB.js.gz +0 -0
  213. package/build/runtime-apiServices-KAO5SQJZ.js +0 -1
  214. package/build/runtime-apiServices-KAO5SQJZ.js.br +0 -0
  215. package/build/runtime-apiServices-KAO5SQJZ.js.gz +0 -0
  216. package/build/runtime-audio-Y3GYW4YQ.js.br +0 -0
  217. package/build/runtime-audio-Y3GYW4YQ.js.gz +0 -0
  218. package/build/runtime-chunk-2SYZJBYJ.js.br +0 -0
  219. package/build/runtime-chunk-2SYZJBYJ.js.gz +0 -0
  220. package/build/runtime-chunk-2Y73BLCY.js +0 -1
  221. package/build/runtime-chunk-2Y73BLCY.js.br +0 -0
  222. package/build/runtime-chunk-2Y73BLCY.js.gz +0 -0
  223. package/build/runtime-chunk-A2LYIKKC.js.gz +0 -0
  224. package/build/runtime-chunk-BJVCOW72.js.br +0 -0
  225. package/build/runtime-chunk-BJVCOW72.js.gz +0 -0
  226. package/build/runtime-chunk-CTHMLYOZ.js +0 -1
  227. package/build/runtime-chunk-CTHMLYOZ.js.br +0 -0
  228. package/build/runtime-chunk-CTHMLYOZ.js.gz +0 -0
  229. package/build/runtime-chunk-E6JCDSXC.js.br +0 -0
  230. package/build/runtime-chunk-E6JCDSXC.js.gz +0 -0
  231. package/build/runtime-chunk-FF5REN2J.js.br +0 -0
  232. package/build/runtime-chunk-FF5REN2J.js.gz +0 -0
  233. package/build/runtime-chunk-HJS3VFEN.js.br +0 -0
  234. package/build/runtime-chunk-HJS3VFEN.js.gz +0 -0
  235. package/build/runtime-chunk-HL3PBPHE.js +0 -1
  236. package/build/runtime-chunk-HL3PBPHE.js.br +0 -0
  237. package/build/runtime-chunk-HL3PBPHE.js.gz +0 -0
  238. package/build/runtime-chunk-I47C4XJU.js.br +0 -0
  239. package/build/runtime-chunk-I47C4XJU.js.gz +0 -0
  240. package/build/runtime-chunk-JFYHGEDN.js.br +0 -0
  241. package/build/runtime-chunk-JFYHGEDN.js.gz +0 -0
  242. package/build/runtime-chunk-K4FLB6Y7.js +0 -1
  243. package/build/runtime-chunk-K4FLB6Y7.js.br +0 -0
  244. package/build/runtime-chunk-K4FLB6Y7.js.gz +0 -0
  245. package/build/runtime-chunk-LSURXI4Y.js.br +0 -2
  246. package/build/runtime-chunk-LSURXI4Y.js.gz +0 -0
  247. package/build/runtime-chunk-MM75L5X4.js +0 -1
  248. package/build/runtime-chunk-MM75L5X4.js.br +0 -0
  249. package/build/runtime-chunk-MM75L5X4.js.gz +0 -0
  250. package/build/runtime-chunk-MRUNX43X.js.br +0 -0
  251. package/build/runtime-chunk-MRUNX43X.js.gz +0 -0
  252. package/build/runtime-chunk-OEXC34HT.js.br +0 -0
  253. package/build/runtime-chunk-OEXC34HT.js.gz +0 -0
  254. package/build/runtime-chunk-OLJVVNDS.js.br +0 -0
  255. package/build/runtime-chunk-OLJVVNDS.js.gz +0 -0
  256. package/build/runtime-chunk-P2XISQYQ.js.br +0 -0
  257. package/build/runtime-chunk-P2XISQYQ.js.gz +0 -0
  258. package/build/runtime-chunk-P3254QGK.js.br +0 -0
  259. package/build/runtime-chunk-P3254QGK.js.gz +0 -0
  260. package/build/runtime-chunk-PPLLJM75.js.br +0 -0
  261. package/build/runtime-chunk-PPLLJM75.js.gz +0 -0
  262. package/build/runtime-chunk-QHPFAHXN.js.br +0 -0
  263. package/build/runtime-chunk-QHPFAHXN.js.gz +0 -0
  264. package/build/runtime-chunk-QZ35BPGB.js +0 -1
  265. package/build/runtime-chunk-QZ35BPGB.js.br +0 -0
  266. package/build/runtime-chunk-QZ35BPGB.js.gz +0 -0
  267. package/build/runtime-chunk-RAX4YJZF.js +0 -1
  268. package/build/runtime-chunk-RAX4YJZF.js.br +0 -0
  269. package/build/runtime-chunk-RAX4YJZF.js.gz +0 -0
  270. package/build/runtime-chunk-RQ3ZQR4P.js.br +0 -0
  271. package/build/runtime-chunk-RQ3ZQR4P.js.gz +0 -0
  272. package/build/runtime-chunk-SKLNU6XK.js +0 -1
  273. package/build/runtime-chunk-SKLNU6XK.js.br +0 -0
  274. package/build/runtime-chunk-SKLNU6XK.js.gz +0 -0
  275. package/build/runtime-chunk-TDCFE5IE.js.br +0 -0
  276. package/build/runtime-chunk-TDCFE5IE.js.gz +0 -0
  277. package/build/runtime-chunk-VRVV54WH.js.br +0 -0
  278. package/build/runtime-chunk-VRVV54WH.js.gz +0 -0
  279. package/build/runtime-chunk-WSJURWOC.js +0 -1
  280. package/build/runtime-chunk-WSJURWOC.js.br +0 -0
  281. package/build/runtime-chunk-WSJURWOC.js.gz +0 -0
  282. package/build/runtime-chunk-Z5OH244S.js.br +0 -0
  283. package/build/runtime-chunk-Z5OH244S.js.gz +0 -0
  284. package/build/runtime-classicRuntime-AMAXBOXT.js.br +0 -0
  285. package/build/runtime-classicRuntime-AMAXBOXT.js.gz +0 -0
  286. package/build/runtime-cloners-4W3AOAQX.js +0 -1
  287. package/build/runtime-cloners-4W3AOAQX.js.br +0 -1
  288. package/build/runtime-cloners-4W3AOAQX.js.gz +0 -0
  289. package/build/runtime-components-EPAMFKSB.js.br +0 -0
  290. package/build/runtime-components-EPAMFKSB.js.gz +0 -0
  291. package/build/runtime-conditional-3A423CXW.js +0 -1
  292. package/build/runtime-conditional-3A423CXW.js.br +0 -0
  293. package/build/runtime-conditional-3A423CXW.js.gz +0 -0
  294. package/build/runtime-createDestroy-HLHRAAC4.js.br +0 -0
  295. package/build/runtime-createDestroy-HLHRAAC4.js.gz +0 -0
  296. package/build/runtime-dragDrop-K6LWK7FL.js.br +0 -0
  297. package/build/runtime-dragDrop-K6LWK7FL.js.gz +0 -0
  298. package/build/runtime-gameControls-ZJUUKNHM.js +0 -1
  299. package/build/runtime-gameControls-ZJUUKNHM.js.br +0 -0
  300. package/build/runtime-gameControls-ZJUUKNHM.js.gz +0 -0
  301. package/build/runtime-hair-AGUMVL55.js +0 -1
  302. package/build/runtime-hair-AGUMVL55.js.br +0 -3
  303. package/build/runtime-hair-AGUMVL55.js.gz +0 -0
  304. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js +0 -1
  305. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js.br +0 -0
  306. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js.gz +0 -0
  307. package/build/runtime-miscActions-L7BIGLEB.js.br +0 -0
  308. package/build/runtime-miscActions-L7BIGLEB.js.gz +0 -0
  309. package/build/runtime-mouseHover-BI5SRQSQ.js +0 -1
  310. package/build/runtime-mouseHover-BI5SRQSQ.js.br +0 -0
  311. package/build/runtime-mouseHover-BI5SRQSQ.js.gz +0 -0
  312. package/build/runtime-particles-W7YEQWJI.js.br +0 -0
  313. package/build/runtime-particles-W7YEQWJI.js.gz +0 -0
  314. package/build/runtime-paths-CK327WCT.js.br +0 -0
  315. package/build/runtime-paths-CK327WCT.js.gz +0 -0
  316. package/build/runtime-resize-RUUW4IXW.js +0 -1
  317. package/build/runtime-resize-RUUW4IXW.js.br +0 -0
  318. package/build/runtime-resize-RUUW4IXW.js.gz +0 -0
  319. package/build/runtime-sceneTransition-7AG4A4P5.js.br +0 -0
  320. package/build/runtime-sceneTransition-7AG4A4P5.js.gz +0 -0
  321. package/build/runtime-scroll-MNQPPLQL.js.br +0 -0
  322. package/build/runtime-scroll-MNQPPLQL.js.gz +0 -0
  323. package/build/runtime-shapeBlends-IP5LZ63L.js +0 -1
  324. package/build/runtime-shapeBlends-IP5LZ63L.js.br +0 -0
  325. package/build/runtime-shapeBlends-IP5LZ63L.js.gz +0 -0
  326. package/build/runtime-text-5RIKJ4US.js.br +0 -0
  327. package/build/runtime-text-5RIKJ4US.js.gz +0 -0
  328. package/build/runtime-textInputs-YBGYTAMD.js.br +0 -0
  329. package/build/runtime-textInputs-YBGYTAMD.js.gz +0 -0
  330. package/build/runtime-timeline-32GBWMFJ.js +0 -1
  331. package/build/runtime-timeline-32GBWMFJ.js.br +0 -0
  332. package/build/runtime-timeline-32GBWMFJ.js.gz +0 -0
  333. package/build/runtime-tracking-2BXFBQQY.js.br +0 -0
  334. package/build/runtime-tracking-2BXFBQQY.js.gz +0 -0
  335. package/build/runtime-transitions-6PZW2QIW.js.br +0 -0
  336. package/build/runtime-transitions-6PZW2QIW.js.gz +0 -0
  337. package/build/runtime-ui2d-VEQUBXIE.js +0 -1
  338. package/build/runtime-ui2d-VEQUBXIE.js.br +0 -0
  339. package/build/runtime-ui2d-VEQUBXIE.js.gz +0 -0
  340. package/build/runtime-variables-U36KPJ5V.js.br +0 -0
  341. package/build/runtime-variables-U36KPJ5V.js.gz +0 -0
  342. package/build/runtime-vectorShapes-4HPEEN3B.js.br +0 -0
  343. package/build/runtime-vectorShapes-4HPEEN3B.js.gz +0 -0
  344. package/build/runtime-video-TZNR7MEM.js +0 -1
  345. package/build/runtime-video-TZNR7MEM.js.br +0 -0
  346. package/build/runtime-video-TZNR7MEM.js.gz +0 -0
  347. package/build/runtime-webgpu-YNY4OXCZ.js +0 -1
  348. package/build/runtime-webgpu-YNY4OXCZ.js.br +0 -0
  349. package/build/runtime-webgpu-YNY4OXCZ.js.gz +0 -0
@@ -1 +0,0 @@
1
- import{b as t}from"./runtime-chunk-N2ZRGNPR.js";import{a as e,c as i}from"./runtime-chunk-VAVYZ35B.js";import{b as s,c as o,d as a,e as n}from"./runtime-chunk-FQNSP44B.js";import{a as r}from"./runtime-chunk-LSURXI4Y.js";import{G as h,a as l}from"./runtime-chunk-CTHMLYOZ.js";import{f as d,g as c}from"./runtime-chunk-MM75L5X4.js";import{h as p}from"./runtime-chunk-2Y73BLCY.js";import{a as m,g as u,h as y}from"./runtime-chunk-QZ35BPGB.js";import{a as v}from"./runtime-chunk-4KZXQGUQ.js";import{a as g}from"./runtime-chunk-Z5OH244S.js";import{c as f}from"./runtime-chunk-TZCHGFVF.js";import{Fa as b}from"./runtime-chunk-OW6T4XFV.js";import{Bc as E,Dc as P,Ec as C,Fc as M,Oc as x,Oe as T,Pc as S,Rc as D,Xc as w,b as R,bd as j,cd as L,dd as G}from"./runtime-chunk-VGN7YHB7.js";var B=200,A=null;function W(t){A=t}function O(){return A}function I(t){let e=!1;return t.scene.objects.forEach(i=>{"Page"===i.data.type&&!e&&i.data.publish.gameControlObject&&b.traverseModuleInstances(t,i.id,(t,i,s)=>{for(let t of s)"GameControl"===t.data.type&&t.data.navmesh.enabled&&(e=!0)})}),e}function F(t){return s?t.metaKey:t.ctrlKey}function k(t,e){return Math.abs(t+3*e)<=2||Math.abs(t+3*window.devicePixelRatio*e)<=2}var V={type:"change"},z={type:"start"},H={type:"end",nonOrbit:!0},Z={type:"end",nonOrbit:!1},U={type:"end",isZoom:!0,nonOrbit:!0},Y={type:"end",changed:!1},X={type:"cameraAnimatingInTimeline"},N=new C,K=new P,_=2*Math.PI,q=new M,Q=new P,J=new M,$=new C,tt=new x,et={type:"requestRender"},it=class extends E{constructor(t,i,s={isPlayMode:!1,isExport:!1},a){super(),this.object=t,this.domElement=i,this.options=s,this.timelineState=a,this.enabled=!0,this.useKeyEvents=!0,this.enableDamping=!1,this.enableZoom=!0,this.enableRotate=!0,this.enablePan=!0,this.autoRotate=!1,this.rotationLimitsMode=0,this.panLimitsMode=0,this.rotationSoftLimit=2,this.panSoftLimit=2,this.hoverRotatePanMode=0,this.zoomLimitsEnabled=!1,this.mouseButtons=[0,5],this.mouseButtonsPlay=[3,4,5],this.touches=[null,R.DOLLY_ROTATE,R.PAN],this.offset=new M,this.eye=new M,this.lastPosition=new M,this.lastQuaternion=new C,this.current=new P,this.overShoot=new P,this.overRatio=new P,this.spherical=new T,this.sphericalDelta=new T,this.panOffset=new M,this.panLeftV=new M,this.panUpV=new M,this.panV=new M,this.rotateStart=new P,this.rotateEnd=new P,this.rotateDelta=new P,this.panStart=new P,this.panEnd=new P,this.panDelta=new P,this.dollyStart=new P,this.dollyEnd=new P,this.dollyDelta=new P,this.rotationRangeFactor=new P,this.panRangeFactor=new P,this.state=-1,this.zoomChanged=!1,this.isPointerDown=!1,this.isThetaFlipped=!1,this.prevScale=0,this.scale=1,this.gesture=!1,this.lastTrackpadPanTime=-1/0,this.lastMouseWheelZoomTime=-1/0,this.timer=-1,this.timerHover=-1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPhi=0,this.maxPhi=Math.PI,this.minTheta=-1/0,this.maxTheta=1/0,this.minH=0,this.maxH=Math.PI,this.minV=-1/0,this.maxV=1/0,this.autoRotateClockwise=!0,this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.resetHoverEffectOnPointerLeave=!1,this.hasChange=!1,this.useWindowEvents=!1,this.isTouchZoom=!0,this.autoRotateSpeed=2,this.dampingFactor=.125,this.zoomSpeed=2,this.rotateSpeed=1,this.rotateFactor=1,this.panSpeed=1,this.hoverRotatePanStrength=.1,this.hoverRotateDamping=this.dampingFactor,this.isCurrentlyDamping=!1,this.thetaIsFree=!1,this.phiIsFree=!1,this.needsUpdate=!0,this.onCameraChange=t=>{this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange),this.object=t.camera,this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)},this.update=()=>{this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(J,$,q),this.offset.copy(J).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&-1===this.state&&this.rotateLeft((!0===this.autoRotateClockwise?1:-1)*this.getAutoRotationAngle()),0!==this.rotationLimitsMode&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),2!==this.rotationLimitsMode&&(this.spherical.phi+=this.sphericalDelta.phi),(1!==this.rotationLimitsMode||!0===this.autoRotate)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&this.object.isPerspectiveCamera&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),0!==this.panLimitsMode&&(this.target.applyQuaternion(N.copy($).invert()),this.panOffset.applyQuaternion(N),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion($),this.panOffset.applyQuaternion($)),2===this.panLimitsMode&&(this.panOffset.y=0),1===this.panLimitsMode&&(this.panOffset.x=0),-1!==this.state||this.gesture?(this.target.add(this.panOffset),this.panOffset.set(0,0,0)):(this.panOffset.multiplyScalar(1-this.dampingFactor),this.target.add(this.panOffset)),this.offset.setFromSpherical(this.spherical),J.copy(this.target).add(this.offset),this.object.position.copy(this.target).add(this.offset),this.object.parent&&(tt.copy(this.object.parent.matrixWorld).invert(),this.object.position.applyMatrix4(tt));let t=this.spherical.phi%_;if(this.eye.copy(this.offset).normalize(),this.object.up.copy(D.DEFAULT_UP).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),t>0&&t>Math.PI||t<0&&t>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),-1===this.state||!0===this.enableDamping){let t=1===this.hoverRotatePanMode?this.hoverRotateDamping:this.dampingFactor;this.sphericalDelta.theta*=1-t,this.sphericalDelta.phi*=1-t}else this.sphericalDelta.set(0,0,0);if(this.scale=1,this.lastPosition.distanceToSquared(this.object.position)>.01||8*(1-this.lastQuaternion.dot(this.object.quaternion))>1e-8)return this.dispatchEvent(V),this.object.dispatchEvent(et),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),void(this.isCurrentlyDamping=!0);this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.object.wasMovedBySwitchCameraAction=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),this.isCurrentlyDamping=!1},this.onPointerDown=t=>{!1!==this.enabled&&("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerDownTouch(t):this.onPointerDownMouse(t),-1!==this.state&&(this.isPointerDown=!0,this.dispatchEvent(z),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp),t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.setPointerCapture(t.pointerId)))},this.onPointerLeave=t=>{this.resetHoverEffectOnPointerLeave&&!this.useWindowEvents?(1===this.hoverRotatePanMode?(this.sphericalDelta.theta=-this.spherical.theta,this.sphericalDelta.phi=-this.spherical.phi,q.subVectors(this.position0,this.target0),this.spherical.setFromVector3(q),this.sphericalDelta.theta+=this.spherical.theta,this.sphericalDelta.phi+=this.spherical.phi,this.sphericalDelta.theta/=8,this.sphericalDelta.phi/=8):2===this.hoverRotatePanMode&&this.panOffset.subVectors(this.target0,this.target).divideScalar(8),this.update()):this.pointerLeaveEvent=t},this.onPointerEnter=t=>{this.resetHoverEffectOnPointerLeave||void 0===this.pointerLeaveEvent?Q.set(t.clientX-this.domElement.clientWidth/2,t.clientY-this.domElement.clientHeight/2):Q.set(t.clientX-this.pointerLeaveEvent.clientX,t.clientY-this.pointerLeaveEvent.clientY),1===this.hoverRotatePanMode?(this.rotateDelta.copy(Q).multiplyScalar(this.rotateSpeed*this.hoverRotatePanStrength).rotateAround(K,-this.object.angleOffsetFromUp),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight),this.rotateStart.set(t.clientX,t.clientY)):2===this.hoverRotatePanMode&&(this.panDelta.copy(Q).multiplyScalar(this.panSpeed*this.hoverRotatePanStrength),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.set(t.clientX,t.clientY)),this.update()},this.onPointerMove=t=>{this.timelineState?.isPlayingCameraAnimation?this.dispatchEvent(X):!1!==this.enabled&&(this.checkRaycastLock()||("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerMoveTouch(t):this.onPointerMoveMouse(t),t.stopPropagation()))},this.onPointerUp=t=>{this.isPointerDown=!1,0===e.length&&(this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)),e.length>1&&t.preventDefault(),this.hasChange?this.dispatchEvent(0===this.state?Z:H):this.dispatchEvent(Y),this.state=-1,t&&(t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.releasePointerCapture(t.pointerId))},this.onPointerDownMouse=t=>{let e;switch(e=this.useKeyEvents?this.mouseButtons[t.button]:this.mouseButtonsPlay[t.button],e){case 0:if(!0!==t.altKey||t.shiftKey||F(t)){if(" "===this.key){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 4:if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2;break;case 3:if(F(t)||t.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 5:if(F(t)||t.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}else{if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}},this.onPointerMoveMouse=t=>{switch(this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(t);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(t);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(t)}this.object.wasMovedByUser=!0},this.onPointerDownTouch=t=>{switch(e.length>1&&t.preventDefault(),this.touches[e.length-1]){case R.ROTATE:if(!1===this.enableRotate)return void(this.state=-1);this.handleTouchStartRotate(),this.state=3;break;case R.PAN:if(!1===this.enablePan)return void(this.state=-1);this.handleTouchStartPan(),this.state=4;break;case R.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(),this.state=5;break;case R.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}},this.onPointerMoveTouch=t=>{switch(e.length>1&&t.preventDefault(),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(!1===this.enablePan)return;this.handleTouchMovePan(t),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}this.object.wasMovedByUser=!0},this.dispatchEndDebounced=v(()=>{this.zoomChanged?this.dispatchEvent(U):this.dispatchEvent(H),this.zoomChanged=!1},33),this.onMouseWheel=t=>{if(!1!==this.enabled&&(!1!==this.enableZoom||!1!==this.enablePan)&&!this.checkRaycastLock()){if(!this.options.isExport&&this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth&&t.preventDefault(),this.dispatchEvent(z),this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(X);this.handleMouseWheel(t),this.dispatchEndDebounced(),this.object.wasMovedByUser=!0}},this.onGesture=t=>{if(t.preventDefault(),!1!==this.enabled&&!this.checkRaycastLock()&&!o){if(this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(X);if("gesturechange"===t.type){if(!1===this.enableZoom||!1===this.isTouchZoom)return;this.dispatchEvent(z),t.scale>this.prevScale?this.dollyIn(this.getZoomScale()):t.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=t.scale,this.update(),this.object.wasMovedByUser=!0}else this.dispatchEvent(H)}},this.onContextMenu=t=>{t.preventDefault()},this.onTouchEnd=t=>{t.preventDefault()},this.onKeyDown=t=>{!1!==this.enabled&&(this.key=t.key," "===t.key&&this.dispatchEvent(z))},this.onKeyUp=t=>{this.key=void 0,!1!==this.enabled&&(-1!==this.state&&"Alt"===t.key&&this.onPointerUp(e[0])," "===t.key&&this.dispatchEvent(H))},this.onPointerHover=t=>{"mouse"!==t.pointerType||!1===this.enabled||-1!==this.state||2===this.hoverRotatePanMode&&this.isPanOverShoot||1===this.hoverRotatePanMode&&this.isRotateOverShoot||(this.isPointerDown=!0,2===this.hoverRotatePanMode?this.handleMouseMovePan(t,this.hoverRotatePanStrength):1===this.hoverRotatePanMode&&this.handleMouseMoveRotate(t,this.hoverRotatePanStrength))},this.onBeginState=()=>{this.enabled=!1,this.needsUpdate=!1},this.onCompleteState=t=>{t.isfromEntity&&this.options.isPlayMode||(this.enabled=!0,this.needsUpdate=!0,this.object.updateUp(),this.object.getTarget(this.target))},this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.quat0=this.object.quaternion.clone(),this.isUpVectorFlipped0=this.object.isUpVectorFlipped,this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(J,$,q),this.offset.copy(J).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.initialSphericalRadius=this.spherical.radius,this.addEventListenersToCamera()}dispatchEvent(t){"start"===t.type?this.hasChange=!1:this.hasChange=!0,super.dispatchEvent(t)}addEventListenersToCamera(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}removeEventListenersFromCamera(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}updateUseWindowEvents(t){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=t,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}}fromJSON(t,e){this.rotateFactor=t.rotationSpeed??1,this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.thetaIsFree=t.rotationHorizontalOffset.min===t.rotationHorizontalOffset.max&&t.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=t.rotationVerticalOffset.min===t.rotationVerticalOffset.max&&t.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.hoverRotateDamping=t.hoverRotateDamping??this.dampingFactor,this.useWindowEvents="window"===e,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));let i=t.hoverRotatePanStrength/100;this.hoverRotatePanStrength=i**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/this.maxZoom,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,this.autoRotateSpeed=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let s=this.object.getTarget().applyQuaternion(N.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+s.y,this.maxV=t.panVerticalOffset.max+s.y,this.minH=-t.panHorizontalOffset.min+s.x,this.maxH=t.panHorizontalOffset.max+s.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=st(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=st(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=st(st(this.spherical.theta)-t.rotationHorizontalOffset.min),this.maxTheta=st(st(this.spherical.theta)+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,1===t.orbitTouches&&(this.touches[0]=R.ROTATE),1===t.panTouches&&(this.touches[0]=R.PAN),2===t.orbitTouches&&(this.touches[1]=R.DOLLY_ROTATE),2===t.panTouches&&(this.touches[1]=R.DOLLY_PAN),3===t.orbitTouches&&(this.touches[2]=R.ROTATE),3===t.panTouches&&(this.touches[2]=R.PAN),this.isTouchZoom=t.isTouchZoom,this.resetHoverEffectOnPointerLeave=t.resetHoverEffectOnPointerLeave??!1}connect(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}dispose(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,e,i,s,o,a,n,r){let h,l,d;this.overShoot.set(0,0),t instanceof M?(h=t.x,l=t.y,this.current.set(this.target.x,this.target.y),d=!0):(h=t.theta,l=t.phi,this.current.set(st(this.spherical.theta),st(this.spherical.phi)),d=!1),0===i&&(this.current.x+=h,this.current.y+=l),(3===e||2===e)&&(!d&&this.isThetaFlipped?this.current.x>s&&this.current.x<0?this.overShoot.x=s-this.current.x:this.current.x<o&&this.current.x>0&&(this.overShoot.x=o-this.current.x):this.current.x>s?this.overShoot.x=s-this.current.x:this.current.x<o&&(this.overShoot.x=o-this.current.x)),(3===e||1===e)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<n&&(this.overShoot.y=n-this.current.y)),d||(this.overShoot.x=st(this.overShoot.x),this.overShoot.y=st(this.overShoot.y)),0!==i?(this.overRatio.copy(this.overShoot).divide(r),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),1===i&&(this.overRatio.x=ot(Math.abs(this.overRatio.x)),this.overRatio.y=ot(Math.abs(this.overRatio.y))),this.isPointerDown||1===i?2===i&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(h*this.overShoot.x<0&&!this.thetaIsFree&&(h*=1-this.overRatio.x),l*this.overShoot.y<0&&!this.phiIsFree&&(l*=1-this.overRatio.y)):2===i&&(!d&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||d&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(h=.05*this.overShoot.x),this.phiIsFree||(l=.05*this.overShoot.y),d?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):d?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(h+=this.overShoot.x,l+=this.overShoot.y),t instanceof M?(t.x=h,t.y=l):(this.thetaIsFree||(t.theta=h),this.phiIsFree||(t.phi=l))}setEnableDampingSpeed(t){this.enableDamping=t,this.rotateSpeed=(!0===t?.2:1)*this.rotateFactor}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0,this.panOffset.set(0,0,0)}setTarget(t,e,i){this.stopDamping(),this.target.set(t,e,i)}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,e){this.panLeftV.setFromMatrixColumn(e,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,e){this.panUpV.setFromMatrixColumn(e,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,e){let i=this.domElement;if(i&&this.object.isPerspectiveCamera){let s=this.object.position;this.panV.copy(s).sub(this.target);let o=this.panV.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/i.clientHeight,this.object.matrixWorld),this.panUp(2*e*o/i.clientHeight,this.object.matrixWorld)}else i&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrixWorld),this.panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrixWorld));this.dispatchEvent(V)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(V)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(V)}setZoom(t){if(this.dispatchEvent(z),this.object.isPerspectiveCamera){let e=this.initialSphericalRadius/t/this.spherical.radius;this.scale=e}else this.object.isOrthographicCamera&&(this.object.zoom=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0);this.dispatchEvent(H)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,e=1){void 0!==t.movementX?this.rotateDelta.set(t.movementX,t.movementY):(this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*e).rotateAround(K,-this.object.angleOffsetFromUp);let i=this.domElement,s=this.useWindowEvents?window.innerHeight:i.clientHeight,o=2*Math.PI*this.rotateDelta.x/s,a=2*Math.PI*this.rotateDelta.y/s;this.rotateLeft(o),this.rotateUp(a),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,e=1){void 0!==t.movementX?this.panDelta.set(t.movementX,t.movementY):(this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*e),this.pan(this.panDelta.x,this.panDelta.y),this.update()}handleMouseWheel(t){if(0===t.deltaX&&0===t.deltaY)return;let e=!0===t.ctrlKey||!0===F(t),i=!1===F(t)&&!0===(0===(r=t).wheelDeltaY||0===r.deltaY?!(s&&r.shiftKey&&Math.abs(r.wheelDeltaX)>=120)&&(r.wheelDeltaX?k(r.wheelDeltaX,r.deltaX):0===r.deltaMode):r.wheelDeltaY?k(r.wheelDeltaY,r.deltaY):0===r.deltaMode),o=!1===e&&(!0===this.gesture||t.timeStamp-this.lastTrackpadPanTime<300),n=!1===e&&!1===o&&t.timeStamp-this.lastMouseWheelZoomTime<300;var r;if(!1!==a||!1!==n||!0!==i&&!0!==o){if(!1===this.enableZoom)return;this.gesture&&(window.clearTimeout(this.timer),this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(H)),!1===e&&!1===i&&(this.lastMouseWheelZoomTime=t.timeStamp),0===t.deltaY?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}else{if(!1===this.enablePan)return;let e=!1===this.gesture&&!1===o;this.lastTrackpadPanTime=t.timeStamp,this.gesture||(this.gesture=!0,this.isPointerDown=!0),!1===e&&(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(H)},100)}}handleTouchStartRotate(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.rotateStart.set(t,i)}else this.rotateStart.set(e[0].pageX,e[0].pageY)}handleTouchStartPan(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.panStart.set(t,i)}else this.panStart.set(e[0].pageX,e[0].pageY)}handleTouchStartDolly(){let t=e[0].pageX-e[1].pageX,i=e[0].pageY-e[1].pageY,s=Math.sqrt(t*t+i*i);this.dollyStart.set(0,s)}handleTouchStartDollyPan(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.rotateEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let s=this.domElement;s&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/s.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/s.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.panEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let e=i(t),s=t.pageX-e.x,o=t.pageY-e.y,a=Math.sqrt(s*s+o*o);this.dollyEnd.set(0,a),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}checkRaycastLock(){if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;{let t=this.options?.showCameraLock;return t&&t(),!0}}return!1}};function st(t){let e=2*Math.PI;for(;t<=-Math.PI;)t+=e;for(;t>Math.PI;)t-=e;return t}function ot(t){return 1-Math.pow(1-t,4)}var at,nt,rt=new Promise(t=>{at=t});function ht(t){return nt||(nt=async function(){let e=t??(g?".":"https://cdn.spline.design/@splinetool/runtime@2.0.2/build"),i=import("./physics.js"),[s,o]=await Promise.all([i,fetch(`${e}/physics.wasm`).then(t=>t.arrayBuffer())]);await s.init(o),at(s)}())}function lt(t){let e=t.elements,i=e[0]**2+e[1]**2+e[2]**2,s=e[4]**2+e[5]**2+e[6]**2,o=e[8]**2+e[9]**2+e[10]**2,a=e[0]**2+e[4]**2+e[8]**2,n=e[1]**2+e[5]**2+e[9]**2,r=e[2]**2+e[6]**2+e[10]**2,h=1e-8;return i<h||s<h||o<h||a<h||n<h||r<h}function dt(t,e){let i=new G;if(e&&lt(e))return i.setAttribute("position",new j([],3)),i.setIndex([]),i;if(!t.getAttribute("position"))return i.setAttribute("position",new j([],3)),i.setIndex([]),i;let{positions:s,triIndices:o}=h(t.getAttribute("position"),t.getIndex());return i.setAttribute("position",new j(s,3)),i.setIndex(o),e&&i.applyMatrix4(e),i}var ct,pt=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.initialDisabled=!1,this.actions=d(e,e.actions,s,o,a,i),this.target=e.target}disconnect(){c(this.actions)}dispatch(t){this.initialDisabled||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Animation.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch(t??!1)}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}},mt=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.page=s,this.currentIntersectedObjects=[],this.actions=d(e,e.actions,s,o,a,i),this.target=e.target,this.triggeringObjects=[];for(let t of e.triggeringObjects){let e=s.scene.find(t);e&&this.triggeringObjects.push(e)}}isValidTriggeringObject(t){return"all"===this.target||this.triggeringObjects.some(e=>e===t||e.isAncestorOf(t.uuid)||t.isAncestorOf(e.uuid))}disconnect(){c(this.actions)}dispatch(){this.object.destroyedInAction||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.SwitchCamera.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(t=>{t.dispatch(!1)}),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.SceneTransition.forEach(t=>{t.dispatch()}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}};rt.then(t=>ct=t);var ut=new M,yt=new C,vt=new M,gt=(new S(0,0,0,"YXZ"),new S(0,0,0,"XYZ")),ft=new M,bt=new M,Et=new M(1,1,1),Pt=new C,Ct=new x,Mt=new x,xt={type:"updateMatrix"},Tt=new C,St=new L,Dt=.01,wt={type:"beginEvent",eventName:"Collision"},Rt={type:"beginEvent",eventName:"Trigger"};function jt(t){if(b.physicsEnabled(t.scene.objects))return!0;let e=!1;return t.scene.objects.traverse((t,i)=>{if(i.events)if(Array.isArray(i.events)){for(let t of i.events)if(!0!==t.data.disabled&&"GameControl"===t.data.type&&t.data.collisionEnabled){e=!0;break}}else for(let t of Object.values(i.events))if(!0!==t.disabled&&"GameControl"===t.type&&t.collisionEnabled){e=!0;break}}),e}var Lt,Gt,Bt=t=>t.states.some(t=>void 0!==t.data.position||void 0!==t.data.rotation||void 0!==t.data.hiddenMatrix||void 0!==t.data.cloner||void 0!==t.data.pathSnapping),At=class{constructor(t){this.eventContext=t,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,kinematicBodyToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.fixedBodiesToWatch=[],this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.skipRender=!0,this._staticBVHAttrIds=new WeakMap,this._staticBVHNextAttrId=1,this.processRigidBody=t=>{if(t.bodyType()!==ct.RigidBodyType.Dynamic)return;t.isSleeping()||this.nActiveRigidBodies++;let[e,i,s]=this.rigidBodyToMesh.get(t.handle);if(ut.copy(t.translation()).multiplyScalar(this.pixelsPerMeter),yt.copy(t.rotation()),e.matrixWorld.compose(ut,yt,i),e.hasNonUniformScale&&e.matrixWorld.multiply(e.shearScale),e.dispatchEvent(xt),s){let t=e.cloner;if(t&&void 0===t.objectForSample){t.matrixWorld.copy(e.matrixWorld);for(let e of t.children)e.updateMatrixWorld(!0)}for(let t of e.children)t.updateMatrixWorld(!0)}},this.accumulator=0,this.handleCollisionEvents=(t,e,i)=>{if(!1===i)return;let s,o;if(this.sensorToTriggerEvent[t]?(s=this.sensorToTriggerEvent[t],o=this.sharedGameControlGlobals.colliderToEntity.get(e)):this.sensorToTriggerEvent[e]&&(s=this.sensorToTriggerEvent[e],o=this.sharedGameControlGlobals.colliderToEntity.get(t)),s&&o&&s.isValidTriggeringObject(o))s.dispatch();else{for(let i=this.sharedGameControlGlobals.createdObjects.length-1;i>=0;i--){let s=this.sharedGameControlGlobals.createdObjects[i];if(s.userData.hasCollisionDestroy&&(s.rigidBody?.collider(0).handle===t||s.rigidBody?.collider(0).handle===e)){this.sharedGameControlGlobals.createdObjects.splice(i,1),s.removeFromParent(),requestAnimationFrame(()=>this.sharedGameControlGlobals.rapierWorld?.removeRigidBody(s.rigidBody));break}}if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(t)){let t=this.sharedGameControlGlobals.colliderToEntity.get(e),i=this.sharedGameControlGlobals.entityToCollisionEvents[t.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,t,e)}else if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(e)){let e=this.sharedGameControlGlobals.colliderToEntity.get(t),i=this.sharedGameControlGlobals.entityToCollisionEvents[e.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,e,t)}else{let i=this.sharedGameControlGlobals.colliderToEntity.get(t),s=this.sharedGameControlGlobals.entityToCollisionEvents[i.uuid];if(void 0!==s)for(let e of s)"scene"===e.data.target&&this.dispatchCollisionEvent(e,i,t);let o=this.sharedGameControlGlobals.colliderToEntity.get(e),a=this.sharedGameControlGlobals.entityToCollisionEvents[o?.uuid];if(void 0!==a)for(let t of a)"scene"===t.data.target&&this.dispatchCollisionEvent(t,o,e)}}},this.isExport=t.isExport,this.sharedAssets=t.sharedAssets,this.renderer=t.renderer,this.requestRender=t.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=200,this.gravity=this.page.data.globalPhysics.gravity}get page(){return this.eventContext.page}markIsDestroyTarget(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events){if(!0===t.data.disabled)continue;let e=t.data.actions?.find(t=>"Destroy"===t.data.type)?.data;if(e)for(let t of e.objects){let e=this.page.scene.find(t);e&&(e.userData.hasDestroy=!0)}}})}markIsDragObject(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events)if(!0!==t.data.disabled&&"DragDrop"===t.data.type)for(let e of t.data.objects){let t=this.page.scene.find(e);t&&(t.userData.hasDrag=!0)}})}_staticBVHIdOf(t){let e=this._staticBVHAttrIds.get(t);return void 0===e&&(e=this._staticBVHNextAttrId++,this._staticBVHAttrIds.set(t,e)),e}initBVH(){if(null===t())return void f("collision-bvh","trigger/collision detection");let e=[],i=[];if(this.page.traverseChildren(t=>{let s,o=t instanceof r,a=m(t);if(u(t)||o||a)return;s=y(t)?t.object:t;let n=s.dataPatched;if("visibility"===n.physics?.enabled?!n.visible:!n.physics?.enabled)return!0;let h=t.geometry,l=!0===s.userData.hasDestroy,d=!0===s.userData.hasDrag;if(Bt(n)||l||d||s.dataPatched.events.some(t=>!0!==t.data.disabled&&("GameControl"===t.data.type||"Follow"===t.data.type)))return t.updateMatrixWorldRigid(),this.addBoundsTree(t),!0;if(h){let s=h.getAttribute("position");if(void 0!==s&&s.count>0){e.push({geometry:h,matrixWorld:t.matrixWorld}),i.push(h.id,this._staticBVHIdOf(s),s.version,null!==h.index?this._staticBVHIdOf(h.index):-1,null!==h.index?h.index.version:-1);for(let e of t.matrixWorld.elements)i.push(e)}}}),e.length>0){let s=this._staticBVHCache;if(void 0!==s&&s.signature.length===i.length&&s.signature.every((t,e)=>t===i[e]))return void(this.sharedGameControlGlobals.staticMeshBVH=s.bvh);let o=e.map(t=>dt(t.geometry,t.matrixWorld)),a=l(o,!1),n=new(t())(a);this._staticBVHCache={signature:i,bvh:n},this.sharedGameControlGlobals.staticMeshBVH=n}}addRigidBody(t,e,i){if(lt(t.matrixWorld))return;let s=[],o="geometry"in t?t.geometry:void 0,a=e.dataPatched;if(void 0!==o?.getAttribute("position")&&s.push(dt(o,t.shearScale)),a.physics.fusedBody){let e=this.gatherChildrenGeom(t,s);t.traverseObject(e),t.children.forEach(t=>t.updateMatrixWorld(!0));let i=t.cloner;i&&void 0===i.objectForSample&&"dynamic"===a.physics.rigidBody&&(i.traverseObject(e),i.children.forEach(t=>t.updateMatrixWorld(!0)))}if(s.length>0){let n,r=!1,h=!i.fromCreate&&"dynamic"===a.physics.rigidBody||i.fromCreate&&i.dynamic;h?(n=ct.RigidBodyDesc.dynamic(),n.setLinearDamping(a.physics.damping).setAngularDamping(a.physics.damping).setAdditionalMass(1e-9).setGravityScale(a.physics.gravityScale).enabledRotations(...a.physics.enabledRotation).enabledTranslations(...a.physics.enabledTranslation)):(i.hasTransformAnim||i.hasFollow||i.hasDrag)&&!i.fromCreate?(n=ct.RigidBodyDesc.kinematicPositionBased(),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(t),r=!0):n=ct.RigidBodyDesc.fixed();let d=l(s);(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(ut,yt,vt),t.position0=ut.clone().divideScalar(this.pixelsPerMeter),t.rotation0=yt.clone(),ut.divideScalar(this.pixelsPerMeter),n.setTranslation(ut.x,ut.y,ut.z).setRotation(yt),o?d?.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):d?.scale(vt.x/this.pixelsPerMeter,vt.y/this.pixelsPerMeter,vt.z/this.pixelsPerMeter);let c=this.sharedGameControlGlobals.rapierWorld.createRigidBody(n);h?this.rigidBodyToMesh.set(c.handle,[t,vt.clone(),a.physics.fusedBody]):r?this.sharedGameControlGlobals.kinematicBodyToEntity.set(c.handle,t):this.fixedBodiesToWatch.push([t,c,(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).clone()]);let p=!(void 0===a.geometry||"SubdivGeometry"===a.geometry.type||"NonParametricGeometry"===a.geometry.type||"BooleanGeometry"===a.geometry.type||"VectorGeometry"===a.geometry.type||"StarGeometry"===a.geometry.type||"RectangleGeometry"===a.geometry.type||"EllipseGeometry"===a.geometry.type||"TriangleGeometry"===a.geometry.type||"TorusGeometry"===a.geometry.type||"HelixGeometry"===a.geometry.type);try{this.addCollider(c,a.physics,d,e,p)}catch{try{this.addCollider(c,a.physics,d,e,!1)}catch(t){console.error(t)}}t.rigidBody=c}}addBoundsTree(e){let i=[];if(void 0!==e.geometry?.getAttribute("position")&&e.geometry?.getAttribute("position").count>0&&i.push(dt(e.geometry,e.shearScale)),e.traverseObject(this.gatherChildrenGeom(e,i)),e.children.forEach(t=>t.updateMatrixWorld(!0)),i.length>0){let s=l(i,!1);e.bvhGeometry=s,s.getAttribute("position").count>0?(e.bvhGeometry.boundsTree=new(t())(s),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e)):g&&console.warn(`ControlsManager.addBoundsTree: object "${e.name}" has empty geometry`)}}addCollider(t,e,i,s,o=!0){if(0===i?.getAttribute("position").count||0===i?.getIndex()?.count)return;let a;i&&(a="trimesh"===e.colliderType?ct.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array):ct.ColliderDesc.convexMesh(i.getAttribute("position").array,o?i.getIndex().array:void 0)),a.setFrictionCombineRule(ct.CoefficientCombineRule.Average).setRestitutionCombineRule(ct.CoefficientCombineRule.Average).setDensity(e.density).setFriction(e.friction).setRestitution(e.restitution);let n=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t);this.sharedGameControlGlobals.colliderToEntity.set(n.handle,s),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]?.some(t=>"scene"===t.target)&&n.setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS)}gatherChildrenGeom(t,e){return(i,s)=>{if(0===s)return;let o;if(u(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;o=i.object}else if(y(i))o=i.object;else if(o=i,o.dataPatched.cloner?.hideBase)return!0;let a=o.dataPatched;if("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled)return!0;1===s?t.hasNonUniformScale?i.matrixWorld.multiplyMatrices(t.shearScale,i.hiddenMatrix):i.matrixWorld.copy(i.hiddenMatrix):i.matrixWorld.multiplyMatrices(i.parent.matrixWorld,i.hiddenMatrix),i.matrixWorld.multiply(i.matrix);let n=i.geometry;void 0!==n?.getAttribute("position")&&e.push(dt(n,i.matrixWorld))}}activate(t){if(this.isEnabled)return;this.isEnabled=!0,this.eventManager=t,this.usePhysics=this.page.data.globalPhysics.usePhysics;let e=this.page.playCamera,i=!1;this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if(!1===e.data.disabled&&"Trigger"===e.data.type)return this.needsCollisionDetection=!0,!0});let s=O();if(null!==s?i=s.setup({manager:this,camera:e,renderer:this.renderer,sharedAssets:this.sharedAssets,eventContext:this.eventContext,isExport:this.isExport})||i:null!==this.page.data.publish.gameControlObject&&f("game-controls","the scene's game controls"),!1===i){let{enableRotate:t,enablePan:i,enableZoom:s,autoRotate:o,hoverRotatePanMode:a}=this.eventManager.publish.orbitControls;(t||i||s||o||0!==a)&&(this.orbitControls=new it(e,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}let o=this.renderer.domElement.width/this.renderer.getPixelRatio(),a=this.renderer.domElement.height/this.renderer.getPixelRatio();O()?.createJoysticks(this,o,a),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout(()=>{this.collisionEvents.forEach(t=>t.initialDisabled=!1)},80)}initPhysics(){this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=new ct.World(new ct.Vector3(0,this.gravity,0)),this.events=new ct.EventQueue(!0);let t=[],e=[];if(this.page.traverseChildren(i=>{let s;if(u(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;s=i.object}else if(y(i))s=i.object;else{if(m(i)||i instanceof r)return;if(s=i,!1===s.dataPatched.cloner?.disabled&&s.dataPatched.cloner?.hideBase&&!0!==s.dataPatched.physics?.fusedBody)return!0}let o,a=s.dataPatched;for(let t of a.events)!0!==t.data.disabled&&"GameControl"===t.data.type&&(o=t.data);if(!a.physics||("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled))return!0;i.updateMatrixWorldRigid();let n=Bt(a),h=!1,l=s.userData.hasDestroy,d=s.userData.hasDrag,c=!1;for(let t of a.events)if(!0!==t.data.disabled)if("Collision"===t.data.type){h=!0;let e=new pt(t.id,t.data,s,this.page,this.sharedAssets,this.eventManager);e.initialDisabled=!0,this.collisionEvents.push(e),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]&&this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].every(e=>e.id!==t.id)?this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].push(e):this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]=[e]}else if("Follow"===t.data.type){c=!0;let e=t.data.target;i.traverseVisible(t=>{t.userData.isFollowingObj=e})}"dynamic"===a.physics.rigidBody&&!1===a.physics.fusedBody&&(i.matrixWorldFusedFalse=i.matrixWorld.clone());let p=i.geometry;if(void 0!==o){let t=ct.RigidBodyDesc.kinematicPositionBased();(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(ut,yt,vt),i.position0=ut.clone().divideScalar(this.pixelsPerMeter),i.rotation0=yt.clone(),ut.divideScalar(this.pixelsPerMeter),t.setTranslation(ut.x,ut.y,ut.z).setRotation(yt);let e,n=this.sharedGameControlGlobals.rapierWorld.createRigidBody(t);i.rigidBody=n,e="sphere"===o.collider.type?ct.ColliderDesc.ball(o.collider.radius/this.pixelsPerMeter):"capsule"===o.collider.type?ct.ColliderDesc.capsule((o.collider.height/2-o.collider.radius)/this.pixelsPerMeter,o.collider.radius/this.pixelsPerMeter):ct.ColliderDesc.cuboid(o.collider.width/this.pixelsPerMeter/2,o.collider.height/this.pixelsPerMeter/2,o.collider.depth/this.pixelsPerMeter/2),e.setFrictionCombineRule(ct.CoefficientCombineRule.Average).setDensity(a.physics.density).setFriction(a.physics.friction).setRestitution(0).setRestitutionCombineRule(ct.CoefficientCombineRule.Min);let r=this.sharedGameControlGlobals.rapierWorld.createCollider(e,n);this.sharedGameControlGlobals.colliderToEntity.set(r.handle,s),ut.fromArray(o.collider.position.map(t=>"number"==typeof t?t:0)).multiply(vt.setFromMatrixScale(s.matrixWorld)).divideScalar(this.pixelsPerMeter),r.setTranslationWrtParent(ut);let h=(new C).setFromEuler((new S).setFromVector3((new M).fromArray(o.collider.rotation.map(t=>"number"==typeof t?t:0))));r.setRotationWrtParent(h),r.setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS),this.generateSensorColliderDescs(s,!0)}else"dynamic"===a.physics.rigidBody||n||c||l||d||h?(this.addRigidBody(i,s,{hasFollow:c,hasTransformAnim:n,hasDrag:d}),this.generateSensorColliderDescs(s,a.physics.fusedBody)):(p&&t.push(dt(p,i.matrixWorld)),a.physics.fusedBody&&i.traverseObject((e,i)=>{if(0===i)return;let s;if(u(e)){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;s=e.object}else{if(m(e)||e instanceof r)return;if(y(e))s=e.object;else if(s=e,s.dataPatched.cloner?.hideBase)return!0}let o=s.dataPatched;if("visibility"===o.physics.enabled?!o.visible:!o.physics.enabled)return!0;let a=e.geometry;void 0!==a?.getAttribute("position")&&t.push(dt(a,e.matrixWorld))}),this.generateSensorColliderDescs(s,a.physics.fusedBody,e));return!(!0!==a.physics?.fusedBody&&!o)||void 0}),0===t.length)return;let i=l(t);i.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);let s=ct.RigidBodyDesc.fixed(),o=this.sharedGameControlGlobals.rapierWorld.createRigidBody(s),a=ct.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array).setFrictionCombineRule(ct.CoefficientCombineRule.Multiply).setRestitutionCombineRule(ct.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(a,o);for(let[t,i]of e){let e=this.sharedGameControlGlobals.rapierWorld.createCollider(t,o);this.sensorToTriggerEvent[e.handle]=i}}updatePositions(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}rebuildBVH(){this.usePhysics?this.initPhysics():(this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let i=new mt(e.id,e.data,t,this.page,this.sharedAssets,this.eventManager),s=(new x).compose(ft.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Pt.setFromEuler(gt.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Et);if("box"===e.data.triggerZone){let o=new w;o.min.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(-.5),o.max.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(.5),this.sharedGameControlGlobals.triggers.push([o,s,t,i])}else this.sharedGameControlGlobals.triggers.push([e.data.radius,s,t,i])}}),this.needsCollisionDetection&&this.initBVH())}disconnectEvents(){this.collisionEvents.forEach(t=>t.disconnect()),this.sharedGameControlGlobals.triggers.forEach(t=>t[3].disconnect()),this.sharedGameControlGlobals.triggers.length=0}deactivate(){if(this.isEnabled){this.isEnabled=!1,this.page.traverse(t=>{let e=t;e.matrixWorldFusedFalse&&(e.matrixWorldFusedFalse=void 0),e.rigidBody&&(e.rigidBody=void 0),e.position0&&(e.position0=void 0),e.rotation0&&(e.rotation0=void 0)}),this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.sharedGameControlGlobals.kinematicBodyToEntity.clear(),this.fixedBodiesToWatch=[],this.disconnectEvents(),this.gameControl?.reset(),this.gameControl?.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach(([t,e])=>{t?.destroy(),e.remove()}),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),this.navigationMeshWrapper?.dispose(),this.navigationMeshWrapper=void 0;for(let t of Object.values(this.sharedGameControlGlobals.entityToCollisionEvents))t.forEach(t=>t.disconnect());this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}update(t){if(!this.isEnabled)return!0;let e=!0;if(void 0!==this.orbitControls&&this.orbitControls.needsUpdate&&(this.orbitControls.update(),e=!this.orbitControls.isCurrentlyDamping),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,e=!1):2===this.initializationCounter&&this.gameControl&&(e=!this.gameControl.update(t)&&e),!1===this.usePhysics&&this.checkTrigger(),this.usePhysics){let i=.016666666666666666;if(0===t)e=this.stepPhysics()&&e;else{let s=t/1e3;s<i&&s>.55*i&&(s=i),this.accumulator+=s;let o=performance.now(),a=0,n=6;for(;this.accumulator>=i&&a<n&&(e=this.stepPhysics()&&e,this.accumulator-=i,a++,!(performance.now()-o>1e3*i)););this.accumulator=this.accumulator%i}}this.skipRender=e}recordPhysicsPose(t){(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(ut,yt,vt);let e=t;void 0===e.prevQ?(e.prevQ=yt.clone(),e.prevT=ut.clone()):(e.prevQ.copy(yt),e.prevT.copy(ut))}promoteMovedFixedBodies(){for(let t=this.fixedBodiesToWatch.length-1;t>=0;t--){let[e,i,s]=this.fixedBodiesToWatch[t];(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).equals(s)||(i.setBodyType(ct.RigidBodyType.KinematicPositionBased,!0),this.sharedGameControlGlobals.kinematicBodyToEntity.set(i.handle,e),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e),this.fixedBodiesToWatch.splice(t,1))}}clampPushedBodies(){let t=this.gameControl?.object.rigidBody;if(void 0===t)return;let e=this.sharedGameControlGlobals.rapierWorld,i=t.linvel(),s=t.translation(),o=Math.hypot(i.x,i.z);for(let a=0;a<t.numColliders();a++){let n=t.collider(a);e.contactPairsWith(n,t=>{let a=t.parent();if(null===a||!a.isDynamic())return;let r=a.translation(),h=-1/0,l=0,d=0;if(e.contactPair(n,t,t=>{let e=t.normal(),o=e.x*(r.x-s.x)+e.y*(r.y-s.y)+e.z*(r.z-s.z)<0?-1:1;if(Math.abs(e.y)>.7)return;let a=o*e.x,n=o*e.z,c=Math.hypot(a,n);if(c<1e-4)return;let p=(i.x*a+i.z*n)/c;p>h&&(h=p,l=a/c,d=n/c)}),h===-1/0)return;let c=i.x*l+i.z*d;if(c<-Dt)return;let p=a.linvel();if(o>Dt&&c>Dt){let t=p.x*l+p.z*d;if(t<=0)return;let e=Math.min(t,c);return void a.setLinvel({x:l*e,y:p.y,z:d*e},!0)}let m=p.x*l+p.z*d-Math.max(0,c);if(m<=0)return;let u=.5*m;a.setLinvel({x:p.x-l*u,y:p.y,z:p.z-d*u},!0)})}}stepPhysics(){this.promoteMovedFixedBodies();for(let t of this.sharedGameControlGlobals.kinematicBodyToEntity.values())this.recordPhysicsPose(t),t.rigidBody.setNextKinematicTranslation(ut.divideScalar(this.pixelsPerMeter)),t.rigidBody.setNextKinematicRotation(yt);for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim)!0!==t.rigidBody?.isKinematic()&&this.recordPhysicsPose(t);return this.sharedGameControlGlobals.rapierWorld.step(this.events),this.clampPushedBodies(),this.events?.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}dispatchCollisionEvent(t,e,i){let s,o=(this.sharedGameControlGlobals.rapierWorld?.getCollider(i))._parent;if(e.cloner)for(let t of e.cloner.children)if(t.rigidBody===o){s=t;break}t.dispatch(s),e.dispatchEvent(wt)}updateUseWindowEvents(t){this.orbitControls?.updateUseWindowEvents(t)}generateSensorColliderDescs(t,e,i){let s=Mt.copy(t.matrixWorld).invert();t.traverseEntity((o,a)=>{if(!1===e&&1===a)return!0;for(let e of o.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let a,n=new mt(e.id,e.data,o,this.page,this.sharedAssets,this.eventManager);if(a="box"===e.data.triggerZone?ct.ColliderDesc.cuboid(...e.data.size.map(t=>("number"==typeof t?t:1)/(2*this.pixelsPerMeter))):ct.ColliderDesc.ball(e.data.radius/this.pixelsPerMeter),a.setDensity(0).setSensor(!0).setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS),ft.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Pt.setFromEuler(gt.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Ct.compose(ft,Pt,Et).premultiply(o.matrixWorld),i?(Ct.decompose(ft,Pt,bt),a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_FIXED|ct.ActiveCollisionTypes.DYNAMIC_FIXED)):(Ct.premultiply(s).decompose(ft,Pt,bt),t.rigidBody.bodyType()===ct.RigidBodyType.Dynamic||(t.rigidBody.bodyType()===ct.RigidBodyType.Fixed?a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_FIXED|ct.ActiveCollisionTypes.DYNAMIC_FIXED):a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_KINEMATIC|ct.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),ft.divideScalar(this.pixelsPerMeter),a.setTranslation(ft.x,ft.y,ft.z),a.setRotation(Pt),i)i.push([a,n]);else{let e=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t.rigidBody);this.sensorToTriggerEvent[e.handle]=n}}})}checkTrigger(){let t;for(let e=0;e<this.sharedGameControlGlobals.triggers.length;e++){let[i,s,o,a]=this.sharedGameControlGlobals.triggers[e];for(let e=0;e<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;e++){let n=this.sharedGameControlGlobals.entitiesWithTransformAnim[e];if(o===n||!1===a.isValidTriggeringObject(p.is(n)?n:n.object))continue;let r=Mt.copy(o.matrixWorld).decompose(ft,Tt,bt).compose(ft,Tt,Et).multiply(s),h=Ct.copy(n.matrixWorld).invert().multiply(r),l=n.bvhGeometry.boundsTree;i instanceof w?t=l.intersectsBox(i,h):(St.radius=i,St.center.setFromMatrixPosition(h),t=l.intersectsSphere(St)),t?-1===a.currentIntersectedObjects.indexOf(n)&&(a.currentIntersectedObjects.push(n),a.dispatch(),o.dispatchEvent(Rt)):a.currentIntersectedObjects=a.currentIntersectedObjects.filter(t=>t!==n)}}}},Wt=new Promise(t=>{Lt=t});function Ot(t){return Gt||(Gt=async function(){let e=t??(g?".":"https://cdn.spline.design/@splinetool/runtime@2.0.2/build"),i=import("./navmesh.js"),[s,o]=await Promise.all([i,fetch(`${e}/navmesh.wasm`).then(t=>t.arrayBuffer())]),a=s.default,n=await a({wasmBinary:o});Lt(n)}())}export{it as a,ht as b,B as c,W as d,I as e,dt as f,wt as g,jt as h,Bt as i,At as j,Wt as k,Ot as l};
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{a as t}from"./runtime-chunk-NTUTXO7Q.js";import{b as e}from"./runtime-chunk-2Y73BLCY.js";import{a as i,c as r,d as s,e as n,f as a}from"./runtime-chunk-Z5OH244S.js";import{E as h,b as o,k as l,o as d}from"./runtime-chunk-OW6T4XFV.js";import{a as u,b as c}from"./runtime-chunk-ML3Z74BL.js";var p,f,x,g=u((t,e)=>{function i(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}!function(t,e){function i(){this.constructor=t}i.prototype=e.prototype,t.prototype=new i}(i,Error),i.buildMessage=function(t,e){var i,r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e,i="";for(e=0;e<t.parts.length;e++)i+=t.parts[e]instanceof Array?a(t.parts[e][0])+"-"+a(t.parts[e][1]):a(t.parts[e]);return"["+(t.inverted?"^":"")+i+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function s(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function a(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+s(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+s(t)})}function h(t){return r[t.type](t)}return"Expected "+function(t){var e,i,r=new Array(t.length);for(e=0;e<t.length;e++)r[e]=h(t[e]);if(r.sort(),r.length>0){for(e=1,i=1;e<r.length;e++)r[e-1]!==r[e]&&(r[i]=r[e],i++);r.length=i}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+((i=e)?'"'+n(i)+'"':"end of input")+" found."},e.exports={SyntaxError:i,parse:function(t,e){e=void 0!==e?e:{};var r,s={},n={svg_path:xt},a=xt,h=function(t){if(!t)return[];for(var e=[],i=0;i<t.length;i++)e=e.concat.apply(e,t[i]);var r=e[0];return r&&"m"==r.code&&(delete r.relative,r.code="M"),e},o=function(t,e){return function(t,e){if(!e)return[t];for(var i=[t],r=0,s=e.length;r<s;r++)i[r+1]=e[r][1];return i}(t,e)},l=/^[Mm]/,d=ut(["M","m"],!1,!1),u=function(t,e,i){var r=jt(t,[e]);return i&&(r=r.concat(jt("M"==t?"L":"l",i[1]))),r},c=/^[Zz]/,p=ut(["Z","z"],!1,!1),f=function(){return jt("Z")},x=/^[Ll]/,g=ut(["L","l"],!1,!1),m=function(t,e){return jt(t,e)},y=/^[Hh]/,v=ut(["H","h"],!1,!1),w=function(t,e){return jt(t,e.map(function(t){return{x:t}}))},_=/^[Vv]/,S=ut(["V","v"],!1,!1),B=function(t,e){return jt(t,e.map(function(t){return{y:t}}))},b=/^[Cc]/,M=ut(["C","c"],!1,!1),C=function(t,e,i){return{x1:t.x,y1:t.y,x2:e.x,y2:e.y,x:i.x,y:i.y}},k=/^[Ss]/,A=ut(["S","s"],!1,!1),T=function(t,e){return{x2:t.x,y2:t.y,x:e.x,y:e.y}},P=/^[Qq]/,z=ut(["Q","q"],!1,!1),R=function(t,e){return{x1:t.x,y1:t.y,x:e.x,y:e.y}},O=/^[Tt]/,E=ut(["T","t"],!1,!1),H=/^[Aa]/,L=ut(["A","a"],!1,!1),F=function(t,e,i,r,s,n){return{rx:t,ry:e,xAxisRotation:i,largeArc:r,sweep:s,x:n.x,y:n.y}},U=function(t,e){return{x:t,y:e}},N=function(t){return 1*t},j=function(t){return 1*t.join("")},I=/^[01]/,W=ut(["0","1"],!1,!1),D=function(t){return"1"==t},X=function(){return""},V=",",q=dt(",",!1),Y=function(t){return t.join("")},$=".",G=dt(".",!1),Q=/^[eE]/,Z=ut(["e","E"],!1,!1),J=/^[+\-]/,K=ut(["+","-"],!1,!1),tt=/^[0-9]/,et=ut([["0","9"]],!1,!1),it=function(t){return t.join("")},rt=/^[ \t\n\r]/,st=ut([" ","\t","\n","\r"],!1,!1),nt=0,at=[{line:1,column:1}],ht=0,ot=[],lt=0;if("startRule"in e){if(!(e.startRule in n))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=n[e.startRule]}function dt(t,e){return{type:"literal",text:t,ignoreCase:e}}function ut(t,e,i){return{type:"class",parts:t,inverted:e,ignoreCase:i}}function ct(e){var i,r=at[e];if(r)return r;for(i=e-1;!at[i];)i--;for(r={line:(r=at[i]).line,column:r.column};i<e;)10===t.charCodeAt(i)?(r.line++,r.column=1):r.column++,i++;return at[e]=r,r}function pt(t,e){var i=ct(t),r=ct(e);return{start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:r.line,column:r.column}}}function ft(t){nt<ht||(nt>ht&&(ht=nt,ot=[]),ot.push(t))}function xt(){var t,e,i,r,n;for(t=nt,e=[],i=Et();i!==s;)e.push(i),i=Et();if(e!==s)if(i=function(){var t,e,i,r,n,a;if(t=nt,(e=gt())!==s){for(i=[],r=nt,n=[],a=Et();a!==s;)n.push(a),a=Et();for(n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;){for(i.push(r),r=nt,n=[],a=Et();a!==s;)n.push(a),a=Et();n!==s&&(a=gt())!==s?r=n=[n,a]:(nt=r,r=s)}i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),i===s&&(i=null),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?t=e=h(i):(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;return t}function gt(){var e,i,r,n,a,h;if(e=nt,i=function(){var e,i,r,n,a,h,o;if(e=nt,l.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(d)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s&&(n=bt())!==s?(a=nt,(h=At())===s&&(h=null),h!==s&&(o=yt())!==s?a=h=[h,o]:(nt=a,a=s),a===s&&(a=null),a!==s?e=i=u(i,n,a):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}(),i!==s){for(r=[],n=nt,a=[],h=Et();h!==s;)a.push(h),h=Et();for(a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s);n!==s;){for(r.push(n),n=nt,a=[],h=Et();h!==s;)a.push(h),h=Et();a!==s&&(h=mt())!==s?n=a=[a,h]:(nt=n,n=s)}r!==s?e=i=o(i,r):(nt=e,e=s)}else nt=e,e=s;return e}function mt(){var e,i;return c.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(p)),i!==s&&(i=f()),(e=i)===s&&(e=function(){var e,i,r,n;if(e=nt,x.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(g)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s&&(n=yt())!==s?e=i=m(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,y.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(v)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s&&(n=vt())!==s?e=i=w(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,_.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(S)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s&&(n=vt())!==s?e=i=B(i,n):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,b.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(M)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=wt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=wt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,k.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(A)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=_t())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=_t())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,P.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(z)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=St())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=St())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,O.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(E)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}())===s&&(e=function(){var e,i,r,n;if(e=nt,H.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(L)),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?(n=function(){var t,e,i,r,n,a;if(t=nt,(e=Bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}(),n!==s?e=i=m(i,n):(nt=e,e=s)):(nt=e,e=s)}else nt=e,e=s;return e}()),e}function yt(){var t,e,i,r,n,a;if(t=nt,(e=bt())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=bt())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function vt(){var t,e,i,r,n,a;if(t=nt,(e=Ct())!==s){for(i=[],r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);r!==s;)i.push(r),r=nt,(n=At())===s&&(n=null),n!==s&&(a=Ct())!==s?r=n=[n,a]:(nt=r,r=s);i!==s?t=e=o(e,i):(nt=t,t=s)}else nt=t,t=s;return t}function wt(){var t,e,i,r,n,a;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?((n=At())===s&&(n=null),n!==s&&(a=bt())!==s?t=e=C(e,r,a):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function _t(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=T(e,r):(nt=t,t=s)):(nt=t,t=s),t}function St(){var t,e,i,r;return t=nt,(e=bt())!==s?((i=At())===s&&(i=null),i!==s&&(r=bt())!==s?t=e=R(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Bt(){var t,e,i,r,n,a,h,o,l,d,u;return t=nt,(e=Mt())!==s?((i=At())===s&&(i=null),i!==s&&(r=Mt())!==s?((n=At())===s&&(n=null),n!==s&&(a=Ct())!==s&&At()!==s&&(h=kt())!==s?((o=At())===s&&(o=null),o!==s&&(l=kt())!==s?((d=At())===s&&(d=null),d!==s&&(u=bt())!==s?t=e=F(e,r,a,h,l,u):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s)):(nt=t,t=s),t}function bt(){var t,e,i,r;return t=nt,(e=Ct())!==s?((i=At())===s&&(i=null),i!==s&&(r=Ct())!==s?t=e=U(e,r):(nt=t,t=s)):(nt=t,t=s),t}function Mt(){var t;return(t=Pt())===s&&(t=Ot()),t!==s&&(t=N(t)),t}function Ct(){var t,e,i;return t=nt,(e=Rt())===s&&(e=null),e!==s&&(i=Pt())!==s?t=e=[e,i]:(nt=t,t=s),t===s&&(t=nt,(e=Rt())===s&&(e=null),e!==s&&(i=Ot())!==s?t=e=[e,i]:(nt=t,t=s)),t!==s&&(t=j(t)),t}function kt(){var e;return I.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(W)),e!==s&&(e=D(e)),e}function At(){var t,e,i,r,n;if(t=nt,e=[],(i=Et())!==s)for(;i!==s;)e.push(i),i=Et();else e=s;if(e!==s)if((i=Tt())===s&&(i=null),i!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?t=e=[e,i,r]:(nt=t,t=s)}else nt=t,t=s;else nt=t,t=s;if(t===s){if(t=nt,e=nt,(i=Tt())!==s){for(r=[],n=Et();n!==s;)r.push(n),n=Et();r!==s?e=i=[i,r]:(nt=e,e=s)}else nt=e,e=s;e!==s&&(e=X()),t=e}return t}function Tt(){var e;return 44===t.charCodeAt(nt)?(e=V,nt++):(e=s,0===lt&&ft(q)),e}function Pt(){var e,i,r;return e=nt,i=function(){var e,i,r,n;return e=nt,(i=Ot())===s&&(i=null),i!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s&&(n=Ot())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Ot())!==s?(46===t.charCodeAt(nt)?(r=$,nt++):(r=s,0===lt&&ft(G)),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s)),e!==s&&(e=Y(e)),e}(),i!==s?((r=zt())===s&&(r=null),r!==s?e=i=[i,r]:(nt=e,e=s)):(nt=e,e=s),e===s&&(e=nt,(i=Ot())!==s&&(r=zt())!==s?e=i=[i,r]:(nt=e,e=s)),e!==s&&(e=Y(e)),e}function zt(){var e,i,r,n;return e=nt,Q.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(Z)),i!==s?((r=Rt())===s&&(r=null),r!==s&&(n=Ot())!==s?e=i=[i,r,n]:(nt=e,e=s)):(nt=e,e=s),e!==s&&(e=Y(e)),e}function Rt(){var e;return J.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(K)),e}function Ot(){var e,i;if(e=[],tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et)),i!==s)for(;i!==s;)e.push(i),tt.test(t.charAt(nt))?(i=t.charAt(nt),nt++):(i=s,0===lt&&ft(et));else e=s;return e!==s&&(e=it(e)),e}function Et(){var e;return rt.test(t.charAt(nt))?(e=t.charAt(nt),nt++):(e=s,0===lt&&ft(st)),e!==s&&(e=X()),e}var Ht,Lt,Ft,Ut={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Nt in Ut)Ut[Nt.toUpperCase()]=Ut[Nt];function jt(t,e){e||(e=[{}]);for(var i=e.length;i--;){var r={code:t,command:Ut[t]};for(var s in t==t.toLowerCase()&&(r.relative=!0),e[i])r[s]=e[i][s];e[i]=r}return e}if((r=a())!==s&&nt===t.length)return r;throw r!==s&&nt<t.length&&ft({type:"end"}),Ht=ot,Lt=ht<t.length?t.charAt(ht):null,Ft=ht<t.length?pt(ht,ht+1):pt(ht,ht),new i(i.buildMessage(Ht,Lt),Ht,Lt,Ft)}}}),m=u((t,e)=>{var i=g().parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,i={x:0,y:0},r={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach(function(t){for(var s in"moveto"===t.command&&(e=t),t.x0=i.x,t.y0=i.y,r)s in t&&(t[s]+=t.relative?t[r[s]]:0);"x"in t||(t.x=i.x),"y"in t||(t.y=i.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),i=t}),t},e.exports=i});function y(){if(!f){if(!p)return Promise.reject(new Error("HanaRenderer: no Hana UI loader registered. Call setHanaUILoader() from the host app before initializing a HanaRenderer."));(f=p()).catch(()=>{f=void 0})}return f}function v(t){x=t}function w(){return p||(p=async()=>async function(t,e){return await t.default(e?{module_or_path:e}:void 0),Object.getOwnPropertyDescriptor(t.Engine.prototype,"scene")||Object.defineProperty(t.Engine.prototype,"scene",{get:function(){let e=Object.create(t.SceneController.prototype);return e.__wbg_ptr=this.__wbg_ptr,e}}),{createEngine:e=>t.Engine.create(e,JSON.parse('{"schema":13,"scenes":[{"fi":0,"id":"32603ebf4-bd9a-54ba-c1e9-6645c3ee7a53","data":{"name":"Page","backgroundColor":[0,0,0,0],"objects":[]}}],"assets":{"images":{},"videos":{},"colors":{},"audios":{},"numbers":{},"booleans":{},"strings":{},"dynamicVariables":{"counters":{},"randoms":{},"timers":{},"times":{}},"fonts":{},"animations":{},"geometries":{},"emojiArt":{}},"publish":{"logo":true,"presentationSizing":"Contain","allowPageScroll":true,"showBackground":true},"framePublish":{},"components":{}}'),!0)}}(await import("./hana-ui.js"),x??function(){let t=typeof process<"u"?"2.0.2":void 0;return`https://cdn.spline.design/@splinetool/runtime${t?`@${t}`:""}/build/hana-ui.wasm`}())),y().then(()=>{})}var _=Math.PI/180;Math.PI;var S,B=1e-10;function b(t,e){let[[i,r],[s,n]]=t,[[a,h],[o,l]]=e,d=(i-s)*(h-l)-(r-n)*(a-o);if(0===d)return!1;let u=((i-a)*(h-l)-(r-h)*(a-o))/d,c=-((i-s)*(r-h)-(r-n)*(i-a))/d;return u>=0&&u<=1&&c>=0&&c<=1}(t=>{function e(t){return[t[0],t[3],t[1],t[4],t[2],t[5]]}t.identity=function(){return[1,0,0,0,1,0,0,0,1]},t.copy=function(e,i=t.identity()){for(let t=0,r=e.length;t<r;t++)i[t]=e[t];return i},t.create=function(e,i,r,s,n,a){return t.setAbcdef(t.identity(),e,i,r,s,n,a)},t.setAbcdef=function(t,e,i,r,s,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t},t.append=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=d*s+u*a,m=d*n+u*h,y=c*s+p*a,v=c*n+p*h,w=f*s+x*a+o,_=f*n+x*h+l;return t.create(g,m,y,v,w,_)},t.prepend=function(i,r){let[s,n,a,h,o,l]=e(i),[d,u,c,p,f,x]=e(r),g=s,m=n,y=a,v=h;(1!==d||0!==u||0!==c||1!==p)&&(g=s*d+n*c,m=s*u+n*p,y=a*d+h*c,v=a*u+h*p);let w=o*d+l*c+f,_=o*u+l*p+x;return t.create(g,m,y,v,w,_)},t.getAbcdef=e,t.invert=function(e){let[i,r,s,n,a,h]=t.getAbcdef(e),o=i*n-r*s,l=n/o,d=-r/o,u=-s/o,c=i/o,p=(s*h-n*a)/o,f=-(i*h-r*a)/o;return t.create(l,d,u,c,p,f)},t.apply=function([e,i],r){let[s,n,a,h,o,l]=t.getAbcdef(r);return[s*e+a*i+o,n*e+h*i+l]},t.applyInverse=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(i),l=1/(r*a+n*-s),[d,u]=e;return[a*l*d+-n*l*u+(o*n-h*a)*l,r*l*u+-s*l*d+(-o*r+h*s)*l]},t.scale=function(e,i,r=i){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s*i,n*r,a*i,h*r,o*i,l*r),e},t.rotate=function(e,i){let r=Math.cos(i),s=Math.sin(i),[n,a,h,o,l,d]=t.getAbcdef(e);return t.setAbcdef(e,n*r-a*s,n*s+a*r,h*r-o*s,h*s+o*r,l*r-d*s,l*s+d*r),e},t.rotateAround=function(e,i,r){let[s,n]=r,a=t.translate(e,-s,-n);return a=t.rotate(a,i),a=t.translate(a,s,n),a},t.translate=function(e,i,r){let[s,n,a,h,o,l]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,o+i,l+r),e},t.setTranslate=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.setPosition=function(e,i,r){let[s,n,a,h]=t.getAbcdef(e);return t.setAbcdef(e,s,n,a,h,i,r),e},t.getScale=function(e){let[i,r,s,n]=t.getAbcdef(e);return[Math.sqrt(i*i+r*r),Math.sqrt(s*s+n*n)]},t.getPosition=function(e){let[,,,,i,r]=t.getAbcdef(e);return[i,r]},t.getRotation=function(e,i){return t.decompose(e,i).rotation},t.decompose=function(e,i){let[r,s,n,a,h,o]=t.getAbcdef(e),{rotation:l,scale:d,shear:u}=function(t){let e=t[0][0],i=t[1][0],r=t[0][1],s=t[1][1],n=Math.sqrt(e*e+i*i),a=n>B?e/n:1,h=n>B?i/n:0,o=a*e+h*i,l=a*s-h*r,d=a*r+h*s;return{rotation:Math.atan2(h,a),scale:[o,l],shear:[Math.abs(l)>B?d/l:0,0]}}([[r,n],[s,a]]);return{position:[h+(i[0]*r+i[1]*n)-i[0],o+(i[0]*s+i[1]*a)-i[1]],scale:d,rotation:l,shear:u,pivot:i}},t.compose=function(e,i,r,s,n=[0,0]){let[a,h]=e,[o,l]=s,[d,u,c,p]=function({rotation:t,scale:e,shear:i}){let r=Math.cos(t),s=Math.sin(t),n=i[0]*e[1],a=i[1]*e[0];return[r*e[0]-s*a,s*e[0]+r*a,r*n-s*e[1],s*n+r*e[1]]}({rotation:r,scale:i,shear:n}),f=a-(o*d+l*c)+o,x=h-(o*u+l*p)+l;return t.create(d,u,c,p,f,x)}})(S||(S={}));var M,C,k,A,T,P=[[-1,1],[-1,-1],[1,-1],[1,1]],z=(t,e,i)=>{let r=t.getCenter(),s=t.getHalfSize(),n=S.append(e,t.worldMatrix);0===s[0]&&0===s[1]?i.push(S.apply(r,n)):P.forEach(t=>{let e=[t[0]*s[0]+r[0],t[1]*s[1]+r[1]];i.push(S.apply(e,n))})},R=class{constructor(){this.matrix=S.identity(),this.min=[1/0,1/0],this.max=[-1/0,-1/0],this.vertices=[],this.edges=[]}setFromObjectSize(t,e=!1){t.updateWorldMatrix(),this.makeEmpty(),S.copy(t.worldMatrix,this.matrix);let i=S.invert(t.worldMatrix);this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[],s=!0===t.isBaseGroup?t:void 0;!0===i&&void 0!==s?s.traverse(t=>{t.visible&&z(t,e,r)}):z(t,e,r),this.setFromPoints(r)}setFromSize(t,e,i){this.makeEmpty(),S.copy(i,this.matrix),this.expandBySize(t,e,i)}expandBySize(t,e,i){[S.apply([0,0],i),S.apply([0,e],i),S.apply([t,e],i),S.apply([t,0],i)].forEach(t=>this.expandByPoint(t))}getCenter(){let[t,e]=this.min,[i,r]=this.getHalfSize();return S.apply([t+i,e+r],this.matrix)}getSize(){return[this.max[0]-this.min[0],this.max[1]-this.min[1]]}getHalfSize(){return[.5*(this.max[0]-this.min[0]),.5*(this.max[1]-this.min[1])]}makeEmpty(){this.min=[1/0,1/0],this.max=[-1/0,-1/0]}setFromPoints(t){this.makeEmpty();for(let e of t)this.expandByPoint(e)}expandByPoint(t){this.min=[Math.min(this.min[0],t[0]),Math.min(this.min[1],t[1])],this.max=[Math.max(this.max[0],t[0]),Math.max(this.max[1],t[1])]}computeVertices(){let[t,e]=this.getHalfSize(),i=this.getCenter(),[r,s,n,a]=S.getAbcdef(this.matrix),h=S.create(r,s,n,a,i[0],i[1]);this.vertices=P.map(([i,r])=>S.apply([i*t,r*e],h))}computeEdges(){this.edges=[];for(let t=0,e=this.vertices.length;t<e;++t)this.edges.push([this.vertices[t],this.vertices[(t+1)%e]])}project(t,e){let i=this.matrix;return e&&(i=S.append(e.worldMatrix,i)),S.applyInverse(t,i)}intersects(t,e,i){return this.intersectsInLocalSpace(...this.project([t,e],i))}intersectsInLocalSpace(t,e){let{min:i,max:r}=this;return t>=i[0]&&t<=r[0]&&e>=i[1]&&e<=r[1]}containsPoint(t){let[e,i]=t,[r,s]=this.min,[n,a]=this.max;return e>=r&&e<=n&&i>=s&&i<=a}intersectsBBox2D(t){for(let e=0,i=this.edges.length;e<i;e++){let i=this.edges[e];for(let e=0,r=t.edges.length;e<r;e++)if(b(i,t.edges[e]))return!0}for(let e=0,i=t.vertices.length;e<i;e++){let i=t.vertices[e];if(this.containsPoint(i))return!0}return!1}ensureMinMax(){let t=this.min,e=this.max;this.min=[Math.min(t[0],e[0]),Math.min(t[1],e[1])],this.max=[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}copy(t){this.min=[...t.min],this.max=[...t.max],S.copy(t.matrix,this.matrix),this.computeVertices(),this.computeEdges()}clone(){let t=new R;return t.copy(this),t}},O=class{constructor(e,i,r){this.uuid=e,this.data=i,this.isObject2D=!0,this.localMatrix=S.identity(),this.worldMatrix=S.identity(),this.ignoreCameraZoom=!1,this.visible=!0,this._singleBBox=new R,this._recursiveBBox=new R,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.stateSelection=null,this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this.name="",this.position=[0,0],this.scale=[1,1],this.rotation=0,this.shear=[0,0],this.emitter=t(),this.dpr=r.dpr??1,this.dataPatched=i}project(t,e){let i=this.worldMatrix;return e&&(i=S.append(e.worldMatrix,i)),S.applyInverse(t,i)}intersects(t,e,i,r=!1){return this.visible&&!this.data.raycastLock&&this.intersectsInLocalSpace(...this.project([t,e],i),r)}intersectsInLocalSpace(t,e,i=!1){let{min:r,max:s}=i?this.recursiveBBox:this.singleBBox;return t>=r[0]&&t<=s[0]&&e>=r[1]&&e<=s[1]}applyTransforms(t){t.setTransform(this.worldMatrix,this.ignoreCameraZoom)}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges()),this._recursiveBBox}updateLocalMatrix(){this.localMatrix=S.compose(this.position,this.scale,this.rotation*_,a.getPivot(this.dataPatched),this.shear)}updateWorldMatrix(t,e,i){let r=this.parent;e&&null!=r&&r.updateWorldMatrix(t,!0,!1),t&&this.updateLocalMatrix(),this.parent?this.worldMatrix=S.append(this.parent.worldMatrix,this.localMatrix):this.worldMatrix=S.copy(this.localMatrix),this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}get pivot(){return a.getPivot(this.data)}getCenter(){return[0,0]}getHalfSize(){return[0,0]}get id(){return this.uuid}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{t.resetBBoxNeedsUpdateSelf()})}updateTransformState(t){let e=!1;void 0!==t.position&&(e=!0,this.position=t.position),void 0!==t.rotation&&(e=!0,this.rotation=t.rotation),void 0!==t.scale&&(e=!0,this.scale=t.scale),void 0!==t.shear&&(e=!0,this.shear=t.shear),e&&(this.updateWorldMatrix(!0,!1,!0),this.resetBBoxNeedsUpdate())}updateByOp(t,i,s){0===t.type&&void 0!==t.props.visible&&(this.visible=t.props.visible),this.data=i,this.data=i;let n=t,a=e(t.path,["states","*"]);if(null!==a){if(0===t.type){let[e]=a;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=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])}}n={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}let i=d.removeOverridden(t.path,t.props,e);n={...t,props:i}}}this.updateByPatchedOpBase(n,r.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),s)}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)r.toOps(this.data,t.data).forEach(t=>{let i=l.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=r.patch(this.data,i),r.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched),this.stateSelection=t}}updateState(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.visible&&(this.visible=t.visible),this.updateTransformState(t)}updateByPatchedOpBase(t,e,i){this.dataPatched=e,this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){0===t.path.length&&0===t.type&&this.updateState(t.props,i),this.requestRender()}traverseFrameAncestors(t){this.traverseAncestors(e=>{"frame2d"===e.data.type&&t(e)})}traverseAncestors(t){let e=this.parent;for(;e;)t(e),e=e.parent}requestRender(){this.traverseFrameAncestors(t=>{t.requestRender()})}clone(t){let e=new O(this.uuid,this.data,t);return e.parent=void 0,e}addEventListener(t,e){this.emitter.on(t,e)}removeEventListener(t,e){this.emitter.off(t,e)}dispatchEvent(t){this.emitter.emit(t.type,{...t,target:t.target??this})}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children;if(e){let i=e.indexOf(this)+1;return e[i]?e[i]:t.traverseSortNextHelper()}}}sortNext(){let t=this.children;return t&&t.length>0&&t[0]?t[0]:this.traverseSortNextHelper()}isDescendantOf(t){t instanceof O&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}},E=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=h.transparent,this.blurRadius=0,this.offset=[0,0],this.spread=0,this.update(e)}update(t){void 0!==t.color&&(this.color=t.color),void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.blurRadius&&(this.blurRadius=t.blurRadius),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.spread&&(this.spread=t.spread)}},H=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.radius=0,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.radius&&(this.radius=t.radius)}},L=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=h.transparent,this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color)}},F=class{constructor(t,e,i){this.uuid=t,this.data=e,this.enabled=!1,this.color=h.transparent,this.thickness=0,this.mode="inside",this.update(e)}update(t){void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.color&&(this.color=t.color),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.mode&&(this.mode=t.mode)}},U=class extends O{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.autoClose=!0,this.fill=new L(t+"-fill",e.fill,i),this.stroke=new F(t+"-stroke",e.stroke,i),this.dropShadow=new E(t+"-dropShadow",e.dropShadow,i),this.innerShadow=new E(t+"-innerShadow",e.innerShadow,i),this.backgroundBlur=new H(t+"-backgroundBlur",e.backgroundBlur,i),this.layerBlur=new H(t+"-layerBlur",e.layerBlur,i)}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:h.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:h.transparent,t.strokeMode=this.stroke.mode,t.lineWidth=this.stroke.thickness}applyFilters(t){this.layerBlur.enabled?t.layerBlur=5*this.layerBlur.radius:t.layerBlur=0,this.backgroundBlur.enabled?t.backgroundBlur=5*this.backgroundBlur.radius:t.backgroundBlur=0,this.dropShadow.enabled?(t.dropShadowBlur=5*this.dropShadow.blurRadius,t.dropShadowColor=this.dropShadow.color,t.dropShadowOffsetX=this.dropShadow.offset[0],t.dropShadowOffsetY=this.dropShadow.offset[1]):t.dropShadowColor=h.transparent,this.innerShadow.enabled?(t.innerShadowSpread=this.innerShadow.spread,t.innerShadowBlur=5*this.innerShadow.blurRadius,t.innerShadowColor=this.innerShadow.color,t.innerShadowOffsetX=this.innerShadow.offset[0],t.innerShadowOffsetY=this.innerShadow.offset[1]):t.innerShadowColor=h.transparent}innerDraw(t){}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.applyFilters(t),this.applyFillStroke(t),t.beginPath(),this.innerDraw(t),this.autoClose&&t.closePath(),this.fill.enabled&&t.fill(),this.stroke.enabled&&t.stroke(),t.restore())}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}updateState(t,e){super.updateState(t,e),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur)}clone(t){let e=new U(this.uuid,this.data,t);return e.parent=void 0,e}},N=class extends U{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.updateState(e,i)}innerDraw(t){t.ellipse(.5*this.width,.5*this.height,.5*this.width,.5*this.height,0,0,2*Math.PI)}intersectsInLocalSpace(t,e){return function(t,e,i,r,s,n){let a=t-i,h=e-r;return a*a/(s*s)+h*h/(n*n)<=1}(t,e,.5*this.width,.5*this.height,.5*this.width,.5*this.height)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t)}clone(t){let e=new N(this.uuid,this.data,t);return e.parent=void 0,e}},j=class extends U{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.width=0,this.height=0,this.cornerRadius=[0,0,0,0],this.updateState(e,i)}innerDraw(t){t.rect(0,0,this.width,this.height,...this.cornerRadius)}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t)}clone(t){let e=new j(this.uuid,this.data,t);return e.parent=void 0,e}},I=class extends U{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._textHeight=0,this._textHeightDirty=!0,this.width=0,this.height=0,this.updateState(e,i)}get textHeight(){return this._textHeight}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:h.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:h.transparent,t.strokeMode="center",t.lineWidth=this.stroke.thickness}innerDraw(t){this._fontHolder?.arrayBuffer&&this._fontHolder.arrayBuffer.byteLength>1&&this.data.font&&t.registerFont(this._fontHolder.arrayBuffer,this.data.font);let e=this.data.textTransform,i=this.data.text.textValue.toString(),r=2===e?i.toUpperCase():3===e?i.toLowerCase():i,{height:s}=t.drawText(r,{x:0,y:0,width:this.width,height:this.height,fontSize:this.data.fontSize,lineHeight:this.data.lineHeight??1,letterSpacing:this.data.letterSpacing??0,horizontalAlign:this.data.horizontalAlign,verticalAlign:this.data.verticalAlign,font:this.data.font});this._textHeight=s}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateFontState(t,{shared:e}){void 0!==t.font&&(this._fontHolder=e.getFont(t.font),this._fontHolder&&!this._fontHolder.isLoaded&&this._fontHolder.loadingPromise.then(()=>{this.requestRender()}))}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateFontState(t,e)}clone(t){let e=new I(this.uuid,this.data,t);return e.parent=void 0,e}},W=class extends U{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.curves=[],this.extremasBBox={min:[0,0],max:[0,0]},this.updateState(e,i)}computeExtremas(){0===this.curves.length&&this.computeCurves();let t=this.curves.map(t=>M.extremas(t)),e=[1/0,1/0],i=[-1/0,-1/0];for(let r=0,s=t.length;r<s;r++){let s=t[r];s[0][0]<e[0]&&(e[0]=s[0][0]),s[0][1]<e[1]&&(e[1]=s[0][1]),s[1][0]>i[0]&&(i[0]=s[1][0]),s[1][1]>i[1]&&(i[1]=s[1][1])}return this.extremasBBox.min=[e[0],e[1]],this.extremasBBox.max=[i[0],i[1]],this.extremasBBox}computeCurves(){this.curves=[];for(let t=1,e=this.data.points.length;t<e;t++){let e=this.data.points[t].data,i=this.data.points[t-1].data,r={start:i.position,cp1:i.controlNext.position,cp2:e.controlPrevious.position,end:e.position};this.curves.push(r)}let t=this.data.points[0].data,e=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let i={start:e.position,cp1:e.controlNext.position,cp2:t.controlPrevious.position,end:t.position};this.curves.push(i)}}getCenter(){let[t,e]=this.extremasBBox.min,[i,r]=this.getHalfSize();return[t+i,e+r]}getHalfSize(){let{min:t,max:e}=this.extremasBBox;return[.5*(e[0]-t[0]),.5*(e[1]-t[1])]}innerDraw(t){for(let e=0,i=this.data.points.length;e<i;e++){let i=this.data.points[e].data;if(0===e){let[e,r]=i.position;t.moveTo(e,r)}else{let r=this.data.points[e-1].data,[s,n]=r.controlNext.position,[a,h]=i.controlPrevious.position,[o,l]=i.position,d={start:r.position,cp1:r.controlNext.position,cp2:i.controlPrevious.position,end:i.position};M.derive(d),t.bezierCurveTo(s,n,a,h,o,l)}}let e=this.data.points[0].data,i=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let[r,s]=i.controlNext.position,[n,a]=e.controlPrevious.position,[h,o]=e.position;t.bezierCurveTo(r,s,n,a,h,o)}}updateState(t,e){super.updateState(t,e),this.computeExtremas()}clone(t){let e=new W(this.uuid,this.data,t);return e.parent=void 0,e}};(t=>{function e(t,e,i,r=!1){let s=t-2*e+i;if(0!==s){let r=-Math.sqrt(Math.abs(e*e-t*i)),n=-t+e;return[-(r+n)/s,-(-r+n)/s]}return e!==i&&0===s?[(2*e-i)/(2*(e-i))]:[]}t.derive=function(t){let e=t.start,i=t.cp1,r=t.cp2,s=t.end,n={start:[3*(i[0]-e[0]),3*(i[1]-e[1])],cp:[3*(r[0]-i[0]),3*(r[1]-i[1])],end:[3*(s[0]-r[0]),3*(s[1]-r[1])]};return t.derivative=n,n.derivative=C.derive(n),n},t.droot=function(i){let r=i.derivative??t.derive(i),s=r.start,n=r.cp,a=r.end;return[e(s[0],n[0],a[0]),e(s[1],n[1],a[1])]},t.extremas=function(e){let[i,r]=t.droot(e),s=[e.start[0],e.end[0]],n=[e.start[1],e.end[1]];for(let r of i)s.push(t.compute(e,Math.min(1,Math.max(0,r)))[0]);for(let i of r)n.push(t.compute(e,Math.min(1,Math.max(0,i)))[1]);return s.sort((t,e)=>t-e),n.sort((t,e)=>t-e),[[s[0],n[0]],[s[s.length-1],n[n.length-1]]]},t.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=e*e,n=r*i,a=r*e*3,h=i*s*3,o=e*s;return[n*t.start[0]+a*t.cp1[0]+h*t.cp2[0]+o*t.end[0],n*t.start[1]+a*t.cp1[1]+h*t.cp2[1]+o*t.end[1]]}})(M||(M={})),(k=C||(C={})).derive=function(t){let e=t.start,i=t.cp,r=t.end,s={start:[2*(i[0]-e[0]),2*(i[1]-e[1])],end:[2*(r[0]-i[0]),2*(r[1]-i[1])]};return s.derivative=A.derive(s),t.derivative=s,s},k.droot=function(t){let e=t.derivative??k.derive(t),i=e.start,r=e.end;return[i[0]!==r[0]?i[0]/(i[0]-r[0]):0,i[1]!==r[1]?i[1]/(i[1]-r[1]):0]},k.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=1-e,r=i*i,s=i*e*2,n=e*e;return[r*t.start[0]+s*t.cp[0]+n*t.end[0],r*t.start[1]+s*t.cp[1]+n*t.end[1]]},(T=A||(A={})).derive=function(t){let e=t.start,i=t.end,r=[i[0]-e[0],i[1]-e[1]];return t.derivative=r,t.derivative},T.compute=function(t,e){if(0===e)return[...t.start];if(1===e)return[...t.end];let i=t.start,r=t.end;return[i[0]+(r[0]-i[0])*e,i[1]+(r[1]-i[1])*e]};var D=class extends O{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.context=i,this.isBaseGroup=!0,this.children=[]}add(t){t.parent&&t.parent instanceof D&&t.parent.remove(t),this.children.push(t),t.parent=this}remove(t){let e=this.children.indexOf(t);e>=0&&(this.children.splice(e,1),t.parent=void 0)}traverse(t){let e=t(this);if(!0!==e)for(let i of this.children)i instanceof D?i.traverse(t):e=t(i)}intersectsChildrenHelper(t,e,i,r,s){for(let n of this.children)if(n.intersects(t,e,i,!1)&&(s.push(n),r)||n instanceof D&&n.intersectsChildrenHelper(t,e,i,r,s))return!0;return!1}intersectsChildren(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelper(t,e,i,r,s),s}intersectsChildrenHelperReverse(t,e,i,r,s){for(let n of this.children)if(n instanceof D&&n.intersectsChildrenHelperReverse(t,e,i,r,s)||n.intersects(t,e,i,!1)&&(s.push(n),r))return!0;return!1}intersectsChildrenReverse(t,e,i,r=!1,s=[],n=!1){return this.intersectsChildrenHelperReverse(t,e,i,r,s),s}updateWorldMatrix(t,e,i){if(super.updateWorldMatrix(t,e,i),i&&this.children)for(let e of this.children)e.updateWorldMatrix(t,!1,!0)}find(t){let e;return this.traverse(i=>{i.uuid===t&&(e=i)}),e}innerDrawChildren(t){for(let e=this.children.length-1;e>=0;e--)this.children[e].draw(t)}resetBBoxNeedsUpdate(){super.resetBBoxNeedsUpdate(),this.traverse(t=>{t.resetBBoxNeedsUpdateSelf()})}clone(t){let e=new D(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},X=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this.updateState(e,i)}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.innerDrawChildren(t),t.restore())}clone(t){let e=new X(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},V=class extends D{constructor(t,e,i){super(t,e,i),this.uuid=t,this.width=0,this.height=0,this.clipped=!0,this.background=new j(t+"-background",s.defaultData,i),this.background.parent=this,this.updateState(e,i)}get fill(){return this.background.fill}get stroke(){return this.background.stroke}get backgroundBlur(){return this.background.backgroundBlur}get layerBlur(){return this.background.layerBlur}get dropShadow(){return this.background.dropShadow}get innerShadow(){return this.background.innerShadow}get cornerRadius(){return this.background.cornerRadius}set cornerRadius(t){this.background.cornerRadius=t}updateLocalMatrix(){super.updateLocalMatrix(),this.background?.updateLocalMatrix()}updateWorldMatrix(t,e,i){super.updateWorldMatrix(t,e,i),this.background?.updateWorldMatrix(t,e,i)}draw(t){if(!this.visible)return;t.save();let e=this.width,i=this.height;this.applyTransforms(t),this.background.width=e,this.background.height=i,this.background.draw(t),this.clipped&&t.clipRect(0,0,e,i,...this.cornerRadius),this.innerDrawChildren(t),t.restore()}getCenter(){return[.5*this.width,.5*this.height]}getHalfSize(){return[.5*this.width,.5*this.height]}updateCornerState(t){void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let e=!1;void 0!==t.width&&(this.width="number"==typeof t.width?t.width:this.width,e=!0),void 0!==t.height&&(this.height="number"==typeof t.height?t.height:this.height,e=!0),e&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,e){super.updateState(t,e),this.updateSizeState(t),this.updateCornerState(t),void 0!==t.fill&&this.fill.update(t.fill),void 0!==t.stroke&&this.stroke.update(t.stroke),void 0!==t.dropShadow&&this.dropShadow.update(t.dropShadow),void 0!==t.innerShadow&&this.innerShadow.update(t.innerShadow),void 0!==t.layerBlur&&this.layerBlur.update(t.layerBlur),void 0!==t.backgroundBlur&&this.backgroundBlur.update(t.backgroundBlur),void 0!==t.clipped&&(this.clipped=t.clipped)}requestRender(){super.requestRender(),this.dispatchEvent({type:"render"})}dispose(){this.removeEventListener("render")}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),0===t.type&&(e(t.path,["fill"])?this.fill.update(t.props):e(t.path,["stroke"])?this.stroke.update(t.props):e(t.path,["dropShadow"])?this.dropShadow.update(t.props):e(t.path,["innerShadow"])?this.innerShadow.update(t.props):e(t.path,["layerBlur"])?this.layerBlur.update(t.props):e(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}clone(t){let e=new V(this.uuid,this.data,t);e.parent=void 0;for(let i of this.children)e.add(i.clone(t));return e}},q=c(m(),1),Y=class extends U{constructor(t,e,i){super(t,e,i),this.uuid=t,this.data=e,this._pathBBox=new DOMRect,this.path="",this.updateState(e,i),this.autoClose=!1,this.computeSVGBBox()}computeSVGBBox(){let t=this.path;$(this.path)&&(console.warn("Invalid SVG path",this.uuid),t="");let e=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=document.createElementNS("http://www.w3.org/2000/svg","path");document.body.appendChild(e),i.setAttribute("d",t),e.appendChild(i),this._pathBBox=i.getBBox(),e.remove()}innerDraw(t){t.path(this.path)}intersectsInLocalSpace(t,e){return t>=this._pathBBox.x&&t<=this._pathBBox.x+this._pathBBox.width&&e>=this._pathBBox.y&&e<=this._pathBBox.y+this._pathBBox.height}getCenter(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}getHalfSize(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}updateState(t,e){super.updateState(t,e),void 0!==t.path&&(this.path=t.path,this.computeSVGBBox())}clone(t){let e=new Y(this.uuid,this.data,t);return e.parent=void 0,e}};function $(t){return/NaN/.test(t)}function G(t,e=1,i=1){if(e<=0||i<=0)return t;if($(t))return console.warn("Cannot scale invalid path",t),Q([]);try{return Q((0,q.parseSVG)(t).map(t=>{let r={...t};return"x"in r&&(r.x=r.x*e),"y"in r&&(r.y=r.y*i),"x1"in r&&(r.x1=r.x1*e),"x2"in r&&(r.x2=r.x2*e),"y1"in r&&(r.y1=r.y1*i),"y2"in r&&(r.y2=r.y2*i),"rx"in r&&(r.rx=r.rx*e),"ry"in r&&(r.ry=r.ry*i),r}))}catch(t){return console.warn("Error parsing SVG path",t),Q([])}}function Q(t){let e,i=["rx","ry","xAxisRotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(t=>{let r=[];i.forEach(e=>{if(e in t){let i=1*t[e];r.length&&i>=0&&r.push(","),r.push(i)}});let s=(e===t.code?r[0]<0?"":",":t.code)+r.join("");return e=t.code,s}).join("")}var Z=class{constructor(t,e,i){this.uuid=t,this.data=e,this.group=new X(Z.GROUP_ID,{...n.defaultData},i),this.createChildrenObjects(e.objects,this.group,i)}createObject(t,e,i,r,s,n){let a=function(t,e,i){switch(e.type){case"ellipse2d":return new N(t,e,i);case"rectangle2d":return new j(t,e,i);case"text2d":return new I(t,e,i);case"vector2d":return new W(t,e,i);case"path2d":return new Y(t,e,i);case"frame2d":return new V(t,e,i);default:return new X(t,e,i)}}(t,e,n);a&&(r.add(a),r.children.splice(s,0,r.children.pop()),a.updateWorldMatrix(),i.length>0&&(a instanceof X||a instanceof V)&&this.createChildrenObjects(i,a,n))}createChildrenObjects(t,e,i){let r=0;for(let s of t)this.createObject(s.id,s.data,s.children,e,r,i),r+=1}draw(t){this.group.draw(t)}updateEntityByOp(t,e,i,r){let s=this.find(t);if(s)try{s.updateByOp(e,i,{shared:r})}catch(t){console.error(t)}}updateTreeByOp(t,e){if(0===t.path.length&&7===t.type){let i=null===t.parent?this.group:this.find(t.parent);void 0!==i&&i instanceof D&&(this.createObject(t.id,t.data,t.children,i,t.localIndex,e),i.requestRender())}else if(0===t.path.length&&8===t.type){let e=this.find(t.id);if(void 0!==e&&void 0!==e.parent&&e.parent instanceof D){let t=e.parent;e.resetBBoxNeedsUpdate(),t?.remove(e),t?.requestRender()}}else if(0===t.path.length&&9===t.type){let e=this.find(t.id);if(void 0!==e){let r=e.parent,s=null===t.parent?this:this.find(t.parent);if(void 0===s&&i&&console.error("unexpected",s,t),s instanceof D||s===this){s.add(e);let i=t.localIndex;s.children.splice(i,0,s.children.pop()),e.updateWorldMatrix(!0,!1,!0),r?.requestRender(),e.requestRender()}e.resetBBoxNeedsUpdate()}}}add(t){this.group.add(t)}remove(t){this.group.remove(t)}traverse(t){this.group.traverse(e=>{e!==this.group&&t(e)})}intersectsChildren(t,e,i,r=!1,s=[]){return this.group.intersectsChildren(t,e,i,r,s,!0)}intersectsChildrenReverse(t,e,i,r=!1,s=[]){return this.group.intersectsChildrenReverse(t,e,i,r,s,!0)}find(t){return this.group.find(t)}get children(){return this.group.children}project(t,e){return this.group.project(t,e)}getWithSortKey(t){let e=this.find(t);if(void 0===e)return;let i=[],r=e;for(;r!==this.group;){let t=r;r=r.parent;let e=r.children.indexOf(t);i.splice(0,0,e)}return{entity:e,sortKey:i}}getAllSorted(t){let e=[];for(let i of t){let t=this.getWithSortKey(i.id);void 0!==t&&e.push(t)}return e.sort((t,e)=>o(t.sortKey,e.sortKey)),e.map(t=>t.entity)}},J=Z;J.GROUP_ID="scene2d";var K=c(m(),1);function tt(t,e,i,r,s,n,a,h,o,l){if(e===o&&i===l)return;if(r=Math.abs(r),s=Math.abs(s),0===r||0===s)return void t.push({LineTo:{x:o,y:l}});let d=n*Math.PI/180,u=Math.cos(d),c=Math.sin(d),p=(e-o)/2,f=(i-l)/2,x=u*p+c*f,g=-c*p+u*f,m=x*x/(r*r)+g*g/(s*s);if(m>1){let t=Math.sqrt(m);r*=t,s*=t}let y=r*r,v=s*s,w=y*v-y*g*g-v*x*x,_=y*g*g+v*x*x,S=(a!==h?1:-1)*Math.sqrt(Math.max(0,w/_)),B=S*(r*g)/s,b=S*(-s*x)/r,M=u*B-c*b+(e+o)/2,C=c*B+u*b+(i+l)/2,k=Math.atan2((g-b)/s,(x-B)/r),A=Math.atan2((-g-b)/s,(-x-B)/r)-k;!h&&A>0?A-=2*Math.PI:h&&A<0&&(A+=2*Math.PI);let T=Math.max(1,Math.ceil(Math.abs(A)/(Math.PI/2))),P=A/T,z=4/3*Math.tan(P/4),R=k,O=e,E=i;for(let e=0;e<T;e++){let e=R+P,i=Math.cos(R),n=Math.sin(R),a=Math.cos(e),h=Math.sin(e),o=M+r*a*u-s*h*c,l=C+r*a*c+s*h*u,d=-r*n*u-s*i*c,p=-r*n*c+s*i*u,f=-r*h*u-s*a*c,x=-r*h*c+s*a*u;t.push({CurveTo:[{x:O+z*d,y:E+z*p},{x:o-z*f,y:l-z*x},{x:o,y:l}]}),R=e,O=o,E=l}}var et=.5522847498307936,it=3408/2816,rt=1536/2816,st=!1;function nt(){st||(st=!0,console.warn("[HanaRenderer] clipRect: precise clipping of rotated/complex content is not supported by the Hana UI overlay yet; drawing unclipped. (Axis-aligned rectangles are clipped geometrically.)"))}var at=class{constructor(t,e=1){this.canvas=t,this._dpr=e,this._width=0,this._height=0,this._isSizeDirty=!1,this._crashed=!1,this._shapes=[],this._lastPushedJSON="",this._ctm=S.identity(),this._stack=[],this._clips=[],this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0,this._fillColor=h.transparent,this._strokeColor=h.transparent,this._lineWidth=1,this._strokeMode="inside",this._layerBlur=0,this._backgroundBlur=0,this._dropShadowBlur=0,this._dropShadowOffsetX=0,this._dropShadowOffsetY=0,this._dropShadowColor=h.transparent,this._innerShadowBlur=0,this._innerShadowOffsetX=0,this._innerShadowOffsetY=0,this._innerShadowSpread=0,this._innerShadowColor=h.transparent,this._fonts=new Map,this._fontsFlushed=new Set,this._fontXPerEm=new Map,this._measureCache=new Map;try{let i=t.getBoundingClientRect();t.width=i.width*e,t.height=i.height*e}catch{console.log(t.width,e)}}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this._isSizeDirty=!0}get width(){return this._width}get height(){return this._height}async init(){if(!this._engine&&!this._crashed){try{this._context=await y(),this._engine=await this._context.createEngine(this.canvas)}catch(t){return this._crashed=!0,void console.error("[HanaRenderer] Failed to load the Hana UI engine; UI scenes will not render.",t)}if(this._width>0&&this._height>0)this._syncViewport();else{let t=this.canvas.getBoundingClientRect();t.width>0&&t.height>0&&(this._width=t.width,this._height=t.height,this._syncViewport())}this._flushFonts()}}_syncViewport(){let t=this._engine;if(!t||this._crashed)return;let e=this._width,i=this._height;this.canvas.style.width=e+"px",this.canvas.style.height=i+"px",this.canvas.width=Math.max(1,Math.ceil(e*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(i*this._dpr)),this._guard(()=>{t.resize([e,i],this._dpr),t.scene.updateCamera({position:[e/2,i/2],zoom:1})})}setSize(t,e){!this._isSizeDirty&&t===this._width&&e===this._height||(this._isSizeDirty=!1,this._width=t,this._height=e,this._engine?this._syncViewport():(this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",this.canvas.width=Math.max(1,Math.ceil(t*this._dpr)),this.canvas.height=Math.max(1,Math.ceil(e*this._dpr))))}_guard(t){if(!this._crashed)try{t()}catch(t){this._crashed=!0,console.error("[HanaRenderer] Hana engine call failed; disabling this renderer instance.",t)}}async loadFont(t,e){try{let i=await fetch(t);if(!i.ok)return void console.error(`[HanaRenderer] loadFont: ${t} returned HTTP ${i.status}; skipping "${e}"`);let r=await i.arrayBuffer();if(0===r.byteLength)return void console.error(`[HanaRenderer] loadFont: ${t} was empty; skipping "${e}"`);this.registerFont(r,e)}catch(i){console.error(`[HanaRenderer] loadFont failed for "${e}" (${t}):`,i)}}registerFont(t,e){if(this._fonts.has(e))return;this._fonts.set(e,t);let i=function(t){try{let e=new DataView(t),i=e.getUint32(0);if(65536!==i&&1330926671!==i&&1953658213!==i)return;let r=e.getUint16(4),s=-1,n=-1;for(let t=0;t<r;t++){let i=12+16*t,r=e.getUint32(i);1751474532===r&&(s=e.getUint32(i+8)),1330851634===r&&(n=e.getUint32(i+8))}if(s<0||n<0)return;let a=e.getUint16(s+18),h=e.getUint16(n);if(0===a||h<2)return;let o=e.getInt16(n+86);return o>0?o/a:void 0}catch{return}}(t);void 0!==i&&this._fontXPerEm.set(e,i),this._flushFonts()}_flushFonts(){let t=this._engine;if(t)for(let[e,i]of this._fonts)this._fontsFlushed.has(e)||(this._fontsFlushed.add(e),this._guard(()=>{t.scene.addLocalFont(e,new Uint8Array(i))}))}set strokeColor(t){this._strokeColor=t}set fillColor(t){this._fillColor=t}set lineWidth(t){this._lineWidth=t}set strokeMode(t){this._strokeMode=t}set dropShadowBlur(t){this._dropShadowBlur=t}set dropShadowColor(t){this._dropShadowColor=t}set dropShadowOffsetX(t){this._dropShadowOffsetX=t}set dropShadowOffsetY(t){this._dropShadowOffsetY=t}set innerShadowBlur(t){this._innerShadowBlur=t}set innerShadowColor(t){this._innerShadowColor=t}set innerShadowOffsetX(t){this._innerShadowOffsetX=t}set innerShadowOffsetY(t){this._innerShadowOffsetY=t}set innerShadowSpread(t){this._innerShadowSpread=t}set layerBlur(t){this._layerBlur=t}set backgroundBlur(t){this._backgroundBlur=t}save(){this._stack.push({ctm:S.copy(this._ctm),clipLen:this._clips.length})}restore(){let t=this._stack.pop();!t||(this._ctm=t.ctm,this._clips.length=t.clipLen)}setTransform(t,e=!1){let i=S.identity();if(this.camera?.enabled&&(i=S.append(i,this.camera.worldMatrix),e)){let t=S.getScale(this.camera.worldMatrix);i=S.scale(i,1/t[0],1/t[1])}this._ctm=S.append(i,t)}transform(t){this._ctm=S.append(this._ctm,t)}beginPath(){this._pathEls=[],this._simpleShape=null,this._pathPrimitives=0}closePath(){0!==this._pathEls.length&&"ClosePath"!==this._pathEls[this._pathEls.length-1]&&this._pathEls.push("ClosePath")}_startFreeform(){this._simpleShape=null,this._pathPrimitives++}moveTo(t,e){this._startFreeform(),this._pathEls.push({MoveTo:{x:t,y:e}})}lineTo(t,e){this._startFreeform(),this._pathEls.push({LineTo:{x:t,y:e}})}bezierCurveTo(t,e,i,r,s,n){this._startFreeform(),this._pathEls.push({CurveTo:[{x:t,y:e},{x:i,y:r},{x:s,y:n}]})}quadraticCurveTo(t,e,i,r){this._startFreeform(),this._pathEls.push({QuadTo:[{x:t,y:e},{x:i,y:r}]})}path(t){this._startFreeform(),this._pathEls.push(...function(t){let e,i=[];try{e=(0,K.makeAbsolute)((0,K.parseSVG)(t))}catch(t){return console.error("[HanaRenderer] Failed to parse SVG path:",t),i}let r=0,s=0,n=0,a=0,h=null,o=null;for(let t of e){let e=null,l=null;switch(t.code){case"M":r=n=t.x,s=a=t.y,i.push({MoveTo:{x:r,y:s}});break;case"L":r=t.x,s=t.y,i.push({LineTo:{x:r,y:s}});break;case"H":r=t.x,i.push({LineTo:{x:r,y:s}});break;case"V":s=t.y,i.push({LineTo:{x:r,y:s}});break;case"C":{let n={x:t.x1,y:t.y1},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"S":{let n=h?{x:2*r-h.x,y:2*s-h.y}:{x:r,y:s},a={x:t.x2,y:t.y2};r=t.x,s=t.y,i.push({CurveTo:[n,a,{x:r,y:s}]}),e=a;break}case"Q":{let e={x:t.x1,y:t.y1};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"T":{let e=o?{x:2*r-o.x,y:2*s-o.y}:{x:r,y:s};r=t.x,s=t.y,i.push({QuadTo:[e,{x:r,y:s}]}),l=e;break}case"A":{let e=r,n=s;r=t.x,s=t.y,tt(i,e,n,t.rx,t.ry,t.xAxisRotation,t.largeArc,t.sweep,r,s);break}case"Z":r=n,s=a,i.push("ClosePath")}h=e,o=l}return i}(t))}rect(t,e,i,r,s=0,n=0,a=0,h=0){if(!ut([t,e,i,r]))return;let o={x:t,y:e,w:i,h:r,radii:[s,n,a,h]};this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"rect",rect:o,smoothing:0}:null,xt(this._pathEls,o)}ellipse(t,e,i,r,s,n,a,h){if(ut([t,e,i,r])){if(i<0||r<0)throw Error("radii cannot be negative");this._pathPrimitives++,this._simpleShape=1===this._pathPrimitives&&0===this._pathEls.length?{kind:"ellipse",cx:t,cy:e,rx:i,ry:r}:null,function(t,e,i,r,s){let n=r*et,a=s*et;t.push({MoveTo:{x:e+r,y:i}},{CurveTo:[{x:e+r,y:i+a},{x:e+n,y:i+s},{x:e,y:i+s}]},{CurveTo:[{x:e-n,y:i+s},{x:e-r,y:i+a},{x:e-r,y:i}]},{CurveTo:[{x:e-r,y:i-a},{x:e-n,y:i-s},{x:e,y:i-s}]},{CurveTo:[{x:e+n,y:i-s},{x:e+r,y:i-a},{x:e+r,y:i}]},"ClosePath")}(this._pathEls,t,e,i,r)}}clipRect(t,e,i,r,s=0,n=0,a=0,h=0){let o=S.invert(this._ctm);!o||this._clips.push({m:S.copy(this._ctm),inv:o,rect:{x:t,y:e,w:i,h:r,radii:[s,n,a,h]}})}fill(){this._emit(!0)}stroke(){this._strokeColor.a<=0||this._lineWidth<=0||this._emit(!1)}_emit(t){let e=this._effectChain(t);if(t&&this._fillColor.a<=0&&!e)return;let i=this._classifyShape();if(!i)return;let r=this._applyClips(i);if("skip"===r)return;if(!t&&r!==i){let t=pt(i);if(t)return void this._emitClippedRectStroke(t,e)}i=r;let s={shape:i,color:t?dt(this._fillColor):[0,0,0,0],transform:S.getAbcdef(this._ctm)};t||(s.stroke=this._strokeDesc()),e&&(s.effect_chain=e),this._shapes.push(s)}_emitClippedRectStroke(t,e){let i=this._lineWidth,r="outside"===this._strokeMode?i:"center"===this._strokeMode?i/2:0,s=i-r,n=Math.min(t.w,t.h)/2,a=t.radii.map(t=>Math.max(0,Math.min(t,n))),h={x:t.x-r,y:t.y-r,w:t.w+2*r,h:t.h+2*r,radii:a.map(t=>t>0?t+r:0)},o=t.w-2*s,l=t.h-2*s,d=o>0&&l>0?{x:t.x+s,y:t.y+s,w:o,h:l,radii:a.map(t=>Math.max(0,t-s))}:null,u=this._applyClips(ct(h,0));if("skip"===u)return;let c=pt(u)??h,p=null;if(d){let t=this._applyClips(ct(d,0));p="skip"===t?null:pt(t)??d}let f=[];xt(f,c),p&&function(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i,y:r+n}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i+s,y:r}},"ClosePath");let u=1-et;t.push({MoveTo:{x:i+h,y:r}}),h>0&&t.push({CurveTo:[{x:i+h*u,y:r},{x:i,y:r+h*u},{x:i,y:r+h}]}),t.push({LineTo:{x:i,y:r+n-d}}),d>0&&t.push({CurveTo:[{x:i,y:r+n-d*u},{x:i+d*u,y:r+n},{x:i+d,y:r+n}]}),t.push({LineTo:{x:i+s-l,y:r+n}}),l>0&&t.push({CurveTo:[{x:i+s-l*u,y:r+n},{x:i+s,y:r+n-l*u},{x:i+s,y:r+n-l}]}),t.push({LineTo:{x:i+s,y:r+o}}),o>0&&t.push({CurveTo:[{x:i+s,y:r+o*u},{x:i+s-o*u,y:r},{x:i+s-o,y:r}]}),t.push("ClosePath")}(f,p);let x={shape:{Custom:f},color:dt(this._strokeColor),transform:S.getAbcdef(this._ctm)};e&&(x.effect_chain=e),this._shapes.push(x)}_classifyShape(){let t=this._simpleShape;return t?"rect"===t.kind?ct(t.rect,t.smoothing):{Ellipse:{center_x:t.cx,center_y:t.cy,rx:t.rx,ry:t.ry}}:0===this._pathEls.length?null:{Custom:this._pathEls.slice()}}_strokeDesc(){return{width:this._lineWidth,line_join:"Miter",color:dt(this._strokeColor),align:ht[this._strokeMode],cap:"Butt"}}_effectChain(t){let e=this.camera?.scale??1,i=[];if(t&&this._dropShadowColor.a>0&&i.push({DropShadow:{position:[this._dropShadowOffsetX*e,this._dropShadowOffsetY*e],blur:{Uniform:{size:2*this._dropShadowBlur*e}},spread:0,color:dt(this._dropShadowColor)}}),t&&this._backgroundBlur>0){let[t,e]=S.getScale(this._ctm),r=(t+e)/2;i.push({BackgroundBlur:{blur:{Uniform:{size:2*this._backgroundBlur*r}}}})}if(this._layerBlur>0&&i.push({LayerBlur:{blur:{Uniform:{size:2*this._layerBlur*e}}}}),t&&this._innerShadowColor.a>0){let[t,r,s,n]=S.getAbcdef(this._ctm),a=this._innerShadowOffsetX,h=this._innerShadowOffsetY;i.push({InnerShadow:{position:[t*a+s*h,r*a+n*h],blur:{Uniform:{size:2*this._innerShadowBlur*e}},spread:this._innerShadowSpread*e,color:dt(this._innerShadowColor)}})}return i.length>0?i:void 0}_applyClips(t){if(0===this._clips.length)return t;let e=t;for(let t of this._clips){let i=S.append(t.inv,this._ctm),[r,s,n,a,h,o]=S.getAbcdef(i),l=Math.abs(s)<=1e-6*(Math.abs(r)+Math.abs(a))&&Math.abs(n)<=1e-6*(Math.abs(r)+Math.abs(a)),d=ft(e);if(!d)return e;if(!l){nt();continue}let u=r*d.minX+h,c=r*d.maxX+h,p=a*d.minY+o,f=a*d.maxY+o,x=Math.min(u,c),g=Math.max(u,c),m=Math.min(p,f),y=Math.max(p,f),v=t.rect,w=Math.max(x,v.x),_=Math.max(m,v.y),B=Math.min(g,v.x+v.w),b=Math.min(y,v.y+v.h);if(w>=B||_>=b)return"skip";if(w===x&&_===m&&B===g&&b===y)continue;let M=pt(e);if(!M||0===r||0===a){nt();continue}let C=(w-h)/r,k=(B-h)/r,A=(_-o)/a,T=(b-o)/a,P=Math.min(C,k),z=Math.min(A,T),R=Math.abs(k-C),O=Math.abs(T-A),[E,H,L,F]=M.radii,U=P!==M.x,N=z!==M.y,j=P+R!==M.x+M.w,I=z+O!==M.y+M.h,W=Math.min(R,O)/2;e=ct({x:P,y:z,w:R,h:O,radii:[U||N?0:Math.min(E,W),j||N?0:Math.min(H,W),j||I?0:Math.min(L,W),U||I?0:Math.min(F,W)]},0)}return e}drawText(t,e){let i=this._fontXPerEm.get(e.font),r=i?i/rt:1,s={TextSimple:{text:t,font_size:e.fontSize*it*r,size:[e.width,e.height],horizontal_align:ot[e.horizontalAlign]??"Left",vertical_align:lt[e.verticalAlign]??"Top"}},n=this._effectChain(!0),a=this._fillColor.a>0,h=this._strokeColor.a>0&&this._lineWidth>0;if(a||h||n){let t={shape:s,color:a?dt(this._fillColor):[0,0,0,0],transform:S.getAbcdef(S.append(this._ctm,S.translate(S.identity(),e.x,e.y)))};h&&(t.stroke=this._strokeDesc()),n&&(t.effect_chain=n),this._shapes.push(t)}return{height:this._measureTextHeight(t,e)}}_measureTextHeight(t,e){let i=`${e.font}|${e.fontSize}|${e.lineHeight}|${e.letterSpacing}|${e.width}|${t}`,r=this._measureCache.get(i);if(void 0!==r)return r;let s=0,n=this._engine;if(n&&!this._crashed&&this._fontsFlushed.has(e.font))try{let[,i]=n.scene.measureTextNaturalSize({size:[e.width,e.height],text:t,fontSize:e.fontSize,horizontalAlign:ot[e.horizontalAlign]??"Left",verticalAlign:lt[e.verticalAlign]??"Top",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,textTransform:"None",font:e.font,version:0,autoSize:"None",truncate:"None"});s=i}catch{}if(!(s>0)){let i=.55*e.fontSize+Math.max(0,e.letterSpacing),r=Math.max(1,Math.floor(e.width/i)),n=0;for(let e of t.split("\n"))n+=Math.max(1,Math.ceil(e.length/r));s=n*e.fontSize*e.lineHeight}return this._measureCache.size>512&&this._measureCache.clear(),this._measureCache.set(i,s),s}clear(){this._shapes=[],this._ctm=S.identity(),this._stack.length=0,this._clips.length=0}render(){let t=this._engine;if(!t||this._crashed)return;let e=JSON.stringify(this._shapes);e!==this._lastPushedJSON&&(this._guard(()=>t.scene.updateUiShapes(this._shapes)),this._lastPushedJSON=e),this._guard(()=>t.onFrame())}},ht={inside:"Inside",outside:"Outside",center:"Center"},ot={1:"Left",2:"Right",3:"Center",4:"Justify"},lt={1:"Top",2:"Center",3:"Bottom"};function dt({r:t,g:e,b:i,a:r}){return[t,e,i,r]}function ut(t){for(let e=0;e<t.length;e++)if(void 0!==t[e]&&!Number.isFinite(t[e]))return!1;return!0}function ct(t,e){let[i,r,s,n]=t.radii;return 0===i&&0===r&&0===s&&0===n?{Rectangle:{x:t.x,y:t.y,width:t.w,height:t.h}}:{RoundedRectangle:{x:t.x,y:t.y,width:t.w,height:t.h,radius:[i,r,s,n],corner_smoothing:e}}}function pt(t){if("Rectangle"in t){let e=t.Rectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[0,0,0,0]}}if("RoundedRectangle"in t){let e=t.RoundedRectangle;return{x:e.x,y:e.y,w:e.width,h:e.height,radii:[e.radius[0],e.radius[1],e.radius[2],e.radius[3]]}}return null}function ft(t){let e=pt(t);if(e)return{minX:e.x,minY:e.y,maxX:e.x+e.w,maxY:e.y+e.h};if("Ellipse"in t){let e=t.Ellipse;return{minX:e.center_x-e.rx,minY:e.center_y-e.ry,maxX:e.center_x+e.rx,maxY:e.center_y+e.ry}}if("TextSimple"in t){let e=t.TextSimple;return{minX:0,minY:0,maxX:e.size[0],maxY:e.size[1]}}if("Custom"in t){let e=1/0,i=1/0,r=-1/0,s=-1/0,n=t=>{t.x<e&&(e=t.x),t.y<i&&(i=t.y),t.x>r&&(r=t.x),t.y>s&&(s=t.y)};for(let e of t.Custom)"ClosePath"!==e&&("MoveTo"in e?n(e.MoveTo):"LineTo"in e?n(e.LineTo):"QuadTo"in e?e.QuadTo.forEach(n):"CurveTo"in e&&e.CurveTo.forEach(n));return e===1/0?null:{minX:e,minY:i,maxX:r,maxY:s}}return null}function xt(t,e){let{x:i,y:r,w:s,h:n}=e,a=Math.min(s,n)/2,[h,o,l,d]=e.radii.map(t=>Math.max(0,Math.min(t,a)));if(0===h&&0===o&&0===l&&0===d)return void t.push({MoveTo:{x:i,y:r}},{LineTo:{x:i+s,y:r}},{LineTo:{x:i+s,y:r+n}},{LineTo:{x:i,y:r+n}},"ClosePath");let u=1-et;t.push({MoveTo:{x:i+h,y:r}}),t.push({LineTo:{x:i+s-o,y:r}}),o>0&&t.push({CurveTo:[{x:i+s-o*u,y:r},{x:i+s,y:r+o*u},{x:i+s,y:r+o}]}),t.push({LineTo:{x:i+s,y:r+n-l}}),l>0&&t.push({CurveTo:[{x:i+s,y:r+n-l*u},{x:i+s-l*u,y:r+n},{x:i+s-l,y:r+n}]}),t.push({LineTo:{x:i+d,y:r+n}}),d>0&&t.push({CurveTo:[{x:i+d*u,y:r+n},{x:i,y:r+n-d*u},{x:i,y:r+n-d}]}),t.push({LineTo:{x:i,y:r+h}}),h>0&&t.push({CurveTo:[{x:i,y:r+h*u},{x:i+h*u,y:r},{x:i+h,y:r}]}),t.push("ClosePath")}function gt({constraints:t,newParentWidth:e,newParentHeight:i,initialParentWidth:r,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:a,objectInitialPosition:h}){let{horizontalConstraint:o,verticalConstraint:l}=t,d=e-r,u=i-s,c=n,p=a,f=h[0],x=h[1];if(0!==o)if(1===o)f+=d;else if(3===o)f+=d/2;else if(2===o)c=Math.max(1,c+d);else if(4===o){let t=e/r;c*=t,f*=t}if(0!==l)if(1===l)x+=u;else if(3===l)x+=u/2;else if(2===l)p=Math.max(1,p+u);else if(4===l){let t=i/s;p*=t,x*=t}return{width:c,height:p,position:[f,x]}}c(m(),1);export{S as a,v as b,w as c,at as d,U as e,N as f,j as g,I as h,X as i,V as j,Y as k,G as l,J as m,gt as n};
Binary file
Binary file
@@ -1,2 +0,0 @@
1
- G ��\�k
2
- �p�ަ�] v\�s�����5X���.��`��A��c����0ѡdݷA�ff˒b8ȸ����&>3��C���E)�X��y/~�n���h�p(�G��- E�u�]�]*'�h惒��7��$*�#^�:��ئ�5�*�:�ǃoQF�
Binary file
@@ -1 +0,0 @@
1
- import{a as e}from"./runtime-chunk-Z5OH244S.js";import{c as t}from"./runtime-chunk-TZCHGFVF.js";import{Ha as r,r as i}from"./runtime-chunk-OW6T4XFV.js";var n=new Map;function s(e,t){n.set(e,t)}var o=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+o.version}static addUnaryOp(e){return o.max_unop_len=Math.max(e.length,o.max_unop_len),o.unary_ops[e]=1,o}static addBinaryOp(e,t,r){return o.max_binop_len=Math.max(e.length,o.max_binop_len),o.binary_ops[e]=t,r?o.right_associative.add(e):o.right_associative.delete(e),o}static addIdentifierChar(e){return o.additional_identifier_chars.add(e),o}static addLiteral(e,t){return o.literals[e]=t,o}static removeUnaryOp(e){return delete o.unary_ops[e],e.length===o.max_unop_len&&(o.max_unop_len=o.getMaxKeyLen(o.unary_ops)),o}static removeAllUnaryOps(){return o.unary_ops={},o.max_unop_len=0,o}static removeIdentifierChar(e){return o.additional_identifier_chars.delete(e),o}static removeBinaryOp(e){return delete o.binary_ops[e],e.length===o.max_binop_len&&(o.max_binop_len=o.getMaxKeyLen(o.binary_ops)),o.right_associative.delete(e),o}static removeAllBinaryOps(){return o.binary_ops={},o.max_binop_len=0,o}static removeLiteral(e){return delete o.literals[e],o}static removeAllLiterals(){return o.literals={},o}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new o(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return o.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!o.binary_ops[String.fromCharCode(e)]||o.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return o.isIdentifierStart(e)||o.isDecimalDigit(e)}throwError(e){let t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(o.hooks[e]){let r={context:this,node:t};return o.hooks.run(e,r),r.node}return t}searchHook(e){if(o.hooks[e]){let t={context:this};return o.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===o.SPACE_CODE||e===o.TAB_CODE||e===o.LF_CODE||e===o.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:o.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,r,i=[];for(;this.index<this.expr.length;)if(t=this.code,t===o.SEMCOL_CODE||t===o.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())i.push(r);else if(this.index<this.expr.length){if(t===e)break;this.throwError('Unexpected "'+this.char+'"')}return i}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,o.max_binop_len),t=e.length;for(;t>0;){if(o.binary_ops.hasOwnProperty(e)&&(!o.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,i,n,s,a,h,l;if(s=this.gobbleToken(),!s||(t=this.gobbleBinaryOp(),!t))return s;for(n={value:t,prec:o.binaryPrecedence(t),right_a:o.right_associative.has(t)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+t),i=[s,n,a];t=this.gobbleBinaryOp();){if(r=o.binaryPrecedence(t),0===r){this.index-=t.length;break}n={value:t,prec:r,right_a:o.right_associative.has(t)},l=t;let h=e=>n.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&h(i[i.length-2]);)a=i.pop(),t=i.pop().value,s=i.pop(),e={type:o.BINARY_EXP,operator:t,left:s,right:a},i.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+l),i.push(n,e)}for(h=i.length-1,e=i[h];h>1;)e={type:o.BINARY_EXP,operator:i[h-1].value,left:i[h-2],right:e},h-=2;return e}gobbleToken(){let e,t,r,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(e=this.code,o.isDecimalDigit(e)||e===o.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===o.SQUOTE_CODE||e===o.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(e===o.OBRACK_CODE)i=this.gobbleArray();else{for(t=this.expr.substr(this.index,o.max_unop_len),r=t.length;r>0;){if(o.unary_ops.hasOwnProperty(t)&&(!o.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:o.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}o.isIdentifierStart(e)?(i=this.gobbleIdentifier(),o.literals.hasOwnProperty(i.name)?i={type:o.LITERAL,value:o.literals[i.name],raw:i.name}:i.name===o.this_str&&(i={type:o.THIS_EXP})):e===o.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===o.PERIOD_CODE||t===o.OBRACK_CODE||t===o.OPAREN_CODE||t===o.QUMARK_CODE;){let r;if(t===o.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==o.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===o.OBRACK_CODE?(e={type:o.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},this.gobbleSpaces(),t=this.code,t!==o.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===o.OPAREN_CODE?e={type:o.CALL_EXP,arguments:this.gobbleArguments(o.CPAREN_CODE),callee:e}:(t===o.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:o.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e,t,r="";for(;o.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(this.code===o.PERIOD_CODE)for(r+=this.expr.charAt(this.index++);o.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);if(e=this.char,"e"===e||"E"===e){for(r+=this.expr.charAt(this.index++),e=this.char,("+"===e||"-"===e)&&(r+=this.expr.charAt(this.index++));o.isDecimalDigit(this.code);)r+=this.expr.charAt(this.index++);o.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")")}return t=this.code,o.isIdentifierStart(t)?this.throwError("Variable names cannot start with a number ("+r+this.char+")"):(t===o.PERIOD_CODE||1===r.length&&r.charCodeAt(0)===o.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:o.LITERAL,value:parseFloat(r),raw:r}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){i=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++),t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||this.throwError('Unclosed quote after "'+e+'"'),{type:o.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(o.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,o.isIdentifierPart(e));)this.index++;return{type:o.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let n=this.code;if(n===e){r=!0,this.index++,e===o.CPAREN_CODE&&i&&i>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(n===o.COMMA_CODE){if(this.index++,i++,i!==t.length)if(e===o.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===o.CBRACK_CODE)for(let e=t.length;e<i;e++)t.push(null)}else if(t.length!==i&&0!==i)this.throwError("Expected comma");else{let e=this.gobbleExpression();(!e||e.type===o.COMPOUND)&&this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(o.CPAREN_CODE);if(this.code===o.CPAREN_CODE)return this.index++,1===e.length?e[0]:!!e.length&&{type:o.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:o.ARRAY_EXP,elements:this.gobbleArguments(o.CBRACK_CODE)}}},a=new class{add(e,t,r){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}};Object.assign(o,{hooks:a,plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(o),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),o.max_unop_len=o.getMaxKeyLen(o.unary_ops),o.max_binop_len=o.getMaxKeyLen(o.binary_ops);var h=e=>new o(e).parse();Object.getOwnPropertyNames(o).forEach(e=>{void 0===h[e]&&"prototype"!==e&&(h[e]=o[e])}),h.Jsep=o;var l={name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let n=this.gobbleExpression();if(n||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:i,alternate:n},r.operator&&e.binary_ops[r.operator]<=.9){let i=r;for(;i.right.operator&&e.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=r}}else this.throwError("Expected :")}})}};h.plugins.register(l);var c=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],d=["0","1","2","3","4","5","6","7","8","9","."],p=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function u(e){return"string"==typeof e&&!isNaN(e)&&!isNaN(parseFloat(e))}function f(e,t,i="number"){let n,s,o="";for(let n=0;n<e.length;n++){let s=e[n];if("objType"in s&&"api"===s.objType){let e=JSON.parse(s.id),r=e[0],i=t.getUserAPI(r);if(void 0!==i&&"function"==typeof i.retrieveValue){let t=i.retrieveValue(e.slice(1));void 0!==t&&(o+=t)}continue}if("objType"in s&&"webhook"===s.objType){let e=JSON.parse(s.id),[r,i]=e,n=t.getUserWebhook(r);if(void 0!==n){let e=n.getParameterValue(i);void 0!==e&&(o+=e)}continue}if("objType"in s&&"aiAssistant"===s.objType){let e=t.openAIRealtime;if("objId"in s&&void 0!==s.objId){let r;if(t.scene.data.objects.traverse((e,t)=>{let i=t.events?.find(e=>e.id===s.objId);i&&(r=i)}),void 0!==r&&"AIAssistantListener"===r.data.type){let t=e?.computeAnalysisForListenerEvent(r.data);if(void 0!==t){o+=t;continue}}}o+=e?.voice??0;continue}if("id"in s){let a=e[n-1];if(n>0&&"id"in a)return void console.error("Two variables in a row",e);let h=t.getVariable(s.id),l=r.getDisplayedValue(h);"number"===i&&r.isTextValue(h)&&Array.isArray(h.textValue)&&1===h.textValue.length?l=parseFloat(l).toString():"boolean"===i&&r.isBoolean(h)?l=h?"true":"false":"boolean"===i&&r.isTextValue(h)&&!Array.isArray(h.textValue)&&(l='"'+l+'"'),o+=l;continue}"string"!==i?"and"!==s.name?"or"!==s.name?"True"!==s.name?"False"!==s.name?"boolean"!==i||u(s.name)||d.includes(s.name)||c.includes(s.name)||p.includes(s.name.replace(/\($/g,""))?o+=s.name:o+='"'+s.name+'"':o+="false":o+="true":o+="||":o+="&&":('"'!==s.name&&("+"!==s.name||s.escaped)&&(o+=s.name),"+"===s.name&&!s.escaped&&"\\"===o[o.length-1]&&(o=o.slice(0,-1)+s.name))}if("string"===i)return o;if(0===e.length){if("number"===i)return 0;if("boolean"===i)return!1}try{n=h(o)}catch(e){return void console.error(o,e)}try{s=b(n)}catch(e){console.error(o,n,e)}return s}function b(e){switch(e.type){case"BinaryExpression":switch(e.operator){case"==":return Number(b(e.left)===b(e.right));case"!=":return Number(b(e.left)!==b(e.right));case">":return Number(b(e.left)>b(e.right));case">=":return Number(b(e.left)>=b(e.right));case"<":return Number(b(e.left)<b(e.right));case"<=":return Number(b(e.left)<=b(e.right));case"+":return b(e.left)+b(e.right);case"-":return b(e.left)-b(e.right);case"*":return b(e.left)*b(e.right);case"/":return b(e.left)/b(e.right);case"%":return b(e.left)%b(e.right);case"&&":return b(e.left)&&b(e.right);case"||":return b(e.left)||b(e.right);case"^":return Math.pow(b(e.left),b(e.right));default:throw new Error("Unknown operator: "+e.operator)}case"UnaryExpression":switch(e.operator){case"-":return-b(e.argument);case"!":return Number(!b(e.argument));default:throw new Error("Unknown operator: "+e.operator)}case"Identifier":throw new Error("Unknown identifier: "+e.name);case"Literal":return e.value;case"CallExpression":if("Identifier"===e.callee.type){if("random"===e.callee.name){let t=0,r=1;if(e.arguments.length>=1)try{t=b(e.arguments[0])}catch(e){console.warn(e)}if(e.arguments.length>=2)try{r=b(e.arguments[1])}catch(e){console.warn(e)}return t=Math.min(r,t),r=Math.max(r,t),t+Math.random()*(r-t)}return Math[e.callee.name].apply(null,e.arguments.map(b))}throw new Error("Unknown node");default:throw new Error("Unknown node type: "+e.type)}}h.addBinaryOp("^",11,!0);var g={mousehover:!0,scroll:!0,dragdrop:!0,tracking:!0,resize:!0,conditional:!0,variables:!0,"api-services":!0,"ai-assistant":!0,textinputs:!0,audio:!0,video:!0,"create-destroy":!0,"scene-transition":!0,timeline:!0,transitions:!0,"misc-actions":!0},E=Object.keys(g),x={MouseHover:"mousehover",Scroll:"scroll",DragDrop:"dragdrop",Follow:"tracking",LookAt:"tracking",Resize:"resize",Conditional:"conditional",VariableChange:"variables",API:"api-services",WEBHOOK:"api-services",AIAssistantListener:"ai-assistant",AIAssistantTrigger:"ai-assistant"},y={Audio:"audio",Video:"video",Particles:"particles",Link:"misc-actions",Reset:"misc-actions",SwitchCamera:"misc-actions",ClearLocalStorage:"misc-actions",Create:"create-destroy",Destroy:"create-destroy",Transition:"transitions",Animation:"transitions",TimelineAnimation:"timeline",SceneTransition:"scene-transition",SetVariable:"variables",DynamicVariablePlay:"variables",UserAPI:"api-services"};function m(e){return"object"==typeof e&&null!==e}var _=class extends Error{};function A(e,t){void 0!==t&&t in g&&e.add(t)}function C(e,t){let r=new Set,i=e=>{if(void 0!==e){if(!Array.isArray(e))throw new _;for(let t of e){if(!m(t))throw new _;n(t.data)}}},n=e=>{if(!m(e)||"string"!=typeof e.type)throw new _;A(r,y[e.type]),"Conditional"===e.type&&(i(e.ifActions),i(e.elseActions))},s=e=>{if(!m(e)||"string"!=typeof e.type)throw new _;if(!0!==e.disabled){if(t?.(e.type),A(r,x[e.type]),i(e.actions),i(e.inActions),i(e.outActions),i(e.successActions),i(e.errorActions),void 0!==e.dragDropActions){if(!m(e.dragDropActions))throw new _;for(let t of Object.values(e.dragDropActions))i(t)}if(void 0!==e.gameActions){if(!m(e.gameActions))throw new _;for(let t of Object.values(e.gameActions))i(t)}if(void 0!==e.breakpoints){if(!Array.isArray(e.breakpoints))throw new _;for(let t of e.breakpoints){if(!m(t)||!m(t.data))throw new _;i(t.data.actions)}}}},o=e=>{if(!m(e))throw new _;(e=>{let t=e.events;if(void 0!==t)if(Array.isArray(t))for(let e of t){if(!m(e))throw new _;s(e.data)}else{if(!m(t))throw new _;for(let e of Object.values(t))s(e)}})(e),"Mesh"===e.type&&m(e.geometry)&&"InputGeometry"===e.geometry.type&&r.add("textinputs"),"Page"===e.type&&m(e.uiScene)&&a(e.uiScene.objects)},a=e=>{if(!m(e)||"function"!=typeof e.traverse)throw new _;e.traverse((e,t)=>{o(t)})},h=e=>{if(!m(e))throw new _;void 0!==e.data&&o(e.data);let t=e.children;if(void 0!==t){if(!Array.isArray(t))throw new _;for(let e of t)h(e)}};try{a(e.scene.objects);let t=e.shared;if(void 0!==t){if(!m(t))throw new _;let e=t.variables;if(void 0!==e){if(!Array.isArray(e))throw new _;for(let t of e){if(!m(t)||!m(t.data))throw new _;"dynamicVariableType"in t.data&&r.add("variables")}}let i=t.userAPIs;if(void 0!==i){if(!m(i))throw new _;for(let e of Object.values(i)){let t=m(e)?e.integration:void 0;m(t)&&"VoiceAssistant"===t.type?r.add("ai-assistant"):r.add("api-services")}}let n=t.userWebhooks;if(void 0!==n){if(!m(n))throw new _;Object.keys(n).length>0&&r.add("api-services")}let s=t.lib;if(void 0!==s){if(!m(s))throw new _;let e=s.components;if(void 0!==e){if(!m(e))throw new _;for(let t of Object.values(e)){if(!m(t))throw new _;void 0!==t.asset&&h(t.asset)}}}}}catch{return new Set(E)}return r}function O(e,t){if(void 0===t)return!0;if(0===t.expression.length)return!1;let r=f(t.expression,e,"boolean");return t.negate?!r:!!r}function w(r,s,o,a,h,l){let c={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],TimelineAnimation:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[],ClearLocalStorage:[],UserAPI:[]},d=s=>({id:p,data:u})=>{try{if("Conditional"===u.type)return void(i[r.type].includes("Conditional")&&(u.ifActions.forEach(d({expression:u.condition,negate:!1})),u.elseActions.forEach(d({expression:u.condition,negate:!0}))));if(!i[r.type].includes(u.type))return;let e=function(e){return n.get(e)}(u.type);if(void 0===e)return void t(y[u.type]??"misc-actions",`a "${u.type}" action`);let f=e({id:p,data:u,object:l,page:o,shared:a,eventManager:h,eventType:r.type,actionCondition:s});null!=f&&u.type in c&&c[u.type].push(f)}catch(t){e&&console.error(t)}};return s.forEach(d()),c}function v(e){Object.values(e).forEach(e=>{e.forEach(e=>{"function"==typeof e.dispose&&e.dispose()})})}export{f as a,s as b,x as c,C as d,O as e,w as f,v as g};
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- function n(n){return!0===n?.isParticleSystem}function t(n){return!0===n?.isHairSystem}function e(n){return!0===n?.isShapeBlendEntity}function i(n){return!0===n?.isPathObject}function r(n){return!0===n?.isObject2D}function s(n){return!0===n?.isUIObject}function u(n){return!0===n?.isCloner}function c(n){return!0===n?.isClone}function a(n){return!0===n?.isComponentObject}export{n as a,t as b,e as c,i as d,r as e,s as f,u as g,c as h,a as i};
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{a as t}from"./runtime-chunk-P3254QGK.js";import{b as e}from"./runtime-chunk-E6JCDSXC.js";import{$ as r,C as i}from"./runtime-chunk-CTHMLYOZ.js";import{f as s,t as n}from"./runtime-chunk-2Y73BLCY.js";import{c as a}from"./runtime-chunk-QZ35BPGB.js";import{c as o}from"./runtime-chunk-4KZXQGUQ.js";import{M as l}from"./runtime-chunk-OW6T4XFV.js";import{Cc as h,Ec as d,Fc as c,Oc as u,Pc as m,Rc as p,Wc as f,qd as y}from"./runtime-chunk-VGN7YHB7.js";import{a as b,b as x}from"./runtime-chunk-ML3Z74BL.js";var g=x(b((t,e)=>{var r,i;r=t,i=function(){return t.importState=function(e){var r=new t;return r.importState(e),r},t;function t(){return function(t){var e=0,r=0,i=0,s=1;0==t.length&&(t=[+new Date]);var n=function(){var t=4022871197,e=function(e){e=e.toString();for(var r=0;r<e.length;r++){var i=.02519603282416938*(t+=e.charCodeAt(r));i-=t=i>>>0,t=(i*=t)>>>0,t+=4294967296*(i-=t)}return 2.3283064365386963e-10*(t>>>0)};return e.version="Mash 0.9",e}();e=n(" "),r=n(" "),i=n(" ");for(var a=0;a<t.length;a++)(e-=n(t[a]))<0&&(e+=1),(r-=n(t[a]))<0&&(r+=1),(i-=n(t[a]))<0&&(i+=1);n=null;var o=function(){var t=2091639*e+2.3283064365386963e-10*s;return e=r,r=i,i=t-(s=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,r,i,s]},o.importState=function(t){e=+t[0]||0,r=+t[1]||0,i=+t[2]||0,s=+t[3]||0},o}(Array.prototype.slice.call(arguments))}},"object"==typeof t?e.exports=i():"function"==typeof define&&define.amd?define(i):r.Alea=i()})()),M=.5*(Math.sqrt(3)-1),v=(3-Math.sqrt(3))/6,w=1/3,j=1/6,S=(Math.sqrt(5),Math.sqrt(5),t=>0|Math.floor(t)),A=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),F=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function _(t){let e=new Uint8Array(512);for(let t=0;t<256;t++)e[t]=t;for(let r=0;r<255;r++){let i=r+~~(t()*(256-r)),s=e[r];e[r]=e[i],e[i]=s}for(let t=256;t<512;t++)e[t]=e[t-256];return e}var z=new f,C=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 r=0;r<t.count;r+=3){let i=1;z.a.fromBufferAttribute(t,r),z.b.fromBufferAttribute(t,r+1),z.c.fromBufferAttribute(t,r+2),i*=z.getArea(),e[r/3]=i}this.distribution=new Float32Array(t.count/3);let r=0;for(let t=0;t<e.length;t++)r+=e[t],this.distribution[t]=r;return this}setRandomGenerator(t){return this.randomFunction=t,this}sample(t,e){if(this.distribution){let r=this.distribution[this.distribution.length-1],i=this.binarySearch(this.randomFunction()*r);return this.sampleFace(i,t,e)}}binarySearch(t){if(!this.distribution)return 0;let e=this.distribution,r=0,i=e.length-1,s=-1;for(;r<=i;){let n=Math.ceil((r+i)/2);if(0===n||e[n-1]<=t&&e[n]>t){s=n;break}t<e[n]?i=n-1:r=n+1}return s}sampleFace(t,e,r){let i=this.randomFunction(),s=this.randomFunction();return i+s>1&&(i=1-i,s=1-s),z.a.fromBufferAttribute(this.positionAttribute,3*t),z.b.fromBufferAttribute(this.positionAttribute,3*t+1),z.c.fromBufferAttribute(this.positionAttribute,3*t+2),e.set(0,0,0).addScaledVector(z.a,i).addScaledVector(z.b,s).addScaledVector(z.c,1-(i+s)),z.getNormal(r),this}},W={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)=>(r,i)=>e&&0!==r&&0!==t?t*i/100:0,P=(t,e)=>{let r=Math.abs(e),i=-1*r;return(t- -1)*(r-i)/2+i},T=new c,V=new c,k=new c,R=new c;function I(t,e){let r=k.fromArray(t),i=R.fromArray(e);V.copy(i).sub(r);let s=V.length();return V.normalize().multiplyScalar(.5*s),T.copy(r).add(V).toArray()}var U,B,D,q,E=new f,G=new c,L=new c,$=new c,Q=class extends y{},Y=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 r=this.parent;if(t&&null!==r&&r.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,r,i,s,n){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}get visible(){return 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)),H=class{constructor(){this.perlin=new Array(4096)}noise(t,e=0,r=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),r<0&&(r=-r);let i,s,n,a,o,l=Math.floor(t),h=Math.floor(e),d=Math.floor(r),c=t-l,u=e-h,m=r-d,p=0,f=.5;for(let t=0;t<4;t++){let t=l+(h<<4)+(d<<8);i=Z(c),s=Z(u),n=this.perlin[4095&t],n+=i*(this.perlin[t+1&4095]-n),a=this.perlin[t+16&4095],a+=i*(this.perlin[t+16+1&4095]-a),n+=s*(a-n),t+=256,a=this.perlin[4095&t],a+=i*(this.perlin[t+1&4095]-a),o=this.perlin[t+16&4095],o+=i*(this.perlin[t+16+1&4095]-o),a+=s*(o-a),n+=Z(m)*(a-n),p+=n*f,f*=.5,l<<=1,c*=2,h<<=1,u*=2,d<<=1,m*=2,c>=1&&(l++,c--),u>=1&&(h++,u--),m>=1&&(d++,m--)}return p}noiseSeed(t){let e=(()=>{let t,e;return{setSeed(r){e=t=(r??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()}},X=1e-4,K=new c,J=new c;i.then(t=>{B=[(U=t).get_face_center,U.get_edge_midpoint,U.get_vertex_position],D=[U.get_face_normal,U.get_edge_normal,U.get_vertex_normal],q=[U.face_count,U.edge_count,U.vertex_count]}),new u;var tt=new u,et=new u,rt=new u,it=new u,st=new u,nt=new u,at=new u,ot=new c,lt=new c,ht=new c,dt=new c,ct=new c,ut=new c,mt=new c,pt=new c,ft=new c,yt=new c,bt=new c,xt=new m,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 H,"perlin"===t.noiseType?(this.perlin.noiseSeed(t.seed),this.noise=e?(t,e,r)=>this.perlin.noise(t,e,r):t=>this.perlin.noise(t)):this.noise=e?function(t=Math.random){let e=_(t),r=new Float64Array(e).map(t=>F[t%12*3]),i=new Float64Array(e).map(t=>F[t%12*3+1]),s=new Float64Array(e).map(t=>F[t%12*3+2]);return function(t,n,a){let o,l,h,d,c,u,m,p,f,y,b=(t+n+a)*w,x=S(t+b),g=S(n+b),M=S(a+b),v=(x+g+M)*j,A=t-(x-v),F=n-(g-v),_=a-(M-v);A>=F?F>=_?(c=1,u=0,m=0,p=1,f=1,y=0):A>=_?(c=1,u=0,m=0,p=1,f=0,y=1):(c=0,u=0,m=1,p=1,f=0,y=1):F<_?(c=0,u=0,m=1,p=0,f=1,y=1):A<_?(c=0,u=1,m=0,p=0,f=1,y=1):(c=0,u=1,m=0,p=1,f=1,y=0);let z=A-c+j,C=F-u+j,W=_-m+j,O=A-p+2*j,N=F-f+2*j,P=_-y+2*j,T=A-1+.5,V=F-1+.5,k=_-1+.5,R=255&x,I=255&g,U=255&M,B=.6-A*A-F*F-_*_;if(B<0)o=0;else{let t=R+e[I+e[U]];B*=B,o=B*B*(r[t]*A+i[t]*F+s[t]*_)}let D=.6-z*z-C*C-W*W;if(D<0)l=0;else{let t=R+c+e[I+u+e[U+m]];D*=D,l=D*D*(r[t]*z+i[t]*C+s[t]*W)}let q=.6-O*O-N*N-P*P;if(q<0)h=0;else{let t=R+p+e[I+f+e[U+y]];q*=q,h=q*q*(r[t]*O+i[t]*N+s[t]*P)}let E=.6-T*T-V*V-k*k;if(E<0)d=0;else{let t=R+1+e[I+1+e[U+1]];E*=E,d=E*E*(r[t]*T+i[t]*V+s[t]*k)}return 32*(o+l+h+d)}}((0,g.default)(t.seed)):function(t=Math.random){let e=_(t),r=new Float64Array(e).map(t=>A[t%12*2]),i=new Float64Array(e).map(t=>A[t%12*2+1]);return function(t,s){let n,a,o=0,l=0,h=0,d=(t+s)*M,c=S(t+d),u=S(s+d),m=(c+u)*v,p=t-(c-m),f=s-(u-m);p>f?(n=1,a=0):(n=0,a=1);let y=p-n+v,b=f-a+v,x=p-1+2*v,g=f-1+2*v,w=255&c,j=255&u,A=.5-p*p-f*f;if(A>=0){let t=w+e[j];A*=A,o=A*A*(r[t]*p+i[t]*f)}let F=.5-y*y-b*b;if(F>=0){let t=w+n+e[j+a];F*=F,l=F*F*(r[t]*y+i[t]*b)}let _=.5-x*x-g*g;if(_>=0){let t=w+1+e[j+1];_*=_,h=_*_*(r[t]*x+i[t]*g)}return 70*(o+l+h)}}((0,g.default)(t.seed??""))}},jt=class extends(s(p)){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()}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()}get instancingActive(){return void 0!==this.instancedMesh}_instancingEligible(){if(!0!==this.parameters.instanced)return!1;let t=this.object;return!(t.entityChildrenCount()>0||!0!==t.isMesh||a(t)||!0===t.isDecalObject)}_syncInstancedMesh(){if(!this._instancingEligible())return void this._disposeInstancedMesh();let t=this.instancedMesh;if(void 0!==t&&t.capacity<this.children.length&&(this._disposeInstancedMesh(),t=void 0),void 0===t){let e=Math.max(8,Math.ceil(1.5*this.children.length));t=this.instancedMesh=new Y(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(){let t=this.instancedMesh;if(void 0===t)return;let e=0;for(let r of this.children)!1!==r.playModeVisible&&(et.multiplyMatrices(r.hiddenMatrix,r.matrix).multiply(r.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 r,i=t.radial,s=i.start*h.DEG2RAD,n=s-i.end*h.DEG2RAD,a=vt(i.rotation,e),o=new m(a[0],a[1],a[2]);switch(i.axis){case"z":r=new c(0,0,1);break;case"y":r=new c(0,1,0);break;default:r=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,p=vt(i.scale,e),f=vt(i.position,e),y=vt(d.scale,e),b=vt(d.position,e),x=vt(d.rotation,e),g=n/t.count,M=N(d.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let n=t*(d.freqScale/10)+d.movement,a=null===u?0:u.noise(n,n,n),l=t+1;e.scale.x=p[0]+M(l,P(a,y[0]))||X,e.scale.y=p[1]+M(l,P(a,y[1]))||X,e.scale.z=p[2]+M(l,P(a,y[2]))||X;let h=g*t-s;switch(i.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)}mt.copy(r).applyQuaternion(gt.setFromEuler(xt)).multiplyScalar(i.radius),e.position.set(mt.x+(f[0]+M(l,P(a,b[0]))),mt.y+(f[1]+M(l,P(a,b[1]))),mt.z+(f[2]+M(l,P(a,b[2]))));let c=M(l,P(a,x[0])),m=M(l,P(a,x[1])),v=M(l,P(a,x[2]));!0===i.alignment?e.rotation.set(xt.x+(o.x+c),xt.y+(o.y+m),xt.z+(o.z+v)):e.rotation.set(o.x+c,o.y+m,o.z+v)}}_updateLinear(t,e){if("linear"!==t.type)throw new Error;let r=t.linear,i=vt(r.rotation,e),s=vt(r.scale,e),n=vt(r.position,e),a=new m(i[0]??0,i[1]??0,i[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,p=N(o.strength,this.parameters.randomness);for(let[t,e]of this.children.entries()){let r=t*(o.freqScale/10)+o.movement,i=null===u?0:u.noise(r,r,r),l=t+1,m=p(l,P(i,h[0])),f=p(l,P(i,h[1])),y=p(l,P(i,h[2]));e.scale.x=1+(s[0]-1)*t+p(l,P(i,d[0]))||X,e.scale.y=1+(s[1]-1)*t+p(l,P(i,d[1]))||X,e.scale.z=1+(s[2]-1)*t+p(l,P(i,d[2]))||X,e.rotation.set(a.x*t+m,a.y*t+f,a.z*t+y),e.position.x=n[0]*t+p(l,P(i,c[0])),e.position.y=n[1]*t+p(l,P(i,c[1])),e.position.z=n[2]*t+p(l,P(i,c[2]))}}_updateGrid(t,e){let r=0,i=t.grid,s=t.randomnessObject??l.defaultData([1,1,1]).randomnessObject,n=vt(s.scale,e),a=vt(s.rotation,e),o=vt(s.position,e),h=!0===this.parameters.randomness&&0!==s.strength?this.getRandom(s,!0):null,d=N(s.strength,this.parameters.randomness),u=vt(i.count,e),m=vt(i.size,e);if(!0===i.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(m[0]*(u[0]-t.x)*.5,m[1]*(u[1]-t.y)*.5,m[2]*(u[2]-t.z)*.5);for(let t=0;t<u[0];t++)for(let i=0;i<u[1];i++)for(let l=0;l<u[2];l++){let c=this.children[r++];if(!c)continue;let u=null===h?0:h.noise((t+1)*(s.freqScale/10)+s.movement,(i+1)*(s.freqScale/10)+s.movement,(l+1)*(s.freqScale/10)+s.movement);c.scale.x=1+d(r,P(u,n[0]))||X,c.scale.y=1+d(r,P(u,n[1]))||X,c.scale.z=1+d(r,P(u,n[2]))||X;let p=d(r,P(u,a[0])),f=d(r,P(u,a[1])),y=d(r,P(u,a[2]));c.rotation.set(p,f,y),c.position.x=m[0]*t-e.x+d(r,P(u,o[0])),c.position.y=m[1]*i-e.y+d(r,P(u,o[1])),c.position.z=m[2]*l-e.z+d(r,P(u,o[2]))}}else for(let t=0;t<u[0];t++)for(let e=0;e<u[1];e++)for(let i=0;i<u[2];i++){let l=this.children[r++];if(!l)continue;let c=null===h?0:h.noise((t+1)*(s.freqScale/10)+s.movement,(e+1)*(s.freqScale/10)+s.movement,(i+1)*(s.freqScale/10)+s.movement);l.scale.x=1+d(r,P(c,n[0]))||X,l.scale.y=1+d(r,P(c,n[1]))||X,l.scale.z=1+d(r,P(c,n[2]))||X;let u=d(r,P(c,a[0])),p=d(r,P(c,a[1])),f=d(r,P(c,a[2]));l.rotation.set(u,p,f),l.position.x=m[0]*t+d(r,P(c,o[0])),l.position.y=-m[1]*e+d(r,P(c,o[1])),l.position.z=-m[2]*i+d(r,P(c,o[2]))}}_updateToObject(r,i){if("toObject"!==r.type)throw new Error;let{toObject:s}=r,n=vt(s.rotation,i),a=vt(s.position,i),o=vt(s.scale,i),h=new m(n[0],n[1],n[2]),d=r.randomnessObject??l.defaultData([1,1,1]).randomnessObject,c=vt(d.rotation,i),u=vt(d.position,i),p=vt(d.scale,i),f=!0===this.parameters.randomness&&0!==d.strength?this.getRandom(d):null,y=N(d.strength,this.parameters.randomness);if(!s.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*s.count/100);this._updateCount(i,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"===s.spreadType,M=null;x&&(M=this.getSurfaceSampler(),M.setRandomGenerator((0,g.default)(this.object.uuid+s.seed)));let v=W[s.axis],w=this.children;ot.fromArray(v),rt.copy(this.object.hiddenMatrix).invert();let j=this.objectForSample instanceof e;j&&it.copy(this.objectForSample.matrixWorld).invert(),"normal"!==s.align&&this.object.getWorldDirection(ut),yt.set(ot.y,ot.z,ot.x).normalize(),bt.copy(yt).cross(ot).normalize(),nt.makeBasis(yt,ot,bt).invert();for(let[t,e]of w.entries()){let r=t*(d.freqScale/10)+d.movement,i=null===f?0:f.noise(r,r,r),n=t+1,l=y(n,P(i,c[0])),m=y(n,P(i,c[1])),g=y(n,P(i,c[2]));x?M.sample(ht,dt):(b.length&&(ht.fromArray(b[t].pos),dt.fromArray(b[t].norm)),j&&ht.applyMatrix4(it)),ht.applyMatrix4(rt),e.position.copy(ht);let v="normal"===s.align?dt:ut,w=lt.fromArray(a);lt.x+=y(n,P(i,u[0])),lt.y+=y(n,P(i,u[1])),lt.z+=y(n,P(i,u[2]));let S=Math.acos(v.dot(ot)),A=ct.crossVectors(ot,v).normalize(),F=tt.makeRotationAxis(A,S);pt.copy(v).cross(this.object.up).normalize(),ft.copy(pt).cross(v).normalize(),st.makeBasis(pt,v,ft),at.multiplyMatrices(st,nt),xt.setFromRotationMatrix(at),w.applyMatrix4(F),e.position.add(w),e.rotation.set(xt.x+h.x+l,xt.y+h.y+m,xt.z+h.z+g),e.scale.set(1+o[0]+y(n,P(i,p[0]))||X,1+o[1]+y(n,P(i,p[1]))||X,1+o[2]+y(n,P(i,p[2]))||X),e.scale.multiply(this.object.scale),e.hiddenMatrix=this.object.hiddenMatrix}}getSurfaceSampler(){let t=this.objectForSample,e=t.geometry,r=e.getAttribute("position"),i=e.index,s=this.surfaceSamplerCache;if(null!==s&&s.geometry===e&&s.position===r&&s.positionVersion===Mt(r)&&s.index===i&&s.indexVersion===(null===i?-1:i.version))return s.sampler;let n=new C(t).build();return this.surfaceSamplerCache={geometry:e,position:r,positionVersion:Mt(r),index:i,indexVersion:null===i?-1:i.version,sampler:n},n}invalidateSurfaceCaches(){this.surfaceSamplerCache=null,this.surfacePointsCache=null}getSubdivData(){if(!this.objectForSample)return[];let t=this.parameters.toObject.spreadType;if("random"===t)return[];let r=this.objectForSample instanceof e,i=this.objectForSample.geometry;if(!r&&i){let e=this.surfacePointsCache,r=i.getAttribute("position");if(null!==e&&e.spreadType===t&&e.geometry===i&&e.position===r&&e.positionVersion===Mt(r)&&e.index===i.index&&e.indexVersion===(null===i.index?-1:i.index.version))return e.points}let s=new Map,n=(t,e)=>{let r=Math.round(1e4*t[0])+"_"+Math.round(1e4*t[1])+"_"+Math.round(1e4*t[2]),i=s.get(r);i?(i.pos[0]+=t[0],i.pos[1]+=t[1],i.pos[2]+=t[2],i.norm[0]+=e[0],i.norm[1]+=e[1],i.norm[2]+=e[2],i.count+=1):s.set(r,{pos:[...t],norm:[...e],count:1})};if(r){let e=this.objectForSample,r=O[t],i=q[r],s=B[r],a=D[r],o=i(e.subdivPointerNew);for(let t=0;t<=o-1;t++){let r=s(e.subdivPointerNew,t),i=a(e.subdivPointerNew,t);K.fromArray(r).applyMatrix4(e.matrixWorld),J.fromArray(i),n(K.toArray(),J.toArray())}}else(i.index?function(t){let e=[],r=Math.floor(t.index.count/3);for(let i=0;i<r;i++)if(G.fromArray(t.index.array,3*i),E.setFromAttributeAndIndices(t.attributes.position,G.x,G.y,G.z),E.getNormal(L),E.getMidpoint($),!(isNaN($.x)||isNaN($.y)||isNaN($.z))){let{a:t,b:r,c:i}=E,s=t.toArray(),n=r.toArray(),a=i.toArray(),o=t.distanceTo(r),l=r.distanceTo(i),h=i.distanceTo(t),d=I(s,n),c=I(n,a),u=I(a,s),m=[o,l,h],p=Math.max(...m),f=m.filter(t=>Math.round(t)===Math.round(p)).length>1,y=[],b=E.getMidpoint($).toArray();p===o&&!f&&(y=[c,u,u],b=d),p===l&&!f&&(y=[d,u,u],b=c),p===h&&!f&&(y=[d,c,c],b=u),f&&(y=[d,c,u]),e.push({vertices:[s,n,a],faceCenters:y,midpoint:b,norm:E.getNormal(L).toArray()})}return e}(i):function(t){let e=[],{position:r}=t.attributes;for(let t=0;t<r.count;t++){E.setFromAttributeAndIndices(r,3*t,3*t+1,3*t+2),E.getNormal(L),E.getMidpoint($);let i=E.a.toArray(),s=E.b.toArray(),n=E.c.toArray();e.push({vertices:[i,s,n],faceCenters:[I(i,s),I(s,n),I(n,i)],midpoint:$.toArray(),norm:L.toArray()})}return e}(i)).forEach((e,r)=>{"polygon_center"===t&&n(e.midpoint,e.norm),"vertex"===t&&(n(e.vertices[0],e.norm),n(e.vertices[1],e.norm),n(e.vertices[2],e.norm)),"edge"===t&&(n(e.faceCenters[0],e.norm),n(e.faceCenters[1],e.norm),n(e.faceCenters[2],e.norm))});let a=Array.from(s.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(!r&&i){let e=i.getAttribute("position");this.surfacePointsCache={spreadType:t,geometry:i,position:e,positionVersion:Mt(e),index:i.index,indexVersion:null===i.index?-1:i.index.version,points:a}}return a}updateState(t,e){if(this.parameters=o(t),"toObject"!==this.parameters.type)this.invalidateSurfaceCaches(),(null===this.parent||this.parent!==this.object)&&(this.removeFromParent(),this.object.parent?.add(this),this.matrix=this.object.matrix,this.hiddenMatrix=this.object.hiddenMatrix,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1);else if(null===this.parent||this.parent.uuid!==this.parameters.toObject.object){this.removeFromParent(),this.invalidateSurfaceCaches();let t=e.scene.find(this.parameters.toObject.object);this.objectForSample=t instanceof n?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};
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{e,g as t,j as a}from"./runtime-chunk-K4FLB6Y7.js";import{a as r}from"./runtime-chunk-2SYZJBYJ.js";import{a as n,b as o}from"./runtime-chunk-A2LYIKKC.js";import{c as i,e as s,f as l}from"./runtime-chunk-WSJURWOC.js";import{a as u}from"./runtime-chunk-RQ3ZQR4P.js";import{b as d}from"./runtime-chunk-E6JCDSXC.js";import{U as p,Y as c,Z as h,da as f,ea as g,h as m}from"./runtime-chunk-CTHMLYOZ.js";import{t as y}from"./runtime-chunk-2Y73BLCY.js";import{d as b,e as v}from"./runtime-chunk-QZ35BPGB.js";import{d as w,f as j}from"./runtime-chunk-4KZXQGUQ.js";import{A as S,B as D,I as E,N as B,O as V,P as x,Q as O,R as C,S as A,da as k,ma as M,pa as R,va as N,z as P}from"./runtime-chunk-OW6T4XFV.js";import{Cc as G,Dc as q,Ec as z,Fc as I,Oc as F,Pc as $,Tc as L}from"./runtime-chunk-VGN7YHB7.js";var{degToRad:T,radToDeg:U}=G,_=new I,W=new I,Y=new z;function Q(e,t,a,r,n,o){let i=void 0!==a[e]?a[e]:void 0,s=r[e];if(null==s)return;let l=null!=i?"string"==typeof i?Number(n.getVariable(i)??0):i:t[e],u="string"==typeof s?Number(n.getVariable(s)??0):s;return l!==u?{update:a=>{let r=G.lerp(l,u,a);t[e]=o?Math.trunc(r):r},start:()=>{t[e]=l},end:()=>{t[e]=u}}:void 0}function Z(e,t,a,r,n,o){let i=a[e]?a[e]:void 0,s=r[e];if(!s)return;let l=t[e],u=[...i??l].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e),d=[...s].map(e=>"string"==typeof e?Number(n.getVariable(e)??0):e);return u.length!==d.length||w(u,d)?void 0:{update:a=>{u.forEach((r,n)=>{let i=G.lerp(r,d[n],a);t[e][n]=o?Math.trunc(i):i})},start:()=>{Object.assign(t[e],u)},end:()=>{Object.assign(t[e],d)}}}function J(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function K(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?J(new I,o,n):s.clone(),u=J(new I,i,n);return l.equals(u)?void 0:{update:e=>{s.lerpVectors(l,u,e)},start:()=>{s.copy(l)},end:()=>{s.copy(u)}}}function X(e,t,a){return t.forEach((t,r)=>{e.setComponent(r,"string"==typeof t?Number(a.getVariable(t)??0):t)}),e}function H(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=!(s instanceof q),u=s instanceof q?s:(new q).fromArray(s),d=o?X(new q,o,n):u.clone(),p=X(new q,i,n);return d.equals(p)?void 0:{update:a=>{u.lerpVectors(d,p,a),l&&(t[e]=u.toArray())},start:()=>{u.copy(d),l&&(t[e]=u.toArray())},end:()=>{u.copy(p),l&&(t[e]=u.toArray())}}}function ee(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=new m(s.r,s.g,s.b,s.a),u=o?"string"==typeof o?n.getColor(o).clone():new m(o.r,o.g,o.b,o.a):l.clone(),d="string"==typeof i?n.getColor(i).clone():new m(i.r,i.g,i.b,i.a);return u.equals(d)?void 0:{update:a=>{l.lerpColors(u,d,a);let r=G.lerp(u.a,d.a,a);l.a=r,t[e]={r:l.r,g:l.g,b:l.b,a:l.a}},start:()=>{l.copy(u)},end:()=>{l.copy(d)}}}function te(e,t,a,r,n){return"number"==typeof t[e]?Q(e,t,a??{},r,n):Array.isArray(t[e])?Z(e,t,a??{},r,n):void 0}function ae(e,t,a,r,n){let o=a[e],i=r[e];if("number"==typeof t[e])Math.abs(o-i)>1e-4&&(t[e]=G.lerp(o,i,n));else if(Array.isArray(t[e]))for(let a=0,r=o.length;a<r;a++)t[e][a]=G.lerp(o[a],i[a],n)}function re(e,t,a,r){let n=e.geometry.userData.parameters.extrusion;if(n)return M.forEach(e=>{ae(e,n,t,a,r)}),n}function ne(e,t,a,r){let n=e.updatedPathSnapping;if(n)return N.forEach(e=>{ae(e,n,t,a,r)}),n}function oe(e,t,a,r,n){let o=e.getValue(r);if(void 0!==o){if("colors"===r)return function(e,t,a,r="colors"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o.map(e=>e.toArray()),s=a[r];for(let e=0;e<o.length;++e){let t=[...i[e]],a=[...s[e]];D.isEqual(t,a)||n.push({update:r=>{o[e].fromArray(D.lerp(t,a,r))},start:()=>{o[e].fromArray(t)},end:()=>{o[e].fromArray(a)}})}return n.length?n:void 0}(e,t,a,r);if(Array.isArray(o))return"steps"===r?function(e,t,a,r="steps"){if(!e.hasValue(r)||!(r in a))return;let n=[],o=e.getValue(r),i=t?t[r]:o,s=a[r];return w(i,s)||n.push({update:t=>{let a=[...o];for(let e=0;e<o.length;++e){let r=i[e],n=s[e];a[e]=G.lerp(r,n,t)}e.setValue(r,a)},start:()=>{e.setValue(r,i)},end:()=>{e.setValue(r,s)}}),n.length?n:void 0}(e,t,a,r):void 0;if("number"==typeof o)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:e.getValue(r),i=a[r],s="string"==typeof o?Number(n.getVariable(o)??0):o,l="string"==typeof i?Number(n.getVariable(i)??0):i;return{update:t=>{e.setValue(r,G.lerp(s,l,t))},start:()=>{e.setValue(r,s)},end:()=>{e.setValue(r,l)}}}(e,t,a,r,n);if("boolean"!=typeof o){if(o instanceof q)return function(e,t,a,r){if(!e.hasValue(r)||!(r in a))return;let n=e.getValue(r),o=t?(new q).fromArray(t[r]):n.clone(),i=(new q).fromArray(a[r]);return o.equals(i)?void 0:{update:e=>{n.lerpVectors(o,i,e)},start:()=>{n.copy(o)},end:()=>{n.copy(i)}}}(e,t,a,r);if(o instanceof I)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=e.getValue(r),i=t?t[r]:void 0,s=a[r],l=i?J(new I,i,n):o.clone(),u=J(new I,s,n);return l.equals(u)?void 0:{update:e=>{o.lerpVectors(l,u,e)},start:()=>{o.copy(l)},end:()=>{o.copy(u)}}}(e,t,a,r,n);if(o instanceof m)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new L).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():new m(i.r,i.g,i.b,i.a);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if(o instanceof L)return function(e,t,a,r,n){if(!e.hasValue(r)||!(r in a))return;let o=t?t[r]:void 0,i=a[r],s=e.getValue(r),l=o?"string"==typeof o?n.color(o).clone():(new L).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.color(i).clone():(new L).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:t=>{e.getValue(r)!==d&&e.setValue(r,d),d.lerpColors(l,u,t)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}(e,t,a,r,n);if("isTexture"in o)return function(e,t,a,r="texture"){if(!e.hasValue(r)||!(r in a))return;let n=e.getNode("rotation"),o=t?.[r]?.rotation??0,i=a[r]?.rotation??0;if(n&&o!==i)return{update:e=>{n.value=G.lerp(o,i,e)*G.DEG2RAD},start:()=>{n.value=o*G.DEG2RAD},end:()=>{n.value=i*G.DEG2RAD}};let s=e.getNode("mat");if(!s)return;let l=t?t[r]:s,u=a[r],d=[...l.repeat],p=[...l.offset],c=[...u.repeat],h=[...u.offset],f=l.rotation??0,g=u.rotation??0;return P.isEqual(d,c)&&P.isEqual(p,h)&&f===g?void 0:{update:e=>{s.repeat=P.lerp(d,c,e),s.offset=P.lerp(p,h,e),s.rotation=G.lerp(f,g,e),s.updateMatrix()},start:()=>{s.repeat=[...d],s.offset=[...p],s.rotation=f,s.updateMatrix()},end:()=>{s.repeat=[...c],s.offset=[...h],s.rotation=g,s.updateMatrix()}}}(e,t,a,r)}}}function ie(e,t,a,r){let n=[],o=p(a,r)||!!t.layers&&p(t,r);n.push(function(e,t){return{update:()=>{e.transparent=t}}}(e,o)),function(e,t,a){let r=e.ensureRainbowNoiseCompiled;if("function"==typeof r)for(let n of[...e.layers]){if("rainbow"!==n.type)continue;let o=t.layers?.data(n.uuid),i=a.layers.data(n.uuid);(c(o?.noiseStrength)||c(i?.noiseStrength))&&r.call(e,n.uuid)}}(e,t,a);for(let o of e.layers){let e=t.layers?.data(o.uuid),i=a.layers.data(o.uuid);if(!i||"light"!==o.type&&(!(o.visible??1)||!(i.visible??1)))continue;let s=h[o.type]??[],l=o.getNames().filter(e=>!s.includes(e)&&!k.some(t=>e.includes(t)));for(let t of l)try{let a=oe(o,e,i,t,r);a&&(Array.isArray(a)?n.push(...a):n.push(a))}catch(e){console.error(`lerpMaterial: unexpected material layer for ${t}`,e)}}return n}function se(e,t,a,r,n,o){let i=oe(t,a,r,e,o);!i||(Array.isArray(i)?i.forEach(e=>e.update(n)):i.update(n))}new $;var le=new I,ue=new $;function de(e,t,a,r){let n=r.cloner?.parameters;if(n){ae("count",n,e,t,a),n.count=Math.trunc(n.count);for(let r of V)ae(r,n.radial,e.radial,t.radial,a);for(let r of x)ae(r,n.linear,e.linear,t.linear,a);for(let r of O)ae(r,n.grid,e.grid,t.grid,a);for(let r of C)ae(r,n.toObject,e.toObject,t.toObject,a);return n}}function pe(e,t,a,r){let n=r.cloner?.parameters;if(n){for(let r of A)ae(r,n.randomnessObject,e.randomnessObject,t.randomnessObject,a);return n}}function ce(r,n,o,p,c){let h=[];return r.data.visible&&h.push(...function(e,t,a,r,n){let o,i,u,d,p,c,h,f,g=[];if(v(e)?(o=H("position",e,t,a,n),o&&g.push(o),u=Q("rotation",e,t,a,n),u&&g.push(u),d=H("shear",e,t,a,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},c=Q("slide",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),c&&g.push(c),h=Q("offset",f,t.pathSnapping??e.updatedPathSnapping??e.dataPatched.pathSnapping,a.pathSnapping??e.dataPatched.pathSnapping,n),h&&g.push(h),!c&&!h&&(o=K("position",e,t,a,n),o&&g.push(o),i=K("scale",e,t,a,n),i&&g.push(i),u=function(e,t,a,r,n){let o=t?.rotation?t.rotation.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*G.DEG2RAD):void 0,i=a.rotation?.map(e=>("string"==typeof e?Number(n.getVariable(e)??0):e)*G.DEG2RAD);if(!i)return;let s=o?(new I).fromArray(o):(new I).setFromEuler(e.rotation),l=(new I).fromArray(i);if(s.equals(l))return;let u=le.subVectors(l,s);if(r&&u.toArray().every(e=>Math.abs(e)<2*Math.PI)){let t=(new z).setFromEuler(ue.setFromVector3(s)),a=(new z).setFromEuler(ue.setFromVector3(l));return{update:r=>{!function(e,t,a,r){if(0===r)return a.copy(e);if(1===r)return a.copy(t);let n=e.w*t.w+e.x*t.x+e.y*t.y+e.z*t.z;if(n>=1)return a.copy(e);let o=1-n*n;if(o<=Number.EPSILON){let n=1-r;return a.w=n*e.w+r*t.w,a.x=n*e.x+r*t.x,a.y=n*e.y+r*t.y,a.z=n*e.z+r*t.z,a.normalize(),a}let i=Math.sqrt(o),s=Math.atan2(i,n),l=Math.sin((1-r)*s)/i,u=Math.sin(r*s)/i;a.w=e.w*l+t.w*u,a.x=e.x*l+t.x*u,a.y=e.y*l+t.y*u,a.z=e.z*l+t.z*u}(t,a,e.quaternion,r)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}return{update:t=>{le.lerpVectors(s,l,t),e.rotation.setFromVector3(le)},start:()=>{e.rotation.setFromVector3(s)},end:()=>{e.rotation.setFromVector3(l)}}}(e,t,a,r,n),u&&g.push(u),p=function(e,t,a,r){let n=a[e]?a[e]:void 0,o=r[e];if(!o)return;let i=t[e],s=n?(new F).fromArray(n):i.clone(),l=new I,u=new z,d=new I;s.decompose(l,u,d);let p=(new F).fromArray(o),c=new I,h=new z,f=new I;return p.decompose(c,h,f),s.equals(p)?void 0:{update:e=>{Y.slerpQuaternions(u,h,e),_.lerpVectors(l,c,e),W.lerpVectors(d,f,e),i.compose(_,Y,W)},start:()=>{i.compose(l,u,d)},end:()=>{i.compose(c,h,f)}}}("hiddenMatrix",e,t,a),p&&g.push(p))),o||i||u||p||c||h){let a=v(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)&&l(e.parent)&&e.invalidateDownstreamBooleanData(!0),e.updatePathSnapping(Object.assign({},t.pathSnapping,f))};g.push({update:a,start:a,end:a})}return g}(r,n,o,c,p.shared)),v(r)?h.push(...function(r,n,o,i,s){let l,u,d,p,c,h,f,g,m,y,b,v,w,j,S,D=[];if("width"in r&&(l=Q("width",r,n,o,s),l&&D.push(l)),"height"in r&&(u=Q("height",r,n,o,s),u&&D.push(u)),r instanceof e||r instanceof a){let t={...n.fill},a={...o.fill};void 0!==t.enabled&&t.enabled!==a.enabled&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.fill.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),d=ee("color",r.fill,t,a,s),d&&D.push(d)}if(r instanceof e){let t={...n.stroke},a={...o.stroke};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.stroke.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),p=ee("color",r.stroke,t,a,s),p&&D.push(p),c=Q("thickness",r.stroke,t,a,s),c&&D.push(c)}if(r instanceof e){let t={...n.dropShadow},a={...o.dropShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.dropShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),h=ee("color",r.dropShadow,t,a,s),h&&D.push(h),f=Q("blurRadius",r.dropShadow,t,a,s),f&&D.push(f),m=Q("spread",r.dropShadow,t,a,s),m&&D.push(m),g=H("offset",r.dropShadow,t,a,s),g&&D.push(g)}if(r instanceof e){let t={...n.innerShadow},a={...o.innerShadow};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.innerShadow.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,color:{...t.color,a:0}}),a.enabled||Object.assign(a,{enabled:!0,color:{...a.color,a:0}})),y=ee("color",r.innerShadow,t,a,s),y&&D.push(y),b=Q("blurRadius",r.innerShadow,t,a,s),b&&D.push(b),w=Q("spread",r.innerShadow,t,a,s),w&&D.push(w),v=H("offset",r.innerShadow,t,a,s),v&&D.push(v)}if(r instanceof e||r instanceof a){let t={...n.backgroundBlur},a={...o.backgroundBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.backgroundBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),j=Q("radius",r.backgroundBlur,t,a,s),j&&D.push(j)}if(r instanceof e){let t={...n.layerBlur},a={...o.layerBlur};(t.enabled||a.enabled)&&(D.push(function(t){return{update:()=>{t instanceof e&&(t.layerBlur.enabled=!0)}}}(r)),t.enabled||Object.assign(t,{enabled:!0,radius:0}),a.enabled||Object.assign(a,{enabled:!0,radius:0})),S=Q("radius",r.layerBlur,t,a,s),S&&D.push(S)}if(r instanceof a||r instanceof t){let e=Z("cornerRadius",r,n,o,s);e&&D.push(e)}return D}(r,n,o,0,p.shared)):(r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("cloner"in a)||!e.cloner)return n;let o=e.cloner,i="cloner"in t?t.cloner:{},s=a.cloner;B.forEach(e=>{let t;t="count"===e?Q("count",o.parameters,i,s,r.shared,!0):te(e,o.parameters,i??{},s,r.shared),t&&n.push(t)});let l=function(e,t,a,r){if("radial"!==e.parameters.type)return;let n=t.radial,o=a.radial;if(!o)return;let i=e.parameters.radial,s=[];return V.forEach(e=>{let t=te(e,i,n??{},o,r);t&&s.push(t)}),s}(o,i,s,r.shared);l?.length&&n.push(...l);let u=function(e,t,a,r){if("linear"!==e.parameters.type)return;let n=t.linear,o=a.linear;if(!o)return;let i=[],s=e.parameters.linear;return x.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);u?.length&&n.push(...u);let d=function(e,t,a,r){if("grid"!==e.parameters.type)return;let n=t.grid,o=a.grid;if(!o)return;let i=[],s=e.parameters.grid;return O.forEach(e=>{let t;t="count"===e?Z(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);d?.length&&n.push(...d);let p=function(e,t,a,r){if("toObject"!==e.parameters.type)return;let n=t.toObject,o=a.toObject;if(!o)return;let i=[],s=e.parameters.toObject;return C.forEach(e=>{let t;t="count"===e?Q(e,s,n??{},o,r,!0):te(e,s,n??{},o,r),t&&i.push(t)}),i}(o,i,s,r.shared);p?.length&&n.push(...p);let c=function(e,t,a,r){if(!e.parameters.randomness)return;let n=t.randomnessObject,o=a.randomnessObject;if(!o)return;let i=[],s=e.parameters.randomnessObject;return A.forEach(e=>{let t=te(e,s,n??{},o,r);t&&i.push(t)}),i}(o,i,s,r.shared);return c?.length&&n.push(...c),n.length&&n.push({update:()=>{o.update(r)}}),n}(r,n,o,p)),r instanceof y?(r instanceof g&&r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(!("geometry"in a))return n;let o=e.geometry.userData.parameters,i="geometry"in t?t.geometry:{},s=a.geometry;if(e instanceof d){let t=function(e,t,a,r){if(void 0===a.scaleBaked)return;let n=(t.scaleBaked??e.data.geometry.scaleBaked).map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e),o=a.scaleBaked.map(e=>"string"==typeof e?Number(r.shared.getVariable(e)??0):e);if(S.isEqual(n,o))return;let i=[];return i.push({update:t=>{e.updateGeometryInteractions({scaleBaked:[G.lerp(n[0],o[0],t),G.lerp(n[1],o[1],t),G.lerp(n[2],o[2],t)]},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},start:()=>{e.updateGeometryInteractions({scaleBaked:n},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)},end:()=>{e.updateGeometryInteractions({scaleBaked:o},r.shared),e.invalidateDownstreamBooleanData(),e.refreshAttachedClonersInteractions(r)}}),i}(e,i,s,r);t&&n.push(...t)}else{let t={};if(Object.assign(t,j(o,R),j(i,R)),R.forEach(e=>{let a=te(e,t,i,s,r.shared);a&&n.push(a)}),b(e)){Object.assign(t,{extrusion:{...o.extrusion}});let e=function(e,t,a,r){if(!a.extrusion)return;let n=e.extrusion,o=t.extrusion??{},i=a.extrusion,s=[];return M.forEach(e=>{let t=te(e,n,o,i,r);t&&s.push(t)}),s}(t,i,s,r.shared);e&&n.push(...e)}n.length&&n.push({update:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},start:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)},end:a=>{e.updateGeometryInteractions(t,r.shared),e.updateGeometryGroupsIfNeeded(),e.refreshAttachedClonersInteractions(r)}})}return n}(r,n,o,p)),r.data.visible&&!(r instanceof f&&r.materialOverride)&&h.push(...function(e,t,a,r){let n=[];if(Array.isArray(e.material)){if(!("materials"in a)||!a.materials)return n;let o="materials"in t&&t.materials?t.materials:[],i=a.materials;e.material.forEach((e,t)=>{if(!i[t])return;let a=o[t]??{},s=i[t];"string"==typeof a||"string"==typeof s||n.push(...ie(e,a,s,r))})}else{if(!("material"in a)||!a.material)return n;let o="material"in t&&t.material?t.material:{},i=a.material;if("string"==typeof o||"string"==typeof i)return n;n.push(...ie(e.material,o,i,r))}return n}(r,n,o,p.shared))):i.is(r)?r.data.visible&&h.push(...function(e,t,a,r){let n=[];if(void 0!==a.intensity){let o=Q("intensity",e,t,a,r);o&&n.push(o)}if(void 0!==a.color){let o=function(e,t,a,r,n){let o=a[e]?a[e]:void 0,i=r[e];if(!i)return;let s=t[e],l=o?"string"==typeof o?n.getColor(o).clone():(new L).setRGB(o.r,o.g,o.b):s.clone(),u="string"==typeof i?n.getColor(i).clone():(new L).setRGB(i.r,i.g,i.b);if(l.equals(u))return;let d=s.clone();return{update:a=>{d.lerpColors(l,u,a),t[e]?.copy?.(d)},start:()=>{d.copy(l)},end:()=>{d.copy(u)}}}("color",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared)):r instanceof u&&h.push(...function(e,t,a,r){let n=[],o="OrthographicCamera"===e.cameraType?t.orthographic?.zoom:t.perspective?.zoom,i="OrthographicCamera"===e.cameraType?a.orthographic?.zoom:a.perspective?.zoom;if(void 0!==i){let t=o??e.zoom,a=i;t!==a&&n.push({update:r=>{e.zoom=G.lerp(t,a,r),e.updateProjectionMatrix()},start:()=>{e.zoom=t,e.updateProjectionMatrix()},end:()=>{e.zoom=a,e.updateProjectionMatrix()}})}if(void 0!==a.targetOffset){let o=Q("targetOffset",e,t,a,r);o&&n.push(o)}return n}(r,n,o,p.shared))),h.length?{update:e=>{h.forEach(t=>t.update(e))},start:e=>{h.forEach(t=>t.start?.(e))},end:e=>{h.forEach(t=>t.end?.(e))}}:void 0}function he(e,t){return{position(t){Object.assign(e.position,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},rotation(t){let a=Object.keys(t)[0];e.rotation[a]=t[a]*G.DEG2RAD,(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},scale(t){Object.assign(e.scale,t),(void 0!==t.x||void 0!==t.y||void 0!==t.z)&&(e.updateMatrix(),e.resetBBoxNeedsUpdate(),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"}))},shapeSize(a){e instanceof g&&(e.userData.value={...e.userData.value,...a},(void 0!==a.x||void 0!==a.y||void 0!==a.z)&&(e.updateGeometryInteractions({width:e.userData.value.x,height:e.userData.value.y,depth:e.userData.value.z},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})))},material(a,r,n){n&&(Object.entries(n).forEach(([a,{start:n,end:o,t:i}])=>{let s=r.getValue(a);e instanceof y&&!Array.isArray(e.material)&&"alpha"===a&&"number"==typeof s&&s>0&&(e.material.transparent=!0),void 0!==s&&se(a,r,n,o,i,t.shared)}),e.dispatchEvent({type:"requestRender"}))},opacity(a){if(e instanceof y&&!Array.isArray(e.material)){let r=e.material.getLayersOfType("light")[0];if(void 0===r)return;e.material.transparent=!0,se("alphaOverride",r,{alphaOverride:a},{alphaOverride:a+1},0,t.shared),e.dispatchEvent({type:"requestRender"})}},light(t,a){(e instanceof n||e instanceof r||e instanceof o)&&(e[t]=a,e.dispatchEvent({type:"requestRender"}))},cloner(e){e.cloner?.update(t),e instanceof g&&e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathExtrusion(e,a){e.geometry.userData.parameters.extrusion={...e.geometry.userData.parameters.extrusion,...a},e.updateGeometryInteractions({extrusion:{...e.geometry.userData.parameters.extrusion}},t.shared),e.resetBBoxNeedsUpdate(),e.invalidateDownstreamBooleanData(),e.dispatchEvent({type:"requestRender"})},pathSnapping(t){e.userData.pathSnapping={...e.userData.pathSnapping,...t},e.updatePathSnapping(e.userData.pathSnapping),e.dispatchEvent({type:"requestRender"})}}}var fe={type:"beginState"};function ge(e){let t;if(5===e.easing){let{control1:a,control2:r}=e;t=`cubicBezier(\n\t\t\t${a[0]}, ${a[1]}, ${r[0]}, ${r[1]}\n\t\t)`}else if(6===e.easing){let{mass:a,stiffness:r,damping:n,velocity:o}=e;t=`spring( ${a}, ${r}, ${n}, ${o} )`}else{let a;switch(e.easing){case 0:default:a=E.linear;break;case 1:a=E.ease;break;case 2:a=E.easeIn;break;case 3:a=E.easeOut;break;case 4:a=E.easeInOut}let[r,n,o,i]=a;t=`cubicBezier( ${r}, ${n}, ${o}, ${i} )`}return{duration:Math.max(e.duration,1e-4),easing:t}}function me(e){let t={delay:0,loop:-1===e.repeat||e.repeat+1};if(0===e.repeat)t.direction="normal",t.rewind=!1;else switch(e.direction){case"pingpong":t.direction="alternate",t.rewind=!1;break;case"pingpong-rewind":t.direction="alternate",t.rewind=!0;break;default:t.direction="normal",t.rewind=!1}switch(t.delay=0,t.endDelay=0,t.startOnceDelay=0,t.pingPongDelayCorrection=0,t.pingPongEndDelayCorrection=0,e.delayDirection){case"start-once":t.startOnceDelay=e.delay;break;case"start":t.delay=e.delay;break;case"end":t.endDelay=e.delay;break;case"start-end":case void 0:t.delay=e.delay,t.endDelay=e.delay}return"alternate"===t.direction&&(t.delay/=2,t.endDelay/=2,"start"===e.delayDirection?(t.pingPongDelayCorrection=t.delay,"number"==typeof t.loop&&t.loop%2==0&&(t.pingPongEndDelayCorrection=t.delay)):"end"===e.delayDirection?"number"==typeof t.loop&&t.loop%2!=0&&(t.pingPongEndDelayCorrection=t.endDelay):"start-end"===e.delayDirection&&(t.pingPongDelayCorrection=t.delay,t.pingPongEndDelayCorrection=t.endDelay)),t}var ye={type:"completeState",isfromEntity:!1};function be(e,t){let a,r;if("string"==typeof t?(a=t,r=e.states?.[a]):null===t&&(a=null,r=e.data),void 0!==a&&void 0!==r)return{id:a,data:r}}var ve=class{constructor(e,t,a,r,n,o,i){if(this.object=e,this.data=r,this.sharedAssets=n,this.allowSlerp=o,this.page=i,this.targets={t:0},this.firstLoop=!0,this._changeBegan=!1,this._changeCompleted=!0,this.onChange=()=>{this.callback&&(this.callback.update(this.targets.t),this.object.requestRender()),0===this.targets.t||1===this.targets.t?this._changeCompleted||(this._changeCompleted=!0,this._changeBegan=!1,this.onChangeComplete()):(this._changeCompleted&&(this._changeCompleted=!1),this._changeBegan||(this._changeBegan=!0,this.onChangeBegin()))},this.onChangeBegin=()=>{this.object.reversibleToState=this.to.id;let e=this.targets.t>.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"beginState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(fe)})},this.onChangeComplete=()=>{this.firstLoop&&(this.onFirstLoop(),this.firstLoop=!1),this.object.reversibleToState=this.to.id;let e=this.targets.t<.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=e,this.object.dispatchEvent({type:"completeState",state:e}),v(this.object)||this.object.traverseEntity(e=>{e!==this.object&&e instanceof u&&e.dispatchEvent(ye)})},this.onFirstLoop=()=>{this.useCurrentState&&(this.callback=ce(this.object,this.from.data,this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp))},void 0===t){let e=be(this.object,this.object.currentState===a?this.object.prevState:this.object.currentState);if(!e)throw new Error("Missing property");this.from=e}else{let e=be(this.object,t);if(!e)throw new Error("Missing property");this.from=e}if(void 0===a)throw new Error("Missing property");{let e=be(this.object,a);if(!e)throw new Error("Missing property");this.to=e}this.useCurrentState=void 0===t||void 0===a,this.params={targets:this.targets,t:1,autoplay:!1,...me(r),...ge(r),change:this.onChange},this.callback=ce(this.object,void 0===t?{}:this.from.data,void 0===a?{}:this.to.data,{scene:this.page.scene,shared:this.sharedAssets},this.allowSlerp)}get changeBegan(){return this._changeBegan}get changeCompleted(){return this._changeCompleted}};export{re as a,ne as b,de as c,pe as d,he as e,fe as f,ge as g,me as h,ye as i,be as j,ve as k};
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file