@splinetool/runtime 2.0.64 → 2.0.66

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 (300) hide show
  1. package/build/{runtime-aiAssistant-WCXMKTQK.js → runtime-aiAssistant-P56R6EIU.js} +1 -1
  2. package/build/runtime-aiAssistant-P56R6EIU.js.br +0 -0
  3. package/build/runtime-aiAssistant-P56R6EIU.js.gz +0 -0
  4. package/build/{runtime-apiServices-DRMLTDTB.js → runtime-apiServices-ADKEC7LW.js} +1 -1
  5. package/build/runtime-apiServices-ADKEC7LW.js.br +0 -0
  6. package/build/runtime-apiServices-ADKEC7LW.js.gz +0 -0
  7. package/build/{runtime-audio-7LXSIVLU.js → runtime-audio-YJWGAMZD.js} +1 -1
  8. package/build/runtime-audio-YJWGAMZD.js.br +0 -0
  9. package/build/runtime-audio-YJWGAMZD.js.gz +0 -0
  10. package/build/{runtime-chunk-BKTNVUN3.js → runtime-chunk-2GPGYGR2.js} +1 -1
  11. package/build/runtime-chunk-2GPGYGR2.js.br +0 -0
  12. package/build/runtime-chunk-2GPGYGR2.js.gz +0 -0
  13. package/build/{runtime-chunk-YLZEQDL2.js → runtime-chunk-3B2NPUWD.js} +1 -1
  14. package/build/runtime-chunk-3B2NPUWD.js.br +0 -0
  15. package/build/runtime-chunk-3B2NPUWD.js.gz +0 -0
  16. package/build/{runtime-chunk-KWEZUCEY.js → runtime-chunk-564IIVBV.js} +1 -1
  17. package/build/runtime-chunk-564IIVBV.js.br +0 -0
  18. package/build/runtime-chunk-564IIVBV.js.gz +0 -0
  19. package/build/{runtime-chunk-BSJNKHDI.js → runtime-chunk-BJXRV54U.js} +1 -1
  20. package/build/runtime-chunk-BJXRV54U.js.br +0 -0
  21. package/build/runtime-chunk-BJXRV54U.js.gz +0 -0
  22. package/build/{runtime-chunk-WS3W6I75.js → runtime-chunk-D373PZPG.js} +1 -1
  23. package/build/runtime-chunk-D373PZPG.js.br +0 -0
  24. package/build/runtime-chunk-D373PZPG.js.gz +0 -0
  25. package/build/{runtime-chunk-PZC5R2IA.js → runtime-chunk-DC4SLIAM.js} +1 -1
  26. package/build/runtime-chunk-DC4SLIAM.js.br +0 -0
  27. package/build/runtime-chunk-DC4SLIAM.js.gz +0 -0
  28. package/build/{runtime-chunk-WQ5L4XSQ.js → runtime-chunk-DUQ2PW7L.js} +1 -1
  29. package/build/runtime-chunk-DUQ2PW7L.js.br +0 -0
  30. package/build/runtime-chunk-DUQ2PW7L.js.gz +0 -0
  31. package/build/{runtime-chunk-P4VXE26L.js → runtime-chunk-E4IP6WPJ.js} +1 -1
  32. package/build/runtime-chunk-E4IP6WPJ.js.br +0 -0
  33. package/build/runtime-chunk-E4IP6WPJ.js.gz +0 -0
  34. package/build/{runtime-chunk-EMM5BAG5.js → runtime-chunk-G3JY5FTO.js} +1 -1
  35. package/build/runtime-chunk-G3JY5FTO.js.br +0 -0
  36. package/build/runtime-chunk-G3JY5FTO.js.gz +0 -0
  37. package/build/{runtime-chunk-7L46WKPR.js → runtime-chunk-I6CPIGMQ.js} +1 -1
  38. package/build/runtime-chunk-I6CPIGMQ.js.br +0 -0
  39. package/build/runtime-chunk-I6CPIGMQ.js.gz +0 -0
  40. package/build/{runtime-chunk-UBIS23VA.js → runtime-chunk-ITPAD3LR.js} +1 -1
  41. package/build/runtime-chunk-ITPAD3LR.js.br +0 -0
  42. package/build/runtime-chunk-ITPAD3LR.js.gz +0 -0
  43. package/build/{runtime-chunk-UTXZTSXZ.js → runtime-chunk-JAELIJQZ.js} +1 -1
  44. package/build/runtime-chunk-JAELIJQZ.js.br +0 -0
  45. package/build/runtime-chunk-JAELIJQZ.js.gz +0 -0
  46. package/build/{runtime-chunk-4OGX3VGG.js → runtime-chunk-JB6TDVGN.js} +1 -1
  47. package/build/runtime-chunk-JB6TDVGN.js.br +0 -0
  48. package/build/runtime-chunk-JB6TDVGN.js.gz +0 -0
  49. package/build/{runtime-chunk-4YSIMIIS.js → runtime-chunk-JVQBFLYF.js} +1 -1
  50. package/build/runtime-chunk-JVQBFLYF.js.br +0 -0
  51. package/build/runtime-chunk-JVQBFLYF.js.gz +0 -0
  52. package/build/{runtime-chunk-M6FFVLT6.js → runtime-chunk-L6ERXCVI.js} +1 -1
  53. package/build/runtime-chunk-L6ERXCVI.js.br +0 -0
  54. package/build/runtime-chunk-L6ERXCVI.js.gz +0 -0
  55. package/build/{runtime-chunk-6UKGQUL5.js → runtime-chunk-LGRD54SI.js} +1 -1
  56. package/build/runtime-chunk-LGRD54SI.js.br +0 -0
  57. package/build/runtime-chunk-LGRD54SI.js.gz +0 -0
  58. package/build/{runtime-chunk-STNNKZRL.js → runtime-chunk-LU45RPBP.js} +1 -1
  59. package/build/runtime-chunk-LU45RPBP.js.br +0 -0
  60. package/build/runtime-chunk-LU45RPBP.js.gz +0 -0
  61. package/build/{runtime-chunk-FLYEGFUP.js → runtime-chunk-LYYY4YGG.js} +1 -1
  62. package/build/runtime-chunk-LYYY4YGG.js.br +0 -0
  63. package/build/runtime-chunk-LYYY4YGG.js.gz +0 -0
  64. package/build/{runtime-chunk-TZDJI7XT.js → runtime-chunk-P4TVEPXM.js} +1 -1
  65. package/build/runtime-chunk-P4TVEPXM.js.br +0 -0
  66. package/build/runtime-chunk-P4TVEPXM.js.gz +0 -0
  67. package/build/{runtime-chunk-2WZ2DHUS.js → runtime-chunk-PE7JIDJV.js} +1 -1
  68. package/build/runtime-chunk-PE7JIDJV.js.br +0 -0
  69. package/build/runtime-chunk-PE7JIDJV.js.gz +0 -0
  70. package/build/{runtime-chunk-XWIXLZ5T.js → runtime-chunk-PKIQR6HY.js} +1 -1
  71. package/build/runtime-chunk-PKIQR6HY.js.br +0 -0
  72. package/build/runtime-chunk-PKIQR6HY.js.gz +0 -0
  73. package/build/{runtime-chunk-P2RJUWN3.js → runtime-chunk-PUFOPNOK.js} +1 -1
  74. package/build/runtime-chunk-PUFOPNOK.js.br +0 -0
  75. package/build/runtime-chunk-PUFOPNOK.js.gz +0 -0
  76. package/build/{runtime-chunk-NFPL6LCH.js → runtime-chunk-QDMMX2RH.js} +1 -1
  77. package/build/runtime-chunk-QDMMX2RH.js.br +0 -0
  78. package/build/runtime-chunk-QDMMX2RH.js.gz +0 -0
  79. package/build/{runtime-chunk-OUUOTV4G.js → runtime-chunk-QRYUKNF2.js} +1 -1
  80. package/build/runtime-chunk-QRYUKNF2.js.br +0 -0
  81. package/build/runtime-chunk-QRYUKNF2.js.gz +0 -0
  82. package/build/{runtime-chunk-GGOMRZAR.js → runtime-chunk-UQJOH5LM.js} +1 -1
  83. package/build/runtime-chunk-UQJOH5LM.js.br +0 -0
  84. package/build/runtime-chunk-UQJOH5LM.js.gz +0 -0
  85. package/build/{runtime-chunk-65Z7LNTT.js → runtime-chunk-XFDV5BI7.js} +1 -1
  86. package/build/runtime-chunk-XFDV5BI7.js.br +2 -0
  87. package/build/runtime-chunk-XFDV5BI7.js.gz +0 -0
  88. package/build/{runtime-classicRuntime-2LP2RINT.js → runtime-classicRuntime-DPTSVYI5.js} +1 -1
  89. package/build/runtime-classicRuntime-DPTSVYI5.js.br +0 -0
  90. package/build/runtime-classicRuntime-DPTSVYI5.js.gz +0 -0
  91. package/build/{runtime-cloners-UXNJ35Q7.js → runtime-cloners-ILCN67AT.js} +1 -1
  92. package/build/runtime-cloners-ILCN67AT.js.br +0 -0
  93. package/build/runtime-cloners-ILCN67AT.js.gz +0 -0
  94. package/build/{runtime-components-SONNU6VA.js → runtime-components-FSOOTPFP.js} +1 -1
  95. package/build/runtime-components-FSOOTPFP.js.br +0 -0
  96. package/build/runtime-components-FSOOTPFP.js.gz +0 -0
  97. package/build/{runtime-conditional-3OCYMAD5.js → runtime-conditional-L7VSDRAB.js} +1 -1
  98. package/build/{runtime-conditional-3OCYMAD5.js.br → runtime-conditional-L7VSDRAB.js.br} +0 -0
  99. package/build/{runtime-conditional-3OCYMAD5.js.gz → runtime-conditional-L7VSDRAB.js.gz} +0 -0
  100. package/build/{runtime-createDestroy-NOHVBEAO.js → runtime-createDestroy-QKX6M7W4.js} +1 -1
  101. package/build/runtime-createDestroy-QKX6M7W4.js.br +0 -0
  102. package/build/runtime-createDestroy-QKX6M7W4.js.gz +0 -0
  103. package/build/{runtime-dragDrop-VTVWV5KA.js → runtime-dragDrop-EKI3PCPJ.js} +1 -1
  104. package/build/runtime-dragDrop-EKI3PCPJ.js.br +0 -0
  105. package/build/runtime-dragDrop-EKI3PCPJ.js.gz +0 -0
  106. package/build/{runtime-gameControls-COW4KVOP.js → runtime-gameControls-E2GZ6EHC.js} +1 -1
  107. package/build/runtime-gameControls-E2GZ6EHC.js.br +0 -0
  108. package/build/runtime-gameControls-E2GZ6EHC.js.gz +0 -0
  109. package/build/{runtime-hair-TRDVYNIC.js → runtime-hair-ROZIYKAI.js} +1 -1
  110. package/build/runtime-hair-ROZIYKAI.js.br +1 -0
  111. package/build/runtime-hair-ROZIYKAI.js.gz +0 -0
  112. package/build/{runtime-mergeStaticGeometries-BOYWYTHP.js → runtime-mergeStaticGeometries-PUYA5EV6.js} +1 -1
  113. package/build/runtime-mergeStaticGeometries-PUYA5EV6.js.br +0 -0
  114. package/build/runtime-mergeStaticGeometries-PUYA5EV6.js.gz +0 -0
  115. package/build/{runtime-miscActions-U6DP3DWY.js → runtime-miscActions-GGVSP7JK.js} +1 -1
  116. package/build/runtime-miscActions-GGVSP7JK.js.br +0 -0
  117. package/build/runtime-miscActions-GGVSP7JK.js.gz +0 -0
  118. package/build/{runtime-mouseHover-D26PWFUI.js → runtime-mouseHover-MMU3GSN4.js} +1 -1
  119. package/build/runtime-mouseHover-MMU3GSN4.js.br +0 -0
  120. package/build/runtime-mouseHover-MMU3GSN4.js.gz +0 -0
  121. package/build/{runtime-particles-6U43I2Y4.js → runtime-particles-H3X2X7GM.js} +1 -1
  122. package/build/runtime-particles-H3X2X7GM.js.br +0 -0
  123. package/build/runtime-particles-H3X2X7GM.js.gz +0 -0
  124. package/build/{runtime-paths-PQHDXTF4.js → runtime-paths-R2WDN2DI.js} +1 -1
  125. package/build/runtime-paths-R2WDN2DI.js.br +0 -0
  126. package/build/runtime-paths-R2WDN2DI.js.gz +0 -0
  127. package/build/{runtime-resize-UMOXP26N.js → runtime-resize-4IJCXNFR.js} +1 -1
  128. package/build/runtime-resize-4IJCXNFR.js.br +0 -0
  129. package/build/runtime-resize-4IJCXNFR.js.gz +0 -0
  130. package/build/{runtime-sceneTransition-5MZBTXK2.js → runtime-sceneTransition-F6OVIBVY.js} +1 -1
  131. package/build/runtime-sceneTransition-F6OVIBVY.js.br +0 -0
  132. package/build/runtime-sceneTransition-F6OVIBVY.js.gz +0 -0
  133. package/build/{runtime-scroll-O7MW4PGX.js → runtime-scroll-ZPNGUYQD.js} +1 -1
  134. package/build/runtime-scroll-ZPNGUYQD.js.br +0 -0
  135. package/build/runtime-scroll-ZPNGUYQD.js.gz +0 -0
  136. package/build/runtime-shapeBlends-PM5VWJX5.js +1 -0
  137. package/build/runtime-shapeBlends-PM5VWJX5.js.br +0 -0
  138. package/build/runtime-shapeBlends-PM5VWJX5.js.gz +0 -0
  139. package/build/{runtime-text-4AHR5UXX.js → runtime-text-PQV2VUAT.js} +1 -1
  140. package/build/runtime-text-PQV2VUAT.js.br +0 -0
  141. package/build/runtime-text-PQV2VUAT.js.gz +0 -0
  142. package/build/{runtime-textInputs-W6K3BQMF.js → runtime-textInputs-GNG4HVQG.js} +1 -1
  143. package/build/runtime-textInputs-GNG4HVQG.js.br +0 -0
  144. package/build/runtime-textInputs-GNG4HVQG.js.gz +0 -0
  145. package/build/{runtime-timeline-JEZKTTPW.js → runtime-timeline-P7IDRC5D.js} +1 -1
  146. package/build/runtime-timeline-P7IDRC5D.js.br +0 -0
  147. package/build/runtime-timeline-P7IDRC5D.js.gz +0 -0
  148. package/build/{runtime-tracking-UYBHQWE3.js → runtime-tracking-OKMQ7ZRT.js} +1 -1
  149. package/build/runtime-tracking-OKMQ7ZRT.js.br +0 -0
  150. package/build/runtime-tracking-OKMQ7ZRT.js.gz +0 -0
  151. package/build/{runtime-transitions-6HDRQDLB.js → runtime-transitions-EMKQKM7N.js} +1 -1
  152. package/build/runtime-transitions-EMKQKM7N.js.br +0 -0
  153. package/build/runtime-transitions-EMKQKM7N.js.gz +0 -0
  154. package/build/{runtime-ui2d-TFL4GHUX.js → runtime-ui2d-AURBDYA2.js} +1 -1
  155. package/build/runtime-ui2d-AURBDYA2.js.br +0 -0
  156. package/build/runtime-ui2d-AURBDYA2.js.gz +0 -0
  157. package/build/{runtime-variables-QPWCA6SV.js → runtime-variables-VMN76G6O.js} +1 -1
  158. package/build/runtime-variables-VMN76G6O.js.br +0 -0
  159. package/build/runtime-variables-VMN76G6O.js.gz +0 -0
  160. package/build/{runtime-vectorShapes-JBKXDWUW.js → runtime-vectorShapes-A4HXI7TN.js} +1 -1
  161. package/build/runtime-vectorShapes-A4HXI7TN.js.br +0 -0
  162. package/build/runtime-vectorShapes-A4HXI7TN.js.gz +0 -0
  163. package/build/{runtime-video-BFI3XXUJ.js → runtime-video-XEINPQPG.js} +1 -1
  164. package/build/runtime-video-XEINPQPG.js.br +0 -0
  165. package/build/runtime-video-XEINPQPG.js.gz +0 -0
  166. package/build/runtime-webgpu-YOUCVSAF.js +1 -0
  167. package/build/runtime-webgpu-YOUCVSAF.js.br +0 -0
  168. package/build/runtime-webgpu-YOUCVSAF.js.gz +0 -0
  169. package/build/runtime.cjs +8 -8
  170. package/build/runtime.js +1 -1
  171. package/build/runtime.js.br +0 -0
  172. package/build/runtime.js.gz +0 -0
  173. package/build/runtime.standalone.js +1 -1
  174. package/build/runtime.standalone.js.br +0 -0
  175. package/build/runtime.standalone.js.gz +0 -0
  176. package/build/runtime.standalone.webgl.js +1 -1
  177. package/build/runtime.standalone.webgl.js.br +0 -0
  178. package/build/runtime.standalone.webgl.js.gz +0 -0
  179. package/build/runtime.standalone.webgpu.js +1 -1
  180. package/build/runtime.standalone.webgpu.js.br +0 -0
  181. package/build/runtime.standalone.webgpu.js.gz +0 -0
  182. package/build/runtime.standalone.webgpu.micro.js +1 -1
  183. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  184. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  185. package/build/runtime.standalone.webgpu.min.js +1 -1
  186. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  187. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  188. package/package.json +1 -1
  189. package/build/runtime-aiAssistant-WCXMKTQK.js.br +0 -0
  190. package/build/runtime-aiAssistant-WCXMKTQK.js.gz +0 -0
  191. package/build/runtime-apiServices-DRMLTDTB.js.br +0 -0
  192. package/build/runtime-apiServices-DRMLTDTB.js.gz +0 -0
  193. package/build/runtime-audio-7LXSIVLU.js.br +0 -0
  194. package/build/runtime-audio-7LXSIVLU.js.gz +0 -0
  195. package/build/runtime-chunk-2WZ2DHUS.js.br +0 -0
  196. package/build/runtime-chunk-2WZ2DHUS.js.gz +0 -0
  197. package/build/runtime-chunk-4OGX3VGG.js.br +0 -0
  198. package/build/runtime-chunk-4OGX3VGG.js.gz +0 -0
  199. package/build/runtime-chunk-4YSIMIIS.js.br +0 -0
  200. package/build/runtime-chunk-4YSIMIIS.js.gz +0 -0
  201. package/build/runtime-chunk-65Z7LNTT.js.br +0 -2
  202. package/build/runtime-chunk-65Z7LNTT.js.gz +0 -0
  203. package/build/runtime-chunk-6UKGQUL5.js.br +0 -0
  204. package/build/runtime-chunk-6UKGQUL5.js.gz +0 -0
  205. package/build/runtime-chunk-7L46WKPR.js.br +0 -0
  206. package/build/runtime-chunk-7L46WKPR.js.gz +0 -0
  207. package/build/runtime-chunk-BKTNVUN3.js.br +0 -0
  208. package/build/runtime-chunk-BKTNVUN3.js.gz +0 -0
  209. package/build/runtime-chunk-BSJNKHDI.js.br +0 -0
  210. package/build/runtime-chunk-BSJNKHDI.js.gz +0 -0
  211. package/build/runtime-chunk-EMM5BAG5.js.br +0 -0
  212. package/build/runtime-chunk-EMM5BAG5.js.gz +0 -0
  213. package/build/runtime-chunk-FLYEGFUP.js.br +0 -0
  214. package/build/runtime-chunk-FLYEGFUP.js.gz +0 -0
  215. package/build/runtime-chunk-GGOMRZAR.js.br +0 -0
  216. package/build/runtime-chunk-GGOMRZAR.js.gz +0 -0
  217. package/build/runtime-chunk-KWEZUCEY.js.br +0 -0
  218. package/build/runtime-chunk-KWEZUCEY.js.gz +0 -0
  219. package/build/runtime-chunk-M6FFVLT6.js.br +0 -0
  220. package/build/runtime-chunk-M6FFVLT6.js.gz +0 -0
  221. package/build/runtime-chunk-NFPL6LCH.js.br +0 -0
  222. package/build/runtime-chunk-NFPL6LCH.js.gz +0 -0
  223. package/build/runtime-chunk-OUUOTV4G.js.br +0 -0
  224. package/build/runtime-chunk-OUUOTV4G.js.gz +0 -0
  225. package/build/runtime-chunk-P2RJUWN3.js.br +0 -0
  226. package/build/runtime-chunk-P2RJUWN3.js.gz +0 -0
  227. package/build/runtime-chunk-P4VXE26L.js.br +0 -0
  228. package/build/runtime-chunk-P4VXE26L.js.gz +0 -0
  229. package/build/runtime-chunk-PZC5R2IA.js.br +0 -0
  230. package/build/runtime-chunk-PZC5R2IA.js.gz +0 -0
  231. package/build/runtime-chunk-STNNKZRL.js.br +0 -0
  232. package/build/runtime-chunk-STNNKZRL.js.gz +0 -0
  233. package/build/runtime-chunk-TZDJI7XT.js.br +0 -0
  234. package/build/runtime-chunk-TZDJI7XT.js.gz +0 -0
  235. package/build/runtime-chunk-UBIS23VA.js.br +0 -0
  236. package/build/runtime-chunk-UBIS23VA.js.gz +0 -0
  237. package/build/runtime-chunk-UTXZTSXZ.js.br +0 -0
  238. package/build/runtime-chunk-UTXZTSXZ.js.gz +0 -0
  239. package/build/runtime-chunk-WQ5L4XSQ.js.br +0 -0
  240. package/build/runtime-chunk-WQ5L4XSQ.js.gz +0 -0
  241. package/build/runtime-chunk-WS3W6I75.js.br +0 -0
  242. package/build/runtime-chunk-WS3W6I75.js.gz +0 -0
  243. package/build/runtime-chunk-XWIXLZ5T.js.br +0 -0
  244. package/build/runtime-chunk-XWIXLZ5T.js.gz +0 -0
  245. package/build/runtime-chunk-YLZEQDL2.js.br +0 -0
  246. package/build/runtime-chunk-YLZEQDL2.js.gz +0 -0
  247. package/build/runtime-classicRuntime-2LP2RINT.js.br +0 -0
  248. package/build/runtime-classicRuntime-2LP2RINT.js.gz +0 -0
  249. package/build/runtime-cloners-UXNJ35Q7.js.br +0 -1
  250. package/build/runtime-cloners-UXNJ35Q7.js.gz +0 -0
  251. package/build/runtime-components-SONNU6VA.js.br +0 -0
  252. package/build/runtime-components-SONNU6VA.js.gz +0 -0
  253. package/build/runtime-createDestroy-NOHVBEAO.js.br +0 -0
  254. package/build/runtime-createDestroy-NOHVBEAO.js.gz +0 -0
  255. package/build/runtime-dragDrop-VTVWV5KA.js.br +0 -0
  256. package/build/runtime-dragDrop-VTVWV5KA.js.gz +0 -0
  257. package/build/runtime-gameControls-COW4KVOP.js.br +0 -0
  258. package/build/runtime-gameControls-COW4KVOP.js.gz +0 -0
  259. package/build/runtime-hair-TRDVYNIC.js.br +0 -1
  260. package/build/runtime-hair-TRDVYNIC.js.gz +0 -0
  261. package/build/runtime-mergeStaticGeometries-BOYWYTHP.js.br +0 -0
  262. package/build/runtime-mergeStaticGeometries-BOYWYTHP.js.gz +0 -0
  263. package/build/runtime-miscActions-U6DP3DWY.js.br +0 -0
  264. package/build/runtime-miscActions-U6DP3DWY.js.gz +0 -0
  265. package/build/runtime-mouseHover-D26PWFUI.js.br +0 -0
  266. package/build/runtime-mouseHover-D26PWFUI.js.gz +0 -0
  267. package/build/runtime-particles-6U43I2Y4.js.br +0 -0
  268. package/build/runtime-particles-6U43I2Y4.js.gz +0 -0
  269. package/build/runtime-paths-PQHDXTF4.js.br +0 -0
  270. package/build/runtime-paths-PQHDXTF4.js.gz +0 -0
  271. package/build/runtime-resize-UMOXP26N.js.br +0 -0
  272. package/build/runtime-resize-UMOXP26N.js.gz +0 -0
  273. package/build/runtime-sceneTransition-5MZBTXK2.js.br +0 -0
  274. package/build/runtime-sceneTransition-5MZBTXK2.js.gz +0 -0
  275. package/build/runtime-scroll-O7MW4PGX.js.br +0 -0
  276. package/build/runtime-scroll-O7MW4PGX.js.gz +0 -0
  277. package/build/runtime-shapeBlends-JZBMFVOG.js +0 -1
  278. package/build/runtime-shapeBlends-JZBMFVOG.js.br +0 -0
  279. package/build/runtime-shapeBlends-JZBMFVOG.js.gz +0 -0
  280. package/build/runtime-text-4AHR5UXX.js.br +0 -0
  281. package/build/runtime-text-4AHR5UXX.js.gz +0 -0
  282. package/build/runtime-textInputs-W6K3BQMF.js.br +0 -0
  283. package/build/runtime-textInputs-W6K3BQMF.js.gz +0 -0
  284. package/build/runtime-timeline-JEZKTTPW.js.br +0 -0
  285. package/build/runtime-timeline-JEZKTTPW.js.gz +0 -0
  286. package/build/runtime-tracking-UYBHQWE3.js.br +0 -0
  287. package/build/runtime-tracking-UYBHQWE3.js.gz +0 -0
  288. package/build/runtime-transitions-6HDRQDLB.js.br +0 -0
  289. package/build/runtime-transitions-6HDRQDLB.js.gz +0 -0
  290. package/build/runtime-ui2d-TFL4GHUX.js.br +0 -0
  291. package/build/runtime-ui2d-TFL4GHUX.js.gz +0 -0
  292. package/build/runtime-variables-QPWCA6SV.js.br +0 -0
  293. package/build/runtime-variables-QPWCA6SV.js.gz +0 -0
  294. package/build/runtime-vectorShapes-JBKXDWUW.js.br +0 -0
  295. package/build/runtime-vectorShapes-JBKXDWUW.js.gz +0 -0
  296. package/build/runtime-video-BFI3XXUJ.js.br +0 -0
  297. package/build/runtime-video-BFI3XXUJ.js.gz +0 -0
  298. package/build/runtime-webgpu-5H7LPI55.js +0 -1
  299. package/build/runtime-webgpu-5H7LPI55.js.br +0 -0
  300. package/build/runtime-webgpu-5H7LPI55.js.gz +0 -0
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-WS3W6I75.js";import{a as e,b as r}from"./runtime-chunk-T53JMQSH.js";import{F as i,o as n}from"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as s,f as a,h as o}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import{Dc as h,Jd as l,Ld as u,Nd as c,Qd as f,Qe as d,Rd as p,Sd as g,Tc as y}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var m=class{constructor(){this.type="ShapePath",this.color=new y,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new f,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath?.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath?.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath?.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath?.splineThru(t),this}toShapes(){let t={loc:0,t:0};function e(e,i,n,s){let a=e.x,o=i.x,h=n.x,l=s.x,u=e.y,c=i.y,f=n.y,d=s.y,p=(l-h)*(u-f)-(d-f)*(a-h),g=(d-f)*(o-a)-(l-h)*(c-u),y=p/g,m=((o-a)*(u-f)-(c-u)*(a-h))/g;if(0===g&&0!==p||y<=0||y>=1||m<0||m>1)return null;if(0===p&&0===g){for(let h=0;h<2;h++){if(r(0===h?n:s,e,i),0===t.loc){let e=0===h?n:s;return{x:e.x,y:e.y,t:t.t}}if(2===t.loc)return{x:+(a+t.t*(o-a)).toPrecision(10),y:+(u+t.t*(c-u)).toPrecision(10),t:t.t}}return null}for(let a=0;a<2;a++)if(r(0===a?n:s,e,i),0===t.loc){let e=0===a?n:s;return{x:e.x,y:e.y,t:t.t}}return{x:+(a+y*(o-a)).toPrecision(10),y:+(u+y*(c-u)).toPrecision(10),t:y}}function r(e,r,i){let n,s=i.x-r.x,a=i.y-r.y,o=e.x-r.x,h=e.y-r.y,l=s*h-o*a;return e.x===r.x&&e.y===r.y?(t.loc=0,void(t.t=0)):e.x===i.x&&e.y===i.y?(t.loc=1,void(t.t=1)):void(l<-Number.EPSILON?t.loc=3:l>Number.EPSILON?t.loc=4:s*o<0||a*h<0?t.loc=5:Math.sqrt(s*s+a*a)<Math.sqrt(o*o+h*h)?t.loc=6:(n=0!==s?o/s:h/a,t.loc=2,t.t=n))}let i=0,n=999999999,s=-999999999,a=[];this.subPaths.forEach(t=>{let e=t.getPoints(),r=-999999999,o=999999999,l=-999999999,u=999999999;for(let t=0;t<e.length;t++){let i=e[t];i.y>r&&(r=i.y),i.y<o&&(o=i.y),i.x>l&&(l=i.x),i.x<u&&(u=i.x)}s<=l&&(s=l+1),n>=u&&(n=u-1),e.length&&a.push({curves:t.curves,points:e,isCW:g.isClockWise(e),identifier:i++,boundingBox:new d(new h(u,o),new h(l,r))})});let o=a.map(t=>function(t,r,i,n,s){(null==s||""===s)&&(s="nonzero");let a=new h;t.boundingBox.getCenter(a);let o=function(t,r,i){let n=new h;r.getCenter(n);let s=[];return i.forEach(r=>{r.boundingBox.containsPoint(n)&&function(t,r){let i=[],n=[];for(let s=1;s<t.length;s++){let a=t[s-1],o=t[s];for(let t=1;t<r.length;t++){let s=e(a,o,r[t-1],r[t]);null!==s&&void 0===i.find(t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON)&&(i.push(s),n.push(new h(s.x,s.y)))}}return n}(t,r.points).forEach(t=>{s.push({identifier:r.identifier,isCW:r.isCW,point:t})})}),s.sort((t,e)=>t.point.x-e.point.x),s}([new h(i,a.y),new h(n,a.y)],t.boundingBox,r);o.sort((t,e)=>t.point.x-e.point.x);let l=[],u=[];o.forEach(e=>{e.identifier===t.identifier?l.push(e):u.push(e)});let c=l[0].point.x,f=[],d=0;for(;d<u.length&&u[d].point.x<c;)f.length>0&&f[f.length-1]===u[d].identifier?f.pop():f.push(u[d].identifier),d++;if(f.push(t.identifier),"evenodd"===s){let e=f.length%2==0,r=f[f.length-2];return{identifier:t.identifier,isHole:e,for:r}}if("nonzero"===s){let e=!0,i=null,n=null;for(let t=0;t<f.length;t++){let s=f[t];r[s]&&(e?(n=r[s].isCW,e=!1,i=s):n!==r[s].isCW&&(n=r[s].isCW,e=!0))}return{identifier:t.identifier,isHole:e,for:i}}console.warn('fill-rule: "'+s+'" is currently not implemented.')}(t,a,n,s,this.userData?.style.fillRule)),l=[];return a.forEach(t=>{let e=o[t.identifier];if(e&&!e.isHole){let e=new p;e.curves=t.curves,o.filter(e=>e?.isHole&&e.for===t.identifier).forEach(t=>{if(t){let r=a[t.identifier],i=new f;i.curves=r.curves,e.holes.push(i)}}),l.push(e)}}),l}},x=new class{async load(t,e,i=()=>{}){let{load:n}=await r;n(t,(t,r)=>{t||!r?i(t??"Something went wrong"):e(r)})}async parse(t){let{parse:e,Bidi:i}=await r;try{let r=e(t),n=new i,s=t=>r.charToGlyphIndex(t.char);return n.registerModifier("glyphIndex",null,s),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(t){console.error(t)}}};function w(t,e){return e.state.glyphIndex===t||e.state.fina===t||e.state.medi===t||e.state.init===t}a("TextGeometry",(e,r,i)=>new t(e,r,i));var b={create:(t,e)=>new i(t,e)};o("TextGeometry",b),o("InputGeometry",b),n(class{constructor(t){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._layoutErrorWarned=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}update(t){this._isLoaded=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}async load(t){try{this._layoutErrorWarned=!1;let r=await async function(t){let r,i,n=!1;if(t.url?(r=await async function(t){let e;try{e=await fetch(t)}catch(e){throw new Error(`could not fetch the font at ${t}: ${e}`)}if(!e.ok)throw new Error(`${e.status} ${e.statusText} fetching the font at ${t}`);return await e.arrayBuffer()}(t.url),i=t.url,n=t.url.startsWith("/")):t.data&&(r=t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)),r){if(!e)return{font:void 0,url:i,intercepted:n,arr:r,bidi:null};{let t=await x.parse(r);if(t)return{font:t.font,url:i,intercepted:n,arr:r,bidi:t.bidi}}}}(t);r&&(this._arrayBuffer=r.arr,this._url=r.url,this.font=r.font,this._intercepted=r.intercepted,this._isLoaded=!0,this._bidi=r.bidi)}catch(e){console.warn(`Could not load the font "${t.url??"(inline data)"}"`,e)}}warnLayoutError(t){this._layoutErrorWarned||(this._layoutErrorWarned=!0,console.warn(`Text layout failed for the font "${this._url??"(inline data)"}"`,t))}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(t,e,r){if(!this._bidi)return[];let i=this._bidi;i.getTextGlyphs(e);let n=i.tokenizer.tokens,s=[],a=0,o=r.length===n.length;for(let i=0;i<r.length;i++){let h=r[i].index,l=String.fromCharCode(r[i].unicode),u=n[a];if(w(h,u)||o)s.push({char:l,index:h,replacements:[u.state.glyphIndex],replacementChars:[u.char]}),a++;else{let r=u.char,i="",n=[u.state.glyphIndex],o=[],c=!1;for(;!c;)a++,i=e.charAt(a),r+=i,n.push(t.charToGlyphIndex(i)),o=t.stringToGlyphs(r),1===o.length&&o[0].index===h&&(c=!0),a>e.length&&(c=!0);s.push({char:l,index:h,replacements:n,replacementChars:Array.from(r)}),a++}}return s}generateShapes(t,e,r){if(!this._isLoaded)return;let i=this.font,n=e.fontSize/this.unitsPerEm,s=e.fontSize*e.lineHeight,a=t.map(t=>this.getTextWidth(t,e)),o="string"==typeof e.width?Number(r.getVariable(e.width)):e.width,h="string"==typeof e.height?Number(r.getVariable(e.height)):e.height,l=this.getCharWidth("\n",e),u=1===e.horizontalAlign?l:0,c=this.getLineInitialOffsetX(a[0],o,e.horizontalAlign,t[0],l),f=this.getLineInitialOffsetY(s,t.length,h,n,e.verticalAlign),d=[],p=t.map(()=>[]),g=t.map(()=>[]);for(let h=0;h<t.length;h++){let y=t[h],m={features:{liga:!0},letterSpacing:e.letterSpacing},x=[];try{x=i.stringToGlyphs(y,m)}catch(t){this.warnLayoutError(t)}c=this.getLineInitialOffsetX(a[h],o,e.horizontalAlign,y,l);let w=[];try{w=this.reverseLigaturesTable(i,y,x)}catch(t){this.warnLayoutError(t)}let b=this.computeSpaceWidthForLine(t,h,e,r),P=0,S=x[0];S&&2===e.horizontalAlign&&void 0!==S.leftSideBearing&&(c-=S.leftSideBearing*n);try{this.font?.forEachGlyph(y,c,f,e.fontSize,m,(t,r,s,a,o)=>{let l=0===t.index?"\n":t.unicode?String.fromCharCode(t.unicode):void 0,c=w[P],f=0;if("\n"===l)f=u;else if(" "===l)f=b;else{let i=this.createPath(t,n,r,s,e);i&&(f=i.offsetX,d.push(i.path))}if(c&&1!==c.replacements.length){let t=c.replacements.map(t=>(i.glyphs.get(t).advanceWidth??0)*n),e=t.reduce((t,e)=>t+e,0),a=t.map(t=>t/e),o=r;for(let t=0;t<a.length;t++){let e=f*a[t];g[h].push([o,s]),p[h].push(e),o+=e}}else g[h].push([r,s]),p[h].push(f);P++})}catch(t){this.warnLayoutError(t)}f-=s}let y=[];for(let t=0,e=d.length;t<e;t++)y.push(...d[t].toShapes());return{shapes:y,charWidths:p,lineWidths:a,charCoords:g}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){return this.font?.ascender??0}get descender(){return this.font?.descender??0}get familyName(){return this.font?.names.fontFamily??""}get subfamilyName(){return this.font?.names.fontSubfamily??""}get unitsPerEm(){return this.font?.unitsPerEm??1}getLineInitialOffsetX(t,e,r,i,n){return(3===r||2===r)&&i.indexOf("\n")>=0&&(t-=n),3===r?.5*e-.5*t:2===r?e-t:0}getLineInitialOffsetY(t,e,r,i,n){let s=e*t,a=t-Math.abs(this.ascender-this.descender)*i,o=-this.ascender*i-a/2;return 3===n?-(r-s-o):2===n?-(.5*r-.5*s-o):o}createPath(t,e,r,i,n){let s=t.getPath(r,-i,n.fontSize,{kerning:!1,letterSpacing:n.letterSpacing});if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+this.familyName+".");let a=new m,o=(t.advanceWidth??1)*e;if(t)for(let t of s.commands){let e=a.currentPath?.currentPoint;if(!e||"Z"===t.type||e.x!==t.x||-e.y!==t.y)switch(t.type){case"M":a.moveTo(t.x,-t.y);break;case"L":a.lineTo(t.x,-t.y);break;case"Q":a.quadraticCurveTo(t.x1,-t.y1,t.x,-t.y);break;case"C":a.bezierCurveTo(t.x1,-t.y1,t.x2,-t.y2,t.x,-t.y)}}return a.subPaths.forEach(t=>{let e=function(t){if(t.length){let e=t[0];if(e instanceof u)return e.v1;if(e instanceof l||e instanceof c)return e.v0}}(t.curves);void 0!==e&&t.currentPoint.distanceTo(e)>0&&t.lineTo(e.x,e.y)}),{offsetX:o,path:a}}getCharWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}getTextWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}computeSpaceWidthForLine(t,e,r,i){let n=this.getCharWidth(" ",r),s=t[e];if(s){let a=this.countSpaces(s.trimEnd());if(4===r.horizontalAlign&&e<t.length-1&&a)return(("string"==typeof r.width?Number(i.getVariable(r.width)):r.width)-(this.getTextWidth(s,r)-a*n))/a}return n}countSpaces(t){return(t.match(/ /g)||[]).length}}),s("text");
1
+ import{a as t}from"./runtime-chunk-D373PZPG.js";import{a as e,b as r}from"./runtime-chunk-T53JMQSH.js";import{F as i,o as n}from"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as s,f as a,h as o}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import{Dc as h,Jd as l,Ld as u,Nd as c,Qd as f,Qe as d,Rd as p,Sd as g,Tc as y}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var m=class{constructor(){this.type="ShapePath",this.color=new y,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new f,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath?.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath?.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath?.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath?.splineThru(t),this}toShapes(){let t={loc:0,t:0};function e(e,i,n,s){let a=e.x,o=i.x,h=n.x,l=s.x,u=e.y,c=i.y,f=n.y,d=s.y,p=(l-h)*(u-f)-(d-f)*(a-h),g=(d-f)*(o-a)-(l-h)*(c-u),y=p/g,m=((o-a)*(u-f)-(c-u)*(a-h))/g;if(0===g&&0!==p||y<=0||y>=1||m<0||m>1)return null;if(0===p&&0===g){for(let h=0;h<2;h++){if(r(0===h?n:s,e,i),0===t.loc){let e=0===h?n:s;return{x:e.x,y:e.y,t:t.t}}if(2===t.loc)return{x:+(a+t.t*(o-a)).toPrecision(10),y:+(u+t.t*(c-u)).toPrecision(10),t:t.t}}return null}for(let a=0;a<2;a++)if(r(0===a?n:s,e,i),0===t.loc){let e=0===a?n:s;return{x:e.x,y:e.y,t:t.t}}return{x:+(a+y*(o-a)).toPrecision(10),y:+(u+y*(c-u)).toPrecision(10),t:y}}function r(e,r,i){let n,s=i.x-r.x,a=i.y-r.y,o=e.x-r.x,h=e.y-r.y,l=s*h-o*a;return e.x===r.x&&e.y===r.y?(t.loc=0,void(t.t=0)):e.x===i.x&&e.y===i.y?(t.loc=1,void(t.t=1)):void(l<-Number.EPSILON?t.loc=3:l>Number.EPSILON?t.loc=4:s*o<0||a*h<0?t.loc=5:Math.sqrt(s*s+a*a)<Math.sqrt(o*o+h*h)?t.loc=6:(n=0!==s?o/s:h/a,t.loc=2,t.t=n))}let i=0,n=999999999,s=-999999999,a=[];this.subPaths.forEach(t=>{let e=t.getPoints(),r=-999999999,o=999999999,l=-999999999,u=999999999;for(let t=0;t<e.length;t++){let i=e[t];i.y>r&&(r=i.y),i.y<o&&(o=i.y),i.x>l&&(l=i.x),i.x<u&&(u=i.x)}s<=l&&(s=l+1),n>=u&&(n=u-1),e.length&&a.push({curves:t.curves,points:e,isCW:g.isClockWise(e),identifier:i++,boundingBox:new d(new h(u,o),new h(l,r))})});let o=a.map(t=>function(t,r,i,n,s){(null==s||""===s)&&(s="nonzero");let a=new h;t.boundingBox.getCenter(a);let o=function(t,r,i){let n=new h;r.getCenter(n);let s=[];return i.forEach(r=>{r.boundingBox.containsPoint(n)&&function(t,r){let i=[],n=[];for(let s=1;s<t.length;s++){let a=t[s-1],o=t[s];for(let t=1;t<r.length;t++){let s=e(a,o,r[t-1],r[t]);null!==s&&void 0===i.find(t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON)&&(i.push(s),n.push(new h(s.x,s.y)))}}return n}(t,r.points).forEach(t=>{s.push({identifier:r.identifier,isCW:r.isCW,point:t})})}),s.sort((t,e)=>t.point.x-e.point.x),s}([new h(i,a.y),new h(n,a.y)],t.boundingBox,r);o.sort((t,e)=>t.point.x-e.point.x);let l=[],u=[];o.forEach(e=>{e.identifier===t.identifier?l.push(e):u.push(e)});let c=l[0].point.x,f=[],d=0;for(;d<u.length&&u[d].point.x<c;)f.length>0&&f[f.length-1]===u[d].identifier?f.pop():f.push(u[d].identifier),d++;if(f.push(t.identifier),"evenodd"===s){let e=f.length%2==0,r=f[f.length-2];return{identifier:t.identifier,isHole:e,for:r}}if("nonzero"===s){let e=!0,i=null,n=null;for(let t=0;t<f.length;t++){let s=f[t];r[s]&&(e?(n=r[s].isCW,e=!1,i=s):n!==r[s].isCW&&(n=r[s].isCW,e=!0))}return{identifier:t.identifier,isHole:e,for:i}}console.warn('fill-rule: "'+s+'" is currently not implemented.')}(t,a,n,s,this.userData?.style.fillRule)),l=[];return a.forEach(t=>{let e=o[t.identifier];if(e&&!e.isHole){let e=new p;e.curves=t.curves,o.filter(e=>e?.isHole&&e.for===t.identifier).forEach(t=>{if(t){let r=a[t.identifier],i=new f;i.curves=r.curves,e.holes.push(i)}}),l.push(e)}}),l}},x=new class{async load(t,e,i=()=>{}){let{load:n}=await r;n(t,(t,r)=>{t||!r?i(t??"Something went wrong"):e(r)})}async parse(t){let{parse:e,Bidi:i}=await r;try{let r=e(t),n=new i,s=t=>r.charToGlyphIndex(t.char);return n.registerModifier("glyphIndex",null,s),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(t){console.error(t)}}};function w(t,e){return e.state.glyphIndex===t||e.state.fina===t||e.state.medi===t||e.state.init===t}a("TextGeometry",(e,r,i)=>new t(e,r,i));var P={create:(t,e)=>new i(t,e)};o("TextGeometry",P),o("InputGeometry",P),n(class{constructor(t){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._layoutErrorWarned=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}update(t){this._isLoaded=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}async load(t){try{this._layoutErrorWarned=!1;let r=await async function(t){let r,i,n=!1;if(t.url?(r=await async function(t){let e;try{e=await fetch(t)}catch(e){throw new Error(`could not fetch the font at ${t}: ${e}`)}if(!e.ok)throw new Error(`${e.status} ${e.statusText} fetching the font at ${t}`);return await e.arrayBuffer()}(t.url),i=t.url,n=t.url.startsWith("/")):t.data&&(r=t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)),r){if(!e)return{font:void 0,url:i,intercepted:n,arr:r,bidi:null};{let t=await x.parse(r);if(t)return{font:t.font,url:i,intercepted:n,arr:r,bidi:t.bidi}}}}(t);r&&(this._arrayBuffer=r.arr,this._url=r.url,this.font=r.font,this._intercepted=r.intercepted,this._isLoaded=!0,this._bidi=r.bidi)}catch(e){console.warn(`Could not load the font "${t.url??"(inline data)"}"`,e)}}warnLayoutError(t){this._layoutErrorWarned||(this._layoutErrorWarned=!0,console.warn(`Text layout failed for the font "${this._url??"(inline data)"}"`,t))}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(t,e,r){if(!this._bidi)return[];let i=this._bidi;i.getTextGlyphs(e);let n=i.tokenizer.tokens,s=[],a=0,o=r.length===n.length;for(let i=0;i<r.length;i++){let h=r[i].index,l=String.fromCharCode(r[i].unicode),u=n[a];if(w(h,u)||o)s.push({char:l,index:h,replacements:[u.state.glyphIndex],replacementChars:[u.char]}),a++;else{let r=u.char,i="",n=[u.state.glyphIndex],o=[],c=!1;for(;!c;)a++,i=e.charAt(a),r+=i,n.push(t.charToGlyphIndex(i)),o=t.stringToGlyphs(r),1===o.length&&o[0].index===h&&(c=!0),a>e.length&&(c=!0);s.push({char:l,index:h,replacements:n,replacementChars:Array.from(r)}),a++}}return s}generateShapes(t,e,r){if(!this._isLoaded)return;let i=this.font,n=e.fontSize/this.unitsPerEm,s=e.fontSize*e.lineHeight,a=t.map(t=>this.getTextWidth(t,e)),o="string"==typeof e.width?Number(r.getVariable(e.width)):e.width,h="string"==typeof e.height?Number(r.getVariable(e.height)):e.height,l=this.getCharWidth("\n",e),u=1===e.horizontalAlign?l:0,c=this.getLineInitialOffsetX(a[0],o,e.horizontalAlign,t[0],l),f=this.getLineInitialOffsetY(s,t.length,h,n,e.verticalAlign),d=[],p=t.map(()=>[]),g=t.map(()=>[]);for(let h=0;h<t.length;h++){let y=t[h],m={features:{liga:!0},letterSpacing:e.letterSpacing},x=[];try{x=i.stringToGlyphs(y,m)}catch(t){this.warnLayoutError(t)}c=this.getLineInitialOffsetX(a[h],o,e.horizontalAlign,y,l);let w=[];try{w=this.reverseLigaturesTable(i,y,x)}catch(t){this.warnLayoutError(t)}let P=this.computeSpaceWidthForLine(t,h,e,r),b=0,v=x[0];v&&2===e.horizontalAlign&&void 0!==v.leftSideBearing&&(c-=v.leftSideBearing*n);try{this.font?.forEachGlyph(y,c,f,e.fontSize,m,(t,r,s,a,o)=>{let l=0===t.index?"\n":t.unicode?String.fromCharCode(t.unicode):void 0,c=w[b],f=0;if("\n"===l)f=u;else if(" "===l)f=P;else{let i=this.createPath(t,n,r,s,e);i&&(f=i.offsetX,d.push(i.path))}if(c&&1!==c.replacements.length){let t=c.replacements.map(t=>(i.glyphs.get(t).advanceWidth??0)*n),e=t.reduce((t,e)=>t+e,0),a=t.map(t=>t/e),o=r;for(let t=0;t<a.length;t++){let e=f*a[t];g[h].push([o,s]),p[h].push(e),o+=e}}else g[h].push([r,s]),p[h].push(f);b++})}catch(t){this.warnLayoutError(t)}f-=s}let y=[];for(let t=0,e=d.length;t<e;t++)y.push(...d[t].toShapes());return{shapes:y,charWidths:p,lineWidths:a,charCoords:g}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){return this.font?.ascender??0}get descender(){return this.font?.descender??0}get familyName(){return this.font?.names.fontFamily??""}get subfamilyName(){return this.font?.names.fontSubfamily??""}get unitsPerEm(){return this.font?.unitsPerEm??1}getLineInitialOffsetX(t,e,r,i,n){return(3===r||2===r)&&i.indexOf("\n")>=0&&(t-=n),3===r?.5*e-.5*t:2===r?e-t:0}getLineInitialOffsetY(t,e,r,i,n){let s=e*t,a=t-Math.abs(this.ascender-this.descender)*i,o=-this.ascender*i-a/2;return 3===n?-(r-s-o):2===n?-(.5*r-.5*s-o):o}createPath(t,e,r,i,n){let s=t.getPath(r,-i,n.fontSize,{kerning:!1,letterSpacing:n.letterSpacing});if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+this.familyName+".");let a=new m,o=(t.advanceWidth??1)*e;if(t)for(let t of s.commands){let e=a.currentPath?.currentPoint;if(!e||"Z"===t.type||e.x!==t.x||-e.y!==t.y)switch(t.type){case"M":a.moveTo(t.x,-t.y);break;case"L":a.lineTo(t.x,-t.y);break;case"Q":a.quadraticCurveTo(t.x1,-t.y1,t.x,-t.y);break;case"C":a.bezierCurveTo(t.x1,-t.y1,t.x2,-t.y2,t.x,-t.y)}}return a.subPaths.forEach(t=>{let e=function(t){if(t.length){let e=t[0];if(e instanceof u)return e.v1;if(e instanceof l||e instanceof c)return e.v0}}(t.curves);void 0!==e&&t.currentPoint.distanceTo(e)>0&&t.lineTo(e.x,e.y)}),{offsetX:o,path:a}}getCharWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}getTextWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}computeSpaceWidthForLine(t,e,r,i){let n=this.getCharWidth(" ",r),s=t[e];if(s){let a=this.countSpaces(s.trimEnd());if(4===r.horizontalAlign&&e<t.length-1&&a)return(("string"==typeof r.width?Number(i.getVariable(r.width)):r.width)-(this.getTextWidth(s,r)-a*n))/a}return n}countSpaces(t){return(t.match(/ /g)||[]).length}}),s("text");
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-WS3W6I75.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ga as h}from"./runtime-chunk-K3UQCG3P.js";import{Dc as l,Fc as p,Gc as u,Sc as d,Vc as c,Vd as g,bd as m,dd as x,kd as v,l as y,ld as I,rd as M}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new I(new g(1,1),new v({transparent:!0,opacity:0,side:y})),this.add(this.caretMesh),this.selectionMesh=new I(new g(1,1),new v({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:y})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.multiplyMatrices(e.matrixWorld,t.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.multiplyMatrices(t.hiddenMatrix,t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,x="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*x,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new x;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,v="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*v,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,T=new p,S=new u,L=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new M,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(S.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(S).normalize(),this.virtualInput.localToWorld(T.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,T))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},A=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return A(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=A(t.value,e.variables))}else s=i.textValue.toString();return s}var H=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new L(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new H(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
1
+ import{a as t}from"./runtime-chunk-D373PZPG.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ga as h}from"./runtime-chunk-K3UQCG3P.js";import{Dc as l,Fc as p,Gc as u,Sc as d,Vc as c,Vd as g,bd as m,dd as x,kd as v,l as y,ld as I,rd as M}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new I(new g(1,1),new v({transparent:!0,opacity:0,side:y})),this.add(this.caretMesh),this.selectionMesh=new I(new g(1,1),new v({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:y})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.multiplyMatrices(e.matrixWorld,t.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.multiplyMatrices(t.hiddenMatrix,t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,x="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*x,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new x;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,v="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*v,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,T=new p,S=new u,L=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new M,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(S.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(S).normalize(),this.virtualInput.localToWorld(T.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,T))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},A=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return A(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=A(t.value,e.variables))}else s=i.textValue.toString();return s}var P=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new L(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new P(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
@@ -1 +1 @@
1
- import{a as e,c as t,d as i,e as a,f as n,g as s,j as r}from"./runtime-chunk-BKTNVUN3.js";import"./runtime-chunk-7L46WKPR.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-HD7WF3XN.js";import{a as o}from"./runtime-chunk-6UKGQUL5.js";import{a as l}from"./runtime-chunk-GGSUJEGZ.js";import{a as h,b as c}from"./runtime-chunk-FLYEGFUP.js";import"./runtime-chunk-WQ5L4XSQ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as d}from"./runtime-chunk-4YSIMIIS.js";import"./runtime-chunk-BSJNKHDI.js";import"./runtime-chunk-KWEZUCEY.js";import"./runtime-chunk-UTXZTSXZ.js";import{aa as u,ga as p,ia as f}from"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as m,e as y}from"./runtime-chunk-M6FFVLT6.js";import{v as g}from"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import{d as v}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as k}from"./runtime-chunk-TZCHGFVF.js";import{A as x,B as D,D as T,E as j,Ea as E,Ja as b,Ka as C,La as O,la as I,p as w,ua as A,z as M}from"./runtime-chunk-K3UQCG3P.js";import{Bc as F,Cc as S}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var N=Math.fround;function U(e){return"pingpong"===e||"pingpong-rewind"===e}var _=class{constructor(e){this.config=e,this.effectiveCycleDuration=this.cycleDuration(0)}layout(e){let{config:t}=this;if(U(t.direction)&&e%2==1)return{startDelay:0,endDelay:0};switch(t.delayDirection){case"start-once":return 0===e?{startDelay:t.delay,endDelay:0}:{startDelay:0,endDelay:0};case"start":return{startDelay:t.delay,endDelay:0};case"end":return{startDelay:0,endDelay:t.delay};default:return{startDelay:t.delay,endDelay:t.delay}}}cycleDuration(e){let{config:t}=this,{startDelay:i,endDelay:a}=this.layout(e);return N(t.duration+i+a)}get totalDuration(){let{config:e}=this;if(-1===e.repeat)return 1/0;let t=0;for(let i=0;i<=e.repeat;i++)t=N(t+this.cycleDuration(i));return t}isFinished(e){return e>=this.totalDuration}resolve(e){let t,i,{config:a}=this,n=N(e);if("start-once"===a.delayDirection){let e=N(a.delay+a.duration);if(n<e)t=0,i=n;else{let s=N(n-e);t=1+Math.floor(N(s/a.duration)),i=N(s%a.duration)}}else if(U(a.direction)){let e=this.cycleDuration(0),s=N(e+a.duration),r=Math.floor(N(n/s)),o=N(n%s);o<e?(t=2*r,i=o):(t=2*r+1,i=N(o-e))}else{let e=this.cycleDuration(0);t=Math.floor(N(n/e)),i=N(n%e)}if(-1!==a.repeat&&t>=a.repeat+1)return null;let s,{startDelay:r}=this.layout(t),o=U(a.direction)&&t%2==1,l=r,h=N(l+a.duration);if(i<l)s=o?a.duration:0;else if(i>=h)s=o?0:a.duration;else{let e=N(i-l);s=o?N(a.duration-e):e}return{cycleIndex:t,localTime:s,isReverse:o}}},B=Math.fround;function L(e){return[...e].sort((e,t)=>e.time-t.time)}function G(e){return{easing:e.type,control1:b(e.cubicControls?.control1,[0,0]),control2:b(e.cubicControls?.control2,[1,1]),...e.springParameters}}function P(e,t){let i=[];for(let a of e??[]){let e=t(a.data);void 0!==e&&i.push({time:a.data.time,ease:G(a.data.easing),value:e})}return{keyframes:L(i)}}function z(t,i){if(0===t.keyframes.length)return;let{index0:a,index1:n,t:s}=function(t,i){if(0===t.length)throw new Error("sampleKeyframes requires at least one keyframe");if(i<=t[0].time)return{index0:0,index1:0,t:1};let{found:a,index:n}=function(e,t){let i=e.length,a=0,n=i;for(;a<n;){let s=a+Math.floor(i/2),r=e[s].time;if(r<t)a=s+1;else{if(!(r>t))return{found:!0,index:s};n=s}i=n-a}return{found:!1,index:a}}(t,i);if(a)return{index0:n,index1:n,t:1};if(n>=t.length){let e=t.length-1;return{index0:e,index1:e,t:1}}let s=n-1,r=n,o=t[s].time,l=t[r].time;if(l===o)return{index0:s,index1:r,t:.5};let h=B(l-o),c={...t[s].ease,control2:t[r].ease.control2};return{index0:s,index1:r,t:e(c,h,B(B(i-o)/h))}}(t.keyframes,i),r=t.read;if(r&&r.index0===a&&r.index1===n&&r.t===s)return;let o={index0:a,index1:n,from:t.keyframes[a].value,to:t.keyframes[n].value,t:s};return t.read=o,o}function K(e){e.read=void 0}function V(e,t,i){return e+(t-e)*i}function R(e,t,i){!e||(e[t]={...e[t],...i})}function W(e,s,r,l,u,p,m){let y=()=>{m.transform=!0,m.bounds=!0,m.boolean=!0,m.render=!0};switch(e.on){case"position":case"scale":{let t=z(e.track,r);if(!t)return;let i=V(t.from,t.to,t.t);return s[e.on][e.axis]=i,R(p,e.on,{[e.axis]:i}),void y()}case"rotation":{let t=z(e.track,r);if(!t)return;let i=V(t.from,t.to,t.t);return s.rotation[e.axis]=i*S.DEG2RAD,R(p,"rotation",{[e.axis]:i}),void y()}case"shapeSize":{let t=z(e.track,r);if(!(t&&s instanceof f))return;let i=V(t.from,t.to,t.t);return s.userData.value={...s.userData.value,[e.axis]:i},R(p,"shapeSize",{[e.axis]:i}),m.size=!0,m.bounds=!0,m.boolean=!0,void(m.render=!0)}case"opacity":{let t=z(e.track,r);if(!t||!(s instanceof g)||Array.isArray(s.material))return;let i=s.material.getLayersOfType("light")[0];if(void 0===i)return;let a=S.lerp(t.from,t.to,t.t);return s.material.transparent=!0,n("alphaOverride",i,{alphaOverride:a},{alphaOverride:a+1},0,l.shared),p&&(p.opacity=a),void(m.render=!0)}case"material":{let t=z(e.track,r);if(!t||0===Object.keys(t.from).length||0===Object.keys(t.to).length)return;let{layer:i}=e,a={};for(let e in i.data){if(!(e in t.from)||!(e in t.to))continue;let r=X(t.from[e],t.to[e],t.t,u);if(void 0===r)continue;a[e]=r;let o=i.getValue(e);void 0!==o&&("alpha"===e&&"number"==typeof o&&o>0&&s instanceof g&&!Array.isArray(s.material)&&(s.material.transparent=!0),n(e,i,t.from,t.to,t.t,l.shared))}return R(p,"material",{[i.uuid]:a}),void(m.render=!0)}case"light":{let t=z(e.track,r);if(!t||!(s instanceof h||s instanceof o||s instanceof c))return;let i=X(t.from,t.to,t.t,u);return s[e.field]=i,R(p,"light",{[e.field]:i}),void(m.render=!0)}case"camera":{let t=z(e.track,r);if(!(t&&s instanceof d))return;let i=V(t.from,t.to,t.t);return s[e.field]=i,void R(p,"camera",{[e.field]:i})}case"cloner":{let t=z(e.track,r);if(!t)return;let n=s.cloner?.parameters,o=i(n,t.from,t.to,t.t);return a(n,o),R(p,"cloner",o),m.cloner=!0,m.boolean=!0,void(m.render=!0)}case"pathExtrusion":{let i=z(e.track,r);if(!i||!v(s))return;let a=t(I,i.from,i.to,i.t),n=s.geometry.userData.parameters;return n.extrusion={...n.extrusion,...a},R(p,"pathExtrusion",a),s.updateGeometryInteractions({extrusion:{...n.extrusion}},l.shared),m.bounds=!0,m.boolean=!0,void(m.render=!0)}case"pathSnapping":{let i=z(e.track,r);if(!i)return;let a=s,n=t(A,i.from,i.to,i.t);return a.userData.pathSnapping={...a.userData.pathSnapping,...n},R(p,"pathSnapping",n),a.updatePathSnapping(a.userData.pathSnapping),void(m.render=!0)}}}function X(e,t,i,a){if("string"==typeof e&&a&&(e=a.color(e)),"string"==typeof t&&a&&(t=a.color(t)),"number"==typeof e)return S.lerp(e,t,i);if(j.is(e))return j.lerp(e,t,i);if(T.is(e))return T.lerp(e,t,i);if(Array.isArray(e))return(e.length>t.length?t:e).map((a,n)=>{if(Array.isArray(a)){let a=e[n].length>t[n].length?t[n].length:e[n].length;return(4===a?D:3===a?x:M).lerp(e[n],t[n],i)}return S.lerp(e[n],t[n],i)});if("object"==typeof e&&null!==e){let n={};for(let s in e){let r=X(e[s],t[s],i,a);void 0!==r&&(n[s]=r)}return n}}var Z=new Map,Q=new Map,H=class extends F{constructor(e,t,i,a,n,s,r){super(),this.id=e,this.data=t,this.scene=i,this.sharedAssets=a,this.object=n,this.eventType=s,this.actionCondition=r,this.evaluators=[],this.elapsed=0,this.lastTime=null,this.direction=1,this._playing=!1,this._finished=!1,this.hasPlayedOnce=!1,this.pauseOnNextCycleEnd=!1,this.lastCycleIndex=0;try{let e=E.findTimeline(this.scene.data.objects,this.data.timeline),t=e.duration;this.animatedObjectIds=Object.keys(e.objectTimelines),this.animatedObjectIds.forEach(n=>{let s=this.scene.find(n);if(!s)return;let r=e.objectTimelines[n];!r||this.evaluators.push(function(e,t,i,a,n){let s=function(e,t){let i=[];return C.groupKeyframes(t.keyframes).forEach(t=>{let a=t.path?.[0],n=t.path[1],s=()=>P(t.keyframes,e=>e.value);switch(a){case"position":case"rotation":case"scale":return void(n&&O.includes(n)&&i.push({on:a,axis:n,track:s()}));case"shape size":return void(n&&O.includes(n)&&"geometry"in e&&i.push({on:"shapeSize",axis:n,track:s()}));case"path extrusion":return void(v(e)&&i.push({on:"pathExtrusion",track:P(t.keyframes,e=>e.value)}));case"path snapping":return void(e.data.pathSnapping&&i.push({on:"pathSnapping",track:P(t.keyframes,e=>e.value)}));case"material":return void("Mesh"===e.type&&"material"in e&&function(e,t){let i=p(e.material)?e.material:void 0,a=t.layerId;if(!i||!a)return[];let n=t.keyframes.some(e=>u(e.data.value?.noiseStrength)),s=i.ensureRainbowNoiseCompiled,r=e=>{n&&"function"==typeof s&&s.call(i,e)},o=e=>"data"in e?[{on:"material",layer:e,track:P(t.keyframes,e=>e.value)}]:[];r(a);let l=i.getLayerByUuid(a);if(l)return o(l);let h=t.path[1];for(let e of i.getLayersOfType(h))r(e.uuid);return(i.getLayersOfType(h)??[]).flatMap(o)}(e,t).forEach(e=>i.push(e)));case"opacity":return void("Mesh"===e.type&&"material"in e&&i.push({on:"opacity",track:s()}));case"cloner":return void i.push({on:"cloner",track:P(t.keyframes,e=>e.value)});case"camera":return void(e instanceof d&&i.push({on:"camera",field:"zoom",track:s()}));case"light":return void((e instanceof h||e instanceof o||e instanceof c)&&i.push({on:"light",field:t.path[1],track:P(t.keyframes,e=>e.value)}))}}),i}(e,t);return{duration:i,evaluate(t,i){e.resetBBoxNeedsUpdate();let r={transform:!1,size:!1,cloner:!1,bounds:!1,boolean:!1,render:!1};for(let o of s)W(o,e,t,a,n,i,r);!function(e,t,i){if(t.size&&e instanceof f){let{x:t,y:a,z:n}=e.userData.value;e.updateGeometryInteractions({width:t,height:a,depth:n},i.shared)}t.cloner&&e.cloner?.update(i),t.transform&&e.updateMatrix(),t.bounds&&e.resetBBoxNeedsUpdate(),t.boolean&&e instanceof f&&e.invalidateDownstreamBooleanData(),t.render&&e.dispatchEvent({type:"requestRender"})}(e,r,a)},invalidate(){for(let e of s)K(e.track)}}}(s,{...r},t,{scene:i,shared:a},this.sharedAssets))}),this.schedule=new _((l=this.data,{duration:t,delay:N(l.delay/1e3),delayDirection:l.delayDirection??"start-end",direction:l.direction??"normal",repeat:l.repeat}))}catch(e){throw new Error("Missing property")}var l;n&&(Q.has(n.uuid)?Q.get(n.uuid).push(this):Q.set(n.uuid,[this])),Z.set(e,this)}get playing(){return this._playing}get finished(){return this._finished}get paused(){return!this._playing}update(e){null!==this.lastTime&&(this.elapsed=Math.max(0,this.elapsed+(e-this.lastTime)*this.direction)),this.lastTime=e,this.applyAtElapsed()}applyAtElapsed(){if(-1===this.direction&&0===this.elapsed)return void this.pause();let e=this.schedule.resolve(this.elapsed);if(e){if(e.cycleIndex!==this.lastCycleIndex&&(this.lastCycleIndex=e.cycleIndex,this.pauseOnNextCycleEnd))return this.pauseOnNextCycleEnd=!1,void this.pause();for(let t of this.evaluators)t.evaluate(e.localTime)}else 1===this.direction&&this.schedule.isFinished(this.elapsed)&&this.finish()}finish(){this.pause(),this._finished=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof d&&t.dispatchEvent(r)})}startTicking(){this._playing=!0,this.lastTime=null;for(let e of this.evaluators)e.invalidate();l.add(this)}play(){let e=void 0!==this.eventType&&w(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.elapsed>0&&!this._finished;if(void 0!==this.eventType&&w(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!e||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof d&&t.dispatchEvent(s)}),!e&&(0===this.elapsed||this._finished)&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.startTicking()}pause(){this._playing=!1,this.lastTime=null,l.remove(this)}stop(){this.pause(),this.elapsed=0,this.lastCycleIndex=0,this.applyAtElapsed(),this._finished=!1}seek(e){let t=this.schedule.totalDuration;this.elapsed=e*(Number.isFinite(t)?t:this.schedule.effectiveCycleDuration);for(let e of this.evaluators)e.invalidate();this.applyAtElapsed()}toggle(e){let t=e??-1===this.direction;this._playing&&this.direction===(t?1:-1)?t&&(this.pauseOnNextCycleEnd=!1):(t?(this._finished&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.pauseOnNextCycleEnd=!1):(this.direction=this.schedule.resolve(this.elapsed)?.isReverse?1:-1,this.pauseOnNextCycleEnd=!0),this.startTicking())}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}},J=class{constructor(e){this.data=e}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(e){let t=this.getTimelineActions(e);!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>{e[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):t.forEach(e=>{e[this.data.interaction]()}))}getTimelineActions(e){let t=Z.get(e);return t?[t]:[...Z.values()].filter(t=>t.data.timeline===e)}pauseAllTimelinesFromObject(e){let t=Q.get(e);!t?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>e[this.data.interaction]()),this.disposeDelay()},this.data.delay)):t.forEach(e=>e[this.data.interaction]()))}pauseAllTimelines(){let e=[...Q.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},Y=class{constructor(e,t,i,a,n,s,r){this.data=t;let o="interaction"in t?t.interaction:"play";if("play"===o||void 0===o)this.interaction=new H(e,t,i,a,n,s,r);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new J(t)}}get playing(){return this.interaction instanceof H&&this.interaction.playing}get finished(){return!(this.interaction instanceof H)||this.interaction.finished}get paused(){return!(this.interaction instanceof H)||this.interaction.paused}play(){if(this.interaction instanceof H)return this.interaction.play();this.interaction.dispatch()}stop(){this.interaction instanceof H&&this.interaction.stop()}seek(e){this.interaction instanceof H&&this.interaction.seek(e)}toggle(e){this.interaction instanceof H?this.interaction.toggle(e):this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof H?this.interaction.playFromCurrent():this.interaction.dispatch()}dispatchConditional(){this.interaction instanceof H?y(this.interaction.sharedAssets,this.interaction.actionCondition)&&this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof H&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};m("TimelineAnimation",({id:e,data:t,page:i,shared:a,object:n,eventType:s,actionCondition:r})=>new Y(e,t,i.scene,a,n,s,r)),k("timeline");
1
+ import{a as e,c as t,d as i,e as a,f as n,g as s,j as r}from"./runtime-chunk-2GPGYGR2.js";import"./runtime-chunk-I6CPIGMQ.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-HD7WF3XN.js";import{a as o}from"./runtime-chunk-LGRD54SI.js";import{a as l}from"./runtime-chunk-GGSUJEGZ.js";import{a as h,b as c}from"./runtime-chunk-LYYY4YGG.js";import"./runtime-chunk-DUQ2PW7L.js";import"./runtime-chunk-FTVQTRM7.js";import{a as d}from"./runtime-chunk-JVQBFLYF.js";import"./runtime-chunk-BJXRV54U.js";import"./runtime-chunk-564IIVBV.js";import"./runtime-chunk-JAELIJQZ.js";import{aa as u,ga as p,ia as f}from"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as m,e as y}from"./runtime-chunk-L6ERXCVI.js";import{v as g}from"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import{d as v}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as k}from"./runtime-chunk-TZCHGFVF.js";import{A as x,B as D,D as T,E as j,Ea as E,Ja as b,Ka as C,La as I,la as O,p as A,ua as w,z as M}from"./runtime-chunk-K3UQCG3P.js";import{Bc as F,Cc as S}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var B=Math.fround;function G(e){return"pingpong"===e||"pingpong-rewind"===e}var _=class{constructor(e){this.config=e,this.effectiveCycleDuration=this.cycleDuration(0)}layout(e){let{config:t}=this;if(G(t.direction)&&e%2==1)return{startDelay:0,endDelay:0};switch(t.delayDirection){case"start-once":return 0===e?{startDelay:t.delay,endDelay:0}:{startDelay:0,endDelay:0};case"start":return{startDelay:t.delay,endDelay:0};case"end":return{startDelay:0,endDelay:t.delay};default:return{startDelay:t.delay,endDelay:t.delay}}}cycleDuration(e){let{config:t}=this,{startDelay:i,endDelay:a}=this.layout(e);return B(t.duration+i+a)}get totalDuration(){let{config:e}=this;if(-1===e.repeat)return 1/0;let t=0;for(let i=0;i<=e.repeat;i++)t=B(t+this.cycleDuration(i));return t}isFinished(e){return e>=this.totalDuration}resolve(e){let t,i,{config:a}=this,n=B(e);if("start-once"===a.delayDirection){let e=B(a.delay+a.duration);if(n<e)t=0,i=n;else{let s=B(n-e);t=1+Math.floor(B(s/a.duration)),i=B(s%a.duration)}}else if(G(a.direction)){let e=this.cycleDuration(0),s=B(e+a.duration),r=Math.floor(B(n/s)),o=B(n%s);o<e?(t=2*r,i=o):(t=2*r+1,i=B(o-e))}else{let e=this.cycleDuration(0);t=Math.floor(B(n/e)),i=B(n%e)}if(-1!==a.repeat&&t>=a.repeat+1)return null;let s,{startDelay:r}=this.layout(t),o=G(a.direction)&&t%2==1,l=r,h=B(l+a.duration);if(i<l)s=o?a.duration:0;else if(i>=h)s=o?0:a.duration;else{let e=B(i-l);s=o?B(a.duration-e):e}return{cycleIndex:t,localTime:s,isReverse:o}}},L=Math.fround;function N(e){return[...e].sort((e,t)=>e.time-t.time)}function P(e){return{easing:e.type,control1:b(e.cubicControls?.control1,[0,0]),control2:b(e.cubicControls?.control2,[1,1]),...e.springParameters}}function V(e,t){let i=[];for(let a of e??[]){let e=t(a.data);void 0!==e&&i.push({time:a.data.time,ease:P(a.data.easing),value:e})}return{keyframes:N(i)}}function U(t,i){if(0===t.keyframes.length)return;let{index0:a,index1:n,t:s}=function(t,i){if(0===t.length)throw new Error("sampleKeyframes requires at least one keyframe");if(i<=t[0].time)return{index0:0,index1:0,t:1};let{found:a,index:n}=function(e,t){let i=e.length,a=0,n=i;for(;a<n;){let s=a+Math.floor(i/2),r=e[s].time;if(r<t)a=s+1;else{if(!(r>t))return{found:!0,index:s};n=s}i=n-a}return{found:!1,index:a}}(t,i);if(a)return{index0:n,index1:n,t:1};if(n>=t.length){let e=t.length-1;return{index0:e,index1:e,t:1}}let s=n-1,r=n,o=t[s].time,l=t[r].time;if(l===o)return{index0:s,index1:r,t:.5};let h=L(l-o),c={...t[s].ease,control2:t[r].ease.control2};return{index0:s,index1:r,t:e(c,h,L(L(i-o)/h))}}(t.keyframes,i),r=t.read;if(r&&r.index0===a&&r.index1===n&&r.t===s)return;let o={index0:a,index1:n,from:t.keyframes[a].value,to:t.keyframes[n].value,t:s};return t.read=o,o}function R(e){e.read=void 0}function z(e,t,i){return e+(t-e)*i}function J(e,t,i){!e||(e[t]={...e[t],...i})}function Q(e,s,r,l,u,p,m){let y=()=>{m.transform=!0,m.bounds=!0,m.boolean=!0,m.render=!0};switch(e.on){case"position":case"scale":{let t=U(e.track,r);if(!t)return;let i=z(t.from,t.to,t.t);return s[e.on][e.axis]=i,J(p,e.on,{[e.axis]:i}),void y()}case"rotation":{let t=U(e.track,r);if(!t)return;let i=z(t.from,t.to,t.t);return s.rotation[e.axis]=i*S.DEG2RAD,J(p,"rotation",{[e.axis]:i}),void y()}case"shapeSize":{let t=U(e.track,r);if(!(t&&s instanceof f))return;let i=z(t.from,t.to,t.t);return s.userData.value={...s.userData.value,[e.axis]:i},J(p,"shapeSize",{[e.axis]:i}),m.size=!0,m.bounds=!0,m.boolean=!0,void(m.render=!0)}case"opacity":{let t=U(e.track,r);if(!t||!(s instanceof g)||Array.isArray(s.material))return;let i=s.material.getLayersOfType("light")[0];if(void 0===i)return;let a=S.lerp(t.from,t.to,t.t);return s.material.transparent=!0,n("alphaOverride",i,{alphaOverride:a},{alphaOverride:a+1},0,l.shared),p&&(p.opacity=a),void(m.render=!0)}case"material":{let t=U(e.track,r);if(!t||0===Object.keys(t.from).length||0===Object.keys(t.to).length)return;let{layer:i}=e,a={};for(let e in i.data){if(!(e in t.from)||!(e in t.to))continue;let r=Y(t.from[e],t.to[e],t.t,u);if(void 0===r)continue;a[e]=r;let o=i.getValue(e);void 0!==o&&("alpha"===e&&"number"==typeof o&&o>0&&s instanceof g&&!Array.isArray(s.material)&&(s.material.transparent=!0),n(e,i,t.from,t.to,t.t,l.shared))}return J(p,"material",{[i.uuid]:a}),void(m.render=!0)}case"light":{let t=U(e.track,r);if(!t||!(s instanceof h||s instanceof o||s instanceof c))return;let i=Y(t.from,t.to,t.t,u);return s[e.field]=i,J(p,"light",{[e.field]:i}),void(m.render=!0)}case"camera":{let t=U(e.track,r);if(!(t&&s instanceof d))return;let i=z(t.from,t.to,t.t);return s[e.field]=i,void J(p,"camera",{[e.field]:i})}case"cloner":{let t=U(e.track,r);if(!t)return;let n=s.cloner?.parameters,o=i(n,t.from,t.to,t.t);return a(n,o),J(p,"cloner",o),m.cloner=!0,m.boolean=!0,void(m.render=!0)}case"pathExtrusion":{let i=U(e.track,r);if(!i||!v(s))return;let a=t(O,i.from,i.to,i.t),n=s.geometry.userData.parameters;return n.extrusion={...n.extrusion,...a},J(p,"pathExtrusion",a),s.updateGeometryInteractions({extrusion:{...n.extrusion}},l.shared),m.bounds=!0,m.boolean=!0,void(m.render=!0)}case"pathSnapping":{let i=U(e.track,r);if(!i)return;let a=s,n=t(w,i.from,i.to,i.t);return a.userData.pathSnapping={...a.userData.pathSnapping,...n},J(p,"pathSnapping",n),a.updatePathSnapping(a.userData.pathSnapping),void(m.render=!0)}}}function Y(e,t,i,a){if("string"==typeof e&&a&&(e=a.color(e)),"string"==typeof t&&a&&(t=a.color(t)),"number"==typeof e)return S.lerp(e,t,i);if(j.is(e))return j.lerp(e,t,i);if(T.is(e))return T.lerp(e,t,i);if(Array.isArray(e))return(e.length>t.length?t:e).map((a,n)=>{if(Array.isArray(a)){let a=e[n].length>t[n].length?t[n].length:e[n].length;return(4===a?D:3===a?x:M).lerp(e[n],t[n],i)}return S.lerp(e[n],t[n],i)});if("object"==typeof e&&null!==e){let n={};for(let s in e){let r=Y(e[s],t[s],i,a);void 0!==r&&(n[s]=r)}return n}}var K=new Map,X=new Map,W=class extends F{constructor(e,t,i,a,n,s,r){super(),this.id=e,this.data=t,this.scene=i,this.sharedAssets=a,this.object=n,this.eventType=s,this.actionCondition=r,this.evaluators=[],this.elapsed=0,this.lastTime=null,this.direction=1,this._playing=!1,this._finished=!1,this.hasPlayedOnce=!1,this.pauseOnNextCycleEnd=!1,this.lastCycleIndex=0;try{let e=E.findTimeline(this.scene.data.objects,this.data.timeline),t=e.duration;this.animatedObjectIds=Object.keys(e.objectTimelines),this.animatedObjectIds.forEach(n=>{let s=this.scene.find(n);if(!s)return;let r=e.objectTimelines[n];!r||this.evaluators.push(function(e,t,i,a,n){let s=function(e,t){let i=[];return C.groupKeyframes(t.keyframes).forEach(t=>{let a=t.path?.[0],n=t.path[1],s=()=>V(t.keyframes,e=>e.value);switch(a){case"position":case"rotation":case"scale":return void(n&&I.includes(n)&&i.push({on:a,axis:n,track:s()}));case"shape size":return void(n&&I.includes(n)&&"geometry"in e&&i.push({on:"shapeSize",axis:n,track:s()}));case"path extrusion":return void(v(e)&&i.push({on:"pathExtrusion",track:V(t.keyframes,e=>e.value)}));case"path snapping":return void(e.data.pathSnapping&&i.push({on:"pathSnapping",track:V(t.keyframes,e=>e.value)}));case"material":return void("Mesh"===e.type&&"material"in e&&function(e,t){let i=p(e.material)?e.material:void 0,a=t.layerId;if(!i||!a)return[];let n=t.keyframes.some(e=>u(e.data.value?.noiseStrength)),s=i.ensureRainbowNoiseCompiled,r=e=>{n&&"function"==typeof s&&s.call(i,e)},o=e=>"data"in e?[{on:"material",layer:e,track:V(t.keyframes,e=>e.value)}]:[];r(a);let l=i.getLayerByUuid(a);if(l)return o(l);let h=t.path[1];for(let e of i.getLayersOfType(h))r(e.uuid);return(i.getLayersOfType(h)??[]).flatMap(o)}(e,t).forEach(e=>i.push(e)));case"opacity":return void("Mesh"===e.type&&"material"in e&&i.push({on:"opacity",track:s()}));case"cloner":return void i.push({on:"cloner",track:V(t.keyframes,e=>e.value)});case"camera":return void(e instanceof d&&i.push({on:"camera",field:"zoom",track:s()}));case"light":return void((e instanceof h||e instanceof o||e instanceof c)&&i.push({on:"light",field:t.path[1],track:V(t.keyframes,e=>e.value)}))}}),i}(e,t);return{duration:i,evaluate(t,i){e.resetBBoxNeedsUpdate();let r={transform:!1,size:!1,cloner:!1,bounds:!1,boolean:!1,render:!1};for(let o of s)Q(o,e,t,a,n,i,r);!function(e,t,i){if(t.size&&e instanceof f){let{x:t,y:a,z:n}=e.userData.value;e.updateGeometryInteractions({width:t,height:a,depth:n},i.shared)}t.cloner&&e.cloner?.update(i),t.transform&&e.updateMatrix(),t.bounds&&e.resetBBoxNeedsUpdate(),t.boolean&&e instanceof f&&e.invalidateDownstreamBooleanData(),t.render&&e.dispatchEvent({type:"requestRender"})}(e,r,a)},invalidate(){for(let e of s)R(e.track)}}}(s,{...r},t,{scene:i,shared:a},this.sharedAssets))}),this.schedule=new _((l=this.data,{duration:t,delay:B(l.delay/1e3),delayDirection:l.delayDirection??"start-end",direction:l.direction??"normal",repeat:l.repeat}))}catch(e){throw new Error("Missing property")}var l;n&&(X.has(n.uuid)?X.get(n.uuid).push(this):X.set(n.uuid,[this])),K.set(e,this)}get playing(){return this._playing}get finished(){return this._finished}get paused(){return!this._playing}update(e){null!==this.lastTime&&(this.elapsed=Math.max(0,this.elapsed+(e-this.lastTime)*this.direction)),this.lastTime=e,this.applyAtElapsed()}applyAtElapsed(){if(-1===this.direction&&0===this.elapsed)return void this.pause();let e=this.schedule.resolve(this.elapsed);if(e){if(e.cycleIndex!==this.lastCycleIndex&&(this.lastCycleIndex=e.cycleIndex,this.pauseOnNextCycleEnd))return this.pauseOnNextCycleEnd=!1,void this.pause();for(let t of this.evaluators)t.evaluate(e.localTime)}else 1===this.direction&&this.schedule.isFinished(this.elapsed)&&this.finish()}finish(){this.pause(),this._finished=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof d&&t.dispatchEvent(r)})}startTicking(){this._playing=!0,this.lastTime=null;for(let e of this.evaluators)e.invalidate();l.add(this)}play(){let e=void 0!==this.eventType&&A(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.elapsed>0&&!this._finished;if(void 0!==this.eventType&&A(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!e||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof d&&t.dispatchEvent(s)}),!e&&(0===this.elapsed||this._finished)&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.startTicking()}pause(){this._playing=!1,this.lastTime=null,l.remove(this)}stop(){this.pause(),this.elapsed=0,this.lastCycleIndex=0,this.applyAtElapsed(),this._finished=!1}seek(e){let t=this.schedule.totalDuration;this.elapsed=e*(Number.isFinite(t)?t:this.schedule.effectiveCycleDuration);for(let e of this.evaluators)e.invalidate();this.applyAtElapsed()}toggle(e){let t=e??-1===this.direction;this._playing&&this.direction===(t?1:-1)?t&&(this.pauseOnNextCycleEnd=!1):(t?(this._finished&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.pauseOnNextCycleEnd=!1):(this.direction=this.schedule.resolve(this.elapsed)?.isReverse?1:-1,this.pauseOnNextCycleEnd=!0),this.startTicking())}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}},Z=class{constructor(e){this.data=e}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(e){let t=this.getTimelineActions(e);!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>{e[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):t.forEach(e=>{e[this.data.interaction]()}))}getTimelineActions(e){let t=K.get(e);return t?[t]:[...K.values()].filter(t=>t.data.timeline===e)}pauseAllTimelinesFromObject(e){let t=X.get(e);!t?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>e[this.data.interaction]()),this.disposeDelay()},this.data.delay)):t.forEach(e=>e[this.data.interaction]()))}pauseAllTimelines(){let e=[...X.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},H=class{constructor(e,t,i,a,n,s,r){this.data=t;let o="interaction"in t?t.interaction:"play";if("play"===o||void 0===o)this.interaction=new W(e,t,i,a,n,s,r);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Z(t)}}get playing(){return this.interaction instanceof W&&this.interaction.playing}get finished(){return!(this.interaction instanceof W)||this.interaction.finished}get paused(){return!(this.interaction instanceof W)||this.interaction.paused}play(){if(this.interaction instanceof W)return this.interaction.play();this.interaction.dispatch()}stop(){this.interaction instanceof W&&this.interaction.stop()}seek(e){this.interaction instanceof W&&this.interaction.seek(e)}toggle(e){this.interaction instanceof W?this.interaction.toggle(e):this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof W?this.interaction.playFromCurrent():this.interaction.dispatch()}dispatchConditional(){this.interaction instanceof W?y(this.interaction.sharedAssets,this.interaction.actionCondition)&&this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof W&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};m("TimelineAnimation",({id:e,data:t,page:i,shared:a,object:n,eventType:s,actionCondition:r})=>new H(e,t,i.scene,a,n,s,r)),k("timeline");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{f as t}from"./runtime-chunk-WQ5L4XSQ.js";import{a as n,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{e as a}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-4YSIMIIS.js";import"./runtime-chunk-KWEZUCEY.js";import"./runtime-chunk-UTXZTSXZ.js";import"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as r}from"./runtime-chunk-M6FFVLT6.js";import{d,v as l}from"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as u}from"./runtime-chunk-TZCHGFVF.js";import{s as h,t as c}from"./runtime-chunk-K3UQCG3P.js";import{Ec as p,Fc as m,Oc as v,rd as g}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var E=new m,f=new m,w=new m,y=new m,L=new g,F={type:"requestRender"},M=function(){let e=new m,t=new m;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),x=function(){let e=new v;return(n,i)=>{n.position.copy(i),null!==n.parent&&(e.copy(n.parent.matrixWorld).invert(),n.position.applyMatrix4(e)),e.copy(n.hiddenMatrix).invert(),n.position.applyMatrix4(e),n.updateMatrix(),n.hasNonUniformScale&&(n.updateMatrixWorld(),n.updateMatrixWorldRigid()),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),D=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new m,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...h.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=o(e,e.actions,i,s,a,n)}},b=class extends n{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new D(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,r(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(w),e.isReset)y.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(y);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(f),f.negate(),E.copy(f)):"xy"===n?E.set(0,0,1):"xz"===n?E.set(0,1,0):"yz"===n&&E.set(1,0,0),L.setFromNormalAndCoplanarPoint(E,w),!t.ray.intersectPlane(L,y))return}if(!e.isReset)if(y.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;y.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(y.x=w.x),!1===e.data.enabledTranslation[1]&&(y.y=w.y),!1===e.data.enabledTranslation[2]&&(y.z=w.z);let a=M(w,y,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=E.subVectors(a,w).divideScalar(e.currentDampingFactor);w.add(n),t&&x(e.object,w),e.paused=n.length()<.01}else x(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(F)}},P=new m,j=new m,C=new v,R=new p,S=new p,N=new m,k=new m,O=new m,Q=new m,W=new g,z={type:"requestRender"},T={type:"changeRotation"},V=function(){let e=new v;return function(n,i){null!==n.parent?e.multiplyMatrices(n.parent.matrixWorld,n.hiddenMatrix):e.copy(n.hiddenMatrix),i.premultiply(d(e).invert()),n.rotation.setFromRotationMatrix(i),n.updateMatrix(),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),I=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new p,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.resetDampingFactor=80/this.data.resetSpeed+1}},U=class extends n{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new I(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e)}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:l,raycaster:u}=this.eventContext,{object:h,target:c}=e;if(h.getWorldPosition(N),!e.isReset)if(e.target)e.target.getWorldPosition(k);else{if("custom"===s?(l().getWorldDirection(j),j.negate(),W.setFromNormalAndCoplanarPoint(j,N)):("xy"===s?P.set(0,0,1):"xz"===s?P.set(0,1,0):"yz"===s&&P.set(1,0,0),W.setFromNormalAndCoplanarPoint(P,N)),!u.ray.intersectPlane(W,k))return;i>0&&("custom"===s||void 0===s)&&k.addScaledVector(j,i)}if(e.isReset||(c?"target"===t?O.copy(c.up).applyMatrix4(C.extractRotation(c.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(Q.set(0,0,1),!1===o[2]&&Q.set(0,1,0)):"y"===n?(Q.set(1,0,0),!1===o[0]&&Q.set(0,0,1)):(Q.set(0,1,0),!1===o[1]&&Q.set(1,0,0)),O.copy(Q).applyQuaternion(e.worldQuaternion0).normalize()):O.set(0,1,0):"custom"===s?O.set(0,1,0):O.copy(P)),e.isReset)S.copy(e.worldQuaternion0);else if(N.distanceTo(k)>a&&r&&c){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;S.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;(function(e,t,n,i,s,a){let o=C.elements;q.subVectors(t,n),0===q.lengthSq()&&(q.z=1),q.normalize(),B.crossVectors(i,q),0===B.lengthSq()&&(1===Math.abs(i.z)?q.x+=1e-4:q.z+=1e-4,q.normalize(),B.crossVectors(i,q)),B.normalize(),A.crossVectors(q,B),"x"===s?1===a.z?[B,A,q]=[q,B,A]:(B.negate(),[B,q]=[q,B]):"y"===s?1===a.x?[B,A,q]=[A,q,B]:(B.negate(),[A,q]=[q,A]):1===a.x&&(B.negate(),[B,A]=[A,B]),o[0]=B.x,o[4]=A.x,o[8]=q.x,o[1]=B.y,o[5]=A.y,o[9]=q.y,o[2]=B.z,o[6]=A.z,o[10]=q.z})(0,k,N,O,n,Q),S.setFromRotationMatrix(C),R.setFromUnitVectors(Q.applyQuaternion(S),O),o.some(e=>!1===e)&&"target"!==t&&S.premultiply(R).normalize()}e.currentDampingFactor>1?(h.updateWorldMatrix(!0,!1),R.setFromRotationMatrix(d(h.matrixWorld)),R.slerp(S,1/e.currentDampingFactor),V(h,C.makeRotationFromQuaternion(R)),e.paused=8*(1-R.dot(S))<1e-6):(V(h,C.makeRotationFromQuaternion(S)),e.paused=!0),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),h.dispatchEvent(z),h.dispatchEvent(T)}},A=new m,B=new m,q=new m;i("Follow",({eventContext:e,eventManager:t})=>new b(e,t)),i("LookAt",({eventContext:e})=>new U(e)),u("tracking");
1
+ import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{f as t}from"./runtime-chunk-DUQ2PW7L.js";import{a as n,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{e as a}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-JVQBFLYF.js";import"./runtime-chunk-564IIVBV.js";import"./runtime-chunk-JAELIJQZ.js";import"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as r}from"./runtime-chunk-L6ERXCVI.js";import{d,v as l}from"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as u}from"./runtime-chunk-TZCHGFVF.js";import{s as h,t as c}from"./runtime-chunk-K3UQCG3P.js";import{Ec as p,Fc as m,Oc as v,rd as g}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var E=new m,f=new m,w=new m,y=new m,L=new g,F={type:"requestRender"},M=function(){let e=new m,t=new m;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),x=function(){let e=new v;return(n,i)=>{n.position.copy(i),null!==n.parent&&(e.copy(n.parent.matrixWorld).invert(),n.position.applyMatrix4(e)),e.copy(n.hiddenMatrix).invert(),n.position.applyMatrix4(e),n.updateMatrix(),n.hasNonUniformScale&&(n.updateMatrixWorld(),n.updateMatrixWorldRigid()),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),D=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new m,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...h.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=o(e,e.actions,i,s,a,n)}},P=class extends n{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new D(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,r(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(w),e.isReset)y.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(y);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(f),f.negate(),E.copy(f)):"xy"===n?E.set(0,0,1):"xz"===n?E.set(0,1,0):"yz"===n&&E.set(1,0,0),L.setFromNormalAndCoplanarPoint(E,w),!t.ray.intersectPlane(L,y))return}if(!e.isReset)if(y.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;y.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(y.x=w.x),!1===e.data.enabledTranslation[1]&&(y.y=w.y),!1===e.data.enabledTranslation[2]&&(y.z=w.z);let a=M(w,y,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=E.subVectors(a,w).divideScalar(e.currentDampingFactor);w.add(n),t&&x(e.object,w),e.paused=n.length()<.01}else x(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(F)}},b=new m,j=new m,C=new v,R=new p,N=new p,S=new m,k=new m,O=new m,Q=new m,z=new g,W={type:"requestRender"},T={type:"changeRotation"},V=function(){let e=new v;return function(n,i){null!==n.parent?e.multiplyMatrices(n.parent.matrixWorld,n.hiddenMatrix):e.copy(n.hiddenMatrix),i.premultiply(d(e).invert()),n.rotation.setFromRotationMatrix(i),n.updateMatrix(),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),I=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new p,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.resetDampingFactor=80/this.data.resetSpeed+1}},A=class extends n{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new I(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e)}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:l,raycaster:u}=this.eventContext,{object:h,target:c}=e;if(h.getWorldPosition(S),!e.isReset)if(e.target)e.target.getWorldPosition(k);else{if("custom"===s?(l().getWorldDirection(j),j.negate(),z.setFromNormalAndCoplanarPoint(j,S)):("xy"===s?b.set(0,0,1):"xz"===s?b.set(0,1,0):"yz"===s&&b.set(1,0,0),z.setFromNormalAndCoplanarPoint(b,S)),!u.ray.intersectPlane(z,k))return;i>0&&("custom"===s||void 0===s)&&k.addScaledVector(j,i)}if(e.isReset||(c?"target"===t?O.copy(c.up).applyMatrix4(C.extractRotation(c.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(Q.set(0,0,1),!1===o[2]&&Q.set(0,1,0)):"y"===n?(Q.set(1,0,0),!1===o[0]&&Q.set(0,0,1)):(Q.set(0,1,0),!1===o[1]&&Q.set(1,0,0)),O.copy(Q).applyQuaternion(e.worldQuaternion0).normalize()):O.set(0,1,0):"custom"===s?O.set(0,1,0):O.copy(b)),e.isReset)N.copy(e.worldQuaternion0);else if(S.distanceTo(k)>a&&r&&c){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;N.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;(function(e,t,n,i,s,a){let o=C.elements;q.subVectors(t,n),0===q.lengthSq()&&(q.z=1),q.normalize(),U.crossVectors(i,q),0===U.lengthSq()&&(1===Math.abs(i.z)?q.x+=1e-4:q.z+=1e-4,q.normalize(),U.crossVectors(i,q)),U.normalize(),B.crossVectors(q,U),"x"===s?1===a.z?[U,B,q]=[q,U,B]:(U.negate(),[U,q]=[q,U]):"y"===s?1===a.x?[U,B,q]=[B,q,U]:(U.negate(),[B,q]=[q,B]):1===a.x&&(U.negate(),[U,B]=[B,U]),o[0]=U.x,o[4]=B.x,o[8]=q.x,o[1]=U.y,o[5]=B.y,o[9]=q.y,o[2]=U.z,o[6]=B.z,o[10]=q.z})(0,k,S,O,n,Q),N.setFromRotationMatrix(C),R.setFromUnitVectors(Q.applyQuaternion(N),O),o.some(e=>!1===e)&&"target"!==t&&N.premultiply(R).normalize()}e.currentDampingFactor>1?(h.updateWorldMatrix(!0,!1),R.setFromRotationMatrix(d(h.matrixWorld)),R.slerp(N,1/e.currentDampingFactor),V(h,C.makeRotationFromQuaternion(R)),e.paused=8*(1-R.dot(N))<1e-6):(V(h,C.makeRotationFromQuaternion(N)),e.paused=!0),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),h.dispatchEvent(W),h.dispatchEvent(T)}},B=new m,U=new m,q=new m;i("Follow",({eventContext:e,eventManager:t})=>new P(e,t)),i("LookAt",({eventContext:e})=>new A(e)),u("tracking");
@@ -1 +1 @@
1
- import{i as t,k as i,l as e,m as s,n}from"./runtime-chunk-BKTNVUN3.js";import"./runtime-chunk-7L46WKPR.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as r,b as a,d as o}from"./runtime-chunk-JXO7S6TH.js";import"./runtime-chunk-HD7WF3XN.js";import{a as h}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-WQ5L4XSQ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as c}from"./runtime-chunk-4YSIMIIS.js";import"./runtime-chunk-BSJNKHDI.js";import"./runtime-chunk-KWEZUCEY.js";import"./runtime-chunk-UTXZTSXZ.js";import"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as d,e as m}from"./runtime-chunk-M6FFVLT6.js";import"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import{e as l}from"./runtime-chunk-2PT2WH66.js";import{a as u}from"./runtime-chunk-EFBUAWKV.js";import{a as p}from"./runtime-chunk-TZCHGFVF.js";import{p as g}from"./runtime-chunk-K3UQCG3P.js";import{Bc as A,Cc as f}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function j(t){let i=t.tweens[0]?.data;return{delay:i?.delay??t.delay,delayDirection:i?.delayDirection??"start-once",direction:i?.direction??t.direction,repeat:i?.repeat??t.repeat}}var y={state:null,duration:0,delay:0,delayDirection:"start-once",direction:"normal",repeat:0,easing:0},T=class extends A{constructor(t,i,s,n,r,a){if(super(),this.eventType=t,this.data=i,this.page=s,this.shared=n,this.condition=r,this.runModeOverride=a,this.tweens=[],this.hasPlayedOnce=!1,this.inert=e,!i.object)throw new Error("Missing property");let o=this.page.scene.find(i.object)??this.page.uiCanvas?.find(i.object)??this.page.scene.find2DInUIObjects(i.object);if(!o)throw new Error("Missing property");if(!o.states)throw new Error("Missing property");if(this.object=o,i.tweens.length<2)throw new Error("Missing property");this.init()}get playing(){return!0===this.runner?.isPlaying}get animating(){return!0===this.runner?.isAnimating}get claimTime(){return this.runner?.claimTime}get contested(){let t=this.object.previousAction;return null!==t&&t!==this&&t.animating}init(){this.initialCurrentState=i(this.object,this.object.currentState).id,this.build()}shouldReinit(){return!!m(this.shared,this.condition)||!(this.animating&&!this.loopsForever)}get loopsForever(){return-1===j(this.data).repeat||this.data.tweens.some((t,i)=>i>0&&-1===t.data.repeat)}get runMode(){return void 0!==this.runModeOverride?this.runModeOverride:g(this.eventType)?this.data.runMode:"Repeat"}get currentState(){return"Toggle"===this.runMode?this.initialCurrentState:this.object.currentState}get opensOnCurrent(){return void 0===this.data.tweens[0].data.state&&"Toggle"!==this.runMode}build(){let i=this.data.tweens,e=[];try{let t=i[0].data.state;void 0!==t&&e.push(new n(this.object,t,t,y,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert));for(let t=1;t<i.length;t++){let s=i[t-1],r=i[t];e.push(new n(this.object,void 0===s.data.state?this.currentState:s.data.state,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert))}}catch(t){return void(t instanceof Error&&console.error(t.message))}this.tweens=e,this.syncInert(),this.runner=new o({...t(j(this.data)),runMode:this.runMode},e.map(t=>t.runner),{claim:t=>this.claimObject(t),assignCurrentState:()=>this.rebindTweens(),isOwner:()=>this.object.previousAction===this})}claimObject(t){if(this.object.previousAction===this)return!1;let i=this.object.previousAction;if(!0===i?.animating){if(void 0!==t&&void 0!==i.claimTime&&i.claimTime>t)return!1;i.pause()}return this.object.previousAction=this,!0}rebindTweens(){for(let t of this.tweens)try{t.rebind()}catch(t){t instanceof Error&&console.error(t.message)}this.syncInert(),this.object instanceof c&&this.object.wasMovedByUser&&(this.object.wasMovedByUser=!1)}syncInert(){let t=this.tweens.flatMap(t=>t.endpointData);if(this.opensOnCurrent&&t.length>0){let e=i(this.object,this.object.currentState);e&&(t[0]=e.data)}this.inert=s(t);for(let t of this.tweens)t.refresh()}update(t){this.runner?.update(t),!0!==this.runner?.isPlaying&&h.remove(this)}play(){if(!1===m(this.shared,this.condition)||"Once"===this.runMode&&this.hasPlayedOnce)return!1;this.hasPlayedOnce=!0,this.start()}start(){!this.runner||(this.runner.play(h.time),this.runner.isPlaying&&h.add(this))}pause(){this.runner?.stop(),h.remove(this)}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;l(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===m(this.shared,this.condition))return!1;this.runner?.seek(t)}playDirected(t){if(!1===m(this.shared,this.condition))return!1;!this.runner||(this.runner.playDirected(h.time,t),this.runner.isPlaying&&h.add(this))}playFromCurrent(){this.playDirected(!0)}reverseFromCurrent(){this.playDirected(!1)}dispose(){this.pause()}},w=new Map,b=new WeakSet;function C(t,i){if(void 0===i)return;let e=t.scene.find(i);return e&&Array.isArray(e.identity)?e.identity[0]:i}var F=class extends A{constructor(t,i,e,s,n){super(),this.page=i,this.animationControls=e,this.shared=s,this.condition=n,this.startOnceDelay=0,this.toggleIsForward=!1;let a=C(i,t.object)??t.object;this.data={...t,object:a};let o=this.animationControls.clipIdToAction[t.clipId+"/"+a];if(this.duration=o?.getClip()?.duration??1,this.data.crop2){let t=r(o?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=o?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay;let h=w.get(a);h||(h=new Set,w.set(a,h)),h.add(this)}get playing(){return this.threeAnimAction?.isRunning()??!1}cancelPending(){window.clearTimeout(this.timeoutId),delete this.timeoutId}resume(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object];return!(!t||!b.has(t)||(b.delete(t),this.threeAnimAction=t,t.paused=!1,t.play(),this.animationControls.requestRender(),0))}play(t=!1){if(!1===m(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{if(this.resume()||(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction))return;b.delete(this.threeAnimAction),this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach(([e,s])=>{let n=e.split("/")[1];this.threeAnimAction!==s&&n===i&&(t?s.fadeOut(.2):s.stop())}),t&&this.threeAnimAction?.fadeIn(.2)},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),this.cancelPending()}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=f.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===m(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing||this.resume()?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let t=this.data.clipId.split("/")[1];Object.entries(this.animationControls.clipIdToAction).forEach(([e,s])=>{let n=e.split("/")[1];this.threeAnimAction!==s&&n===t&&s.isRunning()&&(i?s.fadeOut(.2):s.stop())}),i&&this.threeAnimAction?.fadeIn(.2)}},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause();let i=w.get(this.data.object);i&&(i.delete(this),0===i.size&&w.delete(this.data.object))}},I=class{constructor(t,i,e){this.data=t,this.page=i,this.animationControls=e,this.objectId=C(i,t.object)}dispatch(){this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{this.apply(),this.disposeDelay()},this.data.delay)):this.apply()}targetsClip(t,i){return!(void 0!==this.objectId&&i!==this.objectId||this.data.clipId&&t!==this.data.clipId)}apply(){(void 0!==this.objectId?[w.get(this.objectId)]:[...w.values()]).forEach(t=>{t?.forEach(t=>{this.targetsClip(t.data.clipId,t.data.object)&&t.cancelPending()})});let t=!1;Object.entries(this.animationControls.clipIdToAction).forEach(([i,e])=>{let[s,n]=i.split("/");if(this.targetsClip(s,n))if("pause"===this.data.interaction){if(!e.isRunning())return;e.paused=!0,b.add(e)}else{if(!e.enabled||!e.isRunning()&&!e.paused)return;e.paused=!0,b.delete(e),e.time=e._clip.start??0,e._loopCount=-1,t=!0}}),t&&(this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){this.disposeDelay()}},v=class{constructor(t,i,e,s,n){u.isPause(t)?this.interaction=new I(t,i,e):this.interaction=new F(t,i,e,s,n)}get data(){return this.interaction.data}get playing(){return this.interaction instanceof F&&this.interaction.playing}play(t=!1){if(this.interaction instanceof F)return this.interaction.play(t);this.interaction.dispatch()}pause(){this.interaction instanceof F&&this.interaction.pause()}stop(){this.interaction instanceof F&&this.interaction.stop()}seek(t){this.interaction instanceof F&&this.interaction.seek(t)}toggle(t,i=!1){if(this.interaction instanceof F)return this.interaction.toggle(t,i);this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof F?this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof F&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};a(n),d("Transition",({eventType:t,data:i,page:e,shared:s,actionCondition:n,runModeOverride:r})=>new T(t,i,e,s,n,r)),d("Animation",({data:t,page:i,eventManager:e,shared:s,actionCondition:n})=>new v(t,i,e.animationControls,s,n)),p("transitions");
1
+ import{i as t,k as i,l as e,m as s,n}from"./runtime-chunk-2GPGYGR2.js";import"./runtime-chunk-I6CPIGMQ.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as r,b as a,d as o}from"./runtime-chunk-JXO7S6TH.js";import"./runtime-chunk-HD7WF3XN.js";import{a as h}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-DUQ2PW7L.js";import"./runtime-chunk-FTVQTRM7.js";import{a as c}from"./runtime-chunk-JVQBFLYF.js";import"./runtime-chunk-BJXRV54U.js";import"./runtime-chunk-564IIVBV.js";import"./runtime-chunk-JAELIJQZ.js";import"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as d,e as m}from"./runtime-chunk-L6ERXCVI.js";import"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import{e as l}from"./runtime-chunk-2PT2WH66.js";import{a as u}from"./runtime-chunk-EFBUAWKV.js";import{a as p}from"./runtime-chunk-TZCHGFVF.js";import{p as g}from"./runtime-chunk-K3UQCG3P.js";import{Bc as A,Cc as f}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function j(t){let i=t.tweens[0]?.data;return{delay:i?.delay??t.delay,delayDirection:i?.delayDirection??"start-once",direction:i?.direction??t.direction,repeat:i?.repeat??t.repeat}}var y={state:null,duration:0,delay:0,delayDirection:"start-once",direction:"normal",repeat:0,easing:0},w=class extends A{constructor(t,i,s,n,r,a){if(super(),this.eventType=t,this.data=i,this.page=s,this.shared=n,this.condition=r,this.runModeOverride=a,this.tweens=[],this.hasPlayedOnce=!1,this.inert=e,!i.object)throw new Error("Missing property");let o=this.page.scene.find(i.object)??this.page.uiCanvas?.find(i.object)??this.page.scene.find2DInUIObjects(i.object);if(!o)throw new Error("Missing property");if(!o.states)throw new Error("Missing property");if(this.object=o,i.tweens.length<2)throw new Error("Missing property");this.init()}get playing(){return!0===this.runner?.isPlaying}get animating(){return!0===this.runner?.isAnimating}get claimTime(){return this.runner?.claimTime}get contested(){let t=this.object.previousAction;return null!==t&&t!==this&&t.animating}init(){this.initialCurrentState=i(this.object,this.object.currentState).id,this.build()}shouldReinit(){return!!m(this.shared,this.condition)||!(this.animating&&!this.loopsForever)}get loopsForever(){return-1===j(this.data).repeat||this.data.tweens.some((t,i)=>i>0&&-1===t.data.repeat)}get runMode(){return void 0!==this.runModeOverride?this.runModeOverride:g(this.eventType)?this.data.runMode:"Repeat"}get currentState(){return"Toggle"===this.runMode?this.initialCurrentState:this.object.currentState}get opensOnCurrent(){return void 0===this.data.tweens[0].data.state&&"Toggle"!==this.runMode}build(){let i=this.data.tweens,e=[];try{let t=i[0].data.state;void 0!==t&&e.push(new n(this.object,t,t,y,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert));for(let t=1;t<i.length;t++){let s=i[t-1],r=i[t];e.push(new n(this.object,void 0===s.data.state?this.currentState:s.data.state,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert))}}catch(t){return void(t instanceof Error&&console.error(t.message))}this.tweens=e,this.syncInert(),this.runner=new o({...t(j(this.data)),runMode:this.runMode},e.map(t=>t.runner),{claim:t=>this.claimObject(t),assignCurrentState:()=>this.rebindTweens(),isOwner:()=>this.object.previousAction===this})}claimObject(t){if(this.object.previousAction===this)return!1;let i=this.object.previousAction;if(!0===i?.animating){if(void 0!==t&&void 0!==i.claimTime&&i.claimTime>t)return!1;i.pause()}return this.object.previousAction=this,!0}rebindTweens(){for(let t of this.tweens)try{t.rebind()}catch(t){t instanceof Error&&console.error(t.message)}this.syncInert(),this.object instanceof c&&this.object.wasMovedByUser&&(this.object.wasMovedByUser=!1)}syncInert(){let t=this.tweens.flatMap(t=>t.endpointData);if(this.opensOnCurrent&&t.length>0){let e=i(this.object,this.object.currentState);e&&(t[0]=e.data)}this.inert=s(t);for(let t of this.tweens)t.refresh()}update(t){this.runner?.update(t),!0!==this.runner?.isPlaying&&h.remove(this)}play(){if(!1===m(this.shared,this.condition)||"Once"===this.runMode&&this.hasPlayedOnce)return!1;this.hasPlayedOnce=!0,this.start()}start(){!this.runner||(this.runner.play(h.time),this.runner.isPlaying&&h.add(this))}pause(){this.runner?.stop(),h.remove(this)}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;l(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===m(this.shared,this.condition))return!1;this.runner?.seek(t)}playDirected(t){if(!1===m(this.shared,this.condition))return!1;!this.runner||(this.runner.playDirected(h.time,t),this.runner.isPlaying&&h.add(this))}playFromCurrent(){this.playDirected(!0)}reverseFromCurrent(){this.playDirected(!1)}dispose(){this.pause()}},T=new Map,b=new WeakSet;function C(t,i){if(void 0===i)return;let e=t.scene.find(i);return e&&Array.isArray(e.identity)?e.identity[0]:i}var I=class extends A{constructor(t,i,e,s,n){super(),this.page=i,this.animationControls=e,this.shared=s,this.condition=n,this.startOnceDelay=0,this.toggleIsForward=!1;let a=C(i,t.object)??t.object;this.data={...t,object:a};let o=this.animationControls.clipIdToAction[t.clipId+"/"+a];if(this.duration=o?.getClip()?.duration??1,this.data.crop2){let t=r(o?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=o?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay;let h=T.get(a);h||(h=new Set,T.set(a,h)),h.add(this)}get playing(){return this.threeAnimAction?.isRunning()??!1}cancelPending(){window.clearTimeout(this.timeoutId),delete this.timeoutId}resume(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object];return!(!t||!b.has(t)||(b.delete(t),this.threeAnimAction=t,t.paused=!1,t.play(),this.animationControls.requestRender(),0))}play(t=!1){if(!1===m(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{if(this.resume()||(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction))return;b.delete(this.threeAnimAction),this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach(([e,s])=>{let n=e.split("/")[1];this.threeAnimAction!==s&&n===i&&(t?s.fadeOut(.2):s.stop())}),t&&this.threeAnimAction?.fadeIn(.2)},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),this.cancelPending()}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=f.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===m(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing||this.resume()?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let t=this.data.clipId.split("/")[1];Object.entries(this.animationControls.clipIdToAction).forEach(([e,s])=>{let n=e.split("/")[1];this.threeAnimAction!==s&&n===t&&s.isRunning()&&(i?s.fadeOut(.2):s.stop())}),i&&this.threeAnimAction?.fadeIn(.2)}},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause();let i=T.get(this.data.object);i&&(i.delete(this),0===i.size&&T.delete(this.data.object))}},F=class{constructor(t,i,e){this.data=t,this.page=i,this.animationControls=e,this.objectId=C(i,t.object)}dispatch(){this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{this.apply(),this.disposeDelay()},this.data.delay)):this.apply()}targetsClip(t,i){return!(void 0!==this.objectId&&i!==this.objectId||this.data.clipId&&t!==this.data.clipId)}apply(){(void 0!==this.objectId?[T.get(this.objectId)]:[...T.values()]).forEach(t=>{t?.forEach(t=>{this.targetsClip(t.data.clipId,t.data.object)&&t.cancelPending()})});let t=!1;Object.entries(this.animationControls.clipIdToAction).forEach(([i,e])=>{let[s,n]=i.split("/");if(this.targetsClip(s,n))if("pause"===this.data.interaction){if(!e.isRunning())return;e.paused=!0,b.add(e)}else{if(!e.enabled||!e.isRunning()&&!e.paused)return;e.paused=!0,b.delete(e),e.time=e._clip.start??0,e._loopCount=-1,t=!0}}),t&&(this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){this.disposeDelay()}},v=class{constructor(t,i,e,s,n){u.isPause(t)?this.interaction=new F(t,i,e):this.interaction=new I(t,i,e,s,n)}get data(){return this.interaction.data}get playing(){return this.interaction instanceof I&&this.interaction.playing}play(t=!1){if(this.interaction instanceof I)return this.interaction.play(t);this.interaction.dispatch()}pause(){this.interaction instanceof I&&this.interaction.pause()}stop(){this.interaction instanceof I&&this.interaction.stop()}seek(t){this.interaction instanceof I&&this.interaction.seek(t)}toggle(t,i=!1){if(this.interaction instanceof I)return this.interaction.toggle(t,i);this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof I?this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof I&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};a(n),d("Transition",({eventType:t,data:i,page:e,shared:s,actionCondition:n,runModeOverride:r})=>new w(t,i,e,s,n,r)),d("Animation",({data:t,page:i,eventManager:e,shared:s,actionCondition:n})=>new v(t,i,e.animationControls,s,n)),p("transitions");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-CVUJ3GMH.js";import{a as t,b as i,c as r,d as a,f as s,g as n,h,i as d,j as o,k as m,l as c,m as u,n as l}from"./runtime-chunk-7L46WKPR.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{M as p,ia as f}from"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import{f as g,g as y}from"./runtime-chunk-EFBUAWKV.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-K3UQCG3P.js";import{Ae as b,Ba as R,Bd as x,Cc as S,Lc as F,Le as T,bd as H,ce as W,dd as D,ld as I}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function M(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var U=new b(-1,1,1,-1,0,1),B=new class extends D{constructor(){super(),this.setAttribute("position",new H([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new H([0,2,0,0,2,0],2))}},E=new W({defines:{},uniforms:{tDiffuse:new T(null)},vertexShader:"\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t}",fragmentShader:"\n\tuniform sampler2D tDiffuse;\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\tgl_FragColor = texel;\n\t}"}),G=new class{constructor(e){this._mesh=new I(B,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(E),z=null,k=null,_=t.identity(),C=class{constructor(t,i,r,s){var n;this.uuid=t,this.width=i,this.height=r,this.context=s,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.isScreenSpace||e(this),this.context.shared.requestRender()},this._innerApplySize=()=>{let e=this.width,t=this.height;this.renderer.dpr=M(e,t,this.dpr,this.isScreenSpace),this.renderer.setSize(e,t)},this.onFrameOverrideObjectEvent=e=>{if(void 0!==e.target?.uuid){let t=this.frameRoot?.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new u(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===z&&(z=document.createElement("canvas")),z),this.renderer=(n=this.canvas,null===k&&(k=new a(n)),k),this.promise=this.init(),this.renderTarget=new F(1,1,{type:R,stencilBuffer:!1,depthBuffer:!1}),s.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=s.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new x(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}render(e){if(this.isFrameDirty){if(this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),this.frameOverride?.draw(this.renderer),this.renderer.render(),this.canvasTexture.needsUpdate=!0,e.blitTextureToTarget)e.blitTextureToTarget(this.canvasTexture,this.renderTarget);else{E.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),G.render(e),e.setRenderTarget(t)}this.textureHolder?.setNeedsUpdate(!0)}}updateEntity2DByOp(e,t,i,r){this.scene2d.updateEntityByOp(e,t,i,r),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let t=e?.width??this.width,i=e?.height??this.height;this.frameOverride.width=t,this.frameOverride.height=i,this.frameOverride.localMatrix=_,this.isScreenSpace&&(this.frameOverride.fill.color=j.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:t,height:i},L({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e,t=window.devicePixelRatio){let i=Math.max(1,e?.width??this.width),r=Math.max(1,e?.height??this.height);this.dpr=t,this.width=i,this.height=r,this._innerApplySize();let a=function(e,t,i,r){let a=M(e,t,i,r),s=Math.max(i,512/Math.min(e,t)),n=Math.min(s,a);return{width:Math.max(1,Math.ceil(e*n)),height:Math.max(1,Math.ceil(t*n))}}(i,r,t,this.isScreenSpace);this.renderTarget.setSize(a.width,a.height),this._canvasTexture?.dispose(),this._canvasTexture=void 0,this.applyOverrides(e),this.frameOverride?.requestRender()}applyFrame(e){let t=this.context.scene.find2D(e);if(t&&t instanceof o)return this.disposeFrameOverride(),this.frameRoot=t,this.frameOverride=t.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),this.frame?.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent),e.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frame?.requestRender(),t}get frame(){return this.frameOverride}get frameId(){return this.frame?.uuid}find(e){return this.scene2d.find(e)}get texture(){return this.textureHolder?.getTexture(1001)}disposeFrameOverride(){this.frameOverride?.removeEventListener("render",this.onRenderRequestedDownstream),this.frameOverride?.traverse(e=>{e.removeEventListener("beginState",this.onFrameOverrideObjectEvent),e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function L({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){if(e instanceof o&&t instanceof o||e instanceof d&&t instanceof d)for(let n=0,h=e.children.length;n<h;n++){let h=e.children[n],d=t.children[n];h&&d&&h.uuid===d.uuid&&V({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function V({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(A(e))return[e.width,e.height];if(e instanceof m){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof d){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(t),{width:o,height:u,position:p}=l({constraints:e.data,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:h,objectInitialPosition:t.position});if(e.position=p,e.data={...e.data,position:p},e.states)for(let n in e.states)q({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(A(e)||e instanceof d)A(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function q({stateId:e,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n}){let h=t.states?.[e],d=i.states?.[e];if(h&&d){let{width:i,height:o,position:m}=l({constraints:t.data,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n,objectInitialWidth:g.isResizeable(d)?d.width:0,objectInitialHeight:g.isResizeable(d)?d.height:0,objectInitialPosition:d.position});Object.assign(t.states[e],{position:m}),g.isResizeable(h)&&Object.assign(t.states[e],{width:i,height:o})}}function A(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var N=class extends f{constructor(e,t,i){super(e,t,i),this.isUIObject=!0,this.uiCanvas=new C(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)})}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){let i=e?.width??this.dataPatched.geometry.width,r=e?.height??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:i,height:r}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){let t=this.frame;t&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),this.localGeometry?.dispose(),this.localGeometry=p(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset?.(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,r){this.uiCanvas.updateEntity2DByOp(e,t,i,r),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(r):v(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:r}))}get frame(){return this.uiCanvas.frame}get frameId(){return this.frame?.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t);let i={...this.data.geometry,...e};this.localGeometry?.dispose(),this.localGeometry=p(i,t,this.data.flatShading,this)}};O("UIGeometry",(e,t,i)=>new N(e,t,i)),P({Scene2D:u,UICanvas:C,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
1
+ import{a as e}from"./runtime-chunk-CVUJ3GMH.js";import{a as t,b as i,c as r,d as a,f as s,g as n,h,i as d,j as o,k as m,l as c,m as u,n as l}from"./runtime-chunk-I6CPIGMQ.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{M as p,ia as f}from"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import{f as g,g as y}from"./runtime-chunk-EFBUAWKV.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-K3UQCG3P.js";import{Ae as b,Ba as x,Bd as R,Cc as S,Lc as F,Le as T,bd as H,ce as I,dd as D,ld as W}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function M(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var B=new b(-1,1,1,-1,0,1),U=new class extends D{constructor(){super(),this.setAttribute("position",new H([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new H([0,2,0,0,2,0],2))}},E=new I({defines:{},uniforms:{tDiffuse:new T(null)},vertexShader:"\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t}",fragmentShader:"\n\tuniform sampler2D tDiffuse;\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\tgl_FragColor = texel;\n\t}"}),G=new class{constructor(e){this._mesh=new W(U,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,B)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(E),z=null,k=null,C=t.identity(),_=class{constructor(t,i,r,s){var n;this.uuid=t,this.width=i,this.height=r,this.context=s,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.isScreenSpace||e(this),this.context.shared.requestRender()},this._innerApplySize=()=>{let e=this.width,t=this.height;this.renderer.dpr=M(e,t,this.dpr,this.isScreenSpace),this.renderer.setSize(e,t)},this.onFrameOverrideObjectEvent=e=>{if(void 0!==e.target?.uuid){let t=this.frameRoot?.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new u(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===z&&(z=document.createElement("canvas")),z),this.renderer=(n=this.canvas,null===k&&(k=new a(n)),k),this.promise=this.init(),this.renderTarget=new F(1,1,{type:x,stencilBuffer:!1,depthBuffer:!1}),s.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=s.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new R(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}render(e){if(this.isFrameDirty){if(this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),this.frameOverride?.draw(this.renderer),this.renderer.render(),this.canvasTexture.needsUpdate=!0,e.blitTextureToTarget)e.blitTextureToTarget(this.canvasTexture,this.renderTarget);else{E.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),G.render(e),e.setRenderTarget(t)}this.textureHolder?.setNeedsUpdate(!0)}}updateEntity2DByOp(e,t,i,r){this.scene2d.updateEntityByOp(e,t,i,r),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let t=e?.width??this.width,i=e?.height??this.height;this.frameOverride.width=t,this.frameOverride.height=i,this.frameOverride.localMatrix=C,this.isScreenSpace&&(this.frameOverride.fill.color=j.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:t,height:i},L({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e,t=window.devicePixelRatio){let i=Math.max(1,e?.width??this.width),r=Math.max(1,e?.height??this.height);this.dpr=t,this.width=i,this.height=r,this._innerApplySize();let a=function(e,t,i,r){let a=M(e,t,i,r),s=Math.max(i,512/Math.min(e,t)),n=Math.min(s,a);return{width:Math.max(1,Math.ceil(e*n)),height:Math.max(1,Math.ceil(t*n))}}(i,r,t,this.isScreenSpace);this.renderTarget.setSize(a.width,a.height),this._canvasTexture?.dispose(),this._canvasTexture=void 0,this.applyOverrides(e),this.frameOverride?.requestRender()}applyFrame(e){let t=this.context.scene.find2D(e);if(t&&t instanceof o)return this.disposeFrameOverride(),this.frameRoot=t,this.frameOverride=t.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),this.frame?.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent),e.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frame?.requestRender(),t}get frame(){return this.frameOverride}get frameId(){return this.frame?.uuid}find(e){return this.scene2d.find(e)}get texture(){return this.textureHolder?.getTexture(1001)}disposeFrameOverride(){this.frameOverride?.removeEventListener("render",this.onRenderRequestedDownstream),this.frameOverride?.traverse(e=>{e.removeEventListener("beginState",this.onFrameOverrideObjectEvent),e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function L({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){if(e instanceof o&&t instanceof o||e instanceof d&&t instanceof d)for(let n=0,h=e.children.length;n<h;n++){let h=e.children[n],d=t.children[n];h&&d&&h.uuid===d.uuid&&V({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function V({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(A(e))return[e.width,e.height];if(e instanceof m){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof d){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(t),{width:o,height:u,position:p}=l({constraints:e.data,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:h,objectInitialPosition:t.position});if(e.position=p,e.data={...e.data,position:p},e.states)for(let n in e.states)q({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(A(e)||e instanceof d)A(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function q({stateId:e,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n}){let h=t.states?.[e],d=i.states?.[e];if(h&&d){let{width:i,height:o,position:m}=l({constraints:t.data,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n,objectInitialWidth:g.isResizeable(d)?d.width:0,objectInitialHeight:g.isResizeable(d)?d.height:0,objectInitialPosition:d.position});Object.assign(t.states[e],{position:m}),g.isResizeable(h)&&Object.assign(t.states[e],{width:i,height:o})}}function A(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var N=class extends f{constructor(e,t,i){super(e,t,i),this.isUIObject=!0,this.uiCanvas=new _(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)})}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){let i=e?.width??this.dataPatched.geometry.width,r=e?.height??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:i,height:r}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){let t=this.frame;t&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),this.localGeometry?.dispose(),this.localGeometry=p(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset?.(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,r){this.uiCanvas.updateEntity2DByOp(e,t,i,r),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(r):v(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:r}))}get frame(){return this.uiCanvas.frame}get frameId(){return this.frame?.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t);let i={...this.data.geometry,...e};this.localGeometry?.dispose(),this.localGeometry=p(i,t,this.data.flatShading,this)}};O("UIGeometry",(e,t,i)=>new N(e,t,i)),P({Scene2D:u,UICanvas:_,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
@@ -1 +1 @@
1
- import{b as e}from"./runtime-chunk-TU4KDRKR.js";import{a,b as t}from"./runtime-chunk-DZNU62CT.js";import{a as i,b as s,e as r,f as n,g as d}from"./runtime-chunk-M6FFVLT6.js";import"./runtime-chunk-EFBUAWKV.js";import{a as o}from"./runtime-chunk-TZCHGFVF.js";import{Ga as h,Ha as l,v as c}from"./runtime-chunk-K3UQCG3P.js";import{Cc as m,Ec as u,Fc as p,Oc as y,Pc as V}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var b=new y,v=new p,f=new u,g=new p,T=new V,I=class extends a{constructor(a,t,i,s,r){super(a),this.sharedVariables=t,this.eventManager=i,this.needsMouse=s,this.needsRaycast=r,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.isOutOfFocus=!1,this.events=[],this.onFrame=a=>{let t=this.eventContext.sharedAssets;if(this.rafId=window.requestAnimationFrame(this.onFrame),this.isOutOfFocus)return;let i=new Date,s=[],r=[];for(let e=0;e<this.propertiesToWatch.length;e++){let{objectId:a,property:t,prevValue:i}=this.propertiesToWatch[e],s=this.eventContext.scene.find(a),n=c.propertyPaths[t];if("width"===n[0]||"height"===n[0]||"depth"===n[0])s=s.geometry.userData.parameters[n[0]];else if(("position"===n[0]||"rotation"===n[0]&&n.length>1)&&s.getPhysicsLocalMatrix?.(b))b.decompose(v,f,g),"position"===n[0]?s=n.length>1?v[n[1]]:v:(T.setFromQuaternion(f,s.rotation.order),s=T[n[1]]);else for(let e=0;e<n.length;e++)s=s[n[e]];null===i?this.propertiesToWatch[e].prevValue=s instanceof p?s.clone():s:(s instanceof p?!s.equals(i):i!==s)&&(r.push({objId:a,property:t}),s instanceof p?this.propertiesToWatch[e].prevValue.copy(s):this.propertiesToWatch[e].prevValue=s)}for(let e=0;e<this.variablesToWatch.length;e++){let{id:a,prevValue:i}=this.variablesToWatch[e],r=t.getVariable(a);r!==i&&(s.push(a),this.variablesToWatch[e].prevValue=r)}for(let r=0;r<this.dynamicVars.length;r++){let{id:n,expectedTime:d,last:o,data:c,timerSeconds:u,startValue:p}=this.dynamicVars[r],y=1e3;if("timer"!==c.dynamicVariableType&&"stopwatch"!==c.dynamicVariableType||"number3decimal"!==c.format?"counter"===c.dynamicVariableType?y=c.updateInterval:"random"===c.dynamicVariableType&&(y=c.isStatic?1/0:c.updateInterval):y=1,-1!==d){if("Stopped"!==t.getDynamicVariablePlayState(n)&&"Restarted"!==t.getDynamicVariablePlayState(n)||(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y,"counter"===c.dynamicVariableType&&t.getVariable(n)!==p&&(t.updateVariable(n,p),this.eventManager.requestRender()),("timer"===c.dynamicVariableType||"stopwatch"===c.dynamicVariableType)&&this.dynamicVars[r].timerSeconds!==p&&(this.dynamicVars[r].timerSeconds=p,t.updateVariable(n,l.getFormattedTimerTime(p,c)),this.eventManager.requestRender()),"Restarted"===t.getDynamicVariablePlayState(n)&&t.setDynamicVariablePlayState(n,"Playing"),"Stopped"!==t.getDynamicVariablePlayState(n))){if("Paused"===t.getDynamicVariablePlayState(n)){void 0===this.dynamicVars[r].deltaToExpectedTime&&(this.dynamicVars[r].deltaToExpectedTime=Math.max(this.dynamicVars[r].expectedTime-a,0)),this.dynamicVars[r].last=a-(y-this.dynamicVars[r].deltaToExpectedTime),this.dynamicVars[r].expectedTime=a+this.dynamicVars[r].deltaToExpectedTime;continue}if(this.dynamicVars[r].deltaToExpectedTime=void 0,a>=d)if(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime+=y,"random"===c.dynamicVariableType){let e=c.min+Math.random()*(c.max-c.min),a=c.decimals;e=Math.round(e*Math.pow(10,a))/Math.pow(10,a),t.updateVariable(n,e),s.push(n),this.eventManager.requestRender()}else if("counter"===c.dynamicVariableType){let e=t.getVariable(n),a=t.getDynamicVariableToggleIsForward(n)??!0,i=t.getVariable(n)+c.increment*(a?1:-1);c.hasEnd&&(i=c.increment>0?m.clamp(i,p,c.endValue):m.clamp(i,c.endValue,p),i===p&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?i===c.endValue&&(i=p):(i===p||i===c.endValue)&&t.setDynamicVariablePlayState(n,"Paused")),i!==e&&(s.push(n),t.updateVariable(n,i),this.eventManager.requestRender())}else if("time"===c.dynamicVariableType){let a=t.getVariable(n),r=e(i,c);if("object"==typeof a&&"textValue"in a&&"object"==typeof r&&"textValue"in r){if(Array.isArray(a.textValue)&&Array.isArray(r.textValue)){if(a.textValue.every((e,a)=>e===r.textValue[a]))continue}else if(a.textValue===r.textValue)continue}else if(a===r)continue;t.updateVariable(n,r),s.push(n),this.eventManager.requestRender()}else{let e=h.isTextValue(c.endValue)?w(c.endValue.textValue):c.endValue,i=t.getDynamicVariableToggleIsForward(n)??!0,d=u+(a-o)/1e3*("timer"===c.dynamicVariableType?-1:1)*(i?1:-1);d=Math.max(d,0),c.hasEnd&&(d="stopwatch"===c.dynamicVariableType?m.clamp(d,p,e):m.clamp(d,e,p),d===p&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1)&&(d=p):(Math.abs(d-p)<("number3decimal"===c.format?1e-4:.1)||Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1))&&t.setDynamicVariablePlayState(n,"Paused")),d!==u&&(s.push(n),this.dynamicVars[r].timerSeconds=d,t.updateVariable(n,l.getFormattedTimerTime(d,c)),this.eventManager.requestRender())}}}else this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y}let n=!1;t.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=t.mouseProperty,n=!0);let d=!1;t.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=t.raycastProperty,d=!0),this.events.forEach(e=>{(s.includes(e.data.variableId)||r.find(a=>a.objId===e.data.objectId&&a.property===e.data.property)||"mouseProperty"===e.data.variableId&&n||"raycastProperty"===e.data.variableId&&d)&&(e.dispatch(),this.eventManager.requestRender())})},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()}}pause(){this.isOutOfFocus||(this.isOutOfFocus=!0,this.pauseTime=Date.now())}resume(){if(!this.isOutOfFocus)return;this.isOutOfFocus=!1;let e=Date.now()-this.pauseTime;for(let a=0;a<this.dynamicVars.length;a++)this.dynamicVars[a].last+=e,this.dynamicVars[a].expectedTime+=e}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"VariableChange"===e.data.type&&!e.data.disabled).forEach(a=>{this.events.push(new P(a.id,a.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.propertiesToWatch=this.events.filter(e=>"objectProperty"===e.data.variableId&&null!==e.data.objectId).map(e=>({objectId:e.data.objectId,property:e.data.property,prevValue:null}));let a=this.eventContext.sharedAssets;this.sharedVariables.forEach(({id:t,data:i})=>{if(!("dynamicVariableType"in i))return void(this.events.find(e=>e.data.variableId===t)&&this.variablesToWatch.push({id:t,prevValue:a.getVariable(t)}));let s;if("timer"===i.dynamicVariableType||"stopwatch"===i.dynamicVariableType){let e;if(h.isTextValue(i.value)&&Array.isArray(i.value.textValue)){let a=i.value.textValue;e=3===a.length?a[2]+60*a[1]+3600*a[0]:a[1]+60*a[0]}else e=i.value;s=e,this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,timerSeconds:e,startValue:s})}else"time"===i.dynamicVariableType&&a.updateVariable(t,e(new Date,i)),"counter"===i.dynamicVariableType&&(s=h.isTextValue(i.value)?w(i.value.textValue):i.value),this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,startValue:s})}),this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach(e=>e.dispose())}},P=class{constructor(e,a,t,i,s,r){this.id=e,this.data=a,this.object=t,this.actions=n(a,a.actions,i,s,r,t)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{!e.shouldReinit()||(e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init())}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.TimelineAnimation.forEach(e=>e.dispatchConditional()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispose(){d(this.actions)}};function w(e){return 3===e.length?e[2]+60*e[1]+3600*e[0]:e[1]+60*e[0]}var x=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=r(this.shared,this.condition)}dispatch(){if(!1===this.evaluatedCondition)return!1;let e=this.shared.getVariable(this.data.variableId),a=i(this.data.expression,this.shared,h.typeOfVariable(e));void 0!==a&&this.shared.updateVariable(this.data.variableId,"string"==typeof a?{textValue:a}:a)}dispose(){}},D=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.timeoutId=null}dispatchInner(){if(!1===r(this.shared,this.condition))return!1;let e=this.shared.getDynamicVariablePlayState(this.data.variableId);if("PlayPause"===this.data.mode)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"===e?"Paused":"Playing");else if("Play"===this.data.mode&&"Playing"!==e)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if("Stop"===this.data.mode&&"Stopped"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if("Pause"===this.data.mode&&"Paused"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if("Restart"===this.data.mode)this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if("Toggle"===this.data.mode){let a=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);"Playing"===e?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,void 0!==a&&!a):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!a),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let e=this.data.delay,a=this.shared.getDynamicVariablePlayState(this.data.variableId);"PlayPause"===this.data.mode&&"Playing"===a&&(e=this.data.pauseDelay),0!==e?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.dispatchInner()},e)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}};t("VariableChange",({eventContext:e,sharedVariables:a,eventManager:t,needsMouse:i,needsRaycast:s})=>new I(e,a,t,i,s)),s("SetVariable",({data:e,page:a,shared:t,actionCondition:i})=>new x(e,a,t,i)),s("DynamicVariablePlay",({data:e,page:a,shared:t,actionCondition:i})=>new D(e,a,t,i)),o("variables");
1
+ import{b as e}from"./runtime-chunk-TU4KDRKR.js";import{a,b as t}from"./runtime-chunk-DZNU62CT.js";import{a as i,b as s,e as r,f as n,g as d}from"./runtime-chunk-L6ERXCVI.js";import"./runtime-chunk-EFBUAWKV.js";import{a as o}from"./runtime-chunk-TZCHGFVF.js";import{Ga as h,Ha as l,v as c}from"./runtime-chunk-K3UQCG3P.js";import{Cc as m,Ec as u,Fc as p,Oc as y,Pc as V}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var b=new y,v=new p,f=new u,g=new p,T=new V,I=class extends a{constructor(a,t,i,s,r){super(a),this.sharedVariables=t,this.eventManager=i,this.needsMouse=s,this.needsRaycast=r,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.isOutOfFocus=!1,this.events=[],this.onFrame=a=>{let t=this.eventContext.sharedAssets;if(this.rafId=window.requestAnimationFrame(this.onFrame),this.isOutOfFocus)return;let i=new Date,s=[],r=[];for(let e=0;e<this.propertiesToWatch.length;e++){let{objectId:a,property:t,prevValue:i}=this.propertiesToWatch[e],s=this.eventContext.scene.find(a),n=c.propertyPaths[t];if("width"===n[0]||"height"===n[0]||"depth"===n[0])s=s.geometry.userData.parameters[n[0]];else if(("position"===n[0]||"rotation"===n[0]&&n.length>1)&&s.getPhysicsLocalMatrix?.(b))b.decompose(v,f,g),"position"===n[0]?s=n.length>1?v[n[1]]:v:(T.setFromQuaternion(f,s.rotation.order),s=T[n[1]]);else for(let e=0;e<n.length;e++)s=s[n[e]];null===i?this.propertiesToWatch[e].prevValue=s instanceof p?s.clone():s:(s instanceof p?!s.equals(i):i!==s)&&(r.push({objId:a,property:t}),s instanceof p?this.propertiesToWatch[e].prevValue.copy(s):this.propertiesToWatch[e].prevValue=s)}for(let e=0;e<this.variablesToWatch.length;e++){let{id:a,prevValue:i}=this.variablesToWatch[e],r=t.getVariable(a);r!==i&&(s.push(a),this.variablesToWatch[e].prevValue=r)}for(let r=0;r<this.dynamicVars.length;r++){let{id:n,expectedTime:d,last:o,data:c,timerSeconds:u,startValue:p}=this.dynamicVars[r],y=1e3;if("timer"!==c.dynamicVariableType&&"stopwatch"!==c.dynamicVariableType||"number3decimal"!==c.format?"counter"===c.dynamicVariableType?y=c.updateInterval:"random"===c.dynamicVariableType&&(y=c.isStatic?1/0:c.updateInterval):y=1,-1!==d){if("Stopped"!==t.getDynamicVariablePlayState(n)&&"Restarted"!==t.getDynamicVariablePlayState(n)||(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y,"counter"===c.dynamicVariableType&&t.getVariable(n)!==p&&(t.updateVariable(n,p),this.eventManager.requestRender()),("timer"===c.dynamicVariableType||"stopwatch"===c.dynamicVariableType)&&this.dynamicVars[r].timerSeconds!==p&&(this.dynamicVars[r].timerSeconds=p,t.updateVariable(n,l.getFormattedTimerTime(p,c)),this.eventManager.requestRender()),"Restarted"===t.getDynamicVariablePlayState(n)&&t.setDynamicVariablePlayState(n,"Playing"),"Stopped"!==t.getDynamicVariablePlayState(n))){if("Paused"===t.getDynamicVariablePlayState(n)){void 0===this.dynamicVars[r].deltaToExpectedTime&&(this.dynamicVars[r].deltaToExpectedTime=Math.max(this.dynamicVars[r].expectedTime-a,0)),this.dynamicVars[r].last=a-(y-this.dynamicVars[r].deltaToExpectedTime),this.dynamicVars[r].expectedTime=a+this.dynamicVars[r].deltaToExpectedTime;continue}if(this.dynamicVars[r].deltaToExpectedTime=void 0,a>=d)if(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime+=y,"random"===c.dynamicVariableType){let e=c.min+Math.random()*(c.max-c.min),a=c.decimals;e=Math.round(e*Math.pow(10,a))/Math.pow(10,a),t.updateVariable(n,e),s.push(n),this.eventManager.requestRender()}else if("counter"===c.dynamicVariableType){let e=t.getVariable(n),a=t.getDynamicVariableToggleIsForward(n)??!0,i=t.getVariable(n)+c.increment*(a?1:-1);c.hasEnd&&(i=c.increment>0?m.clamp(i,p,c.endValue):m.clamp(i,c.endValue,p),i===p&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?i===c.endValue&&(i=p):(i===p||i===c.endValue)&&t.setDynamicVariablePlayState(n,"Paused")),i!==e&&(s.push(n),t.updateVariable(n,i),this.eventManager.requestRender())}else if("time"===c.dynamicVariableType){let a=t.getVariable(n),r=e(i,c);if("object"==typeof a&&"textValue"in a&&"object"==typeof r&&"textValue"in r){if(Array.isArray(a.textValue)&&Array.isArray(r.textValue)){if(a.textValue.every((e,a)=>e===r.textValue[a]))continue}else if(a.textValue===r.textValue)continue}else if(a===r)continue;t.updateVariable(n,r),s.push(n),this.eventManager.requestRender()}else{let e=h.isTextValue(c.endValue)?w(c.endValue.textValue):c.endValue,i=t.getDynamicVariableToggleIsForward(n)??!0,d=u+(a-o)/1e3*("timer"===c.dynamicVariableType?-1:1)*(i?1:-1);d=Math.max(d,0),c.hasEnd&&(d="stopwatch"===c.dynamicVariableType?m.clamp(d,p,e):m.clamp(d,e,p),d===p&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1)&&(d=p):(Math.abs(d-p)<("number3decimal"===c.format?1e-4:.1)||Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1))&&t.setDynamicVariablePlayState(n,"Paused")),d!==u&&(s.push(n),this.dynamicVars[r].timerSeconds=d,t.updateVariable(n,l.getFormattedTimerTime(d,c)),this.eventManager.requestRender())}}}else this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y}let n=!1;t.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=t.mouseProperty,n=!0);let d=!1;t.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=t.raycastProperty,d=!0),this.events.forEach(e=>{(s.includes(e.data.variableId)||r.find(a=>a.objId===e.data.objectId&&a.property===e.data.property)||"mouseProperty"===e.data.variableId&&n||"raycastProperty"===e.data.variableId&&d)&&(e.dispatch(),this.eventManager.requestRender())})},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()}}pause(){this.isOutOfFocus||(this.isOutOfFocus=!0,this.pauseTime=Date.now())}resume(){if(!this.isOutOfFocus)return;this.isOutOfFocus=!1;let e=Date.now()-this.pauseTime;for(let a=0;a<this.dynamicVars.length;a++)this.dynamicVars[a].last+=e,this.dynamicVars[a].expectedTime+=e}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"VariableChange"===e.data.type&&!e.data.disabled).forEach(a=>{this.events.push(new P(a.id,a.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.propertiesToWatch=this.events.filter(e=>"objectProperty"===e.data.variableId&&null!==e.data.objectId).map(e=>({objectId:e.data.objectId,property:e.data.property,prevValue:null}));let a=this.eventContext.sharedAssets;this.sharedVariables.forEach(({id:t,data:i})=>{if(!("dynamicVariableType"in i))return void(this.events.find(e=>e.data.variableId===t)&&this.variablesToWatch.push({id:t,prevValue:a.getVariable(t)}));let s;if("timer"===i.dynamicVariableType||"stopwatch"===i.dynamicVariableType){let e;if(h.isTextValue(i.value)&&Array.isArray(i.value.textValue)){let a=i.value.textValue;e=3===a.length?a[2]+60*a[1]+3600*a[0]:a[1]+60*a[0]}else e=i.value;s=e,this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,timerSeconds:e,startValue:s})}else"time"===i.dynamicVariableType&&a.updateVariable(t,e(new Date,i)),"counter"===i.dynamicVariableType&&(s=h.isTextValue(i.value)?w(i.value.textValue):i.value),this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,startValue:s})}),this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach(e=>e.dispose())}},P=class{constructor(e,a,t,i,s,r){this.id=e,this.data=a,this.object=t,this.actions=n(a,a.actions,i,s,r,t)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{!e.shouldReinit()||(e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init())}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.TimelineAnimation.forEach(e=>e.dispatchConditional()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispose(){d(this.actions)}};function w(e){return 3===e.length?e[2]+60*e[1]+3600*e[0]:e[1]+60*e[0]}var x=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=r(this.shared,this.condition)}dispatch(){if(!1===this.evaluatedCondition)return!1;let e=this.shared.getVariable(this.data.variableId),a=i(this.data.expression,this.shared,h.typeOfVariable(e));void 0!==a&&this.shared.updateVariable(this.data.variableId,"string"==typeof a?{textValue:a}:a)}dispose(){}},D=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.timeoutId=null}dispatchInner(){if(!1===r(this.shared,this.condition))return!1;let e=this.shared.getDynamicVariablePlayState(this.data.variableId);if("PlayPause"===this.data.mode)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"===e?"Paused":"Playing");else if("Play"===this.data.mode&&"Playing"!==e)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if("Stop"===this.data.mode&&"Stopped"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if("Pause"===this.data.mode&&"Paused"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if("Restart"===this.data.mode)this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if("Toggle"===this.data.mode){let a=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);"Playing"===e?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,void 0!==a&&!a):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!a),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let e=this.data.delay,a=this.shared.getDynamicVariablePlayState(this.data.variableId);"PlayPause"===this.data.mode&&"Playing"===a&&(e=this.data.pauseDelay),0!==e?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.dispatchInner()},e)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}};t("VariableChange",({eventContext:e,sharedVariables:a,eventManager:t,needsMouse:i,needsRaycast:s})=>new I(e,a,t,i,s)),s("SetVariable",({data:e,page:a,shared:t,actionCondition:i})=>new x(e,a,t,i)),s("DynamicVariablePlay",({data:e,page:a,shared:t,actionCondition:i})=>new D(e,a,t,i)),o("variables");
@@ -1 +1 @@
1
- import{ia as t}from"./runtime-chunk-4OGX3VGG.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-P2RJUWN3.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
1
+ import{ia as t}from"./runtime-chunk-JB6TDVGN.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-PUFOPNOK.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
@@ -1 +1 @@
1
- import{c as t}from"./runtime-chunk-FQNSP44B.js";import{b as i,e}from"./runtime-chunk-M6FFVLT6.js";import{e as s}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var o=new Map,d=new Map,n=class{constructor(i,e,s){this.data=e,this.isPlayVideoAction=!0,this.delay=0,this.status="stopped";let{layerId:a,loop:n,volume:h,delay:l}=e;if(this.object=s,void 0===a)throw new Error("Missing property");let r=function(t,i){let e;if("material"in t){let s=t.material;e=Array.isArray(s)?t.material[0].layers.find(t=>t.uuid===i):t.material.layers.find(t=>t.uuid===i)}if(!e)return;let s=e.color?.texture?.image?.img??e.holders?.find(t=>t.isVideo)?.img;return s instanceof HTMLVideoElement?s:void 0}(s,a);r&&(this.videoElement=r,this.videoElement.loop=n===1/0,t&&(this.videoElement.autoplay=!0),void 0!==h&&(this.videoElement.volume=h)),void 0!==l&&(this.delay=l),d.has(s.uuid)?d.get(s.uuid).push(this):d.set(s.uuid,[this]),o.set(i,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let t=this.videoElement.play();void 0!==t&&t.then(t=>{}).catch(t=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}seek(t){return new Promise(i=>{if(!this.videoElement)return i();let e=this.videoElement.duration;if(e>0){let i=t%e;this.videoElement.currentTime=i}this.videoElement.addEventListener("seeked",()=>i(),{once:!0})})}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},h=class{constructor(t){this.data=t,this.isPauseVideoAction=!0}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=o.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=d.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t[this.data.interaction]()))}pauseAllVideos(){let t=[...d.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},l=class{constructor(t,i,e,s,a){if(this.data=i,this.shared=s,this.condition=a,"play"===i.interaction)this.interaction=new n(t,i,e);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new h(i)}}dispatchBasic(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}};i("Video",({id:t,data:i,object:e,shared:a,actionCondition:o})=>s(e)?null:new l(t,i,e,a,o)),a("video");
1
+ import{c as t}from"./runtime-chunk-FQNSP44B.js";import{b as i,e}from"./runtime-chunk-L6ERXCVI.js";import{e as s}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-EFBUAWKV.js";import{a}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-K3UQCG3P.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var o=new Map,d=new Map,n=class{constructor(i,e,s){this.data=e,this.isPlayVideoAction=!0,this.delay=0,this.status="stopped";let{layerId:a,loop:n,volume:h,delay:l}=e;if(this.object=s,void 0===a)throw new Error("Missing property");let r=function(t,i){let e;if("material"in t){let s=t.material;e=Array.isArray(s)?t.material[0].layers.find(t=>t.uuid===i):t.material.layers.find(t=>t.uuid===i)}if(!e)return;let s=e.color?.texture?.image?.img??e.holders?.find(t=>t.isVideo)?.img;return s instanceof HTMLVideoElement?s:void 0}(s,a);r&&(this.videoElement=r,this.videoElement.loop=n===1/0,t&&(this.videoElement.autoplay=!0),void 0!==h&&(this.videoElement.volume=h)),void 0!==l&&(this.delay=l),d.has(s.uuid)?d.get(s.uuid).push(this):d.set(s.uuid,[this]),o.set(i,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let t=this.videoElement.play();void 0!==t&&t.then(t=>{}).catch(t=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}seek(t){return new Promise(i=>{if(!this.videoElement)return i();let e=this.videoElement.duration;if(e>0){let i=t%e;this.videoElement.currentTime=i}this.videoElement.addEventListener("seeked",()=>i(),{once:!0})})}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},h=class{constructor(t){this.data=t,this.isPauseVideoAction=!0}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=o.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=d.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t[this.data.interaction]()))}pauseAllVideos(){let t=[...d.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},l=class{constructor(t,i,e,s,a){if(this.data=i,this.shared=s,this.condition=a,"play"===i.interaction)this.interaction=new n(t,i,e);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new h(i)}}dispatchBasic(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}};i("Video",({id:t,data:i,object:e,shared:a,actionCondition:o})=>s(e)?null:new l(t,i,e,a,o)),a("video");