@babylonjs/viewer 7.41.0 → 7.41.1-alpha

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 (619) hide show
  1. package/assets/photoStudio.env +0 -0
  2. package/dist/babylon-viewer.esm.js +2 -0
  3. package/dist/babylon-viewer.esm.js.map +1 -0
  4. package/dist/babylon-viewer.esm.min.js +2 -0
  5. package/dist/babylon-viewer.esm.min.js.map +1 -0
  6. package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js +2 -0
  7. package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js.map +1 -0
  8. package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js +84 -0
  9. package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js.map +1 -0
  10. package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js +171 -0
  11. package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js.map +1 -0
  12. package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js +2 -0
  13. package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js.map +1 -0
  14. package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js +86 -0
  15. package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js.map +1 -0
  16. package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js +2 -0
  17. package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js.map +1 -0
  18. package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js +134 -0
  19. package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js.map +1 -0
  20. package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js +2 -0
  21. package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js.map +1 -0
  22. package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js +2 -0
  23. package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js.map +1 -0
  24. package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js +44 -0
  25. package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js.map +1 -0
  26. package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js +2 -0
  27. package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js.map +1 -0
  28. package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js +43 -0
  29. package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js.map +1 -0
  30. package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js +64 -0
  31. package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js.map +1 -0
  32. package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js +2 -0
  33. package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js.map +1 -0
  34. package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js +2 -0
  35. package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js.map +1 -0
  36. package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js +352 -0
  37. package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js.map +1 -0
  38. package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js +2 -0
  39. package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js.map +1 -0
  40. package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js +610 -0
  41. package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js.map +1 -0
  42. package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js +2 -0
  43. package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js.map +1 -0
  44. package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js +4033 -0
  45. package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js.map +1 -0
  46. package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js +581 -0
  47. package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js.map +1 -0
  48. package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js +2 -0
  49. package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js.map +1 -0
  50. package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js +65 -0
  51. package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js.map +1 -0
  52. package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js +2 -0
  53. package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js.map +1 -0
  54. package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js +2 -0
  55. package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js.map +1 -0
  56. package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js +96 -0
  57. package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js.map +1 -0
  58. package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js +2 -0
  59. package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js.map +1 -0
  60. package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js +97 -0
  61. package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js.map +1 -0
  62. package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js +62 -0
  63. package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js.map +1 -0
  64. package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js +2 -0
  65. package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js.map +1 -0
  66. package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js +55 -0
  67. package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js.map +1 -0
  68. package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js +2 -0
  69. package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js.map +1 -0
  70. package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js +64 -0
  71. package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js.map +1 -0
  72. package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js +2 -0
  73. package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js.map +1 -0
  74. package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js +72 -0
  75. package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js.map +1 -0
  76. package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js +2 -0
  77. package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js.map +1 -0
  78. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js +2 -0
  79. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js.map +1 -0
  80. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js +81 -0
  81. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js.map +1 -0
  82. package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js +85 -0
  83. package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js.map +1 -0
  84. package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js +2 -0
  85. package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js.map +1 -0
  86. package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js +75 -0
  87. package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js.map +1 -0
  88. package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js +2 -0
  89. package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js.map +1 -0
  90. package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js +2 -0
  91. package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js.map +1 -0
  92. package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js +307 -0
  93. package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js.map +1 -0
  94. package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js +2 -0
  95. package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js.map +1 -0
  96. package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js +74 -0
  97. package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js.map +1 -0
  98. package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js +262 -0
  99. package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js.map +1 -0
  100. package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js +2 -0
  101. package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js.map +1 -0
  102. package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js +2 -0
  103. package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js.map +1 -0
  104. package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js +87 -0
  105. package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js.map +1 -0
  106. package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js +2 -0
  107. package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js.map +1 -0
  108. package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js +26 -0
  109. package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js.map +1 -0
  110. package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js +39 -0
  111. package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js.map +1 -0
  112. package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js +2 -0
  113. package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js.map +1 -0
  114. package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js +2 -0
  115. package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js.map +1 -0
  116. package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js +46 -0
  117. package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js.map +1 -0
  118. package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js +43 -0
  119. package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js.map +1 -0
  120. package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js +2 -0
  121. package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js.map +1 -0
  122. package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js +63 -0
  123. package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js.map +1 -0
  124. package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js +2 -0
  125. package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js.map +1 -0
  126. package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js +51 -0
  127. package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js.map +1 -0
  128. package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js +2 -0
  129. package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js.map +1 -0
  130. package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js +2 -0
  131. package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js.map +1 -0
  132. package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js +2201 -0
  133. package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js.map +1 -0
  134. package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js +337 -0
  135. package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js.map +1 -0
  136. package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js +2 -0
  137. package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js.map +1 -0
  138. package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js +2 -0
  139. package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js.map +1 -0
  140. package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js +46 -0
  141. package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js.map +1 -0
  142. package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js +47 -0
  143. package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js.map +1 -0
  144. package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js +2 -0
  145. package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js.map +1 -0
  146. package/dist/chunks/animationGroup-8TJDgymS.esm.js +2482 -0
  147. package/dist/chunks/animationGroup-8TJDgymS.esm.js.map +1 -0
  148. package/dist/chunks/animationGroup-toXtd3a1.esm.min.js +2 -0
  149. package/dist/chunks/animationGroup-toXtd3a1.esm.min.js.map +1 -0
  150. package/dist/chunks/assetContainer-7pMDUaac.esm.min.js +2 -0
  151. package/dist/chunks/assetContainer-7pMDUaac.esm.min.js.map +1 -0
  152. package/dist/chunks/assetContainer-DYzO0AbX.esm.js +1720 -0
  153. package/dist/chunks/assetContainer-DYzO0AbX.esm.js.map +1 -0
  154. package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js +2 -0
  155. package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js.map +1 -0
  156. package/dist/chunks/audioEngine-peiGqjr6.esm.js +305 -0
  157. package/dist/chunks/audioEngine-peiGqjr6.esm.js.map +1 -0
  158. package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js +2 -0
  159. package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js.map +1 -0
  160. package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js +114 -0
  161. package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js.map +1 -0
  162. package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js +600 -0
  163. package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js.map +1 -0
  164. package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js +2 -0
  165. package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js.map +1 -0
  166. package/dist/chunks/dds-6EdM5O6M.esm.js +540 -0
  167. package/dist/chunks/dds-6EdM5O6M.esm.js.map +1 -0
  168. package/dist/chunks/dds-DVX_K9B3.esm.min.js +2 -0
  169. package/dist/chunks/dds-DVX_K9B3.esm.min.js.map +1 -0
  170. package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js +2 -0
  171. package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js.map +1 -0
  172. package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js +88 -0
  173. package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js.map +1 -0
  174. package/dist/chunks/decalFragment-C_Cews3-.esm.js +18 -0
  175. package/dist/chunks/decalFragment-C_Cews3-.esm.js.map +1 -0
  176. package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js +2 -0
  177. package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js.map +1 -0
  178. package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js +2 -0
  179. package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js.map +1 -0
  180. package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js +2 -0
  181. package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js.map +1 -0
  182. package/dist/chunks/default.fragment-CyFHDykY.esm.js +446 -0
  183. package/dist/chunks/default.fragment-CyFHDykY.esm.js.map +1 -0
  184. package/dist/chunks/default.fragment-ej-2z5tS.esm.js +515 -0
  185. package/dist/chunks/default.fragment-ej-2z5tS.esm.js.map +1 -0
  186. package/dist/chunks/default.vertex-16mVOFgT.esm.js +211 -0
  187. package/dist/chunks/default.vertex-16mVOFgT.esm.js.map +1 -0
  188. package/dist/chunks/default.vertex-D--q2At3.esm.min.js +2 -0
  189. package/dist/chunks/default.vertex-D--q2At3.esm.min.js.map +1 -0
  190. package/dist/chunks/default.vertex-DDlgZTrR.esm.js +190 -0
  191. package/dist/chunks/default.vertex-DDlgZTrR.esm.js.map +1 -0
  192. package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js +2 -0
  193. package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js.map +1 -0
  194. package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js +15 -0
  195. package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js.map +1 -0
  196. package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js +13 -0
  197. package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js.map +1 -0
  198. package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js +2 -0
  199. package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js.map +1 -0
  200. package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js +2 -0
  201. package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js.map +1 -0
  202. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
  203. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
  204. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
  205. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
  206. package/dist/chunks/dumpTools-Bhux0wvM.esm.js +200 -0
  207. package/dist/chunks/dumpTools-Bhux0wvM.esm.js.map +1 -0
  208. package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js +2 -0
  209. package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js.map +1 -0
  210. package/dist/chunks/engine-DF_zE4qj.esm.js +2213 -0
  211. package/dist/chunks/engine-DF_zE4qj.esm.js.map +1 -0
  212. package/dist/chunks/engine-DVmdDcyP.esm.min.js +2 -0
  213. package/dist/chunks/engine-DVmdDcyP.esm.min.js.map +1 -0
  214. package/dist/chunks/engine.common-CvOmoKru.esm.js +1162 -0
  215. package/dist/chunks/engine.common-CvOmoKru.esm.js.map +1 -0
  216. package/dist/chunks/engine.common-DpTzktQJ.esm.min.js +2 -0
  217. package/dist/chunks/engine.common-DpTzktQJ.esm.min.js.map +1 -0
  218. package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js +64 -0
  219. package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js.map +1 -0
  220. package/dist/chunks/envTextureLoader-DMQui088.esm.min.js +2 -0
  221. package/dist/chunks/envTextureLoader-DMQui088.esm.min.js.map +1 -0
  222. package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js +2 -0
  223. package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js.map +1 -0
  224. package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js +382 -0
  225. package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js.map +1 -0
  226. package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js +1683 -0
  227. package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js.map +1 -0
  228. package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js +2 -0
  229. package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js.map +1 -0
  230. package/dist/chunks/fogFragment-BrGGFaiu.esm.js +101 -0
  231. package/dist/chunks/fogFragment-BrGGFaiu.esm.js.map +1 -0
  232. package/dist/chunks/fogFragment-ByOwwQur.esm.min.js +2 -0
  233. package/dist/chunks/fogFragment-ByOwwQur.esm.min.js.map +1 -0
  234. package/dist/chunks/fogFragment-Chod24nu.esm.min.js +2 -0
  235. package/dist/chunks/fogFragment-Chod24nu.esm.min.js.map +1 -0
  236. package/dist/chunks/fogFragment-gZfybCpt.esm.js +102 -0
  237. package/dist/chunks/fogFragment-gZfybCpt.esm.js.map +1 -0
  238. package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js +2 -0
  239. package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js.map +1 -0
  240. package/dist/chunks/fresnelFunction-DBlxfmri.esm.js +12 -0
  241. package/dist/chunks/fresnelFunction-DBlxfmri.esm.js.map +1 -0
  242. package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js +2 -0
  243. package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js.map +1 -0
  244. package/dist/chunks/glTFLoader-fUFiWvYb.esm.js +7693 -0
  245. package/dist/chunks/glTFLoader-fUFiWvYb.esm.js.map +1 -0
  246. package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js +2 -0
  247. package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js.map +1 -0
  248. package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js +77 -0
  249. package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js.map +1 -0
  250. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
  251. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
  252. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
  253. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
  254. package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js +2 -0
  255. package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js.map +1 -0
  256. package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js +34 -0
  257. package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js.map +1 -0
  258. package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js +2 -0
  259. package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js.map +1 -0
  260. package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js +35 -0
  261. package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js.map +1 -0
  262. package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js +253 -0
  263. package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js.map +1 -0
  264. package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js +2 -0
  265. package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js.map +1 -0
  266. package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js +2 -0
  267. package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js.map +1 -0
  268. package/dist/chunks/helperFunctions-C66wRWtu.esm.js +110 -0
  269. package/dist/chunks/helperFunctions-C66wRWtu.esm.js.map +1 -0
  270. package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js +2 -0
  271. package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js.map +1 -0
  272. package/dist/chunks/helperFunctions-gnki_9Kj.esm.js +83 -0
  273. package/dist/chunks/helperFunctions-gnki_9Kj.esm.js.map +1 -0
  274. package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js +189 -0
  275. package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js.map +1 -0
  276. package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js +2 -0
  277. package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js.map +1 -0
  278. package/dist/chunks/index-C6hXZyZb.esm.js +74889 -0
  279. package/dist/chunks/index-C6hXZyZb.esm.js.map +1 -0
  280. package/dist/chunks/index-rZVkfTE6.esm.min.js +57 -0
  281. package/dist/chunks/index-rZVkfTE6.esm.min.js.map +1 -0
  282. package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js +814 -0
  283. package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js.map +1 -0
  284. package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js +2 -0
  285. package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js.map +1 -0
  286. package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js +2 -0
  287. package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js.map +1 -0
  288. package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js +11 -0
  289. package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js.map +1 -0
  290. package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js +2 -0
  291. package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js.map +1 -0
  292. package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js +35 -0
  293. package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js.map +1 -0
  294. package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js +2 -0
  295. package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js.map +1 -0
  296. package/dist/chunks/logDepthVertex-DKPfA10X.esm.js +81 -0
  297. package/dist/chunks/logDepthVertex-DKPfA10X.esm.js.map +1 -0
  298. package/dist/chunks/logDepthVertex-ojTShW5I.esm.js +77 -0
  299. package/dist/chunks/logDepthVertex-ojTShW5I.esm.js.map +1 -0
  300. package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js +2 -0
  301. package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js.map +1 -0
  302. package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js +2 -0
  303. package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js.map +1 -0
  304. package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js +11 -0
  305. package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js.map +1 -0
  306. package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js +2 -0
  307. package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js.map +1 -0
  308. package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js +11 -0
  309. package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js.map +1 -0
  310. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +119 -0
  311. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +1 -0
  312. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +2 -0
  313. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +1 -0
  314. package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js +26 -0
  315. package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js.map +1 -0
  316. package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js +2 -0
  317. package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js.map +1 -0
  318. package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js +2 -0
  319. package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js.map +1 -0
  320. package/dist/chunks/objFileLoader-BPwrX8RK.esm.js +1338 -0
  321. package/dist/chunks/objFileLoader-BPwrX8RK.esm.js.map +1 -0
  322. package/dist/chunks/oitFragment-CmcWUhsZ.esm.js +1240 -0
  323. package/dist/chunks/oitFragment-CmcWUhsZ.esm.js.map +1 -0
  324. package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js +1078 -0
  325. package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js.map +1 -0
  326. package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js +2 -0
  327. package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js.map +1 -0
  328. package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js +2 -0
  329. package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js.map +1 -0
  330. package/dist/chunks/pass.fragment--XRaXRhU.esm.js +15 -0
  331. package/dist/chunks/pass.fragment--XRaXRhU.esm.js.map +1 -0
  332. package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js +2 -0
  333. package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js.map +1 -0
  334. package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js +2 -0
  335. package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js.map +1 -0
  336. package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js +15 -0
  337. package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js.map +1 -0
  338. package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js +3269 -0
  339. package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js.map +1 -0
  340. package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js +2 -0
  341. package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js.map +1 -0
  342. package/dist/chunks/pbr.fragment-fky04gH_.esm.js +3222 -0
  343. package/dist/chunks/pbr.fragment-fky04gH_.esm.js.map +1 -0
  344. package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js +2 -0
  345. package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js.map +1 -0
  346. package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js +223 -0
  347. package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js.map +1 -0
  348. package/dist/chunks/pbr.vertex-BXcMYADF.esm.js +348 -0
  349. package/dist/chunks/pbr.vertex-BXcMYADF.esm.js.map +1 -0
  350. package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js +2 -0
  351. package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js.map +1 -0
  352. package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js +2 -0
  353. package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js.map +1 -0
  354. package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js +2 -0
  355. package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js.map +1 -0
  356. package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js +20 -0
  357. package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js.map +1 -0
  358. package/dist/chunks/rawTexture-CWiRIto8.esm.js +191 -0
  359. package/dist/chunks/rawTexture-CWiRIto8.esm.js.map +1 -0
  360. package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js +2 -0
  361. package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js.map +1 -0
  362. package/dist/chunks/ray-ix7SqYNQ.esm.min.js +2 -0
  363. package/dist/chunks/ray-ix7SqYNQ.esm.min.js.map +1 -0
  364. package/dist/chunks/ray-nTZBkOil.esm.js +946 -0
  365. package/dist/chunks/ray-nTZBkOil.esm.js.map +1 -0
  366. package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js +2 -0
  367. package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js.map +1 -0
  368. package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js +13 -0
  369. package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js.map +1 -0
  370. package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js +2 -0
  371. package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js.map +1 -0
  372. package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js +13 -0
  373. package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js.map +1 -0
  374. package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js +13 -0
  375. package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js.map +1 -0
  376. package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js +2 -0
  377. package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js.map +1 -0
  378. package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js +13 -0
  379. package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js.map +1 -0
  380. package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js +2 -0
  381. package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js.map +1 -0
  382. package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js +2 -0
  383. package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js.map +1 -0
  384. package/dist/chunks/splatFileLoader-Dp33YOem.esm.js +3379 -0
  385. package/dist/chunks/splatFileLoader-Dp33YOem.esm.js.map +1 -0
  386. package/dist/chunks/spotLight-C0NmKeem.esm.js +701 -0
  387. package/dist/chunks/spotLight-C0NmKeem.esm.js.map +1 -0
  388. package/dist/chunks/spotLight-CcuCNdES.esm.min.js +2 -0
  389. package/dist/chunks/spotLight-CcuCNdES.esm.min.js.map +1 -0
  390. package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js +2 -0
  391. package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js.map +1 -0
  392. package/dist/chunks/standardMaterial-v_D8QA4q.esm.js +1807 -0
  393. package/dist/chunks/standardMaterial-v_D8QA4q.esm.js.map +1 -0
  394. package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js +2 -0
  395. package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js.map +1 -0
  396. package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js +238 -0
  397. package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js.map +1 -0
  398. package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js +349 -0
  399. package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js.map +1 -0
  400. package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js +2 -0
  401. package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js.map +1 -0
  402. package/dist/chunks/thinEngine-DksimP2U.esm.js +3848 -0
  403. package/dist/chunks/thinEngine-DksimP2U.esm.js.map +1 -0
  404. package/dist/chunks/thinEngine-tsALaFYH.esm.min.js +2 -0
  405. package/dist/chunks/thinEngine-tsALaFYH.esm.min.js.map +1 -0
  406. package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js +314 -0
  407. package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js.map +1 -0
  408. package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js +2 -0
  409. package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js.map +1 -0
  410. package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js +2 -0
  411. package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js.map +1 -0
  412. package/dist/chunks/vertexColorMixing-D9917nJN.esm.js +428 -0
  413. package/dist/chunks/vertexColorMixing-D9917nJN.esm.js.map +1 -0
  414. package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js +2 -0
  415. package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js.map +1 -0
  416. package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js +538 -0
  417. package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js.map +1 -0
  418. package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js +2 -0
  419. package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js.map +1 -0
  420. package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js +11533 -0
  421. package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js.map +1 -0
  422. package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
  423. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
  424. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
  425. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
  426. package/lib/index.d.ts +591 -0
  427. package/lib/index.js +2165 -0
  428. package/lib/index.js.map +1 -0
  429. package/package.json +19 -28
  430. package/readme.md +28 -28
  431. package/configuration/configuration.d.ts +0 -107
  432. package/configuration/configuration.js +0 -16
  433. package/configuration/configuration.js.map +0 -1
  434. package/configuration/configurationCompatibility.d.ts +0 -8
  435. package/configuration/configurationCompatibility.js +0 -66
  436. package/configuration/configurationCompatibility.js.map +0 -1
  437. package/configuration/configurationContainer.d.ts +0 -10
  438. package/configuration/configurationContainer.js +0 -10
  439. package/configuration/configurationContainer.js.map +0 -1
  440. package/configuration/globals.d.ts +0 -6
  441. package/configuration/globals.js +0 -18
  442. package/configuration/globals.js.map +0 -1
  443. package/configuration/index.d.ts +0 -2
  444. package/configuration/index.js +0 -4
  445. package/configuration/index.js.map +0 -1
  446. package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
  447. package/configuration/interfaces/cameraConfiguration.js +0 -2
  448. package/configuration/interfaces/cameraConfiguration.js.map +0 -1
  449. package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
  450. package/configuration/interfaces/colorGradingConfiguration.js +0 -2
  451. package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
  452. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
  453. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
  454. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
  455. package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
  456. package/configuration/interfaces/environmentMapConfiguration.js +0 -2
  457. package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
  458. package/configuration/interfaces/groundConfiguration.d.ts +0 -24
  459. package/configuration/interfaces/groundConfiguration.js +0 -2
  460. package/configuration/interfaces/groundConfiguration.js.map +0 -1
  461. package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
  462. package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
  463. package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
  464. package/configuration/interfaces/index.d.ts +0 -15
  465. package/configuration/interfaces/index.js +0 -16
  466. package/configuration/interfaces/index.js.map +0 -1
  467. package/configuration/interfaces/lightConfiguration.d.ts +0 -60
  468. package/configuration/interfaces/lightConfiguration.js +0 -2
  469. package/configuration/interfaces/lightConfiguration.js.map +0 -1
  470. package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
  471. package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
  472. package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
  473. package/configuration/interfaces/modelConfiguration.d.ts +0 -65
  474. package/configuration/interfaces/modelConfiguration.js +0 -2
  475. package/configuration/interfaces/modelConfiguration.js.map +0 -1
  476. package/configuration/interfaces/observersConfiguration.d.ts +0 -5
  477. package/configuration/interfaces/observersConfiguration.js +0 -2
  478. package/configuration/interfaces/observersConfiguration.js.map +0 -1
  479. package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
  480. package/configuration/interfaces/sceneConfiguration.js +0 -2
  481. package/configuration/interfaces/sceneConfiguration.js.map +0 -1
  482. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
  483. package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
  484. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
  485. package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
  486. package/configuration/interfaces/skyboxConfiguration.js +0 -2
  487. package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
  488. package/configuration/interfaces/templateConfiguration.d.ts +0 -67
  489. package/configuration/interfaces/templateConfiguration.js +0 -2
  490. package/configuration/interfaces/templateConfiguration.js.map +0 -1
  491. package/configuration/interfaces/vrConfiguration.d.ts +0 -16
  492. package/configuration/interfaces/vrConfiguration.js +0 -2
  493. package/configuration/interfaces/vrConfiguration.js.map +0 -1
  494. package/configuration/loader.d.ts +0 -4
  495. package/configuration/loader.js +0 -17
  496. package/configuration/loader.js.map +0 -1
  497. package/configuration/mappers.d.ts +0 -43
  498. package/configuration/mappers.js +0 -193
  499. package/configuration/mappers.js.map +0 -1
  500. package/configuration/renderOnlyLoader.d.ts +0 -33
  501. package/configuration/renderOnlyLoader.js +0 -162
  502. package/configuration/renderOnlyLoader.js.map +0 -1
  503. package/configuration/types/default.d.ts +0 -6
  504. package/configuration/types/default.js +0 -121
  505. package/configuration/types/default.js.map +0 -1
  506. package/configuration/types/environmentMap.d.ts +0 -5
  507. package/configuration/types/environmentMap.js +0 -14
  508. package/configuration/types/environmentMap.js.map +0 -1
  509. package/configuration/types/extended.d.ts +0 -6
  510. package/configuration/types/extended.js +0 -317
  511. package/configuration/types/extended.js.map +0 -1
  512. package/configuration/types/index.d.ts +0 -14
  513. package/configuration/types/index.js +0 -51
  514. package/configuration/types/index.js.map +0 -1
  515. package/configuration/types/minimal.d.ts +0 -6
  516. package/configuration/types/minimal.js +0 -43
  517. package/configuration/types/minimal.js.map +0 -1
  518. package/configuration/types/renderOnlyDefault.d.ts +0 -30
  519. package/configuration/types/renderOnlyDefault.js +0 -31
  520. package/configuration/types/renderOnlyDefault.js.map +0 -1
  521. package/configuration/types/shadowLight.d.ts +0 -9
  522. package/configuration/types/shadowLight.js +0 -64
  523. package/configuration/types/shadowLight.js.map +0 -1
  524. package/helper/index.d.ts +0 -29
  525. package/helper/index.js +0 -66
  526. package/helper/index.js.map +0 -1
  527. package/index.d.ts +0 -30
  528. package/index.js +0 -46
  529. package/index.js.map +0 -1
  530. package/initializer.d.ts +0 -11
  531. package/initializer.js +0 -35
  532. package/initializer.js.map +0 -1
  533. package/interfaces.d.ts +0 -5
  534. package/interfaces.js +0 -7
  535. package/interfaces.js.map +0 -1
  536. package/labs/environmentSerializer.d.ts +0 -126
  537. package/labs/environmentSerializer.js +0 -191
  538. package/labs/environmentSerializer.js.map +0 -1
  539. package/labs/texture.d.ts +0 -183
  540. package/labs/texture.js +0 -351
  541. package/labs/texture.js.map +0 -1
  542. package/labs/viewerLabs.d.ts +0 -51
  543. package/labs/viewerLabs.js +0 -134
  544. package/labs/viewerLabs.js.map +0 -1
  545. package/loader/modelLoader.d.ts +0 -56
  546. package/loader/modelLoader.js +0 -202
  547. package/loader/modelLoader.js.map +0 -1
  548. package/loader/plugins/applyMaterialConfig.d.ts +0 -12
  549. package/loader/plugins/applyMaterialConfig.js +0 -16
  550. package/loader/plugins/applyMaterialConfig.js.map +0 -1
  551. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
  552. package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
  553. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
  554. package/loader/plugins/index.d.ts +0 -19
  555. package/loader/plugins/index.js +0 -44
  556. package/loader/plugins/index.js.map +0 -1
  557. package/loader/plugins/loaderPlugin.d.ts +0 -24
  558. package/loader/plugins/loaderPlugin.js +0 -2
  559. package/loader/plugins/loaderPlugin.js.map +0 -1
  560. package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
  561. package/loader/plugins/msftLodLoaderPlugin.js +0 -21
  562. package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
  563. package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
  564. package/loader/plugins/telemetryLoaderPlugin.js +0 -36
  565. package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
  566. package/managers/observablesManager.d.ts +0 -66
  567. package/managers/observablesManager.js +0 -35
  568. package/managers/observablesManager.js.map +0 -1
  569. package/managers/sceneManager.d.ts +0 -245
  570. package/managers/sceneManager.js +0 -1375
  571. package/managers/sceneManager.js.map +0 -1
  572. package/managers/telemetryManager.d.ts +0 -78
  573. package/managers/telemetryManager.js +0 -117
  574. package/managers/telemetryManager.js.map +0 -1
  575. package/model/modelAnimation.d.ts +0 -215
  576. package/model/modelAnimation.js +0 -237
  577. package/model/modelAnimation.js.map +0 -1
  578. package/model/viewerModel.d.ts +0 -233
  579. package/model/viewerModel.js +0 -673
  580. package/model/viewerModel.js.map +0 -1
  581. package/optimizer/custom/extended.d.ts +0 -13
  582. package/optimizer/custom/extended.js +0 -101
  583. package/optimizer/custom/extended.js.map +0 -1
  584. package/optimizer/custom/index.d.ts +0 -9
  585. package/optimizer/custom/index.js +0 -26
  586. package/optimizer/custom/index.js.map +0 -1
  587. package/renderOnlyIndex.d.ts +0 -11
  588. package/renderOnlyIndex.js +0 -18
  589. package/renderOnlyIndex.js.map +0 -1
  590. package/templating/eventManager.d.ts +0 -35
  591. package/templating/eventManager.js +0 -66
  592. package/templating/eventManager.js.map +0 -1
  593. package/templating/plugins/hdButtonPlugin.d.ts +0 -9
  594. package/templating/plugins/hdButtonPlugin.js +0 -22
  595. package/templating/plugins/hdButtonPlugin.js.map +0 -1
  596. package/templating/plugins/printButton.d.ts +0 -9
  597. package/templating/plugins/printButton.js +0 -41
  598. package/templating/plugins/printButton.js.map +0 -1
  599. package/templating/templateManager.d.ts +0 -197
  600. package/templating/templateManager.js +0 -561
  601. package/templating/templateManager.js.map +0 -1
  602. package/templating/viewerTemplatePlugin.d.ts +0 -21
  603. package/templating/viewerTemplatePlugin.js +0 -69
  604. package/templating/viewerTemplatePlugin.js.map +0 -1
  605. package/viewer/defaultViewer.d.ts +0 -130
  606. package/viewer/defaultViewer.js +0 -672
  607. package/viewer/defaultViewer.js.map +0 -1
  608. package/viewer/renderOnlyViewer.d.ts +0 -9
  609. package/viewer/renderOnlyViewer.js +0 -46
  610. package/viewer/renderOnlyViewer.js.map +0 -1
  611. package/viewer/viewer.d.ts +0 -258
  612. package/viewer/viewer.js +0 -783
  613. package/viewer/viewer.js.map +0 -1
  614. package/viewer/viewerManager.d.ts +0 -58
  615. package/viewer/viewerManager.js +0 -91
  616. package/viewer/viewerManager.js.map +0 -1
  617. package/viewer/viewerWithTemplate.d.ts +0 -9
  618. package/viewer/viewerWithTemplate.js +0 -20
  619. package/viewer/viewerWithTemplate.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{an as e,ar as t,be as s,T as n,bf as i,v as o,aV as r,aW as a,bg as l,a5 as h,bh as c,aZ as d,R as u,bi as _,A as p,u as m,ag as f,ac as g,aX as y,a7 as b,E as x,bj as A,L as v,aT as M,C as T,bk as R,a1 as w,bl as C,V as k,t as O,at as P,bm as S,bn as E,bo as I,bp as L,bq as D,br as N,y as F,aR as B,aQ as $,aw as U,bs as V,M as G,l as W,bt as Y,bu as X,w as Z,Y as z,j,a$ as K,s as q,bv as H,bw as Q,bx as J,aS as ee}from"./index-rZVkfTE6.esm.min.js";import{R as te}from"./rawTexture-DX8V9PEj.esm.min.js";import{A as se}from"./assetContainer-7pMDUaac.esm.min.js";import{n as ne}from"./glTFLoaderAnimation-BB_Vw079.esm.min.js";class ie{constructor(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this.rotationSpeed=.5,this.keysRotateLeft=[],this.keysRotateRight=[],this.keysRotateUp=[],this.keysRotateDown=[],this._keys=new Array}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add((()=>{this._keys.length=0})),this._onKeyboardObserver=this._scene.onKeyboardObservable.add((t=>{const s=t.event;if(!s.metaKey)if(t.type===i.KEYDOWN){if(-1!==this.keysUp.indexOf(s.keyCode)||-1!==this.keysDown.indexOf(s.keyCode)||-1!==this.keysLeft.indexOf(s.keyCode)||-1!==this.keysRight.indexOf(s.keyCode)||-1!==this.keysUpward.indexOf(s.keyCode)||-1!==this.keysDownward.indexOf(s.keyCode)||-1!==this.keysRotateLeft.indexOf(s.keyCode)||-1!==this.keysRotateRight.indexOf(s.keyCode)||-1!==this.keysRotateUp.indexOf(s.keyCode)||-1!==this.keysRotateDown.indexOf(s.keyCode)){-1===this._keys.indexOf(s.keyCode)&&this._keys.push(s.keyCode),e||s.preventDefault()}}else if(-1!==this.keysUp.indexOf(s.keyCode)||-1!==this.keysDown.indexOf(s.keyCode)||-1!==this.keysLeft.indexOf(s.keyCode)||-1!==this.keysRight.indexOf(s.keyCode)||-1!==this.keysUpward.indexOf(s.keyCode)||-1!==this.keysDownward.indexOf(s.keyCode)||-1!==this.keysRotateLeft.indexOf(s.keyCode)||-1!==this.keysRotateRight.indexOf(s.keyCode)||-1!==this.keysRotateUp.indexOf(s.keyCode)||-1!==this.keysRotateDown.indexOf(s.keyCode)){const t=this._keys.indexOf(s.keyCode);t>=0&&this._keys.splice(t,1),e||s.preventDefault()}})))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t<this._keys.length;t++){const s=this._keys[t],n=e._computeLocalCameraSpeed();-1!==this.keysLeft.indexOf(s)?e._localDirection.copyFromFloats(-n,0,0):-1!==this.keysUp.indexOf(s)?e._localDirection.copyFromFloats(0,0,n):-1!==this.keysRight.indexOf(s)?e._localDirection.copyFromFloats(n,0,0):-1!==this.keysDown.indexOf(s)?e._localDirection.copyFromFloats(0,0,-n):-1!==this.keysUpward.indexOf(s)?e._localDirection.copyFromFloats(0,n,0):-1!==this.keysDownward.indexOf(s)?e._localDirection.copyFromFloats(0,-n,0):-1!==this.keysRotateLeft.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y-=this._getLocalRotation()):-1!==this.keysRotateRight.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.y+=this._getLocalRotation()):-1!==this.keysRotateUp.indexOf(s)?(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x-=this._getLocalRotation()):-1!==this.keysRotateDown.indexOf(s)&&(e._localDirection.copyFromFloats(0,0,0),e.cameraRotation.x+=this._getLocalRotation()),e.getScene().useRightHandedSystem&&(e._localDirection.z*=-1),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),o.TransformNormalToRef(e._localDirection,e._cameraTransformMatrix,e._transformedDirection),e.cameraDirection.addInPlace(e._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){const e=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*e}}e([t()],ie.prototype,"keysUp",void 0),e([t()],ie.prototype,"keysUpward",void 0),e([t()],ie.prototype,"keysDown",void 0),e([t()],ie.prototype,"keysDownward",void 0),e([t()],ie.prototype,"keysLeft",void 0),e([t()],ie.prototype,"keysRight",void 0),e([t()],ie.prototype,"rotationSpeed",void 0),e([t()],ie.prototype,"keysRotateLeft",void 0),e([t()],ie.prototype,"keysRotateRight",void 0),e([t()],ie.prototype,"keysRotateUp",void 0),e([t()],ie.prototype,"keysRotateDown",void 0),s.FreeCameraKeyboardMoveInput=ie;class oe{constructor(e=!0){this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this._previousPosition=null,this.onPointerMovedObservable=new r,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),s=t.getInputElement();this._pointerInput||(this._pointerInput=n=>{const i=n.event,o="touch"===i.pointerType;if(!this.touchEnabled&&o)return;if(n.type!==a.POINTERMOVE&&-1===this.buttons.indexOf(i.button))return;const r=i.target;if(n.type===a.POINTERDOWN){if(o&&-1!==this._activePointerId||!o&&-1!==this._currentActiveButton)return;this._activePointerId=i.pointerId;try{r?.setPointerCapture(i.pointerId)}catch(e){}-1===this._currentActiveButton&&(this._currentActiveButton=i.button),this._previousPosition={x:i.clientX,y:i.clientY},e||(i.preventDefault(),s&&s.focus()),t.isPointerLock&&this._onMouseMove&&this._onMouseMove(n.event)}else if(n.type===a.POINTERUP){if(o&&this._activePointerId!==i.pointerId||!o&&this._currentActiveButton!==i.button)return;try{r?.releasePointerCapture(i.pointerId)}catch(e){}this._currentActiveButton=-1,this._previousPosition=null,e||i.preventDefault(),this._activePointerId=-1}else if(n.type===a.POINTERMOVE&&(this._activePointerId===i.pointerId||!o))if(t.isPointerLock&&this._onMouseMove)this._onMouseMove(n.event);else if(this._previousPosition){const t=this.camera._calculateHandednessMultiplier(),s=(i.clientX-this._previousPosition.x)*t,n=i.clientY-this._previousPosition.y;this._allowCameraRotation&&(this.camera.cameraRotation.y+=s/this.angularSensibility,this.camera.cameraRotation.x+=n/this.angularSensibility),this.onPointerMovedObservable.notifyObservers({offsetX:s,offsetY:n}),this._previousPosition={x:i.clientX,y:i.clientY},e||i.preventDefault()}}),this._onMouseMove=s=>{if(!t.isPointerLock)return;const n=this.camera._calculateHandednessMultiplier(),i=s.movementX*n;this.camera.cameraRotation.y+=i/this.angularSensibility;const o=s.movementY;this.camera.cameraRotation.x+=o/this.angularSensibility,this._previousPosition=null,e||s.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,a.POINTERDOWN|a.POINTERUP|a.POINTERMOVE),s&&(this._contextMenuBind=e=>this.onContextMenu(e),s.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(e){e.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}}e([t()],oe.prototype,"buttons",void 0),e([t()],oe.prototype,"angularSensibility",void 0),s.FreeCameraMouseInput=oe;class re{constructor(){this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new r,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==a.POINTERWHEEL)return;const s=t.event,n=s.deltaMode===l.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*n*s.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*n*s.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*n*s.deltaZ/this._normalize,s.preventDefault&&(e||s.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,a.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}}var ae,le,he,ce;e([t()],re.prototype,"wheelPrecisionX",void 0),e([t()],re.prototype,"wheelPrecisionY",void 0),e([t()],re.prototype,"wheelPrecisionZ",void 0),function(e){e[e.MoveRelative=0]="MoveRelative",e[e.RotateRelative=1]="RotateRelative",e[e.MoveScene=2]="MoveScene"}(ae||(ae={}));class de extends re{constructor(){super(...arguments),this._moveRelative=o.Zero(),this._rotateRelative=o.Zero(),this._moveScene=o.Zero(),this._wheelXAction=ae.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=ae.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(e){null===e&&this._wheelXAction!==ae.MoveRelative||(this._wheelXAction=ae.MoveRelative,this._wheelXActionCoordinate=e)}get wheelXMoveRelative(){return this._wheelXAction!==ae.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(e){null===e&&this._wheelYAction!==ae.MoveRelative||(this._wheelYAction=ae.MoveRelative,this._wheelYActionCoordinate=e)}get wheelYMoveRelative(){return this._wheelYAction!==ae.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(e){null===e&&this._wheelZAction!==ae.MoveRelative||(this._wheelZAction=ae.MoveRelative,this._wheelZActionCoordinate=e)}get wheelZMoveRelative(){return this._wheelZAction!==ae.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(e){null===e&&this._wheelXAction!==ae.RotateRelative||(this._wheelXAction=ae.RotateRelative,this._wheelXActionCoordinate=e)}get wheelXRotateRelative(){return this._wheelXAction!==ae.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(e){null===e&&this._wheelYAction!==ae.RotateRelative||(this._wheelYAction=ae.RotateRelative,this._wheelYActionCoordinate=e)}get wheelYRotateRelative(){return this._wheelYAction!==ae.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(e){null===e&&this._wheelZAction!==ae.RotateRelative||(this._wheelZAction=ae.RotateRelative,this._wheelZActionCoordinate=e)}get wheelZRotateRelative(){return this._wheelZAction!==ae.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(e){null===e&&this._wheelXAction!==ae.MoveScene||(this._wheelXAction=ae.MoveScene,this._wheelXActionCoordinate=e)}get wheelXMoveScene(){return this._wheelXAction!==ae.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(e){null===e&&this._wheelYAction!==ae.MoveScene||(this._wheelYAction=ae.MoveScene,this._wheelYActionCoordinate=e)}get wheelYMoveScene(){return this._wheelYAction!==ae.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(e){null===e&&this._wheelZAction!==ae.MoveScene||(this._wheelZAction=ae.MoveScene,this._wheelZActionCoordinate=e)}get wheelZMoveScene(){return this._wheelZAction!==ae.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){if(0===this._wheelDeltaX&&0===this._wheelDeltaY&&0==this._wheelDeltaZ)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const e=h.Zero();this.camera.getViewMatrix().invertToRef(e);const t=o.Zero();o.TransformNormalToRef(this._moveRelative,e,t),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(t),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(e,t,s){if(0===e)return;if(null===t||null===s)return;let n=null;switch(t){case ae.MoveRelative:n=this._moveRelative;break;case ae.RotateRelative:n=this._rotateRelative;break;case ae.MoveScene:n=this._moveScene}switch(s){case 0:n.set(e,0,0);break;case 1:n.set(0,e,0);break;case 2:n.set(0,0,e)}}}e([t()],de.prototype,"wheelXMoveRelative",null),e([t()],de.prototype,"wheelYMoveRelative",null),e([t()],de.prototype,"wheelZMoveRelative",null),e([t()],de.prototype,"wheelXRotateRelative",null),e([t()],de.prototype,"wheelYRotateRelative",null),e([t()],de.prototype,"wheelZRotateRelative",null),e([t()],de.prototype,"wheelXMoveScene",null),e([t()],de.prototype,"wheelYMoveScene",null),e([t()],de.prototype,"wheelZMoveScene",null),s.FreeCameraMouseWheelInput=de;class ue{constructor(e=!1){this.allowMouse=e,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this.singleFingerRotate=!1,this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=n.IsSafari()}attachControl(e){e=n.BackCompatCameraNoPreventDefault(arguments);let t=null;if(void 0===this._pointerInput&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=s=>{const n=s.event,i="mouse"===n.pointerType||this._isSafari&&void 0===n.pointerType;if(this.allowMouse||!i)if(s.type===a.POINTERDOWN){if(e||n.preventDefault(),this._pointerPressed.push(n.pointerId),1!==this._pointerPressed.length)return;t={x:n.clientX,y:n.clientY}}else if(s.type===a.POINTERUP){e||n.preventDefault();const s=this._pointerPressed.indexOf(n.pointerId);if(-1===s)return;if(this._pointerPressed.splice(s,1),0!=s)return;t=null,this._offsetX=null,this._offsetY=null}else if(s.type===a.POINTERMOVE){if(e||n.preventDefault(),!t)return;if(0!=this._pointerPressed.indexOf(n.pointerId))return;this._offsetX=n.clientX-t.x,this._offsetY=-(n.clientY-t.y)}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,a.POINTERDOWN|a.POINTERUP|a.POINTERMOVE),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const e=this.camera.getEngine().getInputElement();e&&e.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){if(null===this._offsetX||null===this._offsetY)return;if(0===this._offsetX&&0===this._offsetY)return;const e=this.camera,t=e._calculateHandednessMultiplier();e.cameraRotation.y=t*this._offsetX/this.touchAngularSensibility;if(this.singleFingerRotate&&1===this._pointerPressed.length||!this.singleFingerRotate&&this._pointerPressed.length>1)e.cameraRotation.x=-this._offsetY/this.touchAngularSensibility;else{const t=e._computeLocalCameraSpeed(),s=new o(0,0,0!==this.touchMoveSensibility?t*this._offsetY/this.touchMoveSensibility:0);h.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(o.TransformCoordinates(s,e._cameraRotationMatrix))}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}}e([t()],ue.prototype,"touchAngularSensibility",void 0),e([t()],ue.prototype,"touchMoveSensibility",void 0),s.FreeCameraTouchInput=ue;class _e extends c{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new ie),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new oe(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new de,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new ue),this}clear(){super.clear(),this._mouseInput=null}}class pe extends _{get angularSensibility(){const e=this.inputs.attached.mouse;return e?e.angularSensibility:0}set angularSensibility(e){const t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)}get keysUp(){const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysUpward(){const e=this.inputs.attached.keyboard;return e?e.keysUpward:[]}set keysUpward(e){const t=this.inputs.attached.keyboard;t&&(t.keysUpward=e)}get keysDown(){const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysDownward(){const e=this.inputs.attached.keyboard;return e?e.keysDownward:[]}set keysDownward(e){const t=this.inputs.attached.keyboard;t&&(t.keysDownward=e)}get keysLeft(){const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get keysRotateLeft(){const e=this.inputs.attached.keyboard;return e?e.keysRotateLeft:[]}set keysRotateLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateLeft=e)}get keysRotateRight(){const e=this.inputs.attached.keyboard;return e?e.keysRotateRight:[]}set keysRotateRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateRight=e)}get keysRotateUp(){const e=this.inputs.attached.keyboard;return e?e.keysRotateUp:[]}set keysRotateUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateUp=e)}get keysRotateDown(){const e=this.inputs.attached.keyboard;return e?e.keysRotateDown:[]}set keysRotateDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysRotateDown=e)}constructor(e,t,s,n=!0){super(e,t,s,n),this.ellipsoid=new o(.5,1,.5),this.ellipsoidOffset=new o(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this._needMoveForGravity=!1,this._oldPosition=o.Zero(),this._diffPosition=o.Zero(),this._newPosition=o.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(e,t,s=null)=>{this._newPosition.copyFrom(t),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>p.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&s&&this.onCollide(s))},this.inputs=new _e(this),this.inputs.addKeyboard().addMouse()}attachControl(e,t){t=n.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(t)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new o(0,0,0),this.cameraRotation=new m(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(e){this._collisionMask=isNaN(e)?-1:e}_collideWithWorld(e){let t;t=this.parent?o.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position,t.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const s=this.getScene().collisionCoordinator;this._collider||(this._collider=s.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let n=e;this.applyGravity&&(n=e.add(this.getScene().gravity)),s.getNewPosition(this._oldPosition,n,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=o.Zero(),this._transformedDirection=o.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(e){this._needMoveForGravity=e}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}}e([d()],pe.prototype,"ellipsoid",void 0),e([d()],pe.prototype,"ellipsoidOffset",void 0),e([t()],pe.prototype,"checkCollisions",void 0),e([t()],pe.prototype,"applyGravity",void 0),u("BABYLON.FreeCamera",pe);class me extends y{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,n=null,i=null,o=null,r=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._skeleton=t,this._localMatrix=n?.clone()??h.Identity(),this._restMatrix=i??this._localMatrix.clone(),this._bindMatrix=o??this._localMatrix.clone(),this._index=r,this._absoluteMatrix=new h,this._absoluteBindMatrix=new h,this._absoluteInverseBindMatrix=new h,this._finalMatrix=new h,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 null===this._index?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 e=this.parent.children.indexOf(this);-1!==e&&this.parent.children.splice(e,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=b.Vector3[0],t=b.Quaternion[0],s=b.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._absoluteMatrix}getAbsoluteTransform(){return this._absoluteMatrix}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=o.Zero(),this._localRotation=g.Zero(),this._localPosition=o.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))}_compose(){this._needToCompose&&(this._localScaling?(this._needToCompose=!1,h.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)}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 e=0;e<this.children.length;e++)this.children[e]._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,n=!0){const i=this.getLocalMatrix();if(0==t)n?(i.addAtIndex(12,e.x),i.addAtIndex(13,e.y),i.addAtIndex(14,e.z)):i.setTranslationFromFloats(e.x,e.y,e.z);else{let t=null;s&&(t=s.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const r=me._TmpMats[0],a=me._TmpVecs[0];this.parent?s&&t?(r.copyFrom(this.parent.getAbsoluteMatrix()),r.multiplyToRef(t,r)):r.copyFrom(this.parent.getAbsoluteMatrix()):h.IdentityToRef(r),n&&r.setTranslationFromFloats(0,0,0),r.invert(),o.TransformCoordinatesToRef(e,r,a),n?(i.addAtIndex(12,a.x),i.addAtIndex(13,a.y),i.addAtIndex(14,a.z)):i.setTranslationFromFloats(a.x,a.y,a.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,n=!1){const i=this.getLocalMatrix(),o=me._TmpMats[0];h.ScalingToRef(e,t,s,o),o.multiplyToRef(i,i),o.invert();for(const n of this.children){const i=n.getLocalMatrix();i.multiplyToRef(o,i),i.multiplyAtIndex(12,e),i.multiplyAtIndex(13,t),i.multiplyAtIndex(14,s),n._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),n)for(const i of this.children)i.scale(e,t,s,n)}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,n=0,i){if(0===n){const o=me._TmpQuat;return g.RotationYawPitchRollToRef(e,t,s,o),void this.setRotationQuaternion(o,n,i)}const o=me._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(o,i))return;const r=me._TmpMats[1];h.RotationYawPitchRollToRef(e,t,s,r),o.multiplyToRef(r,r),this._rotateWithMatrix(r,n,i)}rotate(e,t,s=0,n){const i=me._TmpMats[0];i.setTranslationFromFloats(0,0,0),h.RotationAxisToRef(e,t,i),this._rotateWithMatrix(i,s,n)}setAxisAngle(e,t,s=0,n){if(0===s){const i=me._TmpQuat;return g.RotationAxisToRef(e,t,i),void this.setRotationQuaternion(i,s,n)}const i=me._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(i,n))return;const o=me._TmpMats[1];h.RotationAxisToRef(e,t,o),i.multiplyToRef(o,o),this._rotateWithMatrix(o,s,n)}setRotation(e,t=0,s){this.setYawPitchRoll(e.y,e.x,e.z,t,s)}setRotationQuaternion(e,t=0,s){if(0===t)return this._decompose(),this._localRotation.copyFrom(e),void this._markAsDirtyAndCompose();const n=me._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(n,s))return;const i=me._TmpMats[1];h.FromQuaternionToRef(e,i),n.multiplyToRef(i,i),this._rotateWithMatrix(i,t,s)}setRotationMatrix(e,t=0,s){if(0===t){const n=me._TmpQuat;return g.FromRotationMatrixToRef(e,n),void this.setRotationQuaternion(n,t,s)}const n=me._TmpMats[0];if(!this._getAbsoluteInverseMatrixUnscaledToRef(n,s))return;const i=me._TmpMats[1];i.copyFrom(e),n.multiplyToRef(e,i),this._rotateWithMatrix(i,t,s)}_rotateWithMatrix(e,t=0,s){const n=this.getLocalMatrix(),i=n.m[12],o=n.m[13],r=n.m[14],a=this.getParent(),l=me._TmpMats[3],h=me._TmpMats[4];a&&1==t?(s?(l.copyFrom(s.getWorldMatrix()),a.getAbsoluteMatrix().multiplyToRef(l,l)):l.copyFrom(a.getAbsoluteMatrix()),h.copyFrom(l),h.invert(),n.multiplyToRef(l,n),n.multiplyToRef(e,n),n.multiplyToRef(h,n)):1==t&&s?(l.copyFrom(s.getWorldMatrix()),h.copyFrom(l),h.invert(),n.multiplyToRef(l,n),n.multiplyToRef(e,n),n.multiplyToRef(h,n)):n.multiplyToRef(e,n),n.setTranslationFromFloats(i,o,r),this.computeAbsoluteMatrices(),this._markAsDirtyAndDecompose()}_getAbsoluteInverseMatrixUnscaledToRef(e,t){const s=me._TmpMats[2];return e.copyFrom(this.getAbsoluteMatrix()),t?(e.multiplyToRef(t.getWorldMatrix(),e),h.ScalingToRef(t.scaling.x,t.scaling.y,t.scaling.z,s)):h.IdentityToRef(s),e.invert(),!isNaN(e.m[0])&&(s.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(s,e),!0)}getPosition(e=0,t=null){const s=o.Zero();return this.getPositionToRef(e,t,s),s}getPositionToRef(e=0,t,s){if(0==e){const e=this.getLocalMatrix();s.x=e.m[12],s.y=e.m[13],s.z=e.m[14]}else{let e=null;t&&(e=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();let n=me._TmpMats[0];t&&e?(n.copyFrom(this.getAbsoluteMatrix()),n.multiplyToRef(e,n)):n=this.getAbsoluteMatrix(),s.x=n.m[12],s.y=n.m[13],s.z=n.m[14]}}getAbsolutePosition(e=null){const t=o.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 e=this._skeleton.getPoseMatrix();e&&this._absoluteMatrix.multiplyToRef(e,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=o.Zero();return this.getDirectionToRef(e,t,s),s}getDirectionToRef(e,t=null,s){let n=null;t&&(n=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const i=me._TmpMats[0];i.copyFrom(this.getAbsoluteMatrix()),t&&n&&i.multiplyToRef(n,i),o.TransformNormalToRef(e,i,s),s.normalize()}getRotation(e=0,t=null){const s=o.Zero();return this.getRotationToRef(e,t,s),s}getRotationToRef(e=0,t=null,s){const n=me._TmpQuat;this.getRotationQuaternionToRef(e,t,n),n.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(0==e)this._decompose(),s.copyFrom(this._localRotation);else{const e=me._TmpMats[0],n=this.getAbsoluteMatrix();t?n.multiplyToRef(t.getWorldMatrix(),e):e.copyFrom(n),e.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyAtIndex(1,this._scalingDeterminant),e.multiplyAtIndex(2,this._scalingDeterminant),e.decompose(void 0,s,void 0)}}getRotationMatrix(e=0,t){const s=h.Identity();return this.getRotationMatrixToRef(e,t,s),s}getRotationMatrixToRef(e=0,t,s){if(0==e)this.getLocalMatrix().getRotationMatrixToRef(s);else{const e=me._TmpMats[0],n=this.getAbsoluteMatrix();t?n.multiplyToRef(t.getWorldMatrix(),e):e.copyFrom(n),e.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyAtIndex(1,this._scalingDeterminant),e.multiplyAtIndex(2,this._scalingDeterminant),e.getRotationMatrixToRef(s)}}getAbsolutePositionFromLocal(e,t=null){const s=o.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,s),s}getAbsolutePositionFromLocalToRef(e,t=null,s){let n=null;t&&(n=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const i=me._TmpMats[0];i.copyFrom(this.getAbsoluteMatrix()),t&&n&&i.multiplyToRef(n,i),o.TransformCoordinatesToRef(e,i,s)}getLocalPositionFromAbsolute(e,t=null){const s=o.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,s),s}getLocalPositionFromAbsoluteToRef(e,t=null,s){let n=null;t&&(n=t.getWorldMatrix()),this._skeleton.computeAbsoluteMatrices();const i=me._TmpMats[0];i.copyFrom(this.getAbsoluteMatrix()),t&&n&&i.multiplyToRef(n,i),i.invert(),o.TransformCoordinatesToRef(e,i,s)}setCurrentPoseAsRest(){this.setRestMatrix(this.getLocalMatrix())}dispose(){this._linkedTransformNode=null;const e=this._skeleton.bones.indexOf(this);if(-1!==e&&this._skeleton.bones.splice(e,1),this._parentNode&&this._parentNode.children){const e=this._parentNode.children,t=e.indexOf(this);-1!==t&&e.splice(t,1)}super.dispose()}}me._TmpVecs=f(2,o.Zero),me._TmpQuat=g.Identity(),me._TmpMats=f(5,h.Identity);class fe{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=h.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 r,this.bones=[],this._scene=s||x.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;const n=this._scene.getEngine().getCaps();this._canUseTextureForBones=n.textureFloat&&n.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 e=!0;for(const s in this._ranges)e&&(t+=", ",e=!1),t+=s;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}createAnimationRange(e,t,s){if(!this._ranges[e]){this._ranges[e]=new A(e,t,s);for(let n=0,i=this.bones.length;n<i;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].createRange(e,t,s)}}deleteAnimationRange(e,t=!0){for(let s=0,n=this.bones.length;s<n;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 n=!0;const i=this._getHighestAnimationFrame()+1,o={},r=e.bones;let a,l;for(l=0,a=r.length;l<a;l++)o[r[l].name]=r[l];this.bones.length!==r.length&&(v.Warn(`copyAnimationRange: this rig has ${this.bones.length} bones, while source as ${r.length}`),n=!1);const h=s&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(l=0,a=this.bones.length;l<a;l++){const e=this.bones[l].name,r=o[e];r?n=n&&this.bones[l].copyAnimationRange(r,t,i,s,h):(v.Warn("copyAnimationRange: not same rig, missing source bone "+e),n=!1)}const c=e.getAnimationRange(t);return c&&(this._ranges[t]=new A(t,c.from+i,c.to+i)),n}returnToRest(){for(const e of this.bones)-1!==e._index&&e.returnToRest()}_getHighestAnimationFrame(){let e=0;for(let t=0,s=this.bones.length;t<s;t++)if(this.bones[t].animations[0]){const s=this.bones[t].animations[0].getHighestFrame();e<s&&(e=s)}return e}beginAnimation(e,t,s,n){const i=this.getAnimationRange(e);return i?this._scene.beginAnimation(this,i.from,i.to,t,s,n):null}static MakeAnimationAdditive(e,t=0,s){const n=e.getAnimationRange(s);if(!n)return null;const i=e._scene.getAllAnimatablesByTarget(e);let o=null;for(let e=0;e<i.length;e++){const t=i[e];if(t.fromFrame===n?.from&&t.toFrame===n?.to){o=t;break}}const r=e.getAnimatables();for(let e=0;e<r.length;e++){const n=r[e].animations;if(n)for(let e=0;e<n.length;e++)M.MakeAnimationAdditive(n[e],t,s)}return o&&(o.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 n=this.bones[s];n._childUpdateId++;const i=n.getParent();if(i?n.getLocalMatrix().multiplyToRef(i.getFinalMatrix(),n.getFinalMatrix()):t?n.getLocalMatrix().multiplyToRef(t,n.getFinalMatrix()):n.getFinalMatrix().copyFrom(n.getLocalMatrix()),-1!==n._index){const t=null===n._index?s:n._index;n.getAbsoluteInverseBindMatrix().multiplyToArray(n.getFinalMatrix(),e,16*t)}}this._identity.copyToArray(e,16*this.bones.length)}prepare(e=!1){if(!e){const e=this.getScene().getRenderId();if(this._currentRenderId===e)return;this._currentRenderId=e}if(this._numBonesWithLinkedTransformNode>0)for(const e of this.bones)if(e._linkedTransformNode){const t=e._linkedTransformNode;e.position=t.position,t.rotationQuaternion?e.rotationQuaternion=t.rotationQuaternion:e.rotation=t.rotation,e.scaling=t.scaling}if(this.needInitialSkinMatrix)for(const e of this._meshesWithPoseMatrix){const t=e.getPoseMatrix();let s=this._isDirty;if(e._bonesTransformMatrices&&e._bonesTransformMatrices.length===16*(this.bones.length+1)||(e._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1)),s=!0),s){if(this._synchronizedWithMesh!==e){this._synchronizedWithMesh=e;for(const e of this.bones)if(!e.getParent()){e.getBindMatrix().multiplyToRef(t,b.Matrix[1]),e._updateAbsoluteBindMatrices(b.Matrix[1])}if(this.isUsingTextureForMatrices){const t=4*(this.bones.length+1);e._transformMatrixTexture&&e._transformMatrixTexture.getSize().width===t||(e._transformMatrixTexture&&e._transformMatrixTexture.dispose(),e._transformMatrixTexture=te.CreateRGBATexture(e._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,T.TEXTURE_NEAREST_SAMPLINGMODE,T.TEXTURETYPE_FLOAT))}}this._computeTransformMatrices(e._bonesTransformMatrices,t),this.isUsingTextureForMatrices&&e._transformMatrixTexture&&e._transformMatrixTexture.update(e._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=te.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,T.TEXTURE_NEAREST_SAMPLINGMODE,T.TEXTURETYPE_FLOAT))),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 fe(e,t||e,this._scene);s.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let e=0;e<this.bones.length;e++){const t=this.bones[e];let n=null;const i=t.getParent();if(i){const e=this.bones.indexOf(i);n=s.bones[e]}const o=new me(t.name,s,n,t.getBindMatrix().clone(),t.getRestMatrix().clone());o._index=t._index,t._linkedTransformNode&&o.linkTransformNode(t._linkedTransformNode),R.DeepCopy(t.animations,o.animations)}if(this._ranges){s._ranges={};for(const e in this._ranges){const t=this._ranges[e];t&&(s._ranges[e]=t.clone())}}return this._isDirty=!0,s.prepare(!0),s}enableBlending(e=.01){this.bones.forEach((t=>{t.animations.forEach((t=>{t.enableBlending=!0,t.blendingSpeed=e}))}))}dispose(){if(this._meshesWithPoseMatrix.length=0,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,this.dimensionsAtRest&&(e.dimensionsAtRest=this.dimensionsAtRest.asArray()),e.bones=[],e.needInitialSkinMatrix=this.needInitialSkinMatrix;for(let t=0;t<this.bones.length;t++){const s=this.bones[t],n=s.getParent(),i={parentBoneIndex:n?this.bones.indexOf(n):-1,index:s.getIndex(),name:s.name,id:s.id,matrix:s.getBindMatrix().asArray(),rest:s.getRestMatrix().asArray(),linkedTransformNodeId:s.getTransformNode()?.id};e.bones.push(i),s.length&&(i.length=s.length),s.metadata&&(i.metadata=s.metadata),s.animations&&s.animations.length>0&&(i.animation=s.animations[0].serialize()),e.ranges=[];for(const t in this._ranges){const s=this._ranges[t];if(!s)continue;const n={};n.name=t,n.from=s.from,n.to=s.to,e.ranges.push(n)}}return e}static Parse(e,t){const s=new fe(e.name,e.id,t);let n;for(e.dimensionsAtRest&&(s.dimensionsAtRest=o.FromArray(e.dimensionsAtRest)),s.needInitialSkinMatrix=e.needInitialSkinMatrix,n=0;n<e.bones.length;n++){const t=e.bones[n],i=e.bones[n].index;let o=null;t.parentBoneIndex>-1&&(o=s.bones[t.parentBoneIndex]);const r=t.rest?h.FromArray(t.rest):null,a=new me(t.name,s,o,h.FromArray(t.matrix),r,null,i);void 0!==t.id&&null!==t.id&&(a.id=t.id),t.length&&(a.length=t.length),t.metadata&&(a.metadata=t.metadata),t.animation&&a.animations.push(M.Parse(t.animation)),void 0!==t.linkedTransformNodeId&&null!==t.linkedTransformNodeId&&(s._hasWaitingData=!0,a._waitingTransformNodeId=t.linkedTransformNodeId)}if(e.ranges)for(n=0;n<e.ranges.length;n++){const t=e.ranges[n];s.createAnimationRange(t.name,t.from,t.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 n=this.bones[e];if(!n)return;void 0===n._index&&(n._index=e);const i=n.getParent();i&&this._sortBones(this.bones.indexOf(i),t,s),t.push(n)}setCurrentPoseAsRest(){this.bones.forEach((e=>{e.setCurrentPoseAsRest()}))}}class ge{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(0===t||0===e)}get animationPropertiesOverride(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}constructor(e,t=0,s=null){this.name=e,this.animations=[],this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uv2s=null,this._uniqueId=0,this.onInfluenceChanged=new r,this._onDataLayoutChanged=new r,this._animationPropertiesOverride=null,this.id=e,this._scene=s||x.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 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: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}clone(){const e=w.Clone((()=>new ge(this.name,this.influence,this._scene)),this);return e._positions=this._positions,e._normals=this._normals,e._tangents=this._tangents,e._uvs=this._uvs,e._uv2s=this._uv2s,e}serialize(){const e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),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())),w.AppendSerializedAnimations(this,e),e}getClassName(){return"MorphTarget"}static Parse(e,t){const s=new ge(e.name,e.influence);if(s.setPositions(e.positions),null!=e.id&&(s.id=e.id),e.normals&&s.setNormals(e.normals),e.tangents&&s.setTangents(e.tangents),e.uvs&&s.setUVs(e.uvs),e.uv2s&&s.setUV2s(e.uv2s),e.animations){for(let t=0;t<e.animations.length;t++){const n=e.animations[t],i=C("BABYLON.Animation");i&&s.animations.push(i.Parse(n))}e.autoAnimate&&t&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1)}return s}static FromMesh(e,t,s){t||(t=e.name);const n=new ge(t,s,e.getScene());return n.setPositions(e.getVerticesData(k.PositionKind)),e.isVerticesDataPresent(k.NormalKind)&&n.setNormals(e.getVerticesData(k.NormalKind)),e.isVerticesDataPresent(k.TangentKind)&&n.setTangents(e.getVerticesData(k.TangentKind)),e.isVerticesDataPresent(k.UVKind)&&n.setUVs(e.getVerticesData(k.UVKind)),e.isVerticesDataPresent(k.UV2Kind)&&n.setUV2s(e.getVerticesData(k.UV2Kind)),n}}e([t()],ge.prototype,"id",void 0);class ye extends O{get depth(){return this._depth}constructor(e,t,s,n,i,o,r=!0,a=!1,l=O.TRILINEAR_SAMPLINGMODE,h=T.TEXTURETYPE_UNSIGNED_BYTE,c){super(null,o,!r,a),this.format=i,this._texture=o.getEngine().createRawTexture2DArray(e,t,s,n,i,r,a,l,null,h,c),this._depth=n,this.is2DArray=!0}update(e){this._texture&&this._getEngine().updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)}static CreateRGBATexture(e,t,s,n,i,o=!0,r=!1,a=T.TEXTURE_TRILINEAR_SAMPLINGMODE,l=T.TEXTURETYPE_UNSIGNED_BYTE){return new ye(e,t,s,n,T.TEXTUREFORMAT_RGBA,i,o,r,a,l)}}class be{set areUpdatesFrozen(e){e?this._blockCounter++:(this._blockCounter--,this._blockCounter<=0&&(this._blockCounter=0,this._mustSynchronize=!0,this._syncActiveTargets()))}get areUpdatesFrozen(){return this._blockCounter>0}constructor(e=null){if(this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new P(16),this._supportsPositions=!1,this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._supportsUV2s=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this._canUseTextureForTargets=!1,this._blockCounter=0,this._mustSynchronize=!0,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._numMaxInfluencers=0,this._useTextureToStoreTargets=!0,e||(e=x.LastCreatedScene),this._scene=e,this._scene){this._scene.addMorphTargetManager(this),this._uniqueId=this._scene.getUniqueId();const e=this._scene.getEngine().getCaps();this._canUseTextureForTargets=e.canUseGLVertexID&&e.textureFloat&&e.maxVertexTextureImageUnits>0&&e.texture2DArrayMaxLayerCount>1}}get numMaxInfluencers(){return 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 numTargets(){return this._targets.length}get numInfluencers(){return this._activeTargets.length}get influences(){return this._influences}get useTextureToStoreTargets(){return this._useTextureToStoreTargets}set useTextureToStoreTargets(e){this._useTextureToStoreTargets!==e&&(this._useTextureToStoreTargets=e,this._mustSynchronize=!0,this._syncActiveTargets())}get isUsingTextureForTargets(){return be.EnableTextureStorage&&this.useTextureToStoreTargets&&this._canUseTextureForTargets&&!this._scene?.getEngine().getCaps().disableMorphTargetTexture}getActiveTarget(e){return 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((e=>{this._syncActiveTargets(e)}))),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){e.setFloat3("morphTargetTextureInfo",this._textureVertexStride,this._textureWidth,this._textureHeight),e.setFloatArray("morphTargetTextureIndices",this._morphTargetTextureIndices),e.setTexture("morphTargets",this._targetStoreTexture),e.setInt("morphTargetCount",this.numInfluencers)}clone(){const e=new be(this._scene);for(const t of this._targets)e.addTarget(t.clone());return e.enableNormalMorphing=this.enableNormalMorphing,e.enableTangentMorphing=this.enableTangentMorphing,e.enableUVMorphing=this.enableUVMorphing,e.enableUV2Morphing=this.enableUV2Morphing,e}serialize(){const e={};e.id=this.uniqueId,e.targets=[];for(const t of this._targets)e.targets.push(t.serialize());return e}_syncActiveTargets(e=!1){if(this.areUpdatesFrozen)return;const t=!!this._targetStoreTexture,s=this.isUsingTextureForTargets;(this._mustSynchronize||t!==s)&&(this._mustSynchronize=!1,this.synchronize());let n=0;this._activeTargets.reset(),this._morphTargetTextureIndices&&this._morphTargetTextureIndices.length===this._targets.length||(this._morphTargetTextureIndices=new Float32Array(this._targets.length));let i=-1;for(const e of this._targets)if(i++,0!==e.influence||!this.optimizeInfluencers){if(this._activeTargets.length>=be.MaxActiveMorphTargetsInVertexAttributeMode&&!this.isUsingTextureForTargets)break;this._activeTargets.push(e),this._morphTargetTextureIndices[n]=i,this._tempInfluences[n++]=e.influence}this._morphTargetTextureIndices.length!==n&&(this._morphTargetTextureIndices=this._morphTargetTextureIndices.slice(0,n)),this._influences&&this._influences.length===n||(this._influences=new Float32Array(n));for(let e=0;e<n;e++)this._influences[e]=this._tempInfluences[e];if(e&&this._scene)for(const e of this._scene.meshes)e.morphTargetManager===this&&(s?e._markSubMeshesAsAttributesDirty():e._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._vertexCount=0,this._targetStoreTexture?.dispose(),this._targetStoreTexture=null,this.isUsingTextureForTargets&&this._targets.length>e.getCaps().texture2DArrayMaxLayerCount&&(this.useTextureToStoreTargets=!1);for(const e of this._targets){this._supportsPositions=this._supportsPositions&&e.hasPositions,this._supportsNormals=this._supportsNormals&&e.hasNormals,this._supportsTangents=this._supportsTangents&&e.hasTangents,this._supportsUVs=this._supportsUVs&&e.hasUVs,this._supportsUV2s=this._supportsUV2s&&e.hasUV2s;const t=e.vertexCount;if(0===this._vertexCount)this._vertexCount=t;else if(this._vertexCount!==t)return void v.Error(`Incompatible target. Targets must all have the same vertices count. Current vertex count: ${this._vertexCount}, vertex count for target "${e.name}": ${t}`)}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._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,n=new Float32Array(s*this._textureWidth*this._textureHeight*4);let i=0;for(let e=0;e<s;e++){const t=this._targets[e],s=t.getPositions(),o=t.getNormals(),r=t.getUVs(),a=t.getTangents(),l=t.getUV2s();i=e*this._textureWidth*this._textureHeight*4;for(let e=0;e<this._vertexCount;e++)this._supportsPositions&&s&&(n[i]=s[3*e],n[i+1]=s[3*e+1],n[i+2]=s[3*e+2],i+=4),this._supportsNormals&&o&&(n[i]=o[3*e],n[i+1]=o[3*e+1],n[i+2]=o[3*e+2],i+=4),this._supportsUVs&&r&&(n[i]=r[2*e],n[i+1]=r[2*e+1],i+=4),this._supportsTangents&&a&&(n[i]=a[3*e],n[i+1]=a[3*e+1],n[i+2]=a[3*e+2],i+=4),this._supportsUV2s&&l&&(n[i]=l[2*e],n[i+1]=l[2*e+1],i+=4)}this._targetStoreTexture=ye.CreateRGBATexture(n,this._textureWidth,this._textureHeight,s,this._scene,!1,!1,T.TEXTURE_NEAREST_SAMPLINGMODE,T.TEXTURETYPE_FLOAT),this._targetStoreTexture.name=`Morph texture_${this.uniqueId}`}for(const e of this._scene.meshes)e.morphTargetManager===this&&e._syncGeometryWithMorphTargetManager()}dispose(){if(this._targetStoreTexture&&this._targetStoreTexture.dispose(),this._targetStoreTexture=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 be(t);for(const n of e.targets)s.addTarget(ge.Parse(n,t));return s}}be.EnableTextureStorage=!0,be.MaxActiveMorphTargetsInVertexAttributeMode=8;class xe{constructor(e){this.byteOffset=0,this.buffer=e}loadAsync(e){return this.buffer.readAsync(this.byteOffset,e).then((e=>{this._dataView=new DataView(e.buffer,e.byteOffset,e.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 S(this.readUint8Array(e))}skipBytes(e){this._dataByteOffset+=e,this.byteOffset+=e}}function Ae(e,t,s,n){const i={externalResourceFunction:n};return s&&(i.uri="file:"===t?s:t+s),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,i):GLTFValidator.validateString(e,i)}function ve(){const e=[];onmessage=t=>{const s=t.data;switch(s.id){case"init":importScripts(s.url);break;case"validate":Ae(s.data,s.rootUrl,s.fileName,(t=>new Promise(((s,n)=>{const i=e.length;e.push({resolve:s,reject:n}),postMessage({id:"getExternalResource",index:i,uri:t})})))).then((e=>{postMessage({id:"validate.resolve",value:e})}),(e=>{postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[s.index].resolve(s.value);break;case"getExternalResource.reject":e[s.index].reject(s.reason)}}}class Me{static ValidateAsync(e,t,s,i){return"function"==typeof Worker?new Promise(((o,r)=>{const a=`${Ae}(${ve})()`,l=URL.createObjectURL(new Blob([a],{type:"application/javascript"})),h=new Worker(l),c=e=>{h.removeEventListener("error",c),h.removeEventListener("message",d),r(e)},d=e=>{const t=e.data;switch(t.id){case"getExternalResource":i(t.uri).then((e=>{h.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])}),(e=>{h.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":h.removeEventListener("error",c),h.removeEventListener("message",d),o(t.value),h.terminate();break;case"validate.reject":h.removeEventListener("error",c),h.removeEventListener("message",d),r(t.reason),h.terminate()}};if(h.addEventListener("error",c),h.addEventListener("message",d),h.postMessage({id:"init",url:n.GetBabylonScriptURL(this.Configuration.url)}),ArrayBuffer.isView(e)){const n=e.slice();h.postMessage({id:"validate",data:n,rootUrl:t,fileName:s},[n.buffer])}else h.postMessage({id:"validate",data:e,rootUrl:t,fileName:s})})):(this._LoadScriptPromise||(this._LoadScriptPromise=n.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((()=>Ae(e,t,s,i))))}}function Te(e,t,s){try{return Promise.resolve(new Uint8Array(e,t,s))}catch(e){return Promise.reject(e)}}Me.Configuration={url:`${n._DefaultCdnUrl}/gltf_validator.js`},function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(le||(le={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(he||(he={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(ce||(ce={}));class Re{constructor(){this.coordinateSystemMode=le.AUTO,this.animationStartMode=he.FIRST,this.loadNodeAnimations=!0,this.loadSkins=!0,this.loadMorphTargets=!0,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.useGltfTextureNames=!1,this.preprocessUrlAsync=e=>Promise.resolve(e),this.extensionOptions={}}copyFrom(e){e&&(this.onParsed=e.onParsed,this.coordinateSystemMode=e.coordinateSystemMode??this.coordinateSystemMode,this.animationStartMode=e.animationStartMode??this.animationStartMode,this.loadNodeAnimations=e.loadNodeAnimations??this.loadNodeAnimations,this.loadSkins=e.loadSkins??this.loadSkins,this.loadMorphTargets=e.loadMorphTargets??this.loadMorphTargets,this.compileMaterials=e.compileMaterials??this.compileMaterials,this.useClipPlane=e.useClipPlane??this.useClipPlane,this.compileShadowGenerators=e.compileShadowGenerators??this.compileShadowGenerators,this.transparencyAsCoverage=e.transparencyAsCoverage??this.transparencyAsCoverage,this.useRangeRequests=e.useRangeRequests??this.useRangeRequests,this.createInstances=e.createInstances??this.createInstances,this.alwaysComputeBoundingBox=e.alwaysComputeBoundingBox??this.alwaysComputeBoundingBox,this.loadAllMaterials=e.loadAllMaterials??this.loadAllMaterials,this.loadOnlyMaterials=e.loadOnlyMaterials??this.loadOnlyMaterials,this.skipMaterials=e.skipMaterials??this.skipMaterials,this.useSRGBBuffers=e.useSRGBBuffers??this.useSRGBBuffers,this.targetFps=e.targetFps??this.targetFps,this.alwaysComputeSkeletonRootNode=e.alwaysComputeSkeletonRootNode??this.alwaysComputeSkeletonRootNode,this.useGltfTextureNames=e.useGltfTextureNames??this.useGltfTextureNames,this.preprocessUrlAsync=e.preprocessUrlAsync??this.preprocessUrlAsync,this.customRootNode=e.customRootNode,this.onMeshLoaded=e.onMeshLoaded,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onCameraLoaded=e.onCameraLoaded,this.extensionOptions=e.extensionOptions??this.extensionOptions)}}class we extends Re{constructor(e){super(),this.onParsedObservable=new r,this.onMeshLoadedObservable=new r,this.onSkinLoadedObservable=new r,this.onTextureLoadedObservable=new r,this.onMaterialLoadedObservable=new r,this.onCameraLoadedObservable=new r,this.onCompleteObservable=new r,this.onErrorObservable=new r,this.onDisposeObservable=new r,this.onExtensionLoadedObservable=new r,this.validate=!1,this.onValidatedObservable=new r,this._loader=null,this._state=null,this._requests=new Array,this.name=E.name,this.extensions=E.extensions,this.onLoaderStateChangedObservable=new r,this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled,this.copyFrom(e)}set onParsed(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))}set onMeshLoaded(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))}set onSkinLoaded(e){this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add((t=>e(t.node,t.skinnedNode))))}set onTextureLoaded(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))}set onMaterialLoaded(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))}set onCameraLoaded(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))}set onComplete(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)}set onError(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onExtensionLoaded(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)}get loggingEnabled(){return this._loggingEnabled}set loggingEnabled(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)}get capturePerformanceCounters(){return this._capturePerformanceCounters}set capturePerformanceCounters(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))}set onValidated(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)}dispose(){this._loader&&(this._loader.dispose(),this._loader=null);for(const e of this._requests)e.abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=e=>Promise.resolve(e),this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()}loadFile(e,t,s,i,o,a,l,h){if(ArrayBuffer.isView(t))return this._loadBinary(e,t,s,i,l,h),null;this._progressCallback=o;const c=t.name||n.GetFilename(t);if(a){if(this.useRangeRequests){this.validate&&v.Warn("glTF validation is not supported when range requests are enabled");const s={abort:()=>{},onCompleteObservable:new r},n={readAsync:(s,n)=>new Promise(((i,o)=>{this._loadFile(e,t,(e=>{i(new Uint8Array(e))}),!0,(e=>{o(e)}),(e=>{e.setRequestHeader("Range",`bytes=${s}-${s+n-1}`)}))})),byteLength:0};return this._unpackBinaryAsync(new xe(n)).then((e=>{s.onCompleteObservable.notifyObservers(s),i(e)}),l?e=>l(void 0,e):void 0),s}return this._loadFile(e,t,(t=>{this._validate(e,new Uint8Array(t,0,t.byteLength),s,c),this._unpackBinaryAsync(new xe({readAsync:(e,s)=>Te(t,e,s),byteLength:t.byteLength})).then((e=>{i(e)}),l?e=>l(void 0,e):void 0)}),!0,l)}return this._loadFile(e,t,(t=>{try{this._validate(e,t,s,c),i({json:this._parseJson(t)})}catch{l&&l()}}),!1,l)}_loadBinary(e,t,s,n,i,o){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s,o),this._unpackBinaryAsync(new xe({readAsync:(e,s)=>function(e,t,s){try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+s>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,s))}catch(e){return Promise.reject(e)}}(t,e,s),byteLength:t.byteLength})).then((e=>{n(e)}),i?e=>i(void 0,e):void 0)}importMeshAsync(e,t,s,n,i,o){return Promise.resolve().then((()=>(this.onParsedObservable.notifyObservers(s),this.onParsedObservable.clear(),this._log(`Loading ${o||""}`),this._loader=this._getLoader(s),this._loader.importMeshAsync(e,t,null,s,n,i,o))))}loadAsync(e,t,s,n,i){return Promise.resolve().then((()=>(this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t),this._loader.loadAsync(e,t,s,n,i))))}loadAssetContainerAsync(e,t,s,n,i){return Promise.resolve().then((()=>{this.onParsedObservable.notifyObservers(t),this.onParsedObservable.clear(),this._log(`Loading ${i||""}`),this._loader=this._getLoader(t);const o=new se(e),r=[];this.onMaterialLoadedObservable.add((e=>{r.push(e)}));const a=[];this.onTextureLoadedObservable.add((e=>{a.push(e)}));const l=[];this.onCameraLoadedObservable.add((e=>{l.push(e)}));const h=[];return this.onMeshLoadedObservable.add((e=>{e.morphTargetManager&&h.push(e.morphTargetManager)})),this._loader.importMeshAsync(null,e,o,t,s,n,i).then((e=>(Array.prototype.push.apply(o.geometries,e.geometries),Array.prototype.push.apply(o.meshes,e.meshes),Array.prototype.push.apply(o.particleSystems,e.particleSystems),Array.prototype.push.apply(o.skeletons,e.skeletons),Array.prototype.push.apply(o.animationGroups,e.animationGroups),Array.prototype.push.apply(o.materials,r),Array.prototype.push.apply(o.textures,a),Array.prototype.push.apply(o.lights,e.lights),Array.prototype.push.apply(o.transformNodes,e.transformNodes),Array.prototype.push.apply(o.cameras,l),Array.prototype.push.apply(o.morphTargetManagers,h),o)))}))}canDirectLoad(e){return E.canDirectLoad(e)}directLoad(e,t){if(t.startsWith("base64,"+I)||t.startsWith(";base64,"+I)||t.startsWith("application/octet-stream;base64,"+I)||t.startsWith("model/gltf-binary;base64,"+I)){const s=L(t);return this._validate(e,new Uint8Array(s,0,s.byteLength)),this._unpackBinaryAsync(new xe({readAsync:(e,t)=>Te(s,e,t),byteLength:s.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})}createPlugin(e){return new we(e[E.name])}get loaderState(){return this._state}whenCompleteAsync(){return new Promise(((e,t)=>{this.onCompleteObservable.addOnce((()=>{e()})),this.onErrorObservable.addOnce((e=>{t(e)}))}))}_setState(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(ce[this._state]))}_loadFile(e,t,s,n,i,o){const r=e._loadFile(t,s,(e=>{this._onProgress(e,r)}),!0,n,i,o);return r.onCompleteObservable.add((()=>{r._lengthComputable=!0,r._total=r._loaded})),this._requests.push(r),r}_onProgress(e,t){if(!this._progressCallback)return;t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;let s=!0,n=0,i=0;for(const e of this._requests){if(void 0===e._lengthComputable||void 0===e._loaded||void 0===e._total)return;s=s&&e._lengthComputable,n+=e._loaded,i+=e._total}this._progressCallback({lengthComputable:s,loaded:n,total:s?i:0})}_validate(e,t,s="",i=""){this.validate&&(this._startPerformanceCounter("Validate JSON"),Me.ValidateAsync(t,s,i,(t=>this.preprocessUrlAsync(s+t).then((t=>e._loadFileAsync(t,void 0,!0,!0).then((e=>new Uint8Array(e,0,e.byteLength))))))).then((e=>{this._endPerformanceCounter("Validate JSON"),this.onValidatedObservable.notifyObservers(e),this.onValidatedObservable.clear()}),(e=>{this._endPerformanceCounter("Validate JSON"),n.Warn(`Failed to validate: ${e.message}`),this.onValidatedObservable.clear()})))}_getLoader(e){const t=e.json.asset||{};this._log(`Asset version: ${t.version}`),t.minVersion&&this._log(`Asset minimum version: ${t.minVersion}`),t.generator&&this._log(`Asset generator: ${t.generator}`);const s=we._parseVersion(t.version);if(!s)throw new Error("Invalid version: "+t.version);if(void 0!==t.minVersion){const e=we._parseVersion(t.minVersion);if(!e)throw new Error("Invalid minimum version: "+t.minVersion);if(we._compareVersion(e,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+t.minVersion)}const n={1:we._CreateGLTF1Loader,2:we._CreateGLTF2Loader}[s.major];if(!n)throw new Error("Unsupported version: "+t.version);return n(this)}_parseJson(e){this._startPerformanceCounter("Parse JSON"),this._log(`JSON length: ${e.length}`);const t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t}_unpackBinaryAsync(e){return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((()=>{const t=e.readUint32();if(1179937895!==t)throw new D("Unexpected magic: "+t,N.GLTFLoaderUnexpectedMagicError);const s=e.readUint32();this.loggingEnabled&&this._log(`Binary version: ${s}`);const n=e.readUint32();let i;switch(this.useRangeRequests||n===e.buffer.byteLength||v.Warn(`Length in header does not match actual data length: ${n} != ${e.buffer.byteLength}`),s){case 1:i=this._unpackBinaryV1Async(e,n);break;case 2:i=this._unpackBinaryV2Async(e,n);break;default:throw new Error("Unsupported version: "+s)}return this._endPerformanceCounter("Unpack Binary"),i}))}_unpackBinaryV1Async(e,t){const s=e.readUint32(),n=e.readUint32();if(0!==n)throw new Error(`Unexpected content format: ${n}`);const i=t-e.byteOffset,o={json:this._parseJson(e.readString(s)),bin:null};if(0!==i){const t=e.byteOffset;o.bin={readAsync:(s,n)=>e.buffer.readAsync(t+s,n),byteLength:i}}return Promise.resolve(o)}_unpackBinaryV2Async(e,t){const s=1313821514,n=5130562,i=e.readUint32();if(e.readUint32()!==s)throw new Error("First chunk format is not JSON");return e.byteOffset+i===t?e.loadAsync(i).then((()=>({json:this._parseJson(e.readString(i)),bin:null}))):e.loadAsync(i+8).then((()=>{const o={json:this._parseJson(e.readString(i)),bin:null},r=()=>{const i=e.readUint32();switch(e.readUint32()){case s:throw new Error("Unexpected JSON chunk");case n:{const t=e.byteOffset;o.bin={readAsync:(s,n)=>e.buffer.readAsync(t+s,n),byteLength:i},e.skipBytes(i);break}default:e.skipBytes(i)}return e.byteOffset!==t?e.loadAsync(8).then(r):Promise.resolve(o)};return r()}))}static _parseVersion(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};const t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null}static _compareVersion(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0}_logOpen(e){this._log(e),this._logIndentLevel++}_logClose(){--this._logIndentLevel}_logEnabled(e){const t=we._logSpaces.substring(0,2*this._logIndentLevel);v.Log(`${t}${e}`)}_logDisabled(e){}_startPerformanceCounterEnabled(e){n.StartPerformanceCounter(e)}_startPerformanceCounterDisabled(e){}_endPerformanceCounterEnabled(e){n.EndPerformanceCounter(e)}_endPerformanceCounterDisabled(e){}}we.IncrementalLoading=!0,we.HomogeneousCoordinates=!1,we._logSpaces=" ",F(new we);class Ce{static Get(e,t,s){if(!t||null==s||!t[s])throw new Error(`${e}: Failed to find index (${s})`);return t[s]}static TryGet(e,t){return e&&null!=t&&e[t]?e[t]:null}static Assign(e){if(e)for(let t=0;t<e.length;t++)e[t].index=t}}function ke(e){if(e.min&&e.max){const t=e.min,s=e.max,n=b.Vector3[0].copyFromFloats(t[0],t[1],t[2]),i=b.Vector3[1].copyFromFloats(s[0],s[1],s[2]);if(e.normalized&&5126!==e.componentType){let t=1;switch(e.componentType){case 5120:t=127;break;case 5121:t=255;break;case 5122:t=32767;break;case 5123:t=65535}const s=1/t;n.scaleInPlace(s),i.scaleInPlace(s)}return new ee(n,i)}return null}class Oe{static RegisterExtension(e,t){B(e,!1,t)}static UnregisterExtension(e){return $(e)}get gltf(){if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf}get bin(){return this._bin}get parent(){return this._parent}get babylonScene(){if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene}get rootBabylonMesh(){return this._rootBabylonMesh}get rootUrl(){return this._rootUrl}constructor(e){this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._parent=e}dispose(){this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach((e=>e.dispose&&e.dispose())),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())}importMeshAsync(e,t,s,n,i,o,r=""){return Promise.resolve().then((()=>{this._babylonScene=t,this._assetContainer=s,this._loadData(n);let o=null;if(e){const t={};if(this._gltf.nodes)for(const e of this._gltf.nodes)e.name&&(t[e.name]=e.index);o=(e instanceof Array?e:[e]).map((e=>{const s=t[e];if(void 0===s)throw new Error(`Failed to find node '${e}'`);return s}))}return this._loadAsync(i,r,o,(()=>({meshes:this._getMeshes(),particleSystems:[],skeletons:this._getSkeletons(),animationGroups:this._getAnimationGroups(),lights:this._babylonLights,transformNodes:this._getTransformNodes(),geometries:this._getGeometries(),spriteManagers:[]})))}))}loadAsync(e,t,s,n,i=""){return Promise.resolve().then((()=>(this._babylonScene=e,this._loadData(t),this._loadAsync(s,i,null,(()=>{})))))}_loadAsync(e,t,s,i){return Promise.resolve().then((async()=>{this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:`${e}${Date.now()}/`,this._fileName=t,this._allMaterialsDirtyRequired=!1,await this._loadExtensionsAsync();const o=`${ce[ce.LOADING]} => ${ce[ce.READY]}`,r=`${ce[ce.LOADING]} => ${ce[ce.COMPLETE]}`;this._parent._startPerformanceCounter(o),this._parent._startPerformanceCounter(r),this._parent._setState(ce.LOADING),this._extensionsOnLoading();const a=new Array,l=this._babylonScene.blockMaterialDirtyMechanism;if(this._babylonScene.blockMaterialDirtyMechanism=!0,!this.parent.loadOnlyMaterials)if(s)a.push(this.loadSceneAsync("/nodes",{nodes:s,index:-1}));else if(null!=this._gltf.scene||this._gltf.scenes&&this._gltf.scenes[0]){const e=Ce.Get("/scene",this._gltf.scenes,this._gltf.scene||0);a.push(this.loadSceneAsync(`/scenes/${e.index}`,e))}if(!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(let e=0;e<this._gltf.materials.length;++e){const t=this._gltf.materials[e],s="/materials/"+e,n=U.TriangleFillMode;a.push(this._loadMaterialAsync(s,t,null,n,(()=>{})))}this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=l:this._babylonScene._forceBlockMaterialDirtyMechanism(l),this._parent.compileMaterials&&a.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&a.push(this._compileShadowGeneratorsAsync());return Promise.all(a).then((()=>(this._rootBabylonMesh&&this._rootBabylonMesh!==this._parent.customRootNode&&this._rootBabylonMesh.setEnabled(!0),this._extensionsOnReady(),this._parent._setState(ce.READY),this._startAnimations(),i()))).then((e=>(this._parent._endPerformanceCounter(o),n.SetImmediate((()=>{this._disposed||Promise.all(this._completePromises).then((()=>{this._parent._endPerformanceCounter(r),this._parent._setState(ce.COMPLETE),this._parent.onCompleteObservable.notifyObservers(void 0),this._parent.onCompleteObservable.clear(),this.dispose()}),(e=>{this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()}))})),e)))})).catch((e=>{throw this._disposed||(this._parent.onErrorObservable.notifyObservers(e),this._parent.onErrorObservable.clear(),this.dispose()),e}))}_loadData(e){if(this._gltf=e.json,this._setupData(),e.bin){const t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){const s=t[0];(s.byteLength<e.bin.byteLength-3||s.byteLength>e.bin.byteLength)&&v.Warn(`Binary buffer length (${s.byteLength}) from JSON does not match chunk length (${e.bin.byteLength})`),this._bin=e.bin}else v.Warn("Unexpected BIN chunk")}}_setupData(){if(Ce.Assign(this._gltf.accessors),Ce.Assign(this._gltf.animations),Ce.Assign(this._gltf.buffers),Ce.Assign(this._gltf.bufferViews),Ce.Assign(this._gltf.cameras),Ce.Assign(this._gltf.images),Ce.Assign(this._gltf.materials),Ce.Assign(this._gltf.meshes),Ce.Assign(this._gltf.nodes),Ce.Assign(this._gltf.samplers),Ce.Assign(this._gltf.scenes),Ce.Assign(this._gltf.skins),Ce.Assign(this._gltf.textures),this._gltf.nodes){const e={};for(const t of this._gltf.nodes)if(t.children)for(const s of t.children)e[s]=t.index;const t=this._createRootNode();for(const s of this._gltf.nodes){const n=e[s.index];s.parent=void 0===n?t:this._gltf.nodes[n]}}}async _loadExtensionsAsync(){const e=[];if(V.forEach(((t,s)=>{!1===this.parent.extensionOptions[s]?.enabled?t.isGLTFExtension&&this.isExtensionUsed(s)&&v.Warn(`Extension ${s} is used but has been explicitly disabled.`):t.isGLTFExtension&&!this.isExtensionUsed(s)||e.push((async()=>{const e=await t.factory(this);return e.name!==s&&v.Warn(`The name of the glTF loader extension instance does not match the registered name: ${e.name} !== ${s}`),this._parent.onExtensionLoadedObservable.notifyObservers(e),e})())})),this._extensions.push(...await Promise.all(e)),this._extensions.sort(((e,t)=>(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE))),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired)for(const e of this._gltf.extensionsRequired){if(!this._extensions.some((t=>t.name===e&&t.enabled))){if(!1===this.parent.extensionOptions[e]?.enabled)throw new Error(`Required extension ${e} is disabled`);throw new Error(`Required extension ${e} is not available`)}}}_createRootNode(){if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;const e=new G("__root__",this._babylonScene);this._rootBabylonMesh=e,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);const t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case le.AUTO:this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],Oe._LoadTransform(t,this._rootBabylonMesh));break;case le.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error(`Invalid coordinate system mode (${this._parent.coordinateSystemMode})`)}return this._parent.onMeshLoadedObservable.notifyObservers(e),t}loadSceneAsync(e,t){const s=this._extensionsLoadSceneAsync(e,t);if(s)return s;const n=new Array;if(this.logOpen(`${e} ${t.name||""}`),t.nodes)for(const s of t.nodes){const t=Ce.Get(`${e}/nodes/${s}`,this._gltf.nodes,s);n.push(this.loadNodeAsync(`/nodes/${t.index}`,t,(e=>{e.parent=this._rootBabylonMesh})))}for(const e of this._postSceneLoadActions)e();return n.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(n).then((()=>{}))}_forEachPrimitive(e,t){if(e._primitiveBabylonMeshes)for(const s of e._primitiveBabylonMeshes)t(s)}_getGeometries(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,(t=>{const s=t.geometry;s&&-1===e.indexOf(s)&&e.push(s)}));return e}_getMeshes(){const e=[];this._rootBabylonMesh instanceof W&&e.push(this._rootBabylonMesh);const t=this._gltf.nodes;if(t)for(const s of t)this._forEachPrimitive(s,(t=>{e.push(t)}));return e}_getTransformNodes(){const e=[],t=this._gltf.nodes;if(t)for(const s of t)s._babylonTransformNode&&"TransformNode"===s._babylonTransformNode.getClassName()&&e.push(s._babylonTransformNode),s._babylonTransformNodeForSkin&&e.push(s._babylonTransformNodeForSkin);return e}_getSkeletons(){const e=[],t=this._gltf.skins;if(t)for(const s of t)s._data&&e.push(s._data.babylonSkeleton);return e}_getAnimationGroups(){const e=[],t=this._gltf.animations;if(t)for(const s of t)s._babylonAnimationGroup&&e.push(s._babylonAnimationGroup);return e}_startAnimations(){switch(this._parent.animationStartMode){case he.NONE:break;case he.FIRST:{const e=this._getAnimationGroups();0!==e.length&&e[0].start(!0);break}case he.ALL:{const e=this._getAnimationGroups();for(const t of e)t.start(!0);break}default:return void v.Error(`Invalid animation start mode (${this._parent.animationStartMode})`)}}loadNodeAsync(e,t,s=()=>{}){const n=this._extensionsLoadNodeAsync(e,t,s);if(n)return n;if(t._babylonTransformNode)throw new Error(`${e}: Invalid recursive node hierarchy`);const i=new Array;this.logOpen(`${e} ${t.name||""}`);const o=n=>{if(Oe.AddPointerMetadata(n,e),Oe._LoadTransform(t,n),null!=t.camera){const s=Ce.Get(`${e}/camera`,this._gltf.cameras,t.camera);i.push(this.loadCameraAsync(`/cameras/${s.index}`,s,(e=>{e.parent=n})))}if(t.children)for(const s of t.children){const t=Ce.Get(`${e}/children/${s}`,this._gltf.nodes,s);i.push(this.loadNodeAsync(`/nodes/${t.index}`,t,(e=>{e.parent=n})))}s(n)},r=null!=t.mesh,a=this._parent.loadSkins&&null!=t.skin;if(!r||a){const e=t.name||`node${t.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const s=new Y(e,this._babylonScene);s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==t.mesh?t._babylonTransformNode=s:t._babylonTransformNodeForSkin=s,o(s)}if(r)if(a){const s=Ce.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${s.index}`,t,s,(s=>{const n=t._babylonTransformNodeForSkin;s.metadata=X(n.metadata,s.metadata||{});const o=Ce.Get(`${e}/skin`,this._gltf.skins,t.skin);i.push(this._loadSkinAsync(`/skins/${o.index}`,t,o,(e=>{this._forEachPrimitive(t,(t=>{t.skeleton=e})),this._postSceneLoadActions.push((()=>{if(null!=o.skeleton){const e=Ce.Get(`/skins/${o.index}/skeleton`,this._gltf.nodes,o.skeleton).parent;t.index===e.index?s.parent=n.parent:s.parent=e._babylonTransformNode}else s.parent=this._rootBabylonMesh;this._parent.onSkinLoadedObservable.notifyObservers({node:n,skinnedNode:s})}))})))})))}else{const s=Ce.Get(`${e}/mesh`,this._gltf.meshes,t.mesh);i.push(this._loadMeshAsync(`/meshes/${s.index}`,t,s,o))}return this.logClose(),Promise.all(i).then((()=>(this._forEachPrimitive(t,(e=>{e.geometry&&e.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)})),t._babylonTransformNode)))}_loadMeshAsync(e,t,s,n){const i=s.primitives;if(!i||!i.length)throw new Error(`${e}: Primitives are missing`);null==i[0].index&&Ce.Assign(i);const o=new Array;this.logOpen(`${e} ${s.name||""}`);const r=t.name||`node${t.index}`;if(1===i.length){const n=s.primitives[0];o.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,r,t,s,n,(e=>{t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new Y(r,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(const n of i)o.push(this._loadMeshPrimitiveAsync(`${e}/primitives/${n.index}`,`${r}_primitive${n.index}`,t,s,n,(e=>{e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}return n(t._babylonTransformNode),this.logClose(),Promise.all(o).then((()=>t._babylonTransformNode))}_loadMeshPrimitiveAsync(e,t,s,n,i,o){const r=this._extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,o);if(r)return r;this.logOpen(`${e}`);const a=0===this._disableInstancedMesh&&this._parent.createInstances&&null==s.skin&&!n.primitives[0].targets;let l,h;if(a&&i._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,l=i._instanceData.babylonSourceMesh.createInstance(t),l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,h=i._instanceData.promise;else{const o=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;const r=new G(t,this._babylonScene);r._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,r.sideOrientation=this._babylonScene.useRightHandedSystem?U.CounterClockWiseSideOrientation:U.ClockWiseSideOrientation,this._createMorphTargets(e,s,n,i,r),o.push(this._loadVertexDataAsync(e,i,r).then((t=>this._loadMorphTargetsAsync(e,i,r,t).then((()=>{this._disposed||(this._babylonScene._blockEntityCollection=!!this._assetContainer,t.applyToMesh(r),t._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1)})))));const c=Oe._GetDrawMode(e,i.mode);if(null==i.material){let e=this._defaultBabylonMaterialData[c];e||(e=this._createDefaultMaterial("__GLTFLoader._default",c),this._parent.onMaterialLoadedObservable.notifyObservers(e),this._defaultBabylonMaterialData[c]=e),r.material=e}else if(!this.parent.skipMaterials){const t=Ce.Get(`${e}/material`,this._gltf.materials,i.material);o.push(this._loadMaterialAsync(`/materials/${t.index}`,t,r,c,(e=>{r.material=e})))}h=Promise.all(o),a&&(i._instanceData={babylonSourceMesh:r,promise:h}),l=r}return Oe.AddPointerMetadata(l,e),this._parent.onMeshLoadedObservable.notifyObservers(l),o(l),this.logClose(),h.then((()=>l))}_loadVertexDataAsync(e,t,s){const n=this._extensionsLoadVertexDataAsync(e,t,s);if(n)return n;const i=t.attributes;if(!i)throw new Error(`${e}: Attributes are missing`);const o=new Array,r=new Z(s.name,this._babylonScene);if(null==t.indices)s.isUnIndexed=!0;else{const s=Ce.Get(`${e}/indices`,this._gltf.accessors,t.indices);o.push(this._loadIndicesAccessorAsync(`/accessors/${s.index}`,s).then((e=>{r.setIndices(e)})))}const a=(t,n,a)=>{if(null==i[t])return;s._delayInfo=s._delayInfo||[],-1===s._delayInfo.indexOf(n)&&s._delayInfo.push(n);const l=Ce.Get(`${e}/attributes/${t}`,this._gltf.accessors,i[t]);o.push(this._loadVertexAccessorAsync(`/accessors/${l.index}`,l,n).then((e=>{if(e.getKind()===k.PositionKind&&!this.parent.alwaysComputeBoundingBox&&!s.skeleton){const e=ke(l);e&&(r._boundingInfo=e,r.useBoundingInfoFromGeometry=!0)}r.setVerticesBuffer(e,l.count)}))),n==k.MatricesIndicesExtraKind&&(s.numBoneInfluencers=8),a&&a(l)};return a("POSITION",k.PositionKind),a("NORMAL",k.NormalKind),a("TANGENT",k.TangentKind),a("TEXCOORD_0",k.UVKind),a("TEXCOORD_1",k.UV2Kind),a("TEXCOORD_2",k.UV3Kind),a("TEXCOORD_3",k.UV4Kind),a("TEXCOORD_4",k.UV5Kind),a("TEXCOORD_5",k.UV6Kind),a("JOINTS_0",k.MatricesIndicesKind),a("WEIGHTS_0",k.MatricesWeightsKind),a("JOINTS_1",k.MatricesIndicesExtraKind),a("WEIGHTS_1",k.MatricesWeightsExtraKind),a("COLOR_0",k.ColorKind,(e=>{"VEC4"===e.type&&(s.hasVertexAlpha=!0)})),Promise.all(o).then((()=>r))}_createMorphTargets(e,t,s,n,i){if(!n.targets||!this._parent.loadMorphTargets)return;if(null==t._numMorphTargets)t._numMorphTargets=n.targets.length;else if(n.targets.length!==t._numMorphTargets)throw new Error(`${e}: Primitives do not have the same number of targets`);const o=s.extras?s.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,i.morphTargetManager=new be(this._babylonScene),i.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,i.morphTargetManager.areUpdatesFrozen=!0;for(let e=0;e<n.targets.length;e++){const n=t.weights?t.weights[e]:s.weights?s.weights[e]:0,r=o?o[e]:`morphTarget${e}`;i.morphTargetManager.addTarget(new ge(r,n,i.getScene()))}}_loadMorphTargetsAsync(e,t,s,n){if(!t.targets||!this._parent.loadMorphTargets)return Promise.resolve();const i=new Array,o=s.morphTargetManager;for(let s=0;s<o.numTargets;s++){const r=o.getTarget(s);i.push(this._loadMorphTargetVertexDataAsync(`${e}/targets/${s}`,n,t.targets[s],r))}return Promise.all(i).then((()=>{o.areUpdatesFrozen=!1}))}_loadMorphTargetVertexDataAsync(e,t,s,n){const i=new Array,o=(n,o,r)=>{if(null==s[n])return;const a=t.getVertexBuffer(o);if(!a)return;const l=Ce.Get(`${e}/${n}`,this._gltf.accessors,s[n]);i.push(this._loadFloatAccessorAsync(`/accessors/${l.index}`,l).then((e=>{r(a,e)})))};return o("POSITION",k.PositionKind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(t.length,((e,n)=>{s[n]=t[n]+e})),n.setPositions(s)})),o("NORMAL",k.NormalKind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(s.length,((e,n)=>{s[n]=t[n]+e})),n.setNormals(s)})),o("TANGENT",k.TangentKind,((e,t)=>{const s=new Float32Array(t.length/3*4);let i=0;e.forEach(t.length/3*4,((e,n)=>{(n+1)%4!=0&&(s[i]=t[i]+e,i++)})),n.setTangents(s)})),o("TEXCOORD_0",k.UVKind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(t.length,((e,n)=>{s[n]=t[n]+e})),n.setUVs(s)})),o("TEXCOORD_1",k.UV2Kind,((e,t)=>{const s=new Float32Array(t.length);e.forEach(t.length,((e,n)=>{s[n]=t[n]+e})),n.setUV2s(s)})),Promise.all(i).then((()=>{}))}static _LoadTransform(e,t){if(null!=e.skin)return;let s=o.Zero(),n=g.Identity(),i=o.One();if(e.matrix){h.FromArray(e.matrix).decompose(i,n,s)}else e.translation&&(s=o.FromArray(e.translation)),e.rotation&&(n=g.FromArray(e.rotation)),e.scale&&(i=o.FromArray(e.scale));t.position=s,t.rotationQuaternion=n,t.scaling=i}_loadSkinAsync(e,t,s,n){if(!this._parent.loadSkins)return Promise.resolve();const i=this._extensionsLoadSkinAsync(e,t,s);if(i)return i;if(s._data)return n(s._data.babylonSkeleton),s._data.promise;const o=`skeleton${s.index}`;this._babylonScene._blockEntityCollection=!!this._assetContainer;const r=new fe(s.name||o,o,this._babylonScene);r._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,s,r);const a=this._loadSkinInverseBindMatricesDataAsync(e,s).then((e=>{this._updateBoneMatrices(r,e)}));return s._data={babylonSkeleton:r,promise:a},n(r),a}_loadBones(e,t,s){if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){const s=this._findSkeletonRootNode(`${e}/joints`,t.joints);if(s)if(void 0===t.skeleton)t.skeleton=s.index;else{const n=(e,t)=>{for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1},i=Ce.Get(`${e}/skeleton`,this._gltf.nodes,t.skeleton);i===s||n(i,s)||(v.Warn(`${e}/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root`),t.skeleton=s.index)}else v.Warn(`${e}: Failed to find common root`)}const n={};for(const i of t.joints){const o=Ce.Get(`${e}/joints/${i}`,this._gltf.nodes,i);this._loadBone(o,t,s,n)}}_findSkeletonRootNode(e,t){if(0===t.length)return null;const s={};for(const n of t){const t=[];let i=Ce.Get(`${e}/${n}`,this._gltf.nodes,n);for(;-1!==i.index;)t.unshift(i),i=i.parent;s[n]=t}let n=null;for(let e=0;;++e){let i=s[t[0]];if(e>=i.length)return n;const o=i[e];for(let r=1;r<t.length;++r)if(i=s[t[r]],e>=i.length||o!==i[e])return n;n=o}}_loadBone(e,t,s,n){e._isJoint=!0;let i=n[e.index];if(i)return i;let o=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?o=this._loadBone(e.parent,t,s,n):void 0!==t.skeleton&&v.Warn(`/skins/${t.index}/skeleton: Skeleton node is not a common root`));const r=t.joints.indexOf(e.index);return i=new me(e.name||`joint${e.index}`,s,o,this._getNodeMatrix(e),null,null,r),n[e.index]=i,this._postSceneLoadActions.push((()=>{i.linkTransformNode(e._babylonTransformNode)})),i}_loadSkinInverseBindMatricesDataAsync(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);const s=Ce.Get(`${e}/inverseBindMatrices`,this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync(`/accessors/${s.index}`,s)}_updateBoneMatrices(e,t){for(const s of e.bones){const e=h.Identity(),n=s._index;t&&-1!==n&&(h.FromArrayToRef(t,16*n,e),e.invertToRef(e));const i=s.getParent();i&&e.multiplyToRef(i.getAbsoluteInverseBindMatrix(),e),s.updateMatrix(e,!1,!1),s._updateAbsoluteBindMatrices(void 0,!1)}}_getNodeMatrix(e){return e.matrix?h.FromArray(e.matrix):h.Compose(e.scale?o.FromArray(e.scale):o.One(),e.rotation?g.FromArray(e.rotation):g.Identity(),e.translation?o.FromArray(e.translation):o.Zero())}loadCameraAsync(e,t,s=()=>{}){const n=this._extensionsLoadCameraAsync(e,t,s);if(n)return n;const i=new Array;this.logOpen(`${e} ${t.name||""}`),this._babylonScene._blockEntityCollection=!!this._assetContainer;const r=new pe(t.name||`camera${t.index}`,o.Zero(),this._babylonScene,!1);switch(r._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,r.ignoreParentScaling=!0,t._babylonCamera=r,r.rotation.set(0,Math.PI,0),t.type){case"perspective":{const s=t.perspective;if(!s)throw new Error(`${e}: Camera perspective properties are missing`);r.fov=s.yfov,r.minZ=s.znear,r.maxZ=s.zfar||0;break}case"orthographic":if(!t.orthographic)throw new Error(`${e}: Camera orthographic properties are missing`);r.mode=z.ORTHOGRAPHIC_CAMERA,r.orthoLeft=-t.orthographic.xmag,r.orthoRight=t.orthographic.xmag,r.orthoBottom=-t.orthographic.ymag,r.orthoTop=t.orthographic.ymag,r.minZ=t.orthographic.znear,r.maxZ=t.orthographic.zfar;break;default:throw new Error(`${e}: Invalid camera type (${t.type})`)}return Oe.AddPointerMetadata(r,e),this._parent.onCameraLoadedObservable.notifyObservers(r),s(r),this.logClose(),Promise.all(i).then((()=>r))}_loadAnimationsAsync(){const e=this._gltf.animations;if(!e)return Promise.resolve();const t=new Array;for(let s=0;s<e.length;s++){const n=e[s];t.push(this.loadAnimationAsync(`/animations/${n.index}`,n).then((e=>{0===e.targetedAnimations.length&&e.dispose()})))}return Promise.all(t).then((()=>{}))}loadAnimationAsync(e,t){const s=this._extensionsLoadAnimationAsync(e,t);return s||import("./animationGroup-toXtd3a1.esm.min.js").then((({AnimationGroup:s})=>{this._babylonScene._blockEntityCollection=!!this._assetContainer;const n=new s(t.name||`animation${t.index}`,this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=n;const i=new Array;Ce.Assign(t.channels),Ce.Assign(t.samplers);for(const s of t.channels)i.push(this._loadAnimationChannelAsync(`${e}/channels/${s.index}`,e,t,s,((e,t)=>{e.animations=e.animations||[],e.animations.push(t),n.addTargetedAnimation(t,e)})));return Promise.all(i).then((()=>(n.normalize(0),n)))}))}_loadAnimationChannelAsync(e,t,s,n,i){const o=this._extensionsLoadAnimationChannelAsync(e,t,s,n,i);if(o)return o;if(null==n.target.node)return Promise.resolve();const r=Ce.Get(`${e}/target/node`,this._gltf.nodes,n.target.node),a=n.target.path,l="weights"===a;if(l&&!r._numMorphTargets||!l&&!r._babylonTransformNode)return Promise.resolve();if(!this._parent.loadNodeAnimations&&!l&&!r._isJoint)return Promise.resolve();let h;switch(a){case"translation":h=ne.translation;break;case"rotation":h=ne.rotation;break;case"scale":h=ne.scale;break;case"weights":h=ne.weights;break;default:throw new Error(`${e}/target/path: Invalid value (${n.target.path})`)}const c={object:r,info:h};return this._loadAnimationChannelFromTargetInfoAsync(e,t,s,n,c,i)}_loadAnimationChannelFromTargetInfoAsync(e,t,s,n,i,o){const r=this.parent.targetFps,a=1/r,l=Ce.Get(`${e}/sampler`,s.samplers,n.sampler);return this._loadAnimationSamplerAsync(`${t}/samplers/${n.sampler}`,l).then((e=>{let t=0;const l=i.object,h=i.info;for(const i of h){const h=i.getStride(l),c=e.input,d=e.output,u=new Array(c.length);let _=0;switch(e.interpolation){case"STEP":for(let e=0;e<c.length;e++){const t=i.getValue(l,d,_,1);_+=h,u[e]={frame:c[e]*r,value:t,interpolation:1}}break;case"CUBICSPLINE":for(let e=0;e<c.length;e++){const t=i.getValue(l,d,_,a);_+=h;const s=i.getValue(l,d,_,1);_+=h;const n=i.getValue(l,d,_,a);_+=h,u[e]={frame:c[e]*r,inTangent:t,value:s,outTangent:n}}break;case"LINEAR":for(let e=0;e<c.length;e++){const t=i.getValue(l,d,_,1);_+=h,u[e]={frame:c[e]*r,value:t}}}if(_>0){const e=`${s.name||`animation${s.index}`}_channel${n.index}_${t}`;i.buildAnimations(l,e,r,u,((e,s)=>{++t,o(e,s)}))}}}))}_loadAnimationSamplerAsync(e,t){if(t._data)return t._data;const s=t.interpolation||"LINEAR";switch(s){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(`${e}/interpolation: Invalid value (${t.interpolation})`)}const n=Ce.Get(`${e}/input`,this._gltf.accessors,t.input),i=Ce.Get(`${e}/output`,this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync(`/accessors/${n.index}`,n),this._loadFloatAccessorAsync(`/accessors/${i.index}`,i)]).then((([e,t])=>({input:e,interpolation:s,output:t}))),t._data}loadBufferAsync(e,t,s,n){const i=this._extensionsLoadBufferAsync(e,t,s,n);if(i)return i;if(!t._data)if(t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{if(!this._bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((t=>{try{return new Uint8Array(t.buffer,t.byteOffset+s,n)}catch(t){throw new Error(`${e}: ${t.message}`)}}))}loadBufferViewAsync(e,t){const s=this._extensionsLoadBufferViewAsync(e,t);if(s)return s;if(t._data)return t._data;const n=Ce.Get(`${e}/buffer`,this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync(`/buffers/${n.index}`,n,t.byteOffset||0,t.byteLength),t._data}_loadAccessorAsync(e,t,s){if(t._data)return t._data;const n=Oe._GetNumComponents(e,t.type),i=n*k.GetTypeByteLength(t.componentType),o=n*t.count;if(null==t.bufferView)t._data=Promise.resolve(new s(o));else{const r=Ce.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${r.index}`,r).then((a=>{if(5126!==t.componentType||t.normalized||r.byteStride&&r.byteStride!==i){const e=new s(o);return k.ForEach(a,t.byteOffset||0,r.byteStride||i,n,t.componentType,e.length,t.normalized||!1,((t,s)=>{e[s]=t})),e}return Oe._GetTypedArray(e,t.componentType,a,t.byteOffset,o)}))}if(t.sparse){const o=t.sparse;t._data=t._data.then((r=>{const a=r,l=Ce.Get(`${e}/sparse/indices/bufferView`,this._gltf.bufferViews,o.indices.bufferView),h=Ce.Get(`${e}/sparse/values/bufferView`,this._gltf.bufferViews,o.values.bufferView);return Promise.all([this.loadBufferViewAsync(`/bufferViews/${l.index}`,l),this.loadBufferViewAsync(`/bufferViews/${h.index}`,h)]).then((([r,l])=>{const h=Oe._GetTypedArray(`${e}/sparse/indices`,o.indices.componentType,r,o.indices.byteOffset,o.count),c=n*o.count;let d;if(5126!==t.componentType||t.normalized){const r=Oe._GetTypedArray(`${e}/sparse/values`,t.componentType,l,o.values.byteOffset,c);d=new s(c),k.ForEach(r,0,i,n,t.componentType,d.length,t.normalized||!1,((e,t)=>{d[t]=e}))}else d=Oe._GetTypedArray(`${e}/sparse/values`,t.componentType,l,o.values.byteOffset,c);let u=0;for(let e=0;e<h.length;e++){let t=h[e]*n;for(let e=0;e<n;e++)a[t++]=d[u++]}return a}))}))}return t._data}_loadFloatAccessorAsync(e,t){return this._loadAccessorAsync(e,t,Float32Array)}_loadIndicesAccessorAsync(e,t){if("SCALAR"!==t.type)throw new Error(`${e}/type: Invalid value ${t.type}`);if(5121!==t.componentType&&5123!==t.componentType&&5125!==t.componentType)throw new Error(`${e}/componentType: Invalid value ${t.componentType}`);if(t._data)return t._data;if(t.sparse){const s=Oe._GetTypedArrayConstructor(`${e}/componentType`,t.componentType);t._data=this._loadAccessorAsync(e,t,s)}else{const s=Ce.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${s.index}`,s).then((s=>Oe._GetTypedArray(e,t.componentType,s,t.byteOffset,t.count)))}return t._data}_loadVertexBufferViewAsync(e){if(e._babylonBuffer)return e._babylonBuffer;const t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync(`/bufferViews/${e.index}`,e).then((e=>new j(t,e,!1))),e._babylonBuffer}_loadVertexAccessorAsync(e,t,s){if(t._babylonVertexBuffer?.[s])return t._babylonVertexBuffer[s];t._babylonVertexBuffer||(t._babylonVertexBuffer={});const n=this._babylonScene.getEngine();if(t.sparse||null==t.bufferView)t._babylonVertexBuffer[s]=this._loadFloatAccessorAsync(e,t).then((e=>new k(n,e,s,!1)));else{const i=Ce.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._babylonVertexBuffer[s]=this._loadVertexBufferViewAsync(i).then((o=>{const r=Oe._GetNumComponents(e,t.type);return new k(n,o,s,!1,void 0,i.byteStride,void 0,t.byteOffset,r,t.componentType,t.normalized,!0,void 0,!0)}))}return t._babylonVertexBuffer[s]}_loadMaterialMetallicRoughnessPropertiesAsync(e,t,s){if(!(s instanceof K))throw new Error(`${e}: Material type not supported`);const n=new Array;return t&&(t.baseColorFactor?(s.albedoColor=q.FromArray(t.baseColorFactor),s.alpha=t.baseColorFactor[3]):s.albedoColor=q.White(),s.metallic=null==t.metallicFactor?1:t.metallicFactor,s.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&n.push(this.loadTextureInfoAsync(`${e}/baseColorTexture`,t.baseColorTexture,(e=>{e.name=`${s.name} (Base Color)`,s.albedoTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/metallicRoughnessTexture`,t.metallicRoughnessTexture,(e=>{e.name=`${s.name} (Metallic Roughness)`,s.metallicTexture=e}))),s.useMetallnessFromMetallicTextureBlue=!0,s.useRoughnessFromMetallicTextureGreen=!0,s.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(n).then((()=>{}))}_loadMaterialAsync(e,t,s,n,i=()=>{}){const o=this._extensionsLoadMaterialAsync(e,t,s,n,i);if(o)return o;t._data=t._data||{};let r=t._data[n];if(!r){this.logOpen(`${e} ${t.name||""}`);const s=this.createMaterial(e,t,n);r={babylonMaterial:s,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(e,t,s)},t._data[n]=r,Oe.AddPointerMetadata(s,e),this._parent.onMaterialLoadedObservable.notifyObservers(s),this.logClose()}return s&&(r.babylonMeshes.push(s),s.onDisposeObservable.addOnce((()=>{const e=r.babylonMeshes.indexOf(s);-1!==e&&r.babylonMeshes.splice(e,1)}))),i(r.babylonMaterial),r.promise.then((()=>r.babylonMaterial))}_createDefaultMaterial(e,t){this._babylonScene._blockEntityCollection=!!this._assetContainer;const s=new K(e,this._babylonScene);return s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,s.fillMode=t,s.enableSpecularAntiAliasing=!0,s.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,s.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,s.transparencyMode=K.PBRMATERIAL_OPAQUE,s.metallic=1,s.roughness=1,s}createMaterial(e,t,s){const n=this._extensionsCreateMaterial(e,t,s);if(n)return n;const i=t.name||`material${t.index}`;return this._createDefaultMaterial(i,s)}loadMaterialPropertiesAsync(e,t,s){const n=this._extensionsLoadMaterialPropertiesAsync(e,t,s);if(n)return n;const i=new Array;return i.push(this.loadMaterialBasePropertiesAsync(e,t,s)),t.pbrMetallicRoughness&&i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(`${e}/pbrMetallicRoughness`,t.pbrMetallicRoughness,s)),this.loadMaterialAlphaProperties(e,t,s),Promise.all(i).then((()=>{}))}loadMaterialBasePropertiesAsync(e,t,s){if(!(s instanceof K))throw new Error(`${e}: Material type not supported`);const n=new Array;return s.emissiveColor=t.emissiveFactor?q.FromArray(t.emissiveFactor):new q(0,0,0),t.doubleSided&&(s.backFaceCulling=!1,s.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/normalTexture`,t.normalTexture,(e=>{e.name=`${s.name} (Normal)`,s.bumpTexture=e}))),s.invertNormalMapX=!this._babylonScene.useRightHandedSystem,s.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&s.bumpTexture&&(s.bumpTexture.level=t.normalTexture.scale),s.forceIrradianceInFragment=!0),t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,n.push(this.loadTextureInfoAsync(`${e}/occlusionTexture`,t.occlusionTexture,(e=>{e.name=`${s.name} (Occlusion)`,s.ambientTexture=e}))),s.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(s.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&n.push(this.loadTextureInfoAsync(`${e}/emissiveTexture`,t.emissiveTexture,(e=>{e.name=`${s.name} (Emissive)`,s.emissiveTexture=e}))),Promise.all(n).then((()=>{}))}loadMaterialAlphaProperties(e,t,s){if(!(s instanceof K))throw new Error(`${e}: Material type not supported`);switch(t.alphaMode||"OPAQUE"){case"OPAQUE":s.transparencyMode=K.PBRMATERIAL_OPAQUE,s.alpha=1;break;case"MASK":s.transparencyMode=K.PBRMATERIAL_ALPHATEST,s.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,s.albedoTexture&&(s.albedoTexture.hasAlpha=!0);break;case"BLEND":s.transparencyMode=K.PBRMATERIAL_ALPHABLEND,s.albedoTexture&&(s.albedoTexture.hasAlpha=!0,s.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(`${e}/alphaMode: Invalid value (${t.alphaMode})`)}}loadTextureInfoAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureInfoAsync(e,t,s);if(n)return n;if(this.logOpen(`${e}`),t.texCoord>=6)throw new Error(`${e}/texCoord: Invalid value (${t.texCoord})`);const i=Ce.Get(`${e}/index`,this._gltf.textures,t.index);i._textureInfo=t;const o=this._loadTextureAsync(`/textures/${t.index}`,i,(n=>{n.coordinatesIndex=t.texCoord||0,Oe.AddPointerMetadata(n,e),this._parent.onTextureLoadedObservable.notifyObservers(n),s(n)}));return this.logClose(),o}_loadTextureAsync(e,t,s=()=>{}){const n=this._extensionsLoadTextureAsync(e,t,s);if(n)return n;this.logOpen(`${e} ${t.name||""}`);const i=null==t.sampler?Oe.DefaultSampler:Ce.Get(`${e}/sampler`,this._gltf.samplers,t.sampler),o=Ce.Get(`${e}/source`,this._gltf.images,t.source),r=this._createTextureAsync(e,i,o,s,void 0,!t._textureInfo.nonColorData);return this.logClose(),r}_createTextureAsync(e,t,s,n=()=>{},i,o){const r=this._loadSampler(`/samplers/${t.index}`,t),a=new Array,l=new H;this._babylonScene._blockEntityCollection=!!this._assetContainer;const h={noMipmap:r.noMipMaps,invertY:!1,samplingMode:r.samplingMode,onLoad:()=>{this._disposed||l.resolve()},onError:(t,s)=>{this._disposed||l.reject(new Error(`${e}: ${s&&s.message?s.message:t||"Failed to load texture"}`))},mimeType:s.mimeType,loaderOptions:i,useSRGBBuffer:!!o&&this._parent.useSRGBBuffers},c=new O(null,this._babylonScene,h);return c._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.push(l.promise),a.push(this.loadImageAsync(`/images/${s.index}`,s).then((e=>{const t=s.uri||`${this._fileName}#image${s.index}`,n=`data:${this._uniqueRootUrl}${t}`;c.updateURL(n,e);const i=c.getInternalTexture();i&&(i.label=s.name)}))),c.wrapU=r.wrapU,c.wrapV=r.wrapV,n(c),this._parent.useGltfTextureNames&&(c.name=s.name||s.uri||`image${s.index}`),Promise.all(a).then((()=>c))}_loadSampler(e,t){return t._data||(t._data={noMipMaps:9728===t.minFilter||9729===t.minFilter,samplingMode:Oe._GetTextureSamplingMode(e,t),wrapU:Oe._GetTextureWrapMode(`${e}/wrapS`,t.wrapS),wrapV:Oe._GetTextureWrapMode(`${e}/wrapT`,t.wrapT)}),t._data}loadImageAsync(e,t){if(!t._data){if(this.logOpen(`${e} ${t.name||""}`),t.uri)t._data=this.loadUriAsync(`${e}/uri`,t,t.uri);else{const s=Ce.Get(`${e}/bufferView`,this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync(`/bufferViews/${s.index}`,s)}this.logClose()}return t._data}loadUriAsync(e,t,s){const n=this._extensionsLoadUriAsync(e,t,s);if(n)return n;if(!Oe._ValidateUri(s))throw new Error(`${e}: '${s}' is invalid`);if(Q(s)){const t=new Uint8Array(L(s));return this.log(`${e}: Decoded ${s.substring(0,64)}... (${t.length} bytes)`),Promise.resolve(t)}return this.log(`${e}: Loading ${s}`),this._parent.preprocessUrlAsync(this._rootUrl+s).then((t=>new Promise(((n,i)=>{this._parent._loadFile(this._babylonScene,t,(t=>{this._disposed||(this.log(`${e}: Loaded ${s} (${t.byteLength} bytes)`),n(new Uint8Array(t)))}),!0,(t=>{i(new J(`${e}: Failed to load '${s}'${t?": "+t.status+" "+t.statusText:""}`,t))}))}))))}static AddPointerMetadata(e,t){e.metadata=e.metadata||{};const s=e._internalMetadata=e._internalMetadata||{},n=s.gltf=s.gltf||{};(n.pointers=n.pointers||[]).push(t)}static _GetTextureWrapMode(e,t){switch(t=null==t?10497:t){case 33071:return O.CLAMP_ADDRESSMODE;case 33648:return O.MIRROR_ADDRESSMODE;case 10497:return O.WRAP_ADDRESSMODE;default:return v.Warn(`${e}: Invalid value (${t})`),O.WRAP_ADDRESSMODE}}static _GetTextureSamplingMode(e,t){const s=null==t.magFilter?9729:t.magFilter,n=null==t.minFilter?9987:t.minFilter;if(9729===s)switch(n){case 9728:return O.LINEAR_NEAREST;case 9729:return O.LINEAR_LINEAR;case 9984:return O.LINEAR_NEAREST_MIPNEAREST;case 9985:return O.LINEAR_LINEAR_MIPNEAREST;case 9986:return O.LINEAR_NEAREST_MIPLINEAR;case 9987:return O.LINEAR_LINEAR_MIPLINEAR;default:return v.Warn(`${e}/minFilter: Invalid value (${n})`),O.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==s&&v.Warn(`${e}/magFilter: Invalid value (${s})`),n){case 9728:return O.NEAREST_NEAREST;case 9729:return O.NEAREST_LINEAR;case 9984:return O.NEAREST_NEAREST_MIPNEAREST;case 9985:return O.NEAREST_LINEAR_MIPNEAREST;case 9986:return O.NEAREST_NEAREST_MIPLINEAR;case 9987:return O.NEAREST_LINEAR_MIPLINEAR;default:return v.Warn(`${e}/minFilter: Invalid value (${n})`),O.NEAREST_NEAREST_MIPNEAREST}}static _GetTypedArrayConstructor(e,t){switch(t){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`${e}: Invalid component type ${t}`)}}static _GetTypedArray(e,t,s,n,i){const o=s.buffer;n=s.byteOffset+(n||0);const r=Oe._GetTypedArrayConstructor(`${e}/componentType`,t),a=k.GetTypeByteLength(t);return n%a!=0?(v.Warn(`${e}: Copying buffer as byte offset (${n}) is not a multiple of component type byte length (${a})`),new r(o.slice(n,n+i*a),0)):new r(o,n,i)}static _GetNumComponents(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error(`${e}: Invalid type (${t})`)}static _ValidateUri(e){return n.IsBase64(e)||-1===e.indexOf("..")}static _GetDrawMode(e,t){switch(null==t&&(t=4),t){case 0:return U.PointListDrawMode;case 1:return U.LineListDrawMode;case 2:return U.LineLoopDrawMode;case 3:return U.LineStripDrawMode;case 4:return U.TriangleFillMode;case 5:return U.TriangleStripDrawMode;case 6:return U.TriangleFanDrawMode}throw new Error(`${e}: Invalid mesh primitive mode (${t})`)}_compileMaterialsAsync(){this._parent._startPerformanceCounter("Compile materials");const e=new Array;if(this._gltf.materials)for(const t of this._gltf.materials)if(t._data)for(const s in t._data){const n=t._data[s];for(const t of n.babylonMeshes){t.computeWorldMatrix(!0);const s=n.babylonMaterial;e.push(s.forceCompilationAsync(t)),e.push(s.forceCompilationAsync(t,{useInstances:!0})),this._parent.useClipPlane&&(e.push(s.forceCompilationAsync(t,{clipPlane:!0})),e.push(s.forceCompilationAsync(t,{clipPlane:!0,useInstances:!0})))}}return Promise.all(e).then((()=>{this._parent._endPerformanceCounter("Compile materials")}))}_compileShadowGeneratorsAsync(){this._parent._startPerformanceCounter("Compile shadow generators");const e=new Array,t=this._babylonScene.lights;for(const s of t){const t=s.getShadowGenerator();t&&e.push(t.forceCompilationAsync())}return Promise.all(e).then((()=>{this._parent._endPerformanceCounter("Compile shadow generators")}))}_forEachExtensions(e){for(const t of this._extensions)t.enabled&&e(t)}_applyExtensions(e,t,s){for(const n of this._extensions)if(n.enabled){const i=`${n.name}.${t}`,o=e;o._activeLoaderExtensionFunctions=o._activeLoaderExtensionFunctions||{};const r=o._activeLoaderExtensionFunctions;if(!r[i]){r[i]=!0;try{const e=s(n);if(e)return e}finally{delete r[i]}}}return null}_extensionsOnLoading(){this._forEachExtensions((e=>e.onLoading&&e.onLoading()))}_extensionsOnReady(){this._forEachExtensions((e=>e.onReady&&e.onReady()))}_extensionsLoadSceneAsync(e,t){return this._applyExtensions(t,"loadScene",(s=>s.loadSceneAsync&&s.loadSceneAsync(e,t)))}_extensionsLoadNodeAsync(e,t,s){return this._applyExtensions(t,"loadNode",(n=>n.loadNodeAsync&&n.loadNodeAsync(e,t,s)))}_extensionsLoadCameraAsync(e,t,s){return this._applyExtensions(t,"loadCamera",(n=>n.loadCameraAsync&&n.loadCameraAsync(e,t,s)))}_extensionsLoadVertexDataAsync(e,t,s){return this._applyExtensions(t,"loadVertexData",(n=>n._loadVertexDataAsync&&n._loadVertexDataAsync(e,t,s)))}_extensionsLoadMeshPrimitiveAsync(e,t,s,n,i,o){return this._applyExtensions(i,"loadMeshPrimitive",(r=>r._loadMeshPrimitiveAsync&&r._loadMeshPrimitiveAsync(e,t,s,n,i,o)))}_extensionsLoadMaterialAsync(e,t,s,n,i){return this._applyExtensions(t,"loadMaterial",(o=>o._loadMaterialAsync&&o._loadMaterialAsync(e,t,s,n,i)))}_extensionsCreateMaterial(e,t,s){return this._applyExtensions(t,"createMaterial",(n=>n.createMaterial&&n.createMaterial(e,t,s)))}_extensionsLoadMaterialPropertiesAsync(e,t,s){return this._applyExtensions(t,"loadMaterialProperties",(n=>n.loadMaterialPropertiesAsync&&n.loadMaterialPropertiesAsync(e,t,s)))}_extensionsLoadTextureInfoAsync(e,t,s){return this._applyExtensions(t,"loadTextureInfo",(n=>n.loadTextureInfoAsync&&n.loadTextureInfoAsync(e,t,s)))}_extensionsLoadTextureAsync(e,t,s){return this._applyExtensions(t,"loadTexture",(n=>n._loadTextureAsync&&n._loadTextureAsync(e,t,s)))}_extensionsLoadAnimationAsync(e,t){return this._applyExtensions(t,"loadAnimation",(s=>s.loadAnimationAsync&&s.loadAnimationAsync(e,t)))}_extensionsLoadAnimationChannelAsync(e,t,s,n,i){return this._applyExtensions(s,"loadAnimationChannel",(o=>o._loadAnimationChannelAsync&&o._loadAnimationChannelAsync(e,t,s,n,i)))}_extensionsLoadSkinAsync(e,t,s){return this._applyExtensions(s,"loadSkin",(n=>n._loadSkinAsync&&n._loadSkinAsync(e,t,s)))}_extensionsLoadUriAsync(e,t,s){return this._applyExtensions(t,"loadUri",(n=>n._loadUriAsync&&n._loadUriAsync(e,t,s)))}_extensionsLoadBufferViewAsync(e,t){return this._applyExtensions(t,"loadBufferView",(s=>s.loadBufferViewAsync&&s.loadBufferViewAsync(e,t)))}_extensionsLoadBufferAsync(e,t,s,n){return this._applyExtensions(t,"loadBuffer",(i=>i.loadBufferAsync&&i.loadBufferAsync(e,t,s,n)))}static LoadExtensionAsync(e,t,s,n){if(!t.extensions)return null;const i=t.extensions[s];return i?n(`${e}/extensions/${s}`,i):null}static LoadExtraAsync(e,t,s,n){if(!t.extras)return null;const i=t.extras[s];return i?n(`${e}/extras/${s}`,i):null}isExtensionUsed(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)}logOpen(e){this._parent._logOpen(e)}logClose(){this._parent._logClose()}log(e){this._parent._log(e)}startPerformanceCounter(e){this._parent._startPerformanceCounter(e)}endPerformanceCounter(e){this._parent._endPerformanceCounter(e)}}Oe.DefaultSampler={index:-1},we._CreateGLTF2Loader=e=>new Oe(e);var Pe=Object.freeze({__proto__:null,ArrayItem:Ce,GLTFFileLoader:we,GLTFLoader:Oe,LoadBoundingInfoFromPositionAccessor:ke});export{Ce as A,me as B,Oe as G,ke as L,Pe as g};
2
+ //# sourceMappingURL=glTFLoader-D4C1IGb3.esm.min.js.map