@fps-games/editor-deployment 0.2.3-beta.3

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 (533) hide show
  1. package/bin/fps-editor-prepare.mjs +5 -0
  2. package/bin/fps-editor-server.mjs +2 -0
  3. package/licenses/THIRD_PARTY_NOTICES.txt +7 -0
  4. package/manifest.json +2685 -0
  5. package/npm-shrinkwrap.json +19 -0
  6. package/package.json +38 -0
  7. package/public/assets/abstractAudioBus-DKeLA-55.js +1 -0
  8. package/public/assets/animation-DY4Gs-Pw.js +1 -0
  9. package/public/assets/animation-DY4Gs-Pw.js.br +0 -0
  10. package/public/assets/animation-DY4Gs-Pw.js.gz +0 -0
  11. package/public/assets/animationGroup-BN6ExD_I.js +1 -0
  12. package/public/assets/animationGroup-BN6ExD_I.js.br +0 -0
  13. package/public/assets/animationGroup-BN6ExD_I.js.gz +0 -0
  14. package/public/assets/arcRotateCamera-BrOEThh0.js +1 -0
  15. package/public/assets/arcRotateCamera-BrOEThh0.js.br +0 -0
  16. package/public/assets/arcRotateCamera-BrOEThh0.js.gz +0 -0
  17. package/public/assets/babylon-core-BiQ_mrkl.js +1 -0
  18. package/public/assets/babylon-core-BiQ_mrkl.js.br +0 -0
  19. package/public/assets/babylon-core-BiQ_mrkl.js.gz +0 -0
  20. package/public/assets/babylon-core-DygJEuf6.js +13882 -0
  21. package/public/assets/babylon-core-DygJEuf6.js.br +0 -0
  22. package/public/assets/babylon-core-DygJEuf6.js.gz +0 -0
  23. package/public/assets/basisTextureLoader-BWwwG7Gw.js +1 -0
  24. package/public/assets/basisTextureLoader-BWwwG7Gw.js.br +0 -0
  25. package/public/assets/basisTextureLoader-BWwwG7Gw.js.gz +0 -0
  26. package/public/assets/bumpVertex-CzYtMFbI.js +177 -0
  27. package/public/assets/bumpVertex-CzYtMFbI.js.br +0 -0
  28. package/public/assets/bumpVertex-CzYtMFbI.js.gz +0 -0
  29. package/public/assets/bumpVertex-DIMp0NiU.js +173 -0
  30. package/public/assets/bumpVertex-DIMp0NiU.js.br +0 -0
  31. package/public/assets/bumpVertex-DIMp0NiU.js.gz +0 -0
  32. package/public/assets/chromaticAberration.fragment-BJhO9WeA.js +7 -0
  33. package/public/assets/chromaticAberration.fragment-BJhO9WeA.js.br +0 -0
  34. package/public/assets/chromaticAberration.fragment-BJhO9WeA.js.gz +0 -0
  35. package/public/assets/chromaticAberration.fragment-DEAEmyJy.js +6 -0
  36. package/public/assets/chromaticAberration.fragment-DEAEmyJy.js.br +0 -0
  37. package/public/assets/chromaticAberration.fragment-DEAEmyJy.js.gz +0 -0
  38. package/public/assets/circleOfConfusion.fragment-DGnleQIE.js +17 -0
  39. package/public/assets/circleOfConfusion.fragment-DGnleQIE.js.br +0 -0
  40. package/public/assets/circleOfConfusion.fragment-DGnleQIE.js.gz +0 -0
  41. package/public/assets/circleOfConfusion.fragment-DqQcLT7C.js +17 -0
  42. package/public/assets/circleOfConfusion.fragment-DqQcLT7C.js.br +0 -0
  43. package/public/assets/circleOfConfusion.fragment-DqQcLT7C.js.gz +0 -0
  44. package/public/assets/clipPlaneFragment-Da_1RMjt.js +46 -0
  45. package/public/assets/clipPlaneFragment-Da_1RMjt.js.br +0 -0
  46. package/public/assets/clipPlaneFragment-Da_1RMjt.js.gz +0 -0
  47. package/public/assets/clipPlaneVertex-B8PIfZU_.js +177 -0
  48. package/public/assets/clipPlaneVertex-B8PIfZU_.js.br +0 -0
  49. package/public/assets/clipPlaneVertex-B8PIfZU_.js.gz +0 -0
  50. package/public/assets/color.fragment-Bf62ouS6.js +20 -0
  51. package/public/assets/color.fragment-Bf62ouS6.js.br +0 -0
  52. package/public/assets/color.fragment-Bf62ouS6.js.gz +0 -0
  53. package/public/assets/color.fragment-DtJC5xR0.js +21 -0
  54. package/public/assets/color.fragment-DtJC5xR0.js.br +0 -0
  55. package/public/assets/color.fragment-DtJC5xR0.js.gz +0 -0
  56. package/public/assets/color.vertex-DYnzh3f-.js +39 -0
  57. package/public/assets/color.vertex-DYnzh3f-.js.br +0 -0
  58. package/public/assets/color.vertex-DYnzh3f-.js.gz +0 -0
  59. package/public/assets/color.vertex-foaAsgqw.js +32 -0
  60. package/public/assets/color.vertex-foaAsgqw.js.br +0 -0
  61. package/public/assets/color.vertex-foaAsgqw.js.gz +0 -0
  62. package/public/assets/dds-CbA4nCCq.js +1 -0
  63. package/public/assets/dds-CbA4nCCq.js.br +0 -0
  64. package/public/assets/dds-CbA4nCCq.js.gz +0 -0
  65. package/public/assets/ddsTextureLoader-Bwa3u-Gp.js +1 -0
  66. package/public/assets/ddsTextureLoader-Bwa3u-Gp.js.br +0 -0
  67. package/public/assets/ddsTextureLoader-Bwa3u-Gp.js.gz +0 -0
  68. package/public/assets/default.fragment-BKaVVFYF.js +526 -0
  69. package/public/assets/default.fragment-BKaVVFYF.js.br +0 -0
  70. package/public/assets/default.fragment-BKaVVFYF.js.gz +0 -0
  71. package/public/assets/default.fragment-DjNCicws.js +468 -0
  72. package/public/assets/default.fragment-DjNCicws.js.br +0 -0
  73. package/public/assets/default.fragment-DjNCicws.js.gz +0 -0
  74. package/public/assets/default.vertex-CKOvcJ54.js +193 -0
  75. package/public/assets/default.vertex-CKOvcJ54.js.br +0 -0
  76. package/public/assets/default.vertex-CKOvcJ54.js.gz +0 -0
  77. package/public/assets/default.vertex-DyPOsib0.js +181 -0
  78. package/public/assets/default.vertex-DyPOsib0.js.br +0 -0
  79. package/public/assets/default.vertex-DyPOsib0.js.gz +0 -0
  80. package/public/assets/defaultUboDeclaration-ChgZa3Dv.js +5 -0
  81. package/public/assets/defaultUboDeclaration-ChgZa3Dv.js.br +0 -0
  82. package/public/assets/defaultUboDeclaration-ChgZa3Dv.js.gz +0 -0
  83. package/public/assets/defaultUboDeclaration-Dzd2ch6X.js +7 -0
  84. package/public/assets/defaultUboDeclaration-Dzd2ch6X.js.br +0 -0
  85. package/public/assets/defaultUboDeclaration-Dzd2ch6X.js.gz +0 -0
  86. package/public/assets/depth.fragment-B9FDfPgW.js +40 -0
  87. package/public/assets/depth.fragment-B9FDfPgW.js.br +2 -0
  88. package/public/assets/depth.fragment-B9FDfPgW.js.gz +0 -0
  89. package/public/assets/depth.vertex-DXkbiW3p.js +57 -0
  90. package/public/assets/depth.vertex-DXkbiW3p.js.br +0 -0
  91. package/public/assets/depth.vertex-DXkbiW3p.js.gz +0 -0
  92. package/public/assets/depthBoxBlur.fragment-BlgJGCM0.js +6 -0
  93. package/public/assets/depthBoxBlur.fragment-BlgJGCM0.js.br +0 -0
  94. package/public/assets/depthBoxBlur.fragment-BlgJGCM0.js.gz +0 -0
  95. package/public/assets/depthBoxBlur.fragment-DUm61npj.js +5 -0
  96. package/public/assets/depthBoxBlur.fragment-DUm61npj.js.br +0 -0
  97. package/public/assets/depthBoxBlur.fragment-DUm61npj.js.gz +0 -0
  98. package/public/assets/depthOfFieldMerge.fragment-25hKWM62.js +21 -0
  99. package/public/assets/depthOfFieldMerge.fragment-25hKWM62.js.br +0 -0
  100. package/public/assets/depthOfFieldMerge.fragment-25hKWM62.js.gz +0 -0
  101. package/public/assets/depthOfFieldMerge.fragment-_d6h2qdf.js +26 -0
  102. package/public/assets/depthOfFieldMerge.fragment-_d6h2qdf.js.br +0 -0
  103. package/public/assets/depthOfFieldMerge.fragment-_d6h2qdf.js.gz +0 -0
  104. package/public/assets/easing-BkcTAuOI.js +1 -0
  105. package/public/assets/easing-BkcTAuOI.js.br +0 -0
  106. package/public/assets/easing-BkcTAuOI.js.gz +0 -0
  107. package/public/assets/editor-core-plugin-host-c2002442.js +1 -0
  108. package/public/assets/editor-core-plugin-host-c2002442.js.br +0 -0
  109. package/public/assets/editor-core-plugin-host-c2002442.js.gz +0 -0
  110. package/public/assets/exrTextureLoader-DD6CMgpF.js +1 -0
  111. package/public/assets/exrTextureLoader-DD6CMgpF.js.br +0 -0
  112. package/public/assets/exrTextureLoader-DD6CMgpF.js.gz +0 -0
  113. package/public/assets/flowGraphArrayIndexBlock-DAsvnV45.js +1 -0
  114. package/public/assets/flowGraphArrayIndexBlock-DAsvnV45.js.br +0 -0
  115. package/public/assets/flowGraphArrayIndexBlock-DAsvnV45.js.gz +0 -0
  116. package/public/assets/flowGraphBezierCurveEasingBlock-_sVLfNt3.js +1 -0
  117. package/public/assets/flowGraphBezierCurveEasingBlock-_sVLfNt3.js.br +0 -0
  118. package/public/assets/flowGraphBezierCurveEasingBlock-_sVLfNt3.js.gz +0 -0
  119. package/public/assets/flowGraphBinaryOperationBlock-D9lz9r7e.js +1 -0
  120. package/public/assets/flowGraphBinaryOperationBlock-D9lz9r7e.js.br +0 -0
  121. package/public/assets/flowGraphBinaryOperationBlock-D9lz9r7e.js.gz +0 -0
  122. package/public/assets/flowGraphBranchBlock-BMgiYImb.js +1 -0
  123. package/public/assets/flowGraphBranchBlock-BMgiYImb.js.br +0 -0
  124. package/public/assets/flowGraphBranchBlock-BMgiYImb.js.gz +0 -0
  125. package/public/assets/flowGraphCachedOperationBlock-CDf6OBvO.js +1 -0
  126. package/public/assets/flowGraphCachedOperationBlock-CDf6OBvO.js.br +0 -0
  127. package/public/assets/flowGraphCachedOperationBlock-CDf6OBvO.js.gz +0 -0
  128. package/public/assets/flowGraphCancelDelayBlock-BbyDVz48.js +1 -0
  129. package/public/assets/flowGraphCancelDelayBlock-BbyDVz48.js.br +0 -0
  130. package/public/assets/flowGraphCancelDelayBlock-BbyDVz48.js.gz +0 -0
  131. package/public/assets/flowGraphCodeExecutionBlock-fMRePVwn.js +1 -0
  132. package/public/assets/flowGraphCodeExecutionBlock-fMRePVwn.js.br +0 -0
  133. package/public/assets/flowGraphCodeExecutionBlock-fMRePVwn.js.gz +0 -0
  134. package/public/assets/flowGraphConditionalDataBlock-Db9HPH7K.js +1 -0
  135. package/public/assets/flowGraphConditionalDataBlock-Db9HPH7K.js.br +0 -0
  136. package/public/assets/flowGraphConditionalDataBlock-Db9HPH7K.js.gz +0 -0
  137. package/public/assets/flowGraphConsoleLogBlock-U9fcEDaX.js +1 -0
  138. package/public/assets/flowGraphConsoleLogBlock-U9fcEDaX.js.br +0 -0
  139. package/public/assets/flowGraphConsoleLogBlock-U9fcEDaX.js.gz +0 -0
  140. package/public/assets/flowGraphConstantBlock-CN1Myhpi.js +1 -0
  141. package/public/assets/flowGraphConstantBlock-CN1Myhpi.js.br +0 -0
  142. package/public/assets/flowGraphConstantBlock-CN1Myhpi.js.gz +0 -0
  143. package/public/assets/flowGraphContextBlock-BbRTNgI4.js +1 -0
  144. package/public/assets/flowGraphContextBlock-BbRTNgI4.js.br +0 -0
  145. package/public/assets/flowGraphContextBlock-BbRTNgI4.js.gz +0 -0
  146. package/public/assets/flowGraphCounterBlock-DTqShVsi.js +1 -0
  147. package/public/assets/flowGraphCounterBlock-DTqShVsi.js.br +0 -0
  148. package/public/assets/flowGraphCounterBlock-DTqShVsi.js.gz +0 -0
  149. package/public/assets/flowGraphDataSwitchBlock-BtEqygYT.js +1 -0
  150. package/public/assets/flowGraphDataSwitchBlock-BtEqygYT.js.br +0 -0
  151. package/public/assets/flowGraphDataSwitchBlock-BtEqygYT.js.gz +0 -0
  152. package/public/assets/flowGraphDebounceBlock-CNHFUJ8N.js +1 -0
  153. package/public/assets/flowGraphDebounceBlock-CNHFUJ8N.js.br +0 -0
  154. package/public/assets/flowGraphDebounceBlock-CNHFUJ8N.js.gz +0 -0
  155. package/public/assets/flowGraphDoNBlock-DfiUsh6W.js +1 -0
  156. package/public/assets/flowGraphDoNBlock-DfiUsh6W.js.br +0 -0
  157. package/public/assets/flowGraphDoNBlock-DfiUsh6W.js.gz +0 -0
  158. package/public/assets/flowGraphEasingBlock-BQz5MDh1.js +1 -0
  159. package/public/assets/flowGraphEasingBlock-BQz5MDh1.js.br +0 -0
  160. package/public/assets/flowGraphEasingBlock-BQz5MDh1.js.gz +0 -0
  161. package/public/assets/flowGraphFlipFlopBlock-FFeDrjtF.js +1 -0
  162. package/public/assets/flowGraphFlipFlopBlock-FFeDrjtF.js.br +0 -0
  163. package/public/assets/flowGraphFlipFlopBlock-FFeDrjtF.js.gz +0 -0
  164. package/public/assets/flowGraphForLoopBlock-CjPa-aIl.js +1 -0
  165. package/public/assets/flowGraphForLoopBlock-CjPa-aIl.js.br +0 -0
  166. package/public/assets/flowGraphForLoopBlock-CjPa-aIl.js.gz +0 -0
  167. package/public/assets/flowGraphFunctionReferenceBlock-CUUBvJaO.js +1 -0
  168. package/public/assets/flowGraphFunctionReferenceBlock-CUUBvJaO.js.br +0 -0
  169. package/public/assets/flowGraphFunctionReferenceBlock-CUUBvJaO.js.gz +0 -0
  170. package/public/assets/flowGraphGetAssetBlock-CuKntTUp.js +1 -0
  171. package/public/assets/flowGraphGetAssetBlock-CuKntTUp.js.br +0 -0
  172. package/public/assets/flowGraphGetAssetBlock-CuKntTUp.js.gz +0 -0
  173. package/public/assets/flowGraphGetPropertyBlock-r3I5d5Pw.js +1 -0
  174. package/public/assets/flowGraphGetPropertyBlock-r3I5d5Pw.js.br +0 -0
  175. package/public/assets/flowGraphGetPropertyBlock-r3I5d5Pw.js.gz +0 -0
  176. package/public/assets/flowGraphGetVariableBlock-ByAhPias.js +1 -0
  177. package/public/assets/flowGraphGetVariableBlock-ByAhPias.js.br +0 -0
  178. package/public/assets/flowGraphGetVariableBlock-ByAhPias.js.gz +0 -0
  179. package/public/assets/flowGraphIndexOfBlock-kKyrBvN9.js +1 -0
  180. package/public/assets/flowGraphIndexOfBlock-kKyrBvN9.js.br +0 -0
  181. package/public/assets/flowGraphIndexOfBlock-kKyrBvN9.js.gz +0 -0
  182. package/public/assets/flowGraphInterpolationBlock-C1KggJs6.js +1 -0
  183. package/public/assets/flowGraphInterpolationBlock-C1KggJs6.js.br +0 -0
  184. package/public/assets/flowGraphInterpolationBlock-C1KggJs6.js.gz +0 -0
  185. package/public/assets/flowGraphJsonPointerParserBlock-Cq1Nm55u.js +1 -0
  186. package/public/assets/flowGraphJsonPointerParserBlock-Cq1Nm55u.js.br +0 -0
  187. package/public/assets/flowGraphJsonPointerParserBlock-Cq1Nm55u.js.gz +0 -0
  188. package/public/assets/flowGraphMathBlocks-DyKkUJIM.js +1 -0
  189. package/public/assets/flowGraphMathBlocks-DyKkUJIM.js.br +0 -0
  190. package/public/assets/flowGraphMathBlocks-DyKkUJIM.js.gz +0 -0
  191. package/public/assets/flowGraphMathCombineExtractBlocks-DWLx9Jo-.js +1 -0
  192. package/public/assets/flowGraphMathCombineExtractBlocks-DWLx9Jo-.js.br +0 -0
  193. package/public/assets/flowGraphMathCombineExtractBlocks-DWLx9Jo-.js.gz +0 -0
  194. package/public/assets/flowGraphMatrixMathBlocks-CEbyv5Ky.js +1 -0
  195. package/public/assets/flowGraphMatrixMathBlocks-CEbyv5Ky.js.br +0 -0
  196. package/public/assets/flowGraphMatrixMathBlocks-CEbyv5Ky.js.gz +0 -0
  197. package/public/assets/flowGraphMeshPickEventBlock-DBaLM4_x.js +1 -0
  198. package/public/assets/flowGraphMeshPickEventBlock-DBaLM4_x.js.br +0 -0
  199. package/public/assets/flowGraphMeshPickEventBlock-DBaLM4_x.js.gz +0 -0
  200. package/public/assets/flowGraphMultiGateBlock-0zKVRfwg.js +1 -0
  201. package/public/assets/flowGraphMultiGateBlock-0zKVRfwg.js.br +0 -0
  202. package/public/assets/flowGraphMultiGateBlock-0zKVRfwg.js.gz +0 -0
  203. package/public/assets/flowGraphPauseAnimationBlock-Cj1qZ8KL.js +1 -0
  204. package/public/assets/flowGraphPauseAnimationBlock-Cj1qZ8KL.js.br +0 -0
  205. package/public/assets/flowGraphPauseAnimationBlock-Cj1qZ8KL.js.gz +0 -0
  206. package/public/assets/flowGraphPlayAnimationBlock-CmNlz0tC.js +1 -0
  207. package/public/assets/flowGraphPlayAnimationBlock-CmNlz0tC.js.br +0 -0
  208. package/public/assets/flowGraphPlayAnimationBlock-CmNlz0tC.js.gz +0 -0
  209. package/public/assets/flowGraphPointerOutEventBlock-CksX91Wf.js +1 -0
  210. package/public/assets/flowGraphPointerOutEventBlock-CksX91Wf.js.br +4 -0
  211. package/public/assets/flowGraphPointerOutEventBlock-CksX91Wf.js.gz +0 -0
  212. package/public/assets/flowGraphPointerOverEventBlock-BAzWo2rO.js +1 -0
  213. package/public/assets/flowGraphPointerOverEventBlock-BAzWo2rO.js.br +0 -0
  214. package/public/assets/flowGraphPointerOverEventBlock-BAzWo2rO.js.gz +0 -0
  215. package/public/assets/flowGraphReceiveCustomEventBlock-DodatkWu.js +1 -0
  216. package/public/assets/flowGraphReceiveCustomEventBlock-DodatkWu.js.br +0 -0
  217. package/public/assets/flowGraphReceiveCustomEventBlock-DodatkWu.js.gz +0 -0
  218. package/public/assets/flowGraphSceneReadyEventBlock-CdZZEJxf.js +1 -0
  219. package/public/assets/flowGraphSceneReadyEventBlock-CdZZEJxf.js.br +0 -0
  220. package/public/assets/flowGraphSceneReadyEventBlock-CdZZEJxf.js.gz +0 -0
  221. package/public/assets/flowGraphSceneTickEventBlock-BO5xEA0D.js +1 -0
  222. package/public/assets/flowGraphSceneTickEventBlock-BO5xEA0D.js.br +0 -0
  223. package/public/assets/flowGraphSceneTickEventBlock-BO5xEA0D.js.gz +0 -0
  224. package/public/assets/flowGraphSendCustomEventBlock-BSbW6X-n.js +1 -0
  225. package/public/assets/flowGraphSendCustomEventBlock-BSbW6X-n.js.br +0 -0
  226. package/public/assets/flowGraphSendCustomEventBlock-BSbW6X-n.js.gz +0 -0
  227. package/public/assets/flowGraphSequenceBlock-Ppc6pXve.js +1 -0
  228. package/public/assets/flowGraphSequenceBlock-Ppc6pXve.js.br +0 -0
  229. package/public/assets/flowGraphSequenceBlock-Ppc6pXve.js.gz +0 -0
  230. package/public/assets/flowGraphSetDelayBlock-Ckikj9nw.js +1 -0
  231. package/public/assets/flowGraphSetDelayBlock-Ckikj9nw.js.br +0 -0
  232. package/public/assets/flowGraphSetDelayBlock-Ckikj9nw.js.gz +0 -0
  233. package/public/assets/flowGraphSetPropertyBlock-BgUzizbV.js +1 -0
  234. package/public/assets/flowGraphSetPropertyBlock-BgUzizbV.js.br +0 -0
  235. package/public/assets/flowGraphSetPropertyBlock-BgUzizbV.js.gz +0 -0
  236. package/public/assets/flowGraphSetVariableBlock-BdpCJTDy.js +1 -0
  237. package/public/assets/flowGraphSetVariableBlock-BdpCJTDy.js.br +0 -0
  238. package/public/assets/flowGraphSetVariableBlock-BdpCJTDy.js.gz +0 -0
  239. package/public/assets/flowGraphStopAnimationBlock-NXtDyWkx.js +1 -0
  240. package/public/assets/flowGraphStopAnimationBlock-NXtDyWkx.js.br +0 -0
  241. package/public/assets/flowGraphStopAnimationBlock-NXtDyWkx.js.gz +0 -0
  242. package/public/assets/flowGraphSwitchBlock-BtAbN5pw.js +1 -0
  243. package/public/assets/flowGraphSwitchBlock-BtAbN5pw.js.br +0 -0
  244. package/public/assets/flowGraphSwitchBlock-BtAbN5pw.js.gz +0 -0
  245. package/public/assets/flowGraphThrottleBlock-DouJgya1.js +1 -0
  246. package/public/assets/flowGraphThrottleBlock-DouJgya1.js.br +0 -0
  247. package/public/assets/flowGraphThrottleBlock-DouJgya1.js.gz +0 -0
  248. package/public/assets/flowGraphTransformCoordinatesSystemBlock-DnCim8eo.js +1 -0
  249. package/public/assets/flowGraphTransformCoordinatesSystemBlock-DnCim8eo.js.br +0 -0
  250. package/public/assets/flowGraphTransformCoordinatesSystemBlock-DnCim8eo.js.gz +0 -0
  251. package/public/assets/flowGraphTypeToTypeBlocks-DvTPkHj8.js +1 -0
  252. package/public/assets/flowGraphTypeToTypeBlocks-DvTPkHj8.js.br +4 -0
  253. package/public/assets/flowGraphTypeToTypeBlocks-DvTPkHj8.js.gz +0 -0
  254. package/public/assets/flowGraphUnaryOperationBlock-DfKZLa84.js +1 -0
  255. package/public/assets/flowGraphUnaryOperationBlock-DfKZLa84.js.br +0 -0
  256. package/public/assets/flowGraphUnaryOperationBlock-DfKZLa84.js.gz +0 -0
  257. package/public/assets/flowGraphVectorMathBlocks-BQCEcK0m.js +1 -0
  258. package/public/assets/flowGraphVectorMathBlocks-BQCEcK0m.js.br +0 -0
  259. package/public/assets/flowGraphVectorMathBlocks-BQCEcK0m.js.gz +0 -0
  260. package/public/assets/flowGraphWaitAllBlock-ClqfM5vn.js +1 -0
  261. package/public/assets/flowGraphWaitAllBlock-ClqfM5vn.js.br +0 -0
  262. package/public/assets/flowGraphWaitAllBlock-ClqfM5vn.js.gz +0 -0
  263. package/public/assets/flowGraphWhileLoopBlock-DkTf5x3Z.js +1 -0
  264. package/public/assets/flowGraphWhileLoopBlock-DkTf5x3Z.js.br +0 -0
  265. package/public/assets/flowGraphWhileLoopBlock-DkTf5x3Z.js.gz +0 -0
  266. package/public/assets/fogFragmentDeclaration-CJgnG_Ui.js +22 -0
  267. package/public/assets/fogFragmentDeclaration-CJgnG_Ui.js.br +0 -0
  268. package/public/assets/fogFragmentDeclaration-CJgnG_Ui.js.gz +0 -0
  269. package/public/assets/fogFragmentDeclaration-Dk_KLGI0.js +23 -0
  270. package/public/assets/fogFragmentDeclaration-Dk_KLGI0.js.br +0 -0
  271. package/public/assets/fogFragmentDeclaration-Dk_KLGI0.js.gz +0 -0
  272. package/public/assets/glowBlurPostProcess.fragment-BmoPp0DJ.js +7 -0
  273. package/public/assets/glowBlurPostProcess.fragment-BmoPp0DJ.js.br +0 -0
  274. package/public/assets/glowBlurPostProcess.fragment-BmoPp0DJ.js.gz +0 -0
  275. package/public/assets/glowBlurPostProcess.fragment-DSvlweiI.js +7 -0
  276. package/public/assets/glowBlurPostProcess.fragment-DSvlweiI.js.br +0 -0
  277. package/public/assets/glowBlurPostProcess.fragment-DSvlweiI.js.gz +0 -0
  278. package/public/assets/glowMapGeneration.fragment-BmCna86b.js +63 -0
  279. package/public/assets/glowMapGeneration.fragment-BmCna86b.js.br +0 -0
  280. package/public/assets/glowMapGeneration.fragment-BmCna86b.js.gz +0 -0
  281. package/public/assets/glowMapGeneration.fragment-Bx0somqR.js +63 -0
  282. package/public/assets/glowMapGeneration.fragment-Bx0somqR.js.br +0 -0
  283. package/public/assets/glowMapGeneration.fragment-Bx0somqR.js.gz +0 -0
  284. package/public/assets/glowMapGeneration.vertex-C_K1FVYg.js +75 -0
  285. package/public/assets/glowMapGeneration.vertex-C_K1FVYg.js.br +0 -0
  286. package/public/assets/glowMapGeneration.vertex-C_K1FVYg.js.gz +0 -0
  287. package/public/assets/glowMapGeneration.vertex-Fp7OnH6p.js +75 -0
  288. package/public/assets/glowMapGeneration.vertex-Fp7OnH6p.js.br +0 -0
  289. package/public/assets/glowMapGeneration.vertex-Fp7OnH6p.js.gz +0 -0
  290. package/public/assets/glowMapMerge.fragment-0u_W2SCj.js +25 -0
  291. package/public/assets/glowMapMerge.fragment-0u_W2SCj.js.br +0 -0
  292. package/public/assets/glowMapMerge.fragment-0u_W2SCj.js.gz +0 -0
  293. package/public/assets/glowMapMerge.fragment-DbrUnHjm.js +23 -0
  294. package/public/assets/glowMapMerge.fragment-DbrUnHjm.js.br +0 -0
  295. package/public/assets/glowMapMerge.fragment-DbrUnHjm.js.gz +0 -0
  296. package/public/assets/glowMapMerge.vertex-CuTJKa7K.js +7 -0
  297. package/public/assets/glowMapMerge.vertex-CuTJKa7K.js.br +0 -0
  298. package/public/assets/glowMapMerge.vertex-CuTJKa7K.js.gz +0 -0
  299. package/public/assets/glowMapMerge.vertex-DAvXVsHl.js +8 -0
  300. package/public/assets/glowMapMerge.vertex-DAvXVsHl.js.br +0 -0
  301. package/public/assets/glowMapMerge.vertex-DAvXVsHl.js.gz +0 -0
  302. package/public/assets/grain.fragment-6VtM1VfQ.js +6 -0
  303. package/public/assets/grain.fragment-6VtM1VfQ.js.br +0 -0
  304. package/public/assets/grain.fragment-6VtM1VfQ.js.gz +0 -0
  305. package/public/assets/grain.fragment-DDSnqVVY.js +5 -0
  306. package/public/assets/grain.fragment-DDSnqVVY.js.br +4 -1
  307. package/public/assets/grain.fragment-DDSnqVVY.js.gz +0 -0
  308. package/public/assets/harmonicsFunctions-BKiAKdWL.js +189 -0
  309. package/public/assets/harmonicsFunctions-BKiAKdWL.js.br +0 -0
  310. package/public/assets/harmonicsFunctions-BKiAKdWL.js.gz +0 -0
  311. package/public/assets/harmonicsFunctions-BdFr0SEn.js +192 -0
  312. package/public/assets/harmonicsFunctions-BdFr0SEn.js.br +0 -0
  313. package/public/assets/harmonicsFunctions-BdFr0SEn.js.gz +0 -0
  314. package/public/assets/hdrTextureLoader-BZMtuzrh.js +2 -0
  315. package/public/assets/hdrTextureLoader-BZMtuzrh.js.br +0 -0
  316. package/public/assets/hdrTextureLoader-BZMtuzrh.js.gz +0 -0
  317. package/public/assets/hemisphericLight-BF-Si7a7.js +1 -0
  318. package/public/assets/hemisphericLight-BF-Si7a7.js.br +0 -0
  319. package/public/assets/hemisphericLight-BF-Si7a7.js.gz +0 -0
  320. package/public/assets/iesTextureLoader-CfjtMyLq.js +2 -0
  321. package/public/assets/iesTextureLoader-CfjtMyLq.js.br +0 -0
  322. package/public/assets/iesTextureLoader-CfjtMyLq.js.gz +0 -0
  323. package/public/assets/index-Bc_2vm3Z.js +4 -0
  324. package/public/assets/index-Bc_2vm3Z.js.br +0 -0
  325. package/public/assets/index-Bc_2vm3Z.js.gz +0 -0
  326. package/public/assets/index-DKM_mvsP.js +1 -0
  327. package/public/assets/index-DKM_mvsP.js.br +0 -0
  328. package/public/assets/index-DKM_mvsP.js.gz +0 -0
  329. package/public/assets/instancesDeclaration-DpE3Y0C1.js +23 -0
  330. package/public/assets/instancesDeclaration-DpE3Y0C1.js.br +0 -0
  331. package/public/assets/instancesDeclaration-DpE3Y0C1.js.gz +0 -0
  332. package/public/assets/ktxTextureLoader-7eTZtvh5.js +1 -0
  333. package/public/assets/ktxTextureLoader-7eTZtvh5.js.br +0 -0
  334. package/public/assets/ktxTextureLoader-7eTZtvh5.js.gz +0 -0
  335. package/public/assets/lazy-BcZCe0kL.js +2 -0
  336. package/public/assets/lazy-BcZCe0kL.js.br +0 -0
  337. package/public/assets/lazy-BcZCe0kL.js.gz +0 -0
  338. package/public/assets/lod.fragment-CEfFyCdU.js +3 -0
  339. package/public/assets/lod.fragment-CEfFyCdU.js.br +0 -0
  340. package/public/assets/lod.fragment-CEfFyCdU.js.gz +0 -0
  341. package/public/assets/lod.fragment-DT0r7jVm.js +3 -0
  342. package/public/assets/lod.fragment-DT0r7jVm.js.br +0 -0
  343. package/public/assets/lod.fragment-DT0r7jVm.js.gz +0 -0
  344. package/public/assets/lodCube.fragment-BP5e9OXG.js +22 -0
  345. package/public/assets/lodCube.fragment-BP5e9OXG.js.br +0 -0
  346. package/public/assets/lodCube.fragment-BP5e9OXG.js.gz +0 -0
  347. package/public/assets/lodCube.fragment-mh7W3FpN.js +22 -0
  348. package/public/assets/lodCube.fragment-mh7W3FpN.js.br +0 -0
  349. package/public/assets/lodCube.fragment-mh7W3FpN.js.gz +0 -0
  350. package/public/assets/logDepthDeclaration-DapB3ji1.js +4 -0
  351. package/public/assets/logDepthDeclaration-_-FceU2g.js +4 -0
  352. package/public/assets/logDepthFragment-BowlR5UY.js +4 -0
  353. package/public/assets/logDepthFragment-D1ov0i96.js +4 -0
  354. package/public/assets/logDepthFragment-D1ov0i96.js.br +0 -0
  355. package/public/assets/logDepthFragment-D1ov0i96.js.gz +0 -0
  356. package/public/assets/logDepthVertex-dEn2jB_d.js +4 -0
  357. package/public/assets/logDepthVertex-dEn2jB_d.js.br +2 -0
  358. package/public/assets/logDepthVertex-dEn2jB_d.js.gz +0 -0
  359. package/public/assets/logDepthVertex-jWY57236.js +4 -0
  360. package/public/assets/logDepthVertex-jWY57236.js.br +3 -0
  361. package/public/assets/logDepthVertex-jWY57236.js.gz +0 -0
  362. package/public/assets/mainUVVaryingDeclaration-B-lJcjME.js +4 -0
  363. package/public/assets/mainUVVaryingDeclaration-D1LMmumw.js +4 -0
  364. package/public/assets/mesh.vertexData.functions-BXkNVxNr.js +1 -0
  365. package/public/assets/mesh.vertexData.functions-BXkNVxNr.js.br +0 -0
  366. package/public/assets/mesh.vertexData.functions-BXkNVxNr.js.gz +0 -0
  367. package/public/assets/meshUboDeclaration-B5FWJmqY.js +13 -0
  368. package/public/assets/meshUboDeclaration-B5FWJmqY.js.br +1 -0
  369. package/public/assets/meshUboDeclaration-B5FWJmqY.js.gz +0 -0
  370. package/public/assets/meshUboDeclaration-DthvNL2q.js +13 -0
  371. package/public/assets/meshUboDeclaration-DthvNL2q.js.br +0 -0
  372. package/public/assets/meshUboDeclaration-DthvNL2q.js.gz +0 -0
  373. package/public/assets/morphTargetsVertex-DHRA_mKb.js +100 -0
  374. package/public/assets/morphTargetsVertex-DHRA_mKb.js.br +0 -0
  375. package/public/assets/morphTargetsVertex-DHRA_mKb.js.gz +0 -0
  376. package/public/assets/oitFinalSimpleBlend.fragment-BDN2XF0x.js +2 -0
  377. package/public/assets/oitFinalSimpleBlend.fragment-BDN2XF0x.js.br +0 -0
  378. package/public/assets/oitFinalSimpleBlend.fragment-BDN2XF0x.js.gz +0 -0
  379. package/public/assets/oitFinalSimpleBlend.fragment-C5RtcXZE.js +3 -0
  380. package/public/assets/oitFinalSimpleBlend.fragment-C5RtcXZE.js.br +0 -0
  381. package/public/assets/oitFinalSimpleBlend.fragment-C5RtcXZE.js.gz +0 -0
  382. package/public/assets/oitFragment-CAXGfgFH.js +1202 -0
  383. package/public/assets/oitFragment-CAXGfgFH.js.br +0 -0
  384. package/public/assets/oitFragment-CAXGfgFH.js.gz +0 -0
  385. package/public/assets/oitFragment-ay081Wsi.js +1077 -0
  386. package/public/assets/oitFragment-ay081Wsi.js.br +0 -0
  387. package/public/assets/oitFragment-ay081Wsi.js.gz +0 -0
  388. package/public/assets/openpbrMaterial-KVtjwf0K.js +2 -0
  389. package/public/assets/openpbrMaterial-KVtjwf0K.js.br +0 -0
  390. package/public/assets/openpbrMaterial-KVtjwf0K.js.gz +0 -0
  391. package/public/assets/outline.fragment-BanVWYIB.js +21 -0
  392. package/public/assets/outline.fragment-BanVWYIB.js.br +0 -0
  393. package/public/assets/outline.fragment-BanVWYIB.js.gz +0 -0
  394. package/public/assets/outline.fragment-CFKJOJ3l.js +18 -0
  395. package/public/assets/outline.fragment-CFKJOJ3l.js.br +0 -0
  396. package/public/assets/outline.fragment-CFKJOJ3l.js.gz +0 -0
  397. package/public/assets/outline.vertex-1q1i1Z0k.js +47 -0
  398. package/public/assets/outline.vertex-1q1i1Z0k.js.br +0 -0
  399. package/public/assets/outline.vertex-1q1i1Z0k.js.gz +0 -0
  400. package/public/assets/outline.vertex-yrM712o1.js +47 -0
  401. package/public/assets/outline.vertex-yrM712o1.js.br +0 -0
  402. package/public/assets/outline.vertex-yrM712o1.js.gz +0 -0
  403. package/public/assets/passCube.fragment-4x9m1yB9.js +23 -0
  404. package/public/assets/passCube.fragment-4x9m1yB9.js.br +0 -0
  405. package/public/assets/passCube.fragment-4x9m1yB9.js.gz +0 -0
  406. package/public/assets/passCube.fragment-j0YEcfrM.js +23 -0
  407. package/public/assets/passCube.fragment-j0YEcfrM.js.br +3 -0
  408. package/public/assets/passCube.fragment-j0YEcfrM.js.gz +0 -0
  409. package/public/assets/pbr.fragment-D4c9Imut.js +3277 -0
  410. package/public/assets/pbr.fragment-D4c9Imut.js.br +0 -0
  411. package/public/assets/pbr.fragment-D4c9Imut.js.gz +0 -0
  412. package/public/assets/pbr.fragment-qKZeRSsL.js +3327 -0
  413. package/public/assets/pbr.fragment-qKZeRSsL.js.br +0 -0
  414. package/public/assets/pbr.fragment-qKZeRSsL.js.gz +0 -0
  415. package/public/assets/pbr.vertex-CNWuYREY.js +227 -0
  416. package/public/assets/pbr.vertex-CNWuYREY.js.br +0 -0
  417. package/public/assets/pbr.vertex-CNWuYREY.js.gz +0 -0
  418. package/public/assets/pbr.vertex-joJmxK7Z.js +357 -0
  419. package/public/assets/pbr.vertex-joJmxK7Z.js.br +0 -0
  420. package/public/assets/pbr.vertex-joJmxK7Z.js.gz +0 -0
  421. package/public/assets/playable-local-editor-entry-BpT9asOr.js +4 -0
  422. package/public/assets/playable-local-editor-entry-BpT9asOr.js.br +0 -0
  423. package/public/assets/playable-local-editor-entry-BpT9asOr.js.gz +0 -0
  424. package/public/assets/playable-sdk-CrJqCMfO.js +5074 -0
  425. package/public/assets/playable-sdk-CrJqCMfO.js.br +0 -0
  426. package/public/assets/playable-sdk-CrJqCMfO.js.gz +0 -0
  427. package/public/assets/rgbdDecode.fragment-DVQvgSkR.js +5 -0
  428. package/public/assets/rgbdDecode.fragment-DVQvgSkR.js.br +0 -0
  429. package/public/assets/rgbdDecode.fragment-DVQvgSkR.js.gz +0 -0
  430. package/public/assets/rgbdDecode.fragment-jfF24wPs.js +5 -0
  431. package/public/assets/rgbdDecode.fragment-jfF24wPs.js.br +0 -0
  432. package/public/assets/rgbdDecode.fragment-jfF24wPs.js.gz +0 -0
  433. package/public/assets/rgbdEncode.fragment-AWVgflWm.js +5 -0
  434. package/public/assets/rgbdEncode.fragment-AWVgflWm.js.br +0 -0
  435. package/public/assets/rgbdEncode.fragment-AWVgflWm.js.gz +0 -0
  436. package/public/assets/rgbdEncode.fragment-DZGlem9k.js +5 -0
  437. package/public/assets/rgbdEncode.fragment-DZGlem9k.js.br +0 -0
  438. package/public/assets/rgbdEncode.fragment-DZGlem9k.js.gz +0 -0
  439. package/public/assets/sceneLoader-BJz_3O1N.js +1 -0
  440. package/public/assets/sceneLoader-BJz_3O1N.js.br +0 -0
  441. package/public/assets/sceneLoader-BJz_3O1N.js.gz +0 -0
  442. package/public/assets/screenSpaceCurvature.fragment-B-CUjGj1.js +15 -0
  443. package/public/assets/screenSpaceCurvature.fragment-B-CUjGj1.js.br +0 -0
  444. package/public/assets/screenSpaceCurvature.fragment-B-CUjGj1.js.gz +0 -0
  445. package/public/assets/selection.fragment-G8Edn4iI.js +35 -0
  446. package/public/assets/selection.fragment-G8Edn4iI.js.br +0 -0
  447. package/public/assets/selection.fragment-G8Edn4iI.js.gz +0 -0
  448. package/public/assets/selection.fragment-lxotM05-.js +35 -0
  449. package/public/assets/selection.fragment-lxotM05-.js.br +0 -0
  450. package/public/assets/selection.fragment-lxotM05-.js.gz +0 -0
  451. package/public/assets/selection.vertex-BXV_f7Y2.js +74 -0
  452. package/public/assets/selection.vertex-BXV_f7Y2.js.br +0 -0
  453. package/public/assets/selection.vertex-BXV_f7Y2.js.gz +0 -0
  454. package/public/assets/selection.vertex-N4uHCMNz.js +73 -0
  455. package/public/assets/selection.vertex-N4uHCMNz.js.br +0 -0
  456. package/public/assets/selection.vertex-N4uHCMNz.js.gz +0 -0
  457. package/public/assets/selectionOutline.fragment-GI37GIN9.js +48 -0
  458. package/public/assets/selectionOutline.fragment-GI37GIN9.js.br +0 -0
  459. package/public/assets/selectionOutline.fragment-GI37GIN9.js.gz +0 -0
  460. package/public/assets/selectionOutline.fragment-Hvq4J9-Z.js +47 -0
  461. package/public/assets/selectionOutline.fragment-Hvq4J9-Z.js.br +0 -0
  462. package/public/assets/selectionOutline.fragment-Hvq4J9-Z.js.gz +0 -0
  463. package/public/assets/shadowMap.fragment-Bc5HgWvg.js +79 -0
  464. package/public/assets/shadowMap.fragment-Bc5HgWvg.js.br +0 -0
  465. package/public/assets/shadowMap.fragment-Bc5HgWvg.js.gz +0 -0
  466. package/public/assets/shadowMap.fragment-C43vlUxN.js +78 -0
  467. package/public/assets/shadowMap.fragment-C43vlUxN.js.br +0 -0
  468. package/public/assets/shadowMap.fragment-C43vlUxN.js.gz +0 -0
  469. package/public/assets/shadowMap.vertex-CneYEevu.js +119 -0
  470. package/public/assets/shadowMap.vertex-CneYEevu.js.br +0 -0
  471. package/public/assets/shadowMap.vertex-CneYEevu.js.gz +0 -0
  472. package/public/assets/shadowMap.vertex-DCmGPxPg.js +109 -0
  473. package/public/assets/shadowMap.vertex-DCmGPxPg.js.br +0 -0
  474. package/public/assets/shadowMap.vertex-DCmGPxPg.js.gz +0 -0
  475. package/public/assets/shadowMapFragmentSoftTransparentShadow-20DchIFl.js +4 -0
  476. package/public/assets/shadowMapFragmentSoftTransparentShadow-20DchIFl.js.br +0 -0
  477. package/public/assets/shadowMapFragmentSoftTransparentShadow-20DchIFl.js.gz +0 -0
  478. package/public/assets/shadowMapFragmentSoftTransparentShadow-CcyAwByw.js +4 -0
  479. package/public/assets/shadowMapFragmentSoftTransparentShadow-CcyAwByw.js.br +0 -0
  480. package/public/assets/shadowMapFragmentSoftTransparentShadow-CcyAwByw.js.gz +0 -0
  481. package/public/assets/sharpen.fragment-u0Zk00IW.js +8 -0
  482. package/public/assets/sharpen.fragment-u0Zk00IW.js.br +0 -0
  483. package/public/assets/sharpen.fragment-u0Zk00IW.js.gz +0 -0
  484. package/public/assets/standardMaterial-CgDYhl-K.js +1329 -0
  485. package/public/assets/standardMaterial-CgDYhl-K.js.br +0 -0
  486. package/public/assets/standardMaterial-CgDYhl-K.js.gz +0 -0
  487. package/public/assets/textureMerger.fragment-Bb06oGwL.js +84 -0
  488. package/public/assets/textureMerger.fragment-Bb06oGwL.js.br +0 -0
  489. package/public/assets/textureMerger.fragment-Bb06oGwL.js.gz +0 -0
  490. package/public/assets/textureMerger.fragment-yYgn-A7X.js +76 -0
  491. package/public/assets/textureMerger.fragment-yYgn-A7X.js.br +0 -0
  492. package/public/assets/textureMerger.fragment-yYgn-A7X.js.gz +0 -0
  493. package/public/assets/tgaTextureLoader-BD8cHb3T.js +1 -0
  494. package/public/assets/tgaTextureLoader-BD8cHb3T.js.br +0 -0
  495. package/public/assets/tgaTextureLoader-BD8cHb3T.js.gz +0 -0
  496. package/public/assets/vertexColorMixing-31u6kp3A.js +24 -0
  497. package/public/assets/vertexColorMixing-31u6kp3A.js.br +1 -0
  498. package/public/assets/vertexColorMixing-31u6kp3A.js.gz +0 -0
  499. package/public/assets/vertexColorMixing-CWKPQGdm.js +20 -0
  500. package/public/assets/vertexColorMixing-CWKPQGdm.js.br +0 -0
  501. package/public/assets/vertexColorMixing-CWKPQGdm.js.gz +0 -0
  502. package/public/assets/volumetricLightingBlendVolume.fragment-9wHUWZ30.js +11 -0
  503. package/public/assets/volumetricLightingBlendVolume.fragment-9wHUWZ30.js.br +0 -0
  504. package/public/assets/volumetricLightingBlendVolume.fragment-9wHUWZ30.js.gz +0 -0
  505. package/public/assets/volumetricLightingBlendVolume.fragment-N-9p72Fm.js +12 -0
  506. package/public/assets/volumetricLightingBlendVolume.fragment-N-9p72Fm.js.br +0 -0
  507. package/public/assets/volumetricLightingBlendVolume.fragment-N-9p72Fm.js.gz +0 -0
  508. package/public/assets/volumetricLightingRenderVolume.fragment-DJkHTox8.js +15 -0
  509. package/public/assets/volumetricLightingRenderVolume.fragment-DJkHTox8.js.br +0 -0
  510. package/public/assets/volumetricLightingRenderVolume.fragment-DJkHTox8.js.gz +0 -0
  511. package/public/assets/volumetricLightingRenderVolume.fragment-uuHa0TVJ.js +13 -0
  512. package/public/assets/volumetricLightingRenderVolume.fragment-uuHa0TVJ.js.br +0 -0
  513. package/public/assets/volumetricLightingRenderVolume.fragment-uuHa0TVJ.js.gz +0 -0
  514. package/public/assets/volumetricLightingRenderVolume.vertex-DR3E2COu.js +4 -0
  515. package/public/assets/volumetricLightingRenderVolume.vertex-DR3E2COu.js.br +0 -0
  516. package/public/assets/volumetricLightingRenderVolume.vertex-DR3E2COu.js.gz +0 -0
  517. package/public/assets/volumetricLightingRenderVolume.vertex-DhGKqZWW.js +5 -0
  518. package/public/assets/volumetricLightingRenderVolume.vertex-DhGKqZWW.js.br +0 -0
  519. package/public/assets/volumetricLightingRenderVolume.vertex-DhGKqZWW.js.gz +0 -0
  520. package/public/assets/webAudioBus-uR5af0TN.js +1 -0
  521. package/public/assets/webAudioBus-uR5af0TN.js.br +0 -0
  522. package/public/assets/webAudioBus-uR5af0TN.js.gz +0 -0
  523. package/public/assets/webAudioMainBus-B4JHk1VB.js +1 -0
  524. package/public/assets/webAudioMainBus-B4JHk1VB.js.br +0 -0
  525. package/public/assets/webAudioMainBus-B4JHk1VB.js.gz +0 -0
  526. package/public/assets/workerPool-H9Ji3mCo.js +1 -0
  527. package/public/assets/workerPool-H9Ji3mCo.js.br +2 -0
  528. package/public/assets/workerPool-H9Ji3mCo.js.gz +0 -0
  529. package/public/index.html +19 -0
  530. package/public/index.html.br +0 -0
  531. package/public/index.html.gz +0 -0
  532. package/runtime/editor-control-plane.mjs +5 -0
  533. package/worker/editor-service-worker.mjs +1 -0
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./webAudioBus-uR5af0TN.js","./abstractAudioBus-DKeLA-55.js","./webAudioMainBus-B4JHk1VB.js","./flowGraphPlayAnimationBlock-CmNlz0tC.js","./standardMaterial-CgDYhl-K.js","./animationGroup-BN6ExD_I.js","./animation-DY4Gs-Pw.js","./workerPool-H9Ji3mCo.js","./flowGraphStopAnimationBlock-NXtDyWkx.js","./flowGraphPauseAnimationBlock-Cj1qZ8KL.js","./flowGraphInterpolationBlock-C1KggJs6.js","./flowGraphSceneReadyEventBlock-CdZZEJxf.js","./flowGraphSceneTickEventBlock-BO5xEA0D.js","./flowGraphSendCustomEventBlock-BSbW6X-n.js","./flowGraphReceiveCustomEventBlock-DodatkWu.js","./flowGraphMeshPickEventBlock-DBaLM4_x.js","./flowGraphMathBlocks-DyKkUJIM.js","./flowGraphBinaryOperationBlock-D9lz9r7e.js","./flowGraphCachedOperationBlock-CDf6OBvO.js","./flowGraphUnaryOperationBlock-DfKZLa84.js","./flowGraphVectorMathBlocks-BQCEcK0m.js","./flowGraphMatrixMathBlocks-CEbyv5Ky.js","./flowGraphBranchBlock-BMgiYImb.js","./flowGraphSetDelayBlock-Ckikj9nw.js","./flowGraphCancelDelayBlock-BbyDVz48.js","./flowGraphCounterBlock-DTqShVsi.js","./flowGraphDebounceBlock-CNHFUJ8N.js","./flowGraphThrottleBlock-DouJgya1.js","./flowGraphDoNBlock-DfiUsh6W.js","./flowGraphFlipFlopBlock-FFeDrjtF.js","./flowGraphForLoopBlock-CjPa-aIl.js","./flowGraphMultiGateBlock-0zKVRfwg.js","./flowGraphSequenceBlock-Ppc6pXve.js","./flowGraphSwitchBlock-BtAbN5pw.js","./flowGraphWaitAllBlock-ClqfM5vn.js","./flowGraphWhileLoopBlock-DkTf5x3Z.js","./flowGraphConsoleLogBlock-U9fcEDaX.js","./flowGraphConditionalDataBlock-Db9HPH7K.js","./flowGraphConstantBlock-CN1Myhpi.js","./flowGraphTransformCoordinatesSystemBlock-DnCim8eo.js","./flowGraphGetAssetBlock-CuKntTUp.js","./flowGraphGetPropertyBlock-r3I5d5Pw.js","./flowGraphSetPropertyBlock-BgUzizbV.js","./flowGraphGetVariableBlock-ByAhPias.js","./flowGraphSetVariableBlock-BdpCJTDy.js","./flowGraphJsonPointerParserBlock-Cq1Nm55u.js","./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js","./flowGraphTypeToTypeBlocks-DvTPkHj8.js","./flowGraphEasingBlock-BQz5MDh1.js","./easing-BkcTAuOI.js","./flowGraphBezierCurveEasingBlock-_sVLfNt3.js","./flowGraphPointerOverEventBlock-BAzWo2rO.js","./flowGraphPointerOutEventBlock-CksX91Wf.js","./flowGraphContextBlock-BbRTNgI4.js","./flowGraphArrayIndexBlock-DAsvnV45.js","./flowGraphCodeExecutionBlock-fMRePVwn.js","./flowGraphIndexOfBlock-kKyrBvN9.js","./flowGraphFunctionReferenceBlock-CUUBvJaO.js","./flowGraphDataSwitchBlock-BtEqygYT.js","./pbr.vertex-CNWuYREY.js","./harmonicsFunctions-BdFr0SEn.js","./meshUboDeclaration-B5FWJmqY.js","./bumpVertex-CzYtMFbI.js","./mainUVVaryingDeclaration-D1LMmumw.js","./clipPlaneVertex-B8PIfZU_.js","./instancesDeclaration-DpE3Y0C1.js","./vertexColorMixing-31u6kp3A.js","./morphTargetsVertex-DHRA_mKb.js","./logDepthDeclaration-_-FceU2g.js","./logDepthVertex-jWY57236.js","./pbr.fragment-D4c9Imut.js","./oitFragment-ay081Wsi.js","./clipPlaneFragment-Da_1RMjt.js","./fogFragmentDeclaration-CJgnG_Ui.js","./logDepthFragment-D1ov0i96.js","./pbr.vertex-joJmxK7Z.js","./bumpVertex-DIMp0NiU.js","./harmonicsFunctions-BKiAKdWL.js","./meshUboDeclaration-DthvNL2q.js","./mainUVVaryingDeclaration-B-lJcjME.js","./vertexColorMixing-CWKPQGdm.js","./logDepthDeclaration-DapB3ji1.js","./logDepthVertex-dEn2jB_d.js","./pbr.fragment-qKZeRSsL.js","./oitFragment-CAXGfgFH.js","./fogFragmentDeclaration-Dk_KLGI0.js","./logDepthFragment-BowlR5UY.js"])))=>i.map(i=>d[i]);
2
+ import{P as ds,gC as y,eT as G,dt as b,dF as Ke,gh as H,bG as me,cS as Ft,di as N,c as Ot,gp as Lt,da as Me,Q as kt,gm as q,dv as Y,fN as Gt,em as _s,gN as qe,dJ as U,h2 as d,b as k,h0 as qs,e$ as Ee,g_ as Xs,fi as xe,fj as J,g as Ks,fQ as X,b7 as js,gB as je,gD as Tt,Y as z,Z as fs,h1 as h,io as m,eW as gt,e4 as Ut,fs as ps,iy as F,eV as Vt,hq as p,dq as ve,dl as Re,iq as oe,dn as T,eC as O,F as L,iz as Js,gE as w,dk as ke,fw as ms,bj as Zs,ek as Ht,bx as $s,cD as ei,eo as ti,ep as si,eq as ii,en as ni,eL as ri,dp as st,e as ai,cL as it,eN as oi,eB as ui,eF as li,eH as hi,eG as ci,ez as di,eD as _i,ey as fi,et as pi,eK as mi,s as Ti,v as gi,gg as Ne,w as Ai,t as Ei,z as xi,u as yi,D as Si,C as Ci,cO as Ii,eS as Ri,cN as bi,gs as wi,fm as Le,O as Ts,L as Mi,cf as Di,aZ as vi,g$ as Pi,cc as Qt,b2 as Bi}from"./standardMaterial-CgDYhl-K.js";import{a as zt,A as Wt}from"./animation-DY4Gs-Pw.js";import{A as Ni}from"./workerPool-H9Ji3mCo.js";class B extends Ke{get _matrix(){return this._compose(),this._localMatrix}set _matrix(e){e.updateFlag===this._localMatrix.updateFlag&&!this._needToCompose||(this._needToCompose=!1,this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose())}constructor(e,t,s=null,i=null,r=null,a=null,o=null){super(e,t.getScene(),!1),this.name=e,this.children=[],this.animations=[],this._index=null,this._scalingDeterminant=1,this._needToDecompose=!0,this._needToCompose=!1,this._linkedTransformNode=null,this._waitingTransformNodeId=null,this._waitingTransformNodeUniqueId=null,this._skeleton=t,this._localMatrix=i?.clone()??b.Identity(),this._restMatrix=r??this._localMatrix.clone(),this._bindMatrix=a??this._localMatrix.clone(),this._index=o,this._absoluteMatrix=new b,this._absoluteBindMatrix=new b,this._absoluteInverseBindMatrix=new b,this._finalMatrix=new b,t.bones.push(this),this.setParent(s,!1),this._updateAbsoluteBindMatrices()}getClassName(){return"Bone"}getSkeleton(){return this._skeleton}get parent(){return this._parentNode}getParent(){return this.parent}getChildren(){return this.children}getIndex(){return this._index===null?this.getSkeleton().bones.indexOf(this):this._index}set parent(e){this.setParent(e)}setParent(e,t=!0){if(this.parent!==e){if(this.parent){const s=this.parent.children.indexOf(this);s!==-1&&this.parent.children.splice(s,1)}this._parentNode=e,this.parent&&this.parent.children.push(this),t&&this._updateAbsoluteBindMatrices(),this.markAsDirty()}}getLocalMatrix(){return this._compose(),this._localMatrix}getBindMatrix(){return this._bindMatrix}getBaseMatrix(){return this.getBindMatrix()}getRestMatrix(){return this._restMatrix}getRestPose(){return this.getRestMatrix()}setRestMatrix(e){this._restMatrix.copyFrom(e)}setRestPose(e){this.setRestMatrix(e)}getBindPose(){return this.getBindMatrix()}setBindMatrix(e){this.updateMatrix(e)}setBindPose(e){this.setBindMatrix(e)}getFinalMatrix(){return this._finalMatrix}getWorldMatrix(){return this.getFinalMatrix()}returnToRest(){if(this._linkedTransformNode){const e=H.Vector3[0],t=H.Quaternion[0],s=H.Vector3[1];this.getRestMatrix().decompose(e,t,s),this._linkedTransformNode.position.copyFrom(s),this._linkedTransformNode.rotationQuaternion=this._linkedTransformNode.rotationQuaternion??G.Identity(),this._linkedTransformNode.rotationQuaternion.copyFrom(t),this._linkedTransformNode.scaling.copyFrom(e)}else this._matrix=this._restMatrix}getAbsoluteInverseBindMatrix(){return this._absoluteInverseBindMatrix}getInvertedAbsoluteTransform(){return this.getAbsoluteInverseBindMatrix()}getAbsoluteMatrix(){return this._skeleton.computeAbsoluteMatrices(),this._absoluteMatrix}getAbsoluteTransform(){return this.getAbsoluteMatrix()}linkTransformNode(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++}getTransformNode(){return this._linkedTransformNode}get position(){return this._decompose(),this._localPosition}set position(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()}get rotation(){return this.getRotation()}set rotation(e){this.setRotation(e)}get rotationQuaternion(){return this._decompose(),this._localRotation}set rotationQuaternion(e){this.setRotationQuaternion(e)}get scaling(){return this.getScale()}set scaling(e){this.setScale(e)}get animationPropertiesOverride(){return this._skeleton.animationPropertiesOverride}_decompose(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=y.Zero(),this._localRotation=G.Zero(),this._localPosition=y.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))}_compose(){if(this._needToCompose){if(!this._localScaling){this._needToCompose=!1;return}this._needToCompose=!1,b.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)}}updateMatrix(e,t=!0,s=!0){this._bindMatrix.copyFrom(e),t&&this._updateAbsoluteBindMatrices(),s?this._matrix=e:this.markAsDirty()}_updateAbsoluteBindMatrices(e,t=!0){if(e||(e=this._bindMatrix),this.parent?e.multiplyToRef(this.parent._absoluteBindMatrix,this._absoluteBindMatrix):this._absoluteBindMatrix.copyFrom(e),this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix),t)for(let s=0;s<this.children.length;s++)this.children[s]._updateAbsoluteBindMatrices();this._scalingDeterminant=this._absoluteBindMatrix.determinant()<0?-1:1}markAsDirty(){return this._currentRenderId++,this._childUpdateId++,this._skeleton._markAsDirty(),this}_markAsDirtyAndCompose(){this.markAsDirty(),this._needToCompose=!0}_markAsDirtyAndDecompose(){this.markAsDirty(),this._needToDecompose=!0}_updatePosition(e,t=0,s,i=!0){const r=this.getLocalMatrix();if(t==0)i?(r.addAtIndex(12,e.x),r.addAtIndex(13,e.y),r.addAtIndex(14,e.z)):r.setTranslationFromFloats(e.x,e.y,e.z);else{const a=B._TmpMats[0],o=B._TmpVecs[0];this.parent?(a.copyFrom(this.parent.getAbsoluteMatrix()),s&&a.multiplyToRef(s.getWorldMatrix(),a)):b.IdentityToRef(a),i&&a.setTranslationFromFloats(0,0,0),a.invert(),y.TransformCoordinatesToRef(e,a,o),i?(r.addAtIndex(12,o.x),r.addAtIndex(13,o.y),r.addAtIndex(14,o.z)):r.setTranslationFromFloats(o.x,o.y,o.z)}this._markAsDirtyAndDecompose()}translate(e,t=0,s){this._updatePosition(e,t,s,!0)}setPosition(e,t=0,s){this._updatePosition(e,t,s,!1)}setAbsolutePosition(e,t){this.setPosition(e,1,t)}scale(e,t,s,i=!1){const r=this.getLocalMatrix(),a=B._TmpMats[0];b.ScalingToRef(e,t,s,a),a.multiplyToRef(r,r),a.invert();for(const o of this.children){const u=o.getLocalMatrix();u.multiplyToRef(a,u),u.multiplyAtIndex(12,e),u.multiplyAtIndex(13,t),u.multiplyAtIndex(14,s),o._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),i)for(const o of this.children)o.scale(e,t,s,i)}setScale(e){this._decompose(),this._localScaling.copyFrom(e),this._markAsDirtyAndCompose()}getScale(){return this._decompose(),this._localScaling}getScaleToRef(e){this._decompose(),e.copyFrom(this._localScaling)}setYawPitchRoll(e,t,s,i=0,r){if(i===0){const u=B._TmpQuat;G.RotationYawPitchRollToRef(e,t,s,u),this.setRotationQuaternion(u,i,r);return}const a=B._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(a,r))return;const o=B._TmpMats[1];b.RotationYawPitchRollToRef(e,t,s,o),a.multiplyToRef(o,o),this._rotateWithMatrix(o,i,r)}rotate(e,t,s=0,i){const r=B._TmpMats[0];r.setTranslationFromFloats(0,0,0),b.RotationAxisToRef(e,t,r),this._rotateWithMatrix(r,s,i)}setAxisAngle(e,t,s=0,i){if(s===0){const o=B._TmpQuat;G.RotationAxisToRef(e,t,o),this.setRotationQuaternion(o,s,i);return}const r=B._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(r,i))return;const a=B._TmpMats[1];b.RotationAxisToRef(e,t,a),r.multiplyToRef(a,a),this._rotateWithMatrix(a,s,i)}setRotation(e,t=0,s){this.setYawPitchRoll(e.y,e.x,e.z,t,s)}setRotationQuaternion(e,t=0,s){if(t===0){this._decompose(),this._localRotation.copyFrom(e),this._markAsDirtyAndCompose();return}const i=B._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(i,s))return;const r=B._TmpMats[1];b.FromQuaternionToRef(e,r),i.multiplyToRef(r,r),this._rotateWithMatrix(r,t,s)}setRotationMatrix(e,t=0,s){if(t===0){const a=B._TmpQuat;G.FromRotationMatrixToRef(e,a),this.setRotationQuaternion(a,t,s);return}const i=B._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(i,s))return;const r=B._TmpMats[1];r.copyFrom(e),i.multiplyToRef(e,r),this._rotateWithMatrix(r,t,s)}_rotateWithMatrix(e,t=0,s){const i=this.getLocalMatrix(),r=i.m[12],a=i.m[13],o=i.m[14],u=this.getParent(),l=B._TmpMats[3],f=B._TmpMats[4];u&&t==1?(s?(l.copyFrom(s.getWorldMatrix()),u.getAbsoluteMatrix().multiplyToRef(l,l)):l.copyFrom(u.getAbsoluteMatrix()),f.copyFrom(l),f.invert(),i.multiplyToRef(l,i),i.multiplyToRef(e,i),i.multiplyToRef(f,i)):t==1&&s?(l.copyFrom(s.getWorldMatrix()),f.copyFrom(l),f.invert(),i.multiplyToRef(l,i),i.multiplyToRef(e,i),i.multiplyToRef(f,i)):i.multiplyToRef(e,i),i.setTranslationFromFloats(r,a,o),this._markAsDirtyAndDecompose()}_getAbsoluteInverseMatrixUnscaledToRef(e,t){const s=B._TmpMats[2];return e.copyFrom(this.getAbsoluteMatrix()),t?(e.multiplyToRef(t.getWorldMatrix(),e),b.ScalingToRef(t.scaling.x,t.scaling.y,t.scaling.z,s)):b.IdentityToRef(s),e.invert(),isNaN(e.m[0])?!1:(s.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(s,e),!0)}getPosition(e=0,t=null){const s=y.Zero();return this.getPositionToRef(e,t,s),s}getPositionToRef(e=0,t,s){if(e==0){const i=this.getLocalMatrix();s.x=i.m[12],s.y=i.m[13],s.z=i.m[14]}else{const i=B._TmpMats[0].copyFrom(this.getAbsoluteMatrix());t&&i.multiplyToRef(t.getWorldMatrix(),i),s.x=i.m[12],s.y=i.m[13],s.z=i.m[14]}}getAbsolutePosition(e=null){const t=y.Zero();return this.getPositionToRef(1,e,t),t}getAbsolutePositionToRef(e,t){this.getPositionToRef(1,e,t)}computeAbsoluteMatrices(){if(this._compose(),this.parent)this._localMatrix.multiplyToRef(this.parent._absoluteMatrix,this._absoluteMatrix);else{this._absoluteMatrix.copyFrom(this._localMatrix);const s=this._skeleton.getPoseMatrix();s&&this._absoluteMatrix.multiplyToRef(s,this._absoluteMatrix)}const e=this.children,t=e.length;for(let s=0;s<t;s++)e[s].computeAbsoluteMatrices()}computeAbsoluteTransforms(){this.computeAbsoluteMatrices()}getDirection(e,t=null){const s=y.Zero();return this.getDirectionToRef(e,t,s),s}getDirectionToRef(e,t=null,s){const i=B._TmpMats[0].copyFrom(this.getAbsoluteMatrix());t&&i.multiplyToRef(t.getWorldMatrix(),i),y.TransformNormalToRef(e,i,s),s.normalize()}getRotation(e=0,t=null){const s=y.Zero();return this.getRotationToRef(e,t,s),s}getRotationToRef(e=0,t=null,s){const i=B._TmpQuat;this.getRotationQuaternionToRef(e,t,i),i.toEulerAnglesToRef(s)}getRotationQuaternion(e=0,t=null){const s=G.Identity();return this.getRotationQuaternionToRef(e,t,s),s}getRotationQuaternionToRef(e=0,t=null,s){if(e==0)this._decompose(),s.copyFrom(this._localRotation);else{const i=B._TmpMats[0],r=this.getAbsoluteMatrix();t?r.multiplyToRef(t.getWorldMatrix(),i):i.copyFrom(r),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.decompose(void 0,s,void 0)}}getRotationMatrix(e=0,t){const s=b.Identity();return this.getRotationMatrixToRef(e,t,s),s}getRotationMatrixToRef(e=0,t,s){if(e==0)this.getLocalMatrix().getRotationMatrixToRef(s);else{const i=B._TmpMats[0],r=this.getAbsoluteMatrix();t?r.multiplyToRef(t.getWorldMatrix(),i):i.copyFrom(r),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.getRotationMatrixToRef(s)}}getAbsolutePositionFromLocal(e,t=null){const s=y.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,s),s}getAbsolutePositionFromLocalToRef(e,t=null,s){const i=B._TmpMats[0].copyFrom(this.getAbsoluteMatrix());t&&i.multiplyToRef(t.getWorldMatrix(),i),y.TransformCoordinatesToRef(e,i,s)}getLocalPositionFromAbsolute(e,t=null){const s=y.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,s),s}getLocalPositionFromAbsoluteToRef(e,t=null,s){const i=B._TmpMats[0].copyFrom(this.getAbsoluteMatrix());t&&i.multiplyToRef(t.getWorldMatrix(),i),i.invert(),y.TransformCoordinatesToRef(e,i,s)}setCurrentPoseAsRest(){this.setRestMatrix(this.getLocalMatrix())}dispose(){this._linkedTransformNode=null;const e=this._skeleton.bones.indexOf(this);if(e!==-1&&this._skeleton.bones.splice(e,1),this._parentNode&&this._parentNode.children){const t=this._parentNode.children,s=t.indexOf(this);s!==-1&&t.splice(s,1)}super.dispose()}}B._TmpVecs=ds(2,y.Zero);B._TmpQuat=G.Identity();B._TmpMats=ds(5,b.Identity);class gs{constructor(e,t,s){this.frame=e,this.action=t,this.onlyOnce=s,this.isDone=!1}_clone(){return new gs(this.frame,this.action,this.onlyOnce)}}class As{constructor(){this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.sounds=null,this.effectLayers=[],this.layers=[],this.reflectionProbes=[],this.spriteManagers=[]}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture=e}getNodes(){let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}}class Fi extends As{}class Oi{constructor(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]}dispose(){const e=this.rootNodes;for(const i of e)i.dispose();e.length=0;const t=this.skeletons;for(const i of t)i.dispose();t.length=0;const s=this.animationGroups;for(const i of s)i.dispose();s.length=0}}class Dr extends As{constructor(e){super(),this._wasAddedToScene=!1,e=e||me.LastCreatedScene,e&&(this.scene=e,this.proceduralTextures=[],e.onDisposeObservable.add(()=>{this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{for(const t of this.geometries)t._rebuild();for(const t of this.meshes)t._rebuild();for(const t of this.particleSystems)t.rebuild();for(const t of this.textures)t._rebuild();for(const t of this.spriteManagers)t.rebuild()}))}_topologicalSort(e){const t=new Map;for(const o of e)t.set(o.uniqueId,o);const s={dependsOn:new Map,dependedBy:new Map};for(const o of e){const u=o.uniqueId;s.dependsOn.set(u,new Set),s.dependedBy.set(u,new Set)}for(const o of e){const u=o.uniqueId,l=s.dependsOn.get(u);if(o instanceof Ft){const c=o.sourceMesh;t.has(c.uniqueId)&&(l.add(c.uniqueId),s.dependedBy.get(c.uniqueId).add(u))}const f=s.dependedBy.get(u);for(const c of o.getDescendants()){const E=c.uniqueId;t.has(E)&&(f.add(E),s.dependsOn.get(E).add(u))}}const i=[],r=[];for(const o of e){const u=o.uniqueId;s.dependsOn.get(u).size===0&&(r.push(o),t.delete(u))}const a=r;for(;a.length>0;){const o=a.shift();i.push(o);const u=s.dependedBy.get(o.uniqueId);for(const l of Array.from(u.values())){const f=s.dependsOn.get(l);f.delete(o.uniqueId),f.size===0&&t.get(l)&&(a.push(t.get(l)),t.delete(l))}}return t.size>0&&(N.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(o=>{N.Error(o.name)})),i}_addNodeAndDescendantsToList(e,t,s,i){if(!(!s||i&&!i(s)||t.has(s.uniqueId))){e.push(s),t.add(s.uniqueId);for(const r of s.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,r,i)}}_isNodeInContainer(e){return e instanceof Ot&&this.meshes.indexOf(e)!==-1||e instanceof Lt&&this.transformNodes.indexOf(e)!==-1||e instanceof Me&&this.lights.indexOf(e)!==-1||e instanceof kt&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return N.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return N.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return N.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return N.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;return!0}instantiateModelsToScene(e,t=!1,s){this._isValidHierarchy()||q.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const i={},r={},a=new Oi,o=[],u=[],l={doNotInstantiate:!0,...s},f=(_,x)=>{if(i[_.uniqueId]=x.uniqueId,r[x.uniqueId]=x,e&&(x.name=e(_.name)),x instanceof Y){const S=x;if(S.morphTargetManager){const I=_.morphTargetManager;S.morphTargetManager=I.clone();for(let D=0;D<I.numTargets;D++){const ne=I.getTarget(D),V=S.morphTargetManager.getTarget(D);i[ne.uniqueId]=V.uniqueId,r[V.uniqueId]=V}}}},c=[],E=new Set;for(const _ of this.transformNodes)_.parent===null&&this._addNodeAndDescendantsToList(c,E,_,l.predicate);for(const _ of this.meshes)_.parent===null&&this._addNodeAndDescendantsToList(c,E,_,l.predicate);const C=this._topologicalSort(c),g=(_,x)=>{if(f(_,x),_.parent){const S=i[_.parent.uniqueId],I=r[S];I?x.parent=I:x.parent=_.parent}if(x.position&&_.position&&x.position.copyFrom(_.position),x.rotationQuaternion&&_.rotationQuaternion&&x.rotationQuaternion.copyFrom(_.rotationQuaternion),x.rotation&&_.rotation&&x.rotation.copyFrom(_.rotation),x.scaling&&_.scaling&&x.scaling.copyFrom(_.scaling),x.material){const S=x;if(S.material)if(t){const I=_.material;if(u.indexOf(I)===-1){let D=I.clone(e?e(I.name):"Clone of "+I.name);if(u.push(I),i[I.uniqueId]=D.uniqueId,r[D.uniqueId]=D,I.getClassName()==="MultiMaterial"){const ne=I;for(const V of ne.subMaterials)V&&(D=V.clone(e?e(V.name):"Clone of "+V.name),u.push(V),i[V.uniqueId]=D.uniqueId,r[D.uniqueId]=D);ne.subMaterials=ne.subMaterials.map(V=>V&&r[i[V.uniqueId]])}}S.getClassName()!=="InstancedMesh"&&(S.material=r[i[I.uniqueId]])}else S.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(S.material)===-1&&this.scene.addMultiMaterial(S.material):this.scene.materials.indexOf(S.material)===-1&&this.scene.addMaterial(S.material)}x.parent===null&&a.rootNodes.push(x)};for(const _ of C)if(_.getClassName()==="InstancedMesh"){const x=_,S=x.sourceMesh,I=i[S.uniqueId],ne=(typeof I=="number"?r[I]:S).createInstance(x.name);g(x,ne)}else{let x=!0;_.getClassName()==="TransformNode"||_.getClassName()==="Node"||_.skeleton||!_.getTotalVertices||_.getTotalVertices()===0?x=!1:l.doNotInstantiate&&(typeof l.doNotInstantiate=="function"?x=!l.doNotInstantiate(_):x=!l.doNotInstantiate);const S=x?_.createInstance(`instance of ${_.name}`):_.clone(`Clone of ${_.name}`,null,!0);if(!S)throw new Error(`Could not clone or instantiate node on Asset Container ${_.name}`);g(_,S)}for(const _ of this.skeletons){if(l.predicate&&!l.predicate(_))continue;const x=_.clone(e?e(_.name):"Clone of "+_.name);for(const S of this.meshes)if(S.skeleton===_&&!S.isAnInstance){const I=r[i[S.uniqueId]];if(!I||I.isAnInstance||(I.skeleton=x,o.indexOf(x)!==-1))continue;o.push(x);for(const D of x.bones)D._linkedTransformNode&&(D._linkedTransformNode=r[i[D._linkedTransformNode.uniqueId]])}a.skeletons.push(x)}for(const _ of this.animationGroups){if(l.predicate&&!l.predicate(_))continue;const x=_.clone(e?e(_.name):"Clone of "+_.name,S=>r[i[S.uniqueId]]||S);a.animationGroups.push(x)}return a}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||q.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){const t=[];for(const s of this.cameras)e&&!e(s)||(this.scene.addCamera(s),t.push(s));for(const s of this.lights)e&&!e(s)||(this.scene.addLight(s),t.push(s));for(const s of this.meshes)e&&!e(s)||(this.scene.addMesh(s),t.push(s));for(const s of this.skeletons)e&&!e(s)||this.scene.addSkeleton(s);for(const s of this.animations)e&&!e(s)||this.scene.addAnimation(s);for(const s of this.animationGroups)e&&!e(s)||this.scene.addAnimationGroup(s);for(const s of this.multiMaterials)e&&!e(s)||this.scene.addMultiMaterial(s);for(const s of this.materials)e&&!e(s)||this.scene.addMaterial(s);for(const s of this.morphTargetManagers)e&&!e(s)||this.scene.addMorphTargetManager(s);for(const s of this.geometries)e&&!e(s)||this.scene.addGeometry(s);for(const s of this.transformNodes)e&&!e(s)||(this.scene.addTransformNode(s),t.push(s));for(const s of this.actionManagers)e&&!e(s)||this.scene.addActionManager(s);for(const s of this.textures)e&&!e(s)||this.scene.addTexture(s);for(const s of this.reflectionProbes)e&&!e(s)||this.scene.addReflectionProbe(s);for(const s of this.spriteManagers)e&&!e(s)||(this.scene.spriteManagers||(this.scene.spriteManagers=[]),this.scene.spriteManagers.push(s));if(t.length){const s=new Set(this.scene.meshes);for(const i of this.scene.lights)s.add(i);for(const i of this.scene.cameras)s.add(i);for(const i of this.scene.transformNodes)s.add(i);for(const i of this.skeletons)for(const r of i.bones)s.add(r);for(const i of t)i.parent&&!s.has(i.parent)&&(i.setParent?i.setParent(null):i.parent=null)}}removeAllFromScene(){this._isValidHierarchy()||q.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){for(const t of this.cameras)e&&!e(t)||this.scene.removeCamera(t);for(const t of this.lights)e&&!e(t)||this.scene.removeLight(t);for(const t of this.meshes)e&&!e(t)||this.scene.removeMesh(t,!0);for(const t of this.skeletons)e&&!e(t)||this.scene.removeSkeleton(t);for(const t of this.animations)e&&!e(t)||this.scene.removeAnimation(t);for(const t of this.animationGroups)e&&!e(t)||this.scene.removeAnimationGroup(t);for(const t of this.multiMaterials)e&&!e(t)||this.scene.removeMultiMaterial(t);for(const t of this.materials)e&&!e(t)||this.scene.removeMaterial(t);for(const t of this.morphTargetManagers)e&&!e(t)||this.scene.removeMorphTargetManager(t);for(const t of this.geometries)e&&!e(t)||this.scene.removeGeometry(t);for(const t of this.transformNodes)e&&!e(t)||this.scene.removeTransformNode(t);for(const t of this.actionManagers)e&&!e(t)||this.scene.removeActionManager(t);for(const t of this.textures)e&&!e(t)||this.scene.removeTexture(t);for(const t of this.reflectionProbes)e&&!e(t)||this.scene.removeReflectionProbe(t);for(const t of this.spriteManagers)if(!(e&&!e(t))&&this.scene.spriteManagers){const s=this.scene.spriteManagers.indexOf(t);s!==-1&&this.scene.spriteManagers.splice(s,1)}}dispose(){const e=this.cameras.slice(0);for(const _ of e)_.dispose();this.cameras.length=0;const t=this.lights.slice(0);for(const _ of t)_.dispose();this.lights.length=0;const s=this.meshes.slice(0);for(const _ of s)_.dispose();this.meshes.length=0;const i=this.skeletons.slice(0);for(const _ of i)_.dispose();this.skeletons.length=0;const r=this.animationGroups.slice(0);for(const _ of r)_.dispose();this.animationGroups.length=0;const a=this.multiMaterials.slice(0);for(const _ of a)_.dispose();this.multiMaterials.length=0;const o=this.materials.slice(0);for(const _ of o)_.dispose();this.materials.length=0;const u=this.geometries.slice(0);for(const _ of u)_.dispose();this.geometries.length=0;const l=this.transformNodes.slice(0);for(const _ of l)_.dispose();this.transformNodes.length=0;const f=this.actionManagers.slice(0);for(const _ of f)_.dispose();this.actionManagers.length=0;const c=this.textures.slice(0);for(const _ of c)_.dispose();this.textures.length=0;const E=this.reflectionProbes.slice(0);for(const _ of E)_.dispose();this.reflectionProbes.length=0;const C=this.morphTargetManagers.slice(0);for(const _ of C)_.dispose();this.morphTargetManagers.length=0;const g=this.spriteManagers.slice(0);for(const _ of g)_.dispose();this.spriteManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const _ of this.scene._serializableComponents)_.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,s){if(!(!e||!t))for(const i of e){let r=!0;if(s){for(const a of s)if(i===a){r=!1;break}}r&&(t.push(i),i._parentContainer=this)}}moveAllFromScene(e){this._wasAddedToScene=!1,e===void 0&&(e=new Fi);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||(t==="_environmentTexture"?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){const e=new Y("assetContainerRootMesh",this.scene);for(const t of this.meshes)t.parent||e.addChild(t);return this.meshes.unshift(e),e}mergeAnimationsTo(e=me.LastCreatedScene,t,s=null){if(!e)return N.Error("No scene available to merge animations to"),[];const i=s||(u=>{let l;const f=u.animations.length?u.animations[0].targetProperty:"",c=u.name.split(".").join("").split("_primitive")[0];switch(f){case"position":case"rotationQuaternion":l=e.getTransformNodeByName(u.name)||e.getTransformNodeByName(c);break;case"influence":l=e.getMorphTargetByName(u.name)||e.getMorphTargetByName(c);break;default:l=e.getNodeByName(u.name)||e.getNodeByName(c)}return l}),r=this.getNodes();for(const u of r){const l=i(u);if(l!==null){for(const f of u.animations){const c=l.animations.filter(E=>E.targetProperty===f.targetProperty);for(const E of c){const C=l.animations.indexOf(E,0);C>-1&&l.animations.splice(C,1)}}l.animations=l.animations.concat(u.animations)}}const a=[],o=this.animationGroups.slice();for(const u of o){a.push(u.clone(u.name,i));for(const l of u.animatables)l.stop()}for(const u of t){const l=i(u.target);l&&(e.beginAnimation(l,u.fromFrame,u.toFrame,u.loopAnimation,u.speedRatio,u.onAnimationEnd?u.onAnimationEnd:void 0,void 0,!0,void 0,u.onAnimationLoop?u.onAnimationLoop:void 0),e.stopAnimation(u.target))}return a}populateRootNodes(){this.rootNodes.length=0;for(const e of this.meshes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.transformNodes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.lights)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.cameras)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}addAllAssetsToContainer(e){if(!e)return;const t=[],s=new Set;for(t.push(e);t.length>0;){const i=t.pop();if(i instanceof Y?(i.geometry&&this.geometries.indexOf(i.geometry)===-1&&this.geometries.push(i.geometry),this.meshes.push(i)):i instanceof Ft?this.meshes.push(i):i instanceof Lt?this.transformNodes.push(i):i instanceof Me?this.lights.push(i):i instanceof kt&&this.cameras.push(i),i instanceof Ot){if(i.material&&this.materials.indexOf(i.material)===-1){this.materials.push(i.material);for(const r of i.material.getActiveTextures())this.textures.indexOf(r)===-1&&this.textures.push(r)}i.skeleton&&this.skeletons.indexOf(i.skeleton)===-1&&this.skeletons.push(i.skeleton),i.morphTargetManager&&this.morphTargetManagers.indexOf(i.morphTargetManager)===-1&&this.morphTargetManagers.push(i.morphTargetManager)}for(const r of i.getChildren())s.has(r)||t.push(r);s.add(i)}this.populateRootNodes()}_getByTags(e,t,s){if(t===void 0)return e;const i=[];for(const r in e){const a=e[r];Gt&&Gt.MatchesQuery(a,t)&&(!s||s(a))&&i.push(a)}return i}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialsByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}}const Se=[];function Li(){return Se.length===0?null:Se[Se.length-1]}class ki{constructor(e){this._mainBuses=new Set,this._sounds=new Set,this._soundsArray=null,this._nodes=new Set,this._defaultMainBus=null,this._parameterRampDuration=.01,Se.push(this),typeof e.parameterRampDuration=="number"&&(this.parameterRampDuration=e.parameterRampDuration)}get defaultMainBus(){return this._mainBuses.size===0?null:(this._defaultMainBus||(this._defaultMainBus=Array.from(this._mainBuses)[0]),this._defaultMainBus)}get parameterRampDuration(){return this._parameterRampDuration}set parameterRampDuration(e){this._parameterRampDuration=Math.max(0,e)}get sounds(){return this._soundsArray||(this._soundsArray=Array.from(this._sounds)),this._soundsArray}dispose(){Se.includes(this)&&Se.splice(Se.indexOf(this),1);const e=this._nodes.values();for(let t=e.next();!t.done;t=e.next())t.value.dispose();this._mainBuses.clear(),this._nodes.clear(),this._sounds.clear(),this._disposeSoundsArray(),this._defaultMainBus=null}unlockAsync(){return this.resumeAsync()}_addMainBus(e){this._mainBuses.add(e),this._addNode(e)}_removeMainBus(e){this._mainBuses.delete(e),this._defaultMainBus=null,this._removeNode(e)}_addNode(e){this._nodes.add(e)}_removeNode(e){this._nodes.delete(e)}_addSound(e){this._disposeSoundsArray(),this._sounds.add(e),this._addNode(e)}_removeSound(e){this._disposeSoundsArray(),this._sounds.delete(e),this._removeNode(e)}_disposeSoundsArray(){this._soundsArray&&(this._soundsArray.length=0,this._soundsArray=null)}}function be(n){if(n||(n=Li()),n)return n;throw new Error("No audio engine.")}function vr(n,e={},t=null){return t=be(t),t.createBusAsync(n,e)}function Pr(n,e={},t=null){return t=be(t),t.createMainBusAsync(n,e)}function Br(n,e={},t=null){return t=be(t),t.createMicrophoneSoundSourceAsync(n,e)}function Nr(n,e,t={},s=null){return s=be(s),s.createSoundAsync(n,e,t)}async function Fr(n,e={},t=null){return t=be(t),await t.createSoundBufferAsync(n,e)}function Or(n,e,t={},s=null){return s=be(s),s.createSoundSourceAsync(n,e,t)}function Lr(n,e,t={},s=null){return s=be(s),s.createStreamingSoundAsync(n,e,t)}const Gi={position:y.Zero(),rotation:y.Zero(),rotationQuaternion:new G};function Ui(n){return n.listenerEnabled||n.listenerMinUpdateTime!==void 0||n.listenerPosition!==void 0||n.listenerRotation!==void 0||n.listenerRotationQuaternion!==void 0}class Vi{}class ct{constructor(e){this._attachmentType=3,this._position=new y,this._rotationQuaternion=new G,this._sceneNode=null,this._useBoundingBox=!1,this.dispose=()=>{this.detach()},this._spatialAudioNode=e}get isAttached(){return this._sceneNode!==null}attach(e,t,s){this._sceneNode!==e&&(this.detach(),e&&(this._attachmentType=s,this._sceneNode=e,this._sceneNode.onDisposeObservable.add(this.dispose),this._useBoundingBox=t))}detach(){this._sceneNode?.onDisposeObservable.removeCallback(this.dispose),this._sceneNode=null}update(){this._attachmentType&1&&(this._useBoundingBox&&this._sceneNode.getBoundingInfo?this._position.copyFrom(this._sceneNode.getBoundingInfo().boundingBox.centerWorld):this._sceneNode?.getWorldMatrix().getTranslationToRef(this._position),this._spatialAudioNode.position.copyFrom(this._position),this._spatialAudioNode._updatePosition()),this._attachmentType&2&&(this._sceneNode?.getWorldMatrix().decompose(void 0,this._rotationQuaternion),this._spatialAudioNode.rotationQuaternion.copyFrom(this._rotationQuaternion),this._spatialAudioNode._updateRotation())}}class Hi extends Vi{constructor(){super(),this._attacherComponent=null,this._attacherComponent=new ct(this)}get isAttached(){return this._attacherComponent!==null&&this._attacherComponent.isAttached}attach(e,t=!1,s=3){this._attacherComponent||(this._attacherComponent=new ct(this)),this._attacherComponent.attach(e,t,s)}detach(){this._attacherComponent?.detach()}dispose(){this._attacherComponent?.dispose(),this._attacherComponent=null}setOptions(e){e.listenerMinUpdateTime!==void 0&&(this.minUpdateTime=e.listenerMinUpdateTime),e.listenerPosition&&(this.position=e.listenerPosition.clone()),e.listenerRotationQuaternion?this.rotationQuaternion=e.listenerRotationQuaternion.clone():e.listenerRotation?this.rotation=e.listenerRotation.clone():this.rotationQuaternion=Gi.rotationQuaternion.clone(),this.update()}}class Es{constructor(e,t,s){if(this._autoUpdate=!0,this._lastUpdateTime=0,this.minUpdateTime=0,!t)return;this.minUpdateTime=s;const i=()=>{if(!this._autoUpdate)return;let r=!1;if(0<this.minUpdateTime){const a=_s.Now;this._lastUpdateTime&&a-this._lastUpdateTime<this.minUpdateTime*1e3&&(r=!0),this._lastUpdateTime=a}r||e.update(),requestAnimationFrame(i)};requestAnimationFrame(i)}dispose(){this._autoUpdate=!1}}const Qi=new RegExp("\\.(\\w{3,4})($|\\?)"),pe=100,nt=new Float32Array([0,0]);let Fe=null,He=null,Qe=null;function zi(){if(!He){He=new Float32Array(pe);const n=1/(pe-1);let e=n;for(let t=1;t<pe;t++)He[t]=Math.exp(-11.512925464970227*(1-e)),e+=n}return He}function Wi(){if(!Qe){Qe=new Float32Array(pe);const n=1/pe;let e=n;for(let t=0;t<pe;t++)Qe[t]=1+Math.log10(e)/Math.log10(pe),e+=n}return Qe}function Yi(n,e,t){Fe||(Fe=new Float32Array(pe));let s;if(n==="linear")return nt[0]=e,nt[1]=t,nt;if(n==="exponential")s=zi();else if(n==="logarithmic")s=Wi();else throw new Error(`Unknown ramp shape: ${n}`);const i=Math.sign(t-e),r=Math.abs(t-e);if(i===1)for(let a=0;a<s.length;a++)Fe[a]=e+r*s[a];else{let a=pe-1;for(let o=0;o<s.length;o++,a--)Fe[o]=e-r*(1-s[a])}return Fe}function Oe(n){return n.replace(/#/gm,"%23")}function Yt(n){const{url:e,headers:t}=qe._CollectCustomizations(n);return Object.keys(t).length>0&&N.Warn("WebAudioStreamingSound: Custom request headers cannot be applied to a streaming <audio> element and will be ignored. To use custom headers with audio, switch to a static (non-streaming) sound which fetches the file up-front."),e}async function qi(n){const e=await qe.FetchAsync(n);if(!e.ok)throw new Error(`HTTP ${e.status} loading '${n}': ${e.statusText}`);const t=await e.arrayBuffer(),s=e.headers.get("Content-Type")??"";return{data:t,contentType:s}}const Xi=1e-6;let qt=!0;class Q{constructor(e,t){this._rampEndTime=0,this._engine=e,this._param=t,this._targetValue=t.value}get isRamping(){return this._engine.currentTime<this._rampEndTime}get targetValue(){return this._targetValue}set targetValue(e){this.setTargetValue(e)}get value(){return this._param.value}dispose(){this._param=null,this._engine=null}setTargetValue(e,t=null){if(!Number.isFinite(e)){N.Warn(`Attempted to set audio parameter to non-finite value: ${e}`);return}this._param.cancelScheduledValues(0);const s=typeof t?.shape=="string"?t.shape:"linear",i=this._engine.currentTime;if(s==="none"){this._param.value=this._targetValue=e,this._rampEndTime=i;return}let r=typeof t?.duration=="number"?Math.max(t.duration,this._engine.parameterRampDuration):this._engine.parameterRampDuration;if(this._targetValue=e,(r=Math.max(this._engine.parameterRampDuration,r))<Xi){this._param.setValueAtTime(e,i);return}try{this._param.setValueCurveAtTime(Yi(s,Number.isFinite(this._param.value)?this._param.value:0,e),i,r),this._rampEndTime=i+r}catch(a){qt&&(N.Warn(`Audio parameter ramping failed: ${a.message}`),qt=!1)}}}const rt=b.Zero(),at=new G,Xt=y.Zero(),Kt=y.Zero();function jt(n,e,t){const s=n._audioContext.listener;return s.forwardX&&s.forwardY&&s.forwardZ&&s.positionX&&s.positionY&&s.positionZ&&s.upX&&s.upY&&s.upZ?new Ki(n,e,t):new ji(n,e,t)}class xs extends Hi{constructor(e,t,s){super(),this._lastPosition=y.Zero(),this._lastRotation=y.Zero(),this._lastRotationQuaternion=new G,this.position=y.Zero(),this.rotation=y.Zero(),this.rotationQuaternion=new G,this._listener=e._audioContext.listener,this.engine=e,this._updaterComponent=new Es(this,t,s)}dispose(){super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}get minUpdateTime(){return this._updaterComponent.minUpdateTime}set minUpdateTime(e){this._updaterComponent.minUpdateTime=e}update(){this.isAttached?this._attacherComponent?.update():(this._updatePosition(),this._updateRotation())}_updatePosition(){this._lastPosition.equalsWithEpsilon(this.position)||(this._setWebAudioPosition(this.position),this._lastPosition.copyFrom(this.position))}_updateRotation(){if(!this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion))at.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion);else if(!this._lastRotation.equalsWithEpsilon(this.rotation))G.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,at),this._lastRotation.copyFrom(this.rotation);else return;b.FromQuaternionToRef(at,rt),y.TransformNormalToRef(y.RightHandedForwardReadOnly,rt,Xt),y.TransformNormalToRef(y.Up(),rt,Kt),this._setWebAudioOrientation(Xt,Kt)}}class Ki extends xs{constructor(e,t,s){super(e,t,s);const i=e._audioContext.listener;this._forwardX=new Q(e,i.forwardX),this._forwardY=new Q(e,i.forwardY),this._forwardZ=new Q(e,i.forwardZ),this._positionX=new Q(e,i.positionX),this._positionY=new Q(e,i.positionY),this._positionZ=new Q(e,i.positionZ),this._upX=new Q(e,i.upX),this._upY=new Q(e,i.upY),this._upZ=new Q(e,i.upZ)}_setWebAudioPosition(e){this.isAttached&&(this._positionX.isRamping||this._positionY.isRamping||this._positionZ.isRamping)||(this._positionX.targetValue=e.x,this._positionY.targetValue=e.y,this._positionZ.targetValue=e.z)}_setWebAudioOrientation(e,t){this.isAttached&&(this._forwardX.isRamping||this._forwardY.isRamping||this._forwardZ.isRamping||this._upX.isRamping||this._upY.isRamping||this._upZ.isRamping)||(this._forwardX.targetValue=e.x,this._forwardY.targetValue=e.y,this._forwardZ.targetValue=e.z,this._upX.targetValue=t.x,this._upY.targetValue=t.y,this._upZ.targetValue=t.z)}}class ji extends xs{_setWebAudioPosition(e){this._listener.setPosition(e.x,e.y,e.z)}_setWebAudioOrientation(e,t){this._listener.setOrientation(e.x,e.y,e.z,t.x,t.y,t.z)}}var Jt;(function(n){n[n.HAS_INPUTS=1]="HAS_INPUTS",n[n.HAS_OUTPUTS=2]="HAS_OUTPUTS",n[n.HAS_INPUTS_AND_OUTPUTS=3]="HAS_INPUTS_AND_OUTPUTS"})(Jt||(Jt={}));class At{constructor(e,t){this.onDisposeObservable=new U,this.engine=e,t&1&&(this._upstreamNodes=new Set),t&2&&(this._downstreamNodes=new Set)}dispose(){if(this._downstreamNodes){for(const e of Array.from(this._downstreamNodes))if(!this._disconnect(e))throw new Error("Disconnect failed");this._downstreamNodes.clear()}if(this._upstreamNodes){for(const e of Array.from(this._upstreamNodes))if(!e._disconnect(this))throw new Error("Disconnect failed");this._upstreamNodes.clear()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}_connect(e){return!this._downstreamNodes||this._downstreamNodes.has(e)||!e._onConnect(this)?!1:(this._downstreamNodes.add(e),!0)}_disconnect(e){return!this._downstreamNodes||!this._downstreamNodes.delete(e)?!1:e._onDisconnect(this)}_onConnect(e){return!this._upstreamNodes||this._upstreamNodes.has(e)?!1:(this._upstreamNodes.add(e),!0)}_onDisconnect(e){return this._upstreamNodes?.delete(e)??!1}}class ys extends At{constructor(e,t,s){super(t,s),this.onNameChangedObservable=new U,this._name=e}get name(){return this._name}set name(e){if(this._name===e)return;const t=this._name;this._name=e,this.onNameChangedObservable.notifyObservers({newName:e,oldName:t,node:this})}dispose(){super.dispose(),this.onNameChangedObservable.clear()}}class Ji extends At{constructor(e){super(e,1)}}class Zi extends Ji{constructor(e){super(e),this._setGainNode(new GainNode(e._audioContext))}dispose(){super.dispose(),this._volume.dispose(),this._gainNode.disconnect(),this._destinationNode.disconnect()}get _inNode(){return this._gainNode}set _inNode(e){this._gainNode!==e&&this._setGainNode(e)}get volume(){return this._volume.targetValue}set volume(e){this._volume.targetValue=e}get _destinationNode(){return this.engine._audioDestination}getClassName(){return"_WebAudioMainOut"}setVolume(e,t=null){this._volume.setTargetValue(e,t)}_setGainNode(e){this._gainNode!==e&&(this._gainNode?.disconnect(),e.connect(this._destinationNode),this._volume=new Q(this.engine,e.gain),this._gainNode=e)}}class $i{constructor(e,t){this._button=null,this._enabled=!0,this._style=null,this._onStateChanged=()=>{this._button&&(this._engine.state==="running"?this._hide():this._show())},this._engine=e;const s=t||me.LastCreatedEngine?.getInputElement()?.parentElement||document.body,i=(s?.offsetTop||0)+20;this._style=document.createElement("style"),this._style.appendChild(document.createTextNode(`.babylonUnmute{position:absolute;top:${i}px;margin-left:20px;height:40px;width:60px;background-color:rgba(51,51,51,0.7);background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");background-size:80%;background-repeat:no-repeat;background-position:center;background-position-y:4px;border:none;outline:none;transition:transform 0.125s ease-out;cursor:pointer;z-index:9999;}.babylonUnmute:hover{transform:scale(1.05)}`)),document.head.appendChild(this._style),this._button=document.createElement("button"),this._button.className="babylonUnmute",this._button.id="babylonUnmuteButton",this._button.addEventListener("click",()=>{this._engine.unlockAsync()}),s.appendChild(this._button),this._engine.stateChangedObservable.add(this._onStateChanged)}dispose(){this._button?.remove(),this._button=null,this._style?.remove(),this._style=null,this._engine.stateChangedObservable.removeCallback(this._onStateChanged)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,e?this._engine.state!=="running"&&this._show():this._hide()}_show(){!this._button||!this._enabled||(this._button.style.display="block")}_hide(){this._button&&(this._button.style.display="none")}}async function kr(n={}){const e=new Ss(n);return await e._initAsync(n),e}const en={aac:"audio/aac",ac3:"audio/ac3",flac:"audio/flac",m4a:"audio/mp4",mp3:'audio/mpeg; codecs="mp3"',mp4:"audio/mp4",ogg:'audio/ogg; codecs="vorbis"',wav:"audio/wav",webm:'audio/webm; codecs="vorbis"'};class Ss extends ki{constructor(e={}){super(e),this._audioContextStarted=!1,this._destinationNode=null,this._invalidFormats=new Set,this._isUpdating=!1,this._listener=null,this._listenerAutoUpdate=!0,this._listenerMinUpdateTime=0,this._pauseCalled=!1,this._resumeOnInteraction=!0,this._resumeOnPause=!0,this._resumeOnPauseRetryInterval=1e3,this._resumeOnPauseTimerId=null,this._resumePromise=null,this._silentHtmlAudio=null,this._unmuteUI=null,this._updateObservable=null,this._validFormats=new Set,this._volume=1,this._isUsingOfflineAudioContext=!1,this.isReadyPromise=new Promise(t=>{this._resolveIsReadyPromise=t}),this.stateChangedObservable=new U,this.userGestureObservable=new U,this._initAudioContextAsync=async()=>{this._audioContext.addEventListener("statechange",this._onAudioContextStateChange),this._mainOut=new Zi(this),this._mainOut.volume=this._volume,await this.createMainBusAsync("default")},this._onAudioContextStateChange=()=>{this.state==="running"&&(clearInterval(this._resumeOnPauseTimerId),this._audioContextStarted=!0,this._resumePromise=null),(this.state==="suspended"||this.state==="interrupted")&&this._audioContextStarted&&this._resumeOnPause&&!this._pauseCalled&&(clearInterval(this._resumeOnPauseTimerId),this._resumeOnPauseTimerId=setInterval(()=>{this.resumeAsync()},this._resumeOnPauseRetryInterval)),this.stateChangedObservable.notifyObservers(this.state)},this._onUserGestureAsync=async()=>{if(this._resumeOnInteraction&&await this._audioContext.resume(),!this._silentHtmlAudio){this._silentHtmlAudio=document.createElement("audio");const t=this._silentHtmlAudio;t.controls=!1,t.preload="auto",t.loop=!0,t.src="data:audio/wav;base64,UklGRjAAAABXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAAZGF0YQwAAAAAAAEA/v8CAP//AQA=",t.play()}this.userGestureObservable.notifyObservers()},this._startUpdating=()=>{if(!this._isUpdating)if(this._isUpdating=!0,this.state==="running")this._update();else{const t=()=>{this.state==="running"&&(this._update(),this.stateChangedObservable.removeCallback(t))};this.stateChangedObservable.add(t)}},this._update=()=>{this._updateObservable?.hasObservers()?(this._updateObservable.notifyObservers(),requestAnimationFrame(this._update)):this._isUpdating=!1},typeof e.listenerAutoUpdate=="boolean"&&(this._listenerAutoUpdate=e.listenerAutoUpdate),typeof e.listenerMinUpdateTime=="number"&&(this._listenerMinUpdateTime=e.listenerMinUpdateTime),this._volume=e.volume??1,e.audioContext?(this._isUsingOfflineAudioContext=e.audioContext instanceof OfflineAudioContext,this._audioContext=e.audioContext):this._audioContext=new AudioContext,e.disableDefaultUI||(this._unmuteUI=new $i(this,e.defaultUIParentElement))}async _initAsync(e){this._resumeOnInteraction=typeof e.resumeOnInteraction=="boolean"?e.resumeOnInteraction:!0,this._resumeOnPause=typeof e.resumeOnPause=="boolean"?e.resumeOnPause:!0,this._resumeOnPauseRetryInterval=e.resumeOnPauseRetryInterval??1e3,document.addEventListener("click",this._onUserGestureAsync),await this._initAudioContextAsync(),Ui(e)&&(this._listener=jt(this,this._listenerAutoUpdate,this._listenerMinUpdateTime),this._listener.setOptions(e)),this._resolveIsReadyPromise()}get currentTime(){return this._audioContext.currentTime??0}get _inNode(){return this._audioContext.destination}get mainOut(){return this._mainOut}get listener(){return this._listener??(this._listener=jt(this,this._listenerAutoUpdate,this._listenerMinUpdateTime))}get state(){return this._isUsingOfflineAudioContext?"running":this._audioContext.state}get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this._mainOut&&(this._mainOut.volume=e))}get _audioDestination(){return this._destinationNode?this._destinationNode:this._destinationNode=this._audioContext.destination}set _audioDestination(e){this._destinationNode=e}get _unmuteUIEnabled(){return this._unmuteUI?this._unmuteUI.enabled:!1}set _unmuteUIEnabled(e){this._unmuteUI&&(this._unmuteUI.enabled=e)}async createBusAsync(e,t={}){const s=await d(()=>import("./webAudioBus-uR5af0TN.js").then(r=>r.w),__vite__mapDeps([0,1]),import.meta.url),i=new s._WebAudioBus(e,this,t);return await i._initAsync(t),i}async createMainBusAsync(e,t={}){const s=await d(()=>import("./webAudioMainBus-B4JHk1VB.js").then(r=>r.w),__vite__mapDeps([2,1]),import.meta.url),i=new s._WebAudioMainBus(e,this);return await i._initAsync(t),i}async createMicrophoneSoundSourceAsync(e,t){let s;try{s=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(i){throw new Error("Unable to access microphone: "+i,{cause:i})}return await this.createSoundSourceAsync(e,new MediaStreamAudioSourceNode(this._audioContext,{mediaStream:s}),{outBusAutoDefault:!1,...t})}async createSoundAsync(e,t,s={}){const i=await d(()=>Promise.resolve().then(()=>ss),void 0,import.meta.url),r=new i._WebAudioStaticSound(e,this,s);return await r._initAsync(t,s),r}async createSoundBufferAsync(e,t={}){const s=await d(()=>Promise.resolve().then(()=>ss),void 0,import.meta.url),i=new s._WebAudioStaticSoundBuffer(this);return await i._initAsync(e,t),i}async createSoundSourceAsync(e,t,s={}){const i=await d(()=>Promise.resolve().then(()=>bn),void 0,import.meta.url),r=new i._WebAudioSoundSource(e,t,this,s);return await r._initAsync(s),r}async createStreamingSoundAsync(e,t,s={}){const i=await d(()=>Promise.resolve().then(()=>On),void 0,import.meta.url),r=new i._WebAudioStreamingSound(e,this,s);return await r._initAsync(t,s),r}dispose(){super.dispose(),this._listener?.dispose(),this._listener=null,this._audioContext.state!=="closed"&&!this._isUsingOfflineAudioContext&&this._audioContext.close(),document.removeEventListener("click",this._onUserGestureAsync),this._audioContext.removeEventListener("statechange",this._onAudioContextStateChange),this._silentHtmlAudio?.remove(),this._updateObservable?.clear(),this._updateObservable=null,this._unmuteUI?.dispose(),this._unmuteUI=null,this.stateChangedObservable.clear()}flagInvalidFormat(e){this._invalidFormats.add(e)}isFormatValid(e){if(this._validFormats.has(e))return!0;if(this._invalidFormats.has(e))return!1;const t=en[e];return t===void 0?!1:new Audio().canPlayType(t)===""?(this._invalidFormats.add(e),!1):(this._validFormats.add(e),!0)}async pauseAsync(){await this._audioContext.suspend(),this._pauseCalled=!0}resumeAsync(){return this._pauseCalled=!1,this._resumePromise?this._resumePromise:(this._resumePromise=this._audioContext.resume(),this.stateChangedObservable.notifyObservers(this.state),this._resumePromise)}setVolume(e,t=null){if(this._mainOut)this._mainOut.setVolume(e,t);else throw new Error("Main output not initialized yet.")}_addMainBus(e){super._addMainBus(e)}_removeMainBus(e){super._removeMainBus(e)}_addNode(e){super._addNode(e)}_removeNode(e){super._removeNode(e)}_addSound(e){super._addSound(e)}_removeSound(e){super._removeSound(e)}_addUpdateObserver(e){this._updateObservable||(this._updateObservable=new U),this._updateObservable.add(e),this._startUpdating()}_removeUpdateObserver(e){this._updateObservable&&this._updateObservable.removeCallback(e)}}k.AudioEngineFactory=(n,e,t)=>new tn(n,e,t);class tn{get masterGain(){return this._masterGain}set masterGain(e){this._masterGain=this._v2.mainOut._inNode=e}get useCustomUnlockedButton(){return this._useCustomUnlockedButton}set useCustomUnlockedButton(e){this._useCustomUnlockedButton=e,this._v2._unmuteUIEnabled=!e}get audioContext(){return this._v2.state==="running"&&this._triggerRunningStateAsync(),this._v2._audioContext}constructor(e=null,t=null,s=null){this._tryToRun=!1,this._useCustomUnlockedButton=!1,this.canUseWebAudio=!0,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.onAudioUnlockedObservable=new U,this.onAudioLockedObservable=new U;const i=new Ss({audioContext:t||void 0,defaultUIParentElement:e?.parentElement?e.parentElement:void 0});i._unmuteUIEnabled=!1,this._masterGain=new GainNode(i._audioContext),i._audioDestination=s,i.stateChangedObservable.add(r=>{r==="running"?(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)):(this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this))}),i._initAsync({resumeOnInteraction:!1}).then(()=>{const r=i.defaultMainBus._outNode;r&&(r.disconnect(i.mainOut._inNode),r.connect(this._masterGain)),i.mainOut._inNode=this._masterGain,i.stateChangedObservable.notifyObservers(i.state)}),this.isMP3supported=i.isFormatValid("mp3"),this.isOGGsupported=i.isFormatValid("ogg"),this._v2=i}lock(){this._v2._audioContext.suspend(),this._useCustomUnlockedButton||(this._v2._unmuteUIEnabled=!0)}unlock(){if(this._v2._audioContext?.state==="running"){this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this));return}this._triggerRunningStateAsync()}_resumeAudioContextOnStateChange(){this._v2._audioContext?.addEventListener("statechange",()=>{this.unlocked&&this._v2._audioContext?.state!=="running"&&this._resumeAudioContextAsync()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContextAsync(){return this._v2._isUsingOfflineAudioContext?Promise.resolve():(this._v2._audioContext.state==="suspended"&&!this._useCustomUnlockedButton&&(this._v2._unmuteUIEnabled=!0),this._v2._audioContext.resume())}dispose(){this._v2.dispose(),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){return this.masterGain.gain.value}setGlobalVolume(e){this.masterGain.gain.value=e}connectToAnalyser(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._v2._audioContext.destination)}async _triggerRunningStateAsync(){if(this._tryToRun){this._v2._audioContext.resume();return}this._tryToRun=!0,await this._resumeAudioContextAsync(),this._tryToRun=!1,this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)}}const v={coneInnerAngle:6.28318530718,coneOuterAngle:6.28318530718,coneOuterVolume:0,distanceModel:"linear",maxDistance:1e4,minDistance:1,orientation:y.Right(),panningModel:"equalpower",position:y.Zero(),rolloffFactor:1,rotation:y.Zero(),rotationQuaternion:new G};function Ge(n){return n.spatialEnabled||n.spatialAutoUpdate!==void 0||n.spatialConeInnerAngle!==void 0||n.spatialConeOuterAngle!==void 0||n.spatialConeOuterVolume!==void 0||n.spatialDistanceModel!==void 0||n.spatialMaxDistance!==void 0||n.spatialMinDistance!==void 0||n.spatialMinUpdateTime!==void 0||n.spatialOrientation!==void 0||n.spatialPanningModel!==void 0||n.spatialPosition!==void 0||n.spatialRolloffFactor!==void 0||n.spatialRotation!==void 0||n.spatialRotationQuaternion!==void 0}class sn{}class Je extends ys{constructor(e,t){super(e,t,3)}connect(e){if(!this._connect(e))throw new Error("Connect failed")}disconnect(e){if(!this._disconnect(e))throw new Error("Disconnect failed")}disconnectAll(){if(!this._downstreamNodes)throw new Error("Disconnect failed");const e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next())if(!this._disconnect(t.value))throw new Error("Disconnect failed")}}const Cs={volume:1};class nn extends Je{constructor(e){super("Volume",e)}setOptions(e){this.setVolume(e.volume??Cs.volume,{shape:"none"})}}function De(n){return n.getSubNode("Volume")}function rn(n,e){return De(n)?.[e]??Cs[e]}const Ae={fftSize:2048,minDecibels:-100,maxDecibels:-30,smoothing:.8};function an(n){return n.analyzerEnabled||n.analyzerFFTSize!==void 0||n.analyzerMinDecibels!==void 0||n.analyzerMaxDecibels!==void 0||n.analyzerSmoothing!==void 0}class on{get frequencyBinCount(){return this.fftSize/2}}class un extends Je{constructor(e){super("Analyzer",e)}setOptions(e){this.fftSize=e.analyzerFFTSize??Ae.fftSize,this.minDecibels=e.analyzerMinDecibels??Ae.minDecibels,this.maxDecibels=e.analyzerMaxDecibels??Ae.maxDecibels,this.smoothing=e.analyzerSmoothing??Ae.smoothing}}function ye(n){return n.getSubNode("Analyzer")}function ze(n,e,t){n.callOnSubNode("Analyzer",s=>{s[e]=t})}let ot=null,ut=null;function Is(){return ot||(ot=new Uint8Array),ot}function Rs(){return ut||(ut=new Float32Array),ut}class ln extends on{constructor(e){super(),this._fftSize=Ae.fftSize,this._maxDecibels=Ae.maxDecibels,this._minDecibels=Ae.minDecibels,this._smoothing=Ae.smoothing,this._subGraph=e}get fftSize(){return this._fftSize}set fftSize(e){this._fftSize=e,ze(this._subGraph,"fftSize",e)}get isEnabled(){return ye(this._subGraph)!==null}get minDecibels(){return this._minDecibels}set minDecibels(e){this._minDecibels=e,ze(this._subGraph,"minDecibels",e)}get maxDecibels(){return this._maxDecibels}set maxDecibels(e){this._maxDecibels=e,ze(this._subGraph,"maxDecibels",e)}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,ze(this._subGraph,"smoothing",e)}dispose(){const e=ye(this._subGraph);e&&(this._subGraph.removeSubNodeAsync(e),e.dispose())}async enableAsync(){ye(this._subGraph)||await this._subGraph.createAndAddSubNodeAsync("Analyzer")}getByteFrequencyData(){const e=ye(this._subGraph);return e?e.getByteFrequencyData():(N.Warn("AudioAnalyzer not enabled"),this.enableAsync(),Is())}getFloatFrequencyData(){const e=ye(this._subGraph);return e?e.getFloatFrequencyData():(N.Warn("AudioAnalyzer not enabled"),this.enableAsync(),Rs())}}class hn extends ys{constructor(e,t,s){super(e,t,s),this._analyzer=null}get analyzer(){return this._analyzer??(this._analyzer=new ln(this._subGraph))}get volume(){return rn(this._subGraph,"volume")}set volume(e){const t=De(this._subGraph);if(!t)throw new Error("No volume subnode");t.volume=e}dispose(){super.dispose(),this._analyzer?.dispose(),this._analyzer=null,this._subGraph.dispose()}setVolume(e,t=null){const s=De(this._subGraph);if(!s)throw new Error("No volume subnode");s.setVolume(e,t)}}class bs extends hn{constructor(e,t,s,i=2){super(e,t,i),this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._outBus=null,this._spatial=null,this._onOutBusDisposed=null,typeof s.spatialAutoUpdate=="boolean"&&(this._spatialAutoUpdate=s.spatialAutoUpdate),typeof s.spatialMinUpdateTime=="number"&&(this._spatialMinUpdateTime=s.spatialMinUpdateTime)}get outBus(){return this._outBus}set outBus(e){if(this._outBus!==e){if(this._outBus&&(this._onOutBusDisposed&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),this._onOutBusDisposed=null),!this._disconnect(this._outBus)))throw new Error("Disconnect failed");if(this._outBus=e,this._outBus&&(this._onOutBusDisposed=()=>{this._outBus=null},this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}get spatial(){return this._spatial?this._spatial:this._initSpatialProperty()}dispose(){super.dispose(),this._spatial?.dispose(),this._spatial=null,this._outBus&&this._onOutBusDisposed&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),this._onOutBusDisposed=null),this._outBus=null}_initSpatialProperty(){return this._spatial=this._createSpatialProperty(this._spatialAutoUpdate,this._spatialMinUpdateTime)}get _isSpatial(){return this._spatial!==null}set _isSpatial(e){e&&!this._spatial?this._initSpatialProperty():!e&&this._spatial&&(this._spatial.dispose(),this._spatial=null)}}const ws={pan:0};function cn(n){return n.stereoEnabled||n.stereoPan!==void 0}class dn{}class _n extends Je{constructor(e){super("Stereo",e)}setOptions(e){this.pan=e.stereoPan??ws.pan}}function Zt(n){return n.getSubNode("Stereo")}function fn(n,e,t){n.callOnSubNode("Stereo",s=>{s[e]=t})}class Et extends dn{constructor(e){super(),this._pan=ws.pan,this._subGraph=e}get pan(){return this._pan}set pan(e){this._pan=e,fn(this._subGraph,"pan",e)}}class pn extends Je{constructor(e){super("Spatial",e),this._attacherComponent=null}get isAttached(){return this._attacherComponent!==null&&this._attacherComponent.isAttached}attach(e,t,s){this.detach(),this._attacherComponent||(this._attacherComponent=new ct(this)),this._attacherComponent.attach(e,t,s)}detach(){this._attacherComponent?.detach()}dispose(){super.dispose(),this._attacherComponent?.dispose(),this._attacherComponent=null}setOptions(e){this.coneInnerAngle=e.spatialConeInnerAngle??v.coneInnerAngle,this.coneOuterAngle=e.spatialConeOuterAngle??v.coneOuterAngle,this.coneOuterVolume=e.spatialConeOuterVolume??v.coneOuterVolume,this.distanceModel=e.spatialDistanceModel??v.distanceModel,this.maxDistance=e.spatialMaxDistance??v.maxDistance,this.minDistance=e.spatialMinDistance??v.minDistance,this.orientation=e.spatialOrientation??v.orientation,this.panningModel=e.spatialPanningModel??v.panningModel,this.rolloffFactor=e.spatialRolloffFactor??v.rolloffFactor,e.spatialPosition&&(this.position=e.spatialPosition.clone()),e.spatialRotationQuaternion?this.rotationQuaternion=e.spatialRotationQuaternion.clone():e.spatialRotation?this.rotation=e.spatialRotation.clone():this.rotationQuaternion=v.rotationQuaternion.clone(),this.update()}update(){this.isAttached?this._attacherComponent?.update():(this._updatePosition(),this._updateRotation())}}function de(n){return n.getSubNode("Spatial")}function Te(n,e,t){n.callOnSubNode("Spatial",s=>{s[e]=t})}const $t=b.Zero(),lt=new G;function es(n){return n*Math.PI/180}function ts(n){return n*180/Math.PI}async function mn(n){return new Tn(n)}class Tn extends pn{constructor(e){super(e),this._lastOrientation=y.Zero(),this._lastPosition=y.Zero(),this._lastRotation=y.Zero(),this._lastRotationQuaternion=new G,this.orientation=v.orientation.clone(),this.position=v.position.clone(),this.rotation=v.rotation.clone(),this.rotationQuaternion=v.rotationQuaternion.clone(),this.node=new PannerNode(e._audioContext),this._orientationX=new Q(e,this.node.orientationX),this._orientationY=new Q(e,this.node.orientationY),this._orientationZ=new Q(e,this.node.orientationZ),this._positionX=new Q(e,this.node.positionX),this._positionY=new Q(e,this.node.positionY),this._positionZ=new Q(e,this.node.positionZ)}dispose(){super.dispose(),this._orientationX.dispose(),this._orientationY.dispose(),this._orientationZ.dispose(),this._positionX.dispose(),this._positionY.dispose(),this._positionZ.dispose(),this.node.disconnect()}get coneInnerAngle(){return es(this.node.coneInnerAngle)}set coneInnerAngle(e){this.node.coneInnerAngle=ts(e)}get coneOuterAngle(){return es(this.node.coneOuterAngle)}set coneOuterAngle(e){this.node.coneOuterAngle=ts(e)}get coneOuterVolume(){return this.node.coneOuterGain}set coneOuterVolume(e){this.node.coneOuterGain=e}get distanceModel(){return this.node.distanceModel}set distanceModel(e){this.node.distanceModel=e;const t=this.node.maxDistance;this.node.maxDistance=t+.001,this.node.maxDistance=t}get minDistance(){return this.node.refDistance}set minDistance(e){this.node.refDistance=e}get maxDistance(){return this.node.maxDistance}set maxDistance(e){this.node.maxDistance=e}get panningModel(){return this.node.panningModel}set panningModel(e){this.node.panningModel=e}get rolloffFactor(){return this.node.rolloffFactor}set rolloffFactor(e){this.node.rolloffFactor=e}get _inNode(){return this.node}get _outNode(){return this.node}_updatePosition(){this._lastPosition.equalsWithEpsilon(this.position)||(this._positionX.targetValue=this.position.x,this._positionY.targetValue=this.position.y,this._positionZ.targetValue=this.position.z,this._lastPosition.copyFrom(this.position))}_updateRotation(){let e=!1;if(!this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion))lt.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion),e=!0;else if(!this._lastRotation.equalsWithEpsilon(this.rotation))G.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,lt),this._lastRotation.copyFrom(this.rotation),e=!0;else if(this._lastOrientation.equalsWithEpsilon(this.orientation))return;e&&(b.FromQuaternionToRef(lt,$t),y.TransformNormalToRef(y.RightReadOnly,$t,this.orientation)),this._orientationX.targetValue=this.orientation.x,this._orientationY.targetValue=this.orientation.y,this._orientationZ.targetValue=this.orientation.z}_connect(e){return super._connect(e)?(e._inNode&&this.node.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this.node.disconnect(e._inNode),!0):!1}getClassName(){return"_SpatialWebAudioSubNode"}}async function gn(n){return new An(n)}class An extends _n{constructor(e){super(e),this.node=new StereoPannerNode(e._audioContext),this._pan=new Q(e,this.node.pan)}dispose(){super.dispose(),this._pan.dispose()}get pan(){return this._pan.targetValue}set pan(e){this._pan.targetValue=e}get _inNode(){return this.node}get _outNode(){return this.node}getClassName(){return"_StereoWebAudioSubNode"}_connect(e){return super._connect(e)?(e._inNode&&this.node.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this.node.disconnect(e._inNode),!0):!1}}class En{constructor(){this._createSubNodePromises={},this._isDisposed=!1,this._subNodes={},this._onSubNodeDisposed=e=>{const t=e;delete this._subNodes[t.name],this._onSubNodesChanged()}}callOnSubNode(e,t){const s=this.getSubNode(e);if(s){t(s);return}this._createSubNodePromisesResolvedAsync().then(()=>{const i=this.getSubNode(e);if(i){t(i);return}this.createAndAddSubNodeAsync(e).then(r=>{t(r)})})}createAndAddSubNodeAsync(e){var t;return(t=this._createSubNodePromises)[e]||(t[e]=this._createSubNode(e).then(s=>(this._addSubNode(s),s))),this._createSubNodePromises[e]}dispose(){this._isDisposed=!0;const e=Object.values(this._subNodes);for(const t of e)t.dispose();this._subNodes={},this._createSubNodePromises={}}getSubNode(e){return this._subNodes[e]??null}async removeSubNodeAsync(e){if(!e)return;await this._createSubNodePromisesResolvedAsync();const t=e.name;this._subNodes[t]&&delete this._subNodes[t],delete this._createSubNodePromises[t],this._onSubNodesChanged()}async _createSubNodePromisesResolvedAsync(){return await Promise.all(Object.values(this._createSubNodePromises))}_addSubNode(e){if(this._isDisposed){e.dispose();return}this._subNodes[e.name]=e,e.onDisposeObservable.addOnce(this._onSubNodeDisposed),this._onSubNodesChanged()}}async function xn(n){return new yn(n)}class yn extends nn{constructor(e){super(e);const t=this.node=new GainNode(e._audioContext);this._volume=new Q(e,t.gain)}dispose(){super.dispose(),this._volume.dispose()}get volume(){return this._volume.value}set volume(e){this.setVolume(e)}get _inNode(){return this.node}get _outNode(){return this.node}setVolume(e,t=null){this._volume.setTargetValue(e,t)}_connect(e){return super._connect(e)?(e._inNode&&this.node.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this.node.disconnect(e._inNode),!0):!1}getClassName(){return"_VolumeWebAudioSubNode"}}async function Sn(n){return new Cn(n)}class Cn extends un{constructor(e){super(e),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode=new AnalyserNode(e._audioContext)}get fftSize(){return this._analyzerNode.fftSize}set fftSize(e){e!==this._analyzerNode.fftSize&&(this._analyzerNode.fftSize=e,this._clearArrays())}get _inNode(){return this._analyzerNode}get minDecibels(){return this._analyzerNode.minDecibels}set minDecibels(e){this._analyzerNode.minDecibels=e}get maxDecibels(){return this._analyzerNode.maxDecibels}set maxDecibels(e){this._analyzerNode.maxDecibels=e}get smoothing(){return this._analyzerNode.smoothingTimeConstant}set smoothing(e){this._analyzerNode.smoothingTimeConstant=e}dispose(){super.dispose(),this._clearArrays(),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode.disconnect()}getClassName(){return"_WebAudioAnalyzerSubNode"}getByteFrequencyData(){return(!this._byteFrequencyData||this._byteFrequencyData.length===0)&&(this._byteFrequencyData=new Uint8Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getByteFrequencyData(this._byteFrequencyData),this._byteFrequencyData}getFloatFrequencyData(){return(!this._floatFrequencyData||this._floatFrequencyData.length===0)&&(this._floatFrequencyData=new Float32Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getFloatFrequencyData(this._floatFrequencyData),this._floatFrequencyData}_clearArrays(){this._byteFrequencyData?.set(Is()),this._floatFrequencyData?.set(Rs())}}class In extends En{constructor(e){super(),this._outputNode=null,this._owner=e}async initAsync(e){const t=an(e);if(t&&await this.createAndAddSubNodeAsync("Analyzer"),await this.createAndAddSubNodeAsync("Volume"),await this._createSubNodePromisesResolvedAsync(),t){const i=ye(this);if(!i)throw new Error("No analyzer subnode.");i.setOptions(e)}const s=De(this);if(!s)throw new Error("No volume subnode.");if(s.setOptions(e),s.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(this._outputNode=s.node,this._outputNode&&this._downstreamNodes){const i=this._downstreamNodes.values();for(let r=i.next();!r.done;r=i.next()){const a=r.value._inNode;a&&this._outputNode.connect(a)}}}get _inNode(){return this._outputNode}get _outNode(){return this._outputNode}_createSubNode(e){switch(e){case"Analyzer":return Sn(this._owner.engine);case"Volume":return xn(this._owner.engine);default:throw new Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){const e=ye(this),t=De(this);e&&t&&t.connect(e)}}class xt extends In{constructor(){super(...arguments),this._rootNode=null,this._inputNode=null}async initAsync(e){await super.initAsync(e);let t,s;(t=Ge(e))&&await this.createAndAddSubNodeAsync("Spatial"),(s=cn(e))&&await this.createAndAddSubNodeAsync("Stereo"),await this._createSubNodePromisesResolvedAsync(),t&&de(this)?.setOptions(e),s&&Zt(this)?.setOptions(e)}get _inNode(){return this._inputNode}_createSubNode(e){try{return super._createSubNode(e)}catch{}switch(e){case"Spatial":return mn(this._owner.engine);case"Stereo":return gn(this._owner.engine);default:throw new Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){super._onSubNodesChanged();const e=de(this),t=Zt(this),s=De(this);if(e&&e.getClassName()!=="_SpatialWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(t&&t.getClassName()!=="_StereoWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(s&&s.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");e&&(e.disconnectAll(),s&&e.connect(s)),t&&(t.disconnectAll(),s&&t.connect(s)),e&&t?(this._rootNode=new GainNode(this._owner.engine._audioContext),this._rootNode.connect(e._outNode),this._rootNode.connect(t._outNode)):(this._rootNode?.disconnect(),this._rootNode=null);let i=null,r;if(this._rootNode?r=this._rootNode:(e?i=e:t?i=t:s&&(i=s),r=i?.node??null),this._inputNode!==r){if(this._inputNode&&this._upstreamNodes){const a=this._upstreamNodes.values();for(let o=a.next();!o.done;o=a.next())o.value._outNode?.disconnect(this._inputNode)}if(this._inputNode=r,r&&this._upstreamNodes){const a=this._upstreamNodes.values();for(let o=a.next();!o.done;o=a.next())o.value._outNode?.connect(r)}}}}class Rn extends sn{constructor(e){super(),this._coneInnerAngle=v.coneInnerAngle,this._coneOuterAngle=v.coneOuterAngle,this._coneOuterVolume=v.coneOuterVolume,this._distanceModel=v.distanceModel,this._maxDistance=v.maxDistance,this._minDistance=v.minDistance,this._panningModel=v.panningModel,this._rolloffFactor=v.rolloffFactor;const t=de(e);t?(this._orientation=t.orientation.clone(),this._position=t.position.clone(),this._rotation=t.rotation.clone(),this._rotationQuaternion=t.rotationQuaternion.clone()):(this._orientation=v.orientation.clone(),this._position=v.position.clone(),this._rotation=v.rotation.clone(),this._rotationQuaternion=v.rotationQuaternion.clone(),e.createAndAddSubNodeAsync("Spatial")),this._subGraph=e}dispose(){this._subGraph.removeSubNodeAsync(de(this._subGraph))}get coneInnerAngle(){return this._coneInnerAngle}set coneInnerAngle(e){this._coneInnerAngle=e,Te(this._subGraph,"coneInnerAngle",e)}get coneOuterAngle(){return this._coneOuterAngle}set coneOuterAngle(e){this._coneOuterAngle=e,Te(this._subGraph,"coneOuterAngle",e)}get coneOuterVolume(){return this._coneOuterVolume}set coneOuterVolume(e){this._coneOuterVolume=e,Te(this._subGraph,"coneOuterVolume",e)}get distanceModel(){return this._distanceModel}set distanceModel(e){this._distanceModel=e,Te(this._subGraph,"distanceModel",e)}get isAttached(){return this._subGraph.getSubNode("Spatial")?.isAttached??!1}get maxDistance(){return this._maxDistance}set maxDistance(e){e<=0&&(e=1e-6),this._maxDistance=e,Te(this._subGraph,"maxDistance",e)}get minDistance(){return this._minDistance}set minDistance(e){this._minDistance=e,Te(this._subGraph,"minDistance",e)}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._updateRotation()}get panningModel(){return this._panningModel}set panningModel(e){this._panningModel=e,Te(this._subGraph,"panningModel",e)}get position(){return this._position}set position(e){this._position=e,this._updatePosition()}get rolloffFactor(){return this._rolloffFactor}set rolloffFactor(e){this._rolloffFactor=e,Te(this._subGraph,"rolloffFactor",e)}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._updateRotation()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(e){this._rotationQuaternion=e,this._updateRotation()}attach(e,t=!1,s=3){de(this._subGraph)?.attach(e,t,s)}detach(){de(this._subGraph)?.detach()}update(){const e=de(this._subGraph);e&&(e.isAttached?e.update():(this._updatePosition(e),this._updateRotation(e)))}_updatePosition(e=null){if(!e&&(e=de(this._subGraph),!e))return;e.position.equalsWithEpsilon(this._position)||(e.position.copyFrom(this._position),e._updatePosition())}_updateRotation(e=null){!e&&(e=de(this._subGraph),!e)||(e.rotationQuaternion.equalsWithEpsilon(this._rotationQuaternion)?e.rotation.equalsWithEpsilon(this._rotation)?e.orientation.equalsWithEpsilon(this._orientation)||(e.orientation.copyFrom(this._orientation),e._updateRotation(),this._rotation.copyFrom(e.rotation),this._rotationQuaternion.copyFrom(e.rotationQuaternion)):(e.rotation.copyFrom(this._rotation),e._updateRotation(),this._orientation.copyFrom(e.orientation),this._rotationQuaternion.copyFrom(e.rotationQuaternion)):(e.rotationQuaternion.copyFrom(this._rotationQuaternion),e._updateRotation(),this._orientation.copyFrom(e.orientation),this._rotation.copyFrom(e.rotation)))}}class yt extends Rn{constructor(e,t,s){super(e),this._updaterComponent=new Es(this,t,s)}get minUpdateTime(){return this._updaterComponent.minUpdateTime}set minUpdateTime(e){this._updaterComponent.minUpdateTime=e}dispose(){super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}}class K extends bs{constructor(e,t,s,i){super(e,s,i),this._stereo=null,this._webAudioNode=null,this._audioContext=this.engine._audioContext,this._webAudioNode=t,this._subGraph=new K._SubGraph(this)}async _initAsync(e){e.outBus?this.outBus=e.outBus:e.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),Ge(e)&&this._initSpatialProperty(),this.engine._addNode(this)}get _inNode(){return this._webAudioNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new Et(this._subGraph))}dispose(){if(super.dispose(),this._webAudioNode){if(this._webAudioNode instanceof MediaStreamAudioSourceNode)for(const e of this._webAudioNode.mediaStream.getTracks())e.stop();this._webAudioNode.disconnect(),this._webAudioNode=null}this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){return"_WebAudioSoundSource"}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_createSpatialProperty(e,t){return new yt(this._subGraph,e,t)}}K._SubGraph=class extends xt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}_onSubNodesChanged(){super._onSubNodesChanged(),this._owner._inNode?.disconnect(),this._owner._subGraph._inNode&&this._owner._inNode?.connect(this._owner._subGraph._inNode)}};const bn=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioSoundSource:K},Symbol.toStringTag,{value:"Module"}));class Ms extends bs{constructor(e,t,s){super(e,t,s,3),this._newestInstance=null,this._privateInstances=new Set,this._state=1,this._instances=this._privateInstances,this.onEndedObservable=new U,this._onInstanceEnded=i=>{this._newestInstance===i&&(this._newestInstance=null),this._privateInstances.delete(i),this._instances.size===0&&(this._state=1,this.onEndedObservable.notifyObservers(this)),i.dispose()}}get activeInstancesCount(){return this._instances.size}get autoplay(){return this._options.autoplay}get currentTime(){const e=this._getNewestInstance();return e?e.currentTime:0}set currentTime(e){this.startOffset=e;const t=this._getNewestInstance();t&&(t.currentTime=e)}get loop(){return this._options.loop}set loop(e){this._options.loop=e}get maxInstances(){return this._options.maxInstances}set maxInstances(e){this._options.maxInstances=e}get startOffset(){return this._options.startOffset}set startOffset(e){this._options.startOffset=e}get state(){return this._state}dispose(){super.dispose(),this.stop(),this._newestInstance=null,this._privateInstances.clear(),this.onEndedObservable.clear()}pause(){const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())t.value.pause();this._state=5}resume(){if(this._state!==5)return;const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())t.value.resume();this._state=3}_beforePlay(e){if(this.state===5&&this._instances.size>0){this.resume();return}e.onEndedObservable.addOnce(this._onInstanceEnded),this._privateInstances.add(e),this._newestInstance=e}_afterPlay(e){this._state=e.state}_getNewestInstance(){if(this._instances.size===0)return null;if(!this._newestInstance){const e=this._instances.values();for(let t=e.next();!t.done;t=e.next())this._newestInstance=t.value}return this._newestInstance}_setState(e){this._state=e}_stopExcessInstances(){if(this.maxInstances<1/0){const e=Array.from(this._instances).filter(s=>s.state===3),t=e.length-this.maxInstances;for(let s=0;s<t;s++)e[s].stop()}}}class wn extends Ms{constructor(e,t,s){super(e,t,s)}get duration(){return this._options.duration}set duration(e){this._options.duration=e}get loopStart(){return this._options.loopStart}set loopStart(e){this._options.loopStart=e}get loopEnd(){return this._options.loopEnd}set loopEnd(e){this._options.loopEnd=e}get pitch(){return this._options.pitch}set pitch(e){this._options.pitch=e;const t=this._instances.values();for(let s=t.next();!s.done;s=t.next())s.value.pitch=e}get playbackRate(){return this._options.playbackRate}set playbackRate(e){this._options.playbackRate=e;const t=this._instances.values();for(let s=t.next();!s.done;s=t.next())s.value.playbackRate=e}play(e={}){if(this.state===5){this.resume();return}e.duration??(e.duration=this.duration),e.loop??(e.loop=this.loop),e.loopStart??(e.loopStart=this.loopStart),e.loopEnd??(e.loopEnd=this.loopEnd),e.startOffset??(e.startOffset=this.startOffset),e.volume??(e.volume=1),e.waitTime??(e.waitTime=0);const t=this._createInstance();this._beforePlay(t),t.play(e),this._afterPlay(t),this._stopExcessInstances()}stop(e={}){if(e.waitTime&&0<e.waitTime?this._setState(0):this._setState(1),!!this._instances)for(const t of Array.from(this._instances))t.stop(e)}}let Mn=1;class Dn{constructor(e){this.name=`StaticSoundBuffer #${Mn++}`,this.engine=e}}class Ds extends At{constructor(e){super(e.engine,2),this._state=1,this.onEndedObservable=new U,this.onErrorObservable=new U,this.onStateChangedObservable=new U,this._sound=e}get state(){return this._state}dispose(){super.dispose(),this.stop(),this.onEndedObservable.clear(),this.onStateChangedObservable.clear()}_setState(e){this._state!==e&&(this._state=e,this.onStateChangedObservable.notifyObservers(this),this._state===1&&this.onEndedObservable.notifyObservers(this))}}class vn extends Ds{}class te extends wn{constructor(e,t,s){super(e,t,s),this._stereo=null,this._options={autoplay:s.autoplay??!1,duration:s.duration??0,loop:s.loop??!1,loopEnd:s.loopEnd??0,loopStart:s.loopStart??0,maxInstances:s.maxInstances??1/0,pitch:s.pitch??0,playbackRate:s.playbackRate??1,startOffset:s.startOffset??0},this._subGraph=new te._SubGraph(this)}async _initAsync(e,t){this._audioContext=this.engine._audioContext,e instanceof Ze?this._buffer=e:(typeof e=="string"||Array.isArray(e)||e instanceof ArrayBuffer||e instanceof AudioBuffer)&&(this._buffer=await this.engine.createSoundBufferAsync(e,t)),t.outBus?this.outBus=t.outBus:t.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),Ge(t)&&this._initSpatialProperty(),t.autoplay&&this.play(),this.engine._addSound(this)}get buffer(){return this._buffer}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new Et(this._subGraph))}async cloneAsync(e=null){const t=await this.engine.createSoundAsync(this.name,e?.cloneBuffer?this.buffer.clone():this.buffer,this._options);return t.outBus=e?.outBus?e.outBus:this.outBus,t}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeSound(this)}getClassName(){return"_WebAudioStaticSound"}_createInstance(){return new Pn(this,this._options)}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_createSpatialProperty(e,t){return new yt(this._subGraph,e,t)}_getOptions(){return this._options}}te._SubGraph=class extends xt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};class Ze extends Dn{constructor(e){super(e)}async _initAsync(e,t){e instanceof AudioBuffer?this._audioBuffer=e:typeof e=="string"?await this._initFromUrlAsync(e):Array.isArray(e)?await this._initFromUrlsAsync(e,t.skipCodecCheck??!1):e instanceof ArrayBuffer&&await this._initFromArrayBufferAsync(e)}get channelCount(){return this._audioBuffer.numberOfChannels}get duration(){return this._audioBuffer.duration}get length(){return this._audioBuffer.length}get sampleRate(){return this._audioBuffer.sampleRate}clone(e=null){const t=new AudioBuffer({length:this._audioBuffer.length,numberOfChannels:this._audioBuffer.numberOfChannels,sampleRate:this._audioBuffer.sampleRate});for(let i=0;i<this._audioBuffer.numberOfChannels;i++)t.copyToChannel(this._audioBuffer.getChannelData(i),i);const s=new Ze(this.engine);return s._audioBuffer=t,s.name=e?.name?e.name:this.name,s}async _initFromArrayBufferAsync(e){this._audioBuffer=await this.engine._audioContext.decodeAudioData(e)}async _initFromUrlAsync(e){e=Oe(e);const{data:t}=await qi(e);await this._initFromArrayBufferAsync(t)}async _initFromUrlsAsync(e,t){for(const s of e){if(t)await this._initFromUrlAsync(s);else{const r=s.match(Qi)?.at(1);if(r&&this.engine.isFormatValid(r))try{await this._initFromUrlAsync(s)}catch{r&&0<r.length&&this.engine.flagInvalidFormat(r)}}if(this._audioBuffer)break}}}class Pn extends vn{constructor(e,t){super(e),this._enginePlayTime=0,this._enginePauseTime=0,this._isConnected=!1,this._pitch=null,this._playbackRate=null,this._sourceNode=null,this._onEnded=()=>{this._enginePlayTime=0,this._state!==5&&this.onEndedObservable.notifyObservers(this),this._deinitSourceNode()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._options=t,this._volumeNode=new GainNode(e._audioContext),this._initSourceNode()}dispose(){super.dispose(),this._pitch?.dispose(),this._playbackRate?.dispose(),this.stop(),this._deinitSourceNode(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}get currentTime(){if(this._state===1)return 0;const e=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+e+this._options.startOffset}set currentTime(e){const t=this._state===2||this._state===3;if(t){const s=this._sourceNode;this._deinitSourceNode(),s?.stop(),this._state=1}this.state===5&&(this._enginePauseTime=0),this._options.startOffset=e,t&&this.play()}get _outNode(){return this._volumeNode}set pitch(e){this._pitch?.setTargetValue(e)}set playbackRate(e){this._playbackRate?.setTargetValue(e)}get startTime(){return this._state===1?0:this._enginePlayTime}getClassName(){return"_WebAudioStaticSoundInstance"}play(e={}){if(this._state===3)return;e.duration!==void 0&&(this._options.duration=e.duration),e.loop!==void 0&&(this._options.loop=e.loop),e.loopStart!==void 0&&(this._options.loopStart=e.loopStart),e.loopEnd!==void 0&&(this._options.loopEnd=e.loopEnd),e.startOffset!==void 0&&(this._options.startOffset=e.startOffset);let t=this._options.startOffset;this._state===5&&(t+=this._enginePauseTime,t%=this._sound.buffer.duration),this._enginePlayTime=this.engine.currentTime+(e.waitTime??0),this._volumeNode.gain.value=e.volume??1,this._initSourceNode(),this.engine.state==="running"?(this._setState(3),this._sourceNode?.start(this._enginePlayTime,t,this._options.duration>0?this._options.duration:void 0)):this._options.loop&&(this._setState(2),this.engine.stateChangedObservable.add(this._onEngineStateChanged))}pause(){if(this._state!==3&&this._state!==2)return;const e=this._state===3;this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,e?this._sourceNode?.stop():this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this._deinitSourceNode()}resume(){this._state===5&&this.play()}stop(e={}){if(this._state!==1){if(this._state===3){const t=this.engine.currentTime+(e.waitTime??0);this._sourceNode?.stop(t)}(e.waitTime===void 0||e.waitTime<=0)&&(this._setState(1),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))}}_connect(e){return super._connect(e)?(e instanceof te&&e._inNode&&(this._outNode?.connect(e._inNode),this._isConnected=!0),!0):!1}_disconnect(e){return super._disconnect(e)?(e instanceof te&&e._inNode&&(this._outNode?.disconnect(e._inNode),this._isConnected=!1),!0):!1}_deinitSourceNode(){if(this._sourceNode){if(this._isConnected&&!this._disconnect(this._sound))throw new Error("Disconnect failed");this._sourceNode.disconnect(this._volumeNode),this._sourceNode.removeEventListener("ended",this._onEnded),this._sourceNode=null}}_initSourceNode(){if(!this._sourceNode){if(this._sourceNode=new AudioBufferSourceNode(this._sound._audioContext,{buffer:this._sound.buffer._audioBuffer}),this._sourceNode.addEventListener("ended",this._onEnded,{once:!0}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._pitch=new Q(this.engine,this._sourceNode.detune),this._playbackRate=new Q(this.engine,this._sourceNode.playbackRate)}const e=this._sourceNode;e.detune.value=this._sound.pitch,e.loop=this._options.loop,e.loopEnd=this._options.loopEnd,e.loopStart=this._options.loopStart,e.playbackRate.value=this._sound.playbackRate}}const ss=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioStaticSound:te,_WebAudioStaticSoundBuffer:Ze},Symbol.toStringTag,{value:"Module"}));class Bn extends Ms{constructor(e,t,s){super(e,t,s),this._preloadedInstances=new Array}get preloadCount(){return this._options.preloadCount??1}get preloadCompletedCount(){return this._preloadedInstances.length}preloadInstanceAsync(){const e=this._createInstance();return this._addPreloadedInstance(e),e.preloadedPromise}async preloadInstancesAsync(e){for(let t=0;t<e;t++)this.preloadInstanceAsync();await Promise.all(this._preloadedInstances.map(async t=>await t.preloadedPromise))}play(e={}){if(this.state===5){this.resume();return}let t;this.preloadCompletedCount>0?(t=this._preloadedInstances[0],t.startOffset=this.startOffset,this._removePreloadedInstance(t)):t=this._createInstance();const s=()=>{t.state===3&&(this._stopExcessInstances(),t.onStateChangedObservable.removeCallback(s))};t.onStateChangedObservable.add(s),e.startOffset??(e.startOffset=this.startOffset),e.loop??(e.loop=this.loop),e.volume??(e.volume=1),this._beforePlay(t),t.play(e),this._afterPlay(t)}stop(){if(this._setState(1),!!this._instances)for(const e of Array.from(this._instances))e.stop()}_addPreloadedInstance(e){this._preloadedInstances.includes(e)||this._preloadedInstances.push(e)}_removePreloadedInstance(e){const t=this._preloadedInstances.indexOf(e);t!==-1&&this._preloadedInstances.splice(t,1)}}class Nn extends Ds{constructor(e){super(e),this.onReadyObservable=new U,this.preloadedPromise=new Promise((t,s)=>{this._rejectPreloadedPromise=s,this._resolvePreloadedPromise=t}),this.onErrorObservable.add(this._rejectPreloadedPromise),this.onReadyObservable.add(this._resolvePreloadedPromise)}set startOffset(e){this._options.startOffset=e}dispose(){super.dispose(),this.onErrorObservable.clear(),this.onReadyObservable.clear(),this._resolvePreloadedPromise()}}class Ie extends Bn{constructor(e,t,s){super(e,t,s),this._stereo=null,this._options={autoplay:s.autoplay??!1,loop:s.loop??!1,maxInstances:s.maxInstances??1/0,preloadCount:s.preloadCount??1,startOffset:s.startOffset??0},this._subGraph=new Ie._SubGraph(this)}async _initAsync(e,t){const s=this.engine._audioContext;if(!(s instanceof AudioContext))throw new Error("Unsupported audio context type.");this._audioContext=s,this._source=e,t.outBus?this.outBus=t.outBus:t.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),Ge(t)&&this._initSpatialProperty(),this.preloadCount&&await this.preloadInstancesAsync(this.preloadCount),t.autoplay&&this.play(t),this.engine._addSound(this)}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new Et(this._subGraph))}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeSound(this)}getClassName(){return"_WebAudioStreamingSound"}_createInstance(){return new Fn(this,this._options)}_connect(e){return super._connect(e)?(e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_createSpatialProperty(e,t){return new yt(this._subGraph,e,t)}_getOptions(){return this._options}}Ie._SubGraph=class extends xt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};class Fn extends Nn{constructor(e,t){if(super(e),this._currentTimeChangedWhilePaused=!1,this._enginePlayTime=1/0,this._enginePauseTime=0,this._isReady=!1,this._isReadyPromise=new Promise((s,i)=>{this._resolveIsReadyPromise=s,this._rejectIsReadyPromise=i}),this._onCanPlayThrough=()=>{this._isReady=!0,this._resolveIsReadyPromise(this._mediaElement),this.onReadyObservable.notifyObservers(this)},this._onEnded=()=>{this._setState(1)},this._onError=s=>{this._setState(4),this.onErrorObservable.notifyObservers(s),this._rejectIsReadyPromise(s),this.dispose()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._onUserGesture=()=>{this.play()},this._options=t,this._volumeNode=new GainNode(e._audioContext),typeof e._source=="string")this._initFromUrl(e._source);else if(Array.isArray(e._source))this._initFromUrls(e._source);else if(e._source instanceof HTMLMediaElement)this._initFromMediaElement(e._source);else throw new Error(`Invalid streaming sound source (${e._source}).`)}get currentTime(){if(this._state===1)return 0;const e=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+e+this._options.startOffset}set currentTime(e){const t=this._state===2||this._state===3;t&&(this._mediaElement.pause(),this._state=1),this._options.startOffset=e,t?this.play({startOffset:e}):this._state===5&&(this._currentTimeChangedWhilePaused=!0)}get _outNode(){return this._volumeNode}get startTime(){return this._state===1?0:this._enginePlayTime}dispose(){super.dispose(),this.stop(),this._sourceNode?.disconnect(this._volumeNode),this._sourceNode=null,this._mediaElement.removeEventListener("error",this._onError),this._mediaElement.removeEventListener("ended",this._onEnded),this._mediaElement.removeEventListener("canplaythrough",this._onCanPlayThrough);for(const e of Array.from(this._mediaElement.children))this._mediaElement.removeChild(e);this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this.engine.userGestureObservable.removeCallback(this._onUserGesture)}play(e={}){if(this._state===3)return;e.loop!==void 0&&(this._options.loop=e.loop),this._mediaElement.loop=this._options.loop;let t=e.startOffset;this._currentTimeChangedWhilePaused?(t=this._options.startOffset,this._currentTimeChangedWhilePaused=!1):this._state===5&&(t=this.currentTime),t&&t>0&&(this._mediaElement.currentTime=t),this._volumeNode.gain.value=e.volume??1,this._play()}pause(){this._state!==2&&this._state!==3||(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._mediaElement.pause())}resume(){this._state===5?this.play():this._currentTimeChangedWhilePaused&&this.play()}stop(){this._state!==1&&this._stop()}getClassName(){return"_WebAudioStreamingSoundInstance"}_connect(e){return super._connect(e)?(e instanceof Ie&&e._inNode&&this._outNode?.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e instanceof Ie&&e._inNode&&this._outNode?.disconnect(e._inNode),!0):!1}_initFromMediaElement(e){if(q.SetCorsBehavior(e.currentSrc,e),e.controls=!1,e.loop=this._options.loop,e.preload="auto",e.addEventListener("canplaythrough",this._onCanPlayThrough,{once:!0}),e.addEventListener("ended",this._onEnded,{once:!0}),e.addEventListener("error",this._onError,{once:!0}),e.load(),this._sourceNode=new MediaElementAudioSourceNode(this._sound._audioContext,{mediaElement:e}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._mediaElement=e}_initFromUrl(e){const t=qe.IsCustomRequestAvailable?Yt(Oe(e)):Oe(e),s=new Audio(t);this._initFromMediaElement(s)}_initFromUrls(e){const t=new Audio;for(const s of e){const i=document.createElement("source");i.src=qe.IsCustomRequestAvailable?Yt(Oe(s)):Oe(s),t.appendChild(i)}this._initFromMediaElement(t)}_play(){if(this._setState(2),!this._isReady){this._playWhenReady();return}if(this._state===2)if(this.engine.state==="running"){const e=this._mediaElement.play();this._enginePlayTime=this.engine.currentTime,this._setState(3),e.catch(()=>{this._setState(4),this._options.loop&&this.engine.userGestureObservable.addOnce(this._onUserGesture)})}else this._options.loop?this.engine.stateChangedObservable.add(this._onEngineStateChanged):(this.stop(),this._setState(4))}_playWhenReady(){this._isReadyPromise.then(()=>{this._play()}).catch(()=>{N.Error("Streaming sound instance failed to play"),this._setState(4)})}_stop(){this._mediaElement.pause(),this._onEnded(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}}const On=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioStreamingSound:Ie},Symbol.toStringTag,{value:"Module"})),is={duration:0,shape:"linear"},ce={duration:0,startOffset:0,waitTime:0},ns={waitTime:0};function We(n){return n*Math.PI/180}function rs(n){return n*180/Math.PI}class ae{get name(){return this._soundV2.name}set name(e){this._soundV2.name=e}get autoplay(){return this._soundV2 instanceof K?!0:this._optionsV2.autoplay}set autoplay(e){this._optionsV2.autoplay=e}get loop(){return this._soundV2 instanceof K?!0:this._soundV2.loop}set loop(e){this._soundV2 instanceof K||this._soundV2&&(this._soundV2.loop=e)}get isPlaying(){return this._soundV2 instanceof K?!0:this._soundV2?.state===3||!this.isReady()&&this._optionsV2.autoplay}get isPaused(){return this._soundV2 instanceof K?!1:this._soundV2.state===5}get maxDistance(){return this._optionsV2.spatialMaxDistance||100}set maxDistance(e){this._optionsV2.spatialMaxDistance=e,!this.useCustomAttenuation&&this._soundV2&&(this._initSpatial(),this._soundV2.spatial.maxDistance=e)}get distanceModel(){return this._optionsV2.spatialDistanceModel||"linear"}set distanceModel(e){this._optionsV2.spatialDistanceModel=e,this._soundV2&&(this._initSpatial(),this._soundV2.spatial.distanceModel=e)}get currentTime(){return this._soundV2 instanceof K?this._soundV2.engine.currentTime:this._soundV2.currentTime}get spatialSound(){return this._soundV2?._isSpatial??!1}set spatialSound(e){this._soundV2&&(e?this._initSpatial():this._soundV2._isSpatial=!1)}get _onReady(){return this._onReadyObservable||(this._onReadyObservable=new U),this._onReadyObservable}constructor(e,t,s,i=null,r){if(this.useCustomAttenuation=!1,this.soundTrackId=-1,this.refDistance=1,this.rolloffFactor=1,this.metadata=null,this.onEndedObservable=new U,this._localDirection=new y(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._isOutputConnected=!1,this._url=null,this._onReadyObservable=null,this._onReadyToPlay=()=>{this._scene.mainSoundTrack.addSound(this),this._isReadyToPlay=!0,this._readyToPlayCallback(),this._onReadyObservable&&this._onReadyObservable.notifyObservers(),this._optionsV2.autoplay&&this.play()},this._onended=()=>{this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)},s=s||me.LastCreatedScene,!s)return;this._scene=s,ae._SceneComponentInitialization(s),this._readyToPlayCallback=i||(()=>{}),this._customAttenuationFunction=(c,E,C,g,_)=>E<C?c*(1-E/C):0,r=r||{};const a={analyzerEnabled:!1,autoplay:!1,duration:r.length||0,loop:r.loop||!1,loopEnd:0,loopStart:0,outBus:null,outBusAutoDefault:!1,playbackRate:r.playbackRate||1,pitch:0,skipCodecCheck:r.skipCodecCheck||!1,spatialDistanceModel:r.distanceModel,spatialEnabled:r.spatialSound,spatialMaxDistance:r.maxDistance,spatialMinDistance:r.refDistance,spatialRolloffFactor:r.rolloffFactor,stereoEnabled:!1,startOffset:r.offset||0,volume:r.volume??1};this._volume=r.volume??1,Ge(a)&&(a.spatialAutoUpdate=!1,a.spatialConeInnerAngle=v.coneInnerAngle,a.spatialConeOuterAngle=v.coneOuterAngle,a.spatialConeOuterVolume=v.coneOuterVolume,a.spatialMinUpdateTime=0,a.spatialOrientation=v.orientation.clone(),a.spatialPanningModel=this._scene.headphone?"HRTF":"equalpower",a.spatialPosition=v.position.clone(),a.spatialRotation=v.rotation.clone(),a.spatialRotationQuaternion=v.rotationQuaternion.clone(),a.spatialMaxDistance===void 0&&(a.spatialMaxDistance=100)),this._optionsV2={...a},this._optionsV2.autoplay=r.autoplay||!1,this.useCustomAttenuation=r.useCustomAttenuation??!1,this.useCustomAttenuation&&(a.spatialMaxDistance=Number.MAX_VALUE,a.volume=0);let o=r?.streaming||!1;if(!k.audioEngine)return;const l=k.audioEngine._v2,f=()=>{if(o){const c={preloadCount:0,...a},E=new Ie(e,l,c);return E._initAsync(t,a).then(()=>{E.preloadInstancesAsync(1).then(this._onReadyToPlay)}),E}else{const c=new te(e,l,a);return c._initAsync(t,a).then(this._onReadyToPlay),c}};if(!t)this._soundV2=new te(e,l,a);else if(typeof t=="string")this._url=t,this._soundV2=f();else if(t instanceof ArrayBuffer)o=!1,this._soundV2=f();else if(t instanceof HTMLMediaElement)o=!0,this._soundV2=f();else if(t instanceof MediaStream){const c=new MediaStreamAudioSourceNode(l._audioContext,{mediaStream:t});this._soundV2=new K(e,c,l,a),this._soundV2._initAsync(a).then(this._onReadyToPlay)}else t instanceof AudioBuffer?(o=!1,this._soundV2=f()):Array.isArray(t)&&(this._soundV2=f());if(!this._soundV2){N.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");return}this._soundV2 instanceof K||this._soundV2.onEndedObservable.add(this._onended)}dispose(){this.isPlaying&&this.stop(),this._isReadyToPlay=!1,this.soundTrackId===-1?this._scene.mainSoundTrack.removeSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].removeSound(this),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null),this._soundV2.dispose()}isReady(){return this._isReadyToPlay}getClassName(){return"Sound"}setAudioBuffer(e){this._isReadyToPlay||this._soundV2 instanceof te&&this._soundV2._initAsync(e,this._optionsV2).then(this._onReadyToPlay)}updateOptions(e){if(e){if(this.loop=e.loop??this.loop,this.maxDistance=e.maxDistance??this.maxDistance,this.useCustomAttenuation=e.useCustomAttenuation??this.useCustomAttenuation,this.rolloffFactor=e.rolloffFactor??this.rolloffFactor,this.refDistance=e.refDistance??this.refDistance,this.distanceModel=e.distanceModel??this.distanceModel,e.playbackRate!==void 0&&this.setPlaybackRate(e.playbackRate),e.spatialSound!==void 0&&(this.spatialSound=e.spatialSound),e.volume!==void 0&&this.setVolume(e.volume),this._soundV2 instanceof te){let t=!1;e.offset!==void 0&&(this._optionsV2.startOffset=e.offset,t=!0),e.length!==void 0&&(this._soundV2.duration=e.length,t=!0),t&&this.isPaused&&this.stop()}this._updateSpatialParameters()}}_updateSpatialParameters(){if(!this.spatialSound)return;const e=this._soundV2.spatial;this.useCustomAttenuation?(e.distanceModel="linear",e.minDistance=1,e.maxDistance=Number.MAX_VALUE,e.rolloffFactor=1,e.panningModel="equalpower"):(e.distanceModel=this.distanceModel,e.minDistance=this.refDistance,e.maxDistance=this.maxDistance,e.rolloffFactor=this.rolloffFactor,e.panningModel=this._optionsV2.spatialPanningModel||"equalpower")}switchPanningModelToHRTF(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="HRTF")}switchPanningModelToEqualPower(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="equalpower")}connectToSoundTrackAudioNode(e){const t=this._soundV2._outNode;t&&(this._isOutputConnected&&t.disconnect(),t.connect(e),this._isOutputConnected=!0)}setDirectionalCone(e,t,s){if(t<e){N.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeInnerAngle=We(e),this._optionsV2.spatialConeOuterAngle=We(t),this._optionsV2.spatialConeOuterVolume=s,this._initSpatial(),this._soundV2.spatial.coneInnerAngle=this._optionsV2.spatialConeInnerAngle,this._soundV2.spatial.coneOuterAngle=this._optionsV2.spatialConeOuterAngle,this._soundV2.spatial.coneOuterVolume=s,this._isDirectional=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._optionsV2.startOffset,this._optionsV2.duration))}get directionalConeInnerAngle(){return rs(typeof this._optionsV2.spatialConeInnerAngle=="number"?this._optionsV2.spatialConeInnerAngle:v.coneInnerAngle)}set directionalConeInnerAngle(e){if(e=We(e),e!=this._optionsV2.spatialConeInnerAngle){if(this.directionalConeOuterAngle<e){N.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeInnerAngle=e,this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.coneInnerAngle=e)}}get directionalConeOuterAngle(){return rs(typeof this._optionsV2.spatialConeOuterAngle=="number"?this._optionsV2.spatialConeOuterAngle:v.coneOuterAngle)}set directionalConeOuterAngle(e){if(e=We(e),e!=this._optionsV2.spatialConeOuterAngle){if(e<this.directionalConeInnerAngle){N.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeOuterAngle=e,this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.coneOuterAngle=e)}}setPosition(e){this._optionsV2.spatialPosition&&e.equals(this._optionsV2.spatialPosition)||(this._optionsV2.spatialPosition||(this._optionsV2.spatialPosition=y.Zero()),this._optionsV2.spatialPosition.copyFrom(e),this.spatialSound&&!isNaN(e.x)&&!isNaN(e.y)&&!isNaN(e.z)&&(this._initSpatial(),this._soundV2.spatial.position=e))}setLocalDirectionToMesh(e){this._localDirection=e,this._connectedTransformNode&&this.isPlaying&&this._updateDirection()}_updateDirection(){if(!this._connectedTransformNode||!this.spatialSound)return;const e=this._connectedTransformNode.getWorldMatrix(),t=y.TransformNormal(this._localDirection,e);t.normalize(),this._initSpatial(),this._soundV2.spatial.orientation=t}_initSpatial(){this._soundV2._isSpatial=!0,this._optionsV2.spatialDistanceModel===void 0&&(this._optionsV2.spatialDistanceModel="linear",this._soundV2.spatial.distanceModel="linear"),this._optionsV2.spatialMaxDistance===void 0&&(this._optionsV2.spatialMaxDistance=100,this._soundV2.spatial.maxDistance=100)}updateDistanceFromListener(){if(this._soundV2._outNode&&this._connectedTransformNode&&this.useCustomAttenuation&&this._scene.activeCamera){const e=this._scene.audioListenerPositionProvider?this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length():this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundV2.volume=this._customAttenuationFunction(this._volume,e,this.maxDistance,this.refDistance,this.rolloffFactor)}}setAttenuationFunction(e){this._customAttenuationFunction=e}play(e,t,s){const i=k.audioEngine;if(i?.unlock(),!(this._soundV2 instanceof K)&&this._isReadyToPlay&&this._scene.audioEnabled){this._soundV2.state===5&&(e!==void 0||t!==void 0||s!==void 0)&&this._soundV2.stop();try{ce.duration=s||0,ce.startOffset=t!==void 0?t||this._optionsV2.startOffset:this._optionsV2.startOffset,ce.waitTime=e||0,ce.loop=void 0,ce.loopStart=void 0,ce.loopEnd=void 0,ce.volume=void 0,i?.unlocked?this._soundV2.play(ce):setTimeout(()=>{this._soundV2.play(ce)},500)}catch(r){N.Error("Error while trying to play audio: "+this.name+", "+r.message)}}}stop(e){this._soundV2&&(this._soundV2 instanceof K||(ns.waitTime=e||0,this._soundV2.stop(ns)))}pause(){this._soundV2&&(this._soundV2 instanceof K||this._soundV2.pause())}setVolume(e,t){if(!this.isReady()){this._onReady.addOnce(()=>{this.setVolume(e,t)});return}is.duration=t||0,this._soundV2.setVolume(e,is),this._volume=e}setPlaybackRate(e){this._soundV2 instanceof te&&(this._soundV2.playbackRate=e)}getPlaybackRate(){return this._soundV2 instanceof te?this._soundV2.playbackRate:1}getVolume(){return this._volume}attachToMesh(e){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._optionsV2.startOffset,this._optionsV2.duration))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=t=>this._onRegisterAfterWorldMatrixUpdate(t),this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)}detachFromMesh(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)}_onRegisterAfterWorldMatrixUpdate(e){if(!e.getBoundingInfo)this.setPosition(e.absolutePosition);else{const s=e.getBoundingInfo();this.setPosition(s.boundingSphere.centerWorld)}this._isDirectional&&this.isPlaying&&this._updateDirection()}clone(){if(!(this._soundV2 instanceof te))return null;const e={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},t=new ae(this.name+"_cloned",this._soundV2.buffer,this._scene,null,e);return t._optionsV2=this._optionsV2,this.useCustomAttenuation&&t.setAttenuationFunction(this._customAttenuationFunction),t}getAudioBuffer(){return this._soundV2 instanceof te?this._soundV2.buffer._audioBuffer:null}getSoundSource(){return null}getSoundGain(){return this._soundV2._outNode}serialize(){const e={name:this.name,url:this._url,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this.getPlaybackRate(),panningModel:this._soundV2.spatial.panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this.spatialSound&&(this._connectedTransformNode&&(e.connectedMeshId=this._connectedTransformNode.id),e.position=this._soundV2.spatial.position.asArray(),e.refDistance=this.refDistance,e.distanceModel=this.distanceModel,e.isDirectional=this._isDirectional,e.localDirectionToMesh=this._localDirection.asArray(),e.coneInnerAngle=this.directionalConeInnerAngle,e.coneOuterAngle=this.directionalConeOuterAngle,e.coneOuterGain=this._soundV2.spatial.coneOuterVolume),e}static Parse(e,t,s,i){const r=e.name;let a;e.url?a=s+e.url:a=s+r;const o={autoplay:e.autoplay,loop:e.loop,volume:e.volume,spatialSound:e.spatialSound,maxDistance:e.maxDistance,rolloffFactor:e.rolloffFactor,refDistance:e.refDistance,distanceModel:e.distanceModel,playbackRate:e.playbackRate};let u;if(!i)u=new ae(r,a,t,()=>{t.removePendingData(u)},o),t.addPendingData(u);else{const l=()=>{Xs(()=>i._isReadyToPlay,()=>{const f=i.getAudioBuffer();f&&u.setAudioBuffer(f),u._isReadyToPlay=!0,u.autoplay&&u.play(0,i._optionsV2.startOffset,i._optionsV2.duration)},void 0,300)};u=new ae(r,new ArrayBuffer(0),t,null,o),l()}if(e.position){const l=y.FromArray(e.position);u.setPosition(l)}if(e.isDirectional&&(u.setDirectionalCone(e.coneInnerAngle||360,e.coneOuterAngle||360,e.coneOuterGain||0),e.localDirectionToMesh)){const l=y.FromArray(e.localDirectionToMesh);u.setLocalDirectionToMesh(l)}if(e.connectedMeshId){const l=t.getMeshById(e.connectedMeshId);l&&u.attachToMesh(l)}return e.metadata&&(u.metadata=e.metadata),u}}ae._SceneComponentInitialization=n=>{throw qs("AudioSceneComponent")};Ee("BABYLON.Sound",ae);class Ln{constructor(e,t={}){this.id=-1,this._isInitialized=!1,e=e||me.LastCreatedScene,e&&(this._scene=e,this.soundCollection=[],this._options=t,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1))}_initializeSoundTrackAudioGraph(){k.audioEngine?.canUseWebAudio&&k.audioEngine.audioContext&&(this._outputAudioNode=k.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(k.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)}dispose(){if(k.audioEngine&&k.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}}addSound(e){this._isInitialized||this._initializeSoundTrackAudioGraph(),k.audioEngine?.canUseWebAudio&&this._outputAudioNode&&e.connectToSoundTrackAudioNode(this._outputAudioNode),e.soundTrackId!==void 0&&(e.soundTrackId===-1?this._scene.mainSoundTrack.removeSound(e):this._scene.soundTracks&&this._scene.soundTracks[e.soundTrackId].removeSound(e)),this.soundCollection.push(e),e.soundTrackId=this.id}removeSound(e){const t=this.soundCollection.indexOf(e);t!==-1&&this.soundCollection.splice(t,1)}setVolume(e){k.audioEngine?.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)}switchPanningModelToHRTF(){if(k.audioEngine?.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToHRTF()}switchPanningModelToEqualPower(){if(k.audioEngine?.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToEqualPower()}connectToAnalyser(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=e,k.audioEngine?.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.disconnect(),this._connectedAnalyser.connectAudioNodes(this._outputAudioNode,k.audioEngine.masterGain))}}Ks(J.NAME_AUDIO,(n,e,t,s)=>{const i=[];let r;if(t.sounds=t.sounds||[],n.sounds!==void 0&&n.sounds!==null)for(let a=0,o=n.sounds.length;a<o;a++){const u=n.sounds[a];k.audioEngine?.canUseWebAudio?(u.url||(u.url=u.name),i[u.url]?t.sounds.push(ae.Parse(u,e,s,i[u.url])):(r=ae.Parse(u,e,s),i[u.url]=r,t.sounds.push(r))):t.sounds.push(new ae(u.name,null,e))}});Object.defineProperty(xe.prototype,"mainSoundTrack",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),this._mainSoundTrack||(this._mainSoundTrack=new Ln(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0});xe.prototype.getSoundByName=function(n){let e;for(e=0;e<this.mainSoundTrack.soundCollection.length;e++)if(this.mainSoundTrack.soundCollection[e].name===n)return this.mainSoundTrack.soundCollection[e];if(this.soundTracks){for(let t=0;t<this.soundTracks.length;t++)for(e=0;e<this.soundTracks[t].soundCollection.length;e++)if(this.soundTracks[t].soundCollection[e].name===n)return this.soundTracks[t].soundCollection[e]}return null};Object.defineProperty(xe.prototype,"audioEnabled",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),n.audioEnabled},set:function(n){let e=this._getComponent(J.NAME_AUDIO);e||(e=new Z(this),this._addComponent(e)),n?e.enableAudio():e.disableAudio()},enumerable:!0,configurable:!0});Object.defineProperty(xe.prototype,"headphone",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),n.headphone},set:function(n){let e=this._getComponent(J.NAME_AUDIO);e||(e=new Z(this),this._addComponent(e)),n?e.switchAudioModeForHeadphones():e.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0});Object.defineProperty(xe.prototype,"audioListenerPositionProvider",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),n.audioListenerPositionProvider},set:function(n){let e=this._getComponent(J.NAME_AUDIO);if(e||(e=new Z(this),this._addComponent(e)),n&&typeof n!="function")throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");e.audioListenerPositionProvider=n},enumerable:!0,configurable:!0});Object.defineProperty(xe.prototype,"audioListenerRotationProvider",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),n.audioListenerRotationProvider},set:function(n){let e=this._getComponent(J.NAME_AUDIO);if(e||(e=new Z(this),this._addComponent(e)),n&&typeof n!="function")throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");e.audioListenerRotationProvider=n},enumerable:!0,configurable:!0});Object.defineProperty(xe.prototype,"audioPositioningRefreshRate",{get:function(){let n=this._getComponent(J.NAME_AUDIO);return n||(n=new Z(this),this._addComponent(n)),n.audioPositioningRefreshRate},set:function(n){let e=this._getComponent(J.NAME_AUDIO);e||(e=new Z(this),this._addComponent(e)),e.audioPositioningRefreshRate=n},enumerable:!0,configurable:!0});class Z{get audioEnabled(){return this._audioEnabled}get headphone(){return this._headphone}constructor(e){this.name=J.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.audioPositioningRefreshRate=500,this.audioListenerPositionProvider=null,this.audioListenerRotationProvider=null,this._cachedCameraDirection=new y,this._cachedCameraPosition=new y,this._lastCheck=0,this._invertMatrixTemp=new b,this._cameraDirectionTemp=new y,e=e||me.LastCreatedScene,e&&(this.scene=e,e.soundTracks=[],e.sounds=[])}register(){this.scene._afterRenderStage.registerStep(J.STEP_AFTERRENDER_AUDIO,this,this._afterRender)}rebuild(){}serialize(e){if(e.sounds=[],this.scene.soundTracks)for(let t=0;t<this.scene.soundTracks.length;t++){const s=this.scene.soundTracks[t];for(let i=0;i<s.soundCollection.length;i++)e.sounds.push(s.soundCollection[i].serialize())}}addFromContainer(e){if(e.sounds)for(const t of e.sounds)t.play(),t.autoplay=!0,this.scene.mainSoundTrack.addSound(t)}removeFromContainer(e,t=!1){if(e.sounds)for(const s of e.sounds)s.stop(),s.autoplay=!1,this.scene.mainSoundTrack.removeSound(s),t&&s.dispose()}dispose(){const e=this.scene;if(e._mainSoundTrack&&e.mainSoundTrack.dispose(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].dispose()}disableAudio(){const e=this.scene;this._audioEnabled=!1,k.audioEngine&&k.audioEngine.audioContext&&k.audioEngine.audioContext.suspend();let t;for(t=0;t<e.mainSoundTrack.soundCollection.length;t++)e.mainSoundTrack.soundCollection[t].pause();if(e.soundTracks)for(t=0;t<e.soundTracks.length;t++)for(let s=0;s<e.soundTracks[t].soundCollection.length;s++)e.soundTracks[t].soundCollection[s].pause()}enableAudio(){const e=this.scene;this._audioEnabled=!0,k.audioEngine&&k.audioEngine.audioContext&&k.audioEngine.audioContext.resume();let t;for(t=0;t<e.mainSoundTrack.soundCollection.length;t++)e.mainSoundTrack.soundCollection[t].isPaused&&e.mainSoundTrack.soundCollection[t].play();if(e.soundTracks)for(t=0;t<e.soundTracks.length;t++)for(let s=0;s<e.soundTracks[t].soundCollection.length;s++)e.soundTracks[t].soundCollection[s].isPaused&&e.soundTracks[t].soundCollection[s].play()}switchAudioModeForHeadphones(){const e=this.scene;if(this._headphone=!0,e.mainSoundTrack.switchPanningModelToHRTF(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToHRTF()}switchAudioModeForNormalSpeakers(){const e=this.scene;if(this._headphone=!1,e.mainSoundTrack.switchPanningModelToEqualPower(),e.soundTracks)for(let t=0;t<e.soundTracks.length;t++)e.soundTracks[t].switchPanningModelToEqualPower()}_afterRender(){const e=_s.Now;if(this._lastCheck&&e-this._lastCheck<this.audioPositioningRefreshRate)return;this._lastCheck=e;const t=this.scene;if(!this._audioEnabled||!t._mainSoundTrack||!t.soundTracks||t._mainSoundTrack.soundCollection.length===0&&t.soundTracks.length===1)return;const s=k.audioEngine;if(s&&s.audioContext){let i=t.activeCamera;if(t.activeCameras&&t.activeCameras.length>0&&(i=t.activeCameras[0]),this.audioListenerPositionProvider){const a=this.audioListenerPositionProvider();s.audioContext.listener.setPosition(a.x||0,a.y||0,a.z||0)}else i?this._cachedCameraPosition.equals(i.globalPosition)||(this._cachedCameraPosition.copyFrom(i.globalPosition),s.audioContext.listener.setPosition(i.globalPosition.x,i.globalPosition.y,i.globalPosition.z)):s.audioContext.listener.setPosition(0,0,0);if(this.audioListenerRotationProvider){const a=this.audioListenerRotationProvider();s.audioContext.listener.setOrientation(a.x||0,a.y||0,a.z||0,0,1,0)}else i?(i.rigCameras&&i.rigCameras.length>0&&(i=i.rigCameras[0]),i.getViewMatrix().invertToRef(this._invertMatrixTemp),y.TransformNormalToRef(Z._CameraDirection,this._invertMatrixTemp,this._cameraDirectionTemp),this._cameraDirectionTemp.normalize(),!isNaN(this._cameraDirectionTemp.x)&&!isNaN(this._cameraDirectionTemp.y)&&!isNaN(this._cameraDirectionTemp.z)&&(this._cachedCameraDirection.equals(this._cameraDirectionTemp)||(this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp),s.audioContext.listener.setOrientation(this._cameraDirectionTemp.x,this._cameraDirectionTemp.y,this._cameraDirectionTemp.z,0,1,0)))):s.audioContext.listener.setOrientation(0,0,0,0,1,0);let r;for(r=0;r<t.mainSoundTrack.soundCollection.length;r++){const a=t.mainSoundTrack.soundCollection[r];a.useCustomAttenuation&&a.updateDistanceFromListener()}if(t.soundTracks)for(r=0;r<t.soundTracks.length;r++)for(let a=0;a<t.soundTracks[r].soundCollection.length;a++){const o=t.soundTracks[r].soundCollection[a];o.useCustomAttenuation&&o.updateDistanceFromListener()}}}}Z._CameraDirection=new y(0,0,-1);ae._SceneComponentInitialization=n=>{let e=n._getComponent(J.NAME_AUDIO);e||(e=new Z(n),n._addComponent(e))};class Gr{constructor(e,t,s){if(this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],t.length!==s.length)throw new Error("Sounds length does not equal weights length");this.loop=e,this._weights=s;let i=0;for(const a of s)i+=a;const r=i>0?1/i:0;for(let a=0;a<this._weights.length;a++)this._weights[a]*=r;this._sounds=t;for(const a of this._sounds)a.onEndedObservable.add(()=>{this._onended()})}get directionalConeInnerAngle(){return this._coneInnerAngle}set directionalConeInnerAngle(e){if(e!==this._coneInnerAngle){if(this._coneOuterAngle<e){N.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._coneInnerAngle=e;for(const t of this._sounds)t.directionalConeInnerAngle=e}}get directionalConeOuterAngle(){return this._coneOuterAngle}set directionalConeOuterAngle(e){if(e!==this._coneOuterAngle){if(e<this._coneInnerAngle){N.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._coneOuterAngle=e;for(const t of this._sounds)t.directionalConeOuterAngle=e}}get volume(){return this._volume}set volume(e){if(e!==this._volume)for(const t of this._sounds)t.setVolume(e)}_onended(){this._currentIndex!==void 0&&(this._sounds[this._currentIndex].autoplay=!1),this.loop&&this.isPlaying?this.play():this.isPlaying=!1}pause(){this.isPlaying&&(this.isPaused=!0,this._currentIndex!==void 0&&this._sounds[this._currentIndex].pause())}stop(){this.isPlaying=!1,this._currentIndex!==void 0&&this._sounds[this._currentIndex].stop()}play(e){if(!this.isPaused){this.stop();const s=Math.random();let i=0;for(let r=0;r<this._weights.length;r++)if(i+=this._weights[r],s<=i){this._currentIndex=r;break}}const t=this._sounds[this._currentIndex??0];t.isReady()?t.play(0,this.isPaused?void 0:e):t.autoplay=!0,this.isPlaying=!0,this.isPaused=!1}}class ee extends X{constructor(e,t,s,i,r,a=!0,o=!1,u=3,l=0,f,c,E,C){super(null,r,!a,o,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,f),this.format=i,this._engine&&(!this._engine._caps.textureFloatLinearFiltering&&l===1&&(u=1),!this._engine._caps.textureHalfFloatLinearFiltering&&l===2&&(u=1),this._texture=this._engine.createRawTexture(e,t,s,i,a,o,u,null,l,f??0,c??!1,C),this.wrapU=X.CLAMP_ADDRESSMODE,this.wrapV=X.CLAMP_ADDRESSMODE,this._waitingForData=!!E&&!e)}update(e){this.updateMipLevel(e,0)}updateMipLevel(e,t){this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type,this._texture._useSRGBBuffer,t),this._waitingForData=!1}clone(){if(!this._texture)return super.clone();const e=new ee(null,this.getSize().width,this.getSize().height,this.format,this.getScene(),this._texture.generateMipMaps,this._invertY,this.samplingMode,this._texture.type,this._texture._creationFlags,this._useSRGBBuffer);return e._texture=this._texture,this._texture.incrementReferences(),e}isReady(){return super.isReady()&&!this._waitingForData}static CreateLuminanceTexture(e,t,s,i,r=!0,a=!1,o=3){return new ee(e,t,s,1,i,r,a,o)}static CreateLuminanceAlphaTexture(e,t,s,i,r=!0,a=!1,o=3){return new ee(e,t,s,2,i,r,a,o)}static CreateAlphaTexture(e,t,s,i,r=!0,a=!1,o=3){return new ee(e,t,s,0,i,r,a,o)}static CreateRGBTexture(e,t,s,i,r=!0,a=!1,o=3,u=0,l=0,f=!1){return new ee(e,t,s,4,i,r,a,o,u,l,f)}static CreateRGBATexture(e,t,s,i,r=!0,a=!1,o=3,u=0,l=0,f=!1,c=!1){return new ee(e,t,s,5,i,r,a,o,u,l,f,c)}static CreateRGBAStorageTexture(e,t,s,i,r=!0,a=!1,o=3,u=0,l=!1){return new ee(e,t,s,5,i,r,a,o,u,1,l)}static CreateRTexture(e,t,s,i,r=!0,a=!1,o=X.TRILINEAR_SAMPLINGMODE,u=1){return new ee(e,t,s,6,i,r,a,o,u)}static CreateRStorageTexture(e,t,s,i,r=!0,a=!1,o=X.TRILINEAR_SAMPLINGMODE,u=1){return new ee(e,t,s,6,i,r,a,o,u,1)}}class dt{get useTextureToStoreBoneMatrices(){return this._useTextureToStoreBoneMatrices}set useTextureToStoreBoneMatrices(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}get isUsingTextureForMatrices(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones}get uniqueId(){return this._uniqueId}constructor(e,t,s){this.name=e,this.id=t,this.bones=[],this.needInitialSkinMatrix=!1,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=b.Identity(),this._currentRenderId=-1,this._ranges={},this._absoluteTransformIsDirty=!0,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._parentContainer=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new U,this.metadata=null,this.bones=[],this._scene=s||me.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;const i=this._scene.getEngine().getCaps();this._canUseTextureForBones=i.textureFloat&&i.maxVertexTextureImageUnits>0}getClassName(){return"Skeleton"}getChildren(){return this.bones.filter(e=>!e.getParent())}getTransformMatrices(e){if(this.needInitialSkinMatrix){if(!e)throw new Error("getTransformMatrices: When using the needInitialSkinMatrix flag, a mesh must be provided");return e._bonesTransformMatrices||this.prepare(!0),e._bonesTransformMatrices}return(!this._transformMatrices||this._isDirty)&&this.prepare(!this._transformMatrices),this._transformMatrices}getTransformMatrixTexture(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture}getScene(){return this._scene}toString(e){let t=`Name: ${this.name}, nBones: ${this.bones.length}`;if(t+=`, nAnimationRanges: ${this._ranges?Object.keys(this._ranges).length:"none"}`,e){t+=", Ranges: {";let s=!0;for(const i in this._ranges)s&&(t+=", ",s=!1),t+=i;t+="}"}return t}getBoneIndexByName(e){for(let t=0,s=this.bones.length;t<s;t++)if(this.bones[t].name===e)return t;return-1}findBoneFromLinkedTransformNode(e){for(const t of this.bones)if(t._linkedTransformNode===e)return t;return null}findBoneFromLinkedTransformNodeName(e){for(const t of this.bones)if(t._linkedTransformNode&&t._linkedTransformNode.name===e)return t;return null}createAnimationRange(e,t,s){if(!this._ranges[e]){this._ranges[e]=new zt(e,t,s);for(let i=0,r=this.bones.length;i<r;i++)this.bones[i].animations[0]&&this.bones[i].animations[0].createRange(e,t,s)}}deleteAnimationRange(e,t=!0){for(let s=0,i=this.bones.length;s<i;s++)this.bones[s].animations[0]&&this.bones[s].animations[0].deleteRange(e,t);this._ranges[e]=null}getAnimationRange(e){return this._ranges[e]||null}getAnimationRanges(){const e=[];let t;for(t in this._ranges)e.push(this._ranges[t]);return e}copyAnimationRange(e,t,s=!1){if(this._ranges[t]||!e.getAnimationRange(t))return!1;let i=!0;const r=this._getHighestAnimationFrame()+1,a={},o=e.bones;let u,l;for(l=0,u=o.length;l<u;l++)a[o[l].name]=o[l];this.bones.length!==o.length&&(N.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${o.length}`),i=!1);const f=s&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(l=0,u=this.bones.length;l<u;l++){const E=this.bones[l].name,C=a[E];C?i=i&&this.bones[l].copyAnimationRange(C,t,r,s,f):(N.Warn("copyAnimationRange: not same rig, missing source bone "+E),i=!1)}const c=e.getAnimationRange(t);return c&&(this._ranges[t]=new zt(t,c.from+r,c.to+r)),i}returnToRest(){for(const e of this.bones)e._index!==-1&&e.returnToRest()}_getHighestAnimationFrame(){let e=0;for(let t=0,s=this.bones.length;t<s;t++)if(this.bones[t].animations[0]){const i=this.bones[t].animations[0].getHighestFrame();e<i&&(e=i)}return e}beginAnimation(e,t,s,i){const r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,s,i):null}static MakeAnimationAdditive(e,t=0,s){const i=e.getAnimationRange(s);if(!i)return null;const r=e._scene.getAllAnimatablesByTarget(e);let a=null;for(let u=0;u<r.length;u++){const l=r[u];if(l.fromFrame===i?.from&&l.toFrame===i?.to){a=l;break}}const o=e.getAnimatables();for(let u=0;u<o.length;u++){const f=o[u].animations;if(f)for(let c=0;c<f.length;c++)Wt.MakeAnimationAdditive(f[c],t,s)}return a&&(a.isAdditive=!0),e}_markAsDirty(){this._isDirty=!0,this._absoluteTransformIsDirty=!0}_registerMeshWithPoseMatrix(e){this._meshesWithPoseMatrix.push(e)}_unregisterMeshWithPoseMatrix(e){const t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)}_computeTransformMatrices(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(let s=0;s<this.bones.length;s++){const i=this.bones[s];i._childUpdateId++;const r=i.getParent();if(r?i.getLocalMatrix().multiplyToRef(r.getFinalMatrix(),i.getFinalMatrix()):t?i.getLocalMatrix().multiplyToRef(t,i.getFinalMatrix()):i.getFinalMatrix().copyFrom(i.getLocalMatrix()),i._index!==-1){const a=i._index===null?s:i._index;i.getAbsoluteInverseBindMatrix().multiplyToArray(i.getFinalMatrix(),e,a*16)}}this._identity.copyToArray(e,this.bones.length*16)}prepare(e=!1){if(!e){const t=this.getScene().getRenderId();if(this._currentRenderId===t)return;this._currentRenderId=t}if(this._numBonesWithLinkedTransformNode>0){for(const t of this.bones)if(t._linkedTransformNode){const s=t._linkedTransformNode;t.position=s.position,s.rotationQuaternion?t.rotationQuaternion=s.rotationQuaternion:t.rotation=s.rotation,t.scaling=s.scaling}}if(this.needInitialSkinMatrix)for(const t of this._meshesWithPoseMatrix){const s=t.getPoseMatrix();let i=this._isDirty;if((!t._bonesTransformMatrices||t._bonesTransformMatrices.length!==16*(this.bones.length+1))&&(t._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1)),i=!0),!!i){if(this._synchronizedWithMesh!==t){this._synchronizedWithMesh=t;for(const r of this.bones)r.getParent()||(r.getBindMatrix().multiplyToRef(s,H.Matrix[1]),r._updateAbsoluteBindMatrices(H.Matrix[1]));if(this.isUsingTextureForMatrices){const r=(this.bones.length+1)*4;(!t._transformMatrixTexture||t._transformMatrixTexture.getSize().width!==r)&&(t._transformMatrixTexture&&t._transformMatrixTexture.dispose(),t._transformMatrixTexture=ee.CreateRGBATexture(t._bonesTransformMatrices,(this.bones.length+1)*4,1,this._scene,!1,!1,1,1))}}this._computeTransformMatrices(t._bonesTransformMatrices,s),this.isUsingTextureForMatrices&&t._transformMatrixTexture&&t._transformMatrixTexture.update(t._bonesTransformMatrices)}}else{if(!this._isDirty)return;(!this._transformMatrices||this._transformMatrices.length!==16*(this.bones.length+1))&&(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=ee.CreateRGBATexture(this._transformMatrices,(this.bones.length+1)*4,1,this._scene,!1,!1,1,1))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices)}this._isDirty=!1}getAnimatables(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(let e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables}clone(e,t){const s=new dt(e,t||e,this._scene);s.needInitialSkinMatrix=this.needInitialSkinMatrix,s.metadata=this.metadata;for(let i=0;i<this.bones.length;i++){const r=this.bones[i];let a=null;const o=r.getParent();if(o){const l=this.bones.indexOf(o);a=s.bones[l]}const u=new B(r.name,s,a,r.getBindMatrix().clone(),r.getRestMatrix().clone());u._index=r._index,r._linkedTransformNode&&u.linkTransformNode(r._linkedTransformNode),js.DeepCopy(r.animations,u.animations)}if(this._ranges){s._ranges={};for(const i in this._ranges){const r=this._ranges[i];r&&(s._ranges[i]=r.clone())}}return this._isDirty=!0,s.prepare(!0),s}enableBlending(e=.01){for(const t of this.bones)for(const s of t.animations)s.enableBlending=!0,s.blendingSpeed=e}dispose(){if(this._meshesWithPoseMatrix.length=0,this.metadata=null,this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._parentContainer){const e=this._parentContainer.skeletons.indexOf(this);e>-1&&this._parentContainer.skeletons.splice(e,1),this._parentContainer=null}this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)}serialize(){const e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix,this.metadata&&(e.metadata=this.metadata);for(let t=0;t<this.bones.length;t++){const s=this.bones[t],i=s.getParent(),r={parentBoneIndex:i?this.bones.indexOf(i):-1,index:s.getIndex(),name:s.name,id:s.id,uniqueId:s.uniqueId,matrix:s.getBindMatrix().asArray(),rest:s.getRestMatrix().asArray(),linkedTransformNodeId:s.getTransformNode()?.id,linkedTransformNodeUniqueId:s.getTransformNode()?.uniqueId};e.bones.push(r),s.length&&(r.length=s.length),s.metadata&&(r.metadata=s.metadata),s.animations&&s.animations.length>0&&(r.animation=s.animations[0].serialize()),e.ranges=[];for(const a in this._ranges){const o=this._ranges[a];if(!o)continue;const u={};u.name=a,u.from=o.from,u.to=o.to,e.ranges.push(u)}}return e}static Parse(e,t){const s=new dt(e.name,e.id,t);e.dimensionsAtRest&&(s.dimensionsAtRest=y.FromArray(e.dimensionsAtRest)),s.needInitialSkinMatrix=e.needInitialSkinMatrix,e.metadata&&(s.metadata=e.metadata);let i;for(i=0;i<e.bones.length;i++){const r=e.bones[i],a=e.bones[i].index;let o=null;r.parentBoneIndex>-1&&(o=s.bones[r.parentBoneIndex]);const u=r.rest?b.FromArray(r.rest):null,l=new B(r.name,s,o,b.FromArray(r.matrix),u,null,a);r.id!==void 0&&r.id!==null&&(l.id=r.id),r.length&&(l.length=r.length),r.metadata&&(l.metadata=r.metadata),r.animation&&l.animations.push(Wt.Parse(r.animation)),r.linkedTransformNodeId!==void 0&&r.linkedTransformNodeId!==null&&(s._hasWaitingData=!0,l._waitingTransformNodeId=r.linkedTransformNodeId),r.linkedTransformNodeUniqueId!==void 0&&r.linkedTransformNodeUniqueId!==null&&(s._hasWaitingData=!0,l._waitingTransformNodeUniqueId=r.linkedTransformNodeUniqueId)}if(e.ranges)for(i=0;i<e.ranges.length;i++){const r=e.ranges[i];s.createAnimationRange(r.name,r.from,r.to)}return s}computeAbsoluteMatrices(e=!1){(this._absoluteTransformIsDirty||e)&&(this.bones[0].computeAbsoluteMatrices(),this._absoluteTransformIsDirty=!1)}computeAbsoluteTransforms(e=!1){this.computeAbsoluteMatrices(e)}getPoseMatrix(){let e=null;return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e}sortBones(){const e=[],t=new Array(this.bones.length);for(let s=0;s<this.bones.length;s++)this._sortBones(s,e,t);this.bones=e}_sortBones(e,t,s){if(s[e])return;s[e]=!0;const i=this.bones[e];if(!i)return;i._index===void 0&&(i._index=e);const r=i.getParent();r&&this._sortBones(this.bones.indexOf(r),t,s),t.push(i)}setCurrentPoseAsRest(){for(const e of this.bones)e.setCurrentPoseAsRest()}}class re{constructor(e){this.value=this._toInt(e)}_toInt(e){return e|0}add(e){return new re(this.value+e.value)}subtract(e){return new re(this.value-e.value)}multiply(e){return new re(Math.imul(this.value,e.value))}divide(e){return new re(this.value/e.value)}getClassName(){return re.ClassName}equals(e){return this.value===e.value}static FromValue(e){return new re(e)}toString(){return this.value.toString()}}re.ClassName="FlowGraphInteger";Ee("FlowGraphInteger",re);class _e{constructor(e=[1,0,0,1]){this._m=e}get m(){return this._m}transformVector(e){return this.transformVectorToRef(e,new je)}transformVectorToRef(e,t){return t.x=e.x*this._m[0]+e.y*this._m[1],t.y=e.x*this._m[2]+e.y*this._m[3],t}asArray(){return this.toArray()}toArray(e=[]){for(let t=0;t<4;t++)e[t]=this._m[t];return e}fromArray(e){for(let t=0;t<4;t++)this._m[t]=e[t];return this}multiplyToRef(e,t){const s=e._m,i=this._m,r=t._m;return r[0]=s[0]*i[0]+s[1]*i[2],r[1]=s[0]*i[1]+s[1]*i[3],r[2]=s[2]*i[0]+s[3]*i[2],r[3]=s[2]*i[1]+s[3]*i[3],t}multiply(e){return this.multiplyToRef(e,new _e)}divideToRef(e,t){const s=this._m,i=e._m,r=t._m;return r[0]=s[0]/i[0],r[1]=s[1]/i[1],r[2]=s[2]/i[2],r[3]=s[3]/i[3],t}divide(e){return this.divideToRef(e,new _e)}addToRef(e,t){const s=this._m,i=e.m,r=t.m;return r[0]=s[0]+i[0],r[1]=s[1]+i[1],r[2]=s[2]+i[2],r[3]=s[3]+i[3],t}add(e){return this.addToRef(e,new _e)}subtractToRef(e,t){const s=this._m,i=e.m,r=t.m;return r[0]=s[0]-i[0],r[1]=s[1]-i[1],r[2]=s[2]-i[2],r[3]=s[3]-i[3],t}subtract(e){return this.subtractToRef(e,new _e)}transpose(){const e=this._m;return new _e([e[0],e[2],e[1],e[3]])}determinant(){const e=this._m;return e[0]*e[3]-e[1]*e[2]}inverse(){const e=this.determinant();if(e===0)throw new Error("Matrix is not invertible");const t=this._m,s=1/e;return new _e([t[3]*s,-t[1]*s,-t[2]*s,t[0]*s])}equals(e,t=0){const s=this._m,i=e.m;return t===0?s[0]===i[0]&&s[1]===i[1]&&s[2]===i[2]&&s[3]===i[3]:Math.abs(s[0]-i[0])<t&&Math.abs(s[1]-i[1])<t&&Math.abs(s[2]-i[2])<t&&Math.abs(s[3]-i[3])<t}getClassName(){return"FlowGraphMatrix2D"}toString(){return`FlowGraphMatrix2D(${this._m.join(", ")})`}}class fe{constructor(e=[1,0,0,0,1,0,0,0,1]){this._m=e}get m(){return this._m}transformVector(e){return this.transformVectorToRef(e,new y)}transformVectorToRef(e,t){const s=this._m;return t.x=e.x*s[0]+e.y*s[1]+e.z*s[2],t.y=e.x*s[3]+e.y*s[4]+e.z*s[5],t.z=e.x*s[6]+e.y*s[7]+e.z*s[8],t}multiplyToRef(e,t){const s=e._m,i=this._m,r=t.m;return r[0]=s[0]*i[0]+s[1]*i[3]+s[2]*i[6],r[1]=s[0]*i[1]+s[1]*i[4]+s[2]*i[7],r[2]=s[0]*i[2]+s[1]*i[5]+s[2]*i[8],r[3]=s[3]*i[0]+s[4]*i[3]+s[5]*i[6],r[4]=s[3]*i[1]+s[4]*i[4]+s[5]*i[7],r[5]=s[3]*i[2]+s[4]*i[5]+s[5]*i[8],r[6]=s[6]*i[0]+s[7]*i[3]+s[8]*i[6],r[7]=s[6]*i[1]+s[7]*i[4]+s[8]*i[7],r[8]=s[6]*i[2]+s[7]*i[5]+s[8]*i[8],t}multiply(e){return this.multiplyToRef(e,new fe)}divideToRef(e,t){const s=this._m,i=e.m,r=t.m;return r[0]=s[0]/i[0],r[1]=s[1]/i[1],r[2]=s[2]/i[2],r[3]=s[3]/i[3],r[4]=s[4]/i[4],r[5]=s[5]/i[5],r[6]=s[6]/i[6],r[7]=s[7]/i[7],r[8]=s[8]/i[8],t}divide(e){return this.divideToRef(e,new fe)}addToRef(e,t){const s=this._m,i=e.m,r=t.m;return r[0]=s[0]+i[0],r[1]=s[1]+i[1],r[2]=s[2]+i[2],r[3]=s[3]+i[3],r[4]=s[4]+i[4],r[5]=s[5]+i[5],r[6]=s[6]+i[6],r[7]=s[7]+i[7],r[8]=s[8]+i[8],t}add(e){return this.addToRef(e,new fe)}subtractToRef(e,t){const s=this._m,i=e.m,r=t.m;return r[0]=s[0]-i[0],r[1]=s[1]-i[1],r[2]=s[2]-i[2],r[3]=s[3]-i[3],r[4]=s[4]-i[4],r[5]=s[5]-i[5],r[6]=s[6]-i[6],r[7]=s[7]-i[7],r[8]=s[8]-i[8],t}subtract(e){return this.subtractToRef(e,new fe)}toArray(e=[]){for(let t=0;t<9;t++)e[t]=this._m[t];return e}asArray(){return this.toArray()}fromArray(e){for(let t=0;t<9;t++)this._m[t]=e[t];return this}transpose(){const e=this._m;return new fe([e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]])}determinant(){const e=this._m;return e[0]*(e[4]*e[8]-e[5]*e[7])-e[1]*(e[3]*e[8]-e[5]*e[6])+e[2]*(e[3]*e[7]-e[4]*e[6])}inverse(){const e=this.determinant();if(e===0)throw new Error("Matrix is not invertible");const t=this._m,s=1/e;return new fe([(t[4]*t[8]-t[5]*t[7])*s,(t[2]*t[7]-t[1]*t[8])*s,(t[1]*t[5]-t[2]*t[4])*s,(t[5]*t[6]-t[3]*t[8])*s,(t[0]*t[8]-t[2]*t[6])*s,(t[2]*t[3]-t[0]*t[5])*s,(t[3]*t[7]-t[4]*t[6])*s,(t[1]*t[6]-t[0]*t[7])*s,(t[0]*t[4]-t[1]*t[3])*s])}equals(e,t=0){const s=this._m,i=e.m;return t===0?s[0]===i[0]&&s[1]===i[1]&&s[2]===i[2]&&s[3]===i[3]&&s[4]===i[4]&&s[5]===i[5]&&s[6]===i[6]&&s[7]===i[7]&&s[8]===i[8]:Math.abs(s[0]-i[0])<t&&Math.abs(s[1]-i[1])<t&&Math.abs(s[2]-i[2])<t&&Math.abs(s[3]-i[3])<t&&Math.abs(s[4]-i[4])<t&&Math.abs(s[5]-i[5])<t&&Math.abs(s[6]-i[6])<t&&Math.abs(s[7]-i[7])<t&&Math.abs(s[8]-i[8])<t}getClassName(){return"FlowGraphMatrix3D"}toString(){return`FlowGraphMatrix3D(${this._m.join(", ")})`}}var as;(function(n){n.Any="any",n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Integer="FlowGraphInteger",n.Vector2="Vector2",n.Vector3="Vector3",n.Vector4="Vector4",n.Quaternion="Quaternion",n.Matrix="Matrix",n.Matrix2D="Matrix2D",n.Matrix3D="Matrix3D",n.Color3="Color3",n.Color4="Color4"})(as||(as={}));class ${constructor(e,t,s=-1){this.typeName=e,this.defaultValue=t,this.animationType=s}serialize(e){e.typeName=this.typeName,e.defaultValue=this.defaultValue}}const Xe=new $("any",void 0),vs=new $("string",""),St=new $("number",0,0),Ps=new $("boolean",!1),Ct=new $("Vector2",je.Zero(),5),It=new $("Vector3",y.Zero(),1),Bs=new $("Vector4",Tt.Zero()),Rt=new $("Matrix",b.Identity(),3),Ns=new $("Matrix2D",new _e),Fs=new $("Matrix3D",new fe),bt=new $("Color3",z.Black(),4),wt=new $("Color4",new fs(0,0,0,0),7),$e=new $("Quaternion",G.Identity(),2);$e.typeTransformer=n=>{if(n.getClassName){if(n.getClassName()==="Vector4")return G.FromArray(n.asArray());if(n.getClassName()==="Vector3")return G.FromEulerVector(n);if(n.getClassName()==="Matrix")return G.FromRotationMatrix(n)}return n};const Os=new $("FlowGraphInteger",new re(0),0);function Ur(n){const e=n;switch(typeof n){case"string":return vs;case"number":return St;case"boolean":return Ps;case"object":if(e.getClassName)switch(e.getClassName()){case"Vector2":return Ct;case"Vector3":return It;case"Vector4":return Bs;case"Matrix":return Rt;case"Color3":return bt;case"Color4":return wt;case"Quaternion":return $e;case"FlowGraphInteger":return Os;case"Matrix2D":return Ns;case"Matrix3D":return Fs}return Xe;default:return Xe}}function Ls(n){switch(n){case"string":return vs;case"number":return St;case"boolean":return Ps;case"Vector2":return Ct;case"Vector3":return It;case"Vector4":return Bs;case"Matrix":return Rt;case"Color3":return bt;case"Color4":return wt;case"Quaternion":return $e;case"FlowGraphInteger":return Os;case"Matrix2D":return Ns;case"Matrix3D":return Fs;default:return Xe}}function Vr(n){switch(n){case"number":return 0;case"Vector2":return 5;case"Vector3":return 1;case"Matrix":return 3;case"Color3":return 4;case"Color4":return 7;case"Quaternion":return 2;default:return 0}}function Hr(n){switch(n){case 0:return St;case 5:return Ct;case 1:return It;case 3:return Rt;case 4:return bt;case 7:return wt;case 2:return $e;default:return Xe}}function kn(n){return n==="Mesh"||n==="AbstractMesh"||n==="GroundMesh"||n==="InstanceMesh"||n==="LinesMesh"||n==="GoldbergMesh"||n==="GreasedLineMesh"||n==="TrailMesh"}function ks(n){return n==="Vector2"||n==="Vector3"||n==="Vector4"||n==="Quaternion"||n==="Color3"||n==="Color4"}function Gn(n){return n==="Matrix"||n==="Matrix2D"||n==="Matrix3D"}function Un(n){return n==="AnimationGroup"}function Vn(n,e,t=!1){if(n==="Vector2")return je.FromArray(e);if(n==="Vector3")return t&&(e[2]*=-1),y.FromArray(e);if(n==="Vector4")return Tt.FromArray(e);if(n==="Quaternion")return t&&(e[2]*=-1,e[3]*=-1),G.FromArray(e);if(n==="Color3")return new z(e[0],e[1],e[2]);if(n==="Color4")return new fs(e[0],e[1],e[2],e[3]);throw new Error(`Unknown vector class name ${n}`)}function Mt(n,e,t){const s=e?.getClassName?.()??"";if(ks(s)||Gn(s))t[n]={value:e.asArray(),className:s};else if(s==="FlowGraphInteger")t[n]={value:e.value,className:s};else if(s&&(e.id||e.name))t[n]={id:e.id,name:e.name,className:s};else if(typeof e!="object")t[n]=e;else throw new Error(`Could not serialize value ${e}`)}function Ue(n,e,t,s){const i=e[n];let r;const a=i?.type??i?.className;if(kn(a)){let o=s.meshes.filter(u=>i.id?u.id===i.id:u.name===i.name);o.length===0&&(o=s.transformNodes.filter(u=>i.id?u.id===i.id:u.name===i.name)),r=i.uniqueId?o.find(u=>u.uniqueId===i.uniqueId):o[0]}else if(ks(a))r=Vn(a,i.value);else if(Un(a)){const o=s.animationGroups.filter(u=>u.name===i.name);r=o.length===1?o[0]:o.find(u=>u.uniqueId===i.uniqueId)}else a==="Matrix"?r=b.FromArray(i.value):a==="Matrix2D"?r=new _e(i.value):a==="Matrix3D"?r=new fe(i.value):a==="FlowGraphInteger"?r=re.FromValue(i.value):a==="number"||a==="string"||a==="boolean"?r=i.value[0]:i&&i.value!==void 0?r=i.value:Array.isArray(i)?r=i.reduce((o,u)=>(u.eventData&&(o[u.id]={type:Ls(u.type)},typeof u.value<"u"&&(o[u.id].value=Ue("value",u,t,s))),o),{}):r=i;return r}function Hn(n){return n==="FlowGraphJsonPointerParserBlock"}var os;(function(n){n.Animation="Animation",n.AnimationGroup="AnimationGroup",n.Mesh="Mesh",n.Material="Material",n.Camera="Camera",n.Light="Light"})(os||(os={}));function Qn(n,e,t,s){switch(e){case"Animation":return s?n.animations.find(i=>i.uniqueId===t)??null:n.animations[t]??null;case"AnimationGroup":return s?n.animationGroups.find(i=>i.uniqueId===t)??null:n.animationGroups[t]??null;case"Mesh":return s?n.meshes.find(i=>i.uniqueId===t)??null:n.meshes[t]??null;case"Material":return s?n.materials.find(i=>i.uniqueId===t)??null:n.materials[t]??null;case"Camera":return s?n.cameras.find(i=>i.uniqueId===t)??null:n.cameras[t]??null;case"Light":return s?n.lights.find(i=>i.uniqueId===t)??null:n.lights[t]??null;default:return null}}var us;(function(n){n.ExecuteBlock="ExecuteBlock",n.ExecuteEvent="ExecuteEvent",n.TriggerConnection="TriggerConnection",n.ContextVariableSet="ContextVariableSet",n.GlobalVariableSet="GlobalVariableSet",n.GlobalVariableDelete="GlobalVariableDelete",n.GlobalVariableGet="GlobalVariableGet",n.AddConnection="AddConnection",n.GetConnectionValue="GetConnectionValue",n.SetConnectionValue="SetConnectionValue",n.ActivateSignal="ActivateSignal",n.ContextVariableGet="ContextVariableGet"})(us||(us={}));class zn{constructor(){this.logToConsole=!1,this.log=[]}addLogItem(e){if(e.time||(e.time=Date.now()),this.log.push(e),this.logToConsole){const t=e.payload?.value;typeof t=="object"&&t.getClassName?N.Log(`[FGLog] ${e.className}:${e.uniqueId.split("-")[0]} ${e.action} - ${JSON.stringify(t.getClassName())}: ${t.toString()}`):N.Log(`[FGLog] ${e.className}:${e.uniqueId.split("-")[0]} ${e.action} - ${JSON.stringify(e.payload)}`)}}getItemsOfType(e){return this.log.filter(t=>t.action===e)}}class Gs{get enableLogging(){return this._enableLogging}set enableLogging(e){this._enableLogging!==e&&(this._enableLogging=e,this._enableLogging?(this.logger=new zn,this.logger.logToConsole=!0):this.logger=null)}constructor(e){this.uniqueId=gt(),this._userVariables={},this._executionVariables={},this._globalContextVariables={},this._connectionValues={},this._pendingBlocks=[],this._executionId=0,this.onNodeExecutedObservable=new U,this.treatDataAsRightHanded=!1,this._enableLogging=!1,this._configuration=e,this.assetsContext=e.assetsContext??e.scene}hasVariable(e){return e in this._userVariables}setVariable(e,t){this._userVariables[e]=t,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableSet",payload:{name:e,value:t}})}getAsset(e,t){return Qn(this.assetsContext,e,t)}getVariable(e){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableGet",payload:{name:e,value:this._userVariables[e]}}),this._userVariables[e]}get userVariables(){return this._userVariables}getScene(){return this._configuration.scene}_getUniqueIdPrefixedName(e,t){return`${e.uniqueId}_${t}`}_getGlobalContextVariable(e,t){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableGet",payload:{name:e,defaultValue:t,possibleValue:this._globalContextVariables[e]}}),this._hasGlobalContextVariable(e)?this._globalContextVariables[e]:t}_setGlobalContextVariable(e,t){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableSet",payload:{name:e,value:t}}),this._globalContextVariables[e]=t}_deleteGlobalContextVariable(e){this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableDelete",payload:{name:e}}),delete this._globalContextVariables[e]}_hasGlobalContextVariable(e){return e in this._globalContextVariables}_setExecutionVariable(e,t,s){this._executionVariables[this._getUniqueIdPrefixedName(e,t)]=s}_getExecutionVariable(e,t,s){return this._hasExecutionVariable(e,t)?this._executionVariables[this._getUniqueIdPrefixedName(e,t)]:s}_deleteExecutionVariable(e,t){delete this._executionVariables[this._getUniqueIdPrefixedName(e,t)]}_hasExecutionVariable(e,t){return this._getUniqueIdPrefixedName(e,t)in this._executionVariables}_hasConnectionValue(e){return e.uniqueId in this._connectionValues}_setConnectionValue(e,t){this._connectionValues[e.uniqueId]=t,this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"SetConnectionValue",payload:{connectionPointId:e.uniqueId,value:t}})}_setConnectionValueByKey(e,t){this._connectionValues[e]=t}_getConnectionValue(e){return this.logger?.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GetConnectionValue",payload:{connectionPointId:e.uniqueId,value:this._connectionValues[e.uniqueId]}}),this._connectionValues[e.uniqueId]}get configuration(){return this._configuration}get hasPendingBlocks(){return this._pendingBlocks.length>0}_addPendingBlock(e){this._pendingBlocks.includes(e)||(this._pendingBlocks.push(e),this._pendingBlocks.sort((t,s)=>t.priority-s.priority))}_removePendingBlock(e){const t=this._pendingBlocks.indexOf(e);t!==-1&&this._pendingBlocks.splice(t,1)}_clearPendingBlocks(){for(const e of this._pendingBlocks)e._cancelPendingTasks(this);this._pendingBlocks.length=0}_notifyExecuteNode(e){this.onNodeExecutedObservable.notifyObservers(e),this.logger?.addLogItem({time:Date.now(),className:e.getClassName(),uniqueId:e.uniqueId,action:"ExecuteBlock"})}_notifyOnTick(e){this._setGlobalContextVariable("timeSinceStart",e.timeSinceStart),this._setGlobalContextVariable("deltaTime",e.deltaTime);for(const t of this._pendingBlocks)t._executeOnTick?.(this)}_increaseExecutionId(){this._executionId++}get executionId(){return this._executionId}serialize(e={},t=Mt){e.uniqueId=this.uniqueId,e._userVariables={};for(const s in this._userVariables)t(s,this._userVariables[s],e._userVariables);e._connectionValues={};for(const s in this._connectionValues)t(s,this._connectionValues[s],e._connectionValues);this.assetsContext!==this.getScene()&&(e._assetsContext={meshes:this.assetsContext.meshes.map(s=>s.id),materials:this.assetsContext.materials.map(s=>s.id),textures:this.assetsContext.textures.map(s=>s.name),animations:this.assetsContext.animations.map(s=>s.name),lights:this.assetsContext.lights.map(s=>s.id),cameras:this.assetsContext.cameras.map(s=>s.id),sounds:this.assetsContext.sounds?.map(s=>s.name),skeletons:this.assetsContext.skeletons.map(s=>s.id),particleSystems:this.assetsContext.particleSystems.map(s=>s.name),geometries:this.assetsContext.geometries.map(s=>s.id),multiMaterials:this.assetsContext.multiMaterials.map(s=>s.id),transformNodes:this.assetsContext.transformNodes.map(s=>s.id)})}getClassName(){return"FlowGraphContext"}}h([m()],Gs.prototype,"uniqueId",void 0);var ls;(function(n){n[n.Input=0]="Input",n[n.Output=1]="Output"})(ls||(ls={}));class Us{constructor(e,t,s){this._ownerBlock=s,this._connectedPoint=[],this.uniqueId=gt(),this.connectedPointIds=[],this.name=e,this._connectionType=t}get connectionType(){return this._connectionType}_isSingularConnection(){return!0}isConnected(){return this._connectedPoint.length>0}connectTo(e){if(this._connectionType===e._connectionType)throw new Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||e._isSingularConnection()&&e._connectedPoint.length>0)throw new Error("Max number of connections for point reached");this._connectedPoint.push(e),e._connectedPoint.push(this)}disconnectFrom(e,t=!0){const s=this._connectedPoint.indexOf(e),i=e._connectedPoint.indexOf(this);s===-1||i===-1||(t&&this._connectedPoint.splice(s,1),e._connectedPoint.splice(i,1))}disconnectFromAll(){for(const e of this._connectedPoint)this.disconnectFrom(e,!1);this._connectedPoint.length=0}dispose(){for(const e of this._connectedPoint)this.disconnectFrom(e)}serialize(e={}){e.uniqueId=this.uniqueId,e.name=this.name,e._connectionType=this._connectionType,e.connectedPointIds=[],e.className=this.getClassName();for(const t of this._connectedPoint)e.connectedPointIds.push(t.uniqueId)}getClassName(){return"FGConnection"}deserialize(e){this.uniqueId=e.uniqueId,this.name=e.name,this._connectionType=e._connectionType,this.connectedPointIds=e.connectedPointIds}}class _t extends Us{constructor(e,t,s,i,r=i.defaultValue,a=!1){super(e,t,s),this.richType=i,this._defaultValue=r,this._optional=a,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new U}get optional(){return this._optional}get isDisabled(){return this._isDisabled}set isDisabled(e){this._isDisabled!==e&&(this._isDisabled=e,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){return this.connectionType===0}setValue(e,t){t._getConnectionValue(this)!==e&&(t._setConnectionValue(this,e),this.onValueChangedObservable.notifyObservers(e))}resetToDefaultValue(e){e._setConnectionValue(this,this._defaultValue)}connectTo(e){this._isDisabled||super.connectTo(e)}_getValueOrDefault(e){const t=e._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(t):t}getValue(e){if(this.connectionType===1){e._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(e);const s=this._getValueOrDefault(e);return this._lastValue=s,this.richType.typeTransformer?this.richType.typeTransformer(s):s}const t=this.isConnected()?this._connectedPoint[0].getValue(e):this._getValueOrDefault(e);return this._lastValue=t,this.richType.typeTransformer?this.richType.typeTransformer(t):t}_getLastValue(){return this._lastValue}getClassName(){return"FlowGraphDataConnection"}serialize(e={}){super.serialize(e),e.richType={},this.richType.serialize(e.richType),e.optional=this._optional,Mt("defaultValue",this._defaultValue,e)}}Ee("FlowGraphDataConnection",_t);class Wn{constructor(e){this.config=e,this.uniqueId=gt(),this.name=this.config?.name??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(e){}registerDataInput(e,t,s){const i=new _t(e,0,this,t,s);return this.dataInputs.push(i),i}registerDataOutput(e,t,s){const i=new _t(e,1,this,t,s);return this.dataOutputs.push(i),i}getDataInput(e){return this.dataInputs.find(t=>t.name===e)}getDataOutput(e){return this.dataOutputs.find(t=>t.name===e)}serialize(e={},t=Mt){if(e.uniqueId=this.uniqueId,e.config={},this.config){const s=this.config,i=Object.keys(s);for(const r of i)t(r,s[r],e.config)}e.dataInputs=[],e.dataOutputs=[],e.className=this.getClassName();for(const s of this.dataInputs){const i={};s.serialize(i),e.dataInputs.push(i)}for(const s of this.dataOutputs){const i={};s.serialize(i),e.dataOutputs.push(i)}}deserialize(e){}_log(e,t,s){e.logger?.addLogItem({action:t,payload:s,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){return"FlowGraphBlock"}}class ft extends Us{constructor(){super(...arguments),this.priority=0}_isSingularConnection(){return!1}connectTo(e){super.connectTo(e),this._connectedPoint.sort((t,s)=>s.priority-t.priority)}_activateSignal(e){if(e.logger?.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),this.connectionType===0)e._notifyExecuteNode(this._ownerBlock),this._ownerBlock._execute(e,this),e._increaseExecutionId();else for(const t of this._connectedPoint)t._activateSignal(e)}}Ee("FlowGraphSignalConnection",ft);class et extends Wn{constructor(e){super(e),this.priority=0,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(e){const t=new ft(e,0,this);return this.signalInputs.push(t),t}_registerSignalOutput(e){const t=new ft(e,1,this);return this.signalOutputs.push(t),t}_unregisterSignalInput(e){const t=this.signalInputs.findIndex(s=>s.name===e);t!==-1&&(this.signalInputs[t].dispose(),this.signalInputs.splice(t,1))}_unregisterSignalOutput(e){const t=this.signalOutputs.findIndex(s=>s.name===e);t!==-1&&(this.signalOutputs[t].dispose(),this.signalOutputs.splice(t,1))}_reportError(e,t){this.error.payload=typeof t=="string"?new Error(t):t,this.error._activateSignal(e)}getSignalInput(e){return this.signalInputs.find(t=>t.name===e)}getSignalOutput(e){return this.signalOutputs.find(t=>t.name===e)}serialize(e={}){super.serialize(e),e.signalInputs=[],e.signalOutputs=[];for(const t of this.signalInputs){const s={};t.serialize(s),e.signalInputs.push(s)}for(const t of this.signalOutputs){const s={};t.serialize(s),e.signalOutputs.push(s)}}deserialize(e){for(let t=0;t<e.signalInputs.length;t++){const s=this.getSignalInput(e.signalInputs[t].name);if(s)s.deserialize(e.signalInputs[t]);else throw new Error("Could not find signal input with name "+e.signalInputs[t].name+" in block "+e.className)}for(let t=0;t<e.signalOutputs.length;t++){const s=this.getSignalOutput(e.signalOutputs[t].name);if(s)s.deserialize(e.signalOutputs[t]);else throw new Error("Could not find signal output with name "+e.signalOutputs[t].name+" in block "+e.className)}}getClassName(){return"FlowGraphExecutionBlock"}}class Yn{constructor(e){this.onEventTriggeredObservable=new U,this.sceneReadyTriggered=!1,this._pointerUnderMeshState={},this._startingTime=0,this._scene=e,this._initialize()}_initialize(){this._sceneReadyObserver=this._scene.onReadyObservable.add(()=>{this.sceneReadyTriggered||(this.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}),this.sceneReadyTriggered=!0)}),this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{this.onEventTriggeredObservable.notifyObservers({type:"SceneDispose"})}),this._sceneOnBeforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{const e=this._scene.getEngine().getDeltaTime()/1e3;this.onEventTriggeredObservable.notifyObservers({type:"SceneBeforeRender",payload:{timeSinceStart:this._startingTime,deltaTime:e}}),this._startingTime+=e}),this._meshPickedObserver=this._scene.onPointerObservable.add(e=>{this.onEventTriggeredObservable.notifyObservers({type:"MeshPick",payload:e})},Ut.POINTERPICK),this._meshUnderPointerObserver=this._scene.onMeshUnderPointerUpdatedObservable.add(e=>{const t=e.pointerId,s=e.mesh,i=this._pointerUnderMeshState[t];!i&&s?this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:t,mesh:s}}):i&&!s?this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:t,mesh:i}}):i&&s&&i!==s&&(this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:t,mesh:i,over:s}}),this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:t,mesh:s,out:i}})),this._pointerUnderMeshState[t]=s},Ut.POINTERMOVE)}dispose(){this._sceneDisposeObserver?.remove(),this._sceneReadyObserver?.remove(),this._sceneOnBeforeRenderObserver?.remove(),this._meshPickedObserver?.remove(),this._meshUnderPointerObserver?.remove(),this.onEventTriggeredObservable.clear()}}function Vs(n,e){return!!(n.parent&&(n.parent===e||Vs(n.parent,e)))}function Qr(n){if(n.getClassName)return n.getClassName()}function zr(n,e){return n===e&&(n==="Vector2"||n==="Vector3"||n==="Vector4"||n==="Quaternion")}function Wr(n,e){return n===e&&(n==="Matrix"||n==="Matrix2D"||n==="Matrix3D")}function Yr(n,e){return n==="FlowGraphInteger"&&e==="FlowGraphInteger"}function qr(n,e){const t=typeof n=="number"||typeof n?.value=="number";return t&&!e?!isNaN(qn(n)):t}function qn(n){return typeof n=="number"?n:n.value}var hs;(function(n){n[n.Stopped=0]="Stopped",n[n.Started=1]="Started"})(hs||(hs={}));class Xn{get state(){return this._state}set state(e){this._state=e,this.onStateChangedObservable.notifyObservers(e)}constructor(e){this.onStateChangedObservable=new U,this._eventBlocks={SceneReady:[],SceneDispose:[],SceneBeforeRender:[],MeshPick:[],PointerDown:[],PointerUp:[],PointerMove:[],PointerOver:[],PointerOut:[],SceneAfterRender:[],NoTrigger:[]},this._executionContexts=[],this._state=0,this._scene=e.scene,this._sceneEventCoordinator=new Yn(this._scene),this._coordinator=e.coordinator,this._eventObserver=this._sceneEventCoordinator.onEventTriggeredObservable.add(t=>{for(const s of this._executionContexts){const i=this._getContextualOrder(t.type,s);for(const r of i)if(!r._executeEvent(s,t.payload))break}switch(t.type){case"SceneReady":this._sceneEventCoordinator.sceneReadyTriggered=!0;break;case"SceneBeforeRender":for(const s of this._executionContexts)s._notifyOnTick(t.payload);break;case"SceneDispose":this.dispose();break}})}createContext(){const e=new Gs({scene:this._scene,coordinator:this._coordinator});return this._executionContexts.push(e),e}getContext(e){return this._executionContexts[e]}addEventBlock(e){if((e.type==="PointerOver"||e.type==="PointerOut")&&(this._scene.constantlyUpdateMeshUnderPointer=!0),e.type!=="NoTrigger"&&this._eventBlocks[e.type].push(e),this.state===1)for(const t of this._executionContexts)e._startPendingTasks(t);else this.onStateChangedObservable.addOnce(t=>{if(t===1)for(const s of this._executionContexts)e._startPendingTasks(s)})}start(){this.state!==1&&(this._executionContexts.length===0&&this.createContext(),this.onStateChangedObservable.add(e=>{e===1&&(this._startPendingEvents(),this._scene.isReady(!0)&&this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}))}),this.state=1)}_startPendingEvents(){for(const e of this._executionContexts)for(const t in this._eventBlocks){const s=this._getContextualOrder(t,e);for(const i of s)i._startPendingTasks(e)}}_getContextualOrder(e,t){const s=this._eventBlocks[e].sort((i,r)=>r.initPriority-i.initPriority);if(e==="MeshPick"){const i=[];for(const r of s){const a=r.asset.getValue(t);let o=0;for(;o<s.length;o++){const l=s[o].asset.getValue(t);if(a&&l&&Vs(a,l))break}i.splice(o,0,r)}return i}return s}dispose(){if(this.state!==0){this.state=0;for(const e of this._executionContexts)e._clearPendingBlocks();this._executionContexts.length=0;for(const e in this._eventBlocks)this._eventBlocks[e].length=0;this._eventObserver?.remove(),this._sceneEventCoordinator.dispose()}}visitAllBlocks(e){const t=[],s=new Set;for(const i in this._eventBlocks)for(const r of this._eventBlocks[i])t.push(r),s.add(r.uniqueId);for(;t.length>0;){const i=t.pop();e(i);for(const r of i.dataInputs)for(const a of r._connectedPoint)s.has(a._ownerBlock.uniqueId)||(t.push(a._ownerBlock),s.add(a._ownerBlock.uniqueId));if(i instanceof et)for(const r of i.signalOutputs)for(const a of r._connectedPoint)s.has(a._ownerBlock.uniqueId)||(t.push(a._ownerBlock),s.add(a._ownerBlock.uniqueId))}}serialize(e={},t){e.allBlocks=[],this.visitAllBlocks(s=>{const i={};s.serialize(i),e.allBlocks.push(i)}),e.executionContexts=[];for(const s of this._executionContexts){const i={};s.serialize(i,t),e.executionContexts.push(i)}}}class Kn extends et{constructor(e){super(e),this.out=this._registerSignalOutput("out")}}class jn extends Kn{constructor(e,t){if(super(e),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),t)for(const s of t)this._eventsSignalOutputs[s]=this._registerSignalOutput(s+"Event")}_executeOnTick(e){}_startPendingTasks(e){e._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(e),this._resetAfterCanceled(e)),this._preparePendingTasks(e),e._addPendingBlock(this),this.out._activateSignal(e),e._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(e){e._deleteExecutionVariable(this,"_initialized"),e._removePendingBlock(this)}}class Jn extends jn{constructor(){super(...arguments),this.initPriority=0,this.type="NoTrigger"}_execute(e){e._notifyExecuteNode(this),this.done._activateSignal(e)}}class le{constructor(e){this.config=e,this.dispatchEventsSynchronously=!0,this._flowGraphs=[],this._customEventsMap=new Map,this._eventExecutionCounter=new Map,this._executeOnNextFrame=[],this._eventUniqueId=0,this._disposeObserver=this.config.scene.onDisposeObservable.add(()=>{this.dispose()}),this._onBeforeRenderObserver=this.config.scene.onBeforeRenderObservable.add(()=>{this._eventExecutionCounter.clear();const s=this._executeOnNextFrame.slice(0);if(s.length)for(const i of s){this.notifyCustomEvent(i.id,i.data,!1);const r=this._executeOnNextFrame.findIndex(a=>a.uniqueId===i.uniqueId);r!==-1&&this._executeOnNextFrame.splice(r,1)}});let t=le.SceneCoordinators.get(this.config.scene);t||(t=[],le.SceneCoordinators.set(this.config.scene,t)),t.push(this)}createGraph(){const e=new Xn({scene:this.config.scene,coordinator:this});return this._flowGraphs.push(e),e}removeGraph(e){const t=this._flowGraphs.indexOf(e);t!==-1&&(e.dispose(),this._flowGraphs.splice(t,1))}start(){for(const e of this._flowGraphs)e.start()}dispose(){for(const s of this._flowGraphs)s.dispose();this._flowGraphs.length=0,this._disposeObserver?.remove(),this._onBeforeRenderObserver?.remove();const e=le.SceneCoordinators.get(this.config.scene)??[],t=e.indexOf(this);t!==-1&&e.splice(t,1)}serialize(e,t){e._flowGraphs=[];for(const s of this._flowGraphs){const i={};s.serialize(i,t),e._flowGraphs.push(i)}e.dispatchEventsSynchronously=this.dispatchEventsSynchronously}get flowGraphs(){return this._flowGraphs}getCustomEventObservable(e){let t=this._customEventsMap.get(e);return t||(t=new U,this._customEventsMap.set(e,t)),t}notifyCustomEvent(e,t,s=!this.dispatchEventsSynchronously){if(s){this._executeOnNextFrame.push({id:e,data:t,uniqueId:this._eventUniqueId++});return}if(this._eventExecutionCounter.has(e)){const r=this._eventExecutionCounter.get(e);if(this._eventExecutionCounter.set(e,r+1),r>=le.MaxEventTypeExecutionPerFrame){r===le.MaxEventTypeExecutionPerFrame&&N.Warn(`FlowGraphCoordinator: Too many executions of event "${e}".`);return}}else this._eventExecutionCounter.set(e,1);const i=this._customEventsMap.get(e);i&&i.notifyObservers(t)}}le.MaxEventsPerType=30;le.MaxEventTypeExecutionPerFrame=30;le.SceneCoordinators=new Map;const pt={};function Xr(n,e,t){pt[`${n}/${e}`]=t}function Hs(n){switch(n){case"FlowGraphPlayAnimationBlock":return async()=>(await d(async()=>{const{FlowGraphPlayAnimationBlock:e}=await import("./flowGraphPlayAnimationBlock-CmNlz0tC.js");return{FlowGraphPlayAnimationBlock:e}},__vite__mapDeps([3,4,5,6,7]),import.meta.url)).FlowGraphPlayAnimationBlock;case"FlowGraphStopAnimationBlock":return async()=>(await d(async()=>{const{FlowGraphStopAnimationBlock:e}=await import("./flowGraphStopAnimationBlock-NXtDyWkx.js");return{FlowGraphStopAnimationBlock:e}},__vite__mapDeps([8,4,6,7]),import.meta.url)).FlowGraphStopAnimationBlock;case"FlowGraphPauseAnimationBlock":return async()=>(await d(async()=>{const{FlowGraphPauseAnimationBlock:e}=await import("./flowGraphPauseAnimationBlock-Cj1qZ8KL.js");return{FlowGraphPauseAnimationBlock:e}},__vite__mapDeps([9,4,6,7]),import.meta.url)).FlowGraphPauseAnimationBlock;case"FlowGraphInterpolationBlock":return async()=>(await d(async()=>{const{FlowGraphInterpolationBlock:e}=await import("./flowGraphInterpolationBlock-C1KggJs6.js");return{FlowGraphInterpolationBlock:e}},__vite__mapDeps([10,6,4,7]),import.meta.url)).FlowGraphInterpolationBlock;case"FlowGraphSceneReadyEventBlock":return async()=>(await d(async()=>{const{FlowGraphSceneReadyEventBlock:e}=await import("./flowGraphSceneReadyEventBlock-CdZZEJxf.js");return{FlowGraphSceneReadyEventBlock:e}},__vite__mapDeps([11,4,6,7]),import.meta.url)).FlowGraphSceneReadyEventBlock;case"FlowGraphSceneTickEventBlock":return async()=>(await d(async()=>{const{FlowGraphSceneTickEventBlock:e}=await import("./flowGraphSceneTickEventBlock-BO5xEA0D.js");return{FlowGraphSceneTickEventBlock:e}},__vite__mapDeps([12,4,6,7]),import.meta.url)).FlowGraphSceneTickEventBlock;case"FlowGraphSendCustomEventBlock":return async()=>(await d(async()=>{const{FlowGraphSendCustomEventBlock:e}=await import("./flowGraphSendCustomEventBlock-BSbW6X-n.js");return{FlowGraphSendCustomEventBlock:e}},__vite__mapDeps([13,4,6,7]),import.meta.url)).FlowGraphSendCustomEventBlock;case"FlowGraphReceiveCustomEventBlock":return async()=>(await d(async()=>{const{FlowGraphReceiveCustomEventBlock:e}=await import("./flowGraphReceiveCustomEventBlock-DodatkWu.js");return{FlowGraphReceiveCustomEventBlock:e}},__vite__mapDeps([14,4,6,7]),import.meta.url)).FlowGraphReceiveCustomEventBlock;case"FlowGraphMeshPickEventBlock":return async()=>(await d(async()=>{const{FlowGraphMeshPickEventBlock:e}=await import("./flowGraphMeshPickEventBlock-DBaLM4_x.js");return{FlowGraphMeshPickEventBlock:e}},__vite__mapDeps([15,4,6,7]),import.meta.url)).FlowGraphMeshPickEventBlock;case"FlowGraphEBlock":return async()=>(await d(async()=>{const{FlowGraphEBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphEBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphEBlock;case"FlowGraphPIBlock":return async()=>(await d(async()=>{const{FlowGraphPiBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphPiBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphPiBlock;case"FlowGraphInfBlock":return async()=>(await d(async()=>{const{FlowGraphInfBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphInfBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphInfBlock;case"FlowGraphNaNBlock":return async()=>(await d(async()=>{const{FlowGraphNaNBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphNaNBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphNaNBlock;case"FlowGraphRandomBlock":return async()=>(await d(async()=>{const{FlowGraphRandomBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphRandomBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphRandomBlock;case"FlowGraphAddBlock":return async()=>(await d(async()=>{const{FlowGraphAddBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAddBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAddBlock;case"FlowGraphSubtractBlock":return async()=>(await d(async()=>{const{FlowGraphSubtractBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSubtractBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSubtractBlock;case"FlowGraphMultiplyBlock":return async()=>(await d(async()=>{const{FlowGraphMultiplyBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphMultiplyBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphMultiplyBlock;case"FlowGraphDivideBlock":return async()=>(await d(async()=>{const{FlowGraphDivideBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphDivideBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphDivideBlock;case"FlowGraphAbsBlock":return async()=>(await d(async()=>{const{FlowGraphAbsBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAbsBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAbsBlock;case"FlowGraphSignBlock":return async()=>(await d(async()=>{const{FlowGraphSignBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSignBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSignBlock;case"FlowGraphTruncBlock":return async()=>(await d(async()=>{const{FlowGraphTruncBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphTruncBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphTruncBlock;case"FlowGraphFloorBlock":return async()=>(await d(async()=>{const{FlowGraphFloorBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphFloorBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphFloorBlock;case"FlowGraphCeilBlock":return async()=>(await d(async()=>{const{FlowGraphCeilBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphCeilBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphCeilBlock;case"FlowGraphRoundBlock":return async()=>(await d(async()=>{const{FlowGraphRoundBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphRoundBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphRoundBlock;case"FlowGraphFractBlock":return async()=>(await d(async()=>{const{FlowGraphFractionBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphFractionBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphFractionBlock;case"FlowGraphNegationBlock":return async()=>(await d(async()=>{const{FlowGraphNegationBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphNegationBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphNegationBlock;case"FlowGraphModuloBlock":return async()=>(await d(async()=>{const{FlowGraphModuloBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphModuloBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphModuloBlock;case"FlowGraphMinBlock":return async()=>(await d(async()=>{const{FlowGraphMinBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphMinBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphMinBlock;case"FlowGraphMaxBlock":return async()=>(await d(async()=>{const{FlowGraphMaxBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphMaxBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphMaxBlock;case"FlowGraphClampBlock":return async()=>(await d(async()=>{const{FlowGraphClampBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphClampBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphClampBlock;case"FlowGraphSaturateBlock":return async()=>(await d(async()=>{const{FlowGraphSaturateBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSaturateBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSaturateBlock;case"FlowGraphMathInterpolationBlock":return async()=>(await d(async()=>{const{FlowGraphMathInterpolationBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphMathInterpolationBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphMathInterpolationBlock;case"FlowGraphEqualityBlock":return async()=>(await d(async()=>{const{FlowGraphEqualityBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphEqualityBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphEqualityBlock;case"FlowGraphLessThanBlock":return async()=>(await d(async()=>{const{FlowGraphLessThanBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLessThanBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLessThanBlock;case"FlowGraphLessThanOrEqualBlock":return async()=>(await d(async()=>{const{FlowGraphLessThanOrEqualBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLessThanOrEqualBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLessThanOrEqualBlock;case"FlowGraphGreaterThanBlock":return async()=>(await d(async()=>{const{FlowGraphGreaterThanBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphGreaterThanBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphGreaterThanBlock;case"FlowGraphGreaterThanOrEqualBlock":return async()=>(await d(async()=>{const{FlowGraphGreaterThanOrEqualBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphGreaterThanOrEqualBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphGreaterThanOrEqualBlock;case"FlowGraphIsNaNBlock":return async()=>(await d(async()=>{const{FlowGraphIsNanBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphIsNanBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphIsNanBlock;case"FlowGraphIsInfBlock":return async()=>(await d(async()=>{const{FlowGraphIsInfinityBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphIsInfinityBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphIsInfinityBlock;case"FlowGraphDegToRadBlock":return async()=>(await d(async()=>{const{FlowGraphDegToRadBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphDegToRadBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphDegToRadBlock;case"FlowGraphRadToDegBlock":return async()=>(await d(async()=>{const{FlowGraphRadToDegBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphRadToDegBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphRadToDegBlock;case"FlowGraphSinBlock":return async()=>(await d(async()=>{const{FlowGraphSinBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSinBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSinBlock;case"FlowGraphCosBlock":return async()=>(await d(async()=>{const{FlowGraphCosBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphCosBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphCosBlock;case"FlowGraphTanBlock":return async()=>(await d(async()=>{const{FlowGraphTanBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphTanBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphTanBlock;case"FlowGraphASinBlock":return async()=>(await d(async()=>{const{FlowGraphAsinBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAsinBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAsinBlock;case"FlowGraphACosBlock":return async()=>(await d(async()=>{const{FlowGraphAcosBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAcosBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAcosBlock;case"FlowGraphATanBlock":return async()=>(await d(async()=>{const{FlowGraphAtanBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAtanBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAtanBlock;case"FlowGraphATan2Block":return async()=>(await d(async()=>{const{FlowGraphAtan2Block:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAtan2Block:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAtan2Block;case"FlowGraphSinhBlock":return async()=>(await d(async()=>{const{FlowGraphSinhBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSinhBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSinhBlock;case"FlowGraphCoshBlock":return async()=>(await d(async()=>{const{FlowGraphCoshBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphCoshBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphCoshBlock;case"FlowGraphTanhBlock":return async()=>(await d(async()=>{const{FlowGraphTanhBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphTanhBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphTanhBlock;case"FlowGraphASinhBlock":return async()=>(await d(async()=>{const{FlowGraphAsinhBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAsinhBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAsinhBlock;case"FlowGraphACoshBlock":return async()=>(await d(async()=>{const{FlowGraphAcoshBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAcoshBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAcoshBlock;case"FlowGraphATanhBlock":return async()=>(await d(async()=>{const{FlowGraphAtanhBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphAtanhBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphAtanhBlock;case"FlowGraphExponentialBlock":return async()=>(await d(async()=>{const{FlowGraphExpBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphExpBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphExpBlock;case"FlowGraphLogBlock":return async()=>(await d(async()=>{const{FlowGraphLogBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLogBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLogBlock;case"FlowGraphLog2Block":return async()=>(await d(async()=>{const{FlowGraphLog2Block:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLog2Block:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLog2Block;case"FlowGraphLog10Block":return async()=>(await d(async()=>{const{FlowGraphLog10Block:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLog10Block:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLog10Block;case"FlowGraphSquareRootBlock":return async()=>(await d(async()=>{const{FlowGraphSquareRootBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphSquareRootBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphSquareRootBlock;case"FlowGraphPowerBlock":return async()=>(await d(async()=>{const{FlowGraphPowerBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphPowerBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphPowerBlock;case"FlowGraphCubeRootBlock":return async()=>(await d(async()=>{const{FlowGraphCubeRootBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphCubeRootBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphCubeRootBlock;case"FlowGraphBitwiseAndBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseAndBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseAndBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseAndBlock;case"FlowGraphBitwiseOrBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseOrBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseOrBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseOrBlock;case"FlowGraphBitwiseNotBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseNotBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseNotBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseNotBlock;case"FlowGraphBitwiseXorBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseXorBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseXorBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseXorBlock;case"FlowGraphBitwiseLeftShiftBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseLeftShiftBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseLeftShiftBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseLeftShiftBlock;case"FlowGraphBitwiseRightShiftBlock":return async()=>(await d(async()=>{const{FlowGraphBitwiseRightShiftBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphBitwiseRightShiftBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphBitwiseRightShiftBlock;case"FlowGraphLengthBlock":return async()=>(await d(async()=>{const{FlowGraphLengthBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphLengthBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphLengthBlock;case"FlowGraphNormalizeBlock":return async()=>(await d(async()=>{const{FlowGraphNormalizeBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphNormalizeBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphNormalizeBlock;case"FlowGraphDotBlock":return async()=>(await d(async()=>{const{FlowGraphDotBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphDotBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphDotBlock;case"FlowGraphCrossBlock":return async()=>(await d(async()=>{const{FlowGraphCrossBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphCrossBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphCrossBlock;case"FlowGraphRotate2DBlock":return async()=>(await d(async()=>{const{FlowGraphRotate2DBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphRotate2DBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphRotate2DBlock;case"FlowGraphRotate3DBlock":return async()=>(await d(async()=>{const{FlowGraphRotate3DBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphRotate3DBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphRotate3DBlock;case"FlowGraphTransposeBlock":return async()=>(await d(async()=>{const{FlowGraphTransposeBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphTransposeBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphTransposeBlock;case"FlowGraphDeterminantBlock":return async()=>(await d(async()=>{const{FlowGraphDeterminantBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphDeterminantBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphDeterminantBlock;case"FlowGraphInvertMatrixBlock":return async()=>(await d(async()=>{const{FlowGraphInvertMatrixBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphInvertMatrixBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphInvertMatrixBlock;case"FlowGraphMatrixMultiplicationBlock":return async()=>(await d(async()=>{const{FlowGraphMatrixMultiplicationBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphMatrixMultiplicationBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphMatrixMultiplicationBlock;case"FlowGraphBranchBlock":return async()=>(await d(async()=>{const{FlowGraphBranchBlock:e}=await import("./flowGraphBranchBlock-BMgiYImb.js");return{FlowGraphBranchBlock:e}},__vite__mapDeps([22,4,6,7]),import.meta.url)).FlowGraphBranchBlock;case"FlowGraphSetDelayBlock":return async()=>(await d(async()=>{const{FlowGraphSetDelayBlock:e}=await import("./flowGraphSetDelayBlock-Ckikj9nw.js").then(t=>t.f);return{FlowGraphSetDelayBlock:e}},__vite__mapDeps([23,4]),import.meta.url)).FlowGraphSetDelayBlock;case"FlowGraphCancelDelayBlock":return async()=>(await d(async()=>{const{FlowGraphCancelDelayBlock:e}=await import("./flowGraphCancelDelayBlock-BbyDVz48.js");return{FlowGraphCancelDelayBlock:e}},__vite__mapDeps([24,4,6,7]),import.meta.url)).FlowGraphCancelDelayBlock;case"FlowGraphCallCounterBlock":return async()=>(await d(async()=>{const{FlowGraphCallCounterBlock:e}=await import("./flowGraphCounterBlock-DTqShVsi.js");return{FlowGraphCallCounterBlock:e}},__vite__mapDeps([25,4,6,7]),import.meta.url)).FlowGraphCallCounterBlock;case"FlowGraphDebounceBlock":return async()=>(await d(async()=>{const{FlowGraphDebounceBlock:e}=await import("./flowGraphDebounceBlock-CNHFUJ8N.js");return{FlowGraphDebounceBlock:e}},__vite__mapDeps([26,4,6,7]),import.meta.url)).FlowGraphDebounceBlock;case"FlowGraphThrottleBlock":return async()=>(await d(async()=>{const{FlowGraphThrottleBlock:e}=await import("./flowGraphThrottleBlock-DouJgya1.js");return{FlowGraphThrottleBlock:e}},__vite__mapDeps([27,4,6,7]),import.meta.url)).FlowGraphThrottleBlock;case"FlowGraphDoNBlock":return async()=>(await d(async()=>{const{FlowGraphDoNBlock:e}=await import("./flowGraphDoNBlock-DfiUsh6W.js");return{FlowGraphDoNBlock:e}},__vite__mapDeps([28,4,6,7]),import.meta.url)).FlowGraphDoNBlock;case"FlowGraphFlipFlopBlock":return async()=>(await d(async()=>{const{FlowGraphFlipFlopBlock:e}=await import("./flowGraphFlipFlopBlock-FFeDrjtF.js");return{FlowGraphFlipFlopBlock:e}},__vite__mapDeps([29,4,6,7]),import.meta.url)).FlowGraphFlipFlopBlock;case"FlowGraphForLoopBlock":return async()=>(await d(async()=>{const{FlowGraphForLoopBlock:e}=await import("./flowGraphForLoopBlock-CjPa-aIl.js");return{FlowGraphForLoopBlock:e}},__vite__mapDeps([30,4,6,7]),import.meta.url)).FlowGraphForLoopBlock;case"FlowGraphMultiGateBlock":return async()=>(await d(async()=>{const{FlowGraphMultiGateBlock:e}=await import("./flowGraphMultiGateBlock-0zKVRfwg.js");return{FlowGraphMultiGateBlock:e}},__vite__mapDeps([31,4,6,7]),import.meta.url)).FlowGraphMultiGateBlock;case"FlowGraphSequenceBlock":return async()=>(await d(async()=>{const{FlowGraphSequenceBlock:e}=await import("./flowGraphSequenceBlock-Ppc6pXve.js");return{FlowGraphSequenceBlock:e}},__vite__mapDeps([32,4,6,7]),import.meta.url)).FlowGraphSequenceBlock;case"FlowGraphSwitchBlock":return async()=>(await d(async()=>{const{FlowGraphSwitchBlock:e}=await import("./flowGraphSwitchBlock-BtAbN5pw.js");return{FlowGraphSwitchBlock:e}},__vite__mapDeps([33,4,6,7]),import.meta.url)).FlowGraphSwitchBlock;case"FlowGraphWaitAllBlock":return async()=>(await d(async()=>{const{FlowGraphWaitAllBlock:e}=await import("./flowGraphWaitAllBlock-ClqfM5vn.js");return{FlowGraphWaitAllBlock:e}},__vite__mapDeps([34,4,6,7]),import.meta.url)).FlowGraphWaitAllBlock;case"FlowGraphWhileLoopBlock":return async()=>(await d(async()=>{const{FlowGraphWhileLoopBlock:e}=await import("./flowGraphWhileLoopBlock-DkTf5x3Z.js");return{FlowGraphWhileLoopBlock:e}},__vite__mapDeps([35,4,6,7]),import.meta.url)).FlowGraphWhileLoopBlock;case"FlowGraphConsoleLogBlock":return async()=>(await d(async()=>{const{FlowGraphConsoleLogBlock:e}=await import("./flowGraphConsoleLogBlock-U9fcEDaX.js");return{FlowGraphConsoleLogBlock:e}},__vite__mapDeps([36,4,6,7]),import.meta.url)).FlowGraphConsoleLogBlock;case"FlowGraphConditionalBlock":return async()=>(await d(async()=>{const{FlowGraphConditionalDataBlock:e}=await import("./flowGraphConditionalDataBlock-Db9HPH7K.js");return{FlowGraphConditionalDataBlock:e}},__vite__mapDeps([37,4,6,7]),import.meta.url)).FlowGraphConditionalDataBlock;case"FlowGraphConstantBlock":return async()=>(await d(async()=>{const{FlowGraphConstantBlock:e}=await import("./flowGraphConstantBlock-CN1Myhpi.js");return{FlowGraphConstantBlock:e}},__vite__mapDeps([38,4,6,7]),import.meta.url)).FlowGraphConstantBlock;case"FlowGraphTransformCoordinatesSystemBlock":return async()=>(await d(async()=>{const{FlowGraphTransformCoordinatesSystemBlock:e}=await import("./flowGraphTransformCoordinatesSystemBlock-DnCim8eo.js");return{FlowGraphTransformCoordinatesSystemBlock:e}},__vite__mapDeps([39,4,6,7]),import.meta.url)).FlowGraphTransformCoordinatesSystemBlock;case"FlowGraphGetAssetBlock":return async()=>(await d(async()=>{const{FlowGraphGetAssetBlock:e}=await import("./flowGraphGetAssetBlock-CuKntTUp.js");return{FlowGraphGetAssetBlock:e}},__vite__mapDeps([40,4,6,7]),import.meta.url)).FlowGraphGetAssetBlock;case"FlowGraphGetPropertyBlock":return async()=>(await d(async()=>{const{FlowGraphGetPropertyBlock:e}=await import("./flowGraphGetPropertyBlock-r3I5d5Pw.js");return{FlowGraphGetPropertyBlock:e}},__vite__mapDeps([41,4,18,6,7]),import.meta.url)).FlowGraphGetPropertyBlock;case"FlowGraphSetPropertyBlock":return async()=>(await d(async()=>{const{FlowGraphSetPropertyBlock:e}=await import("./flowGraphSetPropertyBlock-BgUzizbV.js");return{FlowGraphSetPropertyBlock:e}},__vite__mapDeps([42,4,6,7]),import.meta.url)).FlowGraphSetPropertyBlock;case"FlowGraphGetVariableBlock":return async()=>(await d(async()=>{const{FlowGraphGetVariableBlock:e}=await import("./flowGraphGetVariableBlock-ByAhPias.js");return{FlowGraphGetVariableBlock:e}},__vite__mapDeps([43,4,6,7]),import.meta.url)).FlowGraphGetVariableBlock;case"FlowGraphSetVariableBlock":return async()=>(await d(async()=>{const{FlowGraphSetVariableBlock:e}=await import("./flowGraphSetVariableBlock-BdpCJTDy.js");return{FlowGraphSetVariableBlock:e}},__vite__mapDeps([44,4,6,7]),import.meta.url)).FlowGraphSetVariableBlock;case"FlowGraphJsonPointerParserBlock":return async()=>(await d(async()=>{const{FlowGraphJsonPointerParserBlock:e}=await import("./flowGraphJsonPointerParserBlock-Cq1Nm55u.js").then(t=>t.f);return{FlowGraphJsonPointerParserBlock:e}},__vite__mapDeps([45,4,18]),import.meta.url)).FlowGraphJsonPointerParserBlock;case"FlowGraphLeadingZerosBlock":return async()=>(await d(async()=>{const{FlowGraphLeadingZerosBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphLeadingZerosBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphLeadingZerosBlock;case"FlowGraphTrailingZerosBlock":return async()=>(await d(async()=>{const{FlowGraphTrailingZerosBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphTrailingZerosBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphTrailingZerosBlock;case"FlowGraphOneBitsCounterBlock":return async()=>(await d(async()=>{const{FlowGraphOneBitsCounterBlock:e}=await import("./flowGraphMathBlocks-DyKkUJIM.js");return{FlowGraphOneBitsCounterBlock:e}},__vite__mapDeps([16,4,17,18,19,6,7]),import.meta.url)).FlowGraphOneBitsCounterBlock;case"FlowGraphCombineVector2Block":return async()=>(await d(async()=>{const{FlowGraphCombineVector2Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphCombineVector2Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphCombineVector2Block;case"FlowGraphCombineVector3Block":return async()=>(await d(async()=>{const{FlowGraphCombineVector3Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphCombineVector3Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphCombineVector3Block;case"FlowGraphCombineVector4Block":return async()=>(await d(async()=>{const{FlowGraphCombineVector4Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphCombineVector4Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphCombineVector4Block;case"FlowGraphCombineMatrixBlock":return async()=>(await d(async()=>{const{FlowGraphCombineMatrixBlock:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphCombineMatrixBlock:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphCombineMatrixBlock;case"FlowGraphExtractVector2Block":return async()=>(await d(async()=>{const{FlowGraphExtractVector2Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphExtractVector2Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphExtractVector2Block;case"FlowGraphExtractVector3Block":return async()=>(await d(async()=>{const{FlowGraphExtractVector3Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphExtractVector3Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphExtractVector3Block;case"FlowGraphExtractVector4Block":return async()=>(await d(async()=>{const{FlowGraphExtractVector4Block:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphExtractVector4Block:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphExtractVector4Block;case"FlowGraphExtractMatrixBlock":return async()=>(await d(async()=>{const{FlowGraphExtractMatrixBlock:e}=await import("./flowGraphMathCombineExtractBlocks-DWLx9Jo-.js");return{FlowGraphExtractMatrixBlock:e}},__vite__mapDeps([46,18,4,6,7]),import.meta.url)).FlowGraphExtractMatrixBlock;case"FlowGraphTransformVectorBlock":return async()=>(await d(async()=>{const{FlowGraphTransformBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphTransformBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphTransformBlock;case"FlowGraphTransformCoordinatesBlock":return async()=>(await d(async()=>{const{FlowGraphTransformCoordinatesBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphTransformCoordinatesBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphTransformCoordinatesBlock;case"FlowGraphConjugateBlock":return async()=>(await d(async()=>{const{FlowGraphConjugateBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphConjugateBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphConjugateBlock;case"FlowGraphAngleBetweenBlock":return async()=>(await d(async()=>{const{FlowGraphAngleBetweenBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphAngleBetweenBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphAngleBetweenBlock;case"FlowGraphQuaternionFromAxisAngleBlock":return async()=>(await d(async()=>{const{FlowGraphQuaternionFromAxisAngleBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphQuaternionFromAxisAngleBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphQuaternionFromAxisAngleBlock;case"FlowGraphAxisAngleFromQuaternionBlock":return async()=>(await d(async()=>{const{FlowGraphAxisAngleFromQuaternionBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphAxisAngleFromQuaternionBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphAxisAngleFromQuaternionBlock;case"FlowGraphQuaternionFromDirectionsBlock":return async()=>(await d(async()=>{const{FlowGraphQuaternionFromDirectionsBlock:e}=await import("./flowGraphVectorMathBlocks-BQCEcK0m.js").then(t=>t.C);return{FlowGraphQuaternionFromDirectionsBlock:e}},__vite__mapDeps([20,4,17,18,19]),import.meta.url)).FlowGraphQuaternionFromDirectionsBlock;case"FlowGraphMatrixDecompose":return async()=>(await d(async()=>{const{FlowGraphMatrixDecomposeBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphMatrixDecomposeBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphMatrixDecomposeBlock;case"FlowGraphMatrixCompose":return async()=>(await d(async()=>{const{FlowGraphMatrixComposeBlock:e}=await import("./flowGraphMatrixMathBlocks-CEbyv5Ky.js");return{FlowGraphMatrixComposeBlock:e}},__vite__mapDeps([21,4,19,18,17,6,7]),import.meta.url)).FlowGraphMatrixComposeBlock;case"FlowGraphBooleanToFloat":return async()=>(await d(async()=>{const{FlowGraphBooleanToFloat:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphBooleanToFloat:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphBooleanToFloat;case"FlowGraphBooleanToInt":return async()=>(await d(async()=>{const{FlowGraphBooleanToInt:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphBooleanToInt:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphBooleanToInt;case"FlowGraphFloatToBoolean":return async()=>(await d(async()=>{const{FlowGraphFloatToBoolean:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphFloatToBoolean:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphFloatToBoolean;case"FlowGraphIntToBoolean":return async()=>(await d(async()=>{const{FlowGraphIntToBoolean:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphIntToBoolean:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphIntToBoolean;case"FlowGraphIntToFloat":return async()=>(await d(async()=>{const{FlowGraphIntToFloat:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphIntToFloat:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphIntToFloat;case"FlowGraphFloatToInt":return async()=>(await d(async()=>{const{FlowGraphFloatToInt:e}=await import("./flowGraphTypeToTypeBlocks-DvTPkHj8.js");return{FlowGraphFloatToInt:e}},__vite__mapDeps([47,19,18,4,6,7]),import.meta.url)).FlowGraphFloatToInt;case"FlowGraphEasingBlock":return async()=>(await d(async()=>{const{FlowGraphEasingBlock:e}=await import("./flowGraphEasingBlock-BQz5MDh1.js");return{FlowGraphEasingBlock:e}},__vite__mapDeps([48,49,4,6,7]),import.meta.url)).FlowGraphEasingBlock;case"FlowGraphBezierCurveEasing":return async()=>(await d(async()=>{const{FlowGraphBezierCurveEasingBlock:e}=await import("./flowGraphBezierCurveEasingBlock-_sVLfNt3.js");return{FlowGraphBezierCurveEasingBlock:e}},__vite__mapDeps([50,49,4,6,7]),import.meta.url)).FlowGraphBezierCurveEasingBlock;case"FlowGraphPointerOverEventBlock":return async()=>(await d(async()=>{const{FlowGraphPointerOverEventBlock:e}=await import("./flowGraphPointerOverEventBlock-BAzWo2rO.js");return{FlowGraphPointerOverEventBlock:e}},__vite__mapDeps([51,4,6,7]),import.meta.url)).FlowGraphPointerOverEventBlock;case"FlowGraphPointerOutEventBlock":return async()=>(await d(async()=>{const{FlowGraphPointerOutEventBlock:e}=await import("./flowGraphPointerOutEventBlock-CksX91Wf.js");return{FlowGraphPointerOutEventBlock:e}},__vite__mapDeps([52,4,6,7]),import.meta.url)).FlowGraphPointerOutEventBlock;case"FlowGraphContextBlock":return async()=>(await d(async()=>{const{FlowGraphContextBlock:e}=await import("./flowGraphContextBlock-BbRTNgI4.js");return{FlowGraphContextBlock:e}},__vite__mapDeps([53,4,6,7]),import.meta.url)).FlowGraphContextBlock;case"FlowGraphArrayIndexBlock":return async()=>(await d(async()=>{const{FlowGraphArrayIndexBlock:e}=await import("./flowGraphArrayIndexBlock-DAsvnV45.js");return{FlowGraphArrayIndexBlock:e}},__vite__mapDeps([54,4,6,7]),import.meta.url)).FlowGraphArrayIndexBlock;case"FlowGraphCodeExecutionBlock":return async()=>(await d(async()=>{const{FlowGraphCodeExecutionBlock:e}=await import("./flowGraphCodeExecutionBlock-fMRePVwn.js");return{FlowGraphCodeExecutionBlock:e}},__vite__mapDeps([55,4,6,7]),import.meta.url)).FlowGraphCodeExecutionBlock;case"FlowGraphIndexOfBlock":return async()=>(await d(async()=>{const{FlowGraphIndexOfBlock:e}=await import("./flowGraphIndexOfBlock-kKyrBvN9.js");return{FlowGraphIndexOfBlock:e}},__vite__mapDeps([56,4,6,7]),import.meta.url)).FlowGraphIndexOfBlock;case"FlowGraphFunctionReference":return async()=>(await d(async()=>{const{FlowGraphFunctionReferenceBlock:e}=await import("./flowGraphFunctionReferenceBlock-CUUBvJaO.js");return{FlowGraphFunctionReferenceBlock:e}},__vite__mapDeps([57,4,6,7]),import.meta.url)).FlowGraphFunctionReferenceBlock;case"FlowGraphDataSwitchBlock":return async()=>(await d(async()=>{const{FlowGraphDataSwitchBlock:e}=await import("./flowGraphDataSwitchBlock-BtEqygYT.js");return{FlowGraphDataSwitchBlock:e}},__vite__mapDeps([58,4,6,7]),import.meta.url)).FlowGraphDataSwitchBlock;default:if(pt[n])return pt[n];throw new Error(`Unknown block name ${n}`)}}function Zn(n,e){for(const t of n)for(const s of t.dataOutputs)if(s.uniqueId===e)return s;throw new Error("Could not find data out connection with unique id "+e)}function $n(n,e){for(const t of n)if(t instanceof et){for(const s of t.signalInputs)if(s.uniqueId===e)return s}throw new Error("Could not find signal in connection with unique id "+e)}async function Kr(n,e){const t=e.valueParseFunction??Ue,s=new le({scene:e.scene});if(n.dispatchEventsSynchronously&&(s.dispatchEventsSynchronously=n.dispatchEventsSynchronously),await e.scene.whenReadyAsync(),n._defaultValues)for(const i in n._defaultValues){const r=n._defaultValues[i];Ls(i).defaultValue=r}return await Promise.all(n._flowGraphs?.map(async i=>await er(i,{coordinator:s,valueParseFunction:t,pathConverter:e.pathConverter}))),s}async function er(n,e){const t=await Promise.all(n.allBlocks.map(async s=>await Hs(s.className)()));return tr(n,e,t)}function tr(n,e,t){const s=e.coordinator.createGraph(),i=[],r=e.valueParseFunction??Ue;for(let a=0;a<n.allBlocks.length;a++){const o=n.allBlocks[a],u=Qs(o,{scene:e.coordinator.config.scene,pathConverter:e.pathConverter,assetsContainer:e.coordinator.config.scene,valueParseFunction:r},t[a]);i.push(u),u instanceof Jn&&s.addEventBlock(u)}for(const a of i){for(const o of a.dataInputs)for(const u of o.connectedPointIds){const l=Zn(i,u);o.connectTo(l)}if(a instanceof et)for(const o of a.signalOutputs)for(const u of o.connectedPointIds){const l=$n(i,u);o.connectTo(l)}}for(const a of n.executionContexts)sr(a,{graph:s,valueParseFunction:r},n.rightHanded);return s}function sr(n,e,t){const s=e.graph.createContext();n.enableLogging&&(s.enableLogging=!0),s.treatDataAsRightHanded=t||!1;const i=e.valueParseFunction??Ue;s.uniqueId=n.uniqueId;const r=s.getScene();if(n._assetsContext){const a=n._assetsContext,o={meshes:a.meshes?.map(u=>r.getMeshById(u)),lights:a.lights?.map(u=>r.getLightByName(u)),cameras:a.cameras?.map(u=>r.getCameraByName(u)),materials:a.materials?.map(u=>r.getMaterialById(u)),textures:a.textures?.map(u=>r.getTextureByName(u)),animations:a.animations?.map(u=>r.animations.find(l=>l.name===u)),skeletons:a.skeletons?.map(u=>r.getSkeletonByName(u)),particleSystems:a.particleSystems?.map(u=>r.getParticleSystemById(u)),animationGroups:a.animationGroups?.map(u=>r.getAnimationGroupByName(u)),transformNodes:a.transformNodes?.map(u=>r.getTransformNodeById(u)),rootNodes:[],multiMaterials:[],morphTargetManagers:[],geometries:[],actionManagers:[],environmentTexture:null,postProcesses:[],sounds:null,effectLayers:[],layers:[],reflectionProbes:[],lensFlareSystems:[],proceduralTextures:[],getNodes:function(){throw new Error("Function not implemented.")}};s.assetsContext=o}for(const a in n._userVariables){const o=i(a,n._userVariables,s.assetsContext,r);s.userVariables[a]=o}for(const a in n._connectionValues){const o=i(a,n._connectionValues,s.assetsContext,r);s._setConnectionValueByKey(a,o)}return s}async function jr(n,e){const s=await Hs(n.className)();return Qs(n,e,s)}function Qs(n,e,t){const s={},i=e.valueParseFunction??Ue;if(n.config)for(const a in n.config)s[a]=i(a,n.config,e.assetsContainer||e.scene,e.scene);if(Hn(n.className)){if(!e.pathConverter)throw new Error("Path converter is required for this block");s.pathConverter=e.pathConverter}const r=new t(s);r.uniqueId=n.uniqueId;for(let a=0;a<n.dataInputs.length;a++){const o=r.getDataInput(n.dataInputs[a].name);if(o)o.deserialize(n.dataInputs[a]);else throw new Error("Could not find data input with name "+n.dataInputs[a].name+" in block "+n.className)}for(let a=0;a<n.dataOutputs.length;a++){const o=r.getDataOutput(n.dataOutputs[a].name);if(o)o.deserialize(n.dataOutputs[a]);else throw new Error("Could not find data output with name "+n.dataOutputs[a].name+" in block "+n.className)}return r.metadata=n.metadata,r.deserialize&&r.deserialize(n),r}function Jr(n={},e,t){const s=new t(n.name,n._connectionType,e);return s.deserialize(n),s}function Zr(n,e,t){const s=ir(n.richType),i=n.defaultValue,r=new t(n.name,n._connectionType,e,s,i,!!n._optional);return r.deserialize(n),r}function ir(n){return new $(n.typeName,n.defaultValue)}Ke.AddNodeConstructor("Light_Type_2",(n,e)=>()=>new se(n,y.Zero(),y.Zero(),0,0,e));class se extends ps{get iesProfileTexture(){return this._iesProfileTexture}set iesProfileTexture(e){this._iesProfileTexture!==e&&(this._iesProfileTexture=e,this._iesProfileTexture&&se._IsTexture(this._iesProfileTexture)&&this._iesProfileTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()}))}get angle(){return this._angle}set angle(e){this._angle=e,this._cosHalfAngle=Math.cos(e*.5),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()}get innerAngle(){return this._innerAngle}set innerAngle(e){this._innerAngle=e,this._computeAngleValues()}get shadowAngleScale(){return this._shadowAngleScale}set shadowAngleScale(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()}get projectionTextureMatrix(){return this._projectionTextureMatrix}get projectionTextureLightNear(){return this._projectionTextureLightNear}set projectionTextureLightNear(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0}get projectionTextureLightFar(){return this._projectionTextureLightFar}set projectionTextureLightFar(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0}get projectionTextureUpDirection(){return this._projectionTextureUpDirection}set projectionTextureUpDirection(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0}get projectionTexture(){return this._projectionTexture}set projectionTexture(e){this._projectionTexture!==e&&(this._projectionTexture=e,this._projectionTextureDirty=!0,this._projectionTexture&&!this._projectionTexture.isReady()&&(se._IsProceduralTexture(this._projectionTexture)?this._projectionTexture.getEffect().executeWhenCompiled(()=>{this._markMeshesAsLightDirty()}):se._IsTexture(this._projectionTexture)&&this._projectionTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()})))}static _IsProceduralTexture(e){return e.onGeneratedObservable!==void 0}static _IsTexture(e){return e.onLoadObservable!==void 0}get projectionTextureProjectionLightMatrix(){return this._projectionTextureProjectionLightMatrix}set projectionTextureProjectionLightMatrix(e){this._projectionTextureProjectionLightMatrix=e,this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0}constructor(e,t,s,i,r,a,o){super(e,a,o),this._innerAngle=0,this._iesProfileTexture=null,this._projectionTextureMatrix=b.Zero(),this._projectionTextureLightNear=1e-6,this._projectionTextureLightFar=1e3,this._projectionTextureUpDirection=y.Up(),this._projectionTextureViewLightDirty=!0,this._projectionTextureProjectionLightDirty=!0,this._projectionTextureDirty=!0,this._projectionTextureViewTargetVector=y.Zero(),this._projectionTextureViewLightMatrix=b.Zero(),this._projectionTextureProjectionLightMatrix=b.Zero(),this._projectionTextureScalingMatrix=b.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),this.position=t,this.direction=s,this.angle=i,this.exponent=r}getClassName(){return"SpotLight"}getTypeID(){return Me.LIGHTTYPEID_SPOTLIGHT}_setDirection(e){super._setDirection(e),this._projectionTextureViewLightDirty=!0}_setPosition(e){super._setPosition(e),this._projectionTextureViewLightDirty=!0}_setDefaultShadowProjectionMatrix(e,t,s){const i=this.getScene().activeCamera;if(!i)return;this._shadowAngleScale=this._shadowAngleScale||1;const r=this._shadowAngleScale*this._angle,a=this.shadowMinZ!==void 0?this.shadowMinZ:i.minZ,o=this.shadowMaxZ!==void 0?this.shadowMaxZ:i.maxZ,u=this.getScene().getEngine().useReverseDepthBuffer;b.PerspectiveFovLHToRef(r,1,u?o:a,u?a:o,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,u)}_computeProjectionTextureViewLightMatrix(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.getAbsolutePosition().addToRef(this.getShadowDirection(),this._projectionTextureViewTargetVector),b.LookAtLHToRef(this.getAbsolutePosition(),this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)}_computeProjectionTextureProjectionLightMatrix(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;const e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,s=e/(e-t),i=-s*t,r=1/Math.tan(this._angle/2);b.FromValuesToRef(r/1,0,0,0,0,r,0,0,0,0,s,1,0,0,i,0,this._projectionTextureProjectionLightMatrix)}_computeProjectionTextureMatrix(){if(this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTexture instanceof X){const e=this._projectionTexture.uScale/2,t=this._projectionTexture.vScale/2;b.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,.5,0,.5,.5,.5,1,this._projectionTextureScalingMatrix)}this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeAngleValues(){this._lightAngleScale=1/Math.max(.001,Math.cos(this._innerAngle*.5)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale}transferTexturesToEffect(e,t){return this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightTexture"+t,this.projectionTexture)),this._iesProfileTexture&&this._iesProfileTexture.isReady()&&e.setTexture("iesLightTexture"+t,this._iesProfileTexture),this}transferToEffect(e,t){let s;const i=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-i.x,this.transformedPosition.y-i.y,this.transformedPosition.z-i.z,this.exponent,t),s=y.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-i.x,this.position.y-i.y,this.position.z-i.z,this.exponent,t),s=y.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",s.x,s.y,s.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this}transferToNodeMaterialEffect(e,t){let s;return this.computeTransformedInformation()?s=y.Normalize(this.transformedDirection):s=y.Normalize(this.direction),this.getScene().useRightHandedSystem?e.setFloat3(t,-s.x,-s.y,-s.z):e.setFloat3(t,s.x,s.y,s.z),this}dispose(){super.dispose(),this._projectionTexture&&this._projectionTexture.dispose(),this._iesProfileTexture&&(this._iesProfileTexture.dispose(),this._iesProfileTexture=null)}getDepthMinZ(e){const t=this._scene.getEngine(),s=this.shadowMinZ!==void 0?this.shadowMinZ:e?.minZ??0;return t.useReverseDepthBuffer&&t.isNDCHalfZRange?s:this._scene.getEngine().isNDCHalfZRange?0:s}getDepthMaxZ(e){const t=this._scene.getEngine(),s=this.shadowMaxZ!==void 0?this.shadowMaxZ:e?.maxZ??1e4;return t.useReverseDepthBuffer&&t.isNDCHalfZRange?0:s}prepareLightSpecificDefines(e,t){e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!!(this.projectionTexture&&this.projectionTexture.isReady()),e["IESLIGHTTEXTURE"+t]=!!(this._iesProfileTexture&&this._iesProfileTexture.isReady())}}h([m()],se.prototype,"angle",null);h([m()],se.prototype,"innerAngle",null);h([m()],se.prototype,"shadowAngleScale",null);h([m()],se.prototype,"exponent",void 0);h([m()],se.prototype,"projectionTextureLightNear",null);h([m()],se.prototype,"projectionTextureLightFar",null);h([m()],se.prototype,"projectionTextureUpDirection",null);h([F("projectedLightTexture")],se.prototype,"_projectionTexture",void 0);Ee("BABYLON.SpotLight",se);const nr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiP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47w4ASmqUkAalYU+DBoIbK8hAG506aZTLonWFG0IMa1AAHXlegW9wFGuAJG97hhFkqiuCxUZyqSSWR5GCZHKxB7nSwDcZADHiACQ4eJ/Oot9+BvsaLQD2Hby9RUEEs1cUlcdKpmWKSQ2VyqAY56J0RiEEPOqHxXYv2W4yJuANWxBkBOKEGFcwyjlhMYdLJSjLJpA8FAxqMwXZRQA0wgdQ94Hcf4nqDFnQhBDcY5YJUIqSSpnxpRqone6ol+2Af7Il2MJJxnN/8lgIA8yWQUKItaBMRsGEdDIrQoYNTnGSyBqdZQSY16IEYaANOOKn/A+htXH+OdgLOiB1BBOEGCz5ejmO6JpGEeexVJTmohJNORqIlnVDyO4CvvsT2AGm0BVEHo0IMHeEooeQipzDFY5eSNcigLgwoGYlIKHF/ky9Z+xD/WrCfoQUuRCGAKBhlwIBRQvmSuykkMYHkqx7EAPK+/wdqEbWmfB0bfwAAAABJRU5ErkJggg==";let ar=0;const zs=(n,e,t,s)=>{if(!n[t]){const i=n.useDelayedTextureLoading;n.useDelayedTextureLoading=!1;const r=n._blockEntityCollection;n._blockEntityCollection=!1;const a=X.CreateFromBase64String(e,s+ar++,n,!0,!1,X.BILINEAR_SAMPLINGMODE);n._blockEntityCollection=r;const o=n.getEngine().getLoadedTexturesCache(),u=o.indexOf(a.getInternalTexture());u!==-1&&o.splice(u,1),a.isRGBD=!0,a.wrapU=X.CLAMP_ADDRESSMODE,a.wrapV=X.CLAMP_ADDRESSMODE,n[t]=a,n.useDelayedTextureLoading=i,Vt.ExpandRGBDTexture(a);const l=n.getEngine().onContextRestoredObservable.add(()=>{a.isRGBD=!0;const f=n.onBeforeRenderObservable.add(()=>{a.isReady()&&(n.onBeforeRenderObservable.remove(f),Vt.ExpandRGBDTexture(a))})});n.onDisposeObservable.add(()=>{n.getEngine().onContextRestoredObservable.remove(l)})}return n[t]},Dt=n=>zs(n,nr,"environmentBRDFTexture","EnvironmentBRDFTexture"),or=n=>zs(n,rr,"environmentFuzzBRDFTexture","EnvironmentFuzzBRDFTexture"),$r={GetEnvironmentBRDFTexture:Dt,GetEnvironmentFuzzBRDFTexture:or};class ur extends Re{constructor(){super(...arguments),this.BRDF_V_HEIGHT_CORRELATED=!1,this.MS_BRDF_ENERGY_CONSERVATION=!1,this.SPHERICAL_HARMONICS=!1,this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,this.MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,this.LEGACY_SPECULAR_ENERGY_CONSERVATION=!1,this.BASE_DIFFUSE_MODEL=0,this.DIELECTRIC_SPECULAR_MODEL=0,this.CONDUCTOR_SPECULAR_MODEL=0}}class R extends ve{_markAllSubMeshesAsMiscDirty(){this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRBRDF",90,new ur,t),this._useEnergyConservation=R.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=R.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=R.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=R.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=R.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=R.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=R.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=R.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._mixIblRadianceWithIrradiance=R.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this.mixIblRadianceWithIrradiance=R.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this._useLegacySpecularEnergyConservation=R.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this.useLegacySpecularEnergyConservation=R.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this._baseDiffuseModel=R.DEFAULT_DIFFUSE_MODEL,this.baseDiffuseModel=R.DEFAULT_DIFFUSE_MODEL,this._dielectricSpecularModel=R.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this.dielectricSpecularModel=R.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this._conductorSpecularModel=R.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this.conductorSpecularModel=R.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16],this._enable(!0)}prepareDefines(e){e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation,e.MIX_IBL_RADIANCE_WITH_IRRADIANCE=this._mixIblRadianceWithIrradiance,e.LEGACY_SPECULAR_ENERGY_CONSERVATION=this._useLegacySpecularEnergyConservation,e.BASE_DIFFUSE_MODEL=this._baseDiffuseModel,e.DIELECTRIC_SPECULAR_MODEL=this._dielectricSpecularModel,e.CONDUCTOR_SPECULAR_MODEL=this._conductorSpecularModel}getClassName(){return"PBRBRDFConfiguration"}}R.DEFAULT_USE_ENERGY_CONSERVATION=!0;R.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0;R.DEFAULT_USE_SPHERICAL_HARMONICS=!0;R.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0;R.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0;R.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION=!0;R.DEFAULT_DIFFUSE_MODEL=0;R.DEFAULT_DIELECTRIC_SPECULAR_MODEL=0;R.DEFAULT_CONDUCTOR_SPECULAR_MODEL=0;h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"useEnergyConservation",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"useSmithVisibilityHeightCorrelated",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"useSphericalHarmonics",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"useSpecularGlossinessInputEnergyConservation",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"mixIblRadianceWithIrradiance",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"useLegacySpecularEnergyConservation",void 0);h([m("baseDiffuseModel"),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"baseDiffuseModel",void 0);h([m("dielectricSpecularModel"),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"dielectricSpecularModel",void 0);h([m("conductorSpecularModel"),p("_markAllSubMeshesAsMiscDirty")],R.prototype,"conductorSpecularModel",void 0);class lr extends Re{constructor(){super(...arguments),this.CLEARCOAT=!1,this.CLEARCOAT_DEFAULTIOR=!1,this.CLEARCOAT_TEXTURE=!1,this.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this.CLEARCOAT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,this.CLEARCOAT_BUMP=!1,this.CLEARCOAT_BUMPDIRECTUV=0,this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,this.CLEARCOAT_REMAP_F0=!1,this.CLEARCOAT_TINT=!1,this.CLEARCOAT_TINT_TEXTURE=!1,this.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TINT_GAMMATEXTURE=!1}}class W extends ve{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRClearCoat",100,new lr,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=W._DefaultIndexOfRefraction,this.indexOfRefraction=W._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._textureRoughness=null,this.textureRoughness=null,this._remapF0OnInterfaceChange=!0,this.remapF0OnInterfaceChange=!0,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=z.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,s){if(!this._isEnabled)return!0;const i=this._material._disableBumpMap;return!(e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.ClearCoatTextureEnabled&&!this._texture.isReadyOrNotBlocking()||this._textureRoughness&&T.ClearCoatTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking()||s.getCaps().standardDerivatives&&this._bumpTexture&&T.ClearCoatBumpTextureEnabled&&!i&&!this._bumpTexture.isReady()||this._isTintEnabled&&this._tintTexture&&T.ClearCoatTintTextureEnabled&&!this._tintTexture.isReadyOrNotBlocking()))}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.CLEARCOAT=!0,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e.CLEARCOAT_REMAP_F0=this._remapF0OnInterfaceChange,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.ClearCoatTextureEnabled?O(this._texture,e,"CLEARCOAT_TEXTURE"):e.CLEARCOAT_TEXTURE=!1,this._textureRoughness&&T.ClearCoatTextureEnabled?O(this._textureRoughness,e,"CLEARCOAT_TEXTURE_ROUGHNESS"):e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this._bumpTexture&&T.ClearCoatBumpTextureEnabled?O(this._bumpTexture,e,"CLEARCOAT_BUMP"):e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===W._DefaultIndexOfRefraction,this._isTintEnabled?(e.CLEARCOAT_TINT=!0,this._tintTexture&&T.ClearCoatTintTextureEnabled?(O(this._tintTexture,e,"CLEARCOAT_TINT_TEXTURE"),e.CLEARCOAT_TINT_GAMMATEXTURE=this._tintTexture.gammaSpace):e.CLEARCOAT_TINT_TEXTURE=!1):(e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1))):(e.CLEARCOAT=!1,e.CLEARCOAT_TEXTURE=!1,e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.CLEARCOAT_DEFAULTIOR=!1,e.CLEARCOAT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,e.CLEARCOAT_BUMPDIRECTUV=0,e.CLEARCOAT_REMAP_F0=!1,e.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TINT_GAMMATEXTURE=!1)}bindForSubMesh(e,t,s,i){if(!this._isEnabled)return;const r=i.materialDefines,a=this._material.isFrozen,o=this._material._disableBumpMap,u=this._material._invertNormalMapX,l=this._material._invertNormalMapY;if(!e.useUbo||!a||!e.isSync){(this._texture||this._textureRoughness)&&T.ClearCoatTextureEnabled&&(e.updateFloat4("vClearCoatInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&L(this._texture,e,"clearCoat"),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&L(this._textureRoughness,e,"clearCoatRoughness")),this._bumpTexture&&s.getCaps().standardDerivatives&&T.ClearCoatTextureEnabled&&!o&&(e.updateFloat2("vClearCoatBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level),L(this._bumpTexture,e,"clearCoatBump"),t._mirroredCameraPosition?e.updateFloat2("vClearCoatTangentSpaceParams",u?1:-1,l?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",u?-1:1,l?-1:1)),this._tintTexture&&T.ClearCoatTintTextureEnabled&&(e.updateFloat2("vClearCoatTintInfos",this._tintTexture.coordinatesIndex,this._tintTexture.level),L(this._tintTexture,e,"clearCoatTint")),e.updateFloat2("vClearCoatParams",this.intensity,this.roughness);const f=1-this._indexOfRefraction,c=1+this._indexOfRefraction,E=Math.pow(-f/c,2),C=1/this._indexOfRefraction;e.updateFloat4("vClearCoatRefractionParams",E,C,f,c),this._isTintEnabled&&(e.updateFloat4("vClearCoatTintParams",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintThickness)),e.updateFloat("clearCoatColorAtDistance",Math.max(1e-5,this.tintColorAtDistance)))}t.texturesEnabled&&(this._texture&&T.ClearCoatTextureEnabled&&e.setTexture("clearCoatSampler",this._texture),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&T.ClearCoatTextureEnabled&&e.setTexture("clearCoatRoughnessSampler",this._textureRoughness),this._bumpTexture&&s.getCaps().standardDerivatives&&T.ClearCoatBumpTextureEnabled&&!o&&e.setTexture("clearCoatBumpSampler",this._bumpTexture),this._isTintEnabled&&this._tintTexture&&T.ClearCoatTintTextureEnabled&&e.setTexture("clearCoatTintSampler",this._tintTexture))}hasTexture(e){return this._texture===e||this._textureRoughness===e||this._bumpTexture===e||this._tintTexture===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness),this._bumpTexture&&e.push(this._bumpTexture),this._tintTexture&&e.push(this._tintTexture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._tintTexture&&this._tintTexture.animations&&this._tintTexture.animations.length>0&&e.push(this._tintTexture)}dispose(e){e&&(this._texture?.dispose(),this._textureRoughness?.dispose(),this._bumpTexture?.dispose(),this._tintTexture?.dispose())}getClassName(){return"PBRClearCoatConfiguration"}addFallbacks(e,t,s){return e.CLEARCOAT_BUMP&&t.addFallback(s++,"CLEARCOAT_BUMP"),e.CLEARCOAT_TINT&&t.addFallback(s++,"CLEARCOAT_TINT"),e.CLEARCOAT&&t.addFallback(s++,"CLEARCOAT"),s}getSamplers(e){e.push("clearCoatSampler","clearCoatRoughnessSampler","clearCoatBumpSampler","clearCoatTintSampler")}getUniforms(){return{ubo:[{name:"vClearCoatParams",size:2,type:"vec2"},{name:"vClearCoatRefractionParams",size:4,type:"vec4"},{name:"vClearCoatInfos",size:4,type:"vec4"},{name:"clearCoatMatrix",size:16,type:"mat4"},{name:"clearCoatRoughnessMatrix",size:16,type:"mat4"},{name:"vClearCoatBumpInfos",size:2,type:"vec2"},{name:"vClearCoatTangentSpaceParams",size:2,type:"vec2"},{name:"clearCoatBumpMatrix",size:16,type:"mat4"},{name:"vClearCoatTintParams",size:4,type:"vec4"},{name:"clearCoatColorAtDistance",size:1,type:"float"},{name:"vClearCoatTintInfos",size:2,type:"vec2"},{name:"clearCoatTintMatrix",size:16,type:"mat4"}]}}}W._DefaultIndexOfRefraction=1.5;h([m(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"isEnabled",void 0);h([m()],W.prototype,"intensity",void 0);h([m()],W.prototype,"roughness",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"indexOfRefraction",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"texture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"useRoughnessFromMainTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"textureRoughness",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"remapF0OnInterfaceChange",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"bumpTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"isTintEnabled",void 0);h([oe()],W.prototype,"tintColor",void 0);h([m()],W.prototype,"tintColorAtDistance",void 0);h([m()],W.prototype,"tintThickness",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],W.prototype,"tintTexture",void 0);class hr extends Re{constructor(){super(...arguments),this.IRIDESCENCE=!1,this.IRIDESCENCE_TEXTURE=!1,this.IRIDESCENCE_TEXTUREDIRECTUV=0,this.IRIDESCENCE_THICKNESS_TEXTURE=!1,this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0}}class j extends ve{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRIridescence",110,new hr,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.minimumThickness=j._DefaultMinimumThickness,this.maximumThickness=j._DefaultMaximumThickness,this.indexOfRefraction=j._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._thicknessTexture=null,this.thicknessTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){return this._isEnabled?!(e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.IridescenceTextureEnabled&&!this._texture.isReadyOrNotBlocking()||this._thicknessTexture&&T.IridescenceTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())):!0}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.IRIDESCENCE=!0,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.IridescenceTextureEnabled?O(this._texture,e,"IRIDESCENCE_TEXTURE"):e.IRIDESCENCE_TEXTURE=!1,this._thicknessTexture&&T.IridescenceTextureEnabled?O(this._thicknessTexture,e,"IRIDESCENCE_THICKNESS_TEXTURE"):e.IRIDESCENCE_THICKNESS_TEXTURE=!1)):(e.IRIDESCENCE=!1,e.IRIDESCENCE_TEXTURE=!1,e.IRIDESCENCE_THICKNESS_TEXTURE=!1,e.IRIDESCENCE_TEXTUREDIRECTUV=0,e.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0)}bindForSubMesh(e,t){if(!this._isEnabled)return;const s=this._material.isFrozen;(!e.useUbo||!s||!e.isSync)&&((this._texture||this._thicknessTexture)&&T.IridescenceTextureEnabled&&(e.updateFloat4("vIridescenceInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._thicknessTexture?.coordinatesIndex??0,this._thicknessTexture?.level??0),this._texture&&L(this._texture,e,"iridescence"),this._thicknessTexture&&L(this._thicknessTexture,e,"iridescenceThickness")),e.updateFloat4("vIridescenceParams",this.intensity,this.indexOfRefraction,this.minimumThickness,this.maximumThickness)),t.texturesEnabled&&(this._texture&&T.IridescenceTextureEnabled&&e.setTexture("iridescenceSampler",this._texture),this._thicknessTexture&&T.IridescenceTextureEnabled&&e.setTexture("iridescenceThicknessSampler",this._thicknessTexture))}hasTexture(e){return this._texture===e||this._thicknessTexture===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._thicknessTexture&&e.push(this._thicknessTexture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture)}dispose(e){e&&(this._texture?.dispose(),this._thicknessTexture?.dispose())}getClassName(){return"PBRIridescenceConfiguration"}addFallbacks(e,t,s){return e.IRIDESCENCE&&t.addFallback(s++,"IRIDESCENCE"),s}getSamplers(e){e.push("iridescenceSampler","iridescenceThicknessSampler")}getUniforms(){return{ubo:[{name:"vIridescenceParams",size:4,type:"vec4"},{name:"vIridescenceInfos",size:4,type:"vec4"},{name:"iridescenceMatrix",size:16,type:"mat4"},{name:"iridescenceThicknessMatrix",size:16,type:"mat4"}]}}}j._DefaultMinimumThickness=100;j._DefaultMaximumThickness=400;j._DefaultIndexOfRefraction=1.3;h([m(),p("_markAllSubMeshesAsTexturesDirty")],j.prototype,"isEnabled",void 0);h([m()],j.prototype,"intensity",void 0);h([m()],j.prototype,"minimumThickness",void 0);h([m()],j.prototype,"maximumThickness",void 0);h([m()],j.prototype,"indexOfRefraction",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],j.prototype,"texture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],j.prototype,"thicknessTexture",void 0);class cr extends Re{constructor(){super(...arguments),this.ANISOTROPIC=!1,this.ANISOTROPIC_TEXTURE=!1,this.ANISOTROPIC_TEXTUREDIRECTUV=0,this.ANISOTROPIC_LEGACY=!1,this.MAINUV1=!1}}class Pe extends ve{set angle(e){this.direction.x=Math.cos(e),this.direction.y=Math.sin(e)}get angle(){return Math.atan2(this.direction.y,this.direction.x)}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markAllSubMeshesAsMiscDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRAnisotropic",110,new cr,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.direction=new je(1,0),this._texture=null,this.texture=null,this._legacy=!1,this.legacy=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16]}isReadyForSubMesh(e,t){return this._isEnabled?!(e._areTexturesDirty&&t.texturesEnabled&&this._texture&&T.AnisotropicTextureEnabled&&!this._texture.isReadyOrNotBlocking()):!0}prepareDefinesBeforeAttributes(e,t,s){this._isEnabled?(e.ANISOTROPIC=this._isEnabled,this._isEnabled&&!s.isVerticesDataPresent(w.TangentKind)&&(e._needUVs=!0,e.MAINUV1=!0),e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.AnisotropicTextureEnabled?O(this._texture,e,"ANISOTROPIC_TEXTURE"):e.ANISOTROPIC_TEXTURE=!1),e._areMiscDirty&&(e.ANISOTROPIC_LEGACY=this._legacy)):(e.ANISOTROPIC=!1,e.ANISOTROPIC_TEXTURE=!1,e.ANISOTROPIC_TEXTUREDIRECTUV=0,e.ANISOTROPIC_LEGACY=!1)}bindForSubMesh(e,t){if(!this._isEnabled)return;const s=this._material.isFrozen;(!e.useUbo||!s||!e.isSync)&&(this._texture&&T.AnisotropicTextureEnabled&&(e.updateFloat2("vAnisotropyInfos",this._texture.coordinatesIndex,this._texture.level),L(this._texture,e,"anisotropy")),e.updateFloat3("vAnisotropy",this.direction.x,this.direction.y,this.intensity)),t.texturesEnabled&&this._texture&&T.AnisotropicTextureEnabled&&e.setTexture("anisotropySampler",this._texture)}hasTexture(e){return this._texture===e}getActiveTextures(e){this._texture&&e.push(this._texture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){e&&this._texture&&this._texture.dispose()}getClassName(){return"PBRAnisotropicConfiguration"}addFallbacks(e,t,s){return e.ANISOTROPIC&&t.addFallback(s++,"ANISOTROPIC"),s}getSamplers(e){e.push("anisotropySampler")}getUniforms(){return{ubo:[{name:"vAnisotropy",size:3,type:"vec3"},{name:"vAnisotropyInfos",size:2,type:"vec2"},{name:"anisotropyMatrix",size:16,type:"mat4"}]}}parse(e,t,s){super.parse(e,t,s),e.legacy===void 0&&(this.legacy=!0)}}h([m(),p("_markAllSubMeshesAsTexturesDirty")],Pe.prototype,"isEnabled",void 0);h([m()],Pe.prototype,"intensity",void 0);h([Js()],Pe.prototype,"direction",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],Pe.prototype,"texture",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],Pe.prototype,"legacy",void 0);class dr extends Re{constructor(){super(...arguments),this.SHEEN=!1,this.SHEEN_TEXTURE=!1,this.SHEEN_GAMMATEXTURE=!1,this.SHEEN_TEXTURE_ROUGHNESS=!1,this.SHEEN_TEXTUREDIRECTUV=0,this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0,this.SHEEN_LINKWITHALBEDO=!1,this.SHEEN_ROUGHNESS=!1,this.SHEEN_ALBEDOSCALING=!1,this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1}}class he extends ve{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"Sheen",120,new dr,t),this._isEnabled=!1,this.isEnabled=!1,this._linkSheenWithAlbedo=!1,this.linkSheenWithAlbedo=!1,this.intensity=1,this.color=z.White(),this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._roughness=null,this.roughness=null,this._textureRoughness=null,this.textureRoughness=null,this._albedoScaling=!1,this.albedoScaling=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){return this._isEnabled?!(e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.SheenTextureEnabled&&!this._texture.isReadyOrNotBlocking()||this._textureRoughness&&T.SheenTextureEnabled&&!this._textureRoughness.isReadyOrNotBlocking())):!0}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.SHEEN=!0,e.SHEEN_LINKWITHALBEDO=this._linkSheenWithAlbedo,e.SHEEN_ROUGHNESS=this._roughness!==null,e.SHEEN_ALBEDOSCALING=this._albedoScaling,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&T.SheenTextureEnabled?(O(this._texture,e,"SHEEN_TEXTURE"),e.SHEEN_GAMMATEXTURE=this._texture.gammaSpace):e.SHEEN_TEXTURE=!1,this._textureRoughness&&T.SheenTextureEnabled?O(this._textureRoughness,e,"SHEEN_TEXTURE_ROUGHNESS"):e.SHEEN_TEXTURE_ROUGHNESS=!1)):(e.SHEEN=!1,e.SHEEN_TEXTURE=!1,e.SHEEN_TEXTURE_ROUGHNESS=!1,e.SHEEN_LINKWITHALBEDO=!1,e.SHEEN_ROUGHNESS=!1,e.SHEEN_ALBEDOSCALING=!1,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.SHEEN_GAMMATEXTURE=!1,e.SHEEN_TEXTUREDIRECTUV=0,e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0)}bindForSubMesh(e,t,s,i){if(!this._isEnabled)return;const r=i.materialDefines,a=this._material.isFrozen;(!e.useUbo||!a||!e.isSync)&&((this._texture||this._textureRoughness)&&T.SheenTextureEnabled&&(e.updateFloat4("vSheenInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&L(this._texture,e,"sheen"),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&L(this._textureRoughness,e,"sheenRoughness")),e.updateFloat4("vSheenColor",this.color.r,this.color.g,this.color.b,this.intensity),this._roughness!==null&&e.updateFloat("vSheenRoughness",this._roughness)),t.texturesEnabled&&(this._texture&&T.SheenTextureEnabled&&e.setTexture("sheenSampler",this._texture),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&T.SheenTextureEnabled&&e.setTexture("sheenRoughnessSampler",this._textureRoughness))}hasTexture(e){return this._texture===e||this._textureRoughness===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness)}dispose(e){e&&(this._texture?.dispose(),this._textureRoughness?.dispose())}getClassName(){return"PBRSheenConfiguration"}addFallbacks(e,t,s){return e.SHEEN&&t.addFallback(s++,"SHEEN"),s}getSamplers(e){e.push("sheenSampler","sheenRoughnessSampler")}getUniforms(){return{ubo:[{name:"vSheenColor",size:4,type:"vec4"},{name:"vSheenRoughness",size:1,type:"float"},{name:"vSheenInfos",size:4,type:"vec4"},{name:"sheenMatrix",size:16,type:"mat4"},{name:"sheenRoughnessMatrix",size:16,type:"mat4"}]}}}h([m(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"isEnabled",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"linkSheenWithAlbedo",void 0);h([m()],he.prototype,"intensity",void 0);h([oe()],he.prototype,"color",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"texture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"useRoughnessFromMainTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"roughness",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"textureRoughness",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],he.prototype,"albedoScaling",void 0);class _r extends Re{constructor(){super(...arguments),this.SUBSURFACE=!1,this.SS_REFRACTION=!1,this.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_TRANSLUCENCY=!1,this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_SCATTERING=!1,this.SS_DISPERSION=!1,this.SS_THICKNESSANDMASK_TEXTURE=!1,this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,this.SS_HAS_THICKNESS=!1,this.SS_REFRACTIONINTENSITY_TEXTURE=!1,this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,this.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,this.SS_REFRACTIONMAP_3D=!1,this.SS_REFRACTIONMAP_OPPOSITEZ=!1,this.SS_LODINREFRACTIONALPHA=!1,this.SS_GAMMAREFRACTION=!1,this.SS_RGBDREFRACTION=!1,this.SS_LINEARSPECULARREFRACTION=!1,this.SS_LINKREFRACTIONTOTRANSPARENCY=!1,this.SS_ALBEDOFORREFRACTIONTINT=!1,this.SS_ALBEDOFORTRANSLUCENCYTINT=!1,this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.SS_USE_THICKNESS_AS_DEPTH=!1,this.SS_USE_GLTF_TEXTURES=!1,this.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1,this.SS_TRANSLUCENCY_LEGACY=!1}}class M extends ve{get scatteringDiffusionProfile(){return this._scene.subSurfaceConfiguration?this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex]:null}set scatteringDiffusionProfile(e){this._scene.enableSubSurfaceForPrePass()&&e&&(this._scatteringDiffusionProfileIndex=this._scene.subSurfaceConfiguration.addDiffusionProfile(e))}get volumeIndexOfRefraction(){return this._volumeIndexOfRefraction>=1?this._volumeIndexOfRefraction:this._indexOfRefraction}set volumeIndexOfRefraction(e){e>=1?this._volumeIndexOfRefraction=e:this._volumeIndexOfRefraction=-1}get legacyTransluceny(){return this.legacyTranslucency}set legacyTransluceny(e){this.legacyTranslucency=e}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markScenePrePassDirty(){this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty(),this._internalMarkScenePrePassDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRSubSurface",130,new _r,t),this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isDispersionEnabled=!1,this.isDispersionEnabled=!1,this._isScatteringEnabled=!1,this.isScatteringEnabled=!1,this._scatteringDiffusionProfileIndex=0,this.refractionIntensity=1,this.translucencyIntensity=1,this._useAlbedoToTintRefraction=!1,this.useAlbedoToTintRefraction=!1,this._useAlbedoToTintTranslucency=!1,this.useAlbedoToTintTranslucency=!1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1.5,this.indexOfRefraction=1.5,this._volumeIndexOfRefraction=-1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.useThicknessAsDepth=!1,this.tintColor=z.White(),this.tintColorAtDistance=1,this.dispersion=0,this.diffusionDistance=z.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._refractionIntensityTexture=null,this.refractionIntensityTexture=null,this._translucencyIntensityTexture=null,this.translucencyIntensityTexture=null,this.translucencyColor=null,this._translucencyColorTexture=null,this.translucencyColorTexture=null,this._useGltfStyleTextures=!0,this.useGltfStyleTextures=!0,this.applyAlbedoAfterSubSurface=M.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE,this.legacyTranslucency=M.DEFAULT_LEGACY_TRANSLUCENCY,this._scene=e.getScene(),this.registerForExtraEvents=!0,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkScenePrePassDirty=e._dirtyCallbacks[32]}isReadyForSubMesh(e,t){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return!0;if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&T.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking()||this._refractionIntensityTexture&&T.RefractionIntensityTextureEnabled&&!this._refractionIntensityTexture.isReadyOrNotBlocking()||this._translucencyColorTexture&&T.TranslucencyColorTextureEnabled&&!this._translucencyColorTexture.isReadyOrNotBlocking()||this._translucencyIntensityTexture&&T.TranslucencyIntensityTextureEnabled&&!this._translucencyIntensityTexture.isReadyOrNotBlocking())return!1;const s=this._getRefractionTexture(t);if(s&&T.RefractionTextureEnabled&&!s.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled){e.SUBSURFACE=!1,e.SS_DISPERSION=!1,e.SS_TRANSLUCENCY=!1,e.SS_SCATTERING=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,e.SS_HAS_THICKNESS=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,e.SS_REFRACTIONMAP_3D=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1;return}if(e._areTexturesDirty){if(e.SUBSURFACE=!0,e.SS_DISPERSION=this._isDispersionEnabled,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_LEGACY=this.legacyTranslucency,e.SS_SCATTERING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_HAS_THICKNESS=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=this.applyAlbedoAfterSubSurface,e._areTexturesDirty&&t.texturesEnabled&&(this._thicknessTexture&&T.ThicknessTextureEnabled&&O(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),this._refractionIntensityTexture&&T.RefractionIntensityTextureEnabled&&O(this._refractionIntensityTexture,e,"SS_REFRACTIONINTENSITY_TEXTURE"),this._translucencyIntensityTexture&&T.TranslucencyIntensityTextureEnabled&&O(this._translucencyIntensityTexture,e,"SS_TRANSLUCENCYINTENSITY_TEXTURE"),this._translucencyColorTexture&&T.TranslucencyColorTextureEnabled&&(O(this._translucencyColorTexture,e,"SS_TRANSLUCENCYCOLOR_TEXTURE"),e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=this._translucencyColorTexture.gammaSpace)),e.SS_HAS_THICKNESS=this.maximumThickness-this.minimumThickness!==0,e.SS_USE_GLTF_TEXTURES=this._useGltfStyleTextures,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._refractionIntensityTexture,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._translucencyIntensityTexture,this._isRefractionEnabled&&t.texturesEnabled){const s=this._getRefractionTexture(t);s&&T.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=s.isCube,e.SS_GAMMAREFRACTION=s.gammaSpace,e.SS_RGBDREFRACTION=s.isRGBD,e.SS_LINEARSPECULARREFRACTION=s.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=this._scene.useRightHandedSystem&&s.isCube?!s.invertZ:s.invertZ,e.SS_LODINREFRACTIONALPHA=s.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency,e.SS_ALBEDOFORREFRACTIONTINT=this._useAlbedoToTintRefraction,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=s.isCube&&s.boundingBoxSize,e.SS_USE_THICKNESS_AS_DEPTH=this.useThicknessAsDepth)}this._isTranslucencyEnabled&&(e.SS_ALBEDOFORTRANSLUCENCYTINT=this._useAlbedoToTintTranslucency)}}hardBindForSubMesh(e,t,s,i){if(!(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled))if(this.maximumThickness===0&&this.minimumThickness===0)e.updateFloat2("vThicknessParam",0,0);else{i.getRenderingMesh().getWorldMatrix().decompose(H.Vector3[0]);const r=Math.max(Math.abs(H.Vector3[0].x),Math.abs(H.Vector3[0].y),Math.abs(H.Vector3[0].z));e.updateFloat2("vThicknessParam",this.minimumThickness*r,(this.maximumThickness-this.minimumThickness)*r)}}bindForSubMesh(e,t,s,i){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return;const r=i.materialDefines,a=this._material.isFrozen,o=this._material.realTimeFiltering,u=r.LODBASEDMICROSFURACE,l=this._getRefractionTexture(t);if(!e.useUbo||!a||!e.isSync){if(this._thicknessTexture&&T.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),L(this._thicknessTexture,e,"thickness")),this._refractionIntensityTexture&&T.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&(e.updateFloat2("vRefractionIntensityInfos",this._refractionIntensityTexture.coordinatesIndex,this._refractionIntensityTexture.level),L(this._refractionIntensityTexture,e,"refractionIntensity")),this._translucencyColorTexture&&T.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&(e.updateFloat2("vTranslucencyColorInfos",this._translucencyColorTexture.coordinatesIndex,this._translucencyColorTexture.level),L(this._translucencyColorTexture,e,"translucencyColor")),this._translucencyIntensityTexture&&T.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&(e.updateFloat2("vTranslucencyIntensityInfos",this._translucencyIntensityTexture.coordinatesIndex,this._translucencyIntensityTexture.level),L(this._translucencyIntensityTexture,e,"translucencyIntensity")),l&&T.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",l.getRefractionTextureMatrix());let f=1;l.isCube||l.depth&&(f=l.depth);const c=l.getSize().width,E=this.volumeIndexOfRefraction;if(e.updateFloat4("vRefractionInfos",l.level,1/E,f,this._invertRefractionY?-1:1),e.updateFloat4("vRefractionMicrosurfaceInfos",c,l.lodGenerationScale,l.lodGenerationOffset,1/this.indexOfRefraction),o&&e.updateFloat2("vRefractionFilteringInfo",c,Math.log2(c)),l.boundingBoxSize){const C=l;e.updateVector3("vRefractionPosition",C.boundingBoxPosition),e.updateVector3("vRefractionSize",C.boundingBoxSize)}}this._isScatteringEnabled&&e.updateFloat("scatteringDiffusionProfile",this._scatteringDiffusionProfileIndex),e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintColorAtDistance)),e.updateColor4("vTranslucencyColor",this.translucencyColor??this.tintColor,0),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,0),e.updateFloat("dispersion",this.dispersion)}t.texturesEnabled&&(this._thicknessTexture&&T.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),this._refractionIntensityTexture&&T.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&e.setTexture("refractionIntensitySampler",this._refractionIntensityTexture),this._translucencyIntensityTexture&&T.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&e.setTexture("translucencyIntensitySampler",this._translucencyIntensityTexture),this._translucencyColorTexture&&T.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&e.setTexture("translucencyColorSampler",this._translucencyColorTexture),l&&T.RefractionTextureEnabled&&(u?e.setTexture("refractionSampler",l):(e.setTexture("refractionSampler",l._lodTextureMid||l),e.setTexture("refractionSamplerLow",l._lodTextureLow||l),e.setTexture("refractionSamplerHigh",l._lodTextureHigh||l))))}_getRefractionTexture(e){return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null}get disableAlphaBlending(){return this._isRefractionEnabled&&this._linkRefractionWithTransparency}fillRenderTargetTextures(e){T.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)}hasTexture(e){return this._thicknessTexture===e||this._refractionTexture===e||this._refractionIntensityTexture===e||this._translucencyIntensityTexture===e||this._translucencyColorTexture===e}hasRenderTargetTextures(){return!!(T.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)}getActiveTextures(e){this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture),this._refractionIntensityTexture&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&e.push(this._translucencyIntensityTexture)}getAnimatables(e){this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),this._refractionIntensityTexture&&this._refractionIntensityTexture.animations&&this._refractionIntensityTexture.animations.length>0&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&this._translucencyColorTexture.animations&&this._translucencyColorTexture.animations.length>0&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.animations&&this._translucencyIntensityTexture.animations.length>0&&e.push(this._translucencyIntensityTexture)}dispose(e){e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose(),this._refractionIntensityTexture&&this._refractionIntensityTexture.dispose(),this._translucencyColorTexture&&this._translucencyColorTexture.dispose(),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.dispose())}getClassName(){return"PBRSubSurfaceConfiguration"}addFallbacks(e,t,s){return e.SS_SCATTERING&&t.addFallback(s++,"SS_SCATTERING"),e.SS_TRANSLUCENCY&&t.addFallback(s++,"SS_TRANSLUCENCY"),s}getSamplers(e){e.push("thicknessSampler","refractionIntensitySampler","translucencyIntensitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","translucencyColorSampler")}getUniforms(){return{ubo:[{name:"vRefractionMicrosurfaceInfos",size:4,type:"vec4"},{name:"vRefractionFilteringInfo",size:2,type:"vec2"},{name:"vTranslucencyIntensityInfos",size:2,type:"vec2"},{name:"vRefractionInfos",size:4,type:"vec4"},{name:"refractionMatrix",size:16,type:"mat4"},{name:"vThicknessInfos",size:2,type:"vec2"},{name:"vRefractionIntensityInfos",size:2,type:"vec2"},{name:"thicknessMatrix",size:16,type:"mat4"},{name:"refractionIntensityMatrix",size:16,type:"mat4"},{name:"translucencyIntensityMatrix",size:16,type:"mat4"},{name:"vThicknessParam",size:2,type:"vec2"},{name:"vDiffusionDistance",size:3,type:"vec3"},{name:"vTintColor",size:4,type:"vec4"},{name:"vSubSurfaceIntensity",size:3,type:"vec3"},{name:"vRefractionPosition",size:3,type:"vec3"},{name:"vRefractionSize",size:3,type:"vec3"},{name:"scatteringDiffusionProfile",size:1,type:"float"},{name:"dispersion",size:1,type:"float"},{name:"vTranslucencyColor",size:4,type:"vec4"},{name:"vTranslucencyColorInfos",size:2,type:"vec2"},{name:"translucencyColorMatrix",size:16,type:"mat4"}]}}}M.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE=!1;M.DEFAULT_LEGACY_TRANSLUCENCY=!1;h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"isRefractionEnabled",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"isTranslucencyEnabled",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"isDispersionEnabled",void 0);h([m(),p("_markScenePrePassDirty")],M.prototype,"isScatteringEnabled",void 0);h([m()],M.prototype,"_scatteringDiffusionProfileIndex",void 0);h([m()],M.prototype,"refractionIntensity",void 0);h([m()],M.prototype,"translucencyIntensity",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"useAlbedoToTintRefraction",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"useAlbedoToTintTranslucency",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"thicknessTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"refractionTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"indexOfRefraction",void 0);h([m()],M.prototype,"_volumeIndexOfRefraction",void 0);h([p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"volumeIndexOfRefraction",null);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"invertRefractionY",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"linkRefractionWithTransparency",void 0);h([m()],M.prototype,"minimumThickness",void 0);h([m()],M.prototype,"maximumThickness",void 0);h([m()],M.prototype,"useThicknessAsDepth",void 0);h([oe()],M.prototype,"tintColor",void 0);h([m()],M.prototype,"tintColorAtDistance",void 0);h([m()],M.prototype,"dispersion",void 0);h([oe()],M.prototype,"diffusionDistance",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"useMaskFromThicknessTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"refractionIntensityTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"translucencyIntensityTexture",void 0);h([oe()],M.prototype,"translucencyColor",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"translucencyColorTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],M.prototype,"useGltfStyleTextures",void 0);h([m()],M.prototype,"applyAlbedoAfterSubSurface",void 0);h([m()],M.prototype,"legacyTranslucency",void 0);const we={effect:null,subMesh:null};class fr extends wi(Re){}class cs extends bi(fr){constructor(e){super(e),this.PBR=!0,this.NUM_SAMPLES="0",this.REALTIME_FILTERING=!1,this.IBL_CDF_FILTERING=!1,this.ALBEDO=!1,this.GAMMAALBEDO=!1,this.ALBEDODIRECTUV=0,this.VERTEXCOLOR=!1,this.BASE_WEIGHT=!1,this.BASE_WEIGHTDIRECTUV=0,this.BASE_DIFFUSE_ROUGHNESS=!1,this.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.AMBIENTINGRAYSCALE=!1,this.OPACITY=!1,this.VERTEXALPHA=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHABLEND=!1,this.ALPHAFROMALBEDO=!1,this.ALPHATESTVALUE="0.5",this.SPECULAROVERALPHA=!1,this.RADIANCEOVERALPHA=!1,this.ALPHAFRESNEL=!1,this.LINEARALPHAFRESNEL=!1,this.PREMULTIPLYALPHA=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.GAMMAEMISSIVE=!1,this.REFLECTIVITY=!1,this.REFLECTIVITY_GAMMA=!1,this.REFLECTIVITYDIRECTUV=0,this.SPECULARTERM=!1,this.MICROSURFACEFROMREFLECTIVITYMAP=!1,this.MICROSURFACEAUTOMATIC=!1,this.LODBASEDMICROSFURACE=!1,this.MICROSURFACEMAP=!1,this.MICROSURFACEMAPDIRECTUV=0,this.METALLICWORKFLOW=!1,this.ROUGHNESSSTOREINMETALMAPALPHA=!1,this.ROUGHNESSSTOREINMETALMAPGREEN=!1,this.METALLNESSSTOREINMETALMAPBLUE=!1,this.AOSTOREINMETALMAPRED=!1,this.METALLIC_REFLECTANCE=!1,this.METALLIC_REFLECTANCE_GAMMA=!1,this.METALLIC_REFLECTANCEDIRECTUV=0,this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=!1,this.REFLECTANCE=!1,this.REFLECTANCE_GAMMA=!1,this.REFLECTANCEDIRECTUV=0,this.ENVIRONMENTBRDF=!1,this.ENVIRONMENTBRDF_RGBD=!1,this.NORMAL=!1,this.TANGENT=!1,this.BUMP=!1,this.BUMPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.NORMALXYSCALE=!0,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.USELIGHTMAPASSHADOWMAP=!1,this.GAMMALIGHTMAP=!1,this.RGBDLIGHTMAP=!1,this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.USESPHERICALFROMREFLECTIONMAP=!1,this.USEIRRADIANCEMAP=!1,this.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this.USESPHERICALINVERTEX=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1,this.LINEARSPECULARREFLECTION=!1,this.RADIANCEOCCLUSION=!1,this.HORIZONOCCLUSION=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.NONUNIFORMSCALING=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.USEPHYSICALLIGHTFALLOFF=!1,this.USEGLTFLIGHTFALLOFF=!1,this.TWOSIDEDLIGHTING=!1,this.MIRRORED=!1,this.SHADOWFLOAT=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.LOGARITHMICDEPTH=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.FORCENORMALFORWARD=!1,this.SPECULARAA=!1,this.UNLIT=!1,this.DECAL_AFTER_DETAIL=!1,this.DEBUGMODE=0,this.USE_VERTEX_PULLING=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.rebuild()}reset(){super.reset(),this.ALPHATESTVALUE="0.5",this.PBR=!0,this.NORMALXYSCALE=!0}}class pr extends Ii(Ri){}class P extends pr{get realTimeFiltering(){return this._realTimeFiltering}set realTimeFiltering(e){this._realTimeFiltering=e,this.markAsDirty(1)}get realTimeFilteringQuality(){return this._realTimeFilteringQuality}set realTimeFilteringQuality(e){this._realTimeFilteringQuality=e,this.markAsDirty(1)}get canRenderToMRT(){return!0}constructor(e,t,s=!1){super(e,t,void 0,s||P.ForceGLSL),this._directIntensity=1,this._emissiveIntensity=1,this._environmentIntensity=1,this._specularIntensity=1,this._lightingInfos=new Tt(this._directIntensity,this._emissiveIntensity,this._environmentIntensity,this._specularIntensity),this._disableBumpMap=!1,this._albedoTexture=null,this._baseWeightTexture=null,this._baseDiffuseRoughnessTexture=null,this._ambientTexture=null,this._ambientTextureStrength=1,this._ambientTextureImpactOnAnalyticalLights=P.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._reflectivityTexture=null,this._metallicTexture=null,this._metallic=null,this._roughness=null,this._metallicF0Factor=1,this._metallicReflectanceColor=z.White(),this._useOnlyMetallicFromMetallicReflectanceTexture=!1,this._metallicReflectanceTexture=null,this._reflectanceTexture=null,this._microSurfaceTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._ambientColor=new z(0,0,0),this._albedoColor=new z(1,1,1),this._baseWeight=1,this._baseDiffuseRoughness=null,this._reflectivityColor=new z(1,1,1),this._reflectionColor=new z(1,1,1),this._emissiveColor=new z(0,0,0),this._microSurface=.9,this._useLightmapAsShadowmap=!1,this._useHorizonOcclusion=!0,this._useRadianceOcclusion=!0,this._useAlphaFromAlbedoTexture=!1,this._useSpecularOverAlpha=!0,this._useMicroSurfaceFromReflectivityMapAlpha=!1,this._useRoughnessFromMetallicTextureAlpha=!0,this._useRoughnessFromMetallicTextureGreen=!1,this._useMetallnessFromMetallicTextureBlue=!1,this._useAmbientOcclusionFromMetallicTextureRed=!1,this._useAmbientInGrayScale=!1,this._useAutoMicroSurfaceFromReflectivityMap=!1,this._lightFalloff=P.LIGHTFALLOFF_PHYSICAL,this._useRadianceOverAlpha=!0,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this._parallaxScaleBias=.05,this._disableLighting=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._alphaCutOff=.4,this._useAlphaFresnel=!1,this._useLinearAlphaFresnel=!1,this._environmentBRDFTexture=null,this._forceIrradianceInFragment=!1,this._realTimeFiltering=!1,this._realTimeFilteringQuality=8,this._forceNormalForward=!1,this._enableSpecularAntiAliasing=!1,this._renderTargets=new ms(16),this._globalAmbientColor=new z(0,0,0),this._unlit=!1,this._applyDecalMapAfterDetailMap=!1,this._debugMode=0,this._shadersLoaded=!1,this._breakShaderLoadedCheck=!1,this.debugMode=0,this.debugLimit=-1,this.debugFactor=1,this._cacheHasRenderTargetTextures=!1,this.brdf=new R(this),this.clearCoat=new W(this),this.iridescence=new j(this),this.anisotropy=new Pe(this),this.sheen=new he(this),this.subSurface=new M(this),this.detailMap=new Zs(this),this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>(this._renderTargets.reset(),T.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets),this._environmentBRDFTexture=Dt(this.getScene()),this.prePassConfiguration=new Ht}get hasRenderTargetTextures(){return T.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}get isPrePassCapable(){return!this.disableDepthWrite}getClassName(){return"PBRBaseMaterial"}get _disableAlphaBlending(){return this._transparencyMode===P.PBRMATERIAL_OPAQUE||this._transparencyMode===P.PBRMATERIAL_ALPHATEST||this.subSurface?.disableAlphaBlending}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromAlbedoTexture()}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:this.subSurface?.disableAlphaBlending?!1:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===P.PBRMATERIAL_ALPHATEST)}_shouldUseAlphaFromAlbedoTexture(){return this._albedoTexture!=null&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==P.PBRMATERIAL_OPAQUE}_hasAlphaChannel(){return this._albedoTexture!=null&&this._albedoTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._albedoTexture}isReadyForSubMesh(e,t,s){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const i=t._drawWrapper;if(i.effect&&this.isFrozen&&i._wasPreviouslyReady&&i._wasPreviouslyUsingInstances===s)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new cs(this._eventInfo.defineNames));const r=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const a=this.getScene(),o=a.getEngine();if(r._areTexturesDirty&&(this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,a.texturesEnabled)){if(this._albedoTexture&&T.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking()||this._baseWeightTexture&&T.BaseWeightTextureEnabled&&!this._baseWeightTexture.isReadyOrNotBlocking()||this._baseDiffuseRoughnessTexture&&T.BaseDiffuseRoughnessTextureEnabled&&!this._baseDiffuseRoughnessTexture.isReadyOrNotBlocking()||this._ambientTexture&&T.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking()||this._opacityTexture&&T.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;const E=this._getReflectionTexture();if(E&&T.ReflectionTextureEnabled){if(!E.isReadyOrNotBlocking())return!1;if(E.irradianceTexture){if(!E.irradianceTexture.isReadyOrNotBlocking())return!1}else if(!E.sphericalPolynomial&&E.getInternalTexture()?._sphericalPolynomialPromise)return!1}if(this._lightmapTexture&&T.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking()||this._emissiveTexture&&T.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(T.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._metallicReflectanceTexture&&!this._metallicReflectanceTexture.isReadyOrNotBlocking()||this._reflectanceTexture&&!this._reflectanceTexture.isReadyOrNotBlocking()||this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(o.getCaps().standardDerivatives&&this._bumpTexture&&T.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady()||this._environmentBRDFTexture&&T.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh||r._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;if(r.AREALIGHTUSED||r.CLUSTLIGHT_BATCH){for(let E=0;E<e.lightSources.length;E++)if(!e.lightSources[E]._isReady())return!1}!o.getCaps().standardDerivatives&&!e.isVerticesDataPresent(w.NormalKind)&&(e.createNormals(!0),N.Warn("PBRMaterial: Normals have been created for the mesh: "+e.name));const u=t.effect,l=r._areLightsDisposed,f=this._prepareEffect(e,t.getRenderingMesh(),r,this.onCompiled,this.onError,s,null);let c=!1;if(f)if(this._onEffectCreatedObservable&&(we.effect=f,we.subMesh=t,this._onEffectCreatedObservable.notifyObservers(we)),this.allowShaderHotSwapping&&u&&!f.isReady()){if(r.markAsUnprocessed(),c=this.isFrozen,l)return r._areLightsDisposed=!0,!1}else a.resetCachedMaterial(),t.setEffect(f,r,this._materialContext);return!t.effect||!t.effect.isReady()?!1:(r._renderId=a.getRenderId(),i._wasPreviouslyReady=!c,i._wasPreviouslyUsingInstances=!!s,this._checkScenePerformancePriority(),!0)}isMetallicWorkflow(){return!!(this._metallic!=null||this._roughness!=null||this._metallicTexture)}_prepareEffect(e,t,s,i=null,r=null,a=null,o=null){if(this._prepareDefines(e,t,s,a,o),!s.isDirty)return null;s.markAsProcessed();const l=this.getScene().getEngine(),f=new $s;let c=0;s.USESPHERICALINVERTEX&&f.addFallback(c++,"USESPHERICALINVERTEX"),s.FOG&&f.addFallback(c,"FOG"),s.SPECULARAA&&f.addFallback(c,"SPECULARAA"),s.POINTSIZE&&f.addFallback(c,"POINTSIZE"),s.LOGARITHMICDEPTH&&f.addFallback(c,"LOGARITHMICDEPTH"),s.PARALLAX&&f.addFallback(c,"PARALLAX"),s.PARALLAX_RHS&&f.addFallback(c,"PARALLAX_RHS"),s.PARALLAXOCCLUSION&&f.addFallback(c++,"PARALLAXOCCLUSION"),s.ENVIRONMENTBRDF&&f.addFallback(c++,"ENVIRONMENTBRDF"),s.TANGENT&&f.addFallback(c++,"TANGENT"),s.BUMP&&f.addFallback(c++,"BUMP"),c=ei(s,f,this._maxSimultaneousLights,c),s.SPECULARTERM&&f.addFallback(c++,"SPECULARTERM"),s.USESPHERICALFROMREFLECTIONMAP&&f.addFallback(c++,"USESPHERICALFROMREFLECTIONMAP"),s.USEIRRADIANCEMAP&&f.addFallback(c++,"USEIRRADIANCEMAP"),s.LIGHTMAP&&f.addFallback(c++,"LIGHTMAP"),s.NORMAL&&f.addFallback(c++,"NORMAL"),s.AMBIENT&&f.addFallback(c++,"AMBIENT"),s.EMISSIVE&&f.addFallback(c++,"EMISSIVE"),s.VERTEXCOLOR&&f.addFallback(c++,"VERTEXCOLOR"),s.MORPHTARGETS&&f.addFallback(c++,"MORPHTARGETS"),s.MULTIVIEW&&f.addFallback(0,"MULTIVIEW");const E=[w.PositionKind];s.NORMAL&&E.push(w.NormalKind),s.TANGENT&&E.push(w.TangentKind);for(let V=1;V<=6;++V)s["UV"+V]&&E.push(`uv${V===1?"":V}`);s.VERTEXCOLOR&&E.push(w.ColorKind),ti(E,e,s,f),si(E,s),ii(E,e,s),ni(E,e,s);let C="pbr";const g=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","baseWeight","baseDiffuseRoughness","vReflectivityColor","vMetallicReflectanceFactors","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vBaseWeightInfos","vBaseDiffuseRoughnessInfos","vAmbientInfos","vOpacityInfos","vEmissiveInfos","vReflectivityInfos","vMetallicReflectanceInfos","vReflectanceInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","mBones","albedoMatrix","baseWeightMatrix","baseDiffuseRoughnessMatrix","ambientMatrix","opacityMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","metallicReflectanceMatrix","reflectanceMatrix","vLightingIntensity","logarithmicDepthConstant","vTangentSpaceParams","boneTextureWidth","vDebugMode","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo"],_=["albedoSampler","baseWeightSampler","baseDiffuseRoughnessSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","microSurfaceSampler","environmentBrdfSampler","boneSampler","metallicReflectanceSampler","reflectanceSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];ri(g,_,!0);const x=["Material","Scene","Mesh"],S={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:s.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=f,this._eventInfo.fallbackRank=c,this._eventInfo.defines=s,this._eventInfo.uniforms=g,this._eventInfo.attributes=E,this._eventInfo.samplers=_,this._eventInfo.uniformBuffersNames=x,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=S,this._callbackPluginEventGeneric(128,this._eventInfo),st.AddUniformsAndSamplers(g,_),Ht.AddUniforms(g),ai(g),it&&(it.PrepareUniforms(g,s),it.PrepareSamplers(_,s)),oi({uniformsNames:g,uniformBuffersNames:x,samplers:_,defines:s,maxSimultaneousLights:this._maxSimultaneousLights});const I={};this.customShaderNameResolve&&(C=this.customShaderNameResolve(C,g,x,_,s,E,I));const D=s.toString(),ne=l.createEffect(C,{attributes:E,uniformsNames:g,uniformBuffersNames:x,samplers:_,defines:D,fallbacks:f,onCompiled:i,onError:r,indexParameters:S,processFinalCode:I.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:s.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{this.shaderLanguage===1?await Promise.all([d(()=>import("./pbr.vertex-CNWuYREY.js"),__vite__mapDeps([59,4,60,61,62,63,64,65,66,67,68,69]),import.meta.url),d(()=>import("./pbr.fragment-D4c9Imut.js"),__vite__mapDeps([70,4,71,60,61,63,72,68,73,74]),import.meta.url)]):await Promise.all([d(()=>import("./pbr.vertex-joJmxK7Z.js"),__vite__mapDeps([75,4,76,77,78,79,80,81,82]),import.meta.url),d(()=>import("./pbr.fragment-qKZeRSsL.js"),__vite__mapDeps([83,4,84,77,78,79,81,85,86]),import.meta.url)]),this._shadersLoaded=!0}},l);return this._eventInfo.customCode=void 0,ne}_prepareDefines(e,t,s,i=null,r=null){const a=t.hasThinInstances,o=this.getScene(),u=o.getEngine();ui(o,e,s,!0,this._maxSimultaneousLights,this._disableLighting),s._needNormals=!0,li(o,s);const l=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if(hi(o,s,this.canRenderToMRT&&!l),ci(o,s,l),st.PrepareDefines(u.currentRenderPassId,e,s),s.METALLICWORKFLOW=this.isMetallicWorkflow(),s._areTexturesDirty){s._needUVs=!1;for(let f=1;f<=6;++f)s["MAINUV"+f]=!1;if(o.texturesEnabled){s.ALBEDODIRECTUV=0,s.BASE_WEIGHTDIRECTUV=0,s.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,s.AMBIENTDIRECTUV=0,s.OPACITYDIRECTUV=0,s.EMISSIVEDIRECTUV=0,s.REFLECTIVITYDIRECTUV=0,s.MICROSURFACEMAPDIRECTUV=0,s.METALLIC_REFLECTANCEDIRECTUV=0,s.REFLECTANCEDIRECTUV=0,s.BUMPDIRECTUV=0,s.LIGHTMAPDIRECTUV=0,u.getCaps().textureLOD&&(s.LODBASEDMICROSFURACE=!0),this._albedoTexture&&T.DiffuseTextureEnabled?(O(this._albedoTexture,s,"ALBEDO"),s.GAMMAALBEDO=this._albedoTexture.gammaSpace):s.ALBEDO=!1,this._baseWeightTexture&&T.BaseWeightTextureEnabled?O(this._baseWeightTexture,s,"BASE_WEIGHT"):s.BASE_WEIGHT=!1,this._baseDiffuseRoughnessTexture&&T.BaseDiffuseRoughnessTextureEnabled?O(this._baseDiffuseRoughnessTexture,s,"BASE_DIFFUSE_ROUGHNESS"):s.BASE_DIFFUSE_ROUGHNESS=!1,this._ambientTexture&&T.AmbientTextureEnabled?(O(this._ambientTexture,s,"AMBIENT"),s.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):s.AMBIENT=!1,this._opacityTexture&&T.OpacityTextureEnabled?(O(this._opacityTexture,s,"OPACITY"),s.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):s.OPACITY=!1;const f=this._getReflectionTexture(),c=this._forceIrradianceInFragment||this.realTimeFiltering||this._twoSidedLighting||u.getCaps().maxVaryingVectors<=8||this._baseDiffuseRoughnessTexture!=null;di(o,f,s,this.realTimeFiltering,this.realTimeFilteringQuality,!c),this._lightmapTexture&&T.LightmapTextureEnabled?(O(this._lightmapTexture,s,"LIGHTMAP"),s.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,s.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,s.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):s.LIGHTMAP=!1,this._emissiveTexture&&T.EmissiveTextureEnabled?(O(this._emissiveTexture,s,"EMISSIVE"),s.GAMMAEMISSIVE=this._emissiveTexture.gammaSpace):s.EMISSIVE=!1,T.SpecularTextureEnabled?(this._metallicTexture?(O(this._metallicTexture,s,"REFLECTIVITY"),s.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,s.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,s.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,s.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed,s.REFLECTIVITY_GAMMA=!1):this._reflectivityTexture?(O(this._reflectivityTexture,s,"REFLECTIVITY"),s.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,s.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap,s.REFLECTIVITY_GAMMA=this._reflectivityTexture.gammaSpace):s.REFLECTIVITY=!1,this._metallicReflectanceTexture||this._reflectanceTexture?(s.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=this._useOnlyMetallicFromMetallicReflectanceTexture,this._metallicReflectanceTexture?(O(this._metallicReflectanceTexture,s,"METALLIC_REFLECTANCE"),s.METALLIC_REFLECTANCE_GAMMA=this._metallicReflectanceTexture.gammaSpace):s.METALLIC_REFLECTANCE=!1,this._reflectanceTexture&&(!this._metallicReflectanceTexture||this._metallicReflectanceTexture&&this._useOnlyMetallicFromMetallicReflectanceTexture)?(O(this._reflectanceTexture,s,"REFLECTANCE"),s.REFLECTANCE_GAMMA=this._reflectanceTexture.gammaSpace):s.REFLECTANCE=!1):(s.METALLIC_REFLECTANCE=!1,s.REFLECTANCE=!1),this._microSurfaceTexture?O(this._microSurfaceTexture,s,"MICROSURFACEMAP"):s.MICROSURFACEMAP=!1):(s.REFLECTIVITY=!1,s.MICROSURFACEMAP=!1),u.getCaps().standardDerivatives&&this._bumpTexture&&T.BumpTextureEnabled&&!this._disableBumpMap?(O(this._bumpTexture,s,"BUMP"),this._useParallax&&this._albedoTexture&&T.DiffuseTextureEnabled?(s.PARALLAX=!0,s.PARALLAX_RHS=o.useRightHandedSystem,s.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):s.PARALLAX=!1,s.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):(s.BUMP=!1,s.PARALLAX=!1,s.PARALLAX_RHS=!1,s.PARALLAXOCCLUSION=!1,s.OBJECTSPACE_NORMALMAP=!1),this._environmentBRDFTexture&&T.ReflectionTextureEnabled?(s.ENVIRONMENTBRDF=!0,s.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(s.ENVIRONMENTBRDF=!1,s.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?s.ALPHAFROMALBEDO=!0:s.ALPHAFROMALBEDO=!1}s.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===P.LIGHTFALLOFF_STANDARD?(s.USEPHYSICALLIGHTFALLOFF=!1,s.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===P.LIGHTFALLOFF_GLTF?(s.USEPHYSICALLIGHTFALLOFF=!1,s.USEGLTFLIGHTFALLOFF=!0):(s.USEPHYSICALLIGHTFALLOFF=!0,s.USEGLTFLIGHTFALLOFF=!1),s.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?s.TWOSIDEDLIGHTING=!0:s.TWOSIDEDLIGHTING=!1,s.MIRRORED=!!o._mirroredCameraPosition,s.SPECULARAA=u.getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(s._areTexturesDirty||s._areMiscDirty)&&(s.ALPHATESTVALUE=`${this._alphaCutOff}${this._alphaCutOff%1===0?".":""}`,s.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,s.ALPHABLEND=this.needAlphaBlendingForMesh(e),s.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,s.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),s._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(s),s.FORCENORMALFORWARD=this._forceNormalForward,s.RADIANCEOCCLUSION=this._useRadianceOcclusion,s.HORIZONOCCLUSION=this._useHorizonOcclusion,s._areMiscDirty&&(_i(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),s,this._applyDecalMapAfterDetailMap,this._useVertexPulling,t,this._isVertexOutputInvariant),s.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(w.NormalKind),s.DEBUGMODE=this._debugMode),fi(o,u,this,s,!!i,r,a),this._eventInfo.defines=s,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),pi(e,s,!0,!0,!0,this._transparencyMode!==P.PBRMATERIAL_OPAQUE),this._callbackPluginEventPrepareDefines(this._eventInfo)}forceCompilation(e,t,s){const i={clipPlane:!1,useInstances:!1,...s};this._uniformBufferLayoutBuilt||this.buildUniformLayout(),this._callbackPluginEventGeneric(4,this._eventInfo),(()=>{if(this._breakShaderLoadedCheck)return;const a=new cs(this._eventInfo.defineNames),o=this._prepareEffect(e,e,a,void 0,void 0,i.useInstances,i.clipPlane);this._onEffectCreatedObservable&&(we.effect=o,we.subMesh=null,this._onEffectCreatedObservable.notifyObservers(we)),o.isReady()?t&&t(this):o.onCompileObservable.add(()=>{t&&t(this)})})()}buildUniformLayout(){const e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vBaseWeightInfos",2),e.addUniform("vBaseDiffuseRoughnessInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("baseWeightMatrix",16),e.addUniform("baseDiffuseRoughnessMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("vAlbedoColor",4),e.addUniform("baseWeight",1),e.addUniform("baseDiffuseRoughness",1),e.addUniform("vLightingIntensity",4),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vAmbientColor",3),e.addUniform("vDebugMode",2),e.addUniform("vMetallicReflectanceFactors",4),e.addUniform("vMetallicReflectanceInfos",2),e.addUniform("metallicReflectanceMatrix",16),e.addUniform("vReflectanceInfos",2),e.addUniform("reflectanceMatrix",16),e.addUniform("cameraInfo",4),mi(e,!0,!0,!0,!0,!0),super.buildUniformLayout()}bindForSubMesh(e,t,s){const i=this.getScene(),r=s.materialDefines;if(!r)return;const a=s.effect;if(!a)return;this._activeEffect=a,t.getMeshUniformBuffer().bindToEffect(a,"Mesh"),t.transferToEffect(e);const o=i.getEngine();this._uniformBuffer.bindToEffect(a,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,i,t,e,this.isFrozen),st.Bind(o.currentRenderPassId,this._activeEffect,t,e,this);const u=i.activeCamera;u?this._uniformBuffer.updateFloat4("cameraInfo",u.minZ,u.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0),this._eventInfo.subMesh=s,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),r.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const l=this._mustRebind(i,a,s,t.visibility);Ti(t,this._activeEffect,this.prePassConfiguration);let f=null;const c=this._uniformBuffer;if(l){if(this.bindViewProjection(a),f=this._getReflectionTexture(),!c.useUbo||!this.isFrozen||!c.isSync||s._drawWrapper._forceRebindOnNextCall){if(i.texturesEnabled&&(this._albedoTexture&&T.DiffuseTextureEnabled&&(c.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),L(this._albedoTexture,c,"albedo")),this._baseWeightTexture&&T.BaseWeightTextureEnabled&&(c.updateFloat2("vBaseWeightInfos",this._baseWeightTexture.coordinatesIndex,this._baseWeightTexture.level),L(this._baseWeightTexture,c,"baseWeight")),this._baseDiffuseRoughnessTexture&&T.BaseDiffuseRoughnessTextureEnabled&&(c.updateFloat2("vBaseDiffuseRoughnessInfos",this._baseDiffuseRoughnessTexture.coordinatesIndex,this._baseDiffuseRoughnessTexture.level),L(this._baseDiffuseRoughnessTexture,c,"baseDiffuseRoughness")),this._ambientTexture&&T.AmbientTextureEnabled&&(c.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),L(this._ambientTexture,c,"ambient")),this._opacityTexture&&T.OpacityTextureEnabled&&(c.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),L(this._opacityTexture,c,"opacity")),this._emissiveTexture&&T.EmissiveTextureEnabled&&(c.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),L(this._emissiveTexture,c,"emissive")),this._lightmapTexture&&T.LightmapTextureEnabled&&(c.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),L(this._lightmapTexture,c,"lightmap")),T.SpecularTextureEnabled&&(this._metallicTexture?(c.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),L(this._metallicTexture,c,"reflectivity")):this._reflectivityTexture&&(c.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),L(this._reflectivityTexture,c,"reflectivity")),this._metallicReflectanceTexture&&(c.updateFloat2("vMetallicReflectanceInfos",this._metallicReflectanceTexture.coordinatesIndex,this._metallicReflectanceTexture.level),L(this._metallicReflectanceTexture,c,"metallicReflectance")),this._reflectanceTexture&&r.REFLECTANCE&&(c.updateFloat2("vReflectanceInfos",this._reflectanceTexture.coordinatesIndex,this._reflectanceTexture.level),L(this._reflectanceTexture,c,"reflectance")),this._microSurfaceTexture&&(c.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),L(this._microSurfaceTexture,c,"microSurfaceSampler"))),this._bumpTexture&&o.getCaps().standardDerivatives&&T.BumpTextureEnabled&&!this._disableBumpMap&&(c.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),L(this._bumpTexture,c,"bump"),i._mirroredCameraPosition?c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):c.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),gi(i,r,c,this._reflectionColor,f,this.realTimeFiltering,!0,!0,!0,!0,!0)),this.pointsCloud&&c.updateFloat("pointSize",this.pointSize),r.METALLICWORKFLOW){Ne.Color4[0].r=this._metallic===void 0||this._metallic===null?1:this._metallic,Ne.Color4[0].g=this._roughness===void 0||this._roughness===null?1:this._roughness;const E=this.subSurface?._indexOfRefraction??1.5,C=1;Ne.Color4[0].b=E;const g=Math.pow((E-C)/(E+C),2);Ne.Color4[0].a=g,c.updateDirectColor4("vReflectivityColor",Ne.Color4[0]),c.updateColor4("vMetallicReflectanceFactors",this._metallicReflectanceColor,this._metallicF0Factor)}else c.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);c.updateColor3("vEmissiveColor",T.EmissiveTextureEnabled?this._emissiveColor:z.BlackReadOnly),!r.SS_REFRACTION&&this.subSurface?._linkRefractionWithTransparency?c.updateColor4("vAlbedoColor",this._albedoColor,1):c.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),c.updateFloat("baseWeight",this._baseWeight),c.updateFloat("baseDiffuseRoughness",this._baseDiffuseRoughness||0),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*i.environmentIntensity,this._lightingInfos.w=this._specularIntensity,c.updateVector4("vLightingIntensity",this._lightingInfos),i.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor),c.updateColor3("vAmbientColor",this._globalAmbientColor),c.updateFloat2("vDebugMode",this.debugLimit,this.debugFactor)}i.texturesEnabled&&(this._albedoTexture&&T.DiffuseTextureEnabled&&c.setTexture("albedoSampler",this._albedoTexture),this._baseWeightTexture&&T.BaseWeightTextureEnabled&&c.setTexture("baseWeightSampler",this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&T.BaseDiffuseRoughnessTextureEnabled&&c.setTexture("baseDiffuseRoughnessSampler",this._baseDiffuseRoughnessTexture),this._ambientTexture&&T.AmbientTextureEnabled&&c.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&T.OpacityTextureEnabled&&c.setTexture("opacitySampler",this._opacityTexture),Ai(i,r,c,f,this.realTimeFiltering),r.ENVIRONMENTBRDF&&c.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&T.EmissiveTextureEnabled&&c.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&T.LightmapTextureEnabled&&c.setTexture("lightmapSampler",this._lightmapTexture),T.SpecularTextureEnabled&&(this._metallicTexture?c.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&c.setTexture("reflectivitySampler",this._reflectivityTexture),this._metallicReflectanceTexture&&c.setTexture("metallicReflectanceSampler",this._metallicReflectanceTexture),this._reflectanceTexture&&r.REFLECTANCE&&c.setTexture("reflectanceSampler",this._reflectanceTexture),this._microSurfaceTexture&&c.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&o.getCaps().standardDerivatives&&T.BumpTextureEnabled&&!this._disableBumpMap&&c.setTexture("bumpSampler",this._bumpTexture)),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(a),this._eventInfo.subMesh=s,this._callbackPluginEventBindForSubMesh(this._eventInfo),Ei(this._activeEffect,this,i),this.bindEyePosition(a)}else i.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(l||!this.isFrozen)&&(i.lightsEnabled&&!this._disableLighting&&xi(i,t,this._activeEffect,r,this._maxSimultaneousLights),(i.fogEnabled&&t.applyFog&&i.fogMode!==xe.FOGMODE_NONE||f||this.subSurface.refractionTexture||t.receiveShadows||r.PREPASS||r.CLUSTLIGHT_BATCH)&&this.bindView(a),yi(i,t,this._activeEffect,!0),r.NUM_MORPH_INFLUENCERS&&Si(t,this._activeEffect),r.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(a,r.INSTANCES),this._imageProcessingConfiguration.bind(this._activeEffect),Ci(r,this._activeEffect,i)),this._afterBind(t,this._activeEffect,s),c.update()}getAnimatables(){const e=super.getAnimatables();return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._baseWeightTexture&&this._baseWeightTexture.animations&&this._baseWeightTexture.animations.length>0&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&this._baseDiffuseRoughnessTexture.animations&&this._baseDiffuseRoughnessTexture.animations.length>0&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._metallicReflectanceTexture&&this._metallicReflectanceTexture.animations&&this._metallicReflectanceTexture.animations.length>0&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&this._reflectanceTexture.animations&&this._reflectanceTexture.animations.length>0&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&this._microSurfaceTexture.animations&&this._microSurfaceTexture.animations.length>0&&e.push(this._microSurfaceTexture),e}_getReflectionTexture(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture}getActiveTextures(){const e=super.getActiveTextures();return this._albedoTexture&&e.push(this._albedoTexture),this._baseWeightTexture&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._reflectivityTexture&&e.push(this._reflectivityTexture),this._metallicTexture&&e.push(this._metallicTexture),this._metallicReflectanceTexture&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&e.push(this._microSurfaceTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),e}hasTexture(e){return!!(super.hasTexture(e)||this._albedoTexture===e||this._baseWeightTexture===e||this._baseDiffuseRoughnessTexture===e||this._ambientTexture===e||this._opacityTexture===e||this._reflectionTexture===e||this._emissiveTexture===e||this._reflectivityTexture===e||this._metallicTexture===e||this._metallicReflectanceTexture===e||this._reflectanceTexture===e||this._microSurfaceTexture===e||this._bumpTexture===e||this._lightmapTexture===e)}setPrePassRenderer(){if(!this.subSurface?.isScatteringEnabled)return!1;const e=this.getScene().enableSubSurfaceForPrePass();return e&&(e.enabled=!0),!0}dispose(e,t){this._breakShaderLoadedCheck=!0,t&&(this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._albedoTexture?.dispose(),this._baseWeightTexture?.dispose(),this._baseDiffuseRoughnessTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._metallicTexture?.dispose(),this._reflectivityTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._metallicReflectanceTexture?.dispose(),this._reflectanceTexture?.dispose(),this._microSurfaceTexture?.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}}P.PBRMATERIAL_OPAQUE=ke.MATERIAL_OPAQUE;P.PBRMATERIAL_ALPHATEST=ke.MATERIAL_ALPHATEST;P.PBRMATERIAL_ALPHABLEND=ke.MATERIAL_ALPHABLEND;P.PBRMATERIAL_ALPHATESTANDBLEND=ke.MATERIAL_ALPHATESTANDBLEND;P.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0;P.LIGHTFALLOFF_PHYSICAL=0;P.LIGHTFALLOFF_GLTF=1;P.LIGHTFALLOFF_STANDARD=2;P.ForceGLSL=!1;h([p("_markAllSubMeshesAsMiscDirty")],P.prototype,"debugMode",void 0);class A extends P{get refractionTexture(){return this.subSurface.refractionTexture}set refractionTexture(e){this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)}get indexOfRefraction(){return this.subSurface.indexOfRefraction}set indexOfRefraction(e){this.subSurface.indexOfRefraction=e}get invertRefractionY(){return this.subSurface.invertRefractionY}set invertRefractionY(e){this.subSurface.invertRefractionY=e}get linkRefractionWithTransparency(){return this.subSurface.linkRefractionWithTransparency}set linkRefractionWithTransparency(e){this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)}get usePhysicalLightFalloff(){return this._lightFalloff===P.LIGHTFALLOFF_PHYSICAL}set usePhysicalLightFalloff(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=P.LIGHTFALLOFF_PHYSICAL:this._lightFalloff=P.LIGHTFALLOFF_STANDARD)}get useGLTFLightFalloff(){return this._lightFalloff===P.LIGHTFALLOFF_GLTF}set useGLTFLightFalloff(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=P.LIGHTFALLOFF_GLTF:this._lightFalloff=P.LIGHTFALLOFF_STANDARD)}constructor(e,t,s=!1){super(e,t,s),this.directIntensity=1,this.emissiveIntensity=1,this.environmentIntensity=1,this.specularIntensity=1,this.disableBumpMap=!1,this.ambientTextureStrength=1,this.ambientTextureImpactOnAnalyticalLights=A.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this.metallicF0Factor=1,this.metallicReflectanceColor=z.White(),this.useOnlyMetallicFromMetallicReflectanceTexture=!1,this.ambientColor=new z(0,0,0),this.albedoColor=new z(1,1,1),this.baseWeight=1,this.reflectivityColor=new z(1,1,1),this.reflectionColor=new z(1,1,1),this.emissiveColor=new z(0,0,0),this.microSurface=1,this.useLightmapAsShadowmap=!1,this.useAlphaFromAlbedoTexture=!1,this.forceAlphaTest=!1,this.alphaCutOff=.4,this.useSpecularOverAlpha=!0,this.useMicroSurfaceFromReflectivityMapAlpha=!1,this.useRoughnessFromMetallicTextureAlpha=!0,this.useRoughnessFromMetallicTextureGreen=!1,this.useMetallnessFromMetallicTextureBlue=!1,this.useAmbientOcclusionFromMetallicTextureRed=!1,this.useAmbientInGrayScale=!1,this.useAutoMicroSurfaceFromReflectivityMap=!1,this.useRadianceOverAlpha=!0,this.useObjectSpaceNormalMap=!1,this.useParallax=!1,this.useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this.disableLighting=!1,this.forceIrradianceInFragment=!1,this.maxSimultaneousLights=4,this.invertNormalMapX=!1,this.invertNormalMapY=!1,this.twoSidedLighting=!1,this.useAlphaFresnel=!1,this.useLinearAlphaFresnel=!1,this.environmentBRDFTexture=null,this.forceNormalForward=!1,this.enableSpecularAntiAliasing=!1,this.useHorizonOcclusion=!0,this.useRadianceOcclusion=!0,this.unlit=!1,this.applyDecalMapAfterDetailMap=!1,this._environmentBRDFTexture=Dt(this.getScene())}getClassName(){return"PBRMaterial"}clone(e,t=!0,s=""){const i=Le.Clone(()=>new A(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return i.id=e,i.name=e,this.stencil.copyTo(i.stencil),this._clonePlugins(i,s),i}serialize(){const e=super.serialize();return e.customType="BABYLON.PBRMaterial",e}static Parse(e,t,s){const i=Le.Parse(()=>new A(e.name,t),e,t,s);return e.stencil&&i.stencil.parse(e.stencil,t,s),ke._ParsePlugins(e,i,t,s),e.clearCoat&&i.clearCoat.parse(e.clearCoat,t,s),e.anisotropy&&i.anisotropy.parse(e.anisotropy,t,s),e.brdf&&i.brdf.parse(e.brdf,t,s),e.sheen&&i.sheen.parse(e.sheen,t,s),e.subSurface&&i.subSurface.parse(e.subSurface,t,s),e.iridescence&&i.iridescence.parse(e.iridescence,t,s),i}}A.PBRMATERIAL_OPAQUE=P.PBRMATERIAL_OPAQUE;A.PBRMATERIAL_ALPHATEST=P.PBRMATERIAL_ALPHATEST;A.PBRMATERIAL_ALPHABLEND=P.PBRMATERIAL_ALPHABLEND;A.PBRMATERIAL_ALPHATESTANDBLEND=P.PBRMATERIAL_ALPHATESTANDBLEND;A.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=P.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"directIntensity",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"emissiveIntensity",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"environmentIntensity",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"specularIntensity",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"disableBumpMap",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"albedoTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"baseWeightTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"baseDiffuseRoughnessTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"ambientTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"ambientTextureStrength",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"ambientTextureImpactOnAnalyticalLights",void 0);h([F(),p("_markAllSubMeshesAsTexturesAndMiscDirty")],A.prototype,"opacityTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"reflectionTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"emissiveTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"reflectivityTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"metallicTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"metallic",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"roughness",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"metallicF0Factor",void 0);h([oe(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"metallicReflectanceColor",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useOnlyMetallicFromMetallicReflectanceTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"metallicReflectanceTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"reflectanceTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"microSurfaceTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"bumpTexture",void 0);h([F(),p("_markAllSubMeshesAsTexturesDirty",null)],A.prototype,"lightmapTexture",void 0);h([oe("ambient"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"ambientColor",void 0);h([oe("albedo"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"albedoColor",void 0);h([m("baseWeight"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"baseWeight",void 0);h([m("baseDiffuseRoughness"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"baseDiffuseRoughness",void 0);h([oe("reflectivity"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"reflectivityColor",void 0);h([oe("reflection"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"reflectionColor",void 0);h([oe("emissive"),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"emissiveColor",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"microSurface",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useLightmapAsShadowmap",void 0);h([m(),p("_markAllSubMeshesAsTexturesAndMiscDirty")],A.prototype,"useAlphaFromAlbedoTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesAndMiscDirty")],A.prototype,"forceAlphaTest",void 0);h([m(),p("_markAllSubMeshesAsTexturesAndMiscDirty")],A.prototype,"alphaCutOff",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useSpecularOverAlpha",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useRoughnessFromMetallicTextureAlpha",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useRoughnessFromMetallicTextureGreen",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useMetallnessFromMetallicTextureBlue",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useAmbientInGrayScale",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0);h([m()],A.prototype,"usePhysicalLightFalloff",null);h([m()],A.prototype,"useGLTFLightFalloff",null);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useRadianceOverAlpha",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useObjectSpaceNormalMap",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useParallax",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useParallaxOcclusion",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"parallaxScaleBias",void 0);h([m(),p("_markAllSubMeshesAsLightsDirty")],A.prototype,"disableLighting",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"forceIrradianceInFragment",void 0);h([m(),p("_markAllSubMeshesAsLightsDirty")],A.prototype,"maxSimultaneousLights",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"invertNormalMapX",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"invertNormalMapY",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"twoSidedLighting",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useAlphaFresnel",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useLinearAlphaFresnel",void 0);h([p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"environmentBRDFTexture",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"forceNormalForward",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"enableSpecularAntiAliasing",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useHorizonOcclusion",void 0);h([m(),p("_markAllSubMeshesAsTexturesDirty")],A.prototype,"useRadianceOcclusion",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],A.prototype,"unlit",void 0);h([m(),p("_markAllSubMeshesAsMiscDirty")],A.prototype,"applyDecalMapAfterDetailMap",void 0);Ee("BABYLON.PBRMaterial",A);const ea=Object.freeze(Object.defineProperty({__proto__:null,PBRMaterial:A},Symbol.toStringTag,{value:"Module"}));Ke.AddNodeConstructor("Light_Type_0",(n,e)=>()=>new vt(n,y.Zero(),e));class vt extends ps{get shadowAngle(){return this._shadowAngle}set shadowAngle(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(e){const t=this.needCube();if(this._direction=e,this.needCube()!==t&&this._shadowGenerators){const s=this._shadowGenerators.values();for(let i=s.next();i.done!==!0;i=s.next())i.value.recreateShadowMap()}}constructor(e,t,s,i){super(e,s,i),this._shadowAngle=Math.PI/2,this.position=t}getClassName(){return"PointLight"}getTypeID(){return Me.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(e){if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new y(1,0,0);case 1:return new y(-1,0,0);case 2:return new y(0,-1,0);case 3:return new y(0,1,0);case 4:return new y(0,0,1);case 5:return new y(0,0,-1)}return y.Zero()}_setDefaultShadowProjectionMatrix(e,t,s){const i=this.getScene().activeCamera,r=this.getDepthMinZ(i),a=this.getDepthMaxZ(i),o=this.getScene().getEngine().useReverseDepthBuffer;b.PerspectiveFovLHToRef(this.shadowAngle,1,o?a:r,o?r:a,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,o)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,t){const s=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-s.x,this.transformedPosition.y-s.y,this.transformedPosition.z-s.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x-s.x,this.position.y-s.y,this.position.z-s.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this}transferToNodeMaterialEffect(e,t){const s=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x-s.x,this.transformedPosition.y-s.y,this.transformedPosition.z-s.z):e.setFloat3(t,this.position.x-s.x,this.position.y-s.y,this.position.z-s.z),this}prepareLightSpecificDefines(e,t){e["POINTLIGHT"+t]=!0}}h([m()],vt.prototype,"shadowAngle",null);Ee("BABYLON.PointLight",vt);async function mr(){const n=new Uint16Array(16384),e=new Uint16Array(64*64*4),t=await q.LoadFileAsync(q.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin")),s=new Uint16Array(t),i=s.length/8;for(let r=0;r<i;r++)n[r*4]=s[r*8],n[r*4+1]=s[r*8+1],n[r*4+2]=s[r*8+2],n[r*4+3]=s[r*8+3],e[r*4]=s[r*8+4],e[r*4+1]=s[r*8+5],e[r*4+2]=s[r*8+6],e[r*4+3]=s[r*8+7];return[n,e]}function Tr(n){const e=n.useDelayedTextureLoading;n.useDelayedTextureLoading=!1;const t=n._blockEntityCollection;n._blockEntityCollection=!1,n._ltcTextures={LTC1:ee.CreateRGBATexture(null,64,64,n.getEngine(),!1,!1,2,2,0,!1,!0),LTC2:ee.CreateRGBATexture(null,64,64,n.getEngine(),!1,!1,2,2,0,!1,!0)},n._blockEntityCollection=t,n._ltcTextures.LTC1.wrapU=X.CLAMP_ADDRESSMODE,n._ltcTextures.LTC1.wrapV=X.CLAMP_ADDRESSMODE,n._ltcTextures.LTC2.wrapU=X.CLAMP_ADDRESSMODE,n._ltcTextures.LTC2.wrapV=X.CLAMP_ADDRESSMODE,n.useDelayedTextureLoading=e,mr().then(s=>{n._ltcTextures&&((n._ltcTextures?.LTC1).update(s[0]),(n._ltcTextures?.LTC2).update(s[1]),n.onDisposeObservable.addOnce(()=>{n._ltcTextures?.LTC1.dispose(),n._ltcTextures?.LTC2.dispose()}))}).catch(s=>{N.Error(`Area Light fail to get LTC textures data. Error: ${s}`)})}class gr extends Me{constructor(e,t,s,i){super(e,s,i),this.position=t,this._scene._ltcTextures||Tr(this._scene)}transferTexturesToEffect(e,t){return this._scene._ltcTextures&&(e.setTexture("areaLightsLTC1Sampler",this._scene._ltcTextures.LTC1),e.setTexture("areaLightsLTC2Sampler",this._scene._ltcTextures.LTC2)),this}prepareLightSpecificDefines(e,t){e["AREALIGHT"+t]=!0,e.AREALIGHTUSED=!0}_isReady(){return this._scene._ltcTextures?this._scene._ltcTextures.LTC1.isReady()&&this._scene._ltcTextures.LTC2.isReady():!1}}Ke.AddNodeConstructor("Light_Type_4",(n,e)=>()=>new Be(n,y.Zero(),1,1,e));class Be extends gr{get emissionTexture(){return this._emissionTextureTexture}set emissionTexture(e){this._emissionTextureTexture!==e&&(this._emissionTextureTexture=e,this._emissionTextureTexture&&(this._emissionTextureTexture.wrapU=0,this._emissionTextureTexture.wrapV=0),this._emissionTextureTexture&&Be._IsTexture(this._emissionTextureTexture)&&this._emissionTextureTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()}))}get width(){return this._width.x}set width(e){this._width.x=e}get height(){return this._height.y}set height(e){this._height.y=e}constructor(e,t,s,i,r,a){super(e,t,r,a),this._emissionTextureTexture=null,this._width=new y(s,0,0),this._height=new y(0,i,0),this._pointTransformedPosition=y.Zero(),this._pointTransformedWidth=y.Zero(),this._pointTransformedHeight=y.Zero()}getClassName(){return"RectAreaLight"}getTypeID(){return Me.LIGHTTYPEID_RECT_AREALIGHT}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightWidth",4),this._uniformBuffer.addUniform("vLightHeight",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(y.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this._pointTransformedPosition),y.TransformNormalToRef(this._width,this.parent.getWorldMatrix(),this._pointTransformedWidth),y.TransformNormalToRef(this._height,this.parent.getWorldMatrix(),this._pointTransformedHeight),!0):!1}static _IsTexture(e){return e.onLoadObservable!==void 0}transferToEffect(e,t){const s=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this._pointTransformedPosition.x-s.x,this._pointTransformedPosition.y-s.y,this._pointTransformedPosition.z-s.z,0,t),this._uniformBuffer.updateFloat4("vLightWidth",this._pointTransformedWidth.x/2,this._pointTransformedWidth.y/2,this._pointTransformedWidth.z/2,0,t),this._uniformBuffer.updateFloat4("vLightHeight",this._pointTransformedHeight.x/2,this._pointTransformedHeight.y/2,this._pointTransformedHeight.z/2,0,t)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-s.x,this.position.y-s.y,this.position.z-s.z,0,t),this._uniformBuffer.updateFloat4("vLightWidth",this._width.x/2,this._width.y/2,this._width.z/2,0,t),this._uniformBuffer.updateFloat4("vLightHeight",this._height.x/2,this._height.y/2,this._height.z/2,0,t)),this}transferTexturesToEffect(e,t){return super.transferTexturesToEffect(e,t),this._emissionTextureTexture&&this._emissionTextureTexture.isReady()&&e.setTexture("rectAreaLightEmissionTexture"+t,this._emissionTextureTexture),this}transferToNodeMaterialEffect(e,t){const s=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?e.setFloat3(t,this._pointTransformedPosition.x-s.x,this._pointTransformedPosition.y-s.y,this._pointTransformedPosition.z-s.z):e.setFloat3(t,this.position.x-s.x,this.position.y-s.y,this.position.z-s.z),this}prepareLightSpecificDefines(e,t){super.prepareLightSpecificDefines(e,t),e["RECTAREALIGHTEMISSIONTEXTURE"+t]=!!(this._emissionTextureTexture&&this._emissionTextureTexture.isReady())}}h([m()],Be.prototype,"width",null);h([m()],Be.prototype,"height",null);Ee("BABYLON.RectAreaLight",Be);Y.prototype.thinInstanceAdd=function(n,e=!0){if(!this.getScene().getEngine().getCaps().instancedArrays)return N.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(n)?n.length:1);const t=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(n))for(let s=0;s<n.length;++s)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,n[s],s===n.length-1&&e);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,n,e);return t};Y.prototype.thinInstanceAddSelf=function(n=!0){return this.thinInstanceAdd(b.IdentityReadOnly,n)};Y.prototype.thinInstanceRegisterAttribute=function(n,e){n===w.ColorKind&&(n=w.ColorInstanceKind),this.removeVerticesData(n),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[n]=e,this._userThinInstanceBuffersStorage.sizes[n]=e*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[n]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[n]),this._userThinInstanceBuffersStorage.vertexBuffers[n]=new w(this.getEngine(),this._userThinInstanceBuffersStorage.data[n],n,!0,!1,e,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[n])};Y.prototype.thinInstanceSetMatrixAt=function(n,e,t=!0){if(!this._thinInstanceDataStorage.matrixData||n>=this._thinInstanceDataStorage.instancesCount)return!1;const s=this._thinInstanceDataStorage.matrixData;return e.copyToArray(s,n*16),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[n]=e),t&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0};Y.prototype.thinInstanceSetAttributeAt=function(n,e,t,s=!0){return n===w.ColorKind&&(n=w.ColorInstanceKind),!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[n]||e>=this._thinInstanceDataStorage.instancesCount?!1:(this._thinInstanceUpdateBufferSize(n,0),this._userThinInstanceBuffersStorage.data[n].set(t,e*this._userThinInstanceBuffersStorage.strides[n]),s&&this.thinInstanceBufferUpdated(n),!0)};Object.defineProperty(Y.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(n){const e=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData,t=e?e.length/16:0;n<=t&&(this._thinInstanceDataStorage.instancesCount=n)},enumerable:!0,configurable:!0});Y.prototype._thinInstanceCreateMatrixBuffer=function(n,e,t=!0){const s=new Ts(this.getEngine(),e,!t,16,!1,!0);for(let i=0;i<4;i++)this.setVerticesBuffer(s.createVertexBuffer(n+i,i*4,4));return s};Y.prototype.thinInstanceSetBuffer=function(n,e,t=0,s=!0){if(t=t||16,n==="matrix")this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*t,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,e!==null?(this._thinInstanceDataStorage.instancesCount=e.length/t,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,s),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo());else if(n==="previousMatrix")this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,e!==null&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,s));else if(n==="splatIndex"&&e){this._thinInstanceInitializeUserStorage(),this._thinInstanceDataStorage.instancesCount=e.length/t,this._userThinInstanceBuffersStorage.data[n]=e,this._userThinInstanceBuffersStorage.strides[n]=t,this._userThinInstanceBuffersStorage.sizes[n]=e.length;const i=new Ts(this.getEngine(),e,!0,16,!1,!0);this._thinInstanceDataStorage.matrixBuffer=i;for(let r=0;r<4;r++)this.setVerticesBuffer(i.createVertexBuffer(n+r,r*4,4))}else n===w.ColorKind&&(n=w.ColorInstanceKind),e===null?this._userThinInstanceBuffersStorage?.data[n]&&(this.removeVerticesData(n),delete this._userThinInstanceBuffersStorage.data[n],delete this._userThinInstanceBuffersStorage.strides[n],delete this._userThinInstanceBuffersStorage.sizes[n],delete this._userThinInstanceBuffersStorage.vertexBuffers[n]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[n]=e,this._userThinInstanceBuffersStorage.strides[n]=t,this._userThinInstanceBuffersStorage.sizes[n]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[n]=new w(this.getEngine(),e,n,!s,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[n]))};Y.prototype.thinInstanceBufferUpdated=function(n){n==="matrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(n),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):n==="previousMatrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(n),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):n==="splatIndex"?this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._userThinInstanceBuffersStorage.data[n],0,this._thinInstanceDataStorage.instancesCount):(n===w.ColorKind&&(n=w.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[n]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[n].isUpdatable()&&this._thinInstanceRecreateBuffer(n),this._userThinInstanceBuffersStorage.vertexBuffers[n].updateDirectly(this._userThinInstanceBuffersStorage.data[n],0)))};Y.prototype.thinInstancePartialBufferUpdate=function(n,e,t){if(n==="matrix")this._thinInstanceDataStorage.matrixBuffer&&(typeof e=="number"?this._thinInstanceDataStorage.matrixBuffer.updateDirectly(new Float32Array(this._thinInstanceDataStorage.matrixData.buffer,this._thinInstanceDataStorage.matrixData.byteOffset+t*16*Float32Array.BYTES_PER_ELEMENT,e*16),t*16):this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,t));else if(n===w.ColorKind&&(n=w.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[n]){const s=this._userThinInstanceBuffersStorage.vertexBuffers[n];if(typeof e=="number"){const i=new Float32Array(this._userThinInstanceBuffersStorage.data[n].buffer,this._userThinInstanceBuffersStorage.data[n].byteOffset+t*this._userThinInstanceBuffersStorage.strides[n]*Float32Array.BYTES_PER_ELEMENT,e*this._userThinInstanceBuffersStorage.strides[n]);this._userThinInstanceBuffersStorage.vertexBuffers[n].updateDirectly(i,t*this._userThinInstanceBuffersStorage.strides[n])}else s.updateDirectly(e,t)}};Y.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const n=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let e=0;e<this._thinInstanceDataStorage.instancesCount;++e)this._thinInstanceDataStorage.worldMatrices[e]=b.FromArray(n,e*16)}return this._thinInstanceDataStorage.worldMatrices};Y.prototype.thinInstanceRefreshBoundingInfo=function(n=!1,e=!1,t=!1){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return;const s=this._thinInstanceDataStorage.boundingVectors;if(n||!this.rawBoundingInfo){s.length=0,this.refreshBoundingInfo(e,t);const a=this.getBoundingInfo();this.rawBoundingInfo=new Mi(a.minimum,a.maximum)}const i=this.getBoundingInfo(),r=this._thinInstanceDataStorage.matrixData;if(s.length===0)for(let a=0;a<i.boundingBox.vectors.length;++a)s.push(i.boundingBox.vectors[a].clone());H.Vector3[0].setAll(Number.POSITIVE_INFINITY),H.Vector3[1].setAll(Number.NEGATIVE_INFINITY);for(let a=0;a<this._thinInstanceDataStorage.instancesCount;++a){b.FromArrayToRef(r,a*16,H.Matrix[0]);for(let o=0;o<s.length;++o)y.TransformCoordinatesToRef(s[o],H.Matrix[0],H.Vector3[2]),H.Vector3[0].minimizeInPlace(H.Vector3[2]),H.Vector3[1].maximizeInPlace(H.Vector3[2])}i.reConstruct(H.Vector3[0],H.Vector3[1]),this._updateBoundingInfo()};Y.prototype._thinInstanceRecreateBuffer=function(n,e=!0){n==="matrix"?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",this._thinInstanceDataStorage.matrixData,e)):n==="previousMatrix"?this._scene.needsPreviousWorldMatrices&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.previousMatrixData??this._thinInstanceDataStorage.matrixData,e)):(n===w.ColorKind&&(n=w.ColorInstanceKind),this._userThinInstanceBuffersStorage.vertexBuffers[n]?.dispose(),this._userThinInstanceBuffersStorage.vertexBuffers[n]=new w(this.getEngine(),this._userThinInstanceBuffersStorage.data[n],n,!e,!1,this._userThinInstanceBuffersStorage.strides[n],!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[n]))};Y.prototype._thinInstanceUpdateBufferSize=function(n,e=1){n===w.ColorKind&&(n=w.ColorInstanceKind);const t=n==="matrix";if(!t&&(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.strides[n]))return;const s=t?16:this._userThinInstanceBuffersStorage.strides[n],i=t?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[n];let r=t?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[n];const a=(this._thinInstanceDataStorage.instancesCount+e)*s;let o=i;for(;o<a;)o*=2;if(!r||i!=o){if(!r)r=new Float32Array(o);else{const u=new Float32Array(o);u.set(r,0),r=u}t?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",r,!1),this._thinInstanceDataStorage.matrixData=r,this._thinInstanceDataStorage.matrixBufferSize=o,this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",r,!1))):(this._userThinInstanceBuffersStorage.vertexBuffers[n]?.dispose(),this._userThinInstanceBuffersStorage.data[n]=r,this._userThinInstanceBuffersStorage.sizes[n]=o,this._userThinInstanceBuffersStorage.vertexBuffers[n]=new w(this.getEngine(),r,n,!0,!1,s,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[n]))}};Y.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})};Y.prototype._disposeThinInstanceSpecificData=function(){this._thinInstanceDataStorage?.matrixBuffer&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null),this._thinInstanceDataStorage?.previousMatrixBuffer&&(this._thinInstanceDataStorage.previousMatrixBuffer.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null)};class Ce{get influence(){return this._influence}set influence(e){if(this._influence===e)return;const t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(t===0||e===0)}get animationPropertiesOverride(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}constructor(e,t=0,s=null,i=null){this.name=e,this.animations=[],this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uv2s=null,this._colors=null,this._uniqueId=0,this.onInfluenceChanged=new U,this._onDataLayoutChanged=new U,this.morphTargetManager=null,this._animationPropertiesOverride=null,this.id=e,this.morphTargetManager=i,this._scene=s||me.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}get uniqueId(){return this._uniqueId}get hasPositions(){return!!this._positions}get hasNormals(){return!!this._normals}get hasTangents(){return!!this._tangents}get hasUVs(){return!!this._uvs}get hasUV2s(){return!!this._uv2s}get hasColors(){return!!this._colors}get vertexCount(){return this._positions?this._positions.length/3:this._normals?this._normals.length/3:this._tangents?this._tangents.length/3:this._uvs?this._uvs.length/2:this._uv2s?this._uv2s.length/2:this._colors?this._colors.length/4:0}setPositions(e){const t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)}getPositions(){return this._positions}setNormals(e){const t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)}getNormals(){return this._normals}setTangents(e){const t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)}getTangents(){return this._tangents}setUVs(e){const t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)}getUVs(){return this._uvs}setUV2s(e){const t=this.hasUV2s;this._uv2s=e,t!==this.hasUV2s&&this._onDataLayoutChanged.notifyObservers(void 0)}getUV2s(){return this._uv2s}setColors(e){const t=this.hasColors;this._colors=e,t!==this.hasColors&&this._onDataLayoutChanged.notifyObservers(void 0)}getColors(){return this._colors}clone(){const e=Le.Clone(()=>new Ce(this.name,this.influence,this._scene,this.morphTargetManager),this);return e._positions=this._positions,e._normals=this._normals,e._tangents=this._tangents,e._uvs=this._uvs,e._uv2s=this._uv2s,e._colors=this._colors,e}serialize(){const e={};return e.name=this.name,e.influence=this.influence,this.id!=null&&(e.id=this.id),e.uniqueId=this.uniqueId,e.positions=Array.prototype.slice.call(this.getPositions()),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),this.hasUV2s&&(e.uv2s=Array.prototype.slice.call(this.getUV2s())),this.hasColors&&(e.colors=Array.prototype.slice.call(this.getColors())),Le.AppendSerializedAnimations(this,e),e}getClassName(){return"MorphTarget"}static Parse(e,t,s=null){const i=new Ce(e.name,e.influence,t,s);if(i.setPositions(e.positions),e.id!=null&&(i.id=e.id),e.normals&&i.setNormals(e.normals),e.tangents&&i.setTangents(e.tangents),e.uvs&&i.setUVs(e.uvs),e.uv2s&&i.setUV2s(e.uv2s),e.colors&&i.setColors(e.colors),e.animations){for(let r=0;r<e.animations.length;r++){const a=e.animations[r],o=Di("BABYLON.Animation");o&&i.animations.push(o.Parse(a))}e.autoAnimate&&t&&t.beginAnimation(i,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1)}return i}static FromMesh(e,t,s){t||(t=e.name);const i=new Ce(t,s,e.getScene(),e.morphTargetManager);return i.setPositions(e.getVerticesData(w.PositionKind)),e.isVerticesDataPresent(w.NormalKind)&&i.setNormals(e.getVerticesData(w.NormalKind)),e.isVerticesDataPresent(w.TangentKind)&&i.setTangents(e.getVerticesData(w.TangentKind)),e.isVerticesDataPresent(w.UVKind)&&i.setUVs(e.getVerticesData(w.UVKind)),e.isVerticesDataPresent(w.UV2Kind)&&i.setUV2s(e.getVerticesData(w.UV2Kind)),e.isVerticesDataPresent(w.ColorKind)&&i.setColors(e.getVerticesData(w.ColorKind)),i}}h([m()],Ce.prototype,"id",void 0);h([m()],Ce.prototype,"morphTargetManager",void 0);class Pt extends X{get depth(){return this._depth}constructor(e,t,s,i,r,a,o=!0,u=!1,l=X.TRILINEAR_SAMPLINGMODE,f=0,c,E){super(null,a,!o,u),this.format=r,this._texture=a.getEngine().createRawTexture2DArray(e,t,s,i,r,o,u,l,null,f,c??0,E),this._depth=i,this.is2DArray=!0}update(e){this.updateMipLevel(e,0)}updateMipLevel(e,t){this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type,t)}static CreateRGBATexture(e,t,s,i,r,a=!0,o=!1,u=3,l=0){return new Pt(e,t,s,i,5,r,a,o,u,l)}}class ue{set areUpdatesFrozen(e){e?this._blockCounter++:(this._blockCounter--,this._blockCounter<=0&&(this._blockCounter=0,this._syncActiveTargets(this._forceUpdateWhenUnfrozen),this._forceUpdateWhenUnfrozen=!1))}get areUpdatesFrozen(){return this._blockCounter>0}constructor(e=null,t){if(this.meshName=t,this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new ms(16),this._supportsPositions=!1,this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._supportsUV2s=!1,this._supportsColors=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this._canUseTextureForTargets=!1,this._blockCounter=0,this._mustSynchronize=!0,this._forceUpdateWhenUnfrozen=!1,this._textureVertexStride=0,this._textureWidth=0,this._textureHeight=1,this._parentContainer=null,this.optimizeInfluencers=!0,this.enablePositionMorphing=!0,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,this.enableUV2Morphing=!0,this.enableColorMorphing=!0,this._numMaxInfluencers=0,this._useTextureToStoreTargets=!0,this.metadata=null,this._influencesAreDirty=!1,this._needUpdateInfluences=!1,e||(e=me.LastCreatedScene),this._scene=e,this._scene){this._scene.addMorphTargetManager(this),this._uniqueId=this._scene.getUniqueId();const s=this._scene.getEngine().getCaps();this._canUseTextureForTargets=s.canUseGLVertexID&&s.textureFloat&&s.maxVertexTextureImageUnits>0&&s.texture2DArrayMaxLayerCount>1}}get numMaxInfluencers(){return ue.ConstantTargetCountForTextureMode>0&&this.isUsingTextureForTargets?ue.ConstantTargetCountForTextureMode:this._numMaxInfluencers}set numMaxInfluencers(e){this._numMaxInfluencers!==e&&(this._numMaxInfluencers=e,this._mustSynchronize=!0,this._syncActiveTargets())}get uniqueId(){return this._uniqueId}get vertexCount(){return this._vertexCount}get supportsPositions(){return this._supportsPositions&&this.enablePositionMorphing}get supportsNormals(){return this._supportsNormals&&this.enableNormalMorphing}get supportsTangents(){return this._supportsTangents&&this.enableTangentMorphing}get supportsUVs(){return this._supportsUVs&&this.enableUVMorphing}get supportsUV2s(){return this._supportsUV2s&&this.enableUV2Morphing}get supportsColors(){return this._supportsColors&&this.enableColorMorphing}get hasPositions(){return this._supportsPositions}get hasNormals(){return this._supportsNormals}get hasTangents(){return this._supportsTangents}get hasUVs(){return this._supportsUVs}get hasUV2s(){return this._supportsUV2s}get hasColors(){return this._supportsColors}get numTargets(){return this._targets.length}get numInfluencers(){return this._influencesAreDirty&&this._syncActiveTargets(),this._activeTargets.length}get influences(){return this._influencesAreDirty&&this._syncActiveTargets(),this._influences}get useTextureToStoreTargets(){return this._useTextureToStoreTargets}set useTextureToStoreTargets(e){this._useTextureToStoreTargets!==e&&(this._useTextureToStoreTargets=e,this._mustSynchronize=!0,this._syncActiveTargets())}get isUsingTextureForTargets(){return ue.EnableTextureStorage&&this.useTextureToStoreTargets&&this._canUseTextureForTargets&&!this._scene?.getEngine().getCaps().disableMorphTargetTexture}getActiveTarget(e){return this._influencesAreDirty&&this._syncActiveTargets(),this._activeTargets.data[e]}getTarget(e){return this._targets[e]}getTargetByName(e){for(const t of this._targets)if(t.name===e)return t;return null}addTarget(e){this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add(t=>{this.areUpdatesFrozen&&t&&(this._forceUpdateWhenUnfrozen=!0),this._influencesAreDirty=!0,this._needUpdateInfluences=this._needUpdateInfluences||t})),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add(()=>{this._mustSynchronize=!0,this._syncActiveTargets()})),this._mustSynchronize=!0,this._syncActiveTargets()}removeTarget(e){const t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._mustSynchronize=!0,this._syncActiveTargets()),this._scene&&this._scene.stopAnimation(e)}_bind(e){this._influencesAreDirty&&this._syncActiveTargets(),e.setFloat3("morphTargetTextureInfo",this._textureVertexStride,this._textureWidth,this._textureHeight),e.setFloatArray("morphTargetTextureIndices",this._morphTargetTextureIndices),e.setTexture("morphTargets",this._targetStoreTexture),e.setFloat("morphTargetCount",this.numInfluencers)}clone(){const e=new ue(this._scene);e.areUpdatesFrozen=!0;for(const t of this._targets)e.addTarget(t.clone());return e.areUpdatesFrozen=!1,e.enablePositionMorphing=this.enablePositionMorphing,e.enableNormalMorphing=this.enableNormalMorphing,e.enableTangentMorphing=this.enableTangentMorphing,e.enableUVMorphing=this.enableUVMorphing,e.enableUV2Morphing=this.enableUV2Morphing,e.enableColorMorphing=this.enableColorMorphing,e.metadata=this.metadata,e}serialize(){const e={};e.id=this.uniqueId,e.meshName=this.meshName,e.targets=[];for(const t of this._targets)e.targets.push(t.serialize());return this.metadata&&(e.metadata=this.metadata),e}_syncActiveTargets(e=!1){if(this.areUpdatesFrozen)return;e=e||this._needUpdateInfluences,this._needUpdateInfluences=!1,this._influencesAreDirty=!1;const t=!!this._targetStoreTexture,s=this.isUsingTextureForTargets;(this._mustSynchronize||t!==s)&&(this._mustSynchronize=!1,this.synchronize());let i=0;this._activeTargets.reset(),(!this._morphTargetTextureIndices||this._morphTargetTextureIndices.length!==this._targets.length)&&(this._morphTargetTextureIndices=new Float32Array(this._targets.length));let r=-1;for(const a of this._targets)if(r++,!(a.influence===0&&this.optimizeInfluencers)){if(this._activeTargets.length>=ue.MaxActiveMorphTargetsInVertexAttributeMode&&!this.isUsingTextureForTargets)break;this._activeTargets.push(a),this._morphTargetTextureIndices[i]=r,this._tempInfluences[i++]=a.influence}this._morphTargetTextureIndices.length!==i&&(this._morphTargetTextureIndices=this._morphTargetTextureIndices.slice(0,i)),(!this._influences||this._influences.length!==i)&&(this._influences=new Float32Array(i));for(let a=0;a<i;a++)this._influences[a]=this._tempInfluences[a];if(e&&this._scene)for(const a of this._scene.meshes)a.morphTargetManager===this&&(s?a._markSubMeshesAsAttributesDirty():a._syncGeometryWithMorphTargetManager())}synchronize(){if(!this._scene||this.areUpdatesFrozen)return;const e=this._scene.getEngine();this._supportsPositions=!0,this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._supportsUV2s=!0,this._supportsColors=!0,this._vertexCount=0,this._targetStoreTexture?.dispose(),this._targetStoreTexture=null,this.isUsingTextureForTargets&&this._targets.length>e.getCaps().texture2DArrayMaxLayerCount&&(this.useTextureToStoreTargets=!1);for(const t of this._targets){this._supportsPositions=this._supportsPositions&&t.hasPositions,this._supportsNormals=this._supportsNormals&&t.hasNormals,this._supportsTangents=this._supportsTangents&&t.hasTangents,this._supportsUVs=this._supportsUVs&&t.hasUVs,this._supportsUV2s=this._supportsUV2s&&t.hasUV2s,this._supportsColors=this._supportsColors&&t.hasColors;const s=t.vertexCount;if(this._vertexCount===0)this._vertexCount=s;else if(this._vertexCount!==s){N.Error(`Incompatible target. Targets must all have the same vertices count. Current vertex count: ${this._vertexCount}, vertex count for target "${t.name}": ${s}`);return}}if(this.isUsingTextureForTargets){this._textureVertexStride=0,this._supportsPositions&&this._textureVertexStride++,this._supportsNormals&&this._textureVertexStride++,this._supportsTangents&&this._textureVertexStride++,this._supportsUVs&&this._textureVertexStride++,this._supportsUV2s&&this._textureVertexStride++,this._supportsColors&&this._textureVertexStride++,this._textureWidth=this._vertexCount*this._textureVertexStride||1,this._textureHeight=1;const t=e.getCaps().maxTextureSize;this._textureWidth>t&&(this._textureHeight=Math.ceil(this._textureWidth/t),this._textureWidth=t);const s=this._targets.length,i=new Float32Array(s*this._textureWidth*this._textureHeight*4);let r;for(let a=0;a<s;a++){const o=this._targets[a],u=o.getPositions(),l=o.getNormals(),f=o.getUVs(),c=o.getTangents(),E=o.getUV2s(),C=o.getColors();r=a*this._textureWidth*this._textureHeight*4;for(let g=0;g<this._vertexCount;g++)this._supportsPositions&&u&&(i[r]=u[g*3],i[r+1]=u[g*3+1],i[r+2]=u[g*3+2],r+=4),this._supportsNormals&&l&&(i[r]=l[g*3],i[r+1]=l[g*3+1],i[r+2]=l[g*3+2],r+=4),this._supportsUVs&&f&&(i[r]=f[g*2],i[r+1]=f[g*2+1],r+=4),this._supportsTangents&&c&&(i[r]=c[g*3],i[r+1]=c[g*3+1],i[r+2]=c[g*3+2],r+=4),this._supportsUV2s&&E&&(i[r]=E[g*2],i[r+1]=E[g*2+1],r+=4),this._supportsColors&&C&&(i[r]=C[g*4],i[r+1]=C[g*4+1],i[r+2]=C[g*4+2],i[r+3]=C[g*4+3],r+=4)}this._targetStoreTexture=Pt.CreateRGBATexture(i,this._textureWidth,this._textureHeight,s,this._scene,!1,!1,1,1),this._targetStoreTexture.name=`Morph texture_${this.uniqueId}`}for(const t of this._scene.meshes)t.morphTargetManager===this&&t._syncGeometryWithMorphTargetManager()}dispose(){if(this._targetStoreTexture&&this._targetStoreTexture.dispose(),this._targetStoreTexture=null,this.metadata=null,this._scene){if(this._scene.removeMorphTargetManager(this),this._parentContainer){const e=this._parentContainer.morphTargetManagers.indexOf(this);e>-1&&this._parentContainer.morphTargetManagers.splice(e,1),this._parentContainer=null}for(const e of this._targets)this._scene.stopAnimation(e)}}static Parse(e,t){const s=new ue(t);for(const i of e.targets)s.addTarget(Ce.Parse(i,t,s));return e.metadata&&(s.metadata=e.metadata),s}}ue.EnableTextureStorage=!0;ue.MaxActiveMorphTargetsInVertexAttributeMode=8;ue.ConstantTargetCountForTextureMode=0;class Ws extends vi{constructor(e,t,s,i=5,r=0,a=!1,o=!1,u=3,l=null){super("",e),this._texture=e.getEngine().createRawCubeTexture(t,s,i,r,a,o,u,l)}update(e,t,s,i,r=null){this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,s,i,r)}updateRGBDAsync(e,t=null,s=.8,i=0){return Pi(this._texture,e,t,s,i).then(()=>{})}clone(){return Le.Clone(()=>{const e=this.getScene(),t=this._texture,s=new Ws(e,t._bufferViewArray,t.width,t.format,t.type,t.generateMipMaps,t.invertY,t.samplingMode,t._compression);return t.source===13&&s.updateRGBDAsync(t._bufferViewArrayArray,t._sphericalPolynomial,t._lodGenerationScale,t._lodGenerationOffset),s},this)}}function Ar(n,e,t,s){const i=n;let r=null,a=null,o=null,u=null;const l={},f=e.find(c=>c.dracoName==="POSITION");if(!f)throw new Error("Draco: Missing position attribute for encoding.");if(!t){const c=f.data.length/f.size;t=new(c>65535?Uint32Array:Uint16Array)(c);for(let E=0;E<c;E++)t[E]=E}try{r=new i.Encoder,a=new i.MeshBuilder,o=new i.Mesh,a.AddFacesToMesh(o,t.length/3,t);const c=new Map([[Float32Array,(g,_,x,S,I,D)=>g.AddFloatAttribute(_,x,S,I,D)],[Uint32Array,(g,_,x,S,I,D)=>g.AddUInt32Attribute(_,x,S,I,D)],[Uint16Array,(g,_,x,S,I,D)=>g.AddUInt16Attribute(_,x,S,I,D)],[Uint8Array,(g,_,x,S,I,D)=>g.AddUInt8Attribute(_,x,S,I,D)],[Int32Array,(g,_,x,S,I,D)=>g.AddInt32Attribute(_,x,S,I,D)],[Int16Array,(g,_,x,S,I,D)=>g.AddInt16Attribute(_,x,S,I,D)],[Int8Array,(g,_,x,S,I,D)=>g.AddInt8Attribute(_,x,S,I,D)]]);for(const g of e){g.data instanceof Uint8ClampedArray&&(g.data=new Uint8Array(g.data));const _=c.get(g.data.constructor),x=g.data.length/g.size;l[g.kind]=_(a,o,i[g.dracoName],x,g.size,g.data),s.quantizationBits&&s.quantizationBits[g.dracoName]&&r.SetAttributeQuantization(i[g.dracoName],s.quantizationBits[g.dracoName])}s.method&&r.SetEncodingMethod(i[s.method]),s.encodeSpeed!==void 0&&s.decodeSpeed!==void 0&&r.SetSpeedOptions(s.encodeSpeed,s.decodeSpeed),u=new i.DracoInt8Array;const E=r.EncodeMeshToDracoBuffer(o,u);if(E<=0)throw new Error("Draco: Failed to encode.");const C=new Int8Array(E);for(let g=0;g<E;g++)C[g]=u.GetValue(g);return{data:C,attributeIds:l}}finally{o&&i.destroy(o),a&&i.destroy(a),r&&i.destroy(r),u&&i.destroy(u)}}function ta(){let n;onmessage=e=>{const t=e.data;switch(t.id){case"init":{t.url&&importScripts(t.url);const s=t.wasmBinary?{wasmBinary:t.wasmBinary}:{};n=DracoEncoderModule(s),postMessage({id:"initDone"});break}case"encodeMesh":{if(!n)throw new Error("Draco: Encoder module is not available.");n.then(s=>{const i=Ar(s,t.attributes,t.indices,t.options);postMessage({id:"encodeMeshSuccess",encodedMeshData:i},i?[i.data.buffer]:void 0)}).catch(s=>{postMessage({id:"encodeMeshError",errorMessage:s.message})});break}}}}function mt(n,e,t,s,i){const r=n;let a=null,o=null,u=null;try{a=new r.Decoder,o=new r.DecoderBuffer,o.Init(e,e.byteLength);let l;const f=a.GetEncodedGeometryType(o);switch(f){case r.TRIANGULAR_MESH:{const C=new r.Mesh;if(l=a.DecodeBufferToMesh(o,C),!l.ok()||C.ptr===0)throw new Error(l.error_msg());const _=C.num_faces()*3,x=_*4,S=r._malloc(x);try{a.GetTrianglesUInt32Array(C,x,S);const I=new Uint32Array(_);I.set(new Uint32Array(r.HEAPF32.buffer,S,_)),s(I)}finally{r._free(S)}u=C;break}case r.POINT_CLOUD:{const C=new r.PointCloud;if(l=a.DecodeBufferToPointCloud(o,C),!l.ok()||!C.ptr)throw new Error(l.error_msg());u=C;break}default:throw new Error(`Draco: Cannot decode invalid geometry type ${f}`)}const c=u.num_points(),E=(C,g,_,x)=>{const S=x.data_type(),I=x.num_components(),D=x.normalized(),ne=x.byte_stride(),V=x.byte_offset(),Ve={[r.DT_FLOAT32]:{typedArrayConstructor:Float32Array,heap:r.HEAPF32},[r.DT_INT8]:{typedArrayConstructor:Int8Array,heap:r.HEAP8},[r.DT_INT16]:{typedArrayConstructor:Int16Array,heap:r.HEAP16},[r.DT_INT32]:{typedArrayConstructor:Int32Array,heap:r.HEAP32},[r.DT_UINT8]:{typedArrayConstructor:Uint8Array,heap:r.HEAPU8},[r.DT_UINT16]:{typedArrayConstructor:Uint16Array,heap:r.HEAPU16},[r.DT_UINT32]:{typedArrayConstructor:Uint32Array,heap:r.HEAPU32}}[S];if(!Ve)throw new Error(`Draco: Cannot decode invalid data type ${S}`);const Bt=c*I,Nt=Bt*Ve.typedArrayConstructor.BYTES_PER_ELEMENT,tt=r._malloc(Nt);try{C.GetAttributeDataArrayForAllPoints(g,x,S,Nt,tt);const Ys=new Ve.typedArrayConstructor(Ve.heap.buffer,tt,Bt);i(_,Ys.slice(),I,V,ne,D)}finally{r._free(tt)}};if(t)for(const C in t){const g=t[C],_=a.GetAttributeByUniqueId(u,g);E(a,u,C,_)}else{const C={position:r.POSITION,normal:r.NORMAL,color:r.COLOR,uv:r.TEX_COORD};for(const g in C){const _=a.GetAttributeId(u,C[g]);if(_!==-1){const x=a.GetAttribute(u,_);E(a,u,g,x)}}}return c}finally{u&&r.destroy(u),o&&r.destroy(o),a&&r.destroy(a)}}function Er(){let n;onmessage=e=>{const t=e.data;switch(t.id){case"init":{t.url&&importScripts(t.url);const s=t.wasmBinary?{wasmBinary:t.wasmBinary}:{};n=DracoDecoderModule(s),postMessage({id:"initDone"});break}case"decodeMesh":{if(!n)throw new Error("Draco: Decoder module is not available");n.then(s=>{const i=mt(s,t.dataView,t.attributes,r=>{postMessage({id:"indices",data:r},[r.buffer])},(r,a,o,u,l,f)=>{postMessage({id:"attribute",kind:r,data:a,size:o,byteOffset:u,byteStride:l,normalized:f},[a.buffer])});postMessage({id:"decodeMeshDone",totalVertices:i})});break}}}}async function xr(n,e,t){return await new Promise((s,i)=>{const r=o=>{n.removeEventListener("error",r),n.removeEventListener("message",a),i(o)},a=o=>{o.data.id==="initDone"&&(n.removeEventListener("error",r),n.removeEventListener("message",a),s(n))};if(n.addEventListener("error",r),n.addEventListener("message",a),!e)n.postMessage({id:"init",url:t});else{const o=e.slice(0);n.postMessage({id:"init",url:t,wasmBinary:o},[o])}})}function yr(){return typeof navigator!="object"||!navigator.hardwareConcurrency?1:Math.min(Math.floor(navigator.hardwareConcurrency*.5),4)}function Sr(n){return!!(n.wasmUrl&&(n.wasmBinary||n.wasmBinaryUrl)&&typeof WebAssembly=="object"||n.fallbackUrl)}class Cr{constructor(e){if(e.workerPool){this._workerPoolPromise=Promise.resolve(e.workerPool);return}const t=e.wasmBinary,s=e.numWorkers??yr(),i=s&&typeof Worker=="function"&&typeof URL=="function",r=i||!e.jsModule,a=e.wasmUrl&&e.wasmBinaryUrl&&typeof WebAssembly=="object"?{url:r?q.GetBabylonScriptURL(e.wasmUrl,!0):"",wasmBinaryPromise:t?Promise.resolve(t):q.LoadFileAsync(q.GetBabylonScriptURL(e.wasmBinaryUrl,!0))}:{url:r?q.GetBabylonScriptURL(e.fallbackUrl):"",wasmBinaryPromise:Promise.resolve(void 0)};i?this._workerPoolPromise=a.wasmBinaryPromise.then(o=>{const u=this._getWorkerContent(),l=URL.createObjectURL(new Blob([u],{type:"application/javascript"}));return new Ni(s,()=>{const f=new Worker(l);return xr(f,o,a.url)})}):this._modulePromise=a.wasmBinaryPromise.then(async o=>{if(!this._isModuleAvailable()&&!e.jsModule){if(!a.url)throw new Error("Draco codec module is not available");await q.LoadBabylonScriptAsync(a.url)}return await this._createModuleAsync(o,e.jsModule)})}async whenReadyAsync(){if(this._workerPoolPromise){await this._workerPoolPromise;return}if(this._modulePromise){await this._modulePromise;return}}dispose(){this._workerPoolPromise&&this._workerPoolPromise.then(e=>{e.dispose()}),delete this._workerPoolPromise,delete this._modulePromise}}class ie extends Cr{static get DefaultAvailable(){return Sr(ie.DefaultConfiguration)}static get Default(){return ie._Default??(ie._Default=new ie),ie._Default}static ResetDefault(e){ie._Default&&(e||ie._Default.dispose(),ie._Default=null)}_isModuleAvailable(){return typeof DracoDecoderModule<"u"}async _createModuleAsync(e,t){return{module:await(t||DracoDecoderModule)({wasmBinary:e})}}_getWorkerContent(){return`${mt}(${Er})()`}constructor(e=ie.DefaultConfiguration){super(e)}decodeMeshToMeshDataAsync(e,t,s){const i=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e.buffer,e.byteOffset,e.byteLength),r=(a,o)=>s&&s[a]!==void 0?(o!==s[a]&&N.Warn(`Normalized flag from Draco data (${o}) does not match normalized flag from glTF accessor (${s[a]}). Using flag from glTF accessor.`),s[a]):o;if(this._workerPoolPromise)return this._workerPoolPromise.then(async a=>await new Promise((o,u)=>{a.push((l,f)=>{let c=null;const E=[],C=x=>{l.removeEventListener("error",C),l.removeEventListener("message",g),u(x),f()},g=x=>{const S=x.data;switch(S.id){case"indices":{c=S.data;break}case"attribute":{E.push({kind:S.kind,data:S.data,size:S.size,byteOffset:S.byteOffset,byteStride:S.byteStride,normalized:r(S.kind,S.normalized)});break}case"decodeMeshDone":{l.removeEventListener("error",C),l.removeEventListener("message",g),o({indices:c,attributes:E,totalVertices:S.totalVertices}),f();break}}};l.addEventListener("error",C),l.addEventListener("message",g);const _=i.slice();l.postMessage({id:"decodeMesh",dataView:_,attributes:t},[_.buffer])})}));if(this._modulePromise)return this._modulePromise.then(a=>{let o=null;const u=[],l=mt(a.module,i,t,f=>{o=f},(f,c,E,C,g,_)=>{u.push({kind:f,data:c,size:E,byteOffset:C,byteStride:g,normalized:_})});return{indices:o,attributes:u,totalVertices:l}});throw new Error("Draco: Decoder module is not available")}async decodeMeshToGeometryAsync(e,t,s,i){const r=await this.decodeMeshToMeshDataAsync(s,i),a=new Qt(e,t);r.indices&&a.setIndices(r.indices);for(const o of r.attributes)a.setVerticesBuffer(new w(t.getEngine(),o.data,o.kind,!1,void 0,o.byteStride,void 0,o.byteOffset,o.size,void 0,o.normalized,!0),r.totalVertices);return a}async _decodeMeshToGeometryForGltfAsync(e,t,s,i,r,a){const o=await this.decodeMeshToMeshDataAsync(s,i,r),u=new Qt(e,t);a&&(u._boundingInfo=a,u.useBoundingInfoFromGeometry=!0),o.indices&&u.setIndices(o.indices);for(const l of o.attributes)u.setVerticesBuffer(new w(t.getEngine(),l.data,l.kind,!1,void 0,l.byteStride,void 0,l.byteOffset,l.size,void 0,l.normalized,!0),o.totalVertices);return u}}ie.DefaultConfiguration={wasmUrl:`${q._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,wasmBinaryUrl:`${q._DefaultCdnUrl}/draco_decoder_gltf.wasm`,fallbackUrl:`${q._DefaultCdnUrl}/draco_decoder_gltf.js`};ie._Default=null;let ht=0,Ye=null;class ge{static get Default(){return ge._Default||(ge._Default=new ge),ge._Default}constructor(){const e=ge.Configuration.decoder;this._decoderModulePromise=q.LoadBabylonScriptAsync(e.url).then(()=>MeshoptDecoder.ready)}dispose(){delete this._decoderModulePromise}async decodeGltfBufferAsync(e,t,s,i,r){await this._decoderModulePromise,ht===0&&(MeshoptDecoder.useWorkers(1),ht=1);const a=await MeshoptDecoder.decodeGltfBufferAsync(t,s,e,i,r);return Ye!==null&&clearTimeout(Ye),Ye=setTimeout(()=>{MeshoptDecoder.useWorkers(0),ht=0,Ye=null},1e3),a}}ge.Configuration={decoder:{url:`${q._DefaultCdnUrl}/meshopt_decoder.js`}};ge._Default=null;function Ir(...n){const e=t=>!!t&&typeof t=="object";return n.reduce((t,s)=>{const i=Object.keys(s);for(const r of i){const a=t[r],o=s[r];Array.isArray(a)&&Array.isArray(o)?t[r]=a.concat(...o):e(a)&&e(o)?t[r]=Ir(a,o):t[r]=o}return t},{})}class sa{get resolve(){return this._resolve}get reject(){return this._reject}constructor(){this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}}class ia{constructor(e){this.byteOffset=0,this.buffer=e}async loadAsync(e){const t=await this.buffer.readAsync(this.byteOffset,e);this._dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),this._dataByteOffset=0}readUint32(){const e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e}readUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t}readString(e){return Bi(this.readUint8Array(e))}skipBytes(e){this._dataByteOffset+=e,this.byteOffset+=e}}class na{constructor(e){this._factory=e}get value(){return this._factory&&(this._value=this._factory(),this._factory=void 0),this._value}}export{Dt as $,As as A,$r as B,vr as C,ia as D,Ar as E,ta as F,Xn as G,us as H,os as I,jn as J,Wn as K,Us as L,ls as M,Gs as N,le as O,_t as P,Jn as Q,et as R,Kn as S,re as T,zn as U,_e as V,fe as W,ft as X,hs as Y,as as Z,Zn as _,on as a,zr as a$,or as a0,Qn as a1,$n as a2,Oi as a3,Fi as a4,Li as a5,na as a6,cr as a7,ur as a8,lr as a9,Pt as aA,Be as aB,$ as aC,Xe as aD,Ps as aE,bt as aF,wt as aG,Os as aH,Rt as aI,Ns as aJ,Fs as aK,St as aL,$e as aM,vs as aN,Ct as aO,It as aP,Bs as aQ,dt as aR,ae as aS,Ln as aT,se as aU,wn as aV,Dn as aW,Bn as aX,Gr as aY,Yr as aZ,Wr as a_,hr as aa,dr as ab,_r as ac,ge as ad,Ce as ae,ue as af,Pe as ag,R as ah,P as ai,W as aj,j as ak,A as al,cs as am,he as an,M as ao,jr as ap,Kr as aq,tr as ar,er as as,Qs as at,sr as au,Jr as av,Zr as aw,vt as ax,Ws as ay,ee as az,At as b,Ae as b0,be as b1,Qr as b2,yr as b3,an as b4,Ui as b5,Ge as b6,cn as b7,Sr as b8,Vs as b9,v as ba,Gi as bb,yt as bc,Et as bd,ws as be,In as bf,xt as bg,Ss as bh,K as bi,te as bj,Ze as bk,Ie as bl,Xr as bm,Hs as bn,Ir as bo,Mt as bp,Vr as bq,qn as br,Hr as bs,Ls as bt,Ur as bu,qr as bv,ea as bw,hn as c,ys as d,Ms as e,sn as f,Vi as g,dn as h,gs as i,gr as j,Dr as k,tn as l,ki as m,Jt as n,Z as o,B as p,kr as q,Pr as r,Br as s,Nr as t,Fr as u,Or as v,Lr as w,sa as x,Cr as y,ie as z};