@uptimizr/dashboard 0.4.6 → 0.4.8

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 (388) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +19 -5
  3. package/out/__next._full.txt +10 -10
  4. package/out/__next._tree.txt +1 -1
  5. package/out/_next/static/chunks/{3cp5nmtwxq4gr.js → 0-6mdj5wxsfid.js} +1 -1
  6. package/out/_next/static/chunks/{2clevl_9ayd0x.js → 0-qthfqvm1jyj.js} +1 -1
  7. package/out/_next/static/chunks/01viyuclp2gm9.js +1 -0
  8. package/out/_next/static/chunks/02aym4t2hgo5c.js +1 -0
  9. package/out/_next/static/chunks/{1fervgvgv10r-.js → 02ic9b5ejugow.js} +1 -1
  10. package/out/_next/static/chunks/03p70i4c7qt0v.js +1 -0
  11. package/out/_next/static/chunks/{3zv5kyos9vtmm.js → 03pjr-ivdicng.js} +1 -1
  12. package/out/_next/static/chunks/041a06-lxipy5.js +1 -0
  13. package/out/_next/static/chunks/{3-yhe6rcsjh88.js → 06dzkwetqis-5.js} +1 -1
  14. package/out/_next/static/chunks/{2mjjo0yj-4ro4.js → 06kvanz5-fo52.js} +1 -1
  15. package/out/_next/static/chunks/{28i3wgvgn_at1.js → 07y8ke_iy59dn.js} +1 -1
  16. package/out/_next/static/chunks/09jukc-4jl735.js +1 -0
  17. package/out/_next/static/chunks/{0cmyc-uvk93kl.js → 09khmdgez3t0a.js} +74 -74
  18. package/out/_next/static/chunks/{2x-7kbwq8tl-o.js → 0_dca4876jshu.js} +196 -196
  19. package/out/_next/static/chunks/0axcgnl5qzr6e.js +1 -0
  20. package/out/_next/static/chunks/0ay4fjomijs3n.js +1 -0
  21. package/out/_next/static/chunks/0c7fy79wlccat.js +1 -0
  22. package/out/_next/static/chunks/0cqe4-l3imct3.js +1 -0
  23. package/out/_next/static/chunks/0cssvelju788j.js +1 -0
  24. package/out/_next/static/chunks/{2-_a-v1xeo5hb.js → 0ctain5xq2wsd.js} +116 -115
  25. package/out/_next/static/chunks/{3yk0hzfq5rcs6.js → 0df-dr3otg_4w.js} +1 -1
  26. package/out/_next/static/chunks/{0i9wa8hjd-5tc.js → 0endw997j7ao9.js} +1 -1
  27. package/out/_next/static/chunks/0ev_pbit1v_qg.js +1 -0
  28. package/out/_next/static/chunks/0eyw9oiwipywb.js +1 -0
  29. package/out/_next/static/chunks/0fkzbuo1tex4u.js +1 -0
  30. package/out/_next/static/chunks/0govas0u0t4w3.js +1 -0
  31. package/out/_next/static/chunks/{287hakn2ijupp.js → 0guzhnususp3-.js} +2 -2
  32. package/out/_next/static/chunks/0h7bq_ysu17q7.js +3 -0
  33. package/out/_next/static/chunks/0hneh_3xzlo28.js +1 -0
  34. package/out/_next/static/chunks/0iaqwme19z_0s.js +1 -0
  35. package/out/_next/static/chunks/0ibmar10xndpn.js +1 -0
  36. package/out/_next/static/chunks/0ii8mqoteppgh.js +11 -0
  37. package/out/_next/static/chunks/{3ioxfi3bvznhh.js → 0ip6v64di_l6x.js} +1 -1
  38. package/out/_next/static/chunks/{184pz6z3dflfm.js → 0ixymgjgz3grn.js} +20 -20
  39. package/out/_next/static/chunks/0kuah8g7lt5ox.js +1 -0
  40. package/out/_next/static/chunks/0l3k4j19vxm17.js +1 -0
  41. package/out/_next/static/chunks/0l6hg0ohwh9-m.js +1 -0
  42. package/out/_next/static/chunks/0m4um4ylhlfan.js +1 -0
  43. package/out/_next/static/chunks/0mj837d4h0ddq.js +1 -0
  44. package/out/_next/static/chunks/0nyn-f4905o91.js +1 -0
  45. package/out/_next/static/chunks/0og6i9rsgkuif.js +1 -0
  46. package/out/_next/static/chunks/0os1x-fxzgnxs.js +1 -0
  47. package/out/_next/static/chunks/0otnra7mp0hog.js +1 -0
  48. package/out/_next/static/chunks/{3p03l0z65c8vc.js → 0oyf2xzv8ofkk.js} +253 -253
  49. package/out/_next/static/chunks/0qvsy3gcqjm12.js +1 -0
  50. package/out/_next/static/chunks/{0yd4_xh476fjn.js → 0rl4ddh2vgxyl.js} +97 -97
  51. package/out/_next/static/chunks/0rwpttmsmqvn_.js +1 -0
  52. package/out/_next/static/chunks/0so3wjp9ch93y.js +1 -0
  53. package/out/_next/static/chunks/{36pz_ews7u0xb.js → 0te4g160_rb5d.js} +1 -1
  54. package/out/_next/static/chunks/0uby-zvu799ef.js +1 -0
  55. package/out/_next/static/chunks/{2kk_vvmr2xm3d.js → 0uvn0op2mlr2u.js} +12 -12
  56. package/out/_next/static/chunks/0vwj4hxjm0igv.js +1 -0
  57. package/out/_next/static/chunks/{0r-x702_jvhud.js → 0w7c30w07uct2.js} +12 -12
  58. package/out/_next/static/chunks/0wm38z3u2133a.js +1 -0
  59. package/out/_next/static/chunks/0y7yk5al7_p8q.js +4 -0
  60. package/out/_next/static/chunks/0ycr0gi6fn6bt.js +1 -0
  61. package/out/_next/static/chunks/0ywvahq9t0tki.js +1 -0
  62. package/out/_next/static/chunks/0zh6nslagkby-.js +1 -0
  63. package/out/_next/static/chunks/{3twr9ds68-9us.js → 0zo8xa0nej3ex.js} +1 -1
  64. package/out/_next/static/chunks/{1lu7rjfvxj8yj.js → 0zsir95gpf3xw.js} +1 -1
  65. package/out/_next/static/chunks/{1j4c0nvdo5q68.js → 0zu6ryyj0ig-j.js} +1 -1
  66. package/out/_next/static/chunks/{1bv-jzy_2jiqs.js → 1-jv8k10q_1uw.js} +1 -1
  67. package/out/_next/static/chunks/{0xx7_7y5jdlh4.js → 1-s5ioie9a94e.js} +1 -1
  68. package/out/_next/static/chunks/{27z7j17kcrty_.js → 1-yos1h0qws5e.js} +11 -11
  69. package/out/_next/static/chunks/10o7brc3x027r.js +1 -0
  70. package/out/_next/static/chunks/{2xe4bgir5l-9b.js → 10pae4gb9i929.js} +504 -504
  71. package/out/_next/static/chunks/13p93itm8a3ym.js +1 -0
  72. package/out/_next/static/chunks/{2mrkv0z2i74pv.js → 147s8i_lktp4_.js} +2 -2
  73. package/out/_next/static/chunks/{3nwaovnpiyrt8.js → 14tgo5xt_3j4w.js} +3 -3
  74. package/out/_next/static/chunks/1699hx-vlak0n.js +22 -0
  75. package/out/_next/static/chunks/{2b5nt7yn-pq3a.js → 16d6n9e77rqti.js} +1 -1
  76. package/out/_next/static/chunks/{3nr48h9zwum-3.js → 16f3d5dv83rsr.js} +1 -1
  77. package/out/_next/static/chunks/16i_tpwn_cmr-.js +1 -0
  78. package/out/_next/static/chunks/{2117sv2qzo6yq.js → 16rfr165nbha0.js} +1 -1
  79. package/out/_next/static/chunks/16sl51pvzo4tf.js +1 -0
  80. package/out/_next/static/chunks/1760s-32qpwgg.js +1 -0
  81. package/out/_next/static/chunks/{3rj-5v0j_2-_2.js → 18kq07c5xy_4g.js} +4 -4
  82. package/out/_next/static/chunks/{2wgh5i70bzelt.js → 190tbzt861ao3.js} +392 -392
  83. package/out/_next/static/chunks/19bhv6cupnnyj.js +1 -0
  84. package/out/_next/static/chunks/1_14pn2wwebxy.js +1 -0
  85. package/out/_next/static/chunks/{2_lw4d7t-xcqi.js → 1_kikmeubh0wq.js} +523 -522
  86. package/out/_next/static/chunks/1ay3z6agelsvz.js +1 -0
  87. package/out/_next/static/chunks/1b-fi3bfmpe31.js +1 -0
  88. package/out/_next/static/chunks/1bae3tqv53x9_.js +1 -0
  89. package/out/_next/static/chunks/{2s4fzgzkwjluu.js → 1bf421g4peccx.js} +2 -2
  90. package/out/_next/static/chunks/1bfony5qsc5tp.js +1 -0
  91. package/out/_next/static/chunks/{3vtmucpx25o7q.js → 1ddt0ot7kl8vq.js} +584 -584
  92. package/out/_next/static/chunks/1emz2vjkgck4z.js +1 -0
  93. package/out/_next/static/chunks/1eogzzw8i1wsg.js +1 -0
  94. package/out/_next/static/chunks/1g9p2h1-31q8o.js +1 -0
  95. package/out/_next/static/chunks/1gcz1k1v1woca.js +1 -0
  96. package/out/_next/static/chunks/1h8lyicgqhpxa.js +1 -0
  97. package/out/_next/static/chunks/{0e5dcxmkprebg.js → 1hot663akaepl.js} +1 -1
  98. package/out/_next/static/chunks/1i7pgl3ks5ye0.js +1 -0
  99. package/out/_next/static/chunks/{0xzamrecplwzw.js → 1i8sk_qgpdjhs.js} +1 -1
  100. package/out/_next/static/chunks/1kk3ct7pkpf3b.js +1 -0
  101. package/out/_next/static/chunks/1kq9o8del67le.js +1 -0
  102. package/out/_next/static/chunks/1l7tzyx2mumlq.js +1 -0
  103. package/out/_next/static/chunks/1n_uwed9o--go.js +1 -0
  104. package/out/_next/static/chunks/1o351eldttogn.js +1 -0
  105. package/out/_next/static/chunks/{1f07l3q77zat1.js → 1ogs4_aj84bfn.js} +1 -1
  106. package/out/_next/static/chunks/{3_dm45k0vk1aa.js → 1p206txlluipi.js} +565 -565
  107. package/out/_next/static/chunks/1p2bt1w845v6c.js +1 -0
  108. package/out/_next/static/chunks/1p3rgz4aef1gk.js +1 -0
  109. package/out/_next/static/chunks/{0ypejzd74ixbw.js → 1qcgdx9yl0gfx.js} +15 -15
  110. package/out/_next/static/chunks/1ql3mm2w5r-m8.js +1 -0
  111. package/out/_next/static/chunks/1qvcyuyshi3ll.js +53 -0
  112. package/out/_next/static/chunks/1r0yyg5a_0knc.js +1 -0
  113. package/out/_next/static/chunks/{374lzksboll-t.js → 1sa6qiidtcyk2.js} +1 -1
  114. package/out/_next/static/chunks/1t-9vrdrsi8le.js +1 -0
  115. package/out/_next/static/chunks/1t97zo0tlpbnz.js +1 -0
  116. package/out/_next/static/chunks/1te2tinzqnwck.js +1 -0
  117. package/out/_next/static/chunks/{3j3ol_d1vsdhx.js → 1trt-m2nrck0v.js} +1 -1
  118. package/out/_next/static/chunks/{3vu5y270muh-7.js → 1ty9jpwr3o_st.js} +1 -1
  119. package/out/_next/static/chunks/{415g3asdds1ac.js → 1u6w6veke8rze.js} +1 -1
  120. package/out/_next/static/chunks/{0-laj-bivzp4x.js → 1u900urmrbv73.js} +1 -1
  121. package/out/_next/static/chunks/{0o73w0cn5n_vl.js → 1vz2gd8k74lpi.js} +1 -1
  122. package/out/_next/static/chunks/1wkpl9bfb0wn7.js +1 -0
  123. package/out/_next/static/chunks/1wrly9a9c3teq.js +1 -0
  124. package/out/_next/static/chunks/1x0m05155yy4e.js +1 -0
  125. package/out/_next/static/chunks/{1my968s78he8g.js → 1xf1wfow43ekc.js} +15 -15
  126. package/out/_next/static/chunks/1y10o40v9odam.js +1 -0
  127. package/out/_next/static/chunks/{3_gfl66zf638s.js → 1y_zykt3fpen4.js} +901 -906
  128. package/out/_next/static/chunks/1ye6xtbm16pg4.js +1 -0
  129. package/out/_next/static/chunks/1z6_57k5h31u7.js +1 -0
  130. package/out/_next/static/chunks/1zboqft0h6mop.js +1 -0
  131. package/out/_next/static/chunks/1zr3c351x0ri5.js +1 -0
  132. package/out/_next/static/chunks/2-5p2lcedvrli.js +1 -0
  133. package/out/_next/static/chunks/{1_4hh3dfop93j.js → 206hxrq60f1_e.js} +1 -1
  134. package/out/_next/static/chunks/20r05k3-studj.js +1 -0
  135. package/out/_next/static/chunks/22gs24kj2du56.js +1 -0
  136. package/out/_next/static/chunks/22x5pd1gyp7sf.js +1 -0
  137. package/out/_next/static/chunks/{3qo7e6b73mfxq.js → 22z-2t_yp1jzs.js} +1 -1
  138. package/out/_next/static/chunks/{3d43gd91r06y6.js → 23hmfdw6z5zfy.js} +507 -505
  139. package/out/_next/static/chunks/23y1krqnc-8sm.js +1 -0
  140. package/out/_next/static/chunks/{0gk5rnci1hznh.js → 24tbkj1qkux88.js} +2 -2
  141. package/out/_next/static/chunks/{2-i29-jdbwww6.js → 26cmri51v7497.js} +111 -111
  142. package/out/_next/static/chunks/27jalbk9zu-2b.js +1 -0
  143. package/out/_next/static/chunks/285d2s9096ryc.js +1 -0
  144. package/out/_next/static/chunks/296ykep2nvppv.js +1 -0
  145. package/out/_next/static/chunks/29nehg5cal-ug.js +1 -0
  146. package/out/_next/static/chunks/2_a56_k3x7to6.js +1 -0
  147. package/out/_next/static/chunks/2a-0l6eb1blh3.js +4 -0
  148. package/out/_next/static/chunks/{2oacwtbslo90t.js → 2a31-txop1jzg.js} +360 -360
  149. package/out/_next/static/chunks/2bse5vll1o-x0.js +1 -0
  150. package/out/_next/static/chunks/2ct40spu9wfj7.js +1 -0
  151. package/out/_next/static/chunks/{2epukrz6paj9n.js → 2ept01b7t-e03.js} +1 -1
  152. package/out/_next/static/chunks/{22yht3s7c-xih.js → 2ey5dqelco_g5.js} +1 -1
  153. package/out/_next/static/chunks/2fd_009hw7y0m.js +1 -0
  154. package/out/_next/static/chunks/{2fspbfbxbswzd.js → 2ftz9kaxrsgxh.js} +1 -1
  155. package/out/_next/static/chunks/2gefdnozflr7p.js +1 -0
  156. package/out/_next/static/chunks/{2as_br1awqk6k.js → 2gs-u1n5uv7iz.js} +496 -496
  157. package/out/_next/static/chunks/{1a94whad0y57f.js → 2hizqql79u-54.js} +1 -1
  158. package/out/_next/static/chunks/2iqf2dpdg_vfl.js +1 -0
  159. package/out/_next/static/chunks/2j7z127s_ycjd.js +1 -0
  160. package/out/_next/static/chunks/2kax7uslfxdnx.js +31 -0
  161. package/out/_next/static/chunks/{2laz1v9fg2a2z.js → 2lh_w9rzy3vek.js} +1 -1
  162. package/out/_next/static/chunks/{3mmy9zsb7zo-m.js → 2ln1na26qwp-3.js} +23 -23
  163. package/out/_next/static/chunks/2n08l1q5o_27e.js +1 -0
  164. package/out/_next/static/chunks/2n7268gyd9z-6.js +1 -0
  165. package/out/_next/static/chunks/2nq9cgjmtqwvp.js +1 -0
  166. package/out/_next/static/chunks/{25brs445bjbik.js → 2oj8qc_pv14nk.js} +2 -2
  167. package/out/_next/static/chunks/2q24e72-olbe8.js +1 -0
  168. package/out/_next/static/chunks/2qc4hscs26cro.js +1 -0
  169. package/out/_next/static/chunks/2qe46redkqhfg.js +1 -0
  170. package/out/_next/static/chunks/2qmfe0mqw150h.js +1 -0
  171. package/out/_next/static/chunks/2qtc0nbl_521e.js +1 -0
  172. package/out/_next/static/chunks/2rofu6gu1xzuq.js +1 -0
  173. package/out/_next/static/chunks/2tdi94rkq739i.js +1 -0
  174. package/out/_next/static/chunks/2u_2sacqa9xa7.js +1 -0
  175. package/out/_next/static/chunks/2ujqz6088shm5.js +1 -0
  176. package/out/_next/static/chunks/{3my05px5mv_s5.js → 2urh9qafp3fiw.js} +235 -235
  177. package/out/_next/static/chunks/{23-y1f_zw56vo.js → 2v06n4z8wsmn9.js} +1 -1
  178. package/out/_next/static/chunks/2vp-5skbk1nfu.js +1 -0
  179. package/out/_next/static/chunks/2vu973j_n6cpx.js +1 -0
  180. package/out/_next/static/chunks/2wwra56rehfcj.js +1 -0
  181. package/out/_next/static/chunks/2xpwr97h2asal.js +1 -0
  182. package/out/_next/static/chunks/3000-0b8n9t_2.js +1 -0
  183. package/out/_next/static/chunks/{0q0i4pdyq66gb.js → 30t3203d7p2da.js} +1 -1
  184. package/out/_next/static/chunks/{3t4ys6th6gf2w.js → 31kto7-dxkt3z.js} +1 -1
  185. package/out/_next/static/chunks/{0j0a0wvmmghxj.js → 32oflcl79d8mu.js} +1 -1
  186. package/out/_next/static/chunks/32ovg81ae0l03.js +1 -0
  187. package/out/_next/static/chunks/{2c8rmxz151fxa.js → 331kthnvoma7n.js} +224 -224
  188. package/out/_next/static/chunks/337kn1mn34rc6.js +1 -0
  189. package/out/_next/static/chunks/{336ckqpboqmbn.js → 33xug8kf0-a1o.js} +1 -1
  190. package/out/_next/static/chunks/34dcb7_flbrvo.js +1 -0
  191. package/out/_next/static/chunks/34zotyeqrz_nq.js +1 -0
  192. package/out/_next/static/chunks/351wsmi75l8db.js +1 -0
  193. package/out/_next/static/chunks/36yv-ialtpx98.js +1 -0
  194. package/out/_next/static/chunks/37hwasxtee5e0.js +1 -0
  195. package/out/_next/static/chunks/37t0iclgxes05.js +1 -0
  196. package/out/_next/static/chunks/{1x0j78ohufpul.js → 37xnvnx1jxfaf.js} +1 -1
  197. package/out/_next/static/chunks/{29hkkj9raxte9.js → 38w74ixqt-9co.js} +77 -77
  198. package/out/_next/static/chunks/{0jap7l5-bskj4.js → 39t2x_9zd2rst.js} +12 -12
  199. package/out/_next/static/chunks/{38q0enmlg5q9o.js → 39v73timmzwny.js} +2 -2
  200. package/out/_next/static/chunks/{3puu2_-t0lln9.js → 3_xqc3658d8sw.js} +12 -12
  201. package/out/_next/static/chunks/3ba8eudvlczwe.js +1 -0
  202. package/out/_next/static/chunks/3buezhxqc8n6n.js +1 -0
  203. package/out/_next/static/chunks/3c5iwwj-fhbue.js +1 -0
  204. package/out/_next/static/chunks/{2kmmk9coo9_b0.js → 3d8ot2tw6yqfq.js} +143 -143
  205. package/out/_next/static/chunks/3dc057ffe7ij-.js +1 -0
  206. package/out/_next/static/chunks/3djnlzwj9869o.js +1 -0
  207. package/out/_next/static/chunks/{2_6b9lraq-exh.js → 3fuqxjjf8o1v9.js} +5 -5
  208. package/out/_next/static/chunks/{0j2ygtc_-bo3m.js → 3gt6rzg9qw-an.js} +1 -1
  209. package/out/_next/static/chunks/{0rykrf_vofbad.js → 3h_05w5j8x538.js} +1 -1
  210. package/out/_next/static/chunks/{3txu-i5qn183a.js → 3hkhd1_k8xohv.js} +321 -321
  211. package/out/_next/static/chunks/{2h07np207nlx7.js → 3ijcc5tfisfnj.js} +1 -1
  212. package/out/_next/static/chunks/3j0dbpd9zop3p.js +1 -0
  213. package/out/_next/static/chunks/{14e4k-718qadd.js → 3ju83xk-ca7ma.js} +163 -168
  214. package/out/_next/static/chunks/3jxhl4apmhbm1.js +13 -0
  215. package/out/_next/static/chunks/{1h1gixjbjkbsl.js → 3la99oz_0p0r6.js} +5 -5
  216. package/out/_next/static/chunks/{1mt4cnd_d6jvf.js → 3n1b34fd5fdrh.js} +1 -1
  217. package/out/_next/static/chunks/3nq_hq4x3rn3r.js +1 -0
  218. package/out/_next/static/chunks/3pgb1kkqrdl9t.js +1 -0
  219. package/out/_next/static/chunks/3pik_-jj-zkfl.js +1 -0
  220. package/out/_next/static/chunks/{1zmx71cvc6ksk.js → 3q38kdbzd2nbd.js} +1 -1
  221. package/out/_next/static/chunks/3q5zl4ks17au2.js +1 -0
  222. package/out/_next/static/chunks/{1t2g1v0ubcsam.js → 3qr10445lte-n.js} +1 -1
  223. package/out/_next/static/chunks/3r-8bnguvxsyo.js +1 -0
  224. package/out/_next/static/chunks/3sg56j8boe-3o.js +1 -0
  225. package/out/_next/static/chunks/3u7zj1-jdg781.js +1 -0
  226. package/out/_next/static/chunks/{0o0qtv35dqv3i.js → 3wj5dmf6cywz8.js} +239 -239
  227. package/out/_next/static/chunks/{2iu0_3cx-ny74.js → 3wr_oijfsq8lr.js} +11 -11
  228. package/out/_next/static/chunks/3xu0dh1ikzwj2.js +1 -0
  229. package/out/_next/static/chunks/{0vzo-8t8c26k9.js → 3y5tpixt23-fl.js} +1 -1
  230. package/out/_next/static/chunks/40gjf-_jt8upu.js +5 -0
  231. package/out/_next/static/chunks/41f12o_5lf-i9.js +1 -0
  232. package/out/_next/static/chunks/42ma8lqduohlc.js +1 -0
  233. package/out/_next/static/chunks/43usshq2nc125.js +1 -0
  234. package/out/_next/static/chunks/{161yjxmdz9obc.js → 44bl4ufopbmyh.js} +1 -1
  235. package/out/_next/static/chunks/44iutzkw9r21x.js +1 -0
  236. package/out/_next/static/chunks/turbopack-1xrxa3noq196-.js +1 -0
  237. package/out/_not-found/__next._full.txt +11 -11
  238. package/out/_not-found/__next._not-found.__PAGE__.txt +19 -2
  239. package/out/_not-found/__next._tree.txt +1 -1
  240. package/out/_not-found.html +1 -1
  241. package/out/_not-found.txt +11 -11
  242. package/out/index.html +1 -1
  243. package/out/index.txt +10 -10
  244. package/package.json +11 -11
  245. package/out/__next._head.txt +0 -6
  246. package/out/__next._index.txt +0 -5
  247. package/out/_next/static/chunks/0-k4hp87gwues.js +0 -1
  248. package/out/_next/static/chunks/04zj0yf1qhk1o.js +0 -1
  249. package/out/_next/static/chunks/06fbalmyyfpsy.js +0 -1
  250. package/out/_next/static/chunks/07hgbbqksqd1g.js +0 -1
  251. package/out/_next/static/chunks/08ou2nvy48e0u.js +0 -1
  252. package/out/_next/static/chunks/08y5-irjbsiy8.js +0 -1
  253. package/out/_next/static/chunks/0_jrfk2u1u3fi.js +0 -1
  254. package/out/_next/static/chunks/0a475u_q5i_dd.js +0 -62
  255. package/out/_next/static/chunks/0aad2r4s4wl1x.js +0 -5
  256. package/out/_next/static/chunks/0d9pxx1w_zqr9.js +0 -1
  257. package/out/_next/static/chunks/0gnjtwq-474uc.js +0 -1
  258. package/out/_next/static/chunks/0gsh_d0m5xss1.js +0 -1
  259. package/out/_next/static/chunks/0ibzpjo0h731v.js +0 -1
  260. package/out/_next/static/chunks/0j_3k5qhv_mdx.js +0 -1
  261. package/out/_next/static/chunks/0jis2w2mfx062.js +0 -1
  262. package/out/_next/static/chunks/0jjvp2slpf7d6.js +0 -1
  263. package/out/_next/static/chunks/0ko10wo4rc9-b.js +0 -1
  264. package/out/_next/static/chunks/0lqmvz6k2h_of.js +0 -1
  265. package/out/_next/static/chunks/0lwjmr8efrlbt.js +0 -17
  266. package/out/_next/static/chunks/0noxyupihh8dk.js +0 -1
  267. package/out/_next/static/chunks/0o1vph7x9shzu.js +0 -1
  268. package/out/_next/static/chunks/0p6phe9kjlxn8.js +0 -1
  269. package/out/_next/static/chunks/0ptxb9dcwsw3o.js +0 -1
  270. package/out/_next/static/chunks/0q8pt8fd0ma30.js +0 -1
  271. package/out/_next/static/chunks/0qqx9aoz8l5d2.js +0 -1
  272. package/out/_next/static/chunks/0tsk32q-88t_7.js +0 -1
  273. package/out/_next/static/chunks/0u7577db_ivyr.js +0 -1
  274. package/out/_next/static/chunks/0unnrt0un064x.js +0 -1
  275. package/out/_next/static/chunks/0uygtr4mo3h0v.js +0 -1
  276. package/out/_next/static/chunks/0vf3facit951s.js +0 -1
  277. package/out/_next/static/chunks/0xyija62b6txc.js +0 -1
  278. package/out/_next/static/chunks/0zeb37703zcz3.js +0 -1
  279. package/out/_next/static/chunks/0zu5ato7-1-q9.js +0 -1
  280. package/out/_next/static/chunks/0zydv7y47dxgh.js +0 -1
  281. package/out/_next/static/chunks/103x4jwovb6d-.js +0 -1
  282. package/out/_next/static/chunks/107wfq84g9-kn.js +0 -1
  283. package/out/_next/static/chunks/10afagk8yn__n.js +0 -1
  284. package/out/_next/static/chunks/12ory_c78yl31.js +0 -1
  285. package/out/_next/static/chunks/133dqp8_7_yo6.js +0 -1
  286. package/out/_next/static/chunks/1365lgwdd4vuo.js +0 -1
  287. package/out/_next/static/chunks/146ou-ohb_qhs.js +0 -1
  288. package/out/_next/static/chunks/14orr68xgdykd.js +0 -1
  289. package/out/_next/static/chunks/15qfoj-vl9thu.js +0 -1
  290. package/out/_next/static/chunks/166yqx3_qvbpy.js +0 -1
  291. package/out/_next/static/chunks/16gwjao676ieb.js +0 -1
  292. package/out/_next/static/chunks/16rmmzhy2p7bw.js +0 -1
  293. package/out/_next/static/chunks/17_jjyx4jz9dd.js +0 -1
  294. package/out/_next/static/chunks/18h9ugdz6igdb.js +0 -1
  295. package/out/_next/static/chunks/19d8n5t7ka2fb.js +0 -1
  296. package/out/_next/static/chunks/1_rbzw3n4fk0g.js +0 -1
  297. package/out/_next/static/chunks/1aa9g197l4twm.js +0 -1
  298. package/out/_next/static/chunks/1bq0fcnt1wy86.js +0 -1
  299. package/out/_next/static/chunks/1c6mho7e0enta.js +0 -1
  300. package/out/_next/static/chunks/1dfaheve77dhi.js +0 -1
  301. package/out/_next/static/chunks/1dgf112ehnhm1.js +0 -1
  302. package/out/_next/static/chunks/1eirucr9s6-h5.js +0 -1
  303. package/out/_next/static/chunks/1fsof7un7igrn.js +0 -1
  304. package/out/_next/static/chunks/1gvu5a6ffbs7l.js +0 -1
  305. package/out/_next/static/chunks/1iel4pzhhh-c3.js +0 -1
  306. package/out/_next/static/chunks/1iojfx3-g4_n9.js +0 -1
  307. package/out/_next/static/chunks/1j4jt5q7px8sy.js +0 -1
  308. package/out/_next/static/chunks/1jjw9hxgi2vzi.js +0 -1
  309. package/out/_next/static/chunks/1k_8olnprvi8r.js +0 -1
  310. package/out/_next/static/chunks/1l0rt7d4m-xdk.js +0 -5
  311. package/out/_next/static/chunks/1s0dpdqy480hg.js +0 -1
  312. package/out/_next/static/chunks/1t-yolk97lmot.js +0 -12
  313. package/out/_next/static/chunks/1tbes2sv-qzcx.js +0 -1
  314. package/out/_next/static/chunks/1upy8a5cb75kt.js +0 -1
  315. package/out/_next/static/chunks/1xed71f608m4b.js +0 -1
  316. package/out/_next/static/chunks/1z790xxb46gxy.js +0 -1
  317. package/out/_next/static/chunks/219n3q-_eengm.js +0 -1
  318. package/out/_next/static/chunks/21wo3vdr_uby8.js +0 -1
  319. package/out/_next/static/chunks/25gep78-izw79.js +0 -4
  320. package/out/_next/static/chunks/26i7dn31afdtm.js +0 -1
  321. package/out/_next/static/chunks/27hbplu797elx.js +0 -1
  322. package/out/_next/static/chunks/2992eiy52nazj.js +0 -1
  323. package/out/_next/static/chunks/29_n5j-hg_gsa.js +0 -1
  324. package/out/_next/static/chunks/29bxq-67oazfg.js +0 -1
  325. package/out/_next/static/chunks/29ings58w7kp1.js +0 -1
  326. package/out/_next/static/chunks/2_n0cpkdsjzli.js +0 -1
  327. package/out/_next/static/chunks/2a3iy701j4r_y.js +0 -1
  328. package/out/_next/static/chunks/2al9dh3_1ixhv.js +0 -1
  329. package/out/_next/static/chunks/2awr1c_vfsutb.js +0 -1
  330. package/out/_next/static/chunks/2bxe3kjr17tdp.js +0 -1
  331. package/out/_next/static/chunks/2dvbzar93ooc-.js +0 -1
  332. package/out/_next/static/chunks/2e-vp0e11g9ew.js +0 -1
  333. package/out/_next/static/chunks/2exj9-0p6n9x-.js +0 -1
  334. package/out/_next/static/chunks/2gf8l6hbmt7v3.js +0 -1
  335. package/out/_next/static/chunks/2h9i_adbqaxs4.js +0 -1
  336. package/out/_next/static/chunks/2jio3sio-_43z.js +0 -1
  337. package/out/_next/static/chunks/2neieeo9g2u56.js +0 -1
  338. package/out/_next/static/chunks/2pb_uosb-aa8x.js +0 -1
  339. package/out/_next/static/chunks/2qu-gpm3ux1l6.js +0 -1
  340. package/out/_next/static/chunks/2rsi6v7qmqx2b.js +0 -1
  341. package/out/_next/static/chunks/2tdvuc-27khif.js +0 -1
  342. package/out/_next/static/chunks/2trolrgd7neax.js +0 -1
  343. package/out/_next/static/chunks/2uyuafmoe5wi0.js +0 -3
  344. package/out/_next/static/chunks/2w2e0pxgs-n8f.js +0 -1
  345. package/out/_next/static/chunks/2xujlsx3stqig.js +0 -1
  346. package/out/_next/static/chunks/30y71dxdpv52d.js +0 -1
  347. package/out/_next/static/chunks/32c-e_v8_2xkf.js +0 -1
  348. package/out/_next/static/chunks/32oj0iudhp8bm.js +0 -1
  349. package/out/_next/static/chunks/33p9du6y9eegg.js +0 -1
  350. package/out/_next/static/chunks/38om-j0h0rryk.js +0 -1
  351. package/out/_next/static/chunks/39cou9lia_g7l.js +0 -1
  352. package/out/_next/static/chunks/39pkya0_bvcaj.js +0 -1
  353. package/out/_next/static/chunks/39rhmj_32ujyj.js +0 -1
  354. package/out/_next/static/chunks/3_1zzmx92j9c0.js +0 -1
  355. package/out/_next/static/chunks/3_earszshuz4n.js +0 -1
  356. package/out/_next/static/chunks/3ap_uxc8lx7ni.js +0 -1
  357. package/out/_next/static/chunks/3b6na8zrex8jo.js +0 -1
  358. package/out/_next/static/chunks/3c0cxt72vilyz.js +0 -1
  359. package/out/_next/static/chunks/3g78x0pdaoi_4.js +0 -1
  360. package/out/_next/static/chunks/3gjvl1p-tugfe.js +0 -4
  361. package/out/_next/static/chunks/3i8iro1gas1vx.js +0 -1
  362. package/out/_next/static/chunks/3kpqfqr99vo7z.js +0 -1
  363. package/out/_next/static/chunks/3lladf_wemm-2.js +0 -1
  364. package/out/_next/static/chunks/3n62hbywoknop.js +0 -1
  365. package/out/_next/static/chunks/3o_dmzpahx-5g.js +0 -1
  366. package/out/_next/static/chunks/3r7v7un976sn7.js +0 -1
  367. package/out/_next/static/chunks/3rl_nhqwew40w.js +0 -1
  368. package/out/_next/static/chunks/3s7hqij6xp_4e.js +0 -1
  369. package/out/_next/static/chunks/3si3migsmvz9o.js +0 -1
  370. package/out/_next/static/chunks/3uarw1i1ij1er.js +0 -1
  371. package/out/_next/static/chunks/3un-w6wutw1qn.js +0 -1
  372. package/out/_next/static/chunks/3v8kgnjk27wbe.js +0 -1
  373. package/out/_next/static/chunks/3we1khqfexh3x.js +0 -1
  374. package/out/_next/static/chunks/3z35loj4i-id4.js +0 -1
  375. package/out/_next/static/chunks/42lqt7ig40wk5.js +0 -1
  376. package/out/_next/static/chunks/42s6ghsurq5q7.js +0 -1
  377. package/out/_next/static/chunks/42yctcfi2rfwr.js +0 -1
  378. package/out/_next/static/chunks/43_fau1gg69eo.js +0 -1
  379. package/out/_next/static/chunks/43ywrdzg_7af8.js +0 -31
  380. package/out/_next/static/chunks/44m1ijc5cv80x.js +0 -1
  381. package/out/_next/static/chunks/453_bg0lgesmp.js +0 -1
  382. package/out/_next/static/chunks/turbopack-1s36ieuku1ds3.js +0 -1
  383. package/out/_not-found/__next._head.txt +0 -6
  384. package/out/_not-found/__next._index.txt +0 -5
  385. package/out/_not-found/__next._not-found.txt +0 -5
  386. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_buildManifest.js +0 -0
  387. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_clientMiddlewareManifest.js +0 -0
  388. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64831,84856,64378,16931,25343,13035,64979,e=>{"use strict";let t,i,s,r,a,n,o,l,h,c,u,d,f,g,_,m,p,M,I,x,b,y,D,V,v,B,S,A,P,T,C,O,R,F,E,w,U,L,W;var N,K,k,z,G,Q,j,q,H,Z,Y,X,$,J,ee,et,ei,es,er,ea,en,eo,el,eh,ec=e.i(3864),eu=e.i(92180),ed=e.i(14958),ef=e.i(6252),eg=e.i(77090);function e_(e,t,i){try{let s=e.next();s.done?t(s):s.value?s.value.then(()=>{s.value=void 0,t(s)},i):t(s)}catch(e){i(e)}}function em(e=25){let t;return(i,s,r)=>{let a=performance.now();void 0===t||a-t>e?(t=a,setTimeout(()=>{e_(i,s,r)},0)):e_(i,s,r)}}function ep(e,t,i,s,r){let a=()=>{let n,o=e=>{e.done?i(e.value):void 0===n?n=!0:a()};do n=void 0,r&&r.aborted?s(Error("Aborted")):t(e,o,s),void 0===n&&(n=!1);while(n)};a()}function eM(e,t){let i;return ep(e,e_,e=>i=e,e=>{throw e},t),i}async function eI(e,t,i){return await new Promise((s,r)=>{ep(e,t,s,r,i)})}function ex(e,t){return(...i)=>eM(e(...i),t)}e.s(["createYieldingScheduler",0,em,"makeSyncFunction",0,ex,"runCoroutineAsync",0,eI,"runCoroutineSync",0,eM],84856);var eb=e.i(55288),ey=e.i(69400),eD=e.i(19919),eV=e.i(52624),ev=e.i(41041),eB=e.i(57575),eS=e.i(85050),eA=e.i(16347),eP=e.i(9855),eT=e.i(49165),eC=e.i(46951);class eO{}let eR=(a=[],N=class{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=ex(this._applyToCoroutine.bind(this)),this.uniqueId=N._UniqueIdGenerator,N._UniqueIdGenerator++}set(e,t){switch(!e.length&&eA.Logger.Warn(`Setting vertex data kind '${t}' with an empty array`),t){case ev.VertexBuffer.PositionKind:this.positions=e;break;case ev.VertexBuffer.NormalKind:this.normals=e;break;case ev.VertexBuffer.TangentKind:this.tangents=e;break;case ev.VertexBuffer.UVKind:this.uvs=e;break;case ev.VertexBuffer.UV2Kind:this.uvs2=e;break;case ev.VertexBuffer.UV3Kind:this.uvs3=e;break;case ev.VertexBuffer.UV4Kind:this.uvs4=e;break;case ev.VertexBuffer.UV5Kind:this.uvs5=e;break;case ev.VertexBuffer.UV6Kind:this.uvs6=e;break;case ev.VertexBuffer.ColorKind:this.colors=e;break;case ev.VertexBuffer.MatricesIndicesKind:this.matricesIndices=e;break;case ev.VertexBuffer.MatricesWeightsKind:this.matricesWeights=e;break;case ev.VertexBuffer.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case ev.VertexBuffer.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}}applyToMesh(e,t){return this._applyTo(e,t,!1),this}applyToGeometry(e,t){return this._applyTo(e,t,!1),this}updateMesh(e){return this._update(e),this}updateGeometry(e){return this._update(e),this}*_applyToCoroutine(e,t=!1,i){if(this.positions&&(e.setVerticesData(ev.VertexBuffer.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(ev.VertexBuffer.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(ev.VertexBuffer.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(ev.VertexBuffer.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(ev.VertexBuffer.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(ev.VertexBuffer.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(ev.VertexBuffer.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(ev.VertexBuffer.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(ev.VertexBuffer.UV6Kind,this.uvs6,t),i&&(yield)),this.colors){let s=this.positions&&this.colors.length===this.positions.length?3:4;e.setVerticesData(ev.VertexBuffer.ColorKind,this.colors,t,s),this.hasVertexAlpha&&void 0!==e.hasVertexAlpha&&(e.hasVertexAlpha=!0),i&&(yield)}if(this.matricesIndices&&(e.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),e.subMeshes&&this.materialInfos&&this.materialInfos.length>1)for(let t of(e.subMeshes=[],this.materialInfos))new eC.SubMesh(t.materialIndex,t.verticesStart,t.verticesCount,t.indexStart,t.indexCount,e);return this}_update(e,t,i){return this.positions&&e.updateVerticesData(ev.VertexBuffer.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(ev.VertexBuffer.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(ev.VertexBuffer.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(ev.VertexBuffer.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(ev.VertexBuffer.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(ev.VertexBuffer.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(ev.VertexBuffer.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(ev.VertexBuffer.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(ev.VertexBuffer.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(ev.VertexBuffer.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1];for(let n=i;n<i+s;n+=3)ey.Vector3.FromArrayToRef(e,n,r),ey.Vector3.TransformCoordinatesToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z}static _TransformVector3Normals(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1];for(let n=i;n<i+s;n+=3)ey.Vector3.FromArrayToRef(e,n,r),ey.Vector3.TransformNormalToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z}static _TransformVector4Normals(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector4[0],a=ey.TmpVectors.Vector4[1];for(let n=i;n<i+s;n+=4)ey.Vector4.FromArrayToRef(e,n,r),ey.Vector4.TransformNormalToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z,e[n+3]=a.w}static _FlipFaces(e,t=0,i=e.length){for(let s=t;s<t+i;s+=3){let t=e[s+1];e[s+1]=e[s+2],e[s+2]=t}}transform(e){let t=0>e.determinant();return this.positions&&N._TransformVector3Coordinates(this.positions,e),this.normals&&N._TransformVector3Normals(this.normals,e),this.tangents&&N._TransformVector4Normals(this.tangents,e),t&&this.indices&&N._FlipFaces(this.indices),this}splitBasedOnMaterialID(){if(!this.materialInfos||this.materialInfos.length<2)return[this];let e=[];for(let t of this.materialInfos){let i=new N;if(this.positions&&(i.positions=this.positions.slice(3*t.verticesStart,(t.verticesCount+t.verticesStart)*3)),this.normals&&(i.normals=this.normals.slice(3*t.verticesStart,(t.verticesCount+t.verticesStart)*3)),this.tangents&&(i.tangents=this.tangents.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.colors&&(i.colors=this.colors.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.uvs&&(i.uvs=this.uvs.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs2&&(i.uvs2=this.uvs2.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs3&&(i.uvs3=this.uvs3.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs4&&(i.uvs4=this.uvs4.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs5&&(i.uvs5=this.uvs5.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs6&&(i.uvs6=this.uvs6.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.matricesIndices&&(i.matricesIndices=this.matricesIndices.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesIndicesExtra&&(i.matricesIndicesExtra=this.matricesIndicesExtra.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesWeights&&(i.matricesWeights=this.matricesWeights.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesWeightsExtra&&(i.matricesWeightsExtra=this.matricesWeightsExtra.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.indices){i.indices=[];for(let e=t.indexStart;e<t.indexStart+t.indexCount;e++)i.indices.push(this.indices[e]-t.verticesStart)}let s=new eO;s.indexStart=0,s.indexCount=i.indices?i.indices.length:0,s.materialIndex=t.materialIndex,s.verticesStart=0,s.verticesCount=(i.positions?i.positions.length:0)/3,i.materialInfos=[s],e.push(i)}return e}merge(e,t=!1,i=!1,s=!1,r=!1){let a=Array.isArray(e)?e.map(e=>({vertexData:e})):[{vertexData:e}];return eM(this._mergeCoroutine(void 0,a,t,!1,i,s,r))}*_mergeCoroutine(e,t,i=!1,s,r,a=!1,n=!1){this._validate();let o=t.map(e=>e.vertexData),l=this;if(n)for(let e of o)e&&(e._validate(),!this.normals&&e.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&e.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&e.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&e.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&e.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&e.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&e.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&e.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&e.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&e.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&e.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&e.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&e.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(let e of o)if(e){if(n)this.normals&&!e.normals&&(e.normals=new Float32Array(e.positions.length)),this.tangents&&!e.tangents&&(e.tangents=new Float32Array(e.positions.length/3*4)),this.uvs&&!e.uvs&&(e.uvs=new Float32Array(e.positions.length/3*2)),this.uvs2&&!e.uvs2&&(e.uvs2=new Float32Array(e.positions.length/3*2)),this.uvs3&&!e.uvs3&&(e.uvs3=new Float32Array(e.positions.length/3*2)),this.uvs4&&!e.uvs4&&(e.uvs4=new Float32Array(e.positions.length/3*2)),this.uvs5&&!e.uvs5&&(e.uvs5=new Float32Array(e.positions.length/3*2)),this.uvs6&&!e.uvs6&&(e.uvs6=new Float32Array(e.positions.length/3*2)),this.colors&&!e.colors&&(e.colors=new Float32Array(e.positions.length/3*4),e.colors.fill(1)),this.matricesIndices&&!e.matricesIndices&&(e.matricesIndices=new Float32Array(e.positions.length/3*4)),this.matricesWeights&&!e.matricesWeights&&(e.matricesWeights=new Float32Array(e.positions.length/3*4)),this.matricesIndicesExtra&&!e.matricesIndicesExtra&&(e.matricesIndicesExtra=new Float32Array(e.positions.length/3*4)),this.matricesWeightsExtra&&!e.matricesWeightsExtra&&(e.matricesWeightsExtra=new Float32Array(e.positions.length/3*4));else if(e._validate(),!this.normals!=!e.normals||!this.tangents!=!e.tangents||!this.uvs!=!e.uvs||!this.uvs2!=!e.uvs2||!this.uvs3!=!e.uvs3||!this.uvs4!=!e.uvs4||!this.uvs5!=!e.uvs5||!this.uvs6!=!e.uvs6||!this.colors!=!e.colors||!this.matricesIndices!=!e.matricesIndices||!this.matricesWeights!=!e.matricesWeights||!this.matricesIndicesExtra!=!e.matricesIndicesExtra||!this.matricesWeightsExtra!=!e.matricesWeightsExtra)throw Error("Cannot merge vertex data that do not have the same set of attributes")}if(a){let i,s=0,r=0,a=[],n=null,h=[];for(let t of this.splitBasedOnMaterialID())h.push({vertexData:t,transform:e});for(let e of t)if(e.vertexData)for(let t of e.vertexData.splitBasedOnMaterialID())h.push({vertexData:t,transform:e.transform});for(let e of(h.sort((e,t)=>{let i=e.vertexData.materialInfos?e.vertexData.materialInfos[0].materialIndex:0,s=t.vertexData.materialInfos?t.vertexData.materialInfos[0].materialIndex:0;return i>s?1:i===s?0:-1}),h)){let t=e.vertexData;if(i=t.materialInfos?t.materialInfos[0].materialIndex:0,n&&n.materialIndex===i)n.indexCount+=t.indices.length,n.verticesCount+=t.positions.length/3;else{let e=new eO;e.materialIndex=i,e.indexStart=s,e.indexCount=t.indices.length,e.verticesStart=r,e.verticesCount=t.positions.length/3,a.push(e),n=e}s+=t.indices.length,r+=t.positions.length/3}let c=h.splice(0,1)[0];l=c.vertexData,e=c.transform,o=h.map(e=>e.vertexData),t=h,this.materialInfos=a}let h=o.reduce((e,t)=>e+(t.indices?.length??0),l.indices?.length??0),c=r||o.some(e=>e.indices===l.indices)?l.indices?.slice():l.indices;if(h>0){let r=c?.length??0;if(c||(c=Array(h)),c.length!==h){if(Array.isArray(c))c.length=h;else{let e=i||c instanceof Uint32Array?new Uint32Array(h):new Uint16Array(h);e.set(c),c=e}e&&0>e.determinant()&&N._FlipFaces(c,0,r)}let a=l.positions?l.positions.length/3:0;for(let{vertexData:e,transform:i}of t)if(e.indices){for(let t=0;t<e.indices.length;t++)c[r+t]=e.indices[t]+a;i&&0>i.determinant()&&N._FlipFaces(c,r,e.indices.length),a+=e.positions.length/3,r+=e.indices.length,s&&(yield)}}return this.indices=c,this.positions=N._MergeElement(ev.VertexBuffer.PositionKind,l.positions,e,t.map(e=>[e.vertexData.positions,e.transform])),s&&(yield),l.normals&&(this.normals=N._MergeElement(ev.VertexBuffer.NormalKind,l.normals,e,t.map(e=>[e.vertexData.normals,e.transform])),s&&(yield)),l.tangents&&(this.tangents=N._MergeElement(ev.VertexBuffer.TangentKind,l.tangents,e,t.map(e=>[e.vertexData.tangents,e.transform])),s&&(yield)),l.uvs&&(this.uvs=N._MergeElement(ev.VertexBuffer.UVKind,l.uvs,e,t.map(e=>[e.vertexData.uvs,e.transform])),s&&(yield)),l.uvs2&&(this.uvs2=N._MergeElement(ev.VertexBuffer.UV2Kind,l.uvs2,e,t.map(e=>[e.vertexData.uvs2,e.transform])),s&&(yield)),l.uvs3&&(this.uvs3=N._MergeElement(ev.VertexBuffer.UV3Kind,l.uvs3,e,t.map(e=>[e.vertexData.uvs3,e.transform])),s&&(yield)),l.uvs4&&(this.uvs4=N._MergeElement(ev.VertexBuffer.UV4Kind,l.uvs4,e,t.map(e=>[e.vertexData.uvs4,e.transform])),s&&(yield)),l.uvs5&&(this.uvs5=N._MergeElement(ev.VertexBuffer.UV5Kind,l.uvs5,e,t.map(e=>[e.vertexData.uvs5,e.transform])),s&&(yield)),l.uvs6&&(this.uvs6=N._MergeElement(ev.VertexBuffer.UV6Kind,l.uvs6,e,t.map(e=>[e.vertexData.uvs6,e.transform])),s&&(yield)),l.colors&&(this.colors=N._MergeElement(ev.VertexBuffer.ColorKind,l.colors,e,t.map(e=>[e.vertexData.colors,e.transform])),(void 0!==l.hasVertexAlpha||t.some(e=>void 0!==e.vertexData.hasVertexAlpha))&&(this.hasVertexAlpha=l.hasVertexAlpha||t.some(e=>e.vertexData.hasVertexAlpha)),s&&(yield)),l.matricesIndices&&(this.matricesIndices=N._MergeElement(ev.VertexBuffer.MatricesIndicesKind,l.matricesIndices,e,t.map(e=>[e.vertexData.matricesIndices,e.transform])),s&&(yield)),l.matricesWeights&&(this.matricesWeights=N._MergeElement(ev.VertexBuffer.MatricesWeightsKind,l.matricesWeights,e,t.map(e=>[e.vertexData.matricesWeights,e.transform])),s&&(yield)),l.matricesIndicesExtra&&(this.matricesIndicesExtra=N._MergeElement(ev.VertexBuffer.MatricesIndicesExtraKind,l.matricesIndicesExtra,e,t.map(e=>[e.vertexData.matricesIndicesExtra,e.transform])),s&&(yield)),l.matricesWeightsExtra&&(this.matricesWeightsExtra=N._MergeElement(ev.VertexBuffer.MatricesWeightsExtraKind,l.matricesWeightsExtra,e,t.map(e=>[e.vertexData.matricesWeightsExtra,e.transform]))),this}static _MergeElement(e,t,i,s){let r=s.filter(e=>null!==e[0]&&void 0!==e[0]);if(!t&&0==r.length)return t;if(!t)return this._MergeElement(e,r[0][0],r[0][1],r.slice(1));let a=r.reduce((e,t)=>e+t[0].length,t.length),n=e===ev.VertexBuffer.PositionKind?N._TransformVector3Coordinates:e===ev.VertexBuffer.NormalKind?N._TransformVector3Normals:e===ev.VertexBuffer.TangentKind?N._TransformVector4Normals:()=>{};if(t instanceof Float32Array){let e=new Float32Array(a);e.set(t),i&&n(e,i,0,t.length);let s=t.length;for(let[t,i]of r)e.set(t,s),i&&n(e,i,s,t.length),s+=t.length;return e}{let e=Array(a);for(let i=0;i<t.length;i++)e[i]=t[i];i&&n(e,i,0,t.length);let s=t.length;for(let[t,i]of r){for(let i=0;i<t.length;i++)e[s+i]=t[i];i&&n(e,i,s,t.length),s+=t.length}return e}}_validate(){if(!this.positions)throw new eT.RuntimeError("Positions are required",eT.ErrorCodes.MeshInvalidPositionsError);let e=(e,t)=>{let i=(0,ev.VertexBufferDeduceStride)(e);if(t.length%i!=0)throw Error("The "+e+"s array count must be a multiple of "+i);return t.length/i},t=e(ev.VertexBuffer.PositionKind,this.positions),i=(i,s)=>{let r=e(i,s);if(r!==t)throw Error("The "+i+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(ev.VertexBuffer.NormalKind,this.normals),this.tangents&&i(ev.VertexBuffer.TangentKind,this.tangents),this.uvs&&i(ev.VertexBuffer.UVKind,this.uvs),this.uvs2&&i(ev.VertexBuffer.UV2Kind,this.uvs2),this.uvs3&&i(ev.VertexBuffer.UV3Kind,this.uvs3),this.uvs4&&i(ev.VertexBuffer.UV4Kind,this.uvs4),this.uvs5&&i(ev.VertexBuffer.UV5Kind,this.uvs5),this.uvs6&&i(ev.VertexBuffer.UV6Kind,this.uvs6),this.colors&&i(ev.VertexBuffer.ColorKind,this.colors),this.matricesIndices&&i(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){let e=this.serialize();return N.Parse(e)}serialize(){let e={};if(this.positions&&(e.positions=Array.from(this.positions)),this.normals&&(e.normals=Array.from(this.normals)),this.tangents&&(e.tangents=Array.from(this.tangents)),this.uvs&&(e.uvs=Array.from(this.uvs)),this.uvs2&&(e.uvs2=Array.from(this.uvs2)),this.uvs3&&(e.uvs3=Array.from(this.uvs3)),this.uvs4&&(e.uvs4=Array.from(this.uvs4)),this.uvs5&&(e.uvs5=Array.from(this.uvs5)),this.uvs6&&(e.uvs6=Array.from(this.uvs6)),this.colors&&(e.colors=Array.from(this.colors),e.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(e.matricesIndices=Array.from(this.matricesIndices),e.matricesIndicesExpanded=!0),this.matricesWeights&&(e.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(e.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),e.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),e.indices=this.indices?Array.from(this.indices):[],this.materialInfos)for(let t of(e.materialInfos=[],this.materialInfos)){let i={indexStart:t.indexStart,indexCount:t.indexCount,materialIndex:t.materialIndex,verticesStart:t.verticesStart,verticesCount:t.verticesCount};e.materialInfos.push(i)}return e}static ExtractFromMesh(e,t,i){return N._ExtractFrom(e,t,i)}static ExtractFromGeometry(e,t,i){return N._ExtractFrom(e,t,i)}static _ExtractFrom(e,t,i){let s=new N;if(e.isVerticesDataPresent(ev.VertexBuffer.PositionKind)&&(s.positions=e.getVerticesData(ev.VertexBuffer.PositionKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&(s.normals=e.getVerticesData(ev.VertexBuffer.NormalKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.TangentKind)&&(s.tangents=e.getVerticesData(ev.VertexBuffer.TangentKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UVKind)&&(s.uvs=e.getVerticesData(ev.VertexBuffer.UVKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV2Kind)&&(s.uvs2=e.getVerticesData(ev.VertexBuffer.UV2Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV3Kind)&&(s.uvs3=e.getVerticesData(ev.VertexBuffer.UV3Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV4Kind)&&(s.uvs4=e.getVerticesData(ev.VertexBuffer.UV4Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV5Kind)&&(s.uvs5=e.getVerticesData(ev.VertexBuffer.UV5Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV6Kind)&&(s.uvs6=e.getVerticesData(ev.VertexBuffer.UV6Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.ColorKind)){let r=e.geometry||e,a=r.getVertexBuffer(ev.VertexBuffer.ColorKind),n=r.getVerticesData(ev.VertexBuffer.ColorKind,t,i);if(3===a.getSize()){let e=new Float32Array(4*n.length/3);for(let t=0,i=0;t<n.length;t+=3,i+=4)e[i]=n[t],e[i+1]=n[t+1],e[i+2]=n[t+2],e[i+3]=1;s.colors=e}else if(4===a.getSize())s.colors=n;else throw Error(`Unexpected number of color components: ${a.getSize()}`)}return e.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&(s.matricesIndices=e.getVerticesData(ev.VertexBuffer.MatricesIndicesKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(s.matricesWeights=e.getVerticesData(ev.VertexBuffer.MatricesWeightsKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesExtraKind)&&(s.matricesIndicesExtra=e.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsExtraKind)&&(s.matricesWeightsExtra=e.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,t,i)),s.indices=e.getIndices(t,i),s}static CreateRibbon(e){throw(0,eS._WarnImport)("ribbonBuilder")}static CreateBox(e){throw(0,eS._WarnImport)("boxBuilder")}static CreateTiledBox(e){throw(0,eS._WarnImport)("tiledBoxBuilder")}static CreateTiledPlane(e){throw(0,eS._WarnImport)("tiledPlaneBuilder")}static CreateSphere(e){throw(0,eS._WarnImport)("sphereBuilder")}static CreateCylinder(e){throw(0,eS._WarnImport)("cylinderBuilder")}static CreateTorus(e){throw(0,eS._WarnImport)("torusBuilder")}static CreateLineSystem(e){throw(0,eS._WarnImport)("linesBuilder")}static CreateDashedLines(e){throw(0,eS._WarnImport)("linesBuilder")}static CreateGround(e){throw(0,eS._WarnImport)("groundBuilder")}static CreateTiledGround(e){throw(0,eS._WarnImport)("groundBuilder")}static CreateGroundFromHeightMap(e){throw(0,eS._WarnImport)("groundBuilder")}static CreatePlane(e){throw(0,eS._WarnImport)("planeBuilder")}static CreateDisc(e){throw(0,eS._WarnImport)("discBuilder")}static CreatePolygon(e,t,i,s,r,a,n){throw(0,eS._WarnImport)("polygonBuilder")}static CreateIcoSphere(e){throw(0,eS._WarnImport)("icoSphereBuilder")}static CreatePolyhedron(e){throw(0,eS._WarnImport)("polyhedronBuilder")}static CreateCapsule(e={orientation:ey.Vector3.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw(0,eS._WarnImport)("capsuleBuilder")}static CreateTorusKnot(e){throw(0,eS._WarnImport)("torusKnotBuilder")}static ComputeNormals(e,t,i,s){let r,a,n,o,l,h,c,u,d,f,g,_,m,p,M,I,x,b,y,D,V=!1,v=!1,B=!1,S=!1,A=1,P=0,T=null;s&&(V=!!s.facetNormals,v=!!s.facetPositions,B=!!s.facetPartitioning,A=!0===s.useRightHandedSystem?-1:1,P=s.ratio||0,S=!!s.depthSort,T=s.distanceTo,S&&void 0===T&&(T=ey.Vector3.Zero()));let C=0,O=0,R=0,F=0;for(B&&s&&s.bbSize&&(C=s.subDiv.X*P/s.bbSize.x,O=s.subDiv.Y*P/s.bbSize.y,R=s.subDiv.Z*P/s.bbSize.z,F=s.subDiv.max*s.subDiv.max,s.facetPartitioning.length=0),r=0;r<e.length;r++)i[r]=0;let E=t.length/3|0;for(r=0;r<E;r++){if(m=(_=3*t[3*r])+1,p=_+2,I=(M=3*t[3*r+1])+1,x=M+2,y=(b=3*t[3*r+2])+1,D=b+2,a=e[_]-e[M],n=e[m]-e[I],o=e[p]-e[x],l=e[b]-e[M],h=e[y]-e[I],g=0===(g=Math.sqrt((u=A*(n*(c=e[D]-e[x])-o*h))*u+(d=A*(o*l-a*c))*d+(f=A*(a*h-n*l))*f))?1:g,u/=g,d/=g,f/=g,V&&s&&(s.facetNormals[r].x=u,s.facetNormals[r].y=d,s.facetNormals[r].z=f),v&&s&&(s.facetPositions[r].x=(e[_]+e[M]+e[b])/3,s.facetPositions[r].y=(e[m]+e[I]+e[y])/3,s.facetPositions[r].z=(e[p]+e[x]+e[D])/3),B&&s){let t=Math.floor((s.facetPositions[r].x-s.bInfo.minimum.x*P)*C),i=Math.floor((s.facetPositions[r].y-s.bInfo.minimum.y*P)*O),a=Math.floor((s.facetPositions[r].z-s.bInfo.minimum.z*P)*R),n=Math.floor((e[_]-s.bInfo.minimum.x*P)*C),o=Math.floor((e[m]-s.bInfo.minimum.y*P)*O),l=Math.floor((e[p]-s.bInfo.minimum.z*P)*R),h=Math.floor((e[M]-s.bInfo.minimum.x*P)*C),c=Math.floor((e[I]-s.bInfo.minimum.y*P)*O),u=Math.floor((e[x]-s.bInfo.minimum.z*P)*R),d=Math.floor((e[b]-s.bInfo.minimum.x*P)*C),f=Math.floor((e[y]-s.bInfo.minimum.y*P)*O),g=Math.floor((e[D]-s.bInfo.minimum.z*P)*R),V=n+s.subDiv.max*o+F*l,v=h+s.subDiv.max*c+F*u,B=d+s.subDiv.max*f+F*g,S=t+s.subDiv.max*i+F*a;s.facetPartitioning[S]=s.facetPartitioning[S]?s.facetPartitioning[S]:[],s.facetPartitioning[V]=s.facetPartitioning[V]?s.facetPartitioning[V]:[],s.facetPartitioning[v]=s.facetPartitioning[v]?s.facetPartitioning[v]:[],s.facetPartitioning[B]=s.facetPartitioning[B]?s.facetPartitioning[B]:[],s.facetPartitioning[V].push(r),v!=V&&s.facetPartitioning[v].push(r),B!=v&&B!=V&&s.facetPartitioning[B].push(r),S!=V&&S!=v&&S!=B&&s.facetPartitioning[S].push(r)}if(S&&s&&s.facetPositions){let e=s.depthSortedFacets[r];e.ind=3*r,e.sqDistance=ey.Vector3.DistanceSquared(s.facetPositions[r],T)}i[_]+=u,i[m]+=d,i[p]+=f,i[M]+=u,i[I]+=d,i[x]+=f,i[b]+=u,i[y]+=d,i[D]+=f}for(r=0;r<i.length/3;r++)u=i[3*r],g=0===(g=Math.sqrt(u*u+(d=i[3*r+1])*d+(f=i[3*r+2])*f))?1:g,u/=g,d/=g,f/=g,i[3*r]=u,i[3*r+1]=d,i[3*r+2]=f}static _ComputeSides(e,t,i,s,r,a,n){let o,l,h=i.length,c=s.length;switch(e=e||N.DEFAULTSIDE){case N.FRONTSIDE:break;case N.BACKSIDE:for(o=0;o<h;o+=3){let e=i[o];i[o]=i[o+2],i[o+2]=e}for(l=0;l<c;l++)s[l]=-s[l];break;case N.DOUBLESIDE:{let e,u=t.length,d=u/3;for(let e=0;e<u;e++)t[u+e]=t[e];for(o=0;o<h;o+=3)i[o+h]=i[o+2]+d,i[o+1+h]=i[o+1]+d,i[o+2+h]=i[o]+d;for(l=0;l<c;l++)s[c+l]=-s[l];let f=r.length;for(e=0;e<f;e++)r[e+f]=r[e];for(o=0,a=a||new ey.Vector4(0,0,1,1),n=n||new ey.Vector4(0,0,1,1),e=0;o<f/2;o++)r[e]=a.x+(a.z-a.x)*r[e],r[e+1]=a.y+(a.w-a.y)*r[e+1],r[e+f]=n.x+(n.z-n.x)*r[e+f],r[e+f+1]=n.y+(n.w-n.y)*r[e+f+1],e+=2}}}static Parse(e){let t=new N,i=e.positions;i&&t.set(i,ev.VertexBuffer.PositionKind);let s=e.normals;s&&t.set(s,ev.VertexBuffer.NormalKind);let r=e.tangents;r&&t.set(r,ev.VertexBuffer.TangentKind);let a=e.uvs;a&&t.set(a,ev.VertexBuffer.UVKind);let n=e.uvs2;n&&t.set(n,ev.VertexBuffer.UV2Kind);let o=e.uvs3;o&&t.set(o,ev.VertexBuffer.UV3Kind);let l=e.uvs4;l&&t.set(l,ev.VertexBuffer.UV4Kind);let h=e.uvs5;h&&t.set(h,ev.VertexBuffer.UV5Kind);let c=e.uvs6;c&&t.set(c,ev.VertexBuffer.UV6Kind);let u=e.colors;u&&(t.set(eD.Color4.CheckColors4(u,i.length/3),ev.VertexBuffer.ColorKind),void 0!==e.hasVertexAlpha&&(t.hasVertexAlpha=e.hasVertexAlpha));let d=e.matricesIndices;d&&t.set(d,ev.VertexBuffer.MatricesIndicesKind);let f=e.matricesWeights;f&&t.set(f,ev.VertexBuffer.MatricesWeightsKind);let g=e.indices;g&&(t.indices=g);let _=e.materialInfos;if(_)for(let e of(t.materialInfos=[],_)){let i=new eO;i.indexCount=e.indexCount,i.indexStart=e.indexStart,i.verticesCount=e.verticesCount,i.verticesStart=e.verticesStart,i.materialIndex=e.materialIndex,t.materialInfos.push(i)}return t}static ImportVertexData(e,t){let i=N.Parse(e);t.setAllVerticesData(i,e.updatable)}},n="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0,t=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],i=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],s=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],r=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],(0,eB.__esDecorate)(N,null,t,{kind:"method",name:"_TransformVector3Coordinates",static:!0,private:!1,access:{has:e=>"_TransformVector3Coordinates"in e,get:e=>e._TransformVector3Coordinates},metadata:n},null,a),(0,eB.__esDecorate)(N,null,i,{kind:"method",name:"_TransformVector3Normals",static:!0,private:!1,access:{has:e=>"_TransformVector3Normals"in e,get:e=>e._TransformVector3Normals},metadata:n},null,a),(0,eB.__esDecorate)(N,null,s,{kind:"method",name:"_TransformVector4Normals",static:!0,private:!1,access:{has:e=>"_TransformVector4Normals"in e,get:e=>e._TransformVector4Normals},metadata:n},null,a),(0,eB.__esDecorate)(N,null,r,{kind:"method",name:"_FlipFaces",static:!0,private:!1,access:{has:e=>"_FlipFaces"in e,get:e=>e._FlipFaces},metadata:n},null,a),n&&Object.defineProperty(N,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),N.FRONTSIDE=((0,eB.__runInitializers)(N,a),0),N.BACKSIDE=1,N.DOUBLESIDE=2,N.DEFAULTSIDE=0,N._UniqueIdGenerator=0,N);e.s(["VertexData",0,eR],64378);var eF=e.i(31837),eE=e.i(90025),ew=e.i(70807),eU=e.i(23003),eL=e.i(372),eW=e.i(83592);class eN{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){let t=new eN(eN.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,r=null,a=null){if(this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new ey.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new ey.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||eU.EngineStore.LastCreatedScene,!this._scene)return;this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,null!==a&&(this._totalVertices=a),i?this.setAllVerticesData(i,s):null===a&&(this._totalVertices=0),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),r&&(this.applyToMesh(r),r.computeWorldMatrix(!0))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return 1===this.delayLoadState||0===this.delayLoadState}get doNotSerialize(){for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){this._vertexArrayObjects&&(this._vertexArrayObjects={}),0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));let e=new Set;for(let t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(e=>{e._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));let r=new ev.VertexBuffer(this._engine,t,e,{updatable:i,postponeInternalCreation:0===this._meshes.length,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(r)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){let s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;let r=this._meshes,a=r.length;if(s===ev.VertexBuffer.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(this.useBoundingInfoFromGeometry&&this._boundingInfo?null:e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();let i=this._extend&&this._extend.minimum||new ey.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),s=this._extend&&this._extend.maximum||new ey.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<a;e++){let t=r[e];t.buildBoundingInfo(i,s),t._createGlobalSubMesh(t.isUnIndexed),t.computeWorldMatrix(!0),t.synchronizeInstances()}}this._notifyUpdate(s)}updateVerticesDataDirectly(e,t,i,s=!1){let r=this.getVertexBuffer(e);r&&(r.updateDirectly(t,i,s),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){let s=this.getVertexBuffer(e);s&&(s.update(t),e===ev.VertexBuffer.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e)for(let e of this._meshes)for(let t of(e.hasBoundingInfo?e.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e.subMeshes))t.refreshBoundingInfo()}_bind(e,t,i,s){if(!e)return;void 0===t&&(t=this._indexBuffer);let r=this.getVertexBuffers();if(!r)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!s)return void this._engine.bindBuffers(r,t,e,i);let a=s||this._vertexArrayObjects,n=this._engine;a[e.key]||(a[e.key]=n.recordVertexArrayObject(r,t,e,i)),n.bindVertexArrayObject(a[e.key],t)}getTotalVertices(){return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){let s=this.getVertexBuffer(e);return s?s.getFloatData(this._totalVertices,i||t&&1!==this._meshes.length):null}copyVerticesData(e,t){let i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));let s=i.getData();s&&(0,eW.CopyFloatData)(s,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){let t=this._vertexBuffers[e];return!!t&&t.isUpdatable()}getVertexBuffer(e){return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){return this._vertexBuffers?void 0!==this._vertexBuffers[e]:!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}getVerticesDataKinds(){let e,t=[];if(!this._vertexBuffers&&this._delayInfo)for(e in this._delayInfo)t.push(e);else for(e in this._vertexBuffers)t.push(e);return t}updateIndices(e,t,i=!1){if(this._indexBuffer)if(this._indexBufferIsUpdatable){let s=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),s)for(let e of this._meshes)e._createGlobalSubMesh(!0)}else this.setIndices(e,null,!0)}setIndexBuffer(e,t,i,s=null){for(let r of(this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,null===s?e.is32Bits=t>65535:e.is32Bits=s,this._meshes))r._createGlobalSubMesh(!0),r.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){for(let r of(this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),void 0!=t&&(this._totalVertices=t),this._meshes))r._createGlobalSubMesh(!s),r.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?void 0!==this._totalIndices?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;let i=this._indices;return t||e&&1!==this._meshes.length?i.slice():i}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){e&&this._vertexArrayObjects&&this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){let i=this._meshes,s=i.indexOf(e);-1!==s&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,0===i.length&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;let t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();let i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&!(e=this.getVerticesData(ev.VertexBuffer.PositionKind)))return;this._extend=(0,ew.extractMinAndMax)(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){for(let t in this._vertexBuffers){let i=this._vertexBuffers[t];i._buffer.getBuffer()||i.create(),t===ev.VertexBuffer.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo())}!this._indexBuffer&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){for(let t of(this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects(),this._meshes))t._markSubMeshesAsAttributesDirty()}load(e,t){if(2!==this.delayLoadState){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),(async()=>{try{let i=await e._loadDelayedFileAsync(this.delayLoadingFile,!1,!0);if(!this._delayLoadingFunction)return void e.removePendingData(this);this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);let s=this._meshes,r=s.length;for(let e=0;e<r;e++)this._applyToMesh(s[e]);t&&t()}catch(t){e.removePendingData(this),e.isDisposed||eA.Logger.Error(`Unable to delay load geometry "${this.id}" from "${this.delayLoadingFile}": ${t}`)}})())}toLeftHanded(){let e=this.getIndices(!1);if(null!=e&&e.length>0){for(let t=0;t<e.length;t+=3){let i=e[t+0];e[t+0]=e[t+2],e[t+2]=i}this.setIndices(e)}let t=this.getVerticesData(ev.VertexBuffer.PositionKind,!1);if(null!=t&&t.length>0){for(let e=0;e<t.length;e+=3)t[e+2]=-t[e+2];this.setVerticesData(ev.VertexBuffer.PositionKind,t,!1)}let i=this.getVerticesData(ev.VertexBuffer.NormalKind,!1);if(null!=i&&i.length>0){for(let e=0;e<i.length;e+=3)i[e+2]=-i[e+2];this.setVerticesData(ev.VertexBuffer.NormalKind,i,!1)}}_resetPointsArrayCache(){this._positions=null}_generatePointsArray(){if(this._positions)return!0;let e=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!e||0===e.length)return!1;for(let t=3*this._positionsCache.length,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=ey.Vector3.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){return this._isDisposed}_disposeVertexArrayObjects(){if(this._vertexArrayObjects){for(let e in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);this._vertexArrayObjects={};let e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){let e,t=this._meshes,i=t.length;for(e=0;e<i;e++)this.releaseForMesh(t[e]);for(let e in this._meshes.length=0,this._disposeVertexArrayObjects(),this._vertexBuffers)this._vertexBuffers[e].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){let e=this._parentContainer.geometries.indexOf(this);e>-1&&this._parentContainer.geometries.splice(e,1),this._parentContainer=null}this._isDisposed=!0}copy(e){let t,i=new eN(e,this._scene),s=this.getIndices(void 0,!0);s&&i.setIndices(s);let r=!1;for(t in this._vertexBuffers){let e=this.getVertexBuffer(t),s=e.getData();if(!s)continue;let a=e.isUpdatable(),n=e.getSize(),{type:o,byteOffset:l,byteStride:h,normalized:c}=e;r=r||a;let u=this._totalVertices;e.getIsInstanced()&&(u=(s instanceof Array?4*s.length:s.byteLength)/h);let d=(0,eW.GetTypedArrayData)(s,n,o,l,h,u,!0),f=new ev.VertexBuffer(this._engine,d,t,{updatable:a,useBytes:!1,stride:n,size:n,offset:0,type:o,normalized:c,takeBufferOwnership:!0,instanced:e.getIsInstanced()});i.setVerticesBuffer(f,u)}for(t in i._updatable=r,i.delayLoadState=this.delayLoadState,i.delayLoadingFile=this.delayLoadingFile,i._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)i._delayInfo=i._delayInfo||[],i._delayInfo.push(t);return i._boundingInfo=new eE.BoundingInfo(this._extend.minimum,this._extend.maximum),i}serialize(){let e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,eg.Tags&&eg.Tags.HasTags(this)&&(e.tags=eg.Tags.GetTags(this)),e}_toNumberArray(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){for(let e in this._totalIndices=this._indices.length,this._indices=[],this._resetPointsArrayCache(),this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){let e=this.serialize();return this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.PositionKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.NormalKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.TangentKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UVKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV2Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV3Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV4Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV5Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV6Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV6Kind)&&(e.uvs6Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.ColorKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(ev.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){let i=e._geometry;return i?i.copy(t):null}static RandomId(){return eu.Tools.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){let i=t.getScene(),s=e.geometryUniqueId,r=e.geometryId;if(s||r){let e=s?this._GetGeometryByLoadedUniqueId(s,i):i.getGeometryById(r);e&&e.applyToMesh(t)}else if(e instanceof ArrayBuffer){let i=t._binaryInfo;if(i.positionsAttrDesc&&i.positionsAttrDesc.count>0){let s=new Float32Array(e,i.positionsAttrDesc.offset,i.positionsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.PositionKind,s,!1)}if(i.normalsAttrDesc&&i.normalsAttrDesc.count>0){let s=new Float32Array(e,i.normalsAttrDesc.offset,i.normalsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.NormalKind,s,!1)}if(i.tangetsAttrDesc&&i.tangetsAttrDesc.count>0){let s=new Float32Array(e,i.tangetsAttrDesc.offset,i.tangetsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.TangentKind,s,!1)}if(i.uvsAttrDesc&&i.uvsAttrDesc.count>0){let s=new Float32Array(e,i.uvsAttrDesc.offset,i.uvsAttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UVKind,s,!1)}if(i.uvs2AttrDesc&&i.uvs2AttrDesc.count>0){let s=new Float32Array(e,i.uvs2AttrDesc.offset,i.uvs2AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV2Kind,s,!1)}if(i.uvs3AttrDesc&&i.uvs3AttrDesc.count>0){let s=new Float32Array(e,i.uvs3AttrDesc.offset,i.uvs3AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV3Kind,s,!1)}if(i.uvs4AttrDesc&&i.uvs4AttrDesc.count>0){let s=new Float32Array(e,i.uvs4AttrDesc.offset,i.uvs4AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV4Kind,s,!1)}if(i.uvs5AttrDesc&&i.uvs5AttrDesc.count>0){let s=new Float32Array(e,i.uvs5AttrDesc.offset,i.uvs5AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV5Kind,s,!1)}if(i.uvs6AttrDesc&&i.uvs6AttrDesc.count>0){let s=new Float32Array(e,i.uvs6AttrDesc.offset,i.uvs6AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV6Kind,s,!1)}if(i.colorsAttrDesc&&i.colorsAttrDesc.count>0){let s=new Float32Array(e,i.colorsAttrDesc.offset,i.colorsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.ColorKind,s,!1,i.colorsAttrDesc.stride)}if(i.matricesIndicesAttrDesc&&i.matricesIndicesAttrDesc.count>0){let s=new Int32Array(e,i.matricesIndicesAttrDesc.offset,i.matricesIndicesAttrDesc.count),r=[];for(let e=0;e<s.length;e++){let t=s[e];r.push(255&t),r.push((65280&t)>>8),r.push((0xff0000&t)>>16),r.push(t>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,r,!1)}if(i.matricesIndicesExtraAttrDesc&&i.matricesIndicesExtraAttrDesc.count>0){let s=new Int32Array(e,i.matricesIndicesExtraAttrDesc.offset,i.matricesIndicesExtraAttrDesc.count),r=[];for(let e=0;e<s.length;e++){let t=s[e];r.push(255&t),r.push((65280&t)>>8),r.push((0xff0000&t)>>16),r.push(t>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,r,!1)}if(i.matricesWeightsAttrDesc&&i.matricesWeightsAttrDesc.count>0){let s=new Float32Array(e,i.matricesWeightsAttrDesc.offset,i.matricesWeightsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,s,!1)}if(i.indicesAttrDesc&&i.indicesAttrDesc.count>0){let s=new Int32Array(e,i.indicesAttrDesc.offset,i.indicesAttrDesc.count);t.setIndices(s,null)}if(i.subMeshesAttrDesc&&i.subMeshesAttrDesc.count>0){let s=new Int32Array(e,i.subMeshesAttrDesc.offset,5*i.subMeshesAttrDesc.count);t.subMeshes=[];for(let e=0;e<i.subMeshesAttrDesc.count;e++){let i=s[5*e+0],r=s[5*e+1],a=s[5*e+2],n=s[5*e+3],o=s[5*e+4];eC.SubMesh.AddToMesh(i,r,a,n,o,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(ev.VertexBuffer.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(ev.VertexBuffer.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(ev.VertexBuffer.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(ev.VertexBuffer.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(ev.VertexBuffer.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(ev.VertexBuffer.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(ev.VertexBuffer.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(ev.VertexBuffer.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(ev.VertexBuffer.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(ev.VertexBuffer.ColorKind,eD.Color4.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(e.matricesIndices._isExpanded||e.matricesIndicesExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);else{let i=[];for(let t=0;t<e.matricesIndices.length;t++){let s=e.matricesIndices[t];i.push(255&s),i.push((65280&s)>>8),i.push((0xff0000&s)>>16),i.push(s>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,i,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{let i=[];for(let t=0;t<e.matricesIndicesExtra.length;t++){let s=e.matricesIndicesExtra[t];i.push(255&s),i.push((65280&s)>>8),i.push((0xff0000&s)>>16),i.push(s>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,i,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}e.matricesWeights&&(eN._CleanMatricesWeights(e,t),t.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let i=0;i<e.subMeshes.length;i++){let s=e.subMeshes[i];eC.SubMesh.AddToMesh(s.materialIndex,s.verticesStart,s.verticesCount,s.indexStart,s.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){let i;if(!eF.SceneLoaderFlags.CleanBoneMatrixWeights||!(e.skeletonId>-1))return;{let s=t.getScene().getLastSkeletonById(e.skeletonId);if(!s)return;i=s.bones.length}let s=t.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),r=t.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind),a=e.matricesWeights,n=e.matricesWeightsExtra,o=e.numBoneInfluencer,l=a.length;for(let e=0;e<l;e+=4){let t=0,l=-1;for(let i=0;i<4;i++){let s=a[e+i];t+=s,s<.001&&l<0&&(l=i)}if(n)for(let i=0;i<4;i++){let s=n[e+i];t+=s,s<.001&&l<0&&(l=i+4)}if((l<0||l>o-1)&&(l=o-1),t>.001){let i=1/t;for(let t=0;t<4;t++)a[e+t]*=i;if(n)for(let t=0;t<4;t++)n[e+t]*=i}else l>=4?(n[e+l-4]=1-t,r[e+l-4]=i):(a[e+l]=1-t,s[e+l]=i)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,s),e.matricesWeightsExtra&&t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,r)}static Parse(e,t,i){let s=new eN(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new eE.BoundingInfo(ey.Vector3.FromArray(e.boundingBoxMinimum),ey.Vector3.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(ev.VertexBuffer.UVKind),e.hasUVs2&&s._delayInfo.push(ev.VertexBuffer.UV2Kind),e.hasUVs3&&s._delayInfo.push(ev.VertexBuffer.UV3Kind),e.hasUVs4&&s._delayInfo.push(ev.VertexBuffer.UV4Kind),e.hasUVs5&&s._delayInfo.push(ev.VertexBuffer.UV5Kind),e.hasUVs6&&s._delayInfo.push(ev.VertexBuffer.UV6Kind),e.hasColors&&s._delayInfo.push(ev.VertexBuffer.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(ev.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(ev.VertexBuffer.MatricesWeightsKind),s._delayLoadingFunction=eR.ImportVertexData):eR.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}e.s(["Geometry",0,eN],16931);var eK=e.i(2060);let ek=(m=eV.Node,p=[],M=[],I=[],x=[],b=[],y=[],D=[],V=[],v=[],B=[],S=[],A=[],P=[],T=[],C=[],O=[],R=[],F=[],K=class extends m{get billboardMode(){return this._billboardMode}set billboardMode(e){this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=(this._billboardMode&K.BILLBOARDMODE_USE_POSITION)!=0)}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)}constructor(e,t=null,i=!0){super(e,t,!1),this._forward=new ey.Vector3(0,0,1),this._up=new ey.Vector3(0,1,0),this._right=new ey.Vector3(1,0,0),this._position=(0,eB.__runInitializers)(this,p,ey.Vector3.Zero()),this._rotation=((0,eB.__runInitializers)(this,M),(0,eB.__runInitializers)(this,I,ey.Vector3.Zero())),this._rotationQuaternion=((0,eB.__runInitializers)(this,x),(0,eB.__runInitializers)(this,b,null)),this._scaling=((0,eB.__runInitializers)(this,y),(0,eB.__runInitializers)(this,D,ey.Vector3.One())),this._transformToBoneReferal=((0,eB.__runInitializers)(this,V),null),this._isAbsoluteSynced=!1,this._billboardMode=(0,eB.__runInitializers)(this,v,K.BILLBOARDMODE_NONE),this.scalingDeterminant=((0,eB.__runInitializers)(this,B),(0,eB.__runInitializers)(this,S,1)),this._infiniteDistance=((0,eB.__runInitializers)(this,A),(0,eB.__runInitializers)(this,P,!1)),this.ignoreNonUniformScaling=((0,eB.__runInitializers)(this,T),(0,eB.__runInitializers)(this,C,!1)),this.reIntegrateRotationIntoRotationQuaternion=((0,eB.__runInitializers)(this,O),(0,eB.__runInitializers)(this,R,!1)),this._poseMatrix=((0,eB.__runInitializers)(this,F),null),this._localMatrix=ey.Matrix.Zero(),this._usePivotMatrix=!1,this._absolutePosition=ey.Vector3.Zero(),this._absoluteScaling=ey.Vector3.Zero(),this._absoluteRotationQuaternion=ey.Quaternion.Identity(),this._pivotMatrix=ey.Matrix.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new ec.Observable,this._nonUniformScaling=!1,i&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(e){this._position=e,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(e){this._scaling=e,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){!this._isDirty&&(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return ey.Vector3.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return ey.Vector3.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return ey.Vector3.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(e){return this._poseMatrix?this._poseMatrix.copyFrom(e):this._poseMatrix=e.clone(),this}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=ey.Matrix.Identity()),this._poseMatrix}_isSynchronized(){let e=this._cache;return this._billboardMode===e.billboardMode&&this._billboardMode===K.BILLBOARDMODE_NONE&&!e.pivotMatrixUpdated&&!this._infiniteDistance&&!this._position._isDirty&&!this._scaling._isDirty&&(!this._rotationQuaternion||!this._rotationQuaternion._isDirty)&&!this._rotation._isDirty&&!0}_initCache(){super._initCache();let e=this._cache;e.localMatrixUpdated=!1,e.billboardMode=-1,e.infiniteDistance=!1,e.useBillboardPosition=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(e){return this.setPivotMatrix(e,!1)}setPivotMatrix(e,t=!0){return this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=ey.Matrix.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(e=null,t,i){let s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);for(let e of(s&&i&&i(this,s),this.getChildTransformNodes(!0)))e.instantiateHierarchy(s,t,i);return s}freezeWorldMatrix(e=null,t=!1){return e?t?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||ey.Quaternion.Identity(),e.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=e,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(e){let t,i,s;if(!e)return this;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],s=arguments[2]}else t=e.x,i=e.y,s=e.z;if(this.parent){let e=ey.TmpVectors.Matrix[0];this.parent.getWorldMatrix().invertToRef(e),ey.Vector3.TransformCoordinatesFromFloatsToRef(t,i,s,e,this.position)}else this.position.x=t,this.position.y=i,this.position.z=s;return this._absolutePosition.copyFrom(e),this}setPositionWithLocalVector(e){return this.computeWorldMatrix(),this.position=ey.Vector3.TransformNormal(e,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();let e=ey.TmpVectors.Matrix[0];return this._localMatrix.invertToRef(e),ey.Vector3.TransformNormal(this.position,e)}locallyTranslate(e){return this.computeWorldMatrix(!0),this.position=ey.Vector3.TransformCoordinates(e,this._localMatrix),this}lookAt(e,t=0,i=0,s=0,r=0){let a=K._LookAtVectorCache,n=0===r?this.position:this.getAbsolutePosition();if(e.subtractToRef(n,a),this.setDirection(a,t,i,s),1===r&&this.parent)if(this.rotationQuaternion){let e=ey.TmpVectors.Matrix[0];this.rotationQuaternion.toRotationMatrix(e);let t=ey.TmpVectors.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(t),t.invert(),e.multiplyToRef(t,e),this.rotationQuaternion.fromRotationMatrix(e)}else{let e=ey.TmpVectors.Quaternion[0];ey.Quaternion.FromEulerVectorToRef(this.rotation,e);let t=ey.TmpVectors.Matrix[0];e.toRotationMatrix(t);let i=ey.TmpVectors.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(i),i.invert(),t.multiplyToRef(i,t),e.fromRotationMatrix(t),e.toEulerAnglesToRef(this.rotation)}return this}getDirection(e){let t=ey.Vector3.Zero();return this.getDirectionToRef(e,t),t}getDirectionToRef(e,t){return ey.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t),this}setDirection(e,t=0,i=0,s=0){let r=-Math.atan2(e.z,e.x)+Math.PI/2,a=Math.sqrt(e.x*e.x+e.z*e.z),n=-Math.atan2(e.y,a);return this.rotationQuaternion?ey.Quaternion.RotationYawPitchRollToRef(r+t,n+i,s,this.rotationQuaternion):(this.rotation.x=n+i,this.rotation.y=r+t,this.rotation.z=s),this}setPivotPoint(e,t=0){0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);let i=this.getWorldMatrix();if(1==t){let t=ey.TmpVectors.Matrix[0];i.invertToRef(t),e=ey.Vector3.TransformCoordinates(e,t)}return this.setPivotMatrix(ey.Matrix.Translation(-e.x,-e.y,-e.z),!0)}getPivotPoint(){let e=ey.Vector3.Zero();return this.getPivotPointToRef(e),e}getPivotPointToRef(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){let e=ey.Vector3.Zero();return this.getAbsolutePivotPointToRef(e),e}getAbsolutePivotPointToRef(e){return this.getPivotPointToRef(e),ey.Vector3.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this}markAsDirty(e){if(this._isDirty)return this;if(this._children)for(let t of this._children)t.markAsDirty(e);return super.markAsDirty(e)}setParent(e,t=!1,i=!1){if(!e&&!this.parent)return this;let s=ey.TmpVectors.Quaternion[0],r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1],n=ey.TmpVectors.Matrix[1];ey.Matrix.IdentityToRef(n);let o=ey.TmpVectors.Matrix[0];this.computeWorldMatrix(!0);let l=this.rotationQuaternion;return l||(l=K._TmpRotation,ey.Quaternion.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),ey.Matrix.ComposeToRef(this.scaling,l,this.position,o),this.parent&&o.multiplyToRef(this.parent.computeWorldMatrix(!0),o),e&&(e.computeWorldMatrix(!0).invertToRef(n),o.multiplyToRef(n,o)),o.decompose(a,s,r,t?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(s):s.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(a),this.position.copyFrom(r),this.parent=e,i&&this.setPivotMatrix(ey.Matrix.Identity()),this}addChild(e,t=!1){return e.setParent(this,t),this}removeChild(e,t=!1){return e.parent!==this||e.setParent(null,t),this}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)}attachToBone(e,t){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(!0),0>e.getFinalMatrix().determinant()&&(this.scalingDeterminant*=-1),this}detachFromBone(e=!1){return this.parent?(0>this.parent.getWorldMatrix().determinant()&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,e?this.parent=this._currentParentWhenAttachingToBone:this.parent=null):e&&(this.parent=this._currentParentWhenAttachingToBone),this}rotate(e,t,i){let s;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),i&&0!==i){if(this.parent){let i=this.parent.getWorldMatrix(),s=ey.TmpVectors.Matrix[0];i.invertToRef(s),e=ey.Vector3.TransformNormal(e,s),0>i.determinant()&&(t*=-1)}(s=ey.Quaternion.RotationAxisToRef(e,t,K._RotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else s=ey.Quaternion.RotationAxisToRef(e,t,K._RotationAxisCache),this.rotationQuaternion.multiplyToRef(s,this.rotationQuaternion);return this}rotateAround(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=ey.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));let s=ey.TmpVectors.Vector3[0],r=ey.TmpVectors.Vector3[1],a=ey.TmpVectors.Vector3[2],n=ey.TmpVectors.Quaternion[0],o=ey.TmpVectors.Matrix[0],l=ey.TmpVectors.Matrix[1],h=ey.TmpVectors.Matrix[2],c=ey.TmpVectors.Matrix[3];return e.subtractToRef(this.position,s),ey.Matrix.TranslationToRef(s.x,s.y,s.z,o),ey.Matrix.TranslationToRef(-s.x,-s.y,-s.z,l),ey.Matrix.RotationAxisToRef(t,i,h),l.multiplyToRef(h,c),c.multiplyToRef(o,c),c.decompose(r,n,a),this.position.addInPlace(a),n.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(e,t,i){let s=e.scale(t);if(i&&0!==i)this.setAbsolutePosition(this.getAbsolutePosition().add(s));else{let e=this.getPositionExpressedInLocalSpace().add(s);this.setPositionWithLocalVector(e)}return this}addRotation(e,t,i){let s;this.rotationQuaternion?s=this.rotationQuaternion:(s=ey.TmpVectors.Quaternion[1],ey.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s));let r=ey.TmpVectors.Quaternion[0];return ey.Quaternion.RotationYawPitchRollToRef(t,e,i,r),s.multiplyInPlace(r),this.rotationQuaternion||s.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==K.BILLBOARDMODE_NONE}computeWorldMatrix(e=!1,t=null){let i;if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;let s=this.getScene().getRenderId();if(!this._isDirty&&!e&&(this._currentRenderId===s||this.isSynchronized()))return this._currentRenderId=s,this._worldMatrix;t=t||this.getScene().activeCamera,this._updateCache();let r=this._cache;r.pivotMatrixUpdated=!1,r.billboardMode=this.billboardMode,r.infiniteDistance=this.infiniteDistance,r.parent=this._parentNode,this._currentRenderId=s,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;let a=this._getEffectiveParent(),n=K._TmpScaling,o=this._position;if(this._infiniteDistance&&!this.parent&&t){let e=t.getWorldMatrix().m;(o=K._TmpTranslation).copyFromFloats(this._position.x+e[12],this._position.y+e[13],this._position.z+e[14])}if(n.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant),this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,i=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(ey.Quaternion.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(i=K._TmpRotation,ey.Quaternion.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,i)),this._usePivotMatrix){let e=ey.TmpVectors.Matrix[1];ey.Matrix.ScalingToRef(n.x,n.y,n.z,e);let t=ey.TmpVectors.Matrix[0];i.toRotationMatrix(t),this._pivotMatrix.multiplyToRef(e,ey.TmpVectors.Matrix[4]),ey.TmpVectors.Matrix[4].multiplyToRef(t,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(o.x,o.y,o.z)}else ey.Matrix.ComposeToRef(n,i,o,this._localMatrix);if(a&&a.getWorldMatrix){if(e&&a.computeWorldMatrix(e),this.billboardMode){if(this._transformToBoneReferal){let e=this.parent;e.getSkeleton().prepare(),e.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),ey.TmpVectors.Matrix[7])}else ey.TmpVectors.Matrix[7].copyFrom(a.getWorldMatrix());let e=ey.TmpVectors.Vector3[5],t=ey.TmpVectors.Vector3[6],i=ey.TmpVectors.Quaternion[0];ey.TmpVectors.Matrix[7].decompose(t,i,e),ey.Matrix.ScalingToRef(t.x,t.y,t.z,ey.TmpVectors.Matrix[7]),ey.TmpVectors.Matrix[7].setTranslation(e),K.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(i,e),this._localMatrix.setTranslation(e)),this._localMatrix.multiplyToRef(ey.TmpVectors.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){let e=this.parent;e.getSkeleton().prepare(),this._localMatrix.multiplyToRef(e.getFinalMatrix(),ey.TmpVectors.Matrix[6]),ey.TmpVectors.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(a.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(t&&this.billboardMode)if(r.useBillboardPosition){let e=ey.TmpVectors.Vector3[0];this._worldMatrix.getTranslationToRef(e);let i=t.globalPosition;this._worldMatrix.invertToRef(ey.TmpVectors.Matrix[1]);let s=ey.TmpVectors.Vector3[1];ey.Vector3.TransformCoordinatesToRef(i,ey.TmpVectors.Matrix[1],s),s.normalize();let r=-Math.atan2(s.z,s.x)+Math.PI/2,a=Math.sqrt(s.x*s.x+s.z*s.z),n=-Math.atan2(s.y,a);if(ey.Quaternion.RotationYawPitchRollToRef(r,n,0,ey.TmpVectors.Quaternion[0]),(this.billboardMode&K.BILLBOARDMODE_ALL)!==K.BILLBOARDMODE_ALL){let e=ey.TmpVectors.Vector3[1];ey.TmpVectors.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&K.BILLBOARDMODE_X)!==K.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&K.BILLBOARDMODE_Y)!==K.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&K.BILLBOARDMODE_Z)!==K.BILLBOARDMODE_Z&&(e.z=0),ey.Matrix.RotationYawPitchRollToRef(e.y,e.x,e.z,ey.TmpVectors.Matrix[0])}else ey.Matrix.FromQuaternionToRef(ey.TmpVectors.Quaternion[0],ey.TmpVectors.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ey.TmpVectors.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ey.TmpVectors.Vector3[0])}else{let e=ey.TmpVectors.Vector3[0];this._worldMatrix.getTranslationToRef(e),ey.TmpVectors.Matrix[1].copyFrom(t.getViewMatrix());let i=this.getScene().useRightHandedSystem;if(i&&ey.TmpVectors.Matrix[1].multiplyToRef(K._TmpRHRestore,ey.TmpVectors.Matrix[1]),ey.TmpVectors.Matrix[1].setTranslationFromFloats(0,0,0),ey.TmpVectors.Matrix[1].invertToRef(ey.TmpVectors.Matrix[0]),(this.billboardMode&K.BILLBOARDMODE_ALL)!==K.BILLBOARDMODE_ALL){ey.TmpVectors.Matrix[0].decompose(void 0,ey.TmpVectors.Quaternion[0],void 0);let e=ey.TmpVectors.Vector3[1];ey.TmpVectors.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&K.BILLBOARDMODE_X)!==K.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&K.BILLBOARDMODE_Y)!==K.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&K.BILLBOARDMODE_Z)!==K.BILLBOARDMODE_Z&&(e.z=0),i&&(e.y+=Math.PI),ey.Matrix.RotationYawPitchRollToRef(e.y,e.x,e.z,ey.TmpVectors.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ey.TmpVectors.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ey.TmpVectors.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):a&&a._nonUniformScaling?this._updateNonUniformScalingState(a._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=ey.Matrix.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if(this.computeWorldMatrix(),e){let e=this.getChildren();for(let t=0;t<e.length;++t){let i=e[t];if(i){i.computeWorldMatrix();let e=ey.TmpVectors.Matrix[0];i._localMatrix.multiplyToRef(this._localMatrix,e);let t=ey.TmpVectors.Quaternion[0];e.decompose(i.scaling,t,i.position),i.rotationQuaternion?i.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(i.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=ey.Quaternion.Identity()),this._worldMatrix=ey.Matrix.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this}unregisterAfterWorldMatrixUpdate(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this}getPositionInCameraSpace(e=null){return e||(e=this.getScene().activeCamera),ey.Vector3.TransformCoordinates(this.getAbsolutePosition(),e.getViewMatrix())}getDistanceToCamera(e=null){return e||(e=this.getScene().activeCamera),this.getAbsolutePosition().subtract(e.globalPosition).length()}clone(e,t,i){let s=eK.SerializationHelper.Clone(()=>new K(e,this.getScene()),this);if(s.name=e,s.id=e,t&&(s.parent=t),!i){let t=this.getDescendants(!0);for(let i=0;i<t.length;i++){let r=t[i];r.clone&&r.clone(e+"."+r.name,s)}}return s}serialize(e){let t=eK.SerializationHelper.Serialize(this,e);return t.type=this.getClassName(),t.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent(t),t.localMatrix=this.getPivotMatrix().asArray(),t.isEnabled=this.isEnabled(),this._isWorldMatrixFrozen&&(t.freezeWorldMatrix=!0),eK.SerializationHelper.AppendSerializedAnimations(this,t),t.ranges=this.serializeAnimationRanges(),t}getChildTransformNodes(e,t){let i=[];return this._getDescendants(i,e,e=>(!t||t(e))&&e instanceof K),i}dispose(e,t=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){let e=this._parentContainer.transformNodes.indexOf(this);e>-1&&this._parentContainer.transformNodes.splice(e,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),e)for(let e of this.getChildTransformNodes(!0))e.parent=null,e.computeWorldMatrix(!0);super.dispose(e,t)}normalizeToUnitCube(e=!0,t=!1,i){let s=null,r=null;t&&(this.rotationQuaternion?(r=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(s=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));let a=this.getHierarchyBoundingVectors(e,i),n=a.max.subtract(a.min),o=Math.max(n.x,n.y,n.z);return 0===o||(this.scaling.scaleInPlace(1/o),t&&(this.rotationQuaternion&&r?this.rotationQuaternion.copyFrom(r):this.rotation&&s&&this.rotation.copyFrom(s))),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}},E="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0,o=[(0,eP.serializeAsVector3)("position")],l=[(0,eP.serializeAsVector3)("rotation")],h=[(0,eP.serializeAsQuaternion)("rotationQuaternion")],c=[(0,eP.serializeAsVector3)("scaling")],u=[(0,eP.serialize)("billboardMode")],d=[(0,eP.serialize)()],f=[(0,eP.serialize)("infiniteDistance")],g=[(0,eP.serialize)()],_=[(0,eP.serialize)()],(0,eB.__esDecorate)(null,null,o,{kind:"field",name:"_position",static:!1,private:!1,access:{has:e=>"_position"in e,get:e=>e._position,set:(e,t)=>{e._position=t}},metadata:E},p,M),(0,eB.__esDecorate)(null,null,l,{kind:"field",name:"_rotation",static:!1,private:!1,access:{has:e=>"_rotation"in e,get:e=>e._rotation,set:(e,t)=>{e._rotation=t}},metadata:E},I,x),(0,eB.__esDecorate)(null,null,h,{kind:"field",name:"_rotationQuaternion",static:!1,private:!1,access:{has:e=>"_rotationQuaternion"in e,get:e=>e._rotationQuaternion,set:(e,t)=>{e._rotationQuaternion=t}},metadata:E},b,y),(0,eB.__esDecorate)(null,null,c,{kind:"field",name:"_scaling",static:!1,private:!1,access:{has:e=>"_scaling"in e,get:e=>e._scaling,set:(e,t)=>{e._scaling=t}},metadata:E},D,V),(0,eB.__esDecorate)(null,null,u,{kind:"field",name:"_billboardMode",static:!1,private:!1,access:{has:e=>"_billboardMode"in e,get:e=>e._billboardMode,set:(e,t)=>{e._billboardMode=t}},metadata:E},v,B),(0,eB.__esDecorate)(null,null,d,{kind:"field",name:"scalingDeterminant",static:!1,private:!1,access:{has:e=>"scalingDeterminant"in e,get:e=>e.scalingDeterminant,set:(e,t)=>{e.scalingDeterminant=t}},metadata:E},S,A),(0,eB.__esDecorate)(null,null,f,{kind:"field",name:"_infiniteDistance",static:!1,private:!1,access:{has:e=>"_infiniteDistance"in e,get:e=>e._infiniteDistance,set:(e,t)=>{e._infiniteDistance=t}},metadata:E},P,T),(0,eB.__esDecorate)(null,null,g,{kind:"field",name:"ignoreNonUniformScaling",static:!1,private:!1,access:{has:e=>"ignoreNonUniformScaling"in e,get:e=>e.ignoreNonUniformScaling,set:(e,t)=>{e.ignoreNonUniformScaling=t}},metadata:E},C,O),(0,eB.__esDecorate)(null,null,_,{kind:"field",name:"reIntegrateRotationIntoRotationQuaternion",static:!1,private:!1,access:{has:e=>"reIntegrateRotationIntoRotationQuaternion"in e,get:e=>e.reIntegrateRotationIntoRotationQuaternion,set:(e,t)=>{e.reIntegrateRotationIntoRotationQuaternion=t}},metadata:E},R,F),E&&Object.defineProperty(K,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E}),K.BILLBOARDMODE_NONE=0,K.BILLBOARDMODE_X=1,K.BILLBOARDMODE_Y=2,K.BILLBOARDMODE_Z=4,K.BILLBOARDMODE_ALL=7,K.BILLBOARDMODE_USE_POSITION=128,K.BillboardUseParentOrientation=!1,K._TmpRotation=ey.Quaternion.Zero(),K._TmpScaling=ey.Vector3.Zero(),K._TmpTranslation=ey.Vector3.Zero(),K._TmpRHRestore=ey.Matrix.Scaling(1,1,-1),K._LookAtVectorCache=new ey.Vector3(0,0,0),K._RotationAxisCache=new ey.Quaternion,K);(z=ek.prototype).getPhysicsBody??(z.getPhysicsBody=(0,eS._MissingSideEffect)("TransformNode","getPhysicsBody")),(G=ek.prototype).applyImpulse??(G.applyImpulse=(0,eS._MissingSideEffect)("TransformNode","applyImpulse")),(Q=ek.prototype).applyAngularImpulse??(Q.applyAngularImpulse=(0,eS._MissingSideEffect)("TransformNode","applyAngularImpulse")),(j=ek.prototype).applyTorque??(j.applyTorque=(0,eS._MissingSideEffect)("TransformNode","applyTorque")),Object.getOwnPropertyDescriptor(ek.prototype,"physicsBody")||Object.defineProperty(ek.prototype,"physicsBody",(0,eS._MissingSideEffectProperty)("TransformNode","physicsBody")),e.s(["TransformNode",0,ek],25343);var ez=e.i(92247),eG=e.i(96333);class eQ{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new ey.Vector3(0,0,0),this._diffPositionForCollisions=new ey.Vector3(0,0,0),this._collisionResponse=!0}}var ej=e.i(6563),eq=e.i(84106),eH=e.i(26924),eZ=e.i(51843),eY=e.i(44520);function eX(e,t){return e-Math.floor(e/t)*t}function e$(e,t,i){e instanceof Float32Array?ey.Matrix.FromArrayToRef(e,t,i):i.copyFromFloats((0,ej.FromHalfFloat)(e[t]),(0,ej.FromHalfFloat)(e[t+1]),(0,ej.FromHalfFloat)(e[t+2]),(0,ej.FromHalfFloat)(e[t+3]),(0,ej.FromHalfFloat)(e[t+4]),(0,ej.FromHalfFloat)(e[t+5]),(0,ej.FromHalfFloat)(e[t+6]),(0,ej.FromHalfFloat)(e[t+7]),(0,ej.FromHalfFloat)(e[t+8]),(0,ej.FromHalfFloat)(e[t+9]),(0,ej.FromHalfFloat)(e[t+10]),(0,ej.FromHalfFloat)(e[t+11]),(0,ej.FromHalfFloat)(e[t+12]),(0,ej.FromHalfFloat)(e[t+13]),(0,ej.FromHalfFloat)(e[t+14]),(0,ej.FromHalfFloat)(e[t+15]))}class eJ{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=ey.Vector3.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class e0{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new eJ,this._visibility=1,this._skeleton=null,this._layerMask=0xfffffff,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new eQ,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._wasActiveLastFrame=!1}}let e1=(U=ek,L=[],k=class extends U{static get BILLBOARDMODE_NONE(){return ek.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return ek.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return ek.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return ek.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return ek.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return ek.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(e){this._internalAbstractMeshDataInfo._collisionRetryCount=e}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(e){this._internalAbstractMeshDataInfo._morphTargetManager!==e&&(this._internalAbstractMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(e){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==e&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=e,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(e){return!!super._updateNonUniformScalingState(e)&&(this._markSubMeshesAsMiscDirty(),!0)}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(e){this._internalAbstractMeshDataInfo._rawBoundingInfo=e}set onCollide(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)}set onCollisionPositionChange(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(e){if(this._internalAbstractMeshDataInfo._visibility===e)return;let t=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=e,(1===t&&1!==e||1!==t&&1===e)&&this._markSubMeshesAsDirty(e=>{e.markAsMiscDirty(),e.markAsPrePassDirty()})}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(e){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=e}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(e){this._internalAbstractMeshDataInfo._renderingGroupId=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){this._setMaterial(e)}_setMaterial(e){this._internalAbstractMeshDataInfo._material===e||(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,null==e),this._unBindEffect()))}getMaterialForRenderPass(e){return this._internalAbstractMeshDataInfo._materialForRenderPass?.[e]}setMaterialForRenderPass(e,t){this.resetDrawCache(e),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);let i=this._internalAbstractMeshDataInfo._materialForRenderPass[e];i?.meshMap?.[this.uniqueId]&&(i.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[e]=t,t&&t.meshMap&&(t.meshMap[this.uniqueId]=this)}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(e){this._internalAbstractMeshDataInfo._enableDistantPicking=e}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(e)?-1:e}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=e}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(e)?-1:e}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(e){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=e}get lightSources(){return this._lightSources}set skeleton(e){let t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(e,t=null){switch(super(e,t,!1),this._internalAbstractMeshDataInfo=new e0,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this._waitingSkeletonId=null,this._waitingSkeletonUniqueId=null,this.cullingStrategy=k.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new ec.Observable,this.onCollisionPositionChangeObservable=new ec.Observable,this.onMaterialChangedObservable=new ec.Observable,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isPickable=k.DefaultIsPickable,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=eD.Color3.Red(),this.outlineWidth=.02,this.overlayColor=eD.Color3.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new ey.Vector3(.5,1,.5),this.ellipsoidOffset=new ey.Vector3(0,0,0),this.edgesWidth=1,this.edgesColor=new eD.Color4(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=[],this._unIndexed=!1,this._lightSources=[],this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new ec.Observable,this._onCollisionPositionChange=(e,t,i=null)=>{t.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>eZ.AbstractEngine.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),i&&this.onCollideObservable.notifyObservers(i),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},t=this.getScene(),this.layerMask=t.defaultRenderableLayerMask,t.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new eG.UniformBuffer(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(e){let t=this._uniformBuffer;t.updateMatrix("world",e),t.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),t.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(e){let t="Name: "+this.name+", isInstance: "+("InstancedMesh"===this.getClassName()?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);let i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode]+", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==ek.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(e,t=!0){if(this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;else if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_releaseRenderPassId(e){}_rebuild(e=!1){if(this.onRebuildObservable.notifyObservers(this),null!==this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes){for(let e of this.subMeshes)e._rebuild();this.resetDrawCache()}}_resyncLightSources(){for(let e of(this._lightSources.length=0,this.getScene().lights))e.isEnabled()&&e.canAffectMesh(this)&&this._lightSources.push(e);this._markSubMeshesAsLightDirty()}_resyncLightSource(e){let t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e),s=!1;if(-1===i){if(!t)return;this._lightSources.push(e)}else{if(t)return;s=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(s)}_unBindEffect(){for(let e of this.subMeshes)e.setEffect(null)}_removeLightSource(e,t){let i=this._lightSources.indexOf(e);-1!==i&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))}_markSubMeshesAsDirty(e){if(this.subMeshes)for(let t of this.subMeshes)for(let i=0;i<t._drawWrappers.length;++i){let s=t._drawWrappers[i];s&&s.defines&&s.defines.markAllAsDirty&&e(s.defines)}}_markSubMeshesAsLightDirty(e=!1){this._markSubMeshesAsDirty(t=>t.markAsLightDirty(e))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(e=>e.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(e=>e.markAsMiscDirty())}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(e),this._isDirty=!0,this}resetDrawCache(e,t=!1){if(this.subMeshes)for(let i of this.subMeshes)i.resetDrawCache(e,t)}get isBlocked(){return!1}getLOD(e){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(e){return null}setVerticesData(e,t,i,s){return this}updateVerticesData(e,t,i,s){return this}setIndices(e,t){return this}isVerticesDataPresent(e){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(e){return this._boundingInfo=e,this}get hasBoundingInfo(){return null!==this._boundingInfo}buildBoundingInfo(e,t,i){return this._boundingInfo=new eE.BoundingInfo(e,t,i),this._boundingInfo}normalizeToUnitCube(e=!0,t=!1,i){return super.normalizeToUnitCube(e,t,i)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===ek.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(e,t,i){return this.position.addInPlace(this.calcMovePOV(e,t,i)),this}calcMovePOV(e,t,i){let s=new ey.Matrix;(this.rotationQuaternion?this.rotationQuaternion:ey.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(s);let r=ey.Vector3.Zero(),a=this.definedFacingForward?-1:1;return ey.Vector3.TransformCoordinatesFromFloatsToRef(e*a,t,i*a,s,r),r}rotatePOV(e,t,i){return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this}calcRotatePOV(e,t,i){let s=this.definedFacingForward?1:-1;return new ey.Vector3(e*s,t,i*s)}_refreshBoundingInfo(e,t){if(e){let i=(0,ew.extractMinAndMax)(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new eE.BoundingInfo(i.minimum,i.maximum)}if(this.subMeshes)for(let t=0;t<this.subMeshes.length;t++)this.subMeshes[t].refreshBoundingInfo(e);this._updateBoundingInfo()}_refreshBoundingInfoDirect(e){if(this._boundingInfo?this._boundingInfo.reConstruct(e.minimum,e.maximum):this._boundingInfo=new eE.BoundingInfo(e.minimum,e.maximum),this.subMeshes)for(let e=0;e<this.subMeshes.length;e++)this.subMeshes[e].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(e,t,i,s,r,a,n){!function(e,t,i,s,r,a,n){let o=ey.TmpVectors.Vector3[0],l=ey.TmpVectors.Matrix[0],h=ey.TmpVectors.Matrix[1],c=t===ev.VertexBuffer.NormalKind?ey.Vector3.TransformNormalFromFloatsToRef:ey.Vector3.TransformCoordinatesFromFloatsToRef;for(let t=0,u=0;t<e.length;t+=3,u+=4){let d,f;for(l.reset(),d=0;d<4;d++)(f=r[u+d])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(i,Math.floor(16*s[u+d]),f,h),l.addToSelf(h));if(a&&n)for(d=0;d<4;d++)(f=n[u+d])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(i,Math.floor(16*a[u+d]),f,h),l.addToSelf(h));c(e[t],e[t+1],e[t+2],l,o),o.toArray(e,t)}}(e,t,i,s,r,a,n)}_getData(e,t,i=ev.VertexBuffer.PositionKind){let s=e.cache,r=e=>{if(s){let t=s._vertexData||(s._vertexData={});return t[e]||this.copyVerticesData(e,t),t[e]}return this.getVerticesData(e)};if(t||(t=r(i)),!t)return null;s?(s._outputData?s._outputData.set(t):s._outputData=new Float32Array(t),t=s._outputData):(e.applyMorph&&this.morphTargetManager||e.applySkeleton&&this.skeleton||e.applyBakedVertexAnimation&&this.bakedVertexAnimationManager?.isEnabled)&&(t=t.slice()),e.applyMorph&&this.morphTargetManager&&function(e,t,i){let s;switch(t){case ev.VertexBuffer.PositionKind:s=e=>e.getPositions();break;case ev.VertexBuffer.NormalKind:s=e=>e.getNormals();break;case ev.VertexBuffer.TangentKind:s=e=>e.getTangents();break;case ev.VertexBuffer.UVKind:s=e=>e.getUVs();break;case ev.VertexBuffer.UV2Kind:s=e=>e.getUV2s();break;case ev.VertexBuffer.ColorKind:s=e=>e.getColors();break;default:return}for(let t=0;t<e.length;t++){let r=e[t];for(let a=0;a<i.numTargets;a++){let n=i.getTarget(a),o=n.influence;if(0!==o){let i=s(n);i&&(r+=(i[t]-e[t])*o)}}e[t]=r}}(t,i,this.morphTargetManager);let a=this.bakedVertexAnimationManager,n=!1;if(e.applyBakedVertexAnimation&&a?.isEnabled){let s=r(ev.VertexBuffer.MatricesIndicesKind),o=r(ev.VertexBuffer.MatricesWeightsKind);if(o&&s){let l=this.numBoneInfluencers>4,h=l?r(ev.VertexBuffer.MatricesIndicesExtraKind):null,c=l?r(ev.VertexBuffer.MatricesWeightsExtraKind):null;n=function(e,t,i,s,r,a,n,o,l){var h;let c,u,d,f,g,_=i.texture,m=_?.getInternalTexture(),p=m?._bufferView;if(!(p instanceof Float32Array)&&!(p instanceof Uint16Array))return eA.Logger.Warn("Baked vertex animation bounding info requires CPU-readable Float32Array or Uint16Array texture data.",1),!1;let M=_.getSize(),I=(h=i.time,c=s.y-s.x+1,d=(u=h*s.w/c)<1?0:1,f=c-d,g=eX(u-Math.floor(u),1)*f,Math.floor(g=eX(g+s.z,f))+s.x+d);if(!isFinite(I)||I<0||I>=M.height)return eA.Logger.Warn("Baked vertex animation bounding info could not be refreshed because the computed frame is outside the texture.",1),!1;let x=ey.TmpVectors.Vector3[0],b=ey.TmpVectors.Matrix[0],y=ey.TmpVectors.Matrix[1],D=I*M.width*4,V=t===ev.VertexBuffer.NormalKind?ey.Vector3.TransformNormalFromFloatsToRef:ey.Vector3.TransformCoordinatesFromFloatsToRef;for(let t=0,i=0;t<e.length;t+=3,i+=4){let s,h;for(b.reset(),s=0;s<4&&s<l;s++)(h=a[i+s])>0&&(e$(p,D+16*Math.floor(r[i+s]),y),y.scaleAndAddToRef(h,b));if(n&&o)for(s=0;s<4&&s+4<l;s++)(h=o[i+s])>0&&(e$(p,D+16*Math.floor(n[i+s]),y),y.scaleAndAddToRef(h,b));V(e[t],e[t+1],e[t+2],b,x),x.toArray(e,t)}return!0}(t,i,a,e.bakedVertexAnimationSettings??a.animationParameters,s,o,h,c,this.numBoneInfluencers)}}if(!n&&e.applySkeleton&&this.skeleton){let e=r(ev.VertexBuffer.MatricesIndicesKind),s=r(ev.VertexBuffer.MatricesWeightsKind);if(s&&e){let a=this.numBoneInfluencers>4,n=a?r(ev.VertexBuffer.MatricesIndicesExtraKind):null,o=a?r(ev.VertexBuffer.MatricesWeightsExtraKind):null,l=this.skeleton.getTransformMatrices(this);k._ApplySkeleton(t,i,l,e,s,n,o)}}if(!1!==e.updatePositionsArray&&i===ev.VertexBuffer.PositionKind){let e=this._internalAbstractMeshDataInfo._positions||[],i=e.length;if(e.length=t.length/3,i<e.length)for(let t=i;t<e.length;t++)e[t]=new ey.Vector3;for(let i=0,s=0;i<e.length;i++,s+=3)e[i].copyFromFloats(t[s],t[s+1],t[s+2]);this._internalAbstractMeshDataInfo._positions=e}return t}getNormalsData(e=!1,t=!1){return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},null,ev.VertexBuffer.NormalKind)}getPositionData(e=!1,t=!1,i=null){return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},i,ev.VertexBuffer.PositionKind)}_updateBoundingInfo(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new eE.BoundingInfo(ey.Vector3.Zero(),ey.Vector3.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(e){if(!this.subMeshes)return this;let t=this.subMeshes.length;for(let i=0;i<t;i++){let s=this.subMeshes[i];(t>1||!s.IsGlobal)&&s.updateBoundingInfo(e)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(e){return this.getBoundingInfo().isInFrustum(e,this.cullingStrategy)}isCompletelyInFrustum(e){return this.getBoundingInfo().isCompletelyInFrustum(e)}intersectsMesh(e,t=!1,i){let s=this.getBoundingInfo(),r=e.getBoundingInfo();if(s.intersects(r,t))return!0;if(i){for(let i of this.getChildMeshes())if(i.intersectsMesh(e,t,!0))return!0}return!1}intersectsPoint(e){return this.getBoundingInfo().intersectsPoint(e)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(e){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=e}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(e,t=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);let i=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=i.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,i.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,e,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,t),this}_collideForSubMesh(e,t,i){if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];let i=e.verticesStart,s=e.verticesStart+e.verticesCount;for(let r=i;r<s;r++)e._lastColliderWorldVertices.push(ey.Vector3.TransformCoordinates(this._positions[r],t))}return i._collide(e._trianglePlanes,e._lastColliderWorldVertices,this.getIndices(),e.indexStart,e.indexStart+e.indexCount,e.verticesStart,!!e.getMaterial(),this,this._shouldConvertRHS(),e.getMaterial()?.fillMode===7),this}_processCollisionsForSubMeshes(e,t){let i=this._scene.getCollidingSubMeshCandidates(this,e),s=i.length;for(let r=0;r<s;r++){let a=i.data[r];(!(s>1)||a._checkCollision(e))&&this._collideForSubMesh(a,t,e)}return this}_shouldConvertRHS(){return!1}_checkCollision(e){if(!this.getBoundingInfo()._checkCollision(e))return this;let t=ey.TmpVectors.Matrix[0],i=ey.TmpVectors.Matrix[1];return ey.Matrix.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this}_generatePointsArray(){return!1}intersects(e,t,i,s=!1,r,a=!1){let n=new ez.PickingInfo,o=this.getClassName(),l="InstancedLinesMesh"===o||"LinesMesh"===o||"GreasedLineMesh"===o?this.intersectionThreshold:0,h=this.getBoundingInfo();if(!this.subMeshes||!a&&(!e.intersectsSphere(h.boundingSphere,l)||!e.intersectsBox(h.boundingBox,l)))return n;if(s)return n.hit=!a,n.pickedMesh=a?null:this,n.distance=a?0:ey.Vector3.Distance(e.origin,h.boundingSphere.center),n.subMeshId=0,n;if(!this._generatePointsArray())return n;let c=null,u=this._scene.getIntersectingSubMeshCandidates(this,e),d=u.length,f=!1;for(let e=0;e<d;e++){let t=u.data[e].getMaterial();if(t&&(7==t.fillMode||0==t.fillMode||1==t.fillMode||2==t.fillMode||4==t.fillMode)){f=!0;break}}if(!f)return n.hit=!0,n.pickedMesh=this,n.distance=ey.Vector3.Distance(e.origin,h.boundingSphere.center),n.subMeshId=-1,n;for(let s=0;s<d;s++){let r=u.data[s];if(d>1&&!a&&!r.canIntersects(e))continue;let n=r.intersects(e,this._positions,this.getIndices(),t,i);if(n&&(t||!c||n.distance<c.distance)&&((c=n).subMeshId=r._id,c._internalSubMeshId=s,t))break}if(c){let t=r??this.getWorldMatrix(),i=ey.TmpVectors.Vector3[0],s=ey.TmpVectors.Vector3[1];ey.Vector3.TransformCoordinatesToRef(e.origin,t,i),e.direction.scaleToRef(c.distance,s);let a=ey.Vector3.TransformNormal(s,t).addInPlace(i);n.hit=!0,n.distance=ey.Vector3.Distance(i,a),n.pickedPoint=a,n.pickedMesh=this,n.bu=c.bu||0,n.bv=c.bv||0,n.subMeshFaceId=c.faceId,n.faceId=c.faceId+u.data[c._internalSubMeshId].indexStart/(-1!==this.getClassName().indexOf("LinesMesh")?2:3),n.subMeshId=c.subMeshId}return n}clone(e,t,i){return null}releaseSubMeshes(e=!1){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(e);else this.subMeshes=[];return this}dispose(e,t=!1){let i,s=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),s.freeActiveMeshes(),s.freeRenderingGroups(),s.renderingManager.maintainStateBetweenFrames&&s.renderingManager.restoreDispachedFlags(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(e=>e!==this&&e.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),i=0;i<this._intersectionsInProgress.length;i++){let e=this._intersectionsInProgress[i],t=e._intersectionsInProgress.indexOf(this);e._intersectionsInProgress.splice(t,1)}for(let e of(this._intersectionsInProgress.length=0,s.lights)){let t=e.includedOnlyMeshes.indexOf(this);-1!==t&&e.includedOnlyMeshes.splice(t,1),-1!==(t=e.excludedMeshes.indexOf(this))&&e.excludedMeshes.splice(t,1);let i=e.getShadowGenerators();if(i){let e=i.values();for(let i=e.next();!0!==i.done;i=e.next()){let e=i.value.getShadowMap();e&&e.renderList&&-1!==(t=e.renderList.indexOf(this))&&e.renderList.splice(t,1)}}}("InstancedMesh"!==this.getClassName()||"InstancedLinesMesh"!==this.getClassName())&&this.releaseSubMeshes(!0);let r=s.getEngine();if(null!==this._occlusionQuery&&(this.isOcclusionQueryInProgress=!1,r.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),r.wipeCaches(),s.removeMesh(this),this._parentContainer){let e=this._parentContainer.meshes.indexOf(this);e>-1&&this._parentContainer.meshes.splice(e,1),this._parentContainer=null}if(t&&this.material&&("MultiMaterial"===this.material.getClassName()?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!e)for(i=0;i<s.particleSystems.length;i++)s.particleSystems[i].emitter===this&&(s.particleSystems[i].dispose(),i--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(e,t)}_initFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;e.facetNormals||(e.facetNormals=[]),e.facetPositions||(e.facetPositions=[]),e.facetPartitioning||(e.facetPartitioning=[]),e.facetNb=this.getIndices().length/3|0,e.partitioningSubdivisions=e.partitioningSubdivisions?e.partitioningSubdivisions:10,e.partitioningBBoxRatio=e.partitioningBBoxRatio?e.partitioningBBoxRatio:1.01;for(let t=0;t<e.facetNb;t++)e.facetNormals[t]=ey.Vector3.Zero(),e.facetPositions[t]=ey.Vector3.Zero();return e.facetDataEnabled=!0,this}updateFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;e.facetDataEnabled||this._initFacetData();let t=this.getVerticesData(ev.VertexBuffer.PositionKind),i=this.getIndices(),s=this.getVerticesData(ev.VertexBuffer.NormalKind)?.slice(),r=this.getBoundingInfo();if(e.facetDepthSort&&!e.facetDepthSortEnabled){if(e.facetDepthSortEnabled=!0,i instanceof Uint16Array)e.depthSortedIndices=new Uint16Array(i);else if(i instanceof Uint32Array)e.depthSortedIndices=new Uint32Array(i);else{let t=!1;for(let e=0;e<i.length;e++)if(i[e]>65535){t=!0;break}t?e.depthSortedIndices=new Uint32Array(i):e.depthSortedIndices=new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){let t=this.getScene().activeCamera;e.facetDepthSortFrom=t?t.position:ey.Vector3.Zero()}e.depthSortedFacets=[];for(let t=0;t<e.facetNb;t++){let i={ind:3*t,sqDistance:0};e.depthSortedFacets.push(i)}e.invertedMatrix=ey.Matrix.Identity(),e.facetDepthSortOrigin=ey.Vector3.Zero()}e.bbSize.x=r.maximum.x-r.minimum.x>eq.Epsilon?r.maximum.x-r.minimum.x:eq.Epsilon,e.bbSize.y=r.maximum.y-r.minimum.y>eq.Epsilon?r.maximum.y-r.minimum.y:eq.Epsilon,e.bbSize.z=r.maximum.z-r.minimum.z>eq.Epsilon?r.maximum.z-r.minimum.z:eq.Epsilon;let a=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(a=a>e.bbSize.z?a:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/a),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/a),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/a),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=r,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),ey.Vector3.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,s&&eR.ComputeNormals(t,i,s,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);let t=e.depthSortedIndices.length/3|0;for(let s=0;s<t;s++){let t=e.depthSortedFacets[s].ind;e.depthSortedIndices[3*s]=i[t],e.depthSortedIndices[3*s+1]=i[t+1],e.depthSortedIndices[3*s+2]=i[t+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetNormals||this.updateFacetData(),e.facetNormals}getFacetLocalPositions(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetPositions||this.updateFacetData(),e.facetPositions}getFacetLocalPartitioning(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetPartitioning||this.updateFacetData(),e.facetPartitioning}getFacetPosition(e){let t=ey.Vector3.Zero();return this.getFacetPositionToRef(e,t),t}getFacetPositionToRef(e,t){let i=this.getFacetLocalPositions()[e],s=this.getWorldMatrix();return ey.Vector3.TransformCoordinatesToRef(i,s,t),this}getFacetNormal(e){let t=ey.Vector3.Zero();return this.getFacetNormalToRef(e,t),t}getFacetNormalToRef(e,t){let i=this.getFacetLocalNormals()[e];return ey.Vector3.TransformNormalToRef(i,this.getWorldMatrix(),t),this}getFacetsAtLocalCoordinates(e,t,i){let s=this.getBoundingInfo(),r=this._internalAbstractMeshDataInfo._facetData,a=Math.floor((e-s.minimum.x*r.partitioningBBoxRatio)*r.subDiv.X*r.partitioningBBoxRatio/r.bbSize.x),n=Math.floor((t-s.minimum.y*r.partitioningBBoxRatio)*r.subDiv.Y*r.partitioningBBoxRatio/r.bbSize.y),o=Math.floor((i-s.minimum.z*r.partitioningBBoxRatio)*r.subDiv.Z*r.partitioningBBoxRatio/r.bbSize.z);return a<0||a>r.subDiv.max||n<0||n>r.subDiv.max||o<0||o>r.subDiv.max?null:r.facetPartitioning[a+r.subDiv.max*n+r.subDiv.max*r.subDiv.max*o]}getClosestFacetAtCoordinates(e,t,i,s,r=!1,a=!0){let n=this.getWorldMatrix(),o=ey.TmpVectors.Matrix[5];n.invertToRef(o);let l=ey.TmpVectors.Vector3[8];ey.Vector3.TransformCoordinatesFromFloatsToRef(e,t,i,o,l);let h=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,s,r,a);return s&&ey.Vector3.TransformCoordinatesFromFloatsToRef(s.x,s.y,s.z,n,s),h}getClosestFacetAtLocalCoordinates(e,t,i,s,r=!1,a=!0){let n,o,l,h,c,u,d,f,g,_,m,p,M=null,I=this.getFacetLocalPositions(),x=this.getFacetLocalNormals(),b=this.getFacetsAtLocalCoordinates(e,t,i);if(!b)return null;let y=Number.MAX_VALUE;for(let D=0;D<b.length;D++)m=x[_=b[D]],h=(e-(p=I[_]).x)*m.x+(t-p.y)*m.y+(i-p.z)*m.z,(!r||r&&a&&h>=0||r&&!a&&h<=0)&&(h=m.x*p.x+m.y*p.y+m.z*p.z,c=-(m.x*e+m.y*t+m.z*i-h)/(m.x*m.x+m.y*m.y+m.z*m.z),u=e+m.x*c,d=t+m.y*c,f=i+m.z*c,(g=(n=u-e)*n+(o=d-t)*o+(l=f-i)*l)<y&&(y=g,M=_,s&&(s.x=u,s.y=d,s.z=f)));return M}getFacetDataParameters(){return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetDataEnabled&&(e.facetDataEnabled=!1,e.facetPositions=[],e.facetNormals=[],e.facetPartitioning=[],e.facetParameters={},e.depthSortedIndices=new Uint32Array(0)),this}updateIndices(e,t,i=!1){return this}createNormals(e){let t,i=this.getVerticesData(ev.VertexBuffer.PositionKind),s=this.getIndices();return t=this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)?this.getVerticesData(ev.VertexBuffer.NormalKind):[],eR.ComputeNormals(i,s,t,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(ev.VertexBuffer.NormalKind,t,e),this}async optimizeIndicesAsync(){let t=this.getIndices();if(!t)return this;let{OptimizeIndices:i}=await e.A(5742);return i(t),this.setIndices(t,this.getTotalVertices()),this}alignWithNormal(e,t){t||(t=eH.Axis.Y);let i=ey.TmpVectors.Vector3[0],s=ey.TmpVectors.Vector3[1];return ey.Vector3.CrossToRef(t,e,s),ey.Vector3.CrossToRef(e,s,i),this.rotationQuaternion?ey.Quaternion.RotationQuaternionFromAxisToRef(i,e,s,this.rotationQuaternion):ey.Vector3.RotationFromAxisToRef(i,e,s,this.rotation),this}_checkOcclusionQuery(e=!1){return!1}disableEdgesRendering(){throw(0,eS._WarnImport)("EdgesRenderer")}enableEdgesRendering(e,t,i){throw(0,eS._WarnImport)("EdgesRenderer")}getConnectedParticleSystems(){return this._scene.particleSystems.filter(e=>e.emitter===this)}},W="function"==typeof Symbol&&Symbol.metadata?Object.create(U[Symbol.metadata]??null):void 0,w=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0])&&!Array.isArray(e[3])&&!Array.isArray(e[4])&&!Array.isArray(e[5])&&!Array.isArray(e[6]))],(0,eB.__esDecorate)(k,null,w,{kind:"method",name:"_ApplySkeleton",static:!0,private:!1,access:{has:e=>"_ApplySkeleton"in e,get:e=>e._ApplySkeleton},metadata:W},null,L),W&&Object.defineProperty(k,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:W}),k.OCCLUSION_TYPE_NONE=((0,eB.__runInitializers)(k,L),0),k.OCCLUSION_TYPE_OPTIMISTIC=1,k.OCCLUSION_TYPE_STRICT=2,k.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,k.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,k.CULLINGSTRATEGY_STANDARD=0,k.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,k.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,k.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,k.DefaultIsPickable=!0,k),e3=!1;(q=e1.prototype).createOrUpdateSubmeshesOctree??(q.createOrUpdateSubmeshesOctree=(0,eS._MissingSideEffect)("AbstractMesh","createOrUpdateSubmeshesOctree")),(H=e1.prototype).getPhysicsImpostor??(H.getPhysicsImpostor=(0,eS._MissingSideEffect)("AbstractMesh","getPhysicsImpostor")),(Z=e1.prototype).setPhysicsLinkWith??(Z.setPhysicsLinkWith=(0,eS._MissingSideEffect)("AbstractMesh","setPhysicsLinkWith")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionRetryCount")||Object.defineProperty(e1.prototype,"occlusionRetryCount",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionRetryCount")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionType")||Object.defineProperty(e1.prototype,"occlusionType",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionType")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionQueryAlgorithmType")||Object.defineProperty(e1.prototype,"occlusionQueryAlgorithmType",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionQueryAlgorithmType")),Object.getOwnPropertyDescriptor(e1.prototype,"isOccluded")||Object.defineProperty(e1.prototype,"isOccluded",(0,eS._MissingSideEffectProperty)("AbstractMesh","isOccluded")),Object.getOwnPropertyDescriptor(e1.prototype,"isOcclusionQueryInProgress")||Object.defineProperty(e1.prototype,"isOcclusionQueryInProgress",(0,eS._MissingSideEffectProperty)("AbstractMesh","isOcclusionQueryInProgress")),Object.getOwnPropertyDescriptor(e1.prototype,"forceRenderingWhenOccluded")||Object.defineProperty(e1.prototype,"forceRenderingWhenOccluded",(0,eS._MissingSideEffectProperty)("AbstractMesh","forceRenderingWhenOccluded")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionForRenderPassId")||Object.defineProperty(e1.prototype,"occlusionForRenderPassId",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionForRenderPassId")),Object.getOwnPropertyDescriptor(e1.prototype,"decalMap")||Object.defineProperty(e1.prototype,"decalMap",(0,eS._MissingSideEffectProperty)("AbstractMesh","decalMap")),Object.getOwnPropertyDescriptor(e1.prototype,"instancedBuffers")||Object.defineProperty(e1.prototype,"instancedBuffers",(0,eS._MissingSideEffectProperty)("AbstractMesh","instancedBuffers")),Object.getOwnPropertyDescriptor(e1.prototype,"physicsImpostor")||Object.defineProperty(e1.prototype,"physicsImpostor",(0,eS._MissingSideEffectProperty)("AbstractMesh","physicsImpostor")),Object.getOwnPropertyDescriptor(e1.prototype,"showBoundingBox")||Object.defineProperty(e1.prototype,"showBoundingBox",(0,eS._MissingSideEffectProperty)("AbstractMesh","showBoundingBox")),Object.getOwnPropertyDescriptor(e1.prototype,"edgesRenderer")||Object.defineProperty(e1.prototype,"edgesRenderer",(0,eS._MissingSideEffectProperty)("AbstractMesh","edgesRenderer")),Object.getOwnPropertyDescriptor(e1.prototype,"renderOutline")||Object.defineProperty(e1.prototype,"renderOutline",(0,eS._MissingSideEffectProperty)("AbstractMesh","renderOutline")),Object.getOwnPropertyDescriptor(e1.prototype,"renderOverlay")||Object.defineProperty(e1.prototype,"renderOverlay",(0,eS._MissingSideEffectProperty)("AbstractMesh","renderOverlay")),e.s(["AbstractMesh",0,e1,"RegisterAbstractMesh",0,function(){e3||(e3=!0,(0,eY.RegisterClass)("BABYLON.AbstractMesh",e1))}],13035);var e2=e.i(46533),e4=e2;class e5 extends e4.Material{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){let t=e.push;e.push=(...i)=>{let s=t.apply(e,i);return this._markAllSubMeshesAsTexturesDirty(),s};let i=e.splice;e.splice=(t,s)=>{let r=i.call(e,t,s??e.length);return this._markAllSubMeshesAsTexturesDirty(),r}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){return"MultiMaterial"}isReadyForSubMesh(e,t,i){for(let s=0;s<this.subMaterials.length;s++){let r=this.subMaterials[s];if(r){if(r._storeEffectOnSubMeshes){if(!r.isReadyForSubMesh(e,t,i))return!1;continue}if(!r.isReady(e))return!1}}return!0}clone(e,t){let i=new e5(e,this.getScene());for(let s=0;s<this.subMaterials.length;s++){let r,a=this.subMaterials[s];r=t&&a?a.clone(e+"-"+a.name):this.subMaterials[s],i.subMaterials.push(r)}return i}serialize(){let e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,eg.Tags&&(e.tags=eg.Tags.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){let i=this.subMaterials[t];i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){let s=this.getScene();if(!s)return;if(i)for(let i=0;i<this.subMaterials.length;i++){let s=this.subMaterials[i];s&&s.dispose(e,t)}let r=s.multiMaterials.indexOf(this);r>=0&&s.multiMaterials.splice(r,1),super.dispose(e,t)}}let e6=!1;function e8(e,t){let i=new e5(e.name,t);if(i.id=e.id,i._loadedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(i,e.tags),e.materialsUniqueIds)i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds;else for(let s of e.materials)i.subMaterials.push(t.getLastMaterialById(s));return i}e.s(["MultiMaterial",0,e5,"RegisterMultiMaterial",0,function(){e6||(e6=!0,e5.ParseMultiMaterial=e8,(0,eY.RegisterClass)("BABYLON.MultiMaterial",e5))}],64979);var e7=e.i(72051);class e9{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}class te{constructor(){this.batchCache=new ti(this),this.batchCacheReplacementModeInFrozenMode=new ti(this),this.instancesBufferSize=2048}}class tt{constructor(){this.renderPasses={}}}class ti{constructor(e){this.parent=e,this.mustReturn=!1,this.visibleInstances=[],this.renderSelf=[],this.hardwareInstancedRendering=[]}}class ts{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class tr{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=[],this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}let ta={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class tn extends e1{static _GetDefaultSideOrientation(e){return e||tn.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(ev.VertexBuffer.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(ev.VertexBuffer.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new ec.Observable),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new ec.Observable),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&1===e||!this._scene.useRightHandedSystem&&0===e}get _effectiveSideOrientation(){return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&null===this.material.sideOrientation||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){let e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){let e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,s=!1){let r=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),ef.DeepCopier.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,r.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){let t=e._ranges;for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]&&this.createAnimationRange(e,t[e].from,t[e].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,eg.Tags&&eg.Tags.HasTags(e)&&eg.Tags.AddTagsTo(this,eg.Tags.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){let r=e.getDescendants(!0);for(let e=0;e<r.length;e++){let a=r[e];a._isMesh?(ta.parent=this,ta.doNotCloneChildren=t,ta.clonePhysicsImpostor=i,ta.cloneThinInstances=s,a.clone(this.name+"."+a.name,ta)):a.clone&&a.clone(this.name+"."+a.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),(0,eS._IsSideEffectImplemented)(r.getPhysicsEngine)){let t=r.getPhysicsEngine();if(i&&t)if(1===t.getPluginVersion()){let i=t.getImpostorForPhysicsObject(e);i&&(this.physicsImpostor=i.clone(this))}else 2===t.getPluginVersion()&&e.physicsBody&&e.physicsBody.clone(this)}for(let t=0;t<r.particleSystems.length;t++){let i=r.particleSystems[t];i.emitter===e&&i.clone(i.name,this)}if(this.skeleton=e.skeleton,s&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){let t=e._userThinInstanceBuffersStorage;for(let e in t.data)this.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!t.vertexBuffers?.[e]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,s=null,r,a=!0){let n;super(e,t),this._internalMeshDataInfo=new tr,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new ts,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=tn.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new tt,this._instanceDataStorage.engine=t.getEngine(),this._instanceDataStorage.useMonoDataStorageRenderPass=!this._instanceDataStorage.engine.isWebGPU,this._instanceDataStorage.useMonoDataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass=new te),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(e,t,i)=>{e&&i&&(this._uniformBuffer?this.transferToEffect(t):i.bindOnlyWorldMatrix(t))};let o=!1;i&&void 0===i._addToSceneRootNodes?(n=i.parent??null,s=i.source??null,r=i.doNotCloneChildren??!1,a=i.clonePhysicsImpostor??!0,o=i.cloneThinInstances??!1):n=i,s&&this._copySource(s,r,a,o),null!==n&&(this.parent=n),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=e=>{e.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new ec.Observable(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){let s=0===this.getTotalVertices()||t&&t.doNotInstantiate&&(!0===t.doNotInstantiate||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));for(let r of(s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s),this.getChildTransformNodes(!0)))"InstancedMesh"===r.getClassName()&&"Mesh"===s.getClassName()&&r.sourceMesh===this?r.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):r.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){let e=this.getIndices(),i=this.getVerticesData(ev.VertexBuffer.PositionKind);i&&e&&(t+=", flat shading: "+(i.length/3===e.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){for(let e of(super._unBindEffect(),this.instances))e._unBindEffect()}get hasLODLevels(){return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){let e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return eA.Logger.Warn("You cannot use a mesh as LOD level twice"),this;let i=new e9(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){let t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){let s=t._LODLevels[i];if(s.distanceOrScreenCoverage===e)return s.mesh}return null}removeLODLevel(e){let t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){let i=this._internalMeshDataInfo;if(!i._LODLevels||0===i._LODLevels.length)return this;let s=t||this.getBoundingInfo().boundingSphere,r=e.mode===eb.Camera.ORTHOGRAPHIC_CAMERA?e.minZ:s.centerWorld.subtract(e.globalPosition).length(),a=r,n=1;if(i._useLODScreenCoverage){let t=e.screenArea,i=s.radiusWorld*e.minZ/r;a=(i=i*i*Math.PI)/t,n=-1}if(n*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>n*a)return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,this),this;for(let e=0;e<i._LODLevels.length;e++){let t=i._LODLevels[e];if(n*t.distanceOrScreenCoverage<n*a){if(t.mesh){if(4===t.mesh.delayLoadState)return t.mesh._checkDelayState(),this;if(2===t.mesh.delayLoadState)return this;t.mesh._preActivate(),t.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,t.mesh),t.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,this),this}get geometry(){return this._geometry}getTotalVertices(){return null===this._geometry||void 0===this._geometry?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,s){if(!this._geometry)return null;let r=s?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&1!==this._geometry.meshes.length);return r||(r=this._geometry.getVerticesData(e,t,i)),r}copyVerticesData(e,t){this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){return this._geometry?!t&&this._userInstancedBuffersStorage?.vertexBuffers[e]!==void 0||this._geometry.isVerticesDataPresent(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}isVertexBufferUpdatable(e,t){if(!this._geometry)return!!this._delayInfo&&-1!==this._delayInfo.indexOf(e);if(!t){let t=this._userInstancedBuffersStorage?.vertexBuffers[e];if(t)return t.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){if(!this._geometry){let e=[];if(this._delayInfo)for(let t of this._delayInfo)e.push(t);return e}let t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(let e in this._userInstancedBuffersStorage.vertexBuffers)-1===t.indexOf(e)&&t.push(e);return t}getTotalIndices(){return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){return null!==this._masterMesh&&void 0!==this._masterMesh}isReady(e=!1,t=!1){if(2===this.delayLoadState||!super.isReady(e))return!1;if(!this.subMeshes||0===this.subMeshes.length||!e)return!0;let i=this.getEngine(),s=this.getScene(),r=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();let a=this.material||s.defaultMaterial;if(a){if(a._storeEffectOnSubMeshes)for(let e of this.subMeshes){let t=e.getMaterial();if(t){if(t._storeEffectOnSubMeshes){if(!t.isReadyForSubMesh(this,e,r))return!1}else if(!t.isReady(this,r))return!1}}else if(!a.isReady(this,r))return!1}let n=i.currentRenderPassId;for(let e of this.lightSources){let t=e.getShadowGenerators();if(!t)continue;let s=t.values();for(let e=s.next();!0!==e.done;e=s.next()){let t=e.value;if(t&&(!t.getShadowMap()?.renderList||t.getShadowMap()?.renderList&&t.getShadowMap()?.renderList?.indexOf(this)!==-1)){let e=t.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let s=0;s<e.length;++s)for(let a of(i.currentRenderPassId=e[s],this.subMeshes))if(!t.isReady(a,r,a.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=n,!1;i.currentRenderPassId=n}}}for(let e of this._internalMeshDataInfo._LODLevels)if(e.mesh&&!e.mesh.isReady(r))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){if(this._instanceDataStorage.useMonoDataStorageRenderPass)return this._instanceDataStorage.dataStorageRenderPass;let e=this._instanceDataStorage.engine.currentRenderPassId,t=this._instanceDataStorage.renderPasses[e];return t||(t=new te,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){let e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t||(e._preActivateId=t,this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass.visibleInstances=null:this._getInstanceDataStorage().visibleInstances=null),this}_preActivateForIntermediateRendering(e){let t=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){let i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(void 0!==i.previousRenderId&&(!this._instanceDataStorage.useMonoDataStorageRenderPass||this._instanceDataStorage.isFrozen)&&delete i.visibleInstances[i.previousRenderId],i.previousRenderId=t,i.visibleInstances[t]=[]),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData("object"==typeof e?e:{applySkeleton:e,applyMorph:t},null,ev.VertexBuffer.PositionKind),i),this}_createGlobalSubMesh(e){let t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){let i=this.getIndices();if(!i)return null;let s=i.length,r=!1;if(e)r=!0;else for(let e of this.subMeshes)if(e.indexStart+e.indexCount>s||e.verticesStart+e.verticesCount>t){r=!0;break}if(!r)return this.subMeshes[0]}return this.releaseSubMeshes(),new eC.SubMesh(0,0,t,0,this.getTotalIndices()||(this.isUnIndexed?t:0),this)}subdivide(e){if(e<1)return;let t=this.getTotalIndices(),i=t/e|0,s=0;for(;i%3!=0;)i++;this.releaseSubMeshes();for(let r=0;r<e&&!(s>=t);r++)eC.SubMesh.CreateFromIndices(0,s,s+i>=t?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{let s=new eR;s.set(t,e);let r=this.getScene();new eN(eN.RandomId(),r,s,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){let i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0,i=null){return this._geometry||(this._geometry=eN.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,i,t),this}updateVerticesData(e,t,i,s){return this._geometry&&(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i)),this}updateMeshPositions(e,t=!0){let i=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(ev.VertexBuffer.PositionKind,i,!1,!1),t){let e=this.getIndices(),t=this.getVerticesData(ev.VertexBuffer.NormalKind);if(!t)return this;eR.ComputeNormals(i,e,t),this.updateVerticesData(ev.VertexBuffer.NormalKind,t,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry||1===this._geometry.meshes.length)return this;let e=this._geometry,t=this._geometry.copy(eN.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,s=null){let r=this._geometry;r||(r=new eN(eN.RandomId(),this.getScene(),void 0,void 0,this)),r.setIndexBuffer(e,t,i,s)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{let s=new eR;s.indices=e;let r=this.getScene();new eN(eN.RandomId(),r,s,i,this,t)}return this}updateIndices(e,t,i=!1){return this._geometry&&this._geometry.updateIndices(e,t,i),this}toLeftHanded(){return this._geometry&&this._geometry.toLeftHanded(),this}_bind(e,t,i,s=!0){let r;if(!this._geometry)return this;let a=this.getScene().getEngine();if(this._unIndexed)r=this._getRenderingFillMode(i)===e2.Material.WireFrameFillMode?e._getLinesIndexBuffer(this.getIndices(),a):null;else switch(this._getRenderingFillMode(i)){case e2.Material.PointFillMode:r=null;break;case e2.Material.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),a);break;default:case e2.Material.TriangleFillMode:r=this._geometry.getIndexBuffer()}return this._bindDirect(t,r,s)}_bindDirect(e,t,i=!0){if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),i&&this._userInstancedBuffersStorage&&!this.hasThinInstances){if(!this._instanceDataStorage.useMonoDataStorageRenderPass&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){let e=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(let t in e)this._userInstancedBuffersStorage.vertexBuffers[t]=e[t]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}else this._geometry._bind(e,t);return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);let s=this.getScene().getEngine(),r=s._currentMaterialContext,a=r&&r.useVertexPulling;return this._unIndexed&&t!==e2.Material.WireFrameFillMode||t==e2.Material.PointFillMode?s.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==e2.Material.WireFrameFillMode?s.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):a?s.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):s.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){let i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}let s=this.getScene(),r=s._isInIntermediateRendering(),a=r?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,n=i.batchCache;if(n.mustReturn=!1,n.renderSelf[e]=t||!a&&this.isEnabled()&&this.isVisible,n.visibleInstances[e]=null,i.visibleInstances&&!t){let t=i.visibleInstances,a=s.getRenderId(),o=r?t.intermediateDefaultRenderId:t.defaultRenderId;n.visibleInstances[e]=t[a],!n.visibleInstances[e]&&o&&(n.visibleInstances[e]=t[o])}return n.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==n.visibleInstances[e]&&void 0!==n.visibleInstances[e],i.previousBatch=n,n}_updateInstancedBuffers(e,t,i,s,r,a){let n=t.visibleInstances[e._id],o=n?n.length:0,l=t.parent,h=this._instanceDataStorage,c=l.instancesBuffer,u=l.instancesPreviousBuffer,d=0,f=0,g=t.renderSelf[e._id],_=this._scene.floatingOriginOffset,m=!c||i!==l.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!l.instancesPreviousBuffer;if(this._instanceDataStorage.manualUpdate||h.isFrozen&&!m)f=+!!g+o;else{let t=this.getWorldMatrix();if(g){this._scene.needsPreviousWorldMatrices&&(h.masterMeshPreviousWorldMatrix?(h.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData,d),h.masterMeshPreviousWorldMatrix.copyFrom(t)):(h.masterMeshPreviousWorldMatrix=t.clone(),h.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData,d))),t.copyToArray(l.instancesData,d);let e=t.asArray();l.instancesData[d+12]=e[12]-_.x,l.instancesData[d+13]=e[13]-_.y,l.instancesData[d+14]=e[14]-_.z,d+=16,f++}if(n){if(tn.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){let e=this._scene.activeCamera.globalPosition;for(let t=0;t<n.length;t++){let i=n[t];i._distanceToCamera=ey.Vector3.Distance(i.getBoundingInfo().boundingSphere.centerWorld,e)}n.sort((e,t)=>e._distanceToCamera>t._distanceToCamera?-1:+(e._distanceToCamera<t._distanceToCamera))}for(let e=0;e<n.length;e++){let t=n[e],i=t.getWorldMatrix();i.copyToArray(l.instancesData,d),this._scene.needsPreviousWorldMatrices&&(t._previousWorldMatrix?(t._previousWorldMatrix.copyToArray(l.instancesPreviousData,d),t._previousWorldMatrix.copyFrom(i)):(t._previousWorldMatrix=i.clone(),t._previousWorldMatrix.copyToArray(l.instancesPreviousData,d)));let s=i.asArray();l.instancesData[d+12]=s[12]-_.x,l.instancesData[d+13]=s[13]-_.y,l.instancesData[d+14]=s[14]-_.z,d+=16,f++}}}if(m){let e;if(c&&c.dispose(),u&&u.dispose(),c=new ev.Buffer(s,l.instancesData,!0,16,!1,!0),l.instancesBuffer=c,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0}),this._instanceDataStorage.useMonoDataStorageRenderPass)e=this._userInstancedBuffersStorage.vertexBuffers;else{this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});let t=this._instanceDataStorage.engine.currentRenderPassId;(e=this._userInstancedBuffersStorage.renderPasses[t])||(this._userInstancedBuffersStorage.renderPasses[t]=e={})}e.world0=c.createVertexBuffer("world0",0,4),e.world1=c.createVertexBuffer("world1",4,4),e.world2=c.createVertexBuffer("world2",8,4),e.world3=c.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(u=new ev.Buffer(s,l.instancesPreviousData,!0,16,!1,!0),l.instancesPreviousBuffer=u,e.previousWorld0=u.createVertexBuffer("previousWorld0",0,4),e.previousWorld1=u.createVertexBuffer("previousWorld1",4,4),e.previousWorld2=u.createVertexBuffer("previousWorld2",8,4),e.previousWorld3=u.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&(c.updateDirectly(l.instancesData,0,f),this._scene.needsPreviousWorldMatrices&&(!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.previousManualUpdate)&&u.updateDirectly(l.instancesPreviousData,0,f));this._processInstancedBuffers(n,g),a&&void 0!==r&&(this.getScene()._activeIndices.addCount(e.indexCount*f,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,a,r),this._draw(e,r,f)),this._scene.needsPreviousWorldMatrices&&!m&&this._instanceDataStorage.manualUpdate&&(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&!this._instanceDataStorage.previousManualUpdate&&u.updateDirectly(l.instancesData,0,f)}_renderWithInstances(e,t,i,s,r){let a=i.visibleInstances[e._id],n=a?a.length:0,o=i.parent,l=o.instancesBufferSize,h=16*(n+1)*4;for(;o.instancesBufferSize<h;)o.instancesBufferSize*=2;return o.instancesData&&l==o.instancesBufferSize||(o.instancesData=new Float32Array(o.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!o.instancesPreviousData||l!=o.instancesBufferSize)&&(o.instancesPreviousData=new Float32Array(o.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,l,r,t,s),r.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,s){let r=this._thinInstanceDataStorage?.instancesCount??0;this.getScene()._activeIndices.addCount(e.indexCount*r,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,r),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,r):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),s.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,s,r,a,n,o){let l=this.getScene(),h=l.getEngine();if(s=this._getRenderingFillMode(s),a&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,s,i,h),this;if(a)this._renderWithInstances(t,s,r,i,h);else{h._currentDrawContext&&(h._currentDrawContext.useInstancing=!1);let i=0;r.renderSelf[t._id]&&(n&&n(!1,e.getWorldMatrix(),o),i++,this._draw(t,s,this._instanceDataStorage.overridenInstanceCount));let a=r.visibleInstances[t._id];if(a){let e=a.length;i+=e;for(let i=0;i<e;i++){let e=a[i].getWorldMatrix();n&&n(!0,e,o),this._draw(t,s)}}l._activeIndices.addCount(t.indexCount*i,!1)}return this}_disposeInstanceDataStorageRenderPass(e,t=!1){e?.instancesBuffer&&(t&&e.instancesBuffer.dispose(),e.instancesBuffer=null),e?.instancesPreviousBuffer&&(t&&e.instancesPreviousBuffer.dispose(),e.instancesPreviousBuffer=null)}_rebuild(e=!1){for(let t in this._instanceDataStorage.renderPasses){let i=this._instanceDataStorage.renderPasses[t];this._disposeInstanceDataStorageRenderPass(i,e)}if(this._disposeInstanceDataStorageRenderPass(this._instanceDataStorage.dataStorageRenderPass,e),this._userInstancedBuffersStorage){for(let t in this._userInstancedBuffersStorage.vertexBuffers){let i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_releaseRenderPassId(e){let t=this._instanceDataStorage.renderPasses[e];if(t&&(this._disposeInstanceDataStorageRenderPass(t,!0),delete this._instanceDataStorage.renderPasses[e]),this._userInstancedBuffersStorage?.renderPasses){let t=this._userInstancedBuffersStorage.renderPasses[e];if(t)for(let e in t)t[e]?.dispose();delete this._userInstancedBuffersStorage.renderPasses[e]}}_freeze(){if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){for(let e in this._instanceDataStorage.isFrozen=!1,this._instanceDataStorage.renderPasses)this._instanceDataStorage.renderPasses[e].previousBatch=null;this._instanceDataStorage.dataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass.previousBatch=null)}renderWithRenderPassId(e,t,i,s,r=!0){let a=this._scene.getEngine(),n=a.currentRenderPassId;if(void 0!==e&&(a.currentRenderPassId=e),s)(!r||r&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i);else for(let e=0;e<this.subMeshes.length;e++){let s=this.subMeshes[e];(!r||r&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i)}return void 0!==e&&(a.currentRenderPassId=n),this}directRender(){if(!this.subMeshes)return this;for(let e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){let s,r,a=this.getScene(),n=a.getEngine();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;let o=a.activeCameras?.length??0,l=o>1&&a.activeCamera===a.activeCameras[0]||o<=1,h=this._occlusionDataStorage&&-1!==this._occlusionDataStorage.occlusionForRenderPassId&&this._occlusionDataStorage.occlusionForRenderPassId!==n.currentRenderPassId;if(l&&this._checkOcclusionQuery(h)&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;let c=this._getInstancesRenderList(e._id,!!i);if(c.mustReturn||!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let u=0,d=null;this.ignoreCameraMaxZ&&a.activeCamera&&!a._isInIntermediateRendering()&&(u=a.activeCamera.maxZ,d=a.activeCamera,a.activeCamera.maxZ=0,a.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);let f=e.getRenderingMesh(),g=c.hardwareInstancedRendering[e._id]||f.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,_=this._instanceDataStorage,m=e.getMaterial();if(!m)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;if(_.isFrozen&&this._internalMeshDataInfo._effectiveMaterial&&this._internalMeshDataInfo._effectiveMaterial===m){if(m._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!m._storeEffectOnSubMeshes&&!m._getDrawWrapper()._wasPreviouslyReady)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this}else{if(m._storeEffectOnSubMeshes){if(!m.isReadyForSubMesh(this,e,g))return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this}else if(!m.isReady(this,g))return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=m}if(t){let e=this._internalMeshDataInfo._effectiveMaterial;if(1===e.alphaModes.length)n.setAlphaMode(e.alphaMode);else for(let t=0;t<e.alphaModes.length;t++){let i=e.alphaModes[t];n.setAlphaMode(void 0!==i?i:2,!1,t)}}s=this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?e._drawWrapper:this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();let p=s?.effect??null;for(let t of a._beforeRenderingMeshStage)t.action(this,e,c,p);if(!s||!p)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;let M=i||this;if(!_.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||null!==this._internalMeshDataInfo._effectiveMaterial.sideOrientation||this._internalMeshDataInfo._effectiveMaterial._twoSidedLighting)){let e=M._getWorldMatrixDeterminant();r=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),e<0&&(r=r===e2.Material.ClockWiseSideOrientation?e2.Material.CounterClockWiseSideOrientation:e2.Material.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=r}let I=this._internalMeshDataInfo._effectiveMaterial._preBind(s,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&n.setDepthWrite(!0);let x=this._internalMeshDataInfo._effectiveMaterial,b=x.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),g||this._bind(e,p,b,!1);let y=M.getWorldMatrix();for(let t of(x._storeEffectOnSubMeshes?x.bindForSubMesh(y,this,e):x.bind(y,this),!x.backFaceCulling&&x.separateCullingPass&&(n.setState(!0,x.zOffset,!1,!I,x.cullBackFaces,x.stencil,x.zOffsetUnits),this._processRendering(this,e,p,b,c,g,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),n.setState(!0,x.zOffset,!1,I,x.cullBackFaces,x.stencil,x.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,p,b,c,g,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind(),a._afterRenderingMeshStage))t.action(this,e,c,p);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),d&&(d.maxZ=u,a.updateTransformMatrix(!0)),2!==a.performancePriority||_.isFrozen||this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){let t=e[i]+e[i+1]+e[i+2]+e[i+3];if(0===t)e[i]=1;else{let s=1/t;e[i]*=s,e[i+1]*=s,e[i+2]*=s,e[i+3]*=s}}this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind),i=t.length;for(let s=0;s<i;s+=4){let i=t[s]+t[s+1]+t[s+2]+t[s+3];if(0===(i+=e[s]+e[s+1]+e[s+2]+e[s+3]))t[s]=1;else{let r=1/i;t[s]*=r,t[s+1]*=r,t[s+2]*=r,t[s+3]*=r,e[s]*=r,e[s+1]*=r,e[s+2]*=r,e[s+3]*=r}}this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,t),this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e)}validateSkinning(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind);if(null===t||null==this.skeleton)return{skinned:!1,valid:!0,report:"not skinned"};let i=t.length,s=0,r=0,a=0,n=0,o=null===e?4:8,l=[];for(let e=0;e<=o;e++)l[e]=0;for(let h=0;h<i;h+=4){let i=t[h],c=i,u=+(0!==c);for(let r=1;r<o;r++){let a=r<4?t[h+r]:e[h+r-4];a>i&&s++,0!==a&&u++,c+=a,i=a}if(l[u]++,u>a&&(a=u),0===c)r++;else{let i=1/c,s=0;for(let r=0;r<o;r++)r<4?s+=Math.abs(t[h+r]-t[h+r]*i):s+=Math.abs(e[h+r-4]-e[h+r-4]*i);s>.001&&n++}}let h=this.skeleton.bones.length,c=this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),u=this.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind),d=0;for(let e=0;e<i;e+=4)for(let t=0;t<o;t++){let i=t<4?c[e+t]:u[e+t-4];(i>=h||i<0)&&d++}let f="Number of Weights = "+i/4+"\nMaximum influences = "+a+"\nMissing Weights = "+r+"\nNot Sorted = "+s+"\nNot Normalized = "+n+"\nWeightCounts = ["+l+"]\nNumber of bones = "+h+"\nBad Bone Indices = "+d;return{skinned:!0,valid:0===r&&0===n&&0===d,report:f}}_checkDelayState(){let e=this.getScene();return this._geometry?this._geometry.load(e):4===this.delayLoadState&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);let t=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return(async()=>{try{let i=await e._loadDelayedFileAsync(this.delayLoadingFile,t,!0);for(let e of(i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this),this.instances))e.refreshBoundingInfo(),e._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)}catch(t){e.removePendingData(this),e.isDisposed||eA.Logger.Error(`Unable to delay load geometry data for mesh "${this.name}" from "${this.delayLoadingFile}": ${t}`)}})(),this}isInFrustum(e){return 2!==this.delayLoadState&&!!super.isInFrustum(e)&&(this._checkDelayState(),!0)}setMaterialById(e){let t,i=this.getScene().materials;for(t=i.length-1;t>-1;t--)if(i[t].id===e)return this.material=i[t],this;let s=this.getScene().multiMaterials;for(t=s.length-1;t>-1;t--)if(s[t].id===e){this.material=s[t];break}return this}getAnimatables(){let e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){let t;if(!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind))return this;let i=this.subMeshes.splice(0);this._resetPointsArrayCache();let s=this.getVerticesData(ev.VertexBuffer.PositionKind),r=ey.Vector3.Zero();for(t=0;t<s.length;t+=3)ey.Vector3.TransformCoordinatesFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).toArray(s,t);if(this.setVerticesData(ev.VertexBuffer.PositionKind,s,this.getVertexBuffer(ev.VertexBuffer.PositionKind).isUpdatable()),this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)){for(t=0,s=this.getVerticesData(ev.VertexBuffer.NormalKind);t<s.length;t+=3)ey.Vector3.TransformNormalFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).normalize().toArray(s,t);this.setVerticesData(ev.VertexBuffer.NormalKind,s,this.getVertexBuffer(ev.VertexBuffer.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(ev.VertexBuffer.TangentKind)){for(t=0,s=this.getVerticesData(ev.VertexBuffer.TangentKind);t<s.length;t+=4)ey.Vector3.TransformNormalFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).normalize().toArray(s,t);this.setVerticesData(ev.VertexBuffer.TangentKind,s,this.getVertexBuffer(ev.VertexBuffer.TangentKind).isUpdatable())}return 0>e.determinant()&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=i,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){return!!this._geometry&&this._geometry._generatePointsArray()}clone(e="",t=null,i,s=!0){return t&&void 0===t._addToSceneRootNodes?(ta.source=this,ta.doNotCloneChildren=t.doNotCloneChildren,ta.clonePhysicsImpostor=t.clonePhysicsImpostor,ta.cloneThinInstances=t.cloneThinInstances,new tn(e,this.getScene(),ta)):new tn(e,this.getScene(),t,this,i,s)}dispose(e,t=!1){this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);let i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(let e in i.meshMap){let t=i.meshMap[e];t&&(t._internalMeshDataInfo._source=null,i.meshMap[e]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else for(let e of this.getScene().meshes)e._internalMeshDataInfo&&e._internalMeshDataInfo._source&&e._internalMeshDataInfo._source===this&&(e._internalMeshDataInfo._source=null);i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,s,r,a,n=!1,o){let l=this.getScene(),h=e=>{let o=e.width,l=e.height,h=this.getEngine().createCanvas(o,l).getContext("2d");h.drawImage(e,0,0);let c=h.getImageData(0,0,o,l).data;this.applyDisplacementMapFromBuffer(c,o,l,t,i,r,a,n),s&&s(this)};return(0,ed.LoadImage)(e,h,o||(()=>{}),l.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,r,a,n,o=!1){if(!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)||!this.isVerticesDataPresent(ev.VertexBuffer.UVKind))return eA.Logger.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;let l=this.getVerticesData(ev.VertexBuffer.PositionKind,!0,!0),h=this.getVerticesData(ev.VertexBuffer.NormalKind),c=this.getVerticesData(ev.VertexBuffer.UVKind),u=ey.Vector3.Zero(),d=ey.Vector3.Zero(),f=ey.Vector2.Zero();a=a||ey.Vector2.Zero(),n=n||new ey.Vector2(1,1);for(let o=0;o<l.length;o+=3){ey.Vector3.FromArrayToRef(l,o,u),ey.Vector3.FromArrayToRef(h,o,d),ey.Vector2.FromArrayToRef(c,o/3*2,f);let g=((Math.abs(f.x*n.x+a.x%1)*(t-1)%t|0)+(Math.abs(f.y*n.y+a.y%1)*(i-1)%i|0)*t)*4,_=.3*(e[g]/255)+.59*(e[g+1]/255)+.11*(e[g+2]/255);d.normalize(),d.scaleInPlace(s+(r-s)*_),(u=u.add(d)).toArray(l,o)}return eR.ComputeNormals(l,this.getIndices(),h),o?(this.setVerticesData(ev.VertexBuffer.PositionKind,l),this.setVerticesData(ev.VertexBuffer.NormalKind,h),this.setVerticesData(ev.VertexBuffer.UVKind,c)):(this.updateVerticesData(ev.VertexBuffer.PositionKind,l),this.updateVerticesData(ev.VertexBuffer.NormalKind,h)),this}_getFlattenedNormals(e,t){let i=new Float32Array(3*e.length),s=0,r=this.sideOrientation===+!!this._scene.useRightHandedSystem;for(let a=0;a<e.length;a+=3){let n=ey.Vector3.FromArray(t,3*e[a]),o=ey.Vector3.FromArray(t,3*e[a+1]),l=ey.Vector3.FromArray(t,3*e[a+2]),h=n.subtract(o),c=l.subtract(o),u=ey.Vector3.Normalize(ey.Vector3.Cross(h,c));r&&u.scaleInPlace(-1);for(let e=0;e<3;e++)i[s++]=u.x,i[s++]=u.y,i[s++]=u.z}return i}_convertToUnIndexedMesh(e=!1){let t=this.getVerticesDataKinds().filter(e=>!this.getVertexBuffer(e)?.getIsInstanced()),i=this.getIndices(!1,!0),s={},r=(e,t)=>{let s=new Float32Array(i.length*t),r=0;for(let a=0;a<i.length;a++)for(let n=0;n<t;n++)s[r++]=e[i[a]*t+n];return s},a=this.getBoundingInfo(),n=this.geometry?this.subMeshes.slice(0):[];for(let e of t)s[e]=this.getVerticesData(e);for(let a of t){let t=this.getVertexBuffer(a),n=t.getSize();if(e&&a===ev.VertexBuffer.NormalKind){let e=this._getFlattenedNormals(i,s[ev.VertexBuffer.PositionKind]);this.setVerticesData(ev.VertexBuffer.NormalKind,e,t.isUpdatable(),n)}else this.setVerticesData(a,r(s[a],n),t.isUpdatable(),n)}if(this.morphTargetManager){for(let t=0;t<this.morphTargetManager.numTargets;t++){let s=this.morphTargetManager.getTarget(t),a=s.getPositions();s.setPositions(r(a,3));let n=s.getNormals();n&&s.setNormals(e?this._getFlattenedNormals(i,a):r(n,3));let o=s.getTangents();o&&s.setTangents(r(o,3));let l=s.getUVs();l&&s.setUVs(r(l,2));let h=s.getColors();h&&s.setColors(r(h,4))}this.morphTargetManager.synchronize()}for(let e=0;e<i.length;e++)i[e]=e;for(let e of(this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes(),n)){let t=e.getBoundingInfo();eC.SubMesh.AddToMesh(e.materialIndex,e.indexStart,e.indexCount,e.indexStart,e.indexCount,this).setBoundingInfo(t)}return this.setBoundingInfo(a),this.synchronizeInstances(),this}convertToFlatShadedMesh(){return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){return this._convertToUnIndexedMesh()}flipFaces(e=!1){let t,i=eR.ExtractFromMesh(this);if(e&&this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&i.normals){for(t=0;t<i.normals.length;t++)i.normals[t]*=-1;this.setVerticesData(ev.VertexBuffer.NormalKind,i.normals,this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind))}if(i.indices){let e;for(t=0;t<i.indices.length;t+=3)e=i.indices[t+1],i.indices[t+1]=i.indices[t+2],i.indices[t+2]=e;this.setIndices(i.indices,null,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind),!0)}return this}increaseVertices(e=1){let t=eR.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,s=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,r=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,a=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(i&&s){let n,o,l,h,c;t.indices=i,t.positions=s,r&&(t.uvs=r),a&&(t.normals=a);let u=e+1,d=[];for(let e=0;e<u+1;e++)d[e]=[];let f=new ey.Vector3(0,0,0),g=new ey.Vector3(0,0,0),_=new ey.Vector2(0,0),m=[],p=[],M=[],I=s.length;r&&(h=r.length),a&&(c=a.length);for(let e=0;e<i.length;e+=3){p[0]=i[e],p[1]=i[e+1],p[2]=i[e+2];for(let e=0;e<3;e++)if(n=p[e],o=p[(e+1)%3],void 0===M[n]&&void 0===M[o]?(M[n]=[],M[o]=[]):(void 0===M[n]&&(M[n]=[]),void 0===M[o]&&(M[o]=[])),void 0===M[n][o]&&void 0===M[o][n]){M[n][o]=[],f.x=(s[3*o]-s[3*n])/u,f.y=(s[3*o+1]-s[3*n+1])/u,f.z=(s[3*o+2]-s[3*n+2])/u,a&&(g.x=(a[3*o]-a[3*n])/u,g.y=(a[3*o+1]-a[3*n+1])/u,g.z=(a[3*o+2]-a[3*n+2])/u),r&&(_.x=(r[2*o]-r[2*n])/u,_.y=(r[2*o+1]-r[2*n+1])/u),M[n][o].push(n);for(let e=1;e<u;e++)M[n][o].push(s.length/3),s[I++]=s[3*n]+e*f.x,s[I++]=s[3*n+1]+e*f.y,s[I++]=s[3*n+2]+e*f.z,a&&(a[c++]=a[3*n]+e*g.x,a[c++]=a[3*n+1]+e*g.y,a[c++]=a[3*n+2]+e*g.z),r&&(r[h++]=r[2*n]+e*_.x,r[h++]=r[2*n+1]+e*_.y);M[n][o].push(o),M[o][n]=[],l=M[n][o].length;for(let e=0;e<l;e++)M[o][n][e]=M[n][o][l-1-e]}d[0][0]=i[e],d[1][0]=M[i[e]][i[e+1]][1],d[1][1]=M[i[e]][i[e+2]][1];for(let t=2;t<u;t++){d[t][0]=M[i[e]][i[e+1]][t],d[t][t]=M[i[e]][i[e+2]][t],f.x=(s[3*d[t][t]]-s[3*d[t][0]])/t,f.y=(s[3*d[t][t]+1]-s[3*d[t][0]+1])/t,f.z=(s[3*d[t][t]+2]-s[3*d[t][0]+2])/t,a&&(g.x=(a[3*d[t][t]]-a[3*d[t][0]])/t,g.y=(a[3*d[t][t]+1]-a[3*d[t][0]+1])/t,g.z=(a[3*d[t][t]+2]-a[3*d[t][0]+2])/t),r&&(_.x=(r[2*d[t][t]]-r[2*d[t][0]])/t,_.y=(r[2*d[t][t]+1]-r[2*d[t][0]+1])/t);for(let e=1;e<t;e++)d[t][e]=s.length/3,s[I++]=s[3*d[t][0]]+e*f.x,s[I++]=s[3*d[t][0]+1]+e*f.y,s[I++]=s[3*d[t][0]+2]+e*f.z,a&&(a[c++]=a[3*d[t][0]]+e*g.x,a[c++]=a[3*d[t][0]+1]+e*g.y,a[c++]=a[3*d[t][0]+2]+e*g.z),r&&(r[h++]=r[2*d[t][0]]+e*_.x,r[h++]=r[2*d[t][0]+1]+e*_.y)}d[u]=M[i[e+1]][i[e+2]],m.push(d[0][0],d[1][0],d[1][1]);for(let e=1;e<u;e++){let t;for(t=0;t<e;t++)m.push(d[e][t],d[e+1][t],d[e+1][t+1]),m.push(d[e][t],d[e+1][t+1],d[e][t+1]);m.push(d[e][t],d[e+1][t],d[e+1][t+1])}}t.indices=m,t.applyToMesh(this,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind))}else eA.Logger.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions")}forceSharedVertices(){let e=eR.ExtractFromMesh(this),t=e.uvs,i=e.indices,s=e.positions,r=e.colors,a=e.matricesIndices,n=e.matricesWeights,o=e.matricesIndicesExtra,l=e.matricesWeightsExtra;if(void 0===i||void 0===s||null===i||null===s)eA.Logger.Warn("VertexData contains empty entries");else{let h,c,u,d=[],f=[],g=[],_=[],m=[],p=[],M=[],I=[],x=0,b={};for(let e=0;e<i.length;e+=3){u=[i[e],i[e+1],i[e+2]],h=[];for(let e=0;e<3;e++){h[e]="";for(let t=0;t<3;t++)1e-8>Math.abs(s[3*u[e]+t])&&(s[3*u[e]+t]=0),h[e]+=s[3*u[e]+t]+"|"}if(h[0]!=h[1]&&h[0]!=h[2]&&h[1]!=h[2])for(let e=0;e<3;e++){if(void 0===(c=b[h[e]])){b[h[e]]=x,c=x++;for(let t=0;t<3;t++)d.push(s[3*u[e]+t]);if(null!=r)for(let t=0;t<4;t++)_.push(r[4*u[e]+t]);if(null!=t)for(let i=0;i<2;i++)g.push(t[2*u[e]+i]);if(null!=a)for(let t=0;t<4;t++)m.push(a[4*u[e]+t]);if(null!=n)for(let t=0;t<4;t++)p.push(n[4*u[e]+t]);if(null!=o)for(let t=0;t<4;t++)M.push(o[4*u[e]+t]);if(null!=l)for(let t=0;t<4;t++)I.push(l[4*u[e]+t])}f.push(c)}}let y=[];eR.ComputeNormals(d,f,y),e.positions=d,e.indices=f,e.normals=y,null!=t&&(e.uvs=g),null!=r&&(e.colors=_),null!=a&&(e.matricesIndices=m),null!=n&&(e.matricesWeights=p),null!=o&&(e.matricesIndicesExtra=M),null!=n&&(e.matricesWeightsExtra=I),e.applyToMesh(this,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind))}}static _instancedMeshFactory(e,t){throw(0,eS._WarnImport)("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){throw(0,eS._WarnImport)("PhysicsImpostor")}createInstance(e){let t=tn._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){for(let e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this}optimizeIndices(e){let t=this.getIndices(),i=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!i||!t)return this;let s=[];for(let e=0;e<i.length;e+=3)s.push(ey.Vector3.FromArray(i,e));let r=[];return eu.AsyncLoop.SyncAsyncForLoop(s.length,40,e=>{let t=s.length-1-e,i=s[t];for(let e=0;e<t;++e){let a=s[e];if(i.equals(a)){r[t]=e;break}}},()=>{for(let e=0;e<t.length;++e)t[e]=r[t[e]]||t[e];let i=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=i,e&&e(this)}),this}serialize(e={}){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),eg.Tags&&eg.Tags.HasTags(this)&&(e.tags=eg.Tags.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this._isWorldMatrixFrozen&&(e.freezeWorldMatrix=!0),this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;let t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let t=0;t<this.subMeshes.length;t++){let i=this.subMeshes[t];e.subMeshes.push({materialIndex:i.materialIndex,verticesStart:i.verticesStart,verticesCount:i.verticesCount,indexStart:i.indexStart,indexCount:i.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.skeletonUniqueId=this.skeleton.uniqueId,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(e7.SceneComponentConstants.NAME_PHYSICSENGINE)){let t=this.getPhysicsImpostor?.();t&&(e.physicsMass=t.getParam("mass"),e.physicsFriction=t.getParam("friction"),e.physicsRestitution=t.getParam("mass"),e.physicsImpostor=t.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let t=0;t<this.instances.length;t++){let i=this.instances[t];if(i.doNotSerialize)continue;let s={name:i.name,id:i.id,isEnabled:i.isEnabled(!1),isVisible:i.isVisible,isPickable:i.isPickable,checkCollisions:i.checkCollisions,position:i.position.asArray(),scaling:i.scaling.asArray()};if(i.parent&&i.parent._serializeAsParent(s),i.rotationQuaternion?s.rotationQuaternion=i.rotationQuaternion.asArray():i.rotation&&(s.rotation=i.rotation.asArray()),this.getScene()._getComponent(e7.SceneComponentConstants.NAME_PHYSICSENGINE)){let e=i.getPhysicsImpostor?.();e&&(s.physicsMass=e.getParam("mass"),s.physicsFriction=e.getParam("friction"),s.physicsRestitution=e.getParam("mass"),s.physicsImpostor=e.type)}i.metadata&&(s.metadata=i.metadata),i.actionManager&&(s.actions=i.actionManager.serialize(i.name)),e.instances.push(s),eK.SerializationHelper.AppendSerializedAnimations(i,s),s.ranges=i.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){let t={data:{},sizes:{},strides:{}};for(let e in this._userThinInstanceBuffersStorage.data)t.data[e]=Array.from(this._userThinInstanceBuffersStorage.data[e]),t.sizes[e]=this._userThinInstanceBuffersStorage.sizes[e],t.strides[e]=this._userThinInstanceBuffersStorage.strides[e];e.thinInstances.userThinInstance=t}return eK.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();let e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices()){eA.Logger.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),this.morphTargetManager=null;return}if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){let i=e.getActiveTarget(t),s=i.getPositions();if(!s)return void eA.Logger.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(ev.VertexBuffer.PositionKind+t,s,!1,3);let r=i.getNormals();r&&this.geometry.setVerticesData(ev.VertexBuffer.NormalKind+t,r,!1,3);let a=i.getTangents();a&&this.geometry.setVerticesData(ev.VertexBuffer.TangentKind+t,a,!1,3);let n=i.getUVs();n&&this.geometry.setVerticesData(ev.VertexBuffer.UVKind+"_"+t,n,!1,2);let o=i.getUV2s();o&&this.geometry.setVerticesData(ev.VertexBuffer.UV2Kind+"_"+t,o,!1,2);let l=i.getColors();l&&this.geometry.setVerticesData(ev.VertexBuffer.ColorKind+t,l,!1,4)}}else{let e=0;for(;this.geometry.isVerticesDataPresent(ev.VertexBuffer.PositionKind+e);)this.geometry.removeVerticesData(ev.VertexBuffer.PositionKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.NormalKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.NormalKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.TangentKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.TangentKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.UVKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.UVKind+"_"+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.UV2Kind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.UV2Kind+"_"+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.ColorKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.ColorKind+e),e++}}static Parse(e,t,i){let s,r=!1;if(e.type&&"LinesMesh"===e.type?s=tn._LinesMeshParser(e,t):e.type&&"GroundMesh"===e.type?s=tn._GroundMeshParser(e,t):e.type&&"GoldbergMesh"===e.type?s=tn._GoldbergMeshParser(e,t):e.type&&"GreasedLineMesh"===e.type?s=tn._GreasedLineMeshParser(e,t):e.type&&"TrailMesh"===e.type?s=tn._TrailMeshParser(e,t):e.type&&"GaussianSplattingMesh"===e.type?(s=e._isCompound?tn._GaussianSplattingCompoundMeshParser(e,t):tn._GaussianSplattingMeshParser(e,t),r=!0):e.type&&"GaussianSplattingPartProxyMesh"===e.type?(s=tn._GaussianSplattingPartProxyMeshParser(e,t),r=!0):s=new tn(e.name,t),s.id=e.id,s._waitingParsedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(s,e.tags),s.position=ey.Vector3.FromArray(e.position),void 0!==e.metadata&&(s.metadata=e.metadata),e.rotationQuaternion?s.rotationQuaternion=ey.Quaternion.FromArray(e.rotationQuaternion):e.rotation&&(s.rotation=ey.Vector3.FromArray(e.rotation)),s.scaling=ey.Vector3.FromArray(e.scaling),e.localMatrix?s.setPreTransformMatrix(ey.Matrix.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(ey.Matrix.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s.isVisible=e.isVisible,s.infiniteDistance=e.infiniteDistance,s.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,s.showBoundingBox=e.showBoundingBox,s.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,void 0!==e.applyFog&&(s.applyFog=e.applyFog),void 0!==e.pickable&&(s.isPickable=e.pickable),void 0!==e.alphaIndex&&(s.alphaIndex=e.alphaIndex),s.receiveShadows=e.receiveShadows,void 0!==e.billboardMode&&(s.billboardMode=e.billboardMode),void 0!==e.visibility&&(s.visibility=e.visibility),s.checkCollisions=e.checkCollisions,s.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(s.ellipsoid=ey.Vector3.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(s.ellipsoidOffset=ey.Vector3.FromArray(e.ellipsoidOffset)),null!=e.overrideMaterialSideOrientation&&(s.sideOrientation=e.overrideMaterialSideOrientation),void 0!==e.sideOrientation&&(s.sideOrientation=e.sideOrientation),void 0!==e.isBlocker&&(s.isBlocker=e.isBlocker),s._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(s._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),void 0!==e.parentId&&(s._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),void 0!==e.actions&&(s._waitingData.actions=e.actions),void 0!==e.overlayAlpha&&(s.overlayAlpha=e.overlayAlpha),void 0!==e.overlayColor&&(s.overlayColor=eD.Color3.FromArray(e.overlayColor)),void 0!==e.renderOverlay&&(s.renderOverlay=e.renderOverlay),s.isUnIndexed=!!e.isUnIndexed,s.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s.buildBoundingInfo(ey.Vector3.FromArray(e.boundingBoxMinimum),ey.Vector3.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(s._binaryInfo=e._binaryInfo),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(ev.VertexBuffer.UVKind),e.hasUVs2&&s._delayInfo.push(ev.VertexBuffer.UV2Kind),e.hasUVs3&&s._delayInfo.push(ev.VertexBuffer.UV3Kind),e.hasUVs4&&s._delayInfo.push(ev.VertexBuffer.UV4Kind),e.hasUVs5&&s._delayInfo.push(ev.VertexBuffer.UV5Kind),e.hasUVs6&&s._delayInfo.push(ev.VertexBuffer.UV6Kind),e.hasColors&&s._delayInfo.push(ev.VertexBuffer.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(ev.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(ev.VertexBuffer.MatricesWeightsKind),s._delayLoadingFunction=eN._ImportGeometry,eF.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&s._checkDelayState()):r||eN._ImportGeometry(e,s),e.materialUniqueId?s._waitingMaterialId=e.materialUniqueId:e.materialId&&(s._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),void 0!==e.skeletonId&&null!==e.skeletonId&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),s._waitingSkeletonId=e.skeletonId,e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),void 0!==e.skeletonUniqueId&&null!==e.skeletonUniqueId&&(s._waitingSkeletonUniqueId=e.skeletonUniqueId),e.animations){for(let t=0;t<e.animations.length;t++){let i=e.animations[t],r=(0,eY.GetClass)("BABYLON.Animation");r&&s.animations.push(r.Parse(i))}eV.Node.ParseAnimationRanges(s,e,t)}if(e.autoAnimate&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?s.layerMask=Math.abs(parseInt(e.layerMask)):s.layerMask=0xfffffff,e.physicsImpostor&&(s.physicsImpostor=tn._PhysicsImpostorParser(t,s,e)),e.lodMeshIds&&(s._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let i=0;i<e.instances.length;i++){let r=e.instances[i],a=s.createInstance(r.name);if(r.id&&(a.id=r.id),eg.Tags&&(r.tags?eg.Tags.AddTagsTo(a,r.tags):eg.Tags.AddTagsTo(a,e.tags)),a.position=ey.Vector3.FromArray(r.position),void 0!==r.metadata&&(a.metadata=r.metadata),void 0!==r.parentId&&(a._waitingParentId=r.parentId),void 0!==r.parentInstanceIndex&&(a._waitingParentInstanceIndex=r.parentInstanceIndex),void 0!==r.isEnabled&&null!==r.isEnabled&&a.setEnabled(r.isEnabled),void 0!==r.isVisible&&null!==r.isVisible&&(a.isVisible=r.isVisible),void 0!==r.isPickable&&null!==r.isPickable&&(a.isPickable=r.isPickable),r.rotationQuaternion?a.rotationQuaternion=ey.Quaternion.FromArray(r.rotationQuaternion):r.rotation&&(a.rotation=ey.Vector3.FromArray(r.rotation)),a.scaling=ey.Vector3.FromArray(r.scaling),void 0!=r.checkCollisions&&null!=r.checkCollisions&&(a.checkCollisions=r.checkCollisions),void 0!=r.pickable&&null!=r.pickable&&(a.isPickable=r.pickable),void 0!=r.showBoundingBox&&null!=r.showBoundingBox&&(a.showBoundingBox=r.showBoundingBox),void 0!=r.showSubMeshesBoundingBox&&null!=r.showSubMeshesBoundingBox&&(a.showSubMeshesBoundingBox=r.showSubMeshesBoundingBox),void 0!=r.alphaIndex&&null!=r.showSubMeshesBoundingBox&&(a.alphaIndex=r.alphaIndex),r.physicsImpostor&&(a.physicsImpostor=tn._PhysicsImpostorParser(t,a,r)),void 0!==r.actions&&(a._waitingData.actions=r.actions),r.animations){for(let e=0;e<r.animations.length;e++){let t=r.animations[e],i=(0,eY.GetClass)("BABYLON.Animation");i&&a.animations.push(i.Parse(t))}eV.Node.ParseAnimationRanges(a,r,t),r.autoAnimate&&t.beginAnimation(a,r.autoAnimateFrom,r.autoAnimateTo,r.autoAnimateLoop,r.autoAnimateSpeed||1)}}if(e.thinInstances){let t=e.thinInstances;if(s.thinInstanceEnablePicking=!!t.enablePicking,t.matrixData?(s.thinInstanceSetBuffer("matrix",new Float32Array(t.matrixData),16,!1),s._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,s._thinInstanceDataStorage.instancesCount=t.instancesCount):s._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,e.thinInstances.userThinInstance){let t=e.thinInstances.userThinInstance;for(let e in t.data)s.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!1),s._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}}return s}setPositionsForCPUSkinning(){let e=this._internalMeshDataInfo;if(!e._sourcePositions){let t=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind)||this.setVerticesData(ev.VertexBuffer.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){let e=this._internalMeshDataInfo;if(!e._sourceNormals){let t=this.getVerticesData(ev.VertexBuffer.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind)||this.setVerticesData(ev.VertexBuffer.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){let t;if(!this.geometry||this.geometry._softwareSkinningFrameId==this.getScene().getFrameId()||(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)||!this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)))return this;let i=this.isVerticesDataPresent(ev.VertexBuffer.NormalKind),s=this._internalMeshDataInfo;if(!s._sourcePositions){let e=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=e}i&&!s._sourceNormals&&this.setNormalsForCPUSkinning();let r=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r));let a=this.getVerticesData(ev.VertexBuffer.NormalKind);if(i){if(!a)return this;a instanceof Float32Array||(a=new Float32Array(a))}let n=this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),o=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind);if(!o||!n)return this;let l=this.numBoneInfluencers>4,h=l?this.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind):null,c=l?this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),d=ey.Vector3.Zero(),f=new ey.Matrix,g=new ey.Matrix,_=0;for(let e=0;e<r.length;e+=3,_+=4){let m;for(t=0;t<4;t++)(m=o[_+t])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*n[_+t]),m,g),f.addToSelf(g));if(l)for(t=0;t<4;t++)(m=c[_+t])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*h[_+t]),m,g),f.addToSelf(g));ey.Vector3.TransformCoordinatesFromFloatsToRef(s._sourcePositions[e],s._sourcePositions[e+1],s._sourcePositions[e+2],f,d),d.toArray(r,e),i&&(ey.Vector3.TransformNormalFromFloatsToRef(s._sourceNormals[e],s._sourceNormals[e+1],s._sourceNormals[e+2],f,d),d.toArray(a,e)),f.reset()}return this.updateVerticesData(ev.VertexBuffer.PositionKind,r),i&&this.updateVerticesData(ev.VertexBuffer.NormalKind,a),this}static MinMax(e){let t=null,i=null;for(let s of e){let e=s.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(e.minimumWorld),i.maximizeInPlace(e.maximumWorld)):(t=e.minimumWorld.clone(),i=e.maximumWorld.clone())}return t&&i?{min:t,max:i}:{min:ey.Vector3.Zero(),max:ey.Vector3.Zero()}}static Center(e){let t=e instanceof Array?tn.MinMax(e):e;return ey.Vector3.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,r,a){return eM(tn._MergeMeshesCoroutine(e,t,i,s,r,a,!1))}static async MergeMeshesAsync(e,t=!0,i,s,r,a){return await eI(tn._MergeMeshesCoroutine(e,t,i,s,r,a,!0),em())}static*_MergeMeshesCoroutine(e,t=!0,i,s,r,a,n){let o;if(0===(e=e.filter(Boolean)).length)return null;if(!i){let t=0;for(o=0;o<e.length;o++)if((t+=e[o].getTotalVertices())>=65536)return eA.Logger.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}let l=e[0];a&&(r=!1,e.sort((e,t)=>(e.material?.uniqueId??-1)-(t.material?.uniqueId??-1)));let h=[],c=[],u=[],d=e[0].sideOrientation;for(o=0;o<e.length;o++){let t=e[o];if(t.isAnInstance)return eA.Logger.Warn("Cannot merge instance meshes."),null;if(d!==t.sideOrientation)return eA.Logger.Warn("Cannot merge meshes with different sideOrientation values."),null;if(r||a){let e=u.reduce((e,t)=>Math.max(e,t.start+t.count),0);if(a)if(t.material){let i=t.material;if(i instanceof e5){for(let e=0;e<i.subMaterials.length;e++)0>h.indexOf(i.subMaterials[e])&&h.push(i.subMaterials[e]);for(let s=0;s<t.subMeshes.length;s++)c.push(h.indexOf(i.subMaterials[t.subMeshes[s].materialIndex])),u.push({start:e+t.subMeshes[s].indexStart,count:t.subMeshes[s].indexCount})}else{0>h.indexOf(i)&&h.push(i);for(let s=0;s<t.subMeshes.length;s++)c.push(h.indexOf(i)),u.push({start:e+t.subMeshes[s].indexStart,count:t.subMeshes[s].indexCount})}}else for(let i=0;i<t.subMeshes.length;i++)c.push(0),u.push({start:e+t.subMeshes[i].indexStart,count:t.subMeshes[i].indexCount});else u.push({start:e,count:t.getTotalIndices()})}}if(a&&u.length>1){let e=0;for(let t=1;t<u.length;t++){let i=u[e],s=u[t];c[t]===c[e]&&i.start+i.count===s.start?i.count+=s.count:(u[++e]=s,c[e]=c[t])}u.length=e+1,c.length=e+1}let f=e=>{let t=e.computeWorldMatrix(!0);return{vertexData:eR.ExtractFromMesh(e,!1,!1),transform:t}},{vertexData:g,transform:_}=f(e[0]);n&&(yield);let m=Array(e.length-1);for(let t=1;t<e.length;t++)m[t-1]=f(e[t]),n&&(yield);let p=g._mergeCoroutine(_,m,i,n,!t),M=p.next();for(;!M.done;)n&&(yield),M=p.next();let I=M.value;s||(s=new tn(l.name+"_merged",l.getScene()));let x=I._applyToCoroutine(s,void 0,n),b=x.next();for(;!b.done;)n&&(yield),b=x.next();if(s.checkCollisions=l.checkCollisions,s.sideOrientation=l.sideOrientation,t)for(o=0;o<e.length;o++)e[o].dispose();if(r||a){for(s.releaseSubMeshes(),o=0;o<u.length;)eC.SubMesh.CreateFromIndices(0,u[o].start,u[o].count,s,void 0,!1),o++;for(let e of s.subMeshes)e.refreshBoundingInfo();s.computeWorldMatrix(!0)}if(a){let e=new e5(l.name+"_merged",l.getScene());e.subMaterials=h;for(let e=0;e<s.subMeshes.length;e++)s.subMeshes[e].materialIndex=c[e];s.material=e}else s.material=l.material;return s}addInstance(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){let t=e._indexInSourceMeshInstanceArray;if(-1!=t){if(t!==this.instances.length-1){let e=this.instances[this.instances.length-1];this.instances[t]=e,e._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){return this._scene.useRightHandedSystem&&this.sideOrientation===e2.Material.CounterClockWiseSideOrientation}_getRenderingFillMode(e){let t=this.getScene();return t.forcePointsCloud?e2.Material.PointFillMode:t.forceWireframe?e2.Material.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){return this.setMaterialById(e)}static CreateRibbon(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,s){throw Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,s,r,a,n,o){throw Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,s,r,a,n,o){throw Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,s,r,a,n,o,l,h,c,u){throw Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,s,r,a,n,o,l,h,c){throw Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){throw Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){throw Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){throw Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){throw Error("Import MeshBuilder to populate this function")}}tn.FRONTSIDE=eR.FRONTSIDE,tn.BACKSIDE=eR.BACKSIDE,tn.DOUBLESIDE=eR.DOUBLESIDE,tn.DEFAULTSIDE=eR.DEFAULTSIDE,tn.NO_CAP=0,tn.CAP_START=1,tn.CAP_END=2,tn.CAP_ALL=3,tn.NO_FLIP=0,tn.FLIP_TILE=1,tn.ROTATE_TILE=2,tn.FLIP_ROW=3,tn.ROTATE_ROW=4,tn.FLIP_N_ROTATE_TILE=5,tn.FLIP_N_ROTATE_ROW=6,tn.CENTER=0,tn.LEFT=1,tn.RIGHT=2,tn.TOP=3,tn.BOTTOM=4,tn.INSTANCEDMESH_SORT_TRANSPARENT=!1,tn._GroundMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GroundMesh")},tn._GoldbergMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GoldbergMesh")},tn._LinesMeshParser=(e,t)=>{throw(0,eS._WarnImport)("LinesMesh")},tn._GreasedLineMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GreasedLineMesh")},tn._GreasedLineRibbonMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GreasedLineRibbonMesh")},tn._TrailMeshParser=(e,t)=>{throw(0,eS._WarnImport)("TrailMesh")},tn._GaussianSplattingMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingMesh")},tn._GaussianSplattingPartProxyMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingPartProxyMesh")},tn._GaussianSplattingCompoundMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingCompoundMesh")};let to=!1;(Y=tn.prototype).registerInstancedBuffer??(Y.registerInstancedBuffer=(0,eS._MissingSideEffect)("Mesh","registerInstancedBuffer")),(X=tn.prototype).simplify??(X.simplify=(0,eS._MissingSideEffect)("Mesh","simplify")),($=tn.prototype).thinInstanceAdd??($.thinInstanceAdd=(0,eS._MissingSideEffect)("Mesh","thinInstanceAdd")),(J=tn.prototype).thinInstanceAddSelf??(J.thinInstanceAddSelf=(0,eS._MissingSideEffect)("Mesh","thinInstanceAddSelf")),(ee=tn.prototype).thinInstanceRegisterAttribute??(ee.thinInstanceRegisterAttribute=(0,eS._MissingSideEffect)("Mesh","thinInstanceRegisterAttribute")),(et=tn.prototype).thinInstanceSetMatrixAt??(et.thinInstanceSetMatrixAt=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetMatrixAt")),(ei=tn.prototype).thinInstanceSetAttributeAt??(ei.thinInstanceSetAttributeAt=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetAttributeAt")),(es=tn.prototype).thinInstanceSetBuffer??(es.thinInstanceSetBuffer=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetBuffer")),(er=tn.prototype).thinInstanceGetWorldMatrices??(er.thinInstanceGetWorldMatrices=(0,eS._MissingSideEffect)("Mesh","thinInstanceGetWorldMatrices")),(ea=tn.prototype).thinInstanceBufferUpdated??(ea.thinInstanceBufferUpdated=(0,eS._MissingSideEffect)("Mesh","thinInstanceBufferUpdated")),(en=tn.prototype).thinInstancePartialBufferUpdate??(en.thinInstancePartialBufferUpdate=(0,eS._MissingSideEffect)("Mesh","thinInstancePartialBufferUpdate")),(eo=tn.prototype).thinInstanceRefreshBoundingInfo??(eo.thinInstanceRefreshBoundingInfo=(0,eS._MissingSideEffect)("Mesh","thinInstanceRefreshBoundingInfo")),(el=tn.prototype).getEmittedParticleSystems??(el.getEmittedParticleSystems=(0,eS._MissingSideEffect)("Mesh","getEmittedParticleSystems")),(eh=tn.prototype).getHierarchyEmittedParticleSystems??(eh.getHierarchyEmittedParticleSystems=(0,eS._MissingSideEffect)("Mesh","getHierarchyEmittedParticleSystems")),Object.getOwnPropertyDescriptor(tn.prototype,"edgesShareWithInstances")||Object.defineProperty(tn.prototype,"edgesShareWithInstances",(0,eS._MissingSideEffectProperty)("Mesh","edgesShareWithInstances")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceEnablePicking")||Object.defineProperty(tn.prototype,"thinInstanceEnablePicking",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceEnablePicking")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation")||Object.defineProperty(tn.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceAllowAutomaticStaticBufferRecreation")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceCount")||Object.defineProperty(tn.prototype,"thinInstanceCount",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceCount")),e.s(["Mesh",0,tn,"RegisterMesh",0,function(){to||(to=!0,(0,eY.RegisterClass)("BABYLON.Mesh",tn))},"_CreationDataStorage",0,class{},"_InstancesBatch",0,ti],64831)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,7263,16535,e=>{"use strict";let t,r,s,i,a,o,n,u,l,h,c,_,f,m,p,g;var x,d,T,R,C,b,y,A=e.i(19919);(0,A.RegisterMathColor)(),e.s([],16535);var W=e.i(57575),w=e.i(9855),S=e.i(3864),B=e.i(41041),E=e.i(72051),M=e.i(46533),v=e.i(20363),D=e.i(69133),G=e.i(92180);class I{constructor(e){this.name=E.SceneComponentConstants.NAME_PROCEDURALTEXTURE,this.scene=e}register(){this.scene._beforeClearStage.registerStep(E.SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)}rebuild(){}dispose(){}_beforeClear(){if(this.scene.proceduralTexturesEnabled){G.Tools.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(let e=0;e<this.scene.proceduralTextures.length;e++){let t=this.scene.proceduralTextures[e];t._shouldRender()&&t.render()}G.Tools.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}}}var O=e.i(23003),k=e.i(16771);let F=(o=v.Texture,n=[],u=[],l=[],h=[],c=[],_=[],f=[],m=[],p=[],x=class extends o{get shaderLanguage(){return this._shaderLanguage}constructor(e,t,r,s,i=null,a=!0,o=!1,g=0){super(null,s,!a),this.isEnabled=((0,W.__runInitializers)(this,n),(0,W.__runInitializers)(this,u,!0)),this.autoClear=((0,W.__runInitializers)(this,l),(0,W.__runInitializers)(this,h,!0)),this.onGenerated=(0,W.__runInitializers)(this,c),this.onGeneratedObservable=new S.Observable,this.onBeforeGenerationObservable=new S.Observable,this.nodeMaterialSource=null,this.defines="",this._generateMipMaps=(0,W.__runInitializers)(this,_,void 0),this._drawWrapper=(0,W.__runInitializers)(this,f),this._textures={},this._size=(0,W.__runInitializers)(this,m,void 0),this._textureType=(0,W.__runInitializers)(this,p),this._currentRefreshId=-1,this._frameId=-1,this._refreshRate=1,this._vertexBuffers={},this._uniforms=[],this._samplers=[],this._floats={},this._ints={},this._floatsArrays={},this._colors3={},this._colors4={},this._vectors2={},this._vectors3={},this._vectors4={},this._matrices={},this._fallbackTextureUsed=!1,this._cachedDefines=null,this._contentUpdateId=-1,this._rtWrapper=null,null===i||i instanceof v.Texture?(this._options={},this._fallbackTexture=i):(this._options=i,this._fallbackTexture=i.fallbackTexture??null),this._shaderLanguage=this._options.shaderLanguage??0;let x=(s=this.getScene()||O.EngineStore.LastCreatedScene)._getComponent(E.SceneComponentConstants.NAME_PROCEDURALTEXTURE);x||(x=new I(s),s._addComponent(x)),this._options.skipSceneRegistration||s.proceduralTextures.push(this),this._fullEngine=s.getEngine(),this.name=e,this.isRenderTarget=!0,this._size=t,this._textureType=g,this._generateMipMaps=a,this._drawWrapper=new k.DrawWrapper(this._fullEngine),this.setFragment(r);const d=this._createRtWrapper(o,t,a,g);this._texture=d.texture;const T=[];T.push(1,1),T.push(-1,1),T.push(-1,-1),T.push(1,-1),this._vertexBuffers[B.VertexBuffer.PositionKind]=new B.VertexBuffer(this._fullEngine,T,B.VertexBuffer.PositionKind,!1,!1,2),this._createIndexBuffer()}_createRtWrapper(e,t,r,s){return e?(this._rtWrapper=this._fullEngine.createRenderTargetCubeTexture(t,{generateMipMaps:r,generateDepthBuffer:!1,generateStencilBuffer:!1,type:s,...this._options}),this.setFloat("face",0)):(this._rtWrapper=this._fullEngine.createRenderTargetTexture(t,{generateMipMaps:r,generateDepthBuffer:!1,generateStencilBuffer:!1,type:s,...this._options}),this._rtWrapper.is3D&&(this.setFloat("layer",0),this.setInt("layerNum",0))),this._rtWrapper}getEffect(){return this._drawWrapper.effect}_setEffect(e){this._drawWrapper.effect=e}getContent(){return this._contentData&&this._frameId===this._contentUpdateId||(this._contentData?this._contentData.then(e=>{this._contentData=this.readPixels(0,0,e),this._contentUpdateId=this._frameId}):(this._contentData=this.readPixels(0,0),this._contentUpdateId=this._frameId)),this._contentData}_createIndexBuffer(){let e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){let e=this._vertexBuffers[B.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===D.RenderTargetTexture.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=D.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)}reset(){this._drawWrapper.effect?.dispose(),this._drawWrapper.effect=null,this._cachedDefines=null}_getDefines(){return this.defines}executeWhenReady(e){if(this.isReady())return void e(this);let t=this.getEffect();t&&t.executeWhenCompiled(()=>{e(this)})}isReady(){let t=this._fullEngine;if(this.nodeMaterialSource)return this._drawWrapper.effect?.isReady()??!1;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;if(!this._texture)return!1;let r=this._getDefines();if(this._drawWrapper.effect&&r===this._cachedDefines&&this._drawWrapper.effect.isReady())return!0;let s={vertex:"procedural",fragmentElement:this._fragment.fragmentElement,fragmentSource:this._fragment.fragmentSource,fragment:"string"==typeof this._fragment?this._fragment:void 0};return this._cachedDefines!==r&&(this._cachedDefines=r,this._drawWrapper.effect=t.createEffect(s,[B.VertexBuffer.PositionKind],this._uniforms,this._samplers,r,void 0,void 0,()=>{this._rtWrapper?.dispose(),this._rtWrapper=this._texture=null,this._fallbackTexture&&(this._texture=this._fallbackTexture._texture,this._texture&&this._texture.incrementReferences()),this._fallbackTextureUsed=!0},void 0,this._shaderLanguage,async()=>{this._options.extraInitializationsAsync?1===this.shaderLanguage?await Promise.all([e.A(3958),this._options.extraInitializationsAsync()]):await Promise.all([e.A(60264),this._options.extraInitializationsAsync()]):1===this.shaderLanguage?await e.A(3958):await e.A(60264)})),this._drawWrapper.effect.isReady()}resetRefreshCounter(){this._currentRefreshId=-1}setFragment(e){this._fragment=e}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}_shouldRender(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)}getRenderSize(){return this._size}resize(e,t){if(this._fallbackTextureUsed||!this._rtWrapper||!this._texture)return;let r=this._texture.isCube;this._rtWrapper.dispose();let s=this._createRtWrapper(r,e,t,this._textureType);this._texture=s.texture,this._size=e,this._generateMipMaps=t}_checkUniform(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)}setTexture(e,t){return -1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}render(e){let t=this.getScene();if(!t)return;let r=this._fullEngine;if(r.enableEffect(this._drawWrapper),this.onBeforeGenerationObservable.notifyObservers(this),r.setState(!1),!this.nodeMaterialSource){for(let e in this._textures)this._drawWrapper.effect.setTexture(e,this._textures[e]);for(let e in this._ints)this._drawWrapper.effect.setInt(e,this._ints[e]);for(let e in this._floats)this._drawWrapper.effect.setFloat(e,this._floats[e]);for(let e in this._floatsArrays)this._drawWrapper.effect.setArray(e,this._floatsArrays[e]);for(let e in this._colors3)this._drawWrapper.effect.setColor3(e,this._colors3[e]);for(let e in this._colors4){let t=this._colors4[e];this._drawWrapper.effect.setFloat4(e,t.r,t.g,t.b,t.a)}for(let e in this._vectors2)this._drawWrapper.effect.setVector2(e,this._vectors2[e]);for(let e in this._vectors3)this._drawWrapper.effect.setVector3(e,this._vectors3[e]);for(let e in this._vectors4)this._drawWrapper.effect.setVector4(e,this._vectors4[e]);for(let e in this._matrices)this._drawWrapper.effect.setMatrix(e,this._matrices[e])}if(!this._texture||!this._rtWrapper)return;r._enableGPUDebugMarkers&&r._debugPushGroup?.(`procedural texture generation for ${this.name}`);let s=r.currentViewport;if(this.isCube)for(let e=0;e<6;e++)r.bindFramebuffer(this._rtWrapper,e,void 0,void 0,!0),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._drawWrapper.effect.setFloat("face",e),this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(M.Material.TriangleFillMode,0,6),r.unBindFramebuffer(this._rtWrapper,!0);else{let e=1;this._rtWrapper.is3D?e=this._rtWrapper.depth:this._rtWrapper.is2DArray&&(e=this._rtWrapper.layers);for(let s=0;s<e;s++){if(r.bindFramebuffer(this._rtWrapper,0,void 0,void 0,!0,0,s),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._rtWrapper.is3D||this._rtWrapper.is2DArray)for(let t in this._drawWrapper.effect?.setFloat("layer",1!==e?s/(e-1):0),this._drawWrapper.effect?.setInt("layerNum",s),this._textures)this._drawWrapper.effect.setTexture(t,this._textures[t]);this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(M.Material.TriangleFillMode,0,6),r.unBindFramebuffer(this._rtWrapper,!this._generateMipMaps)}}s&&r.setViewport(s),this.isCube&&r.generateMipMapsForCubemap(this._texture,!0),r._enableGPUDebugMarkers&&r._debugPopGroup?.(),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}clone(){let e=this.getSize(),t=new x(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,t}dispose(){let e=this.getScene();if(!e)return;let t=e.proceduralTextures.indexOf(this);t>=0&&e.proceduralTextures.splice(t,1);let r=this._vertexBuffers[B.VertexBuffer.PositionKind];r&&(r.dispose(),this._vertexBuffers[B.VertexBuffer.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),super.dispose()}},g="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0,t=[(0,w.serialize)()],r=[(0,w.serialize)()],s=[(0,w.serialize)()],i=[(0,w.serialize)()],a=[(0,w.serialize)()],(0,W.__esDecorate)(x,null,a,{kind:"getter",name:"refreshRate",static:!1,private:!1,access:{has:e=>"refreshRate"in e,get:e=>e.refreshRate},metadata:g},null,n),(0,W.__esDecorate)(null,null,t,{kind:"field",name:"isEnabled",static:!1,private:!1,access:{has:e=>"isEnabled"in e,get:e=>e.isEnabled,set:(e,t)=>{e.isEnabled=t}},metadata:g},u,l),(0,W.__esDecorate)(null,null,r,{kind:"field",name:"autoClear",static:!1,private:!1,access:{has:e=>"autoClear"in e,get:e=>e.autoClear,set:(e,t)=>{e.autoClear=t}},metadata:g},h,c),(0,W.__esDecorate)(null,null,s,{kind:"field",name:"_generateMipMaps",static:!1,private:!1,access:{has:e=>"_generateMipMaps"in e,get:e=>e._generateMipMaps,set:(e,t)=>{e._generateMipMaps=t}},metadata:g},_,f),(0,W.__esDecorate)(null,null,i,{kind:"field",name:"_size",static:!1,private:!1,access:{has:e=>"_size"in e,get:e=>e._size,set:(e,t)=>{e._size=t}},metadata:g},m,p),g&&Object.defineProperty(x,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),x);function z(e,t,r,s){let i={texture:e,factor:t};return r&&(i.channel=r),s&&(i.colorSpace=s),i}function P(e){return e.factor??new A.Color4(1,1,1,1)}function U(e){let t=0,r=512;for(let s of e)if(s.texture){let e=s.texture.getSize(),i=Math.max(e.width,e.height);i>t&&(t=i,r=e.width===e.height?i:e)}return r}function N(e){return!e.getTextureMatrix().isIdentity()}function L(e){if(e.length<=1)return!0;let t=e[0].getTextureMatrix();for(let r=1;r<e.length;r++)if(!t.equals(e[r].getTextureMatrix()))return!1;return!0}function V(e,t,r){t.coordinatesIndex=e.coordinatesIndex,t.wrapU=e.wrapU,t.wrapV=e.wrapV,r&&(t.uOffset=e.uOffset??0,t.vOffset=e.vOffset??0,t.uScale=e.uScale??1,t.vScale=e.vScale??1,t.wAng=e.wAng??0)}function K(e){switch(e){case y.R:return"R";case y.G:return"G";case y.B:return"B";case y.A:return"A";default:return""}}function X(e){let t=[];return e&b.R||t.push("OUTPUT_MASK_R_ZERO"),e&b.G||t.push("OUTPUT_MASK_G_ZERO"),e&b.B||t.push("OUTPUT_MASK_B_ZERO"),e&b.A||t.push("OUTPUT_MASK_A_ONE"),t}function $(e,t){return new A.Color4(t&b.R?e.r:0,t&b.G?e.g:0,t&b.B?e.b:0,t&b.A?e.a:1)}function H(e,t,r){let s=[];return e.texture&&(s.push(`OPERAND_${t}_TEXTURE`),r&&N(e.texture)&&s.push(`OPERAND_${t}_MATRIX`),e.colorSpace&&s.push(`OPERAND_${t}_SRGB`),e.channel&&s.push(`OPERAND_${t}_CHANNEL_${K(e.channel)}`)),void 0===e.factor&&e.texture||s.push(`OPERAND_${t}_FACTOR`),s}function j(e,t,r,s,i){t.texture&&(e.setTexture(r,t.texture),i&&N(t.texture)&&e.setMatrix(`${r}Matrix`,t.texture.getTextureMatrix())),void 0===t.factor&&t.texture||e.setColor4(s,P(t))}function q(t,r,s,i,a=C.Linear){let o={type:0,format:5,samplingMode:2,generateDepthBuffer:!1,generateMipMaps:!1,gammaSpace:a===C.SRGB,shaderLanguage:+!!i.getEngine().isWebGPU,extraInitializationsAsync:async()=>{i.getEngine().isWebGPU?await Promise.all([e.A(11916)]):await Promise.all([e.A(98374)])},skipSceneRegistration:!0},n=new F(t,s,"textureProcessor",i,o);return n.refreshRate=-1,n.defines=r.length>0?"#define "+r.join("\n#define ")+"\n":"",n}async function Z(e){return await new Promise((t,r)=>{e.executeWhenReady(()=>{try{e.render(),t()}catch(e){r(e instanceof Error?e:Error(String(e)))}})})}async function J(e,t,r,s,i,a){if(!t.texture&&!r.texture){var o,n;let e=(o=P(t),n=P(r),new A.Color4(o.r*n.r,o.g*n.g,o.b*n.b,o.a*n.a));return{texture:null,factor:a?$(e,a):e}}let u=[];t.texture&&u.push(t.texture),r.texture&&u.push(r.texture);let l=L(u),h=!l,c=[...H(t,"A",h),...H(r,"B",h),...a?X(a):[]];i&&c.push("OUTPUT_SRGB");let _=q(e,c,U([t,r]),s,i);j(_,t,"textureA","factorA",h),j(_,r,"textureB","factorB",h);try{await Z(_)}catch(e){throw t.dispose?.(),r.dispose?.(),e}t.dispose?.(),r.dispose?.(),V(u[0],_,l);let f={texture:_,dispose:()=>_.dispose()};return i&&(f.colorSpace=i),f}async function Q(e,t,r,s,i,a,o){var n,u,l;let h;if(!t.texture&&!r.texture&&!s.texture){let e=(n=P(t),u=P(r),l=P(s),new A.Color4(n.r+(u.r-n.r)*l.r,n.g+(u.g-n.g)*l.g,n.b+(u.b-n.b)*l.b,n.a+(u.a-n.a)*l.a));return{texture:null,factor:o?$(e,o):e}}let c=[];t.texture&&c.push(t.texture),r.texture&&c.push(r.texture),s.texture&&c.push(s.texture);let _=L(c),f=!_,m=["OP_LERP",...H(t,"A",f),...H(r,"B",f),...(h=[],s.texture&&(h.push("LERP_T_TEXTURE"),f&&N(s.texture)&&h.push("LERP_T_MATRIX"),void 0!==s.factor&&h.push("LERP_T_FACTOR"),s.colorSpace&&h.push("LERP_T_SRGB"),s.channel&&h.push(`LERP_T_CHANNEL_${K(s.channel)}`)),h),...o?X(o):[]];a&&m.push("OUTPUT_SRGB");let p=q(e,m,U([t,r,s]),i,a);j(p,t,"textureA","factorA",f),j(p,r,"textureB","factorB",f),s.texture?(p.setTexture("textureT",s.texture),f&&N(s.texture)&&p.setMatrix("textureTMatrix",s.texture.getTextureMatrix()),void 0!==s.factor&&p.setColor4("factorT",s.factor)):p.setColor4("factorT",P(s));try{await Z(p)}catch(e){throw t.dispose?.(),r.dispose?.(),s.dispose?.(),e}t.dispose?.(),r.dispose?.(),s.dispose?.(),V(c[0],p,_);let g={texture:p,dispose:()=>p.dispose()};return a&&(g.colorSpace=a),g}async function Y(e,t,r,s=b.RGBA,i,a){let o;if(!t.texture){let e=P(t),r=new A.Color4(s&b.R?1-e.r:e.r,s&b.G?1-e.g:e.g,s&b.B?1-e.b:e.b,s&b.A?1-e.a:e.a);return{texture:null,factor:a?$(r,a):r}}let n=[...H(t,"A",!1),...(o=["OP_INVERT"],s&b.R&&o.push("INVERT_R"),s&b.G&&o.push("INVERT_G"),s&b.B&&o.push("INVERT_B"),s&b.A&&o.push("INVERT_A"),o),...a?X(a):[]];i&&n.push("OUTPUT_SRGB");let u=q(e,n,U([t]),r,i);j(u,t,"textureA","factorA",!1);try{await Z(u)}catch(e){throw t.dispose?.(),e}t.dispose?.(),V(t.texture,u,!0);let l={texture:u,dispose:()=>u.dispose()};return i&&(l.colorSpace=i),l}async function ee(e,t,r,s=!1,i,a){if(!t.texture){let e=P(t),r=s?Math.max(e.r,e.g,e.b,e.a):Math.max(e.r,e.g,e.b),i=new A.Color4(r,r,r,s?r:e.a);return{texture:null,factor:a?$(i,a):i}}let o=[...H(t,"A",!1),"OP_CHANNEL_MAX",...a?X(a):[]];s&&o.push("CHANNEL_MAX_INCLUDE_ALPHA"),i&&o.push("OUTPUT_SRGB");let n=q(e,o,U([t]),r,i);j(n,t,"textureA","factorA",!1);try{await Z(n)}catch(e){throw t.dispose?.(),e}t.dispose?.(),V(t.texture,n,!0);let u={texture:n,dispose:()=>n.dispose()};return i&&(u.colorSpace=i),u}async function et(e,t,r,s,i,a){if(!t.texture){let e=function(e,t){switch(t){case y.R:return new A.Color4(e.r,e.r,e.r,e.a);case y.G:return new A.Color4(e.g,e.g,e.g,e.a);case y.B:return new A.Color4(e.b,e.b,e.b,e.a);case y.A:return new A.Color4(e.a,e.a,e.a,e.a);default:return e}}(P(t),r);return{texture:null,factor:a?$(e,a):e}}return await J(e,{...t,channel:r},{texture:null,factor:new A.Color4(1,1,1,1)},s,i,a)}(d=C||(C={}))[d.Linear=0]="Linear",d[d.SRGB=1]="SRGB",(T=b||(b={}))[T.R=1]="R",T[T.G=2]="G",T[T.B=4]="B",T[T.A=8]="A",T[T.RGB=7]="RGB",T[T.RGBA=15]="RGBA",(R=y||(y={}))[R.RGBA=0]="RGBA",R[R.R=1]="R",R[R.G=2]="G",R[R.B=3]="B",R[R.A=4]="A",e.s(["OpenPBRMaterialLoadingAdapter",0,class{constructor(e){this._specWorkflow=!1,this._diffuseTransmissionTint=A.Color3.White(),this._diffuseTransmissionTintTexture=null,this._material=e}get material(){return this._material}get isUnlit(){return this._material.unlit}set isUnlit(e){this._material.unlit=e}set backFaceCulling(e){this._material.backFaceCulling=e}get backFaceCulling(){return this._material.backFaceCulling}set twoSidedLighting(e){this._material.twoSidedLighting=e}get twoSidedLighting(){return this._material.twoSidedLighting}set alphaCutOff(e){this._material.alphaCutOff=e}get alphaCutOff(){return this._material.alphaCutOff}set useAlphaFromBaseColorTexture(e){this._material._useAlphaFromBaseColorTexture=e}get useAlphaFromBaseColorTexture(){return this._material._useAlphaFromBaseColorTexture}get transparencyAsAlphaCoverage(){return!1}set transparencyAsAlphaCoverage(e){}set baseColor(e){this._material.baseColor=e}get baseColor(){return this._material.baseColor}set baseColorTexture(e){this._material.baseColorTexture=e}get baseColorTexture(){return this._material.baseColorTexture}set baseDiffuseRoughness(e){this._material.baseDiffuseRoughness=e}get baseDiffuseRoughness(){return this._material.baseDiffuseRoughness}set baseDiffuseRoughnessTexture(e){this._material.baseDiffuseRoughnessTexture=e}get baseDiffuseRoughnessTexture(){return this._material.baseDiffuseRoughnessTexture}set baseMetalness(e){this._material.baseMetalness=e}get baseMetalness(){return this._material.baseMetalness}set baseMetalnessTexture(e){this._material.baseMetalnessTexture=e}get baseMetalnessTexture(){return this._material.baseMetalnessTexture}set useRoughnessFromMetallicTextureGreen(e){this._material._useRoughnessFromMetallicTextureGreen=e}set useMetallicFromMetallicTextureBlue(e){this._material._useMetallicFromMetallicTextureBlue=e}enableSpecularEdgeColor(e=!1){}configureSpecularGlossiness(){this._specWorkflow=!0}set specularWeight(e){this._material.specularWeight=e}get specularWeight(){return this._material.specularWeight}set specularWeightTexture(e){this._material.specularColorTexture===e?(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0):this._material.specularWeightTexture=e}get specularWeightTexture(){return this._material.specularWeightTexture}set specularColor(e){this._material.specularColor=e}get specularColor(){return this._material.specularColor}set specularColorTexture(e){this._material.specularColorTexture=e,this._material.specularWeightTexture===this._material.specularColorTexture&&(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0)}get specularColorTexture(){return this._material.specularColorTexture}set specularRoughness(e){this._material.specularRoughness=e}get specularRoughness(){return this._material.specularRoughness}set specularRoughnessTexture(e){this._material.specularRoughnessTexture=e}get specularRoughnessTexture(){return this._material.specularRoughnessTexture}set specularIor(e){this._material.specularIor=e}get specularIor(){return this._material.specularIor}set glossiness(e){this._material.specularRoughness=Math.max(1-e,0)}get glossiness(){return 1-this._material.specularRoughness}set emissionColor(e){this._material.emissionColor=e}get emissionColor(){return this._material.emissionColor}set emissionLuminance(e){this._material.emissionLuminance=e}get emissionLuminance(){return this._material.emissionLuminance}set emissionColorTexture(e){this._material.emissionColorTexture=e}get emissionColorTexture(){return this._material.emissionColorTexture}set ambientOcclusionTexture(e){this._material.ambientOcclusionTexture=e}get ambientOcclusionTexture(){return this._material.ambientOcclusionTexture}set ambientOcclusionTextureStrength(e){let t=this._material.ambientOcclusionTexture;t&&(t.level=e)}get ambientOcclusionTextureStrength(){let e=this._material.ambientOcclusionTexture;return e?.level??1}configureCoat(){}set coatWeight(e){this._material.coatWeight=e}get coatWeight(){return this._material.coatWeight}set coatWeightTexture(e){this._material.coatWeightTexture=e}get coatWeightTexture(){return this._material.coatWeightTexture}set coatColor(e){this._material.coatColor=e}get coatColor(){return this._material.coatColor}set coatColorTexture(e){this._material.coatColorTexture=e}set coatRoughness(e){this._material.coatRoughness=e}get coatRoughness(){return this._material.coatRoughness}set coatRoughnessTexture(e){this._material.coatRoughnessTexture=e,e&&(this._material._useCoatRoughnessFromGreenChannel=!0)}get coatRoughnessTexture(){return this._material.coatRoughnessTexture}set coatIor(e){this._material.coatIor=e}get coatIor(){return this._material.coatIor}set coatDarkening(e){this._material.coatDarkening=e}get coatDarkening(){return this._material.coatDarkening}set coatDarkeningTexture(e){this._material.coatDarkeningTexture=e}set coatRoughnessAnisotropy(e){this._material.coatRoughnessAnisotropy=e}get coatRoughnessAnisotropy(){return this._material.coatRoughnessAnisotropy}set geometryCoatTangentAngle(e){this._material.geometryCoatTangentAngle=e}set geometryCoatTangentTexture(e){this._material.geometryCoatTangentTexture=e,e&&(this._material._useCoatRoughnessAnisotropyFromTangentTexture=!0)}get geometryCoatTangentTexture(){return this._material.geometryCoatTangentTexture}configureTransmission(){this._material.geometryThinWalled=1,this._material.transmissionDepth=0}set transmissionWeight(e){this._material.transmissionWeight=e}set transmissionWeightTexture(e){this._material.transmissionWeightTexture=e}get transmissionWeightTexture(){return this._material.transmissionWeightTexture}get transmissionWeight(){return this._material.transmissionWeight}set transmissionScatter(e){this._material.transmissionScatter=e}get transmissionScatter(){return this._material.transmissionScatter}set transmissionScatterTexture(e){this._material.transmissionScatterTexture=e}get transmissionScatterTexture(){return this._material.transmissionScatterTexture}set transmissionScatterAnisotropy(e){this._material.transmissionScatterAnisotropy=e}set transmissionDispersionAbbeNumber(e){this._material.transmissionDispersionAbbeNumber=e}set transmissionDispersionScale(e){this._material.transmissionDispersionScale=e}set transmissionDepth(e){e!==Number.MAX_VALUE||0!==this._material.transmissionDepth?this._material.transmissionDepth=e:this._material.transmissionDepth=0}get transmissionDepth(){return this._material.transmissionDepth}set transmissionColor(e){e.equals(A.Color3.White())||(this._material.transmissionColor=e)}get transmissionColor(){return this._material.transmissionColor}get refractionBackgroundTexture(){return this._material.backgroundRefractionTexture}set refractionBackgroundTexture(e){this._material.backgroundRefractionTexture=e}configureVolume(){this._material.geometryThinWalled=0}set geometryThinWalled(e){this._material.geometryThinWalled=+!!e}get geometryThinWalled(){return!!this._material.geometryThinWalled}set volumeThicknessTexture(e){this._material.geometryThicknessTexture=e,this._material._useGeometryThicknessFromGreenChannel=!0}set volumeThickness(e){this._material.geometryThickness=e}configureSubsurface(){this._material.geometryThinWalled=1,this._material.subsurfaceScatterAnisotropy=1}set subsurfaceWeight(e){this._material.subsurfaceWeight=e}get subsurfaceWeight(){return this._material.subsurfaceWeight}set subsurfaceWeightTexture(e){this._material.subsurfaceWeightTexture=e,this._material._useSubsurfaceWeightFromTextureAlpha=!0}get subsurfaceWeightTexture(){return this._material.subsurfaceWeightTexture}set subsurfaceColor(e){this._material.subsurfaceColor=e}set subsurfaceColorTexture(e){this._material.subsurfaceColorTexture=e}set diffuseTransmissionTint(e){this._diffuseTransmissionTint=e}get diffuseTransmissionTint(){return this._diffuseTransmissionTint}set diffuseTransmissionTintTexture(e){this._diffuseTransmissionTintTexture=e}get subsurfaceRadius(){return this._material.subsurfaceRadius}set subsurfaceRadius(e){this._material.subsurfaceRadius=e}get subsurfaceRadiusScale(){return this._material.subsurfaceRadiusScale}set subsurfaceRadiusScale(e){this._material.subsurfaceRadiusScale=e}set subsurfaceScatterAnisotropy(e){this._material.subsurfaceScatterAnisotropy=e}isTranslucent(){return this.transmissionWeight>0||this.subsurfaceWeight>0}configureFuzz(){}set fuzzWeight(e){this._material.fuzzWeight=e}set fuzzWeightTexture(e){this._material.fuzzWeightTexture=e}set fuzzColor(e){this._material.fuzzColor=e}set fuzzColorTexture(e){this._material.fuzzColorTexture=e}set fuzzRoughness(e){this._material.fuzzRoughness=e}set fuzzRoughnessTexture(e){this._material.fuzzRoughnessTexture=e,this._material._useFuzzRoughnessFromTextureAlpha=!0}set specularRoughnessAnisotropy(e){this._material.specularRoughnessAnisotropy=e}get specularRoughnessAnisotropy(){return this._material.specularRoughnessAnisotropy}set geometryTangentAngle(e){this._material.geometryTangentAngle=e}set geometryTangentTexture(e){this._material.geometryTangentTexture=e,this._material._useSpecularRoughnessAnisotropyFromTangentTexture=!0}get geometryTangentTexture(){return this._material.geometryTangentTexture}configureGltfStyleAnisotropy(e=!0){this._material._useGltfStyleAnisotropy=e}set thinFilmWeight(e){this._material.thinFilmWeight=e}set thinFilmIor(e){this._material.thinFilmIor=e}set thinFilmThicknessMinimum(e){this._material.thinFilmThicknessMin=e/1e3}set thinFilmThicknessMaximum(e){this._material.thinFilmThickness=e/1e3}set thinFilmWeightTexture(e){this._material.thinFilmWeightTexture=e}set thinFilmThicknessTexture(e){this._material.thinFilmThicknessTexture=e,this._material._useThinFilmThicknessFromTextureGreen=!0}set unlit(e){this._material.unlit=e}set geometryOpacity(e){this._material.geometryOpacity=e}get geometryOpacity(){return this._material.geometryOpacity}set geometryNormalTexture(e){this._material.geometryNormalTexture=e}get geometryNormalTexture(){return this._material.geometryNormalTexture}setNormalMapInversions(e,t){}set geometryCoatNormalTexture(e){this._material.geometryCoatNormalTexture=e}get geometryCoatNormalTexture(){return this._material.geometryCoatNormalTexture}set geometryCoatNormalTextureScale(e){this._material.geometryCoatNormalTexture&&(this._material.geometryCoatNormalTexture.level=e)}async finalizeAsync(e){if(this._diffuseTransmissionTint&&!this._diffuseTransmissionTint.equals(A.Color3.White())||this._diffuseTransmissionTintTexture){if(this._material.geometryThinWalled)this.subsurfaceColor=this._diffuseTransmissionTint,this.subsurfaceColorTexture=this._diffuseTransmissionTintTexture;else if(await this.copySurfaceToCoatAsync(e,this.subsurfaceWeight,this.subsurfaceWeightTexture,y.A,this._diffuseTransmissionTint,this._diffuseTransmissionTintTexture,!0),e._disposed)return}if(this.transmissionWeight>0){if(this._material.geometryThinWalled||0===this._material.transmissionDepth)this._material.transmissionColor=this._material.baseColor,this._material.transmissionColorTexture=this._material.baseColorTexture;else if((!this.baseColor.equals(A.Color3.White())||null!==this.baseColorTexture)&&(await this.copySurfaceToCoatAsync(e,this.transmissionWeight,this.transmissionWeightTexture,y.R,this.baseColor,this.baseColorTexture,!1),e._disposed))return}if(this._specWorkflow){let t=await Y("newRoughnessTexture ("+this._material.name+")",await et("glossiness ("+this._material.name+")",z(this.specularColorTexture,new A.Color4(this.specularColor.r,this.specularColor.g,this.specularColor.b,this.glossiness),y.A,C.Linear),y.A,this._material.getScene(),C.Linear,b.R),this._material.getScene(),b.R,C.Linear,b.R);if(e._disposed)return void t.texture?.dispose();this.specularRoughnessTexture=t.texture,this.specularRoughness=t.factor?t.factor.r:1;let r=await ee("metallicTexture ("+this._material.name+")",z(this.specularColorTexture,this.specularColor.toColor4(),y.RGBA,C.Linear),this._material.getScene(),!1,C.SRGB,b.RGB);if(e._disposed)return void r.texture?.dispose();this.baseMetalnessTexture=r.texture,this.baseMetalness=r.factor?r.factor.r:1;let s=await Q("newBaseColor ("+this._material.name+")",z(this.baseColorTexture,this.baseColor.toColor4(),y.RGBA,C.Linear),z(this.specularColorTexture,this.specularColor.toColor4(),y.RGBA,C.Linear),{...r,dispose:void 0,colorSpace:C.Linear},this._material.getScene(),C.SRGB,b.RGB);if(e._disposed)return void s.texture?.dispose();let i=this.baseColorTexture;i?.dispose(),this.baseColorTexture=s.texture,this.baseColor=s.factor?new A.Color3(s.factor.r,s.factor.g,s.factor.b):A.Color3.White();let a=this.specularColorTexture;a?.dispose(),this.specularColorTexture=null}}async copySurfaceToCoatAsync(e,t,r,s,i,a,o=!1){let n=this._material.coatWeight,u=this._material.coatWeightTexture,l=this._material.coatColor.clone(),h=this._material.coatColorTexture,c=this._material.geometryCoatNormalTexture,_=new A.Color4(n,n,n,n),f=new A.Color4(t,t,t,t);this.coatWeightTexture=null,this.coatWeight=1;let m=await Promise.allSettled([Q("lerpExistingCoat",z(null,new A.Color4(1,1,1,1)),z(h,l.toColor4(),y.RGBA,C.SRGB),z(u,_,y.R),this._material.getScene(),C.SRGB),Q("lerpSurfaceColor",z(null,new A.Color4(1,1,1,1)),z(a,i.toColor4(),y.RGBA,C.SRGB),z(r,f,s),this._material.getScene(),C.SRGB)]),p=m.find(e=>"rejected"===e.status);if(p){for(let e of m)"fulfilled"===e.status&&e.value.texture?.dispose();throw p.reason}let[g,x]=m.map(e=>e.value);if(e._disposed){g.texture?.dispose(),x.texture?.dispose();return}let d=await J("newCoatColor ("+this._material.name+")",g,x,this._material.getScene(),C.SRGB);if(e._disposed)return void d.texture?.dispose();d.texture?(this.coatColorTexture=d.texture,this.coatColor=A.Color3.White()):d.factor&&(this.coatColorTexture=null,this.coatColor.fromArray([d.factor.r,d.factor.g,d.factor.b]));let T=await Q("newCoatIor ("+this._material.name+")",z(null,new A.Color4(this._material.specularIor,this._material.specularIor,this._material.specularIor,1),y.R),z(null,new A.Color4(this.coatIor,this.coatIor,this.coatIor,1),y.R),z(u,_,y.R),this._material.getScene());if(e._disposed)return void T.texture?.dispose();this.coatIor=T.factor?T.factor.r:this.coatIor;let R=await Q("newCoatRoughness ("+this._material.name+")",z(this.specularRoughnessTexture,new A.Color4(this.specularRoughness,this.specularRoughness,this.specularRoughness,1),y.G),z(this.coatRoughnessTexture,new A.Color4(this.coatRoughness,this.coatRoughness,this.coatRoughness,1),y.G),z(u,_,y.R),this._material.getScene());if(e._disposed)return void R.texture?.dispose();this.coatRoughness=R.factor?R.factor.r:1,this.coatRoughnessTexture=R.texture;let b=await Q("newCoatDarkening ("+this._material.name+")",z(null,new A.Color4(0,0,0,1),y.R),z(null,new A.Color4(this.coatDarkening,this.coatDarkening,this.coatDarkening,1),y.R),z(u,_,y.R),this._material.getScene());if(e._disposed)return void b.texture?.dispose();if(this.coatDarkening=b.factor?b.factor.r:this.coatDarkening,o){let t=await Q("newSpecularRoughness ("+this._material.name+")",z(this.specularRoughnessTexture,new A.Color4(this._material.specularRoughness,this._material.specularRoughness,this._material.specularRoughness,1),y.G),z(null,new A.Color4(1,1,1,1),y.R),z(r,f,s),this._material.getScene());if(e._disposed)return void t.texture?.dispose();this.specularRoughness=t.factor?t.factor.r:1,this.specularRoughnessTexture=t.texture}if(c||this.geometryNormalTexture){let t=await Q("newCoatNormal ("+this._material.name+")",z(this.geometryNormalTexture,this.geometryNormalTexture?new A.Color4(1,1,1,1):new A.Color4(.5,.5,1,1),y.RGBA),z(c,c?new A.Color4(1,1,1,1):new A.Color4(.5,.5,1,1),y.RGBA),z(u,_,y.R),this._material.getScene());if(e._disposed)return void t.texture?.dispose();t.texture&&(this.geometryCoatNormalTexture=t.texture)}}}],7263)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47951,e=>{"use strict";var t=e.i(78992),n=e.i(44520);class c extends t.FlowGraphEventBlock{constructor(){super(...arguments),this.initPriority=-1,this.type="SceneReady"}_executeEvent(e,t){return this._execute(e),!0}_preparePendingTasks(e){}_cancelPendingTasks(e){}getClassName(){return"FlowGraphSceneReadyEventBlock"}}let s=!1;function r(){s||(s=!0,(0,n.RegisterClass)("FlowGraphSceneReadyEventBlock",c))}e.s(["FlowGraphSceneReadyEventBlock",0,c,"RegisterFlowGraphSceneReadyEventBlock",0,r],56910),r(),e.s([],2847),e.i(2847),e.i(56910),e.s(["FlowGraphSceneReadyEventBlock",0,c],47951)}]);