@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
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,45335,64610,51070,10609,e=>{"use strict";let t,i,r,n,s,a,o,l,h,c,u,d,_,f;var g,m=e.i(73403),p=e.i(5207),T=e.i(32866),I=e.i(56173),E=e.i(33491),y=e.i(93663);class M{constructor(e,t,i){this._cameraPosition=t,this._behavior=i,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new I.Vector3,this.rotationAccumulatedPixels=new I.Vector3,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=I.Vector3.Zero(),this.rotationDeltaCurrentFrame=I.Vector3.Zero(),this._zoomVelocity=0,this._panVelocity=new I.Vector3,this.referenceFrameRate=60,this._rotationVelocity=new I.Vector3,this._prevFrameTimeMs=0,this._scene=e}computeCurrentFrameDeltas(){let e=this._scene.getEngine().getDeltaTime(),t=this._getEffectiveDeltaMs(e);if(0===this._zoomVelocity&&0===this.zoomAccumulatedPixels&&0===this._panVelocity.x&&0===this._panVelocity.y&&0===this._panVelocity.z&&0===this.panAccumulatedPixels.x&&0===this.panAccumulatedPixels.y&&0===this.panAccumulatedPixels.z&&0===this._rotationVelocity.x&&0===this._rotationVelocity.y&&0===this._rotationVelocity.z&&0===this.rotationAccumulatedPixels.x&&0===this.rotationAccumulatedPixels.y&&0===this.rotationAccumulatedPixels.z&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,e>0&&(this._prevFrameTimeMs=e);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||0!==this.zoomAccumulatedPixels)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*t,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*t,this._rotationVelocity.y*this.speed*this.rotationYSpeed*t,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*t,e>0&&(this._prevFrameTimeMs=e),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(e){let t=this._scene.getEngine().getDeltaTime();return Math.pow(e,this._getEffectiveDeltaMs(t)/(1e3/this.referenceFrameRate))}getFrameIndependentInputScale(e){let t=1-e;return t<=0?1:(1-this.getFrameIndependentDecay(e))/t}_getEffectiveDeltaMs(e){return e>0?e:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(e,t,i){let r=e,n=this._scene.getEngine().getDeltaTime(),s=this._getEffectiveDeltaMs(n);if(0===s)return r;let a=this.getFrameIndependentDecay(i);if(r*=a,0!==t||this.activeInput){let e=1-i;r+=t/s*(e>0?(1-a)/e:1)}else 1e-6>Math.abs(r)&&(r=0);return r}}e.s(["CameraMovement",0,M],64610);class S{constructor(e,t){this.inputMap=[],this.handlers=e,this._createDefaultEntries=t,this.resetInputMap()}resolveInteraction(e,t){for(let i of this.inputMap)if(i.source===e&&this._entryMatches(i,t))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(e,t,i){let r=this.inputMap;for(let n=0;n<r.length;n++){let s=r[n];if(s.source===e&&s.interaction===t&&this._entryConditionsMatch(s,i))return s}}getEntries(e,t,i){let r=[],n=this.inputMap;for(let s=0;s<n.length;s++){let a=n[s];a.source===e&&a.interaction===t&&this._entryConditionsMatch(a,i)&&r.push(a)}return r}addEntry(e){let t=this._entrySpecificity(e),i=this.inputMap.length;for(let e=0;e<this.inputMap.length;e++)if(this._entrySpecificity(this.inputMap[e])<t){i=e;break}this.inputMap.splice(i,0,e)}setInteraction(e,t,i){let r=this.resolveInteraction(e,t);return r&&this._entryCoversAllConditionsOf(r,t)?r.interaction=i:this.addEntry({source:e,...t??{},interaction:i}),!0}_entryCoversAllConditionsOf(e,t){if(!t)return!0;for(let i of Object.keys(t)){let r=t[i];if(void 0!==r){if("modifiers"===i){let t=e.modifiers??{};for(let e of Object.keys(r))if(void 0!==r[e]&&void 0===t[e])return!1}else if(void 0===e[i])return!1}}return!0}setInteractions(e,t,i){let r=0,n=this.inputMap;for(let s=0;s<n.length;s++){let a=n[s];a.source===e&&this._entryMatches(a,t)&&(a.interaction=i,r++)}return r}_entryMatches(e,t){switch(e.source){case"pointer":if(void 0!==e.button&&e.button!==t?.button)return!1;return this._matchModifiers(e.modifiers,t?.modifiers);case"wheel":return this._matchModifiers(e.modifiers,t?.modifiers);case"touch":if(void 0!==e.touchCount&&e.touchCount!==t?.touchCount)return!1;return!0;case"keyboard":if(void 0!==e.key&&(Array.isArray(e.key)?-1===e.key.indexOf(t?.key??-1):e.key!==t?.key))return!1;return this._matchModifiers(e.modifiers,t?.modifiers)}}_entryConditionsMatch(e,t){if(!t)return!0;switch(e.source){case"pointer":if("button"in t&&e.button!==t.button)return!1;return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"wheel":return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"touch":return!("touchCount"in t)||e.touchCount===t.touchCount;case"keyboard":if("key"in t){if(void 0===e.key)return void 0===t.key;if(void 0===t.key||(Array.isArray(e.key)?-1===e.key.indexOf(t.key):e.key!==t.key))return!1}return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers)}}_entrySpecificity(e){let t=0;return"button"in e&&void 0!==e.button&&t++,"key"in e&&void 0!==e.key&&t++,"touchCount"in e&&void 0!==e.touchCount&&t++,"modifiers"in e&&e.modifiers&&t++,t}_matchModifiers(e,t){return!e||(void 0===e.ctrl||e.ctrl===(t?.ctrl??!1))&&(void 0===e.shift||e.shift===(t?.shift??!1))&&(void 0===e.alt||e.alt===(t?.alt??!1))}_entryModifiersMatch(e,t){return t?void 0===t.ctrl&&void 0===t.shift&&void 0===t.alt?!e||void 0===e.ctrl&&void 0===e.shift&&void 0===e.alt:(void 0===t.ctrl||e?.ctrl===t.ctrl)&&(void 0===t.shift||e?.shift===t.shift)&&(void 0===t.alt||e?.alt===t.alt):!e}}e.s(["InputMapper",0,S],51070);class x extends M{constructor(e,t,i){super(e,t,i),this.input=new S({translate:(e,t,i)=>{this.panAccumulatedPixels.x+=e,this.panAccumulatedPixels.y+=t,this.panAccumulatedPixels.z+=i},rotate:(e,t)=>{this.rotationAccumulatedPixels.x+=e,this.rotationAccumulatedPixels.y+=t}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}let A=I.Matrix.Zero(),R=I.Quaternion.Identity(),D=(s=T.Camera,a=[],o=[],l=[],h=[],c=[],u=[],d=[],_=[],g=class extends s{get inertia(){return this._targetInertia}set inertia(e){this._targetInertia=e,this.movement&&(this.movement.panInertia=e,this.movement.rotationInertia=e)}constructor(e,t,i,r=!0){super(e,t,i,r),this.cameraDirection=new I.Vector3(0,0,0),this.cameraRotation=new I.Vector2(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=(0,m.__runInitializers)(this,a,!1),this.rotation=((0,m.__runInitializers)(this,o),(0,m.__runInitializers)(this,l,void 0)),this.rotationQuaternion=(0,m.__runInitializers)(this,h),this.speed=(0,m.__runInitializers)(this,c,2),this.noRotationConstraint=((0,m.__runInitializers)(this,u),!1),this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=E.Epsilon,this._rotationEpsilon=E.Epsilon,this.lockedTarget=(0,m.__runInitializers)(this,d,null),this._currentTarget=((0,m.__runInitializers)(this,_),I.Vector3.Zero()),this._initialFocalDistance=1,this._viewMatrix=I.Matrix.Zero(),this._cameraTransformMatrix=I.Matrix.Zero(),this._cameraRotationMatrix=I.Matrix.Zero(),this._transformedReferencePoint=I.Vector3.Zero(),this._deferredPositionUpdate=new I.Vector3,this._deferredRotationQuaternionUpdate=new I.Quaternion,this._deferredRotationUpdate=new I.Vector3,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=I.Vector3.Forward(this.getScene().useRightHandedSystem),this.rotation=new I.Vector3(0,this.getScene().useRightHandedSystem?Math.PI:0,0),this.movement=new x(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(e){this.getWorldMatrix();let t=I.TmpVectors.Vector3[0],i=I.TmpVectors.Vector3[1];return i.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(i,t),t.scaleInPlace(e),this.globalPosition.add(t)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){let e=this.lockedTarget;e.computeWorldMatrix().getTranslationToRef(e.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return!!super._restoreStateValues()&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)}_initCache(){super._initCache(),this._cache.lockedTarget=new I.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new I.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new I.Quaternion(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(e){e||super._updateCache();let t=this._getLockedTargetPosition();t?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(t):this._cache.lockedTarget=t.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;let e=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(e):!e)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){let e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(100*e.getFps()))}setTarget(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=E.Epsilon),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?I.Matrix.LookAtRHToRef(this.position,e,I.Vector3.UpReadOnly,A):I.Matrix.LookAtLHToRef(this.position,e,I.Vector3.UpReadOnly,A),A.invert();let t=this.rotationQuaternion||R;I.Quaternion.FromRotationMatrixToRef(A,t),t.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(I.TmpVectors.Matrix[0]),I.Vector3.TransformNormalToRef(this.cameraDirection,I.TmpVectors.Matrix[0],I.TmpVectors.Vector3[0]),this._deferredPositionUpdate.addInPlace(I.TmpVectors.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){let e=this.movement,t=0!==this.cameraDirection.x||0!==this.cameraDirection.y||0!==this.cameraDirection.z;e.panAccumulatedPixels.addInPlace(this.cameraDirection),e.rotationAccumulatedPixels.x+=this.cameraRotation.x,e.rotationAccumulatedPixels.y+=this.cameraRotation.y,e.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(e.panDeltaCurrentFrame),this.cameraRotation.set(e.rotationDeltaCurrentFrame.x,e.rotationDeltaCurrentFrame.y);let i=this.speed*this._panningEpsilon;!t&&Math.abs(this.cameraDirection.x)<i&&Math.abs(this.cameraDirection.y)<i&&Math.abs(this.cameraDirection.z)<i&&(this.cameraDirection.setAll(0),e.resetPanVelocity());let r=this.invertRotation?-this.inverseRotationSpeed:1,n=this._decideIfNeedsToMove(),s=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),n&&this._updatePosition(),s&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*r,this._deferredRotationUpdate.y+=this.cameraRotation.y*r,!this.noRotationConstraint&&(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(I.Quaternion.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):I.Matrix.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return I.Vector3.TransformNormalToRef(I.Vector3.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),I.Vector3.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?y.Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(I.Quaternion.FromEulerVectorToRef(this.rotation,R),y.Axis.Y.rotateByQuaternionToRef(R,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(e,t,i){if(this.getScene().useRightHandedSystem?I.Matrix.LookAtRHToRef(e,t,i,this._viewMatrix):I.Matrix.LookAtLHToRef(e,t,i,this._viewMatrix),this.parent){let e=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(e,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(e,t){if(this.cameraRigMode!==T.Camera.RIG_MODE_NONE){let t=new g(e,this.position.clone(),this.getScene());return t.isRigCamera=!0,t.rigParent=this,this.cameraRigMode===T.Camera.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new I.Quaternion),t._cameraRigParams={},t.rotationQuaternion=new I.Quaternion),t.mode=this.mode,t.orthoLeft=this.orthoLeft,t.orthoRight=this.orthoRight,t.orthoTop=this.orthoTop,t.orthoBottom=this.orthoBottom,t}return null}_updateRigCameras(){let e=this._rigCameras[0],t=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case T.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case T.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case T.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case T.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case T.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:{let i=this.cameraRigMode===T.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,r=this.cameraRigMode===T.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*i,e),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*r,t);break}case T.Camera.RIG_MODE_VR:e.rotationQuaternion&&t.rotationQuaternion&&this.rotationQuaternion?(e.rotationQuaternion.copyFrom(this.rotationQuaternion),t.rotationQuaternion.copyFrom(this.rotationQuaternion)):(e.rotation.copyFrom(this.rotation),t.rotation.copyFrom(this.rotation)),e.position.copyFrom(this.position),t.position.copyFrom(this.position)}super._updateRigCameras()}_getRigCamPositionAndTarget(e,t){this.getTarget().subtractToRef(this.position,g._TargetFocalPoint),g._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);let i=g._TargetFocalPoint.addInPlace(this.position);I.Matrix.TranslationToRef(-i.x,-i.y,-i.z,g._TargetTransformMatrix),g._TargetTransformMatrix.multiplyToRef(I.Matrix.RotationAxis(t.upVector,e),g._RigCamTransformMatrix),I.Matrix.TranslationToRef(i.x,i.y,i.z,g._TargetTransformMatrix),g._RigCamTransformMatrix.multiplyToRef(g._TargetTransformMatrix,g._RigCamTransformMatrix),I.Vector3.TransformCoordinatesToRef(this.position,g._RigCamTransformMatrix,t.position),t.setTarget(i)}getClassName(){return"TargetCamera"}},f="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0,t=[(0,p.serialize)()],i=[(0,p.serializeAsVector3)()],r=[(0,p.serialize)()],n=[(0,p.serializeAsMeshReference)("lockedTargetId")],(0,m.__esDecorate)(null,null,t,{kind:"field",name:"updateUpVectorFromRotation",static:!1,private:!1,access:{has:e=>"updateUpVectorFromRotation"in e,get:e=>e.updateUpVectorFromRotation,set:(e,t)=>{e.updateUpVectorFromRotation=t}},metadata:f},a,o),(0,m.__esDecorate)(null,null,i,{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:f},l,h),(0,m.__esDecorate)(null,null,r,{kind:"field",name:"speed",static:!1,private:!1,access:{has:e=>"speed"in e,get:e=>e.speed,set:(e,t)=>{e.speed=t}},metadata:f},c,u),(0,m.__esDecorate)(null,null,n,{kind:"field",name:"lockedTarget",static:!1,private:!1,access:{has:e=>"lockedTarget"in e,get:e=>e.lockedTarget,set:(e,t)=>{e.lockedTarget=t}},metadata:f},d,_),f&&Object.defineProperty(g,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),g._RigCamTransformMatrix=new I.Matrix,g._TargetTransformMatrix=new I.Matrix,g._TargetFocalPoint=new I.Vector3,g);e.s(["TargetCamera",0,D],45335);var C=e.i(8697),L=e.i(69552),b={};e.s(["CameraInputTypes",0,b,"CameraInputsManager",0,class{constructor(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){let t=e.getSimpleName();this.attached[t]?C.Logger.Warn("camera input of type "+t+" already exists on camera"):(this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault))}remove(e){for(let t in this.attached){let i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(let t in this.attached){let i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){let t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement)for(let t in e=!T.Camera.ForceAttachControlToAlwaysPreventDefault&&e,this.attachedToElement=!0,this.noPreventDefault=e,this.attached)this.attached[t].attachControl(e)}detachElement(e=!1){for(let t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){for(let e in this.checkInputs=()=>{},this.attached){let t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){let t={};for(let e in this.attached){let i=this.attached[e],r=L.SerializationHelper.Serialize(i);t[i.getClassName()]=r}e.inputsmgr=t}parse(e){let t=e.inputsmgr;if(t)for(let e in this.clear(),t){let i=b[e];if(i){let r=t[e],n=L.SerializationHelper.Parse(()=>new i,r,null);this.add(n)}}else for(let t in this.attached){let i=b[this.attached[t].getClassName()];if(i){let r=L.SerializationHelper.Parse(()=>new i,e,null);this.remove(this.attached[t]),this.add(r)}}}}],10609)},6363,e=>{"use strict";var t=e.i(18405);let i=!1;e.s(["RegisterAbstractEngineDom",0,function(){i||(i=!0,t.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},t.AbstractEngine.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},t.AbstractEngine.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},t.AbstractEngine.prototype.getAspectRatio=function(e,t=!1){let i=e.viewport;return this.getRenderWidth(t)*i.width/(this.getRenderHeight(t)*i.height)},t.AbstractEngine.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},t.AbstractEngine.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}])},27239,e=>{"use strict";var t=e.i(58724),i=e.i(71829),r=e.i(476),n=e.i(90138),s=e.i(81712),a=e.i(8697),o=e.i(27217),l=e.i(18405),h=e.i(64950),c=e.i(76846),u=e.i(89435),d=e.i(6363),_=e.i(38080);class f extends r.ThinEngine{static get NpmPackage(){return l.AbstractEngine.NpmPackage}static get Version(){return l.AbstractEngine.Version}static get Instances(){return i.EngineStore.Instances}static get LastCreatedEngine(){return i.EngineStore.LastCreatedEngine}static get LastCreatedScene(){return i.EngineStore.LastCreatedScene}static DefaultLoadingScreenFactory(e){return l.AbstractEngine.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!f._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,i,r=!1){if((0,d.RegisterAbstractEngineDom)(),(0,_.RegisterAbstractEngineRenderPass)(),super(e,t,i,r),this._performanceMonitor=new n.PerformanceMonitor,this._drawCalls=new c.PerfCounter,!e)return;this._features.supportRenderPasses=!0}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),(0,h._CommonInit)(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){return(0,h.ResizeImageBitmap)(this,e,t,i)}async _createImageBitmapFromSource(e,t){return await (0,h.CreateImageBitmapFromSource)(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){!this.isFullscreen&&(this._pointerLockRequested=e,this._renderingCanvas&&(0,h.RequestFullscreen)(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&(0,h.ExitFullscreen)()}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,i,r){let n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,r),n}scissorClear(e,t,i,r,n){this.enableScissor(e,t,i,r),this.clear(n,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(let e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(let e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return(0,h.GetFontOffset)(e)}enterPointerlock(){this._renderingCanvas&&(0,h.RequestPointerlock)(this._renderingCanvas)}exitPointerlock(){(0,h.ExitPointerlock)()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){e&&e.program&&e.transformFeedback&&(this.deleteTransformFeedback(e.transformFeedback),e.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,r,n,s=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);let a=super.createShaderProgram(e,t,i,r,n,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),a}_createShaderProgram(e,t,i,r,n=null){let s=r.createProgram();if(e.program=s,!s)throw Error("Unable to create program");if(r.attachShader(s,t),r.attachShader(s,i),this.webGLVersion>1&&n){let t=this.createTransformFeedback();this.bindTransformFeedback(t),this.setTranformFeedbackVaryings(s,n),e.transformFeedback=t}return r.linkProgram(s),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=r,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),s}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){for(let t of(super._releaseRenderTargetWrapper(e),this.scenes)){for(let i of t.postProcesses)i._outputTexture===e&&(i._outputTexture=null);for(let i of t.cameras)for(let t of i._postProcesses)t&&t._outputTexture===e&&(t._outputTexture=null)}}_rescaleTexture(e,t,i,r,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);let s=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&f._RescalePostProcessFactory&&(this._rescalePostProcess=f._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;let a=()=>{this._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};let a=i;a||(a=this.scenes[this.scenes.length-1]),a.postProcessManager.directRender([this._rescalePostProcess],s,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,r,0,0,t.width,t.height,0),this.unBindFramebuffer(s),s.dispose(),n&&n()},o=this._rescalePostProcess.getEffect();o?o.executeWhenCompiled(a):this._rescalePostProcess.onEffectCreatedObservable.addOnce(e=>{e.executeWhenCompiled(a)})}}wrapWebGLTexture(e,i=!1,r=3,n=0,s=0){let a=new o.WebGLHardwareTexture(e,this._gl),l=new t.InternalTexture(this,15,!0);return l._hardwareTexture=a,l.baseWidth=n,l.baseHeight=s,l.width=n,l.height=s,l.isReady=!0,l.useMipMaps=i,this.updateTextureSamplingMode(r,l),l}updateWrappedWebGLTexture(e,t){if(15!==e.source)throw Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(let t of this._renderTargetWrapperCache)if(t.textures?.includes(e)){if(t.isMulti)throw Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(t._depthStencilTexture)throw Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}for(let i in e._hardwareTexture=new o.WebGLHardwareTexture(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null,this._boundTexturesCache)this._boundTexturesCache[i]===e&&(this._boundTexturesCache[i]=null);this.updateTextureSamplingMode(e.samplingMode,e);let i=this._gl;for(let r of this._renderTargetWrapperCache){if(r.texture!==e)continue;let n=r.samples,s=n>1;r._framebuffer&&i.deleteFramebuffer(r._framebuffer),!s&&r._depthStencilBuffer&&(i.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null);let a=this._currentFramebuffer,o=i.createFramebuffer();this._bindUnboundFramebuffer(o),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),s||(r._depthStencilBuffer=this._setupFramebufferDepthAttachments(r._generateStencilBuffer,r._generateDepthBuffer,r.width,r.height)),this._bindUnboundFramebuffer(a),r._framebuffer=o,s&&(r._samples=1,this.updateRenderTargetTextureSampleCount(r,n))}}_uploadImageToTexture(e,t,i=0,r=0){let n=this._gl,s=this._getWebGLTextureType(e.type),a=this._getInternalFormat(e.format),o=this._getRGBABufferInternalSizedFormat(e.type,a),l=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(l,e,!0),this._unpackFlipY(e.invertY);let h=n.TEXTURE_2D;e.isCube&&(h=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(h,r,o,a,s,t),this._bindTextureDirectly(l,null,!0)}updateTextureComparisonFunction(e,t){if(1===this.webGLVersion)return void a.Logger.Error("WebGL 1 does not support texture comparison.");let i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){let t=this._gl.createBuffer();if(!t)throw Error("Unable to create instance buffer");let i=new s.WebGLDataBuffer(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,i=10){let r=this._gl;return await new Promise((n,s)=>{(0,u._RetryWithInterval)(()=>{let i=r.clientWaitSync(e,t,0);if(i==r.WAIT_FAILED)throw Error("clientWaitSync failed");return i!=r.TIMEOUT_EXPIRED},n,s,i)})}_readPixelsAsync(e,t,i,r,n,s,a){if(this._webGLVersion<2)throw Error("_readPixelsAsync only work on WebGL2+");let o=this._gl,l=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,l),o.bufferData(o.PIXEL_PACK_BUFFER,a.byteLength,o.STREAM_READ),o.readPixels(e,t,i,r,n,s,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null);let h=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);return h?(o.flush(),this._clientWaitAsync(h,0,10).then(()=>(o.deleteSync(h),o.bindBuffer(o.PIXEL_PACK_BUFFER,l),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,a),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteBuffer(l),a))):null}dispose(){this.hideLoadingUI?.(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),(0,h._CommonDispose)(this,this._renderingCanvas),super.dispose()}}f.ALPHA_DISABLE=0,f.ALPHA_ADD=1,f.ALPHA_COMBINE=2,f.ALPHA_SUBTRACT=3,f.ALPHA_MULTIPLY=4,f.ALPHA_MAXIMIZED=5,f.ALPHA_ONEONE=6,f.ALPHA_PREMULTIPLIED=7,f.ALPHA_PREMULTIPLIED_PORTERDUFF=8,f.ALPHA_INTERPOLATE=9,f.ALPHA_SCREENMODE=10,f.DELAYLOADSTATE_NONE=0,f.DELAYLOADSTATE_LOADED=1,f.DELAYLOADSTATE_LOADING=2,f.DELAYLOADSTATE_NOTLOADED=4,f.NEVER=512,f.ALWAYS=519,f.LESS=513,f.EQUAL=514,f.LEQUAL=515,f.GREATER=516,f.GEQUAL=518,f.NOTEQUAL=517,f.KEEP=7680,f.REPLACE=7681,f.INCR=7682,f.DECR=7683,f.INVERT=5386,f.INCR_WRAP=34055,f.DECR_WRAP=34056,f.TEXTURE_CLAMP_ADDRESSMODE=0,f.TEXTURE_WRAP_ADDRESSMODE=1,f.TEXTURE_MIRROR_ADDRESSMODE=2,f.TEXTUREFORMAT_ALPHA=0,f.TEXTUREFORMAT_LUMINANCE=1,f.TEXTUREFORMAT_LUMINANCE_ALPHA=2,f.TEXTUREFORMAT_RGB=4,f.TEXTUREFORMAT_RGBA=5,f.TEXTUREFORMAT_RED=6,f.TEXTUREFORMAT_R=6,f.TEXTUREFORMAT_R16_UNORM=33322,f.TEXTUREFORMAT_RG16_UNORM=33324,f.TEXTUREFORMAT_RGB16_UNORM=32852,f.TEXTUREFORMAT_RGBA16_UNORM=32859,f.TEXTUREFORMAT_R16_SNORM=36760,f.TEXTUREFORMAT_RG16_SNORM=36761,f.TEXTUREFORMAT_RGB16_SNORM=36762,f.TEXTUREFORMAT_RGBA16_SNORM=36763,f.TEXTUREFORMAT_RG=7,f.TEXTUREFORMAT_RED_INTEGER=8,f.TEXTUREFORMAT_R_INTEGER=8,f.TEXTUREFORMAT_RG_INTEGER=9,f.TEXTUREFORMAT_RGB_INTEGER=10,f.TEXTUREFORMAT_RGBA_INTEGER=11,f.TEXTURETYPE_UNSIGNED_BYTE=0,f.TEXTURETYPE_UNSIGNED_INT=0,f.TEXTURETYPE_FLOAT=1,f.TEXTURETYPE_HALF_FLOAT=2,f.TEXTURETYPE_BYTE=3,f.TEXTURETYPE_SHORT=4,f.TEXTURETYPE_UNSIGNED_SHORT=5,f.TEXTURETYPE_INT=6,f.TEXTURETYPE_UNSIGNED_INTEGER=7,f.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,f.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,f.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,f.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,f.TEXTURETYPE_UNSIGNED_INT_24_8=12,f.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,f.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,f.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,f.TEXTURE_NEAREST_SAMPLINGMODE=1,f.TEXTURE_BILINEAR_SAMPLINGMODE=2,f.TEXTURE_TRILINEAR_SAMPLINGMODE=3,f.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,f.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,f.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,f.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,f.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,f.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,f.TEXTURE_NEAREST_LINEAR=7,f.TEXTURE_NEAREST_NEAREST=1,f.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,f.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,f.TEXTURE_LINEAR_LINEAR=2,f.TEXTURE_LINEAR_NEAREST=12,f.TEXTURE_EXPLICIT_MODE=0,f.TEXTURE_SPHERICAL_MODE=1,f.TEXTURE_PLANAR_MODE=2,f.TEXTURE_CUBIC_MODE=3,f.TEXTURE_PROJECTION_MODE=4,f.TEXTURE_SKYBOX_MODE=5,f.TEXTURE_INVCUBIC_MODE=6,f.TEXTURE_EQUIRECTANGULAR_MODE=7,f.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,f.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,f.SCALEMODE_FLOOR=1,f.SCALEMODE_NEAREST=2,f.SCALEMODE_CEILING=3,e.s(["Engine",0,f])},69194,e=>{"use strict";var t=e.i(68282);class i{constructor(e){this.value=this._toInt(e)}_toInt(e){return 0|e}add(e){return new i(this.value+e.value)}subtract(e){return new i(this.value-e.value)}multiply(e){return new i(Math.imul(this.value,e.value))}divide(e){return new i(this.value/e.value)}getClassName(){return i.ClassName}equals(e){return this.value===e.value}static FromValue(e){return new i(e)}toString(){return this.value.toString()}}i.ClassName="FlowGraphInteger";let r=!1;e.s(["FlowGraphInteger",0,i,"RegisterFlowGraphInteger",0,function(){r||(r=!0,(0,t.RegisterClass)("FlowGraphInteger",i))}])},63369,e=>{"use strict";var t,i;(i=t||(t={})).Animation="Animation",i.AnimationGroup="AnimationGroup",i.Mesh="Mesh",i.Material="Material",i.Camera="Camera",i.Light="Light",e.s(["GetFlowGraphAssetWithType",0,function(e,t,i,r){switch(t){case"Animation":return r?e.animations.find(e=>e.uniqueId===i)??null:e.animations[i]??null;case"AnimationGroup":return r?e.animationGroups.find(e=>e.uniqueId===i)??null:e.animationGroups[i]??null;case"Mesh":return r?e.meshes.find(e=>e.uniqueId===i)??null:e.meshes[i]??null;case"Material":return r?e.materials.find(e=>e.uniqueId===i)??null:e.materials[i]??null;case"Camera":return r?e.cameras.find(e=>e.uniqueId===i)??null:e.cameras[i]??null;case"Light":return r?e.lights.find(e=>e.uniqueId===i)??null:e.lights[i]??null;default:return null}}])},68166,e=>{"use strict";var t=e.i(23422);class i extends t.FlowGraphExecutionBlockWithOutSignal{constructor(e,t){if(super(e),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),t)for(const e of t)this._eventsSignalOutputs[e]=this._registerSignalOutput(e+"Event")}_executeOnTick(e){}_startPendingTasks(e){e._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(e),this._resetAfterCanceled(e)),this._preparePendingTasks(e),e._addPendingBlock(this),this.out._activateSignal(e),e._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(e){e._deleteExecutionVariable(this,"_initialized"),e._removePendingBlock(this)}}e.s(["FlowGraphAsyncExecutionBlock",0,i])},60699,e=>{"use strict";var t=e.i(70081),i=e.i(45213),r=e.i(97991),n=e.i(24667);class s extends i.FlowGraphConnection{constructor(e,t,i,n,s=n.defaultValue,a=!1){super(e,t,i),this.richType=n,this._defaultValue=s,this._optional=a,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new r.Observable}get optional(){return this._optional}get isDisabled(){return this._isDisabled}set isDisabled(e){this._isDisabled!==e&&(this._isDisabled=e,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){return 0===this.connectionType}setValue(e,t){t._getConnectionValue(this)!==e&&(t._setConnectionValue(this,e),this.onValueChangedObservable.notifyObservers(e))}resetToDefaultValue(e){e._setConnectionValue(this,this._defaultValue)}_reresolveDefaultValueForScene(e){let t,i=this._defaultValue;if(!i||"object"!=typeof i)return;if("function"==typeof i.getClassName&&"function"==typeof i.getScene){if(i.getScene()===e)return;t={id:i.id,name:i.name,className:i.getClassName(),uniqueId:i.uniqueId}}else{if("string"!=typeof i.className||!i.id&&!i.name||void 0!==i.value)return;t=i}let r=(0,n.GetSceneNodeFromSerializedReference)(t,e);r&&(this._defaultValue=r)}connectTo(e){this._isDisabled||super.connectTo(e)}_getValueOrDefault(e){let t=e._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(t):t}getValue(e){if(1===this.connectionType){e._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(e);let t=this._getValueOrDefault(e);return this._lastValue=t,this.richType.typeTransformer?this.richType.typeTransformer(t):t}let t=this.isConnected()?this._connectedPoint[0].getValue(e):this._getValueOrDefault(e);return this._lastValue=t,this.richType.typeTransformer?this.richType.typeTransformer(t):t}_getLastValue(){return this._lastValue}getClassName(){return"FlowGraphDataConnection"}serialize(e={}){super.serialize(e),e.richType={},this.richType.serialize(e.richType),e.optional=this._optional,(0,n.defaultValueSerializationFunction)("defaultValue",this._defaultValue,e)}}e.s(["FlowGraphBlock",0,class{constructor(e){this.config=e,this.uniqueId=(0,t.RandomGUID)(),this.name=this.config?.name??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(e){}registerDataInput(e,t,i){let r=new s(e,0,this,t,i);return this.dataInputs.push(r),r}registerDataOutput(e,t,i){let r=new s(e,1,this,t,i);return this.dataOutputs.push(r),r}getDataInput(e){return this.dataInputs.find(t=>t.name===e)}getDataOutput(e){return this.dataOutputs.find(t=>t.name===e)}serialize(e={},t=n.defaultValueSerializationFunction){if(e.uniqueId=this.uniqueId,e.config={},this.config){let i=this.config;for(let r of Object.keys(i))t(r,i[r],e.config)}for(let t of(e.dataInputs=[],e.dataOutputs=[],e.className=this.getClassName(),this.dataInputs)){let i={};t.serialize(i),e.dataInputs.push(i)}for(let t of this.dataOutputs){let i={};t.serialize(i),e.dataOutputs.push(i)}}deserialize(e){}_log(e,t,i){e.logger?.addLogItem({action:t,payload:i,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){return"FlowGraphBlock"}}],60699)},45213,e=>{"use strict";var t,i,r=e.i(70081);(t=i||(i={}))[t.Input=0]="Input",t[t.Output=1]="Output",e.s(["FlowGraphConnection",0,class{constructor(e,t,i){this._ownerBlock=i,this._connectedPoint=[],this.uniqueId=(0,r.RandomGUID)(),this.connectedPointIds=[],this.name=e,this._connectionType=t}get connectionType(){return this._connectionType}_isSingularConnection(){return!0}isConnected(){return this._connectedPoint.length>0}connectTo(e){if(this._connectionType===e._connectionType)throw Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||e._isSingularConnection()&&e._connectedPoint.length>0)throw Error("Max number of connections for point reached");this._connectedPoint.push(e),e._connectedPoint.push(this)}disconnectFrom(e,t=!0){let i=this._connectedPoint.indexOf(e),r=e._connectedPoint.indexOf(this);-1!==i&&-1!==r&&(t&&this._connectedPoint.splice(i,1),e._connectedPoint.splice(r,1))}disconnectFromAll(){for(let e of this._connectedPoint)this.disconnectFrom(e,!1);this._connectedPoint.length=0}dispose(){for(let e of this._connectedPoint)this.disconnectFrom(e)}serialize(e={}){for(let t of(e.uniqueId=this.uniqueId,e.name=this.name,e._connectionType=this._connectionType,e.connectedPointIds=[],e.className=this.getClassName(),this._connectedPoint))e.connectedPointIds.push(t.uniqueId)}getClassName(){return"FGConnection"}deserialize(e){this.uniqueId=e.uniqueId,this.name=e.name,this._connectionType=e._connectionType,this.connectedPointIds=e.connectedPointIds}}])},49795,e=>{"use strict";let t="activeDelayIndices";e.s(["IsDelayActive",0,function(e,i){return e._getGlobalContextVariable(t,null)?.has(i)??!1},"MarkDelayActive",0,function(e,i){let r;(!(r=e._getGlobalContextVariable(t,null))&&(r=new Set,e._setGlobalContextVariable(t,r)),r).add(i)},"MarkDelayInactive",0,function(e,i){e._getGlobalContextVariable(t,null)?.delete(i)}])},87083,e=>{"use strict";var t=e.i(68166);class i extends t.FlowGraphAsyncExecutionBlock{constructor(e){super(e),this.initPriority=0,this.type="NoTrigger",this._unregisterSignalInput("in")}deserialize(e){let t={...e};t.signalInputs=(e.signalInputs??[]).filter(e=>"in"!==e.name),super.deserialize(t)}_execute(e){e._notifyExecuteNode(this),this.done._activateSignal(e),this.out._activateSignal(e)}_startPendingTasks(e){e._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(e),this._resetAfterCanceled(e)),this._preparePendingTasks(e),e._addPendingBlock(this),e._setExecutionVariable(this,"_initialized",!0)}}e.s(["FlowGraphEventBlock",0,i])},64675,e=>{"use strict";var t=e.i(60699),i=e.i(45213);class r extends i.FlowGraphConnection{constructor(){super(...arguments),this.priority=0,this._lastActivationTime=-1}_isSingularConnection(){return!1}connectTo(e){super.connectTo(e),this._connectedPoint.sort((e,t)=>t.priority-e.priority)}_activateSignal(e){if(this._lastActivationTime=performance.now(),e.logger?.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),0===this.connectionType){if(e._shouldBreak(this._ownerBlock,this))return;e._increaseExecutionId(),e._notifyExecuteNode(this._ownerBlock);let t=performance.now();this._ownerBlock._execute(e,this),this._ownerBlock._lastExecutionTime=performance.now()-t}else for(let t of this._connectedPoint)t._activateSignal(e)}}class n extends t.FlowGraphBlock{constructor(e){super(e),this.priority=0,this._lastExecutionTime=-1,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(e){let t=new r(e,0,this);return this.signalInputs.push(t),t}_registerSignalOutput(e){let t=new r(e,1,this);return this.signalOutputs.push(t),t}_unregisterSignalInput(e){let t=this.signalInputs.findIndex(t=>t.name===e);-1!==t&&(this.signalInputs[t].dispose(),this.signalInputs.splice(t,1))}_unregisterSignalOutput(e){let t=this.signalOutputs.findIndex(t=>t.name===e);-1!==t&&(this.signalOutputs[t].dispose(),this.signalOutputs.splice(t,1))}_reportError(e,t){this.error.payload="string"==typeof t?Error(t):t,this.error._activateSignal(e)}getSignalInput(e){return this.signalInputs.find(t=>t.name===e)}getSignalOutput(e){return this.signalOutputs.find(t=>t.name===e)}serialize(e={}){for(let t of(super.serialize(e),e.signalInputs=[],e.signalOutputs=[],this.signalInputs)){let i={};t.serialize(i),e.signalInputs.push(i)}for(let t of this.signalOutputs){let i={};t.serialize(i),e.signalOutputs.push(i)}}deserialize(e){for(let t=0;t<e.signalInputs.length;t++){let i=this.getSignalInput(e.signalInputs[t].name);if(i)i.deserialize(e.signalInputs[t]);else throw Error("Could not find signal input with name "+e.signalInputs[t].name+" in block "+e.className)}for(let t=0;t<e.signalOutputs.length;t++){let i=this.getSignalOutput(e.signalOutputs[t].name);if(i)i.deserialize(e.signalOutputs[t]);else throw Error("Could not find signal output with name "+e.signalOutputs[t].name+" in block "+e.className)}}getClassName(){return"FlowGraphExecutionBlock"}}e.s(["FlowGraphExecutionBlock",0,n],64675)},23422,e=>{"use strict";var t=e.i(64675);class i extends t.FlowGraphExecutionBlock{constructor(e){super(e),this.out=this._registerSignalOutput("out")}}e.s(["FlowGraphExecutionBlockWithOutSignal",0,i])},65678,28111,e=>{"use strict";var t,i,r=e.i(56173),n=e.i(24617),s=e.i(69194);class a{constructor(e=[1,0,0,1]){this._m=e}get m(){return this._m}transformVector(e){return this.transformVectorToRef(e,new r.Vector2)}transformVectorToRef(e,t){return t.x=e.x*this._m[0]+e.y*this._m[2],t.y=e.x*this._m[1]+e.y*this._m[3],t}asArray(){return this.toArray()}toArray(e=[]){for(let t=0;t<4;t++)e[t]=this._m[t];return e}fromArray(e){for(let t=0;t<4;t++)this._m[t]=e[t];return this}multiplyToRef(e,t){let i=e._m,r=this._m,n=t._m;return n[0]=r[0]*i[0]+r[1]*i[2],n[1]=r[0]*i[1]+r[1]*i[3],n[2]=r[2]*i[0]+r[3]*i[2],n[3]=r[2]*i[1]+r[3]*i[3],t}multiply(e){return this.multiplyToRef(e,new a)}divideToRef(e,t){let i=this._m,r=e._m,n=t._m;return n[0]=i[0]/r[0],n[1]=i[1]/r[1],n[2]=i[2]/r[2],n[3]=i[3]/r[3],t}divide(e){return this.divideToRef(e,new a)}addToRef(e,t){let i=this._m,r=e.m,n=t.m;return n[0]=i[0]+r[0],n[1]=i[1]+r[1],n[2]=i[2]+r[2],n[3]=i[3]+r[3],t}add(e){return this.addToRef(e,new a)}subtractToRef(e,t){let i=this._m,r=e.m,n=t.m;return n[0]=i[0]-r[0],n[1]=i[1]-r[1],n[2]=i[2]-r[2],n[3]=i[3]-r[3],t}subtract(e){return this.subtractToRef(e,new a)}transpose(){let e=this._m;return new a([e[0],e[2],e[1],e[3]])}determinant(){let e=this._m;return e[0]*e[3]-e[1]*e[2]}inverse(){let e=this.determinant();if(0===e)throw Error("Matrix is not invertible");let t=this._m,i=1/e;return new a([t[3]*i,-t[1]*i,-t[2]*i,t[0]*i])}equals(e,t=0){let i=this._m,r=e.m;return 0===t?i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]:Math.abs(i[0]-r[0])<t&&Math.abs(i[1]-r[1])<t&&Math.abs(i[2]-r[2])<t&&Math.abs(i[3]-r[3])<t}getClassName(){return"FlowGraphMatrix2D"}toString(){return`FlowGraphMatrix2D(${this._m.join(", ")})`}}class o{constructor(e=[1,0,0,0,1,0,0,0,1]){this._m=e}get m(){return this._m}transformVector(e){return this.transformVectorToRef(e,new r.Vector3)}transformVectorToRef(e,t){let i=this._m;return t.x=e.x*i[0]+e.y*i[3]+e.z*i[6],t.y=e.x*i[1]+e.y*i[4]+e.z*i[7],t.z=e.x*i[2]+e.y*i[5]+e.z*i[8],t}multiplyToRef(e,t){let i=e._m,r=this._m,n=t.m;return n[0]=r[0]*i[0]+r[1]*i[3]+r[2]*i[6],n[1]=r[0]*i[1]+r[1]*i[4]+r[2]*i[7],n[2]=r[0]*i[2]+r[1]*i[5]+r[2]*i[8],n[3]=r[3]*i[0]+r[4]*i[3]+r[5]*i[6],n[4]=r[3]*i[1]+r[4]*i[4]+r[5]*i[7],n[5]=r[3]*i[2]+r[4]*i[5]+r[5]*i[8],n[6]=r[6]*i[0]+r[7]*i[3]+r[8]*i[6],n[7]=r[6]*i[1]+r[7]*i[4]+r[8]*i[7],n[8]=r[6]*i[2]+r[7]*i[5]+r[8]*i[8],t}multiply(e){return this.multiplyToRef(e,new o)}divideToRef(e,t){let i=this._m,r=e.m,n=t.m;return n[0]=i[0]/r[0],n[1]=i[1]/r[1],n[2]=i[2]/r[2],n[3]=i[3]/r[3],n[4]=i[4]/r[4],n[5]=i[5]/r[5],n[6]=i[6]/r[6],n[7]=i[7]/r[7],n[8]=i[8]/r[8],t}divide(e){return this.divideToRef(e,new o)}addToRef(e,t){let i=this._m,r=e.m,n=t.m;return n[0]=i[0]+r[0],n[1]=i[1]+r[1],n[2]=i[2]+r[2],n[3]=i[3]+r[3],n[4]=i[4]+r[4],n[5]=i[5]+r[5],n[6]=i[6]+r[6],n[7]=i[7]+r[7],n[8]=i[8]+r[8],t}add(e){return this.addToRef(e,new o)}subtractToRef(e,t){let i=this._m,r=e.m,n=t.m;return n[0]=i[0]-r[0],n[1]=i[1]-r[1],n[2]=i[2]-r[2],n[3]=i[3]-r[3],n[4]=i[4]-r[4],n[5]=i[5]-r[5],n[6]=i[6]-r[6],n[7]=i[7]-r[7],n[8]=i[8]-r[8],t}subtract(e){return this.subtractToRef(e,new o)}toArray(e=[]){for(let t=0;t<9;t++)e[t]=this._m[t];return e}asArray(){return this.toArray()}fromArray(e){for(let t=0;t<9;t++)this._m[t]=e[t];return this}transpose(){let e=this._m;return new o([e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]])}determinant(){let e=this._m;return e[0]*(e[4]*e[8]-e[5]*e[7])-e[1]*(e[3]*e[8]-e[5]*e[6])+e[2]*(e[3]*e[7]-e[4]*e[6])}inverse(){let e=this.determinant();if(0===e)throw Error("Matrix is not invertible");let t=this._m,i=1/e;return new o([(t[4]*t[8]-t[5]*t[7])*i,(t[2]*t[7]-t[1]*t[8])*i,(t[1]*t[5]-t[2]*t[4])*i,(t[5]*t[6]-t[3]*t[8])*i,(t[0]*t[8]-t[2]*t[6])*i,(t[2]*t[3]-t[0]*t[5])*i,(t[3]*t[7]-t[4]*t[6])*i,(t[1]*t[6]-t[0]*t[7])*i,(t[0]*t[4]-t[1]*t[3])*i])}equals(e,t=0){let i=this._m,r=e.m;return 0===t?i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]:Math.abs(i[0]-r[0])<t&&Math.abs(i[1]-r[1])<t&&Math.abs(i[2]-r[2])<t&&Math.abs(i[3]-r[3])<t&&Math.abs(i[4]-r[4])<t&&Math.abs(i[5]-r[5])<t&&Math.abs(i[6]-r[6])<t&&Math.abs(i[7]-r[7])<t&&Math.abs(i[8]-r[8])<t}getClassName(){return"FlowGraphMatrix3D"}toString(){return`FlowGraphMatrix3D(${this._m.join(", ")})`}}e.s(["FlowGraphMatrix2D",0,a,"FlowGraphMatrix3D",0,o],28111),(t=i||(i={})).Any="any",t.String="string",t.Number="number",t.Boolean="boolean",t.Object="object",t.Integer="FlowGraphInteger",t.Vector2="Vector2",t.Vector3="Vector3",t.Vector4="Vector4",t.Quaternion="Quaternion",t.Matrix="Matrix",t.Matrix2D="Matrix2D",t.Matrix3D="Matrix3D",t.Color3="Color3",t.Color4="Color4";class l{constructor(e,t,i=-1){this.typeName=e,this.defaultValue=t,this.animationType=i}serialize(e){e.typeName=this.typeName,e.defaultValue=this.defaultValue}}let h=new l("any",void 0),c=new l("string",""),u=new l("number",0,0),d=new l("boolean",!1),_=new l("Vector2",r.Vector2.Zero(),5),f=new l("Vector3",r.Vector3.Zero(),1),g=new l("Vector4",r.Vector4.Zero()),m=new l("Matrix",r.Matrix.Identity(),3),p=new l("Matrix2D",new a),T=new l("Matrix3D",new o),I=new l("Color3",n.Color3.Black(),4),E=new l("Color4",new n.Color4(0,0,0,0),7),y=new l("Quaternion",r.Quaternion.Identity(),2),M=new l("FlowGraphInteger",new s.FlowGraphInteger(0),0),S=!1;e.s(["RegisterFlowGraphRichTypes",0,function(){S||(S=!0,y.typeTransformer=e=>{if(e.getClassName){if("Vector4"===e.getClassName())return r.Quaternion.FromArray(e.asArray());else if("Vector3"===e.getClassName())return r.Quaternion.FromEulerVector(e);else if("Matrix"===e.getClassName())return r.Quaternion.FromRotationMatrix(e)}return e})},"RichTypeAny",0,h,"RichTypeBoolean",0,d,"RichTypeFlowGraphInteger",0,M,"RichTypeMatrix",0,m,"RichTypeMatrix2D",0,p,"RichTypeMatrix3D",0,T,"RichTypeNumber",0,u,"RichTypeQuaternion",0,y,"RichTypeString",0,c,"RichTypeVector2",0,_,"RichTypeVector3",0,f,"RichTypeVector4",0,g,"getAnimationTypeByFlowGraphType",0,function(e){switch(e){case"number":default:return 0;case"Vector2":return 5;case"Vector3":return 1;case"Matrix":return 3;case"Color3":return 4;case"Color4":return 7;case"Quaternion":return 2}},"getRichTypeByAnimationType",0,function(e){switch(e){case 0:return u;case 5:return _;case 1:return f;case 3:return m;case 4:return I;case 7:return E;case 2:return y;default:return h}},"getRichTypeByFlowGraphType",0,function(e){switch(e){case"string":return c;case"number":return u;case"boolean":return d;case"Vector2":return _;case"Vector3":return f;case"Vector4":return g;case"Matrix":return m;case"Color3":return I;case"Color4":return E;case"Quaternion":return y;case"FlowGraphInteger":return M;case"Matrix2D":return p;case"Matrix3D":return T;default:return h}},"getRichTypeFromValue",0,function(e){switch(typeof e){case"string":return c;case"number":return u;case"boolean":return d;case"object":if(e.getClassName)switch(e.getClassName()){case"Vector2":return _;case"Vector3":return f;case"Vector4":return g;case"Matrix":return m;case"Color3":return I;case"Color4":return E;case"Quaternion":return y;case"FlowGraphInteger":return M;case"Matrix2D":return p;case"Matrix3D":return T}return h;default:return h}}],65678)},24667,e=>{"use strict";var t=e.i(8697),i=e.i(24617),r=e.i(56173),n=e.i(69194),s=e.i(65678),a=e.i(28111);function o(e){return"Vector2"===e||"Vector3"===e||"Vector4"===e||"Quaternion"===e||"Color3"===e||"Color4"===e}function l(e,t){if(!e||!e.id&&!e.name)return;let i=t.getNodes().filter(t=>e.id?t.id===e.id:t.name===e.name);if(0===i.length)return;let r=e.type??e.className,n=r?i.filter(e=>e.getClassName()===r):[],s=n.length>0?n:i;return(e.uniqueId?s.find(t=>t.uniqueId===e.uniqueId):void 0)??s[0]}e.s(["GetSceneNodeFromSerializedReference",0,l,"defaultValueParseFunction",0,function e(t,h,c,u){let d,_=h[t],f=_?.type??_?.className,g=l(_,u);if(g)d=g;else if(o(f))d=function(e,t,n=!1){if("Vector2"===e)return r.Vector2.FromArray(t);if("Vector3"===e)return n&&(t[2]*=-1),r.Vector3.FromArray(t);if("Vector4"===e)return r.Vector4.FromArray(t);if("Quaternion"===e)return n&&(t[2]*=-1,t[3]*=-1),r.Quaternion.FromArray(t);if("Color3"===e)return new i.Color3(t[0],t[1],t[2]);else if("Color4"===e)return new i.Color4(t[0],t[1],t[2],t[3]);else throw Error(`Unknown vector class name ${e}`)}(f,_.value);else if("AnimationGroup"===f){let e=u.animationGroups.filter(e=>e.name===_.name);d=1===e.length?e[0]:e.find(e=>e.uniqueId===_.uniqueId)}else d="Matrix"===f?r.Matrix.FromArray(_.value):"Matrix2D"===f?new a.FlowGraphMatrix2D(_.value):"Matrix3D"===f?new a.FlowGraphMatrix3D(_.value):"FlowGraphInteger"===f?n.FlowGraphInteger.FromValue(_.value):"number"===f||"string"===f||"boolean"===f?_.value[0]:_&&void 0!==_.value?_.value:Array.isArray(_)&&_.length>0&&"object"==typeof _[0]&&null!==_[0]&&"eventData"in _[0]?_.reduce((t,i)=>(i.eventData&&(t[i.id]={type:(0,s.getRichTypeByFlowGraphType)(i.type)},void 0!==i.value&&(t[i.id].value=e("value",i,c,u))),t),{}):_;return d},"defaultValueSerializationFunction",0,function(e,i,r){var n;let s=i?.getClassName?.()??"";if(o(s)||"Matrix"===(n=s)||"Matrix2D"===n||"Matrix3D"===n)r[e]={value:i.asArray(),className:s};else if("FlowGraphInteger"===s)r[e]={value:i.value,className:s};else if(s&&(i.id||i.name))r[e]={id:i.id,name:i.name,className:s,uniqueId:i.uniqueId};else if("object"!=typeof i||null===i)r[e]=i;else{if("pathConverter"===e||Object.values(i).some(e=>"function"==typeof e))return;try{r[e]=JSON.parse(JSON.stringify(i))}catch{t.Logger.Warn(`FlowGraph serialization: value for key "${e}" is not JSON-serializable and was skipped.`)}}},"needsPathConverter",0,function(e){return"FlowGraphJsonPointerParserBlock"===e}])},80129,e=>{"use strict";let t=(0,e.i(45735).IsNavigatorAvailable)()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);function i(e){return"number"==typeof e?e:e.value}e.s(["_AreSameIntegerClass",0,function(e,t){return"FlowGraphInteger"===e&&"FlowGraphInteger"===t},"_AreSameMatrixClass",0,function(e,t){return e===t&&("Matrix"===e||"Matrix2D"===e||"Matrix3D"===e)},"_AreSameVectorOrQuaternionClass",0,function(e,t){return e===t&&("Vector2"===e||"Vector3"===e||"Vector4"===e||"Quaternion"===e)},"_GetClassNameOf",0,function(e){if(e.getClassName)return e.getClassName()},"_IsDescendantOf",0,function e(t,i){return!!(t.parent&&(t.parent===i||e(t.parent,i)))},"_IsMacPlatform",0,t,"getNumericValue",0,i,"isNumeric",0,function(e,t){let r="number"==typeof e||"number"==typeof e?.value;return r&&!t?!isNaN(i(e)):r}])},73037,83362,e=>{"use strict";let t,i,r,n,s,a,o,l;var h,c=e.i(73403),u=e.i(5207),d=e.i(56173),_=e.i(24617),f=e.i(22247),g=e.i(43384),m=e.i(68282);let p=(r=f.Light,n=[],s=[],a=[],o=[],h=class extends r{constructor(e,t,i,r){super(e,i,r),this.groundColor=(0,c.__runInitializers)(this,n,new _.Color3(0,0,0)),this.direction=((0,c.__runInitializers)(this,s),(0,c.__runInitializers)(this,a,void 0)),(0,c.__runInitializers)(this,o),this.direction=t||d.Vector3.Up()}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}getClassName(){return"HemisphericLight"}setDirectionToTarget(e){return this.direction=d.Vector3.Normalize(e.subtract(d.Vector3.Zero())),this.direction}getShadowGenerator(){return null}transferToEffect(e,t){let i=d.Vector3.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this}transferToNodeMaterialEffect(e,t){let i=d.Vector3.Normalize(this.direction);return e.setFloat3(t,i.x,i.y,i.z),this}computeWorldMatrix(){return this._worldMatrix||(this._worldMatrix=d.Matrix.Identity()),this._worldMatrix}getTypeID(){return f.Light.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(e,t){e["HEMILIGHT"+t]=!0}},l="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0,t=[(0,u.serializeAsColor3)()],i=[(0,u.serializeAsVector3)()],(0,c.__esDecorate)(null,null,t,{kind:"field",name:"groundColor",static:!1,private:!1,access:{has:e=>"groundColor"in e,get:e=>e.groundColor,set:(e,t)=>{e.groundColor=t}},metadata:l},n,s),(0,c.__esDecorate)(null,null,i,{kind:"field",name:"direction",static:!1,private:!1,access:{has:e=>"direction"in e,get:e=>e.direction,set:(e,t)=>{e.direction=t}},metadata:l},a,o),l&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:l}),h),T=!1;function I(){T||(T=!0,g.Node.AddNodeConstructor("Light_Type_3",(e,t)=>()=>new p(e,d.Vector3.Zero(),t)),(0,m.RegisterClass)("BABYLON.HemisphericLight",p))}e.s(["HemisphericLight",0,p,"RegisterHemisphericLight",0,I],83362),I(),e.s([],73037)},22247,e=>{"use strict";let t,i,r,n,s,a,o,l,h,c,u,d,_,f,g,m,p,T,I,E,y,M,S,x,A,R,D,C,L,b,v,P,w,B,F,O;var V,N,U=e.i(73403),k=e.i(5207),G=e.i(56173),z=e.i(24617),W=e.i(43384),X=e.i(58607),H=e.i(68282),Y=e.i(76972),Q=e.i(69552);let q=(f=W.Node,g=[],m=[],p=[],T=[],I=[],E=[],y=[],M=[],S=[],x=[],A=[],R=[],D=[],C=[],L=[],b=[],v=[],P=[],w=[],B=[],F=[],V=class extends f{get range(){return this._range}set range(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)}get intensityMode(){return this._intensityMode}set intensityMode(e){this._intensityMode=e,this._computePhotometricScale()}get radius(){return this._radius}set radius(e){this._radius=e,this._computePhotometricScale()}get renderPriority(){return(0,U.__classPrivateFieldGet)(this,N,"f")}set renderPriority(e){(0,U.__classPrivateFieldSet)(this,N,e,"f")}get shadowEnabled(){return this._shadowEnabled}set shadowEnabled(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())}get includedOnlyMeshes(){return this._includedOnlyMeshes}set includedOnlyMeshes(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)}get excludedMeshes(){return this._excludedMeshes}set excludedMeshes(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)}get excludeWithLayerMask(){return this._excludeWithLayerMask}set excludeWithLayerMask(e){this._excludeWithLayerMask=e,this._resyncMeshes()}get includeOnlyWithLayerMask(){return this._includeOnlyWithLayerMask}set includeOnlyWithLayerMask(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()}get lightmapMode(){return this._lightmapMode}set lightmapMode(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())}getViewMatrix(e){return null}getProjectionMatrix(e,t){return null}constructor(e,t,i){super(e,t,!1),this.diffuse=((0,U.__runInitializers)(this,g),(0,U.__runInitializers)(this,m,new z.Color3(1,1,1))),this.specular=((0,U.__runInitializers)(this,p),(0,U.__runInitializers)(this,T,new z.Color3(1,1,1))),this.falloffType=((0,U.__runInitializers)(this,I),(0,U.__runInitializers)(this,E,V.FALLOFF_DEFAULT)),this.intensity=((0,U.__runInitializers)(this,y),(0,U.__runInitializers)(this,M,1)),this._range=((0,U.__runInitializers)(this,S),Number.MAX_VALUE),this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=V.INTENSITYMODE_AUTOMATIC,this._radius=1e-5,this._renderPriority=(0,U.__runInitializers)(this,x,void 0),N.set(this,((0,U.__runInitializers)(this,A),(0,U.__runInitializers)(this,R,0))),this._shadowEnabled=((0,U.__runInitializers)(this,D),(0,U.__runInitializers)(this,C,!0)),this._includedOnlyMeshes=(0,U.__runInitializers)(this,L),this._excludeWithLayerMask=(0,U.__runInitializers)(this,b,0),this._includeOnlyWithLayerMask=((0,U.__runInitializers)(this,v),(0,U.__runInitializers)(this,P,0)),this._lightmapMode=((0,U.__runInitializers)(this,w),(0,U.__runInitializers)(this,B,0)),this._shadowGenerators=((0,U.__runInitializers)(this,F),null),this._excludedMeshesIds=[],this._includedOnlyMeshesIds=[],this._currentViewDepth=0,this._clusteredContainer=null,this._isLight=!0,i||this.getScene().addLight(this),this._uniformBuffer=new X.UniformBuffer(this.getScene().getEngine(),void 0,void 0,e),this._buildUniformLayout(),this.includedOnlyMeshes=[],this.excludedMeshes=[],i||this._resyncMeshes()}transferTexturesToEffect(e,t){return this}_bindLight(e,t,i,r,n=!0){let s=e.toString(),a=!1;if(this._uniformBuffer.bindToEffect(i,"Light"+s),this._renderId!==t.getRenderId()||this._lastUseSpecular!==r||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId(),this._lastUseSpecular=r;let e=this.getScaledIntensity();this.transferToEffect(i,s),this.diffuse.scaleToRef(e,z.TmpColors.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",z.TmpColors.Color3[0],this.range,s),r&&(this.specular.scaleToRef(e,z.TmpColors.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",z.TmpColors.Color3[1],this.radius,s)),a=!0}if(this.transferTexturesToEffect(i,s),t.shadowsEnabled&&this.shadowEnabled&&n){let e=this.getShadowGenerator(t.activeCamera)??this.getShadowGenerator();e&&(e.bindShadowLight(s,i),a=!0)}a?this._uniformBuffer.update():this._uniformBuffer.bindUniformBuffer()}getClassName(){return"Light"}toString(e){let t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric","Clustered"][this.getTypeID()],this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t}_syncParentEnabledState(){super._syncParentEnabledState(),this.isDisposed()||this._resyncMeshes()}setEnabled(e){super.setEnabled(e),this._resyncMeshes()}getShadowGenerator(e=null){return null===this._shadowGenerators?null:this._shadowGenerators.get(e)??null}getShadowGenerators(){return this._shadowGenerators}getAbsolutePosition(){return G.Vector3.Zero()}canAffectMesh(e){return!e||(!this.includedOnlyMeshes||!(this.includedOnlyMeshes.length>0)||-1!==this.includedOnlyMeshes.indexOf(e))&&(!this.excludedMeshes||!(this.excludedMeshes.length>0)||-1===this.excludedMeshes.indexOf(e))&&(0===this.includeOnlyWithLayerMask||(this.includeOnlyWithLayerMask&e.layerMask)!=0)&&(0===this.excludeWithLayerMask||!(this.excludeWithLayerMask&e.layerMask))}dispose(e,t=!1){if(this._shadowGenerators){let e=this._shadowGenerators.values();for(let t=e.next();!0!==t.done;t=e.next())t.value.dispose();this._shadowGenerators=null}if(this.getScene().stopAnimation(this),this._parentContainer){let e=this._parentContainer.lights.indexOf(this);e>-1&&this._parentContainer.lights.splice(e,1),this._parentContainer=null}for(let e of this.getScene().meshes)e._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),super.dispose(e,t)}getTypeID(){return 0}getScaledIntensity(){return this._photometricScale*this.intensity}clone(e,t=null){let i=V.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!i)return null;let r=Q.SerializationHelper.Clone(i,this);return e&&(r.name=e),t&&(r.parent=t),r.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(r),r}serialize(){let e=Q.SerializationHelper.Serialize(this);if(e.uniqueId=this.uniqueId,e.type=this.getTypeID(),this.parent&&this.parent._serializeAsParent(e),this.excludedMeshes.length>0)for(let t of(e.excludedMeshesIds=[],this.excludedMeshes))e.excludedMeshesIds.push(t.id);if(this.includedOnlyMeshes.length>0)for(let t of(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes))e.includedOnlyMeshesIds.push(t.id);return Q.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}static GetConstructorFromName(e,t,i){let r=W.Node.Construct("Light_Type_"+e,t,i);return r||null}static Parse(e,t,i=""){let r=V.GetConstructorFromName(e.type,e.name,t);if(!r)return null;let n=Q.SerializationHelper.Parse(r,e,t,i);if(e.excludedMeshesIds&&(n._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(n._includedOnlyMeshesIds=e.includedOnlyMeshesIds),void 0!==e.parentId&&(n._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),void 0!==e.falloffType&&(n.falloffType=e.falloffType),void 0!==e.lightmapMode&&(n.lightmapMode=e.lightmapMode),e.animations){for(let t=0;t<e.animations.length;t++){let i=e.animations[t],r=(0,H.GetClass)("BABYLON.Animation");r&&n.animations.push(r.Parse(i))}W.Node.ParseAnimationRanges(n,e,t)}return e.autoAnimate&&t.beginAnimation(n,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),void 0!==e.isEnabled&&n.setEnabled(e.isEnabled),n._onParsed(e,t,i),n}_onParsed(e,t,i=""){}_hookArrayForExcluded(e){let t=e.push;e.push=(...i)=>{let r=t.apply(e,i);if(this._clusteredContainer)return r;for(let e of i)e._resyncLightSource(this);return r};let i=e.splice;e.splice=(t,r)=>{let n=i.call(e,t,r??e.length);if(this._clusteredContainer)return n;for(let e of n)e._resyncLightSource(this);return n},this._resyncMeshes()}_hookArrayForIncludedOnly(e){let t=e.push;e.push=(...i)=>{let r=t.apply(e,i);return this._resyncMeshes(),r};let i=e.splice;e.splice=(t,r)=>{let n=i.call(e,t,r??e.length);return this._resyncMeshes(),n},this._resyncMeshes()}_resyncMeshes(){if(!this._clusteredContainer)for(let e of this.getScene().meshes)e._resyncLightSource(this)}_markMeshesAsLightDirty(){for(let e of this.getScene().meshes)-1!==e.lightSources.indexOf(this)&&e._markSubMeshesAsLightDirty()}_computePhotometricScale(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()}_getPhotometricScale(){let e=0,t=this.getTypeID(),i=this.intensityMode;switch(i===V.INTENSITYMODE_AUTOMATIC&&(i=t===V.LIGHTTYPEID_DIRECTIONALLIGHT?V.INTENSITYMODE_ILLUMINANCE:V.INTENSITYMODE_LUMINOUSINTENSITY),t){case V.LIGHTTYPEID_POINTLIGHT:case V.LIGHTTYPEID_SPOTLIGHT:switch(i){case V.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case V.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case V.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius}break;case V.LIGHTTYPEID_DIRECTIONALLIGHT:switch(i){case V.INTENSITYMODE_ILLUMINANCE:e=1;break;case V.INTENSITYMODE_LUMINANCE:{let t=this.radius;e=2*Math.PI*(1-Math.cos(t=Math.max(t,.001)))}}break;case V.LIGHTTYPEID_HEMISPHERICLIGHT:case V.LIGHTTYPEID_RECT_AREALIGHT:e=1}return e}_reorderLightsInScene(){let e=this.getScene();0!=this._renderPriority&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()}areLightTexturesReady(){return!0}_isReady(){return!0}},N=new WeakMap,O="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0,t=[(0,k.serializeAsColor3)()],i=[(0,k.serializeAsColor3)()],r=[(0,k.serialize)()],n=[(0,k.serialize)()],s=[(0,k.serialize)()],a=[(0,k.serialize)()],o=[(0,k.serialize)()],l=[(0,k.serialize)()],h=[(0,k.expandToProperty)("_reorderLightsInScene")],c=[(0,k.serialize)("shadowEnabled")],u=[(0,k.serialize)("excludeWithLayerMask")],d=[(0,k.serialize)("includeOnlyWithLayerMask")],_=[(0,k.serialize)("lightmapMode")],(0,U.__esDecorate)(V,null,s,{kind:"getter",name:"range",static:!1,private:!1,access:{has:e=>"range"in e,get:e=>e.range},metadata:O},null,g),(0,U.__esDecorate)(V,null,a,{kind:"getter",name:"intensityMode",static:!1,private:!1,access:{has:e=>"intensityMode"in e,get:e=>e.intensityMode},metadata:O},null,g),(0,U.__esDecorate)(V,null,o,{kind:"getter",name:"radius",static:!1,private:!1,access:{has:e=>"radius"in e,get:e=>e.radius},metadata:O},null,g),(0,U.__esDecorate)(V,null,h,{kind:"accessor",name:"renderPriority",static:!1,private:!1,access:{has:e=>"renderPriority"in e,get:e=>e.renderPriority,set:(e,t)=>{e.renderPriority=t}},metadata:O},R,D),(0,U.__esDecorate)(null,null,t,{kind:"field",name:"diffuse",static:!1,private:!1,access:{has:e=>"diffuse"in e,get:e=>e.diffuse,set:(e,t)=>{e.diffuse=t}},metadata:O},m,p),(0,U.__esDecorate)(null,null,i,{kind:"field",name:"specular",static:!1,private:!1,access:{has:e=>"specular"in e,get:e=>e.specular,set:(e,t)=>{e.specular=t}},metadata:O},T,I),(0,U.__esDecorate)(null,null,r,{kind:"field",name:"falloffType",static:!1,private:!1,access:{has:e=>"falloffType"in e,get:e=>e.falloffType,set:(e,t)=>{e.falloffType=t}},metadata:O},E,y),(0,U.__esDecorate)(null,null,n,{kind:"field",name:"intensity",static:!1,private:!1,access:{has:e=>"intensity"in e,get:e=>e.intensity,set:(e,t)=>{e.intensity=t}},metadata:O},M,S),(0,U.__esDecorate)(null,null,l,{kind:"field",name:"_renderPriority",static:!1,private:!1,access:{has:e=>"_renderPriority"in e,get:e=>e._renderPriority,set:(e,t)=>{e._renderPriority=t}},metadata:O},x,A),(0,U.__esDecorate)(null,null,c,{kind:"field",name:"_shadowEnabled",static:!1,private:!1,access:{has:e=>"_shadowEnabled"in e,get:e=>e._shadowEnabled,set:(e,t)=>{e._shadowEnabled=t}},metadata:O},C,L),(0,U.__esDecorate)(null,null,u,{kind:"field",name:"_excludeWithLayerMask",static:!1,private:!1,access:{has:e=>"_excludeWithLayerMask"in e,get:e=>e._excludeWithLayerMask,set:(e,t)=>{e._excludeWithLayerMask=t}},metadata:O},b,v),(0,U.__esDecorate)(null,null,d,{kind:"field",name:"_includeOnlyWithLayerMask",static:!1,private:!1,access:{has:e=>"_includeOnlyWithLayerMask"in e,get:e=>e._includeOnlyWithLayerMask,set:(e,t)=>{e._includeOnlyWithLayerMask=t}},metadata:O},P,w),(0,U.__esDecorate)(null,null,_,{kind:"field",name:"_lightmapMode",static:!1,private:!1,access:{has:e=>"_lightmapMode"in e,get:e=>e._lightmapMode,set:(e,t)=>{e._lightmapMode=t}},metadata:O},B,F),O&&Object.defineProperty(V,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:O}),V.FALLOFF_DEFAULT=Y.LightConstants.FALLOFF_DEFAULT,V.FALLOFF_PHYSICAL=Y.LightConstants.FALLOFF_PHYSICAL,V.FALLOFF_GLTF=Y.LightConstants.FALLOFF_GLTF,V.FALLOFF_STANDARD=Y.LightConstants.FALLOFF_STANDARD,V.LIGHTMAP_DEFAULT=Y.LightConstants.LIGHTMAP_DEFAULT,V.LIGHTMAP_SPECULAR=Y.LightConstants.LIGHTMAP_SPECULAR,V.LIGHTMAP_SHADOWSONLY=Y.LightConstants.LIGHTMAP_SHADOWSONLY,V.INTENSITYMODE_AUTOMATIC=Y.LightConstants.INTENSITYMODE_AUTOMATIC,V.INTENSITYMODE_LUMINOUSPOWER=Y.LightConstants.INTENSITYMODE_LUMINOUSPOWER,V.INTENSITYMODE_LUMINOUSINTENSITY=Y.LightConstants.INTENSITYMODE_LUMINOUSINTENSITY,V.INTENSITYMODE_ILLUMINANCE=Y.LightConstants.INTENSITYMODE_ILLUMINANCE,V.INTENSITYMODE_LUMINANCE=Y.LightConstants.INTENSITYMODE_LUMINANCE,V.LIGHTTYPEID_POINTLIGHT=Y.LightConstants.LIGHTTYPEID_POINTLIGHT,V.LIGHTTYPEID_DIRECTIONALLIGHT=Y.LightConstants.LIGHTTYPEID_DIRECTIONALLIGHT,V.LIGHTTYPEID_SPOTLIGHT=Y.LightConstants.LIGHTTYPEID_SPOTLIGHT,V.LIGHTTYPEID_HEMISPHERICLIGHT=Y.LightConstants.LIGHTTYPEID_HEMISPHERICLIGHT,V.LIGHTTYPEID_RECT_AREALIGHT=Y.LightConstants.LIGHTTYPEID_RECT_AREALIGHT,V);e.s(["Light",0,q])},57605,e=>{"use strict";var t,i,r=e.i(17814),n=e.i(97991),s=e.i(17188),a=e.i(71829),o=e.i(8697),l=e.i(75751),h=e.i(20887),c=e.i(31619),u=e.i(70081),d=e.i(18405),_=e.i(5369);async function f(e,t){let i=t.method||"GET";return await new Promise((r,n)=>{let s=new _.WebRequest;s.addEventListener("readystatechange",()=>{if(4==s.readyState)if(200==s.status){let e={};if(t.responseHeaders)for(let i of t.responseHeaders)e[i]=s.getResponseHeader(i)||"";r({response:s.response,headerValues:e})}else n(`Unable to fetch data from ${e}. Error code: ${s.status}`)}),s.open(i,e),s.send()})}(t=i||(i={}))[t.Clean=0]="Clean",t[t.Stop=1]="Stop",t[t.Sync=2]="Sync",t[t.NoSync=3]="NoSync";let g=new n.Observable,m={},p=!1;function T(){return m[".babylon"]}function I(e,t){let i=m[e];return i||(o.Logger.Warn("Unable to find a plugin to load "+e+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"),t?T():void 0)}function E(e,t,i){let r,n=(r="Unable to load from "+(e.rawData?"binary data":e.url),t?r+=`: ${t}`:i&&(r+=`: ${i}`),r);return new c.RuntimeError(n,c.ErrorCodes.SceneLoaderError,i)}function y(e){return e instanceof Error?e.message:String(e)}function M(e,t){return t instanceof c.RuntimeError&&t.errorCode===c.ErrorCodes.SceneLoaderError?t:E(e,y(t),t)}function S(e,t){if(!(e.importMesh||e.load||e.loadAssetContainer))return e;let i=e=>{let i,r=e((e,t)=>{i={message:e,exception:t}});if(!r)throw E(t,i?.message,i?.exception);return r};return{name:e.name,extensions:e.extensions,importMeshAsync:async(t,r,n,s)=>{let a=[],o=[],l=[];return i(i=>e.importMesh(t,r,n,s,a,o,l,i)),{meshes:a,particleSystems:o,skeletons:l,animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}},loadAsync:async(t,r,n)=>{i(i=>e.load(t,r,n,i))},loadAssetContainerAsync:async(t,r,n)=>i(i=>e.loadAssetContainer(t,r,n,i))}}function x(e,t,i){let r=y(i);e&&t?e(t,r,i):o.Logger.Error(r)}function A(e){if(e)return t=>{try{e(t)}catch(e){o.Logger.Warn("Error in onProgress callback: "+y(e))}}}async function R(e,t,i,r,n,s){var a,o;let l,c,u,_="data:"===(a=e.url).substring(0,5)?a.substring(5):null;if(e.rawData&&!r)throw Error("When using ArrayBufferView to load data the file extension must be provided.");let p=_||r?"":(-1!==(c=(o=e.url).indexOf("?"))&&(o=o.substring(0,c)),u=o.lastIndexOf("."),o.substring(u,o.length).toLowerCase()),y=r?I(r,!0):_?function(e){for(let t in m){let i=m[t].plugin;if(i.canDirectLoad&&i.canDirectLoad(e))return m[t]}return T()}(e.url):I(p,!1);if(!y&&p){if(e.url&&!e.url.startsWith("blob:")){let t=await f(e.url,{method:"HEAD",responseHeaders:["Content-Type"]}),i=t.headerValues?t.headerValues["Content-Type"]:"";i&&(y=function(e){for(let t in m){let i=m[t];if(i.mimeType===e)return i}}(i))}y||(y=T())}if(!y)throw Error(`No plugin or fallback for ${r??e.url}`);if(s?.[y.plugin.name]?.enabled===!1)throw Error(`The '${y.plugin.name}' plugin is disabled via the loader options passed to the loading operation.`);if(e.rawData&&!y.isBinary)throw Error("Loading from ArrayBufferView can not be used with plugins that don't support binary loading.");if(y.plugin.createPlugin){let t=y.plugin;try{let e=t.createPlugin(s??{});l=e instanceof Promise?await e:e}catch(t){throw E(e,"Error instantiating plugin.",t)}}else l=y.plugin;if(!l)throw Error(`The loader plugin corresponding to the '${r}' file type has not been found. If using es6, please import the plugin you wish to use before.`);if(g.notifyObservers(l),_&&(l.canDirectLoad&&l.canDirectLoad(e.url)||!(0,h.IsBase64DataUrl)(e.url))){if(l.directLoad){let i;try{i=await l.directLoad(t,_)}catch(t){throw E(e,"Error in directLoad of _loadData: "+t,t)}return{plugin:l,data:i}}return{plugin:l,data:_}}let M=y.isBinary;return await new Promise((r,s)=>{let a=null,o=!1,h=l.onDisposeObservable?.add(()=>{o=!0,a&&(a.abort(),a=null),u(E(e,"Loading was aborted because the plugin was disposed."))}),c=()=>{h&&l.onDisposeObservable?.remove(h)},u=e=>{c(),s(e)},_=(i,n)=>{var s;t.isDisposed?u(E(e,"Scene has been disposed")):(s={plugin:l,data:i,responseURL:n},c(),r(s))},f=()=>{if(o)return;let r=(t,i)=>{u(E(e,t?.statusText,i))};if(!l.loadFile&&e.rawData)return void u(E(e,"Plugin does not support loading ArrayBufferView."));try{a=l.loadFile?l.loadFile(t,e.rawData||e.file||e.url,e.rootUrl,_,i,M,r,n):t._loadFile(e.file||e.url,_,i,!0,M,r)}catch(t){u(E(e,void 0,t))}},g=t.getEngine(),m=!e.file&&!e.rawData&&g.enableOfflineSupport;if(m){let i=!1;for(let r of t.disableOfflineSupportExceptionRules)if(r.test(e.url)){i=!0;break}m=!i}if(m&&d.AbstractEngine.OfflineProviderFactory)try{t.offlineProvider=d.AbstractEngine.OfflineProviderFactory(e.url,f,g.disableManifestCheck)}catch(t){u(E(e,void 0,t))}else f()})}function D(e,t){let i,n,s=null,a=null;if(t)if(t.name)i=`file:${t.name}`,n=t.name,s=t;else if(ArrayBuffer.isView(t))i="",n=(0,u.RandomGUID)(),a=t;else if(t.startsWith("data:"))i=t,n="";else if(e){if("/"===t.substring(0,1))return r.Tools.Error("Wrong sceneFilename parameter"),null;i=e+t,n=t}else i=t,n=r.Tools.GetFilename(t),e=r.Tools.GetFolderPath(t);else i=e,n=r.Tools.GetFilename(e),e=r.Tools.GetFolderPath(e);return{url:i,rootUrl:e,name:n,file:s,rawData:a}}function C(e){if("string"==typeof e.extensions)m[e.extensions.toLowerCase()]={plugin:e,isBinary:!1};else{let t=e.extensions;for(let i of Object.keys(t))m[i.toLowerCase()]={plugin:e,isBinary:t[i].isBinary,mimeType:t[i].mimeType}}}async function L(e,t,i){let{meshNames:r,rootUrl:n="",onProgress:s,pluginExtension:a,name:o,pluginOptions:l}=i??{};return await b(r,n,e,t,s,a,o,l)}async function b(e,t,i="",r=a.EngineStore.LastCreatedScene,n,s,o="",l={}){if(!r)throw Error("No scene available to import mesh to");let h=D(t,i);if(!h)throw Error("Cannot load file: a valid scene filename or root url was not provided.");let c={};r.addPendingData(c);let u=A(n);try{let t,{plugin:i,data:n,responseURL:a}=await R(h,r,u,s??null,o,l);i.rewriteRootURL&&(h.rootUrl=i.rewriteRootURL(h.rootUrl,a));try{t=await S(i,h).importMeshAsync(e,r,n,h.rootUrl,u,h.name)}catch(e){throw M(h,e)}return r.loadingPluginName=i.name,r.importedMeshesFiles.push(h.url),t}finally{r.removePendingData(c)}}async function v(e,t="",i=a.EngineStore.LastCreatedEngine,r,n,o="",l={}){if(!i)throw Error("No engine available");let h=new s.Scene(i);try{await P(e,t,h,r,n,o,l)}catch(e){throw h.dispose(),e}return h}async function P(e,t="",i=a.EngineStore.LastCreatedScene,r,n,s="",o={}){if(!i)throw Error("No scene available to append to");let h=D(e,t);if(!h)throw Error("Cannot load file: a valid scene filename or root url was not provided.");let c={};i.addPendingData(c),l.SceneLoaderFlags.ShowLoadingScreen&&!p&&(p=!0,i.getEngine().displayLoadingUI(),i.executeWhenReady(()=>{i.getEngine().hideLoadingUI(),p=!1}));let u=A(r);try{let{plugin:e,data:t}=await R(h,i,u,n??null,s,o);try{await S(e,h).loadAsync(i,t,h.rootUrl,u,h.name)}catch(e){throw M(h,e)}return i.loadingPluginName=e.name,i}finally{i.removePendingData(c)}}async function w(e,t="",i=a.EngineStore.LastCreatedScene,r,n,s="",o={}){if(!i)throw Error("No scene available to load asset container to");let l=D(e,t);if(!l)throw Error("Cannot load file: a valid scene filename or root url was not provided.");let h={};i.addPendingData(h);let c=A(r);try{let e,{plugin:t,data:r}=await R(l,i,c,n??null,s,o),a=S(t,l);if(!a.loadAssetContainerAsync)throw E(l,"LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");try{e=await a.loadAssetContainerAsync(i,r,l.rootUrl,c,l.name)}catch(e){throw M(l,e)}return e.populateRootNodes(),i.loadingPluginName=t.name,e}finally{i.removePendingData(h)}}async function B(e,t,i){let{rootUrl:r="",onProgress:n,pluginExtension:s,name:a,pluginOptions:o}=i??{};return await w(r,e,t,n,s,a,o)}async function F(e,t="",i=a.EngineStore.LastCreatedScene,r=!0,n=0,s=null,o,l,h="",c={}){if(!i)throw Error("No scene available to load animations to");if(r){for(let e of i.animatables)e.reset();for(let e of(i.stopAllAnimations(),i.animationGroups.slice()))e.dispose();for(let e of i.getNodes())e.animations&&(e.animations=[])}else switch(n){case 0:for(let e of i.animationGroups.slice())e.dispose();break;case 1:for(let e of i.animationGroups)e.stop();break;case 2:for(let e of i.animationGroups)e.reset(),e.restart();break;case 3:break;default:throw Error("Unknown animation group loading mode value '"+n+"'")}let u=i.animatables.length,d=await w(e,t,i,o,l,h,c);d.mergeAnimationsTo(i,i.animatables.slice(u),s),d.dispose(),i.onAnimationFileImportedObservable.notifyObservers(i)}class O{static get ForceFullSceneLoadingForIncremental(){return l.SceneLoaderFlags.ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){l.SceneLoaderFlags.ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return l.SceneLoaderFlags.ShowLoadingScreen}static set ShowLoadingScreen(e){l.SceneLoaderFlags.ShowLoadingScreen=e}static get loggingLevel(){return l.SceneLoaderFlags.loggingLevel}static set loggingLevel(e){l.SceneLoaderFlags.loggingLevel=e}static get CleanBoneMatrixWeights(){return l.SceneLoaderFlags.CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){l.SceneLoaderFlags.CleanBoneMatrixWeights=e}static GetDefaultPlugin(){return T()}static GetPluginForExtension(e){return I(e,!0)?.plugin}static IsPluginForExtensionAvailable(e){return!!m[e]}static RegisterPlugin(e){C(e)}static ImportMesh(e,t,i,r,n,s,o,l,h,c){let u=r??a.EngineStore.LastCreatedScene;(async()=>{try{let a=await b(e,t,i,r,s,l,h,c);n?.(a.meshes,a.particleSystems,a.skeletons,a.animationGroups,a.transformNodes,a.geometries,a.lights,a.spriteManagers)}catch(e){x(o,u,e)}})()}static async ImportMeshAsync(e,t,i,r,n,s,a){return await b(e,t,i,r,n,s,a)}static Load(e,t,i,r,n,s,o,l){(async()=>{try{let s=await v(e,t,i,n,o,l);r?.(s)}catch(e){x(s,a.EngineStore.LastCreatedScene,e)}})()}static async LoadAsync(e,t,i,r,n,s){return await v(e,t,i,r,n,s)}static Append(e,t,i,r,n,s,o,l){let h=i??a.EngineStore.LastCreatedScene;(async()=>{try{let s=await P(e,t,i,n,o,l);r?.(s)}catch(e){x(s,h,e)}})()}static async AppendAsync(e,t,i,r,n,s){return await P(e,t,i,r,n,s)}static LoadAssetContainer(e,t,i,r,n,s,o,l){let h=i??a.EngineStore.LastCreatedScene;(async()=>{try{let s=await w(e,t,i,n,o,l);r?.(s)}catch(e){x(s,h,e)}})()}static async LoadAssetContainerAsync(e,t,i,r,n,s){return await w(e,t,i,r,n,s)}static ImportAnimations(e,t,i,r,n,s,o,l,h,c,u){let d=i??a.EngineStore.LastCreatedScene;(async()=>{try{await F(e,t,i,r,n,s,l,c,u),o?.(d)}catch(e){x(h,d,e)}})()}static async ImportAnimationsAsync(e,t,i,r,n,s,o,l,h,c,u){let d=i??a.EngineStore.LastCreatedScene;return await F(e,t,d,r,n,s,l,c,u),d}}O.NO_LOGGING=0,O.MINIMAL_LOGGING=1,O.SUMMARY_LOGGING=2,O.DETAILED_LOGGING=3,O.OnPluginActivatedObservable=g,e.s(["ImportMeshAsync",0,L,"LoadAssetContainerAsync",0,B,"RegisterSceneLoaderPlugin",0,C],57605)},30523,e=>{"use strict";var t=e.i(8697);let i=new Map;function r(e,r){var n;n=e,i.delete(n)&&t.Logger.Warn(`Extension with the name '${e}' already exists`),i.set(e,r)}e.s(["_GetCompatibleTextureLoader",0,function(t,n){("image/ktx"===n||"image/ktx2"===n)&&(t=".ktx"),!i.has(t)&&(t.endsWith(".ies")&&r(".ies",async()=>await e.A(22035).then(e=>new e._IESTextureLoader)),t.endsWith(".dds")&&r(".dds",async()=>await e.A(87682).then(e=>new e._DDSTextureLoader)),t.endsWith(".basis")&&r(".basis",async()=>await e.A(25860).then(e=>new e._BasisTextureLoader)),t.endsWith(".env")&&r(".env",async()=>await e.A(48820).then(e=>new e._ENVTextureLoader)),t.endsWith(".hdr")&&r(".hdr",async()=>await e.A(35218).then(e=>new e._HDRTextureLoader)),(t.endsWith(".ktx")||t.endsWith(".ktx2"))&&(r(".ktx",async()=>await e.A(30928).then(e=>new e._KTXTextureLoader)),r(".ktx2",async()=>await e.A(30928).then(e=>new e._KTXTextureLoader))),t.endsWith(".tga")&&r(".tga",async()=>await e.A(58959).then(e=>new e._TGATextureLoader)),t.endsWith(".exr")&&r(".exr",async()=>await e.A(356).then(e=>new e._ExrTextureLoader)));let s=i.get(t);return s?Promise.resolve(s(n)):null}])},3427,e=>{"use strict";(0,e.i(56173).RegisterMathVector)(),e.s([])},88229,e=>{"use strict";var t=e.i(56173),i=e.i(8697),r=e.i(82648),n=e.i(10332),s=e.i(87663),a=e.i(59136),o=e.i(10977),l=e.i(68282);class h extends r.AbstractMesh{constructor(e,t){for(const i of(super(e,t.getScene()),this._indexInSourceMeshInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice(),t.getAnimationRanges()))null!=i&&this.createAnimationRange(i.name,i.from,i.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),t.skeleton||t.morphTargetManager||!t.hasBoundingInfo)this.refreshBoundingInfo(!0,!0);else{const e=t.getBoundingInfo();this.buildBoundingInfo(e.minimum,e.maximum)}this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){this._sourceMesh?.receiveShadows!==e&&i.Logger.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){this._sourceMesh?.material!==e&&i.Logger.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){this._sourceMesh?.visibility!==e&&i.Logger.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){this._sourceMesh?.skeleton!==e&&i.Logger.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){this._sourceMesh&&e!==this._sourceMesh.renderingGroupId&&i.Logger.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}get geometry(){return this._sourceMesh._geometry}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._sourceMesh.getVertexBuffer(e,t)}setVerticesData(e,t,i,r){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,r),this.sourceMesh}updateVerticesData(e,t,i,r){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,r),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData("object"==typeof e?e:{applySkeleton:e,applyMorph:t},null,o.VertexBuffer.PositionKind),i),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||i.Logger.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==a.TransformNode.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new t.Matrix);let e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,t.TmpVectors.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(t.TmpVectors.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;let t=this.sourceMesh.getLODLevels();if(t&&0!==t.length){let t=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,t.boundingSphere)}else this._currentLOD=this.sourceMesh;return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this}_generatePointsArray(){return this._sourceMesh._generatePointsArray()}_updateBoundingInfo(){return this.hasBoundingInfo?this.getBoundingInfo().update(this.worldMatrixFromCache):this.buildBoundingInfo(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}clone(e,t=null,i,r){let n=(r||this._sourceMesh).createInstance(e);if(s.DeepCopier.DeepCopy(this,n,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","hasBoundingInfo","geometry"],[]),t&&(n.parent=t),!i)for(let e=0;e<this.getScene().meshes.length;e++){let t=this.getScene().meshes[e];t.parent===this&&t.clone(t.name,n)}return n.computeWorldMatrix(!0),this.onClonedObservable.notifyObservers(n),n}dispose(e,t=!1){this._sourceMesh.removeInstance(this),super.dispose(e,t)}_serializeAsParent(e){super._serializeAsParent(e),e.parentId=this._sourceMesh.uniqueId,e.parentInstanceIndex=this._indexInSourceMeshInstanceArray}instantiateHierarchy(e=null,t,i){let r=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0,t&&t.newSourcedMesh);for(let e of(r&&i&&i(this,r),this.getChildTransformNodes(!0)))e.instantiateHierarchy(r,t,i);return r}}let c=!1;e.s(["InstancedMesh",0,h,"RegisterInstancedMesh",0,function(){c||(c=!0,n.Mesh._instancedMeshFactory=(e,t)=>{let i=new h(e,t);if(t.instancedBuffers)for(let e in i.instancedBuffers={},t.instancedBuffers)i.instancedBuffers[e]=t.instancedBuffers[e];return i},n.Mesh.prototype.registerInstancedBuffer=function(e,t){if(this._userInstancedBuffersStorage?.vertexBuffers[e]?.dispose(),this._userInstancedBuffersStorage?.renderPasses)for(let t in this._userInstancedBuffersStorage.renderPasses){let i=this._userInstancedBuffersStorage.renderPasses[t];i[e]?.dispose(),delete i[e]}if(!this.instancedBuffers)for(let e of(this.instancedBuffers={},this.instances))e.instancedBuffers={};for(let i of(this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0}),this.instancedBuffers[e]=null,this._userInstancedBuffersStorage.strides[e]=t,this._userInstancedBuffersStorage.sizes[e]=32*t,this._userInstancedBuffersStorage.data[e]=new Float32Array(this._userInstancedBuffersStorage.sizes[e]),this._userInstancedBuffersStorage.vertexBuffers[e]=this._instanceDataStorage.useMonoDataStorageRenderPass?new o.VertexBuffer(this.getEngine(),this._userInstancedBuffersStorage.data[e],e,!0,!1,t,!0):null,this.instances))i.instancedBuffers[e]=null;this._invalidateInstanceVertexArrayObject(),this._markSubMeshesAsAttributesDirty()},n.Mesh.prototype._processInstancedBuffers=function(e,t){let i,r=e?e.length:0,n=!this._instanceDataStorage.useMonoDataStorageRenderPass;if(n){let e=this._instanceDataStorage.engine.currentRenderPassId;this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={}),this._userInstancedBuffersStorage.renderPasses[e]||(this._userInstancedBuffersStorage.renderPasses[e]={}),i=this._userInstancedBuffersStorage.renderPasses[e]}for(let s in this.instancedBuffers){let a=this._userInstancedBuffersStorage.sizes[s],l=this._userInstancedBuffersStorage.strides[s],h=(r+1)*l;for(;a<h;)a*=2;this._userInstancedBuffersStorage.data[s].length!=a&&(this._userInstancedBuffersStorage.data[s]=new Float32Array(a),this._userInstancedBuffersStorage.sizes[s]=a,n?i[s]&&(i[s].dispose(),i[s]=null):this._userInstancedBuffersStorage.vertexBuffers[s]&&(this._userInstancedBuffersStorage.vertexBuffers[s].dispose(),this._userInstancedBuffersStorage.vertexBuffers[s]=null));let c=this._userInstancedBuffersStorage.data[s],u=0;if(t){let e=this.instancedBuffers[s]??0;e.toArray?e.toArray(c,u):e.copyToArray?e.copyToArray(c,u):c[u]=e,u+=l}for(let t=0;t<r;t++){let i=e[t].instancedBuffers[s]??0;i.toArray?i.toArray(c,u):i.copyToArray?i.copyToArray(c,u):c[u]=i,u+=l}n?i[s]?i[s].updateDirectly(c,0):(i[s]=new o.VertexBuffer(this.getEngine(),this._userInstancedBuffersStorage.data[s],s,!0,!1,l,!0),this._invalidateInstanceVertexArrayObject()):this._userInstancedBuffersStorage.vertexBuffers[s]?this._userInstancedBuffersStorage.vertexBuffers[s].updateDirectly(c,0):(this._userInstancedBuffersStorage.vertexBuffers[s]=new o.VertexBuffer(this.getEngine(),this._userInstancedBuffersStorage.data[s],s,!0,!1,l,!0),this._invalidateInstanceVertexArrayObject())}},n.Mesh.prototype._invalidateInstanceVertexArrayObject=function(){if(this._userInstancedBuffersStorage&&void 0!==this._userInstancedBuffersStorage.vertexArrayObjects){for(let e in this._userInstancedBuffersStorage.vertexArrayObjects)this.getEngine().releaseVertexArrayObject(this._userInstancedBuffersStorage.vertexArrayObjects[e]);this._userInstancedBuffersStorage.vertexArrayObjects={}}},n.Mesh.prototype._disposeInstanceSpecificData=function(){for(let e in this._instanceDataStorage.renderPasses)this._instanceDataStorage.renderPasses[e].instancesBuffer?.dispose();for(this._instanceDataStorage.renderPasses={},this._instanceDataStorage.dataStorageRenderPass?.instancesBuffer?.dispose();this.instances.length;)this.instances[0].dispose();for(let e in this.instancedBuffers)this._userInstancedBuffersStorage.vertexBuffers[e]&&this._userInstancedBuffersStorage.vertexBuffers[e].dispose();this._invalidateInstanceVertexArrayObject(),this.instancedBuffers={}},(0,l.RegisterClass)("BABYLON.InstancedMesh",h))}])},71567,e=>{"use strict";(0,e.i(10332).RegisterMesh)(),e.s([])},17397,23989,52998,e=>{"use strict";e.s([],23989);var t=e.i(56173),i=e.i(8697),r=e.i(72716),n=e.i(10332),s=e.i(10977);let a="bakedVertexAnimationSettingsInstanced";function o(e){let t=e.bakedVertexAnimationManager?.texture?.getInternalTexture()?._bufferView;return t instanceof Float32Array||t instanceof Uint16Array}let l=!1;function h(){l||(l=!0,n.Mesh.prototype.thinInstanceAdd=function(e,t=!0){if(!this.getScene().getEngine().getCaps().instancedArrays)return i.Logger.Error("Thin Instances are not supported on this device as Instanced Array extension not supported"),-1;this._thinInstanceUpdateBufferSize("matrix",Array.isArray(e)?e.length:1);let r=this._thinInstanceDataStorage.instancesCount;if(Array.isArray(e))for(let i=0;i<e.length;++i)this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e[i],i===e.length-1&&t);else this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++,e,t);return r},n.Mesh.prototype.thinInstanceAddSelf=function(e=!0){return this.thinInstanceAdd(t.Matrix.IdentityReadOnly,e)},n.Mesh.prototype.thinInstanceRegisterAttribute=function(e,t){e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),this.removeVerticesData(e),this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.strides[e]=t,this._userThinInstanceBuffersStorage.sizes[e]=t*Math.max(32,this._thinInstanceDataStorage.instancesCount),this._userThinInstanceBuffersStorage.data[e]=new Float32Array(this._userThinInstanceBuffersStorage.sizes[e]),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new s.VertexBuffer(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!0,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e])},n.Mesh.prototype.thinInstanceSetMatrixAt=function(e,t,i=!0){if(!this._thinInstanceDataStorage.matrixData||e>=this._thinInstanceDataStorage.instancesCount)return!1;let r=this._thinInstanceDataStorage.matrixData;return t.copyToArray(r,16*e),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[e]=t),i&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0},n.Mesh.prototype.thinInstanceSetAttributeAt=function(e,t,i,r=!0){return e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),!!this._userThinInstanceBuffersStorage&&!!this._userThinInstanceBuffersStorage.data[e]&&!(t>=this._thinInstanceDataStorage.instancesCount)&&(this._thinInstanceUpdateBufferSize(e,0),this._userThinInstanceBuffersStorage.data[e].set(i,t*this._userThinInstanceBuffersStorage.strides[e]),r&&this.thinInstanceBufferUpdated(e),!0)},Object.defineProperty(n.Mesh.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(e){let t=this._thinInstanceDataStorage.matrixData??this.source?._thinInstanceDataStorage.matrixData;e<=(t?t.length/16:0)&&(this._thinInstanceDataStorage.instancesCount=e)},enumerable:!0,configurable:!0}),n.Mesh.prototype._thinInstanceCreateMatrixBuffer=function(e,t,i=!0){let r=new s.Buffer(this.getEngine(),t,!i,16,!1,!0);for(let t=0;t<4;t++)this.setVerticesBuffer(r.createVertexBuffer(e+t,4*t,4));return r},n.Mesh.prototype.thinInstanceSetBuffer=function(e,t,i=0,r=!0){if(i=i||16,"matrix"===e)this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=t?t.length:32*i,this._thinInstanceDataStorage.matrixData=t,this._thinInstanceDataStorage.worldMatrices=null,null!==t?(this._thinInstanceDataStorage.instancesCount=t.length/i,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",t,r),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo());else if("previousMatrix"===e)this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=t,null!==t&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",t,r));else if("splatIndex"===e&&t){this._thinInstanceInitializeUserStorage(),this._thinInstanceDataStorage.instancesCount=t.length/i,this._userThinInstanceBuffersStorage.data[e]=t,this._userThinInstanceBuffersStorage.strides[e]=i,this._userThinInstanceBuffersStorage.sizes[e]=t.length;let r=new s.Buffer(this.getEngine(),t,!0,16,!1,!0);this._thinInstanceDataStorage.matrixBuffer=r;for(let t=0;t<4;t++)this.setVerticesBuffer(r.createVertexBuffer(e+t,4*t,4))}else e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),null===t?this._userThinInstanceBuffersStorage?.data[e]&&(this.removeVerticesData(e),delete this._userThinInstanceBuffersStorage.data[e],delete this._userThinInstanceBuffersStorage.strides[e],delete this._userThinInstanceBuffersStorage.sizes[e],delete this._userThinInstanceBuffersStorage.vertexBuffers[e]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[e]=t,this._userThinInstanceBuffersStorage.strides[e]=i,this._userThinInstanceBuffersStorage.sizes[e]=t.length,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new s.VertexBuffer(this.getEngine(),t,e,!r,!1,i,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))},n.Mesh.prototype.thinInstanceBufferUpdated=function(e){"matrix"===e?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):"previousMatrix"===e?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._thinInstanceDataStorage.previousMatrixBuffer?.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):"splatIndex"===e?this._thinInstanceDataStorage.matrixBuffer?.updateDirectly(this._userThinInstanceBuffersStorage.data[e],0,this._thinInstanceDataStorage.instancesCount):(e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[e]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[e].isUpdatable()&&this._thinInstanceRecreateBuffer(e),this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(this._userThinInstanceBuffersStorage.data[e],0)))},n.Mesh.prototype.thinInstancePartialBufferUpdate=function(e,t,i){if("matrix"===e)this._thinInstanceDataStorage.matrixBuffer&&("number"==typeof t?this._thinInstanceDataStorage.matrixBuffer.updateDirectly(new Float32Array(this._thinInstanceDataStorage.matrixData.buffer,this._thinInstanceDataStorage.matrixData.byteOffset+16*i*Float32Array.BYTES_PER_ELEMENT,16*t),16*i):this._thinInstanceDataStorage.matrixBuffer.updateDirectly(t,i));else if(e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage?.vertexBuffers[e]){let r=this._userThinInstanceBuffersStorage.vertexBuffers[e];if("number"==typeof t){let r=new Float32Array(this._userThinInstanceBuffersStorage.data[e].buffer,this._userThinInstanceBuffersStorage.data[e].byteOffset+i*this._userThinInstanceBuffersStorage.strides[e]*Float32Array.BYTES_PER_ELEMENT,t*this._userThinInstanceBuffersStorage.strides[e]);this._userThinInstanceBuffersStorage.vertexBuffers[e].updateDirectly(r,i*this._userThinInstanceBuffersStorage.strides[e])}else r.updateDirectly(t,i)}},n.Mesh.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];let e=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let i=0;i<this._thinInstanceDataStorage.instancesCount;++i)this._thinInstanceDataStorage.worldMatrices[i]=t.Matrix.FromArray(e,16*i)}return this._thinInstanceDataStorage.worldMatrices},n.Mesh.prototype.thinInstanceRefreshBoundingInfo=function(e=!1,i=!1,n=!1,l=!1){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return;let h=this._thinInstanceDataStorage.boundingVectors;if(e||!this.rawBoundingInfo){if(h.length=0,l&&function(e,i,n){let l=e._userThinInstanceBuffersStorage,h=l?.data[a],c=l?.strides[a];if(!h||!c||c<4||!o(e))return!1;let u=e._thinInstanceDataStorage.matrixData;if(!u)return!1;let d={},_=t.TmpVectors.Vector4[0],f=t.TmpVectors.Vector3[1],g=t.TmpVectors.Vector3[2],m=t.TmpVectors.Vector3[3],p=t.TmpVectors.Vector3[4],T=t.TmpVectors.Vector3[5],I=t.TmpVectors.Vector3[6],E=t.TmpVectors.Matrix[2],y=e.geometry?e.geometry.boundingBias:null,M=e.getTotalVertices();f.setAll(1/0),g.setAll(-1/0),m.setAll(1/0),p.setAll(-1/0);for(let i=0;i<e._thinInstanceDataStorage.instancesCount;++i){let r=i*c;_.set(h[r],h[r+1],h[r+2],h[r+3]);let a=e._getData({applyMorph:n,applyBakedVertexAnimation:!0,bakedVertexAnimationSettings:_,updatePositionsArray:!1,cache:d},null,s.VertexBuffer.PositionKind);if(!a)return!1;T.setAll(1/0),I.setAll(-1/0);for(let e=0;e<3*M;e+=3){let t=a[e],i=a[e+1],r=a[e+2];t<T.x&&(T.x=t),i<T.y&&(T.y=i),r<T.z&&(T.z=r),t>I.x&&(I.x=t),i>I.y&&(I.y=i),r>I.z&&(I.z=r)}y&&(T.x-=T.x*y.x+y.y,T.y-=T.y*y.x+y.y,T.z-=T.z*y.x+y.y,I.x+=I.x*y.x+y.y,I.y+=I.y*y.x+y.y,I.z+=I.z*y.x+y.y),f.minimizeInPlace(T),g.maximizeInPlace(I),t.Matrix.FromArrayToRef(u,16*i,E),y?function(e,i,r,n,s){let a=t.TmpVectors.Vector3[7],o=t.TmpVectors.Vector3[8];for(let l=0;l<2;++l)for(let h=0;h<2;++h)for(let c=0;c<2;++c)a.set(l?i.x:e.x,h?i.y:e.y,c?i.z:e.z),t.Vector3.TransformCoordinatesToRef(a,r,o),n.minimizeInPlace(o),s.maximizeInPlace(o)}(T,I,E,m,p):function(e,i,r,n,s){let a=t.TmpVectors.Vector3[7];for(let o=0;o<3*i;o+=3)t.Vector3.TransformCoordinatesFromFloatsToRef(e[o],e[o+1],e[o+2],r,a),n.minimizeInPlace(a),s.maximizeInPlace(a)}(a,M,E,m,p)}if(!isFinite(f.x)||!isFinite(m.x))return!1;e.getBoundingInfo().reConstruct(m,p),e.rawBoundingInfo=new r.BoundingInfo(f,g);var S=e.rawBoundingInfo;i.length=0;for(let e=0;e<S.boundingBox.vectors.length;++e)i.push(S.boundingBox.vectors[e].clone());return e._updateBoundingInfo(),!0}(this,h,n))return;l&&this.bakedVertexAnimationManager?.isEnabled&&o(this)?this.refreshBoundingInfo({applySkeleton:i,applyMorph:n,applyBakedVertexAnimation:!0,updatePositionsArray:!1}):this.refreshBoundingInfo(i,n);let e=this.getBoundingInfo();this.rawBoundingInfo=new r.BoundingInfo(e.minimum,e.maximum)}let c=this.getBoundingInfo(),u=this._thinInstanceDataStorage.matrixData;if(0===h.length)for(let e=0;e<c.boundingBox.vectors.length;++e)h.push(c.boundingBox.vectors[e].clone());t.TmpVectors.Vector3[0].setAll(1/0),t.TmpVectors.Vector3[1].setAll(-1/0);for(let e=0;e<this._thinInstanceDataStorage.instancesCount;++e){t.Matrix.FromArrayToRef(u,16*e,t.TmpVectors.Matrix[0]);for(let e=0;e<h.length;++e)t.Vector3.TransformCoordinatesToRef(h[e],t.TmpVectors.Matrix[0],t.TmpVectors.Vector3[2]),t.TmpVectors.Vector3[0].minimizeInPlace(t.TmpVectors.Vector3[2]),t.TmpVectors.Vector3[1].maximizeInPlace(t.TmpVectors.Vector3[2])}c.reConstruct(t.TmpVectors.Vector3[0],t.TmpVectors.Vector3[1]),this._updateBoundingInfo()},n.Mesh.prototype._thinInstanceRecreateBuffer=function(e,t=!0){"matrix"===e?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",this._thinInstanceDataStorage.matrixData,t)):"previousMatrix"===e?this._scene.needsPreviousWorldMatrices&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.previousMatrixData??this._thinInstanceDataStorage.matrixData,t)):(e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind),this._userThinInstanceBuffersStorage.vertexBuffers[e]?.dispose(),this._userThinInstanceBuffersStorage.vertexBuffers[e]=new s.VertexBuffer(this.getEngine(),this._userThinInstanceBuffersStorage.data[e],e,!t,!1,this._userThinInstanceBuffersStorage.strides[e],!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))},n.Mesh.prototype._thinInstanceUpdateBufferSize=function(e,t=1){e===s.VertexBuffer.ColorKind&&(e=s.VertexBuffer.ColorInstanceKind);let i="matrix"===e;if(!i&&(!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.strides[e]))return;let r=i?16:this._userThinInstanceBuffersStorage.strides[e],n=i?this._thinInstanceDataStorage.matrixBufferSize:this._userThinInstanceBuffersStorage.sizes[e],a=i?this._thinInstanceDataStorage.matrixData:this._userThinInstanceBuffersStorage.data[e],o=(this._thinInstanceDataStorage.instancesCount+t)*r,l=n;for(;l<o;)l*=2;if(!a||n!=l){if(a){let e=new Float32Array(l);e.set(a,0),a=e}else a=new Float32Array(l);i?(this._thinInstanceDataStorage.matrixBuffer?.dispose(),this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",a,!1),this._thinInstanceDataStorage.matrixData=a,this._thinInstanceDataStorage.matrixBufferSize=l,this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",a,!1))):(this._userThinInstanceBuffersStorage.vertexBuffers[e]?.dispose(),this._userThinInstanceBuffersStorage.data[e]=a,this._userThinInstanceBuffersStorage.sizes[e]=l,this._userThinInstanceBuffersStorage.vertexBuffers[e]=new s.VertexBuffer(this.getEngine(),a,e,!0,!1,r,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[e]))}},n.Mesh.prototype._thinInstanceInitializeUserStorage=function(){this._userThinInstanceBuffersStorage||(this._userThinInstanceBuffersStorage={data:{},sizes:{},vertexBuffers:{},strides:{}})},n.Mesh.prototype._disposeThinInstanceSpecificData=function(){this._thinInstanceDataStorage?.matrixBuffer&&(this._thinInstanceDataStorage.matrixBuffer.dispose(),this._thinInstanceDataStorage.matrixBuffer=null),this._thinInstanceDataStorage?.previousMatrixBuffer&&(this._thinInstanceDataStorage.previousMatrixBuffer.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null)})}e.s(["RegisterThinInstanceMesh",0,h],52998),h(),e.s([],17397)},70081,e=>{"use strict";e.s(["RandomGUID",0,function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}])},8697,e=>{"use strict";class t{static _CheckLimit(e,i){let r=t._LogLimitOutputs[e];return r?r.current++:(r={limit:i,current:1},t._LogLimitOutputs[e]=r),r.current<=r.limit}static _GenerateLimitMessage(e,i=1){let r=t._LogLimitOutputs[e];if(!r||!t.MessageLimitReached)return;let n=this._Levels[i];r.current===r.limit&&t[n.name](t.MessageLimitReached.replace(/%LIMIT%/g,""+r.limit).replace(/%TYPE%/g,n.name??""))}static _AddLogEntry(e){t._LogCache=e+t._LogCache,t.OnNewCacheEntry&&t.OnNewCacheEntry(e)}static _FormatMessage(e){let t=e=>e<10?"0"+e:""+e,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,i,r){let n=Array.isArray(i)?i[0]:i;if(void 0!==r&&!t._CheckLimit(n,r))return;let s=t._FormatMessage(n),a=this._Levels[e],o=Array.isArray(i)?i.slice(1):[];a.logFunc&&a.logFunc("BJS - "+s,...o);let l=`<div style='color:${a.color}'>${s}</div><br>`;t._AddLogEntry(l),t._GenerateLimitMessage(n,e)}static get LogCache(){return t._LogCache}static ClearLogCache(){t._LogCache="",t._LogLimitOutputs={},t.errorsCount=0}static set LogLevels(e){for(let i of(t.Log=t._LogDisabled,t.Warn=t._LogDisabled,t.Error=t._LogDisabled,[t.MessageLogLevel,t.WarningLogLevel,t.ErrorLogLevel]))(e&i)===i&&(t[this._Levels[i].name]=t._LogEnabled.bind(t,i))}}t.NoneLogLevel=0,t.MessageLogLevel=1,t.WarningLogLevel=2,t.ErrorLogLevel=4,t.AllLogLevel=7,t.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.",t._LogCache="",t._LogLimitOutputs={},t._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}],t.errorsCount=0,t.Log=t._LogEnabled.bind(t,t.MessageLogLevel),t.Warn=t._LogEnabled.bind(t,t.WarningLogLevel),t.Error=t._LogEnabled.bind(t,t.ErrorLogLevel),e.s(["Logger",0,t])},90138,64950,e=>{"use strict";var t=e.i(2103);class i{constructor(e){this._samples=Array(e),this.reset()}add(e){let t;if(this.isSaturated()){let e=this._samples[this._pos];t=e-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(e-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;let t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){let t=this._samples.length;return(e%t+t)%t}}e.s(["PerformanceMonitor",0,class{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new i(e)}sampleFrame(e=t.PrecisionDate.Now){if(this._enabled){if(null!=this._lastFrameTimeMs){let t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){let e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}],90138);var r=e.i(45735),n=e.i(18405),s=e.i(71829);function a(e){return Number.isFinite(e.ascent)&&Number.isFinite(e.height)&&Number.isFinite(e.descent)&&e.height>0}async function o(e,t,i){return await new Promise((r,n)=>{let s=new Image;s.onload=()=>{s.decode().then(()=>{e.createImageBitmap(s,i).then(e=>{r(e)})})},s.onerror=()=>{n(`Error loading image ${s.src}`)},s.src=t})}function l(e){if(e.requestPointerLock){let t=e.requestPointerLock();t instanceof Promise?t.then(()=>{e.focus()}).catch(()=>{}):e.focus()}}e.s(["CreateImageBitmapFromSource",0,o,"ExitFullscreen",0,function(){let e=document;document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()},"ExitPointerlock",0,function(){document.exitPointerLock&&document.exitPointerLock()},"GetFontOffset",0,function(e){var t;let i,n,s,o,l=function(e){let t,i;if(!(0,r.IsDocumentAvailable)()||!document.body)return null;let n=document.createElement("span");n.textContent="Hg",n.style.font=e;let s=document.createElement("div");s.style.display="inline-block",s.style.width="1px",s.style.height="0px",s.style.verticalAlign="bottom";let o=document.createElement("div");o.style.whiteSpace="nowrap",o.appendChild(n),o.appendChild(s),document.body.appendChild(o);try{i=s.getBoundingClientRect().top-n.getBoundingClientRect().top,s.style.verticalAlign="baseline",t=s.getBoundingClientRect().top-n.getBoundingClientRect().top}finally{document.body.removeChild(o)}let l={ascent:t,height:i,descent:i-t};return a(l)?l:null}(e);if(l)return l;let h=function(e){let t=null;try{"u">typeof OffscreenCanvas?t=new OffscreenCanvas(64,64):(0,r.IsDocumentAvailable)()&&"function"==typeof document.createElement&&((t=document.createElement("canvas")).width=64,t.height=64);let i=t?.getContext("2d");if(!i)return null;i.font=e;let n=i.measureText("Hg"),s=Number(n.actualBoundingBoxAscent??n.fontBoundingBoxAscent),o=Number(n.actualBoundingBoxDescent??n.fontBoundingBoxDescent),l={ascent:s,height:s+o,descent:o};return a(l)?l:null}catch{return null}finally{let e=t;"function"==typeof e?.dispose&&e.dispose()}}(e);return h||(s=.8*(n=Math.max(1,(t=e,(i=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(t||"")))?Number(i[1]):16))),{ascent:s,height:s+(o=.2*n),descent:o})},"RequestFullscreen",0,function(e){let t=e.requestFullscreen||e.webkitRequestFullscreen;t&&t.call(e)},"RequestPointerlock",0,l,"ResizeImageBitmap",0,function(e,t,i,r){let n=e.createCanvas(i,r).getContext("2d");if(!n)throw Error("Unable to get 2d context for resizeImageBitmap");return n.drawImage(t,0,0),n.getImageData(0,0,i,r).data},"_CommonDispose",0,function(e,t){1===s.EngineStore.Instances.length&&n.AbstractEngine.audioEngine&&(n.AbstractEngine.audioEngine.dispose(),n.AbstractEngine.audioEngine=null);let i=e.getHostWindow();i&&"function"==typeof i.removeEventListener&&(i.removeEventListener("blur",e._onBlur),i.removeEventListener("focus",e._onFocus)),t&&(t.removeEventListener("focus",e._onCanvasFocus),t.removeEventListener("blur",e._onCanvasBlur),t.removeEventListener("pointerout",e._onCanvasPointerOut),t.removeEventListener("contextmenu",e._onCanvasContextMenu)),(0,r.IsDocumentAvailable)()&&(document.removeEventListener("fullscreenchange",e._onFullscreenChange),document.removeEventListener("mozfullscreenchange",e._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",e._onFullscreenChange),document.removeEventListener("msfullscreenchange",e._onFullscreenChange),document.removeEventListener("pointerlockchange",e._onPointerLockChange),document.removeEventListener("mspointerlockchange",e._onPointerLockChange),document.removeEventListener("mozpointerlockchange",e._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",e._onPointerLockChange))},"_CommonInit",0,function(e,t,i){e._onCanvasFocus=()=>{e.onCanvasFocusObservable.notifyObservers(e)},e._onCanvasBlur=()=>{e.onCanvasBlurObservable.notifyObservers(e)},e._onCanvasContextMenu=t=>{e.disableContextMenu&&t.preventDefault()},t.addEventListener("focus",e._onCanvasFocus),t.addEventListener("blur",e._onCanvasBlur),t.addEventListener("contextmenu",e._onCanvasContextMenu),e._onBlur=()=>{e.disablePerformanceMonitorInBackground&&e.performanceMonitor.disable(),e._windowIsBackground=!0},e._onFocus=()=>{e.disablePerformanceMonitorInBackground&&e.performanceMonitor.enable(),e._windowIsBackground=!1},e._onCanvasPointerOut=i=>{document.elementFromPoint(i.clientX,i.clientY)!==t&&e.onCanvasPointerOutObservable.notifyObservers(i)};let s=e.getHostWindow();s&&"function"==typeof s.addEventListener&&(s.addEventListener("blur",e._onBlur),s.addEventListener("focus",e._onFocus)),t.addEventListener("pointerout",e._onCanvasPointerOut),!i.doNotHandleTouchAction&&t&&t.setAttribute&&(t.setAttribute("touch-action","none"),t.style.touchAction="none",t.style.webkitTapHighlightColor="transparent"),!n.AbstractEngine.audioEngine&&i.audioEngine&&n.AbstractEngine.AudioEngineFactory&&(n.AbstractEngine.audioEngine=n.AbstractEngine.AudioEngineFactory(e.getRenderingCanvas(),e.getAudioContext(),e.getAudioDestination())),(0,r.IsDocumentAvailable)()&&(e._onFullscreenChange=()=>{e.isFullscreen=!!document.fullscreenElement,e.isFullscreen&&e._pointerLockRequested&&t&&l(t)},document.addEventListener("fullscreenchange",e._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",e._onFullscreenChange,!1),e._onPointerLockChange=()=>{e.isPointerLock=document.pointerLockElement===t},document.addEventListener("pointerlockchange",e._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",e._onPointerLockChange,!1)),e.enableOfflineSupport=void 0!==n.AbstractEngine.OfflineProviderFactory,e._deterministicLockstep=!!i.deterministicLockstep,e._lockstepMaxSteps=i.lockstepMaxSteps||0,e._timeStep=i.timeStep||1/60}],64950)},54616,e=>{"use strict";class t{constructor(e){this._pendingActions=[],this._workerInfos=e.map(e=>({workerPromise:Promise.resolve(e),idle:!0}))}dispose(){for(let e of this._workerInfos)e.workerPromise.then(e=>{e.terminate()});this._workerInfos.length=0,this._pendingActions.length=0}push(e){this._executeOnIdleWorker(e)||this._pendingActions.push(e)}_executeOnIdleWorker(e){for(let t of this._workerInfos)if(t.idle)return this._execute(t,e),!0;return!1}_execute(e,t){e.idle=!1,e.workerPromise.then(i=>{t(i,()=>{let t=this._pendingActions.shift();t?this._execute(e,t):e.idle=!0})})}}class i extends t{constructor(e,t,r=i.DefaultOptions){super([]),this._maxWorkers=e,this._createWorkerAsync=t,this._options=r}push(e){if(!this._executeOnIdleWorker(e))if(this._workerInfos.length<this._maxWorkers){let t={workerPromise:this._createWorkerAsync(),idle:!1};this._workerInfos.push(t),this._execute(t,e)}else this._pendingActions.push(e)}_execute(e,t){e.timeoutId&&(clearTimeout(e.timeoutId),delete e.timeoutId),super._execute(e,(i,r)=>{t(i,()=>{r(),e.idle&&(e.timeoutId=setTimeout(()=>{e.workerPromise.then(e=>{e.terminate()});let t=this._workerInfos.indexOf(e);-1!==t&&this._workerInfos.splice(t,1)},this._options.idleTimeElapsedBeforeRelease))})})}}i.DefaultOptions={idleTimeElapsedBeforeRelease:1e3},e.s(["AutoReleaseWorkerPool",0,i])},98687,27746,e=>{"use strict";var t=e.i(60699),i=e.i(65678);(0,i.RegisterFlowGraphRichTypes)(),e.s([],27746);class r extends t.FlowGraphBlock{constructor(e){super(e);const t=e.glTF,r=t?.animations?.map(e=>e._babylonAnimationGroup)||[];this.animationGroups=this.registerDataOutput("animationGroups",i.RichTypeAny,r);const n=t?.nodes?.map(e=>e._babylonTransformNode)||[];this.nodes=this.registerDataOutput("nodes",i.RichTypeAny,n)}getClassName(){return"FlowGraphGLTFDataProvider"}}e.s(["FlowGraphGLTFDataProvider",0,r],98687)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15099,t=>{"use strict";var e=t.i(23422),o=t.i(65678),u=t.i(68282);class i extends e.FlowGraphExecutionBlockWithOutSignal{constructor(t){super(t),this.sound=this.registerDataInput("sound",o.RichTypeAny),this.volume=this.registerDataInput("volume",o.RichTypeNumber,1)}_execute(t,e){let o=this.sound.getValue(t);if(!o){this._reportError(t,"No sound provided"),this.out._activateSignal(t);return}o.volume=this.volume.getValue(t),this.out._activateSignal(t)}getClassName(){return"FlowGraphSetSoundVolumeBlock"}}let l=!1;t.s(["FlowGraphSetSoundVolumeBlock",0,i,"RegisterFlowGraphSetSoundVolumeBlock",0,function(){l||(l=!0,(0,u.RegisterClass)("FlowGraphSetSoundVolumeBlock",i))}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28803,e=>{"use strict";var t=e.i(65678),i=e.i(82600),l=e.i(56173),a=e.i(68282);class s extends i.FlowGraphCachedOperationBlock{constructor(e){super(t.RichTypeVector3,e),this.body=this.registerDataInput("body",t.RichTypeAny)}_doOperation(e){let t=this.body.getValue(e);if(!t)return;let i=e._getExecutionVariable(this,"_cachedVelocity",null);return i||(i=new l.Vector3,e._setExecutionVariable(this,"_cachedVelocity",i)),t.getLinearVelocityToRef(i),i}getClassName(){return"FlowGraphGetLinearVelocityBlock"}}let o=!1;e.s(["FlowGraphGetLinearVelocityBlock",0,s,"RegisterFlowGraphGetLinearVelocityBlock",0,function(){o||(o=!0,(0,a.RegisterClass)("FlowGraphGetLinearVelocityBlock",s))}])},82600,e=>{"use strict";var t=e.i(60699),i=e.i(65678);let l="cachedOperationValue",a="cachedExecutionId";class s extends t.FlowGraphBlock{constructor(e,t){super(t),this._outputRichType=e,this.value=this.registerDataOutput("value",e),this.isValid=this.registerDataOutput("isValid",i.RichTypeBoolean)}_getInvalidOutputValue(e){let t=this._outputRichType.defaultValue,i=t?.clone;return"function"==typeof i?i.call(t):t}_updateOutputs(e){let t=e._getExecutionVariable(this,a,-1),i=e._getExecutionVariable(this,l,null);if(null!=i&&t===e.executionId)this.isValid.setValue(!0,e),this.value.setValue(i,e);else try{let t=this._doOperation(e);if(null==t)return void this._setInvalid(e);e._setExecutionVariable(this,l,t),e._setExecutionVariable(this,a,e.executionId),this.value.setValue(t,e),this.isValid.setValue(!0,e)}catch(t){this._setInvalid(e)}}_setInvalid(e){this.isValid.setValue(!1,e),this.value.setValue(this._getInvalidOutputValue(e),e)}}e.s(["FlowGraphCachedOperationBlock",0,s])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24316,e=>{"use strict";var t=e.i(476);let i=!1;i=!0,t.ThinEngine.prototype.setAlphaMode=function(e,t=!1,i=0){if(this._alphaMode[i]===e){if(!t){let t=0===e;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}let r=0===e;this._alphaState.setAlphaBlend(!r,i),this._alphaState.setAlphaMode(e,i),t||(this.depthCullingState.depthMask=r),this._alphaMode[i]=e};let r=!1;!function(){if(r)return;r=!0;let e=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap;t.ThinEngine.prototype.getAlphaToCoverage=function(){return e.get(this)??!1},t.ThinEngine.prototype.setAlphaToCoverage=function(t){e.get(this)===t&&(!this._gl||i.get(this)===this._gl)||(e.set(this,t),this._gl&&(t?this._gl.enable(this._gl.SAMPLE_ALPHA_TO_COVERAGE):this._gl.disable(this._gl.SAMPLE_ALPHA_TO_COVERAGE),i.set(this,this._gl)))},Object.defineProperty(t.ThinEngine.prototype,"currentSampleCount",{get:function(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._gl?(s.get(this)!==this._gl&&(n.set(this,this._gl.getContextAttributes()?.antialias?Math.max(1,this._gl.getParameter(this._gl.SAMPLES)):1),s.set(this,this._gl)),n.get(this)):1},enumerable:!1,configurable:!0})}();var n=e.i(58724),s=e.i(8697),a=e.i(4696);let l=!1;function h(e,t,i,r){let n,s=1;1===r?n=new Float32Array(t*i*4):2===r?(n=new Uint16Array(t*i*4),s=15360):n=7===r?new Uint32Array(t*i*4):new Uint8Array(t*i*4);for(let r=0;r<t;r++)for(let a=0;a<i;a++){let i=(a*t+r)*3,l=(a*t+r)*4;n[l+0]=e[i+0],n[l+1]=e[i+1],n[l+2]=e[i+2],n[l+3]=s}return n}function u(e){return function(t,i,r,s,a,l,h,u,_=null,o=0){let f=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,c=new n.InternalTexture(this,e?10:11);c.baseWidth=i,c.baseHeight=r,c.baseDepth=s,c.width=i,c.height=r,c.depth=s,c.format=a,c.type=o,c.generateMipMaps=l,c.samplingMode=u,e?c.is3D=!0:c.is2DArray=!0,this._doNotHandleContextLost||(c._bufferView=t),e?this.updateRawTexture3D(c,t,a,h,_,o):this.updateRawTexture2DArray(c,t,a,h,_,o),this._bindTextureDirectly(f,c,!0);let p=this._getSamplingParameters(u,l);return this._gl.texParameteri(f,this._gl.TEXTURE_MAG_FILTER,p.mag),this._gl.texParameteri(f,this._gl.TEXTURE_MIN_FILTER,p.min),l&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null),this._internalTexturesCache.push(c),c}}function _(e){return function(t,i,r,n,s=null,a=0){let l=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,h=this._getWebGLTextureType(a),u=this._getInternalFormat(r),_=this._getRGBABufferInternalSizedFormat(a,r);this._bindTextureDirectly(l,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=i,t.format=r,t.invertY=n,t._compression=s),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),s&&i?this._gl.compressedTexImage3D(l,0,this.getCaps().s3tc[s],t.width,t.height,t.depth,0,i):this._gl.texImage3D(l,0,_,t.width,t.height,t.depth,0,u,h,i),t.generateMipMaps&&this._gl.generateMipmap(l),this._bindTextureDirectly(l,null),t.isReady=!0}}l=!0,t.ThinEngine.prototype.updateRawTexture=function(e,t,i,r,n=null,s=0,a=!1){if(!e)return;let l=this._getRGBABufferInternalSizedFormat(s,i,a),h=this._getInternalFormat(i),u=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===r||!!r),this._doNotHandleContextLost||(e._bufferView=t,e.format=i,e.type=s,e.invertY=r,e._compression=n),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),n&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[n],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,l,e.width,e.height,0,h,u,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0},t.ThinEngine.prototype.createRawTexture=function(e,t,i,r,s,a,l,h=null,u=0,_=0,o=!1){let f=new n.InternalTexture(this,3);f.baseWidth=t,f.baseHeight=i,f.width=t,f.height=i,f.format=r,f.generateMipMaps=s,f.samplingMode=l,f.invertY=a,f._compression=h,f.type=u,f._useSRGBBuffer=this._getUseSRGBBuffer(o,!s),this._doNotHandleContextLost||(f._bufferView=e),this.updateRawTexture(f,e,r,a,h,u,f._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,f,!0);let c=this._getSamplingParameters(l,s);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,c.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,c.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(f),f},t.ThinEngine.prototype.createRawCubeTexture=function(e,t,i,r,l,h,u,_=null){let o=this._gl,f=new n.InternalTexture(this,8);f.isCube=!0,f.format=i,f.type=r,this._doNotHandleContextLost||(f._bufferViewArray=e);let c=this._getWebGLTextureType(r),p=this._getInternalFormat(i);if(p===o.RGB&&(p=o.RGBA),c!==o.FLOAT||this._caps.textureFloatLinearFiltering?c!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?c!==o.FLOAT||this._caps.textureFloatRender?c!==o.HALF_FLOAT||this._caps.colorBufferFloat||(l=!1,s.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(l=!1,s.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(l=!1,u=1,s.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(l=!1,u=1,s.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")),f.width=t,f.height=t,f.invertY=h,f._compression=_,!this.needPOTTextures||(0,a.IsExponentOfTwo)(f.width)&&(0,a.IsExponentOfTwo)(f.height)||(l=!1),e)this.updateRawCubeTexture(f,e,i,r,h,_);else{let e=this._getRGBABufferInternalSizedFormat(r);this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,f,!0);for(let t=0;t<6;t++)_?o.compressedTexImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this.getCaps().s3tc[_],f.width,f.height,0,void 0):o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,e,f.width,f.height,0,p,c,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,f,!0),e&&l&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);let T=this._getSamplingParameters(u,l);return o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,T.mag),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,T.min),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),f.generateMipMaps=l,f.samplingMode=u,f.isReady=!0,f},t.ThinEngine.prototype.updateRawCubeTexture=function(e,t,i,r,n,s=null,l=0){e._bufferViewArray=t,e.format=i,e.type=r,e.invertY=n,e._compression=s;let u=this._gl,_=this._getWebGLTextureType(r),o=this._getInternalFormat(i),f=this._getRGBABufferInternalSizedFormat(r),c=!1;o===u.RGB&&(o=u.RGBA,c=!0),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===n||!!n),e.width%4!=0&&u.pixelStorei(u.UNPACK_ALIGNMENT,1);for(let i=0;i<6;i++){let n=t[i];s?u.compressedTexImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+i,l,this.getCaps().s3tc[s],e.width,e.height,0,n):(c&&(n=h(n,e.width,e.height,r)),u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+i,l,f,e.width,e.height,0,o,_,n))}(!this.needPOTTextures||(0,a.IsExponentOfTwo)(e.width)&&(0,a.IsExponentOfTwo)(e.height))&&e.generateMipMaps&&0===l&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},t.ThinEngine.prototype.createRawCubeTextureFromUrl=function(e,t,i,r,n,s,a,l,u=null,_=null,o=3,f=!1){let c=this._gl,p=this.createRawCubeTexture(null,i,r,n,!s,f,o,null);t?.addPendingData(p),p.url=e,p.isReady=!1,this._internalTexturesCache.push(p);let T=(e,i)=>{t?.removePendingData(p),_&&_(e?e.status+" "+e.statusText:"Failed to parse texture data",i)},d=async e=>{if(!p._hardwareTexture)return;let i=a(e);if(!i)return;let s=i instanceof Promise?await i:i,_=p.width;if(l){let e=this._getWebGLTextureType(n),t=this._getInternalFormat(r),i=this._getRGBABufferInternalSizedFormat(n),a=!1;t===c.RGB&&(t=c.RGBA,a=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,p,!0),this._unpackFlipY(!1);let u=l(s);for(let r=0;r<u.length;r++){let s=_>>r;for(let l=0;l<6;l++){let _=u[r][l];a&&(_=h(_,s,s,n)),c.texImage2D(l,r,i,s,s,0,t,e,_)}}this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(p,s,r,n,f);p.isReady=!0,t?.removePendingData(p),p.onLoadedObservable.notifyObservers(p),p.onLoadedObservable.clear(),u&&u()};return this._loadFile(e,e=>{d(e).catch(e=>{T(void 0,e)})},void 0,t?.offlineProvider,!0,T),p},t.ThinEngine.prototype.createRawTexture2DArray=u(!1),t.ThinEngine.prototype.createRawTexture3D=u(!0),t.ThinEngine.prototype.updateRawTexture2DArray=_(!1),t.ThinEngine.prototype.updateRawTexture3D=_(!0);var o=e.i(20969);let f=!1;f=!0,t.ThinEngine.prototype._readTexturePixelsSync=function(e,t,i,r=-1,n=0,s=null,a=!0,l=!1,h=0,u=0){let _=this._gl;if(!_)throw Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){let e=_.createFramebuffer();if(!e)throw Error("Unable to create dummy framebuffer");this._dummyFramebuffer=e}_.bindFramebuffer(_.FRAMEBUFFER,this._dummyFramebuffer),r>-1&&(e.is2DArray||e.is3D)?_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,e._hardwareTexture?.underlyingResource,n,r):r>-1?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+r,e._hardwareTexture?.underlyingResource,n):_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e._hardwareTexture?.underlyingResource,n);let f=void 0!==e.type?this._getWebGLTextureType(e.type):_.UNSIGNED_BYTE;return l?s||(s=(0,o.allocateAndCopyTypedBuffer)(e.type,4*t*i)):f===_.UNSIGNED_BYTE?(s||(s=new Uint8Array(4*t*i)),f=_.UNSIGNED_BYTE):(s||(s=new Float32Array(4*t*i)),f=_.FLOAT),a&&this.flushFramebuffer(),_.readPixels(h,u,t,i,_.RGBA,f,s),_.bindFramebuffer(_.FRAMEBUFFER,this._currentFramebuffer),s},t.ThinEngine.prototype._readTexturePixels=function(e,t,i,r=-1,n=0,s=null,a=!0,l=!1,h=0,u=0){return Promise.resolve(this._readTexturePixelsSync(e,t,i,r,n,s,a,l,h,u))},(0,e.i(72509).RegisterEngineDynamicBuffer)();let c=!1;c=!0,t.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){let i=new n.InternalTexture(this,12);if(i.isCube=!0,1===this.webGLVersion)return s.Logger.Error("Depth cube texture is not supported by WebGL 1."),i;let r={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t},a=this._gl;this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,i,!0),this._setupDepthStencilTexture(i,e,r.bilinearFiltering,r.comparisonFunction);for(let t=0;t<6;t++)r.generateStencil?a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,a.DEPTH24_STENCIL8,e,e,0,a.DEPTH_STENCIL,a.UNSIGNED_INT_24_8,null):a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,a.DEPTH_COMPONENT24,e,e,0,a.DEPTH_COMPONENT,a.UNSIGNED_INT,null);return this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(i),i},t.ThinEngine.prototype._setCubeMapTextureParams=function(e,t,i){let r=this._gl;r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e.samplingMode=t?3:2,t&&this.getCaps().textureMaxLevel&&void 0!==i&&i>0&&(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAX_LEVEL,i),e._maxLodLevel=i),this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,null)},t.ThinEngine.prototype.createCubeTexture=function(e,t,i,r,n=null,l=null,h,u=null,_=!1,o=0,f=0,c=null,p,T=!1,d=null){let g=this._gl;return this.createCubeTextureBase(e,t,i,!!r,n,l,h,u,_,o,f,c,e=>this._bindTextureDirectly(g.TEXTURE_CUBE_MAP,e,!0),(e,t)=>{let i=this.needPOTTextures?(0,a.GetExponentOfTwo)(t[0].width,this._caps.maxCubemapTextureSize):t[0].width,l=[g.TEXTURE_CUBE_MAP_POSITIVE_X,g.TEXTURE_CUBE_MAP_POSITIVE_Y,g.TEXTURE_CUBE_MAP_POSITIVE_Z,g.TEXTURE_CUBE_MAP_NEGATIVE_X,g.TEXTURE_CUBE_MAP_NEGATIVE_Y,g.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(g.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(!1);let u=h?this._getInternalFormat(h,e._useSRGBBuffer):e._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:g.RGBA,_=h?this._getInternalFormat(h):g.RGBA;e._useSRGBBuffer&&1===this.webGLVersion&&(_=u);for(let e=0;e<l.length;e++)if(t[e].width!==i||t[e].height!==i){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext)return void s.Logger.Warn("Cannot create canvas to resize texture.");this._workingCanvas.width=i,this._workingCanvas.height=i,this._workingContext.drawImage(t[e],0,0,t[e].width,t[e].height,0,0,i,i),g.texImage2D(l[e],0,u,_,g.UNSIGNED_BYTE,this._workingCanvas)}else g.texImage2D(l[e],0,u,_,g.UNSIGNED_BYTE,t[e]);r||g.generateMipmap(g.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(e,!r),e.width=i,e.height=i,e.isReady=!0,h&&(e.format=h),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),n&&n()},!!T,d)},t.ThinEngine.prototype.generateMipMapsForCubemap=function(e,t=!0){if(e.generateMipMaps){let i=this._gl;this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,e,!0),i.generateMipmap(i.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)}};var p=e.i(81398);class T{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=(0,p.HasStencilAspect)(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return -1;let t=this._textures[e],i=this._layerIndices?.[e]??0,r=this._faceIndices?.[e]??0;return t.isCube?6*i+r:t.is3D?0:i}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;let r=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,r}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,i,r,n){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=r,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),void 0!==t&&t>=0&&(this._layerIndices[e]=t),void 0!==i&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,r=1,n=14,s){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=s,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:r,depthTextureFormat:n,label:s},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){let t=this.textures;if(t&&t.length>0){let i=!1,r=t.length,n=-1,s=t[t.length-1]._source;(14===s||12===s)&&(i=!0,n=t[t.length-1].format,r--);let a=[],l=[],h=[],u=[],_=[],o=[],f=[],c={};for(let e=0;e<r;++e){let i=t[e];a.push(i.samplingMode),l.push(i.type),h.push(i.format),void 0!==c[i.uniqueId]?(u.push(-1),f.push(0)):(c[i.uniqueId]=e,i.is2DArray?(u.push(35866),f.push(i.depth)):i.isCube?(u.push(34067),f.push(0)):i.is3D?(u.push(32879),f.push(i.depth)):(u.push(3553),f.push(0))),this._faceIndices&&_.push(this._faceIndices[e]??0),this._layerIndices&&o.push(this._layerIndices[e]??0)}let p={samplingModes:a,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:i,depthTextureFormat:n,types:l,formats:h,textureCount:r,targetTypes:u,faceIndex:_,layerIndex:o,layerCounts:f,label:this.label},T={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(T,p);for(let i=0;i<r;++i){if(-1!==u[i])continue;let r=c[t[i].uniqueId];e.setTexture(e.textures[r],i)}}}else{let t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{let i={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(i,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){let e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){let t=this._depthStencilTexture.samplingMode,i=this._depthStencilTexture.format;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,2===t||3===t||11===t,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,i,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class d extends T{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;let i=this._engine,r=this._context,n=e._hardwareTexture;if(n&&e._autoMSAAManagement&&this._MSAAFramebuffer){let t=i._currentFramebuffer;i._bindUnboundFramebuffer(this._MSAAFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,(0,p.HasStencilAspect)(e.format)?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,r.RENDERBUFFER,n.getMSAARenderBuffer()),i._bindUnboundFramebuffer(t)}}constructor(e,t,i,r,n){super(e,t,i,r),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=n}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height)).texture.isReady=!0:e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,i=!1,r=1,n=14,s){if(this._depthStencilBuffer){let e=this._engine,t=e._currentFramebuffer,i=this._context;e._bindUnboundFramebuffer(this._framebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,null),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.STENCIL_ATTACHMENT,i.RENDERBUFFER,null),e._bindUnboundFramebuffer(t),i.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,r,n,s)}shareDepth(e){super.shareDepth(e);let t=this._context,i=this._depthStencilBuffer,r=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;let s=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(r),t.framebufferRenderbuffer(t.FRAMEBUFFER,s,t.RENDERBUFFER,i),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,r=0){let n,s=e._hardwareTexture;if(!s)return;let a=this._framebuffer,l=this._engine,h=l._currentFramebuffer;if(l._bindUnboundFramebuffer(a),l.webGLVersion>1){let a=this._context;n=a["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=i??this.layerIndices?.[t]??0,a.framebufferTextureLayer(a.FRAMEBUFFER,n,s.underlyingResource,r,i)):e.isCube?(i=i??this.faceIndices?.[t]??0,a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_CUBE_MAP_POSITIVE_X+i,s.underlyingResource,r)):a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_2D,s.underlyingResource,r)}else{let e=this._context;n=e["COLOR_ATTACHMENT"+t+"_WEBGL"];let a=void 0!==i?e.TEXTURE_CUBE_MAP_POSITIVE_X+i:e.TEXTURE_2D;e.framebufferTexture2D(e.FRAMEBUFFER,n,a,s.underlyingResource,r)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){let e=this._context;l._bindUnboundFramebuffer(this._MSAAFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,s.getMSAARenderBuffer())}l._bindUnboundFramebuffer(h)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;let i=this._attachments?.length??this.textures.length;for(let e=0;e<i;e++){let t=this.textures[e];t&&(t.is2DArray||t.is3D?this._bindTextureRenderTarget(t,e,this.layerIndices[e]):t.isCube?this._bindTextureRenderTarget(t,e,this.faceIndices[e]):this._bindTextureRenderTarget(t,e))}}setLayerAndFaceIndex(e=0,t,i){if(super.setLayerAndFaceIndex(e,t,i),!this.textures||!this.layerIndices||!this.faceIndices)return;let r=this.textures[e];r.is2DArray||r.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):r.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){let e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){let t=this._context;!e&&(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let g=!1;g=!0,t.ThinEngine.prototype._createHardwareRenderTargetWrapper=function(e,t,i){let r=new d(e,t,i,this,this._gl);return this._renderTargetWrapperCache.push(r),r},t.ThinEngine.prototype.createRenderTargetTexture=function(e,t){let i,r,n=this._createHardwareRenderTargetWrapper(!1,!1,e),s=!0,a=!1,l=!1,h=1;void 0!==t&&"object"==typeof t&&(s=t.generateDepthBuffer??!0,a=!!t.generateStencilBuffer,l=!!t.noColorAttachment,i=t.colorAttachment,h=t.samples??1,r=t.label);let u=i||(l?null:this._createInternalTexture(e,t,!0,5)),_=e.width||e,o=e.height||e,f=this._currentFramebuffer,c=this._gl,p=c.createFramebuffer();if(this._bindUnboundFramebuffer(p),n._depthStencilBuffer=this._setupFramebufferDepthAttachments(a,s,_,o),!u||u.is2DArray||u.is3D||c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,u._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(f),n.label=r??"RenderTargetWrapper",n._framebuffer=p,n._generateDepthBuffer=s,n._generateStencilBuffer=a,n.setTextures(u),i){if(n._samples=i.samples,i.samples>1){let e=i._hardwareTexture.getMSAARenderBuffer(0);n._MSAAFramebuffer=c.createFramebuffer(),this._bindUnboundFramebuffer(n._MSAAFramebuffer),c.framebufferRenderbuffer(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.RENDERBUFFER,e),this._bindUnboundFramebuffer(null)}}else this.updateRenderTargetTextureSampleCount(n,h);return n},t.ThinEngine.prototype._createDepthStencilTexture=function(e,t,i){let r=this._gl,a=e.layers||0,l=e.depth||0,h=r.TEXTURE_2D;0!==a?h=r.TEXTURE_2D_ARRAY:0!==l&&(h=r.TEXTURE_3D);let u=new n.InternalTexture(this,12);if(u.label=t.label,!this._caps.depthTextureExtension)return s.Logger.Error("Depth texture is not supported by your browser or hardware."),u;let _={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t};if(this._bindTextureDirectly(h,u,!0),this._setupDepthStencilTexture(u,e,0!==_.comparisonFunction&&_.bilinearFiltering,_.comparisonFunction,_.samples),void 0!==_.depthTextureFormat){if(15!==_.depthTextureFormat&&16!==_.depthTextureFormat&&17!==_.depthTextureFormat&&13!==_.depthTextureFormat&&14!==_.depthTextureFormat&&18!==_.depthTextureFormat)return s.Logger.Error(`Depth texture ${_.depthTextureFormat} format is not supported.`),u;u.format=_.depthTextureFormat}else u.format=_.generateStencil?13:16;let o=(0,p.HasStencilAspect)(u.format),f=this._getWebGLTextureTypeFromDepthTextureFormat(u.format),c=o?r.DEPTH_STENCIL:r.DEPTH_COMPONENT,T=this._getInternalFormatFromDepthTextureFormat(u.format,!0,o);return u.is2DArray?r.texImage3D(h,0,T,u.width,u.height,a,0,c,f,null):u.is3D?r.texImage3D(h,0,T,u.width,u.height,l,0,c,f,null):r.texImage2D(h,0,T,u.width,u.height,0,c,f,null),this._bindTextureDirectly(h,null),this._internalTexturesCache.push(u),i._depthStencilBuffer&&(r.deleteRenderbuffer(i._depthStencilBuffer),i._depthStencilBuffer=null),this._bindUnboundFramebuffer(i._MSAAFramebuffer??i._framebuffer),i._generateStencilBuffer=o,i._depthStencilTextureWithStencil=o,i._depthStencilBuffer=this._setupFramebufferDepthAttachments(i._generateStencilBuffer,i._generateDepthBuffer,i.width,i.height,i.samples,u.format),this._bindUnboundFramebuffer(null),u},t.ThinEngine.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;let i=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(i.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(i.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null);let r=e.texture?._hardwareTexture;if(r?.releaseMSAARenderBuffers(),e.texture&&t>1&&"function"==typeof i.renderbufferStorageMultisample){let n=i.createFramebuffer();if(!n)throw Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);let s=this._createRenderBuffer(e.texture.width,e.texture.height,t,-1,this._getRGBABufferInternalSizedFormat(e.texture.type,e.texture.format,e.texture._useSRGBBuffer),i.COLOR_ATTACHMENT0,!1);if(!s)throw Error("Unable to create multi sampled framebuffer");r?.addMSAARenderBuffer(s)}this._bindUnboundFramebuffer(e._MSAAFramebuffer??e._framebuffer),e.texture&&(e.texture.samples=t),e._samples=t;let n=e._depthStencilTexture?e._depthStencilTexture.format:void 0;return e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t,n),this._bindUnboundFramebuffer(null),t},t.ThinEngine.prototype._setupDepthStencilTexture=function(e,t,i,r,n=1){let s=t.width??t,a=t.height??t,l=t.layers||0,h=t.depth||0;e.baseWidth=s,e.baseHeight=a,e.width=s,e.height=a,e.is2DArray=l>0,e.depth=l||h,e.isReady=!0,e.samples=n,e.generateMipMaps=!1,e.samplingMode=i?2:1,e.type=0,e._comparisonFunction=r;let u=this._gl,_=this._getTextureTarget(e),o=this._getSamplingParameters(e.samplingMode,!1);u.texParameteri(_,u.TEXTURE_MAG_FILTER,o.mag),u.texParameteri(_,u.TEXTURE_MIN_FILTER,o.min),u.texParameteri(_,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(_,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this.webGLVersion>1&&(0===r?(u.texParameteri(_,u.TEXTURE_COMPARE_FUNC,515),u.texParameteri(_,u.TEXTURE_COMPARE_MODE,u.NONE)):(u.texParameteri(_,u.TEXTURE_COMPARE_FUNC,r),u.texParameteri(_,u.TEXTURE_COMPARE_MODE,u.COMPARE_REF_TO_TEXTURE)))};let E=!1;E=!0,t.ThinEngine.prototype.setDepthStencilTexture=function(e,t,i,r){void 0!==e&&(t&&(this._boundUniforms[e]=t),i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0,r):this._setTexture(e,null,void 0,void 0,r))};let A=!1;A=!0,t.ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){let i=this._createHardwareRenderTargetWrapper(!1,!0,e),r={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...t};r.generateStencilBuffer=r.generateDepthBuffer&&r.generateStencilBuffer,(1!==r.type||this._caps.textureFloatLinearFiltering)&&(2!==r.type||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=1);let a=this._gl,l=new n.InternalTexture(this,5);this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,l,!0);let h=this._getSamplingParameters(r.samplingMode,r.generateMipMaps);1!==r.type||this._caps.textureFloat||(r.type=0,s.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,h.mag),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,h.min),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);for(let t=0;t<6;t++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this._getRGBABufferInternalSizedFormat(r.type,r.format),e,e,0,this._getInternalFormat(r.format),this._getWebGLTextureType(r.type),null);let u=a.createFramebuffer();return this._bindUnboundFramebuffer(u),i._depthStencilBuffer=this._setupFramebufferDepthAttachments(r.generateStencilBuffer,r.generateDepthBuffer,e,e),r.generateMipMaps&&a.generateMipmap(a.TEXTURE_CUBE_MAP),this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),i._framebuffer=u,i._generateDepthBuffer=r.generateDepthBuffer,i._generateStencilBuffer=r.generateStencilBuffer,l.width=e,l.height=e,l.isReady=!0,l.isCube=!0,l.samples=1,l.generateMipMaps=r.generateMipMaps,l.samplingMode=r.samplingMode,l.type=r.type,l.format=r.format,this._internalTexturesCache.push(l),i.setTextures(l),i};var b=e.i(81705),m=e.i(65042);let x=!1;x=!0,t.ThinEngine.prototype.createPrefilteredCubeTexture=function(t,i,r,a,l=null,h=null,u,_=null,o=!0){let f=async t=>{if(!t){l&&l(null);return}let h=t.texture;if(o?t.info.sphericalPolynomial&&(h._sphericalPolynomial=t.info.sphericalPolynomial):h._sphericalPolynomial=h._sphericalPolynomial??new b.SphericalPolynomial,h._source=9,this.getCaps().textureLOD){l&&l(h);return}let u=this._gl,_=t.width;if(!_)return;let{DDSTools:f}=await e.A(61785),c=[];for(let e=0;e<3;e++){let l=Math.log2(_)*r+a,o=Math.round(Math.min(Math.max(a+(l-a)*(1-e/2),0),l)),p=new n.InternalTexture(this,2);if(p.type=h.type,p.format=h.format,p.width=Math.pow(2,Math.max(Math.log2(_)-o,0)),p.height=p.width,p.isCube=!0,p._cachedWrapU=0,p._cachedWrapV=0,this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,p,!0),p.samplingMode=2,u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),t.isDDS){let e=t.info,i=t.data;this._unpackFlipY(e.isCompressed),f.UploadDDSLevels(this,p,i,e,!0,6,o)}else s.Logger.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null);let T=new m.BaseTexture(i);T._isCube=!0,T._texture=p,p.isReady=!0,c.push(T)}h._lodTextureHigh=c[2],h._lodTextureMid=c[1],h._lodTextureLow=c[0],l&&l(h)};return this.createCubeTexture(t,i,null,!1,f,h,u,_,o,r,a)};var R=e.i(81712);let S=!1;S=!0,t.ThinEngine.prototype.createUniformBuffer=function(e,t){let i=this._gl.createBuffer();if(!i)throw Error("Unable to create uniform buffer");let r=new R.WebGLDataBuffer(i);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},t.ThinEngine.prototype.createDynamicUniformBuffer=function(e,t){let i=this._gl.createBuffer();if(!i)throw Error("Unable to create dynamic uniform buffer");let r=new R.WebGLDataBuffer(i);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},t.ThinEngine.prototype.updateUniformBuffer=function(e,t,i,r){this.bindUniformBuffer(e),void 0===i&&(i=0),void 0===r?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,i,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(i,i+r)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(i,i+r)),this.bindUniformBuffer(null)},t.ThinEngine.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},t.ThinEngine.prototype.bindUniformBufferBase=function(e,t,i){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},t.ThinEngine.prototype.bindUniformBlock=function(e,t,i){let r=e.program,n=this._gl.getUniformBlockIndex(r,t);0xffffffff!==n&&this._gl.uniformBlockBinding(r,n,i)};var F=e.i(45735),M=e.i(18405);let y=!1;y=!0,M.AbstractEngine.prototype.displayLoadingUI=function(){if(!(0,F.IsWindowObjectExist)())return;let e=this.loadingScreen;e&&e.displayLoadingUI()},M.AbstractEngine.prototype.hideLoadingUI=function(){if(!(0,F.IsWindowObjectExist)())return;let e=this._loadingScreen;e&&e.hideLoadingUI()},Object.defineProperty(M.AbstractEngine.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=M.AbstractEngine.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(M.AbstractEngine.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(M.AbstractEngine.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0}),(0,e.i(6363).RegisterAbstractEngineDom)();let U=!1;U=!0,M.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},M.AbstractEngine.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},M.AbstractEngine.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},M.AbstractEngine.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},M.AbstractEngine.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},M.AbstractEngine.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},M.AbstractEngine.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},M.AbstractEngine.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},M.AbstractEngine.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},M.AbstractEngine.prototype.setAlphaConstants=function(e,t,i,r){this._alphaState.setAlphaBlendConstants(e,t,i,r)},M.AbstractEngine.prototype.getAlphaMode=function(e=0){return this._alphaMode[e]},M.AbstractEngine.prototype.getAlphaEquation=function(e=0){return this._alphaEquation[e]};let B=!1;B=!0,M.AbstractEngine.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},M.AbstractEngine.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},M.AbstractEngine.prototype.getStencilMask=function(){return this._stencilState.stencilMask},M.AbstractEngine.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},M.AbstractEngine.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},M.AbstractEngine.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},M.AbstractEngine.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},M.AbstractEngine.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},M.AbstractEngine.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},M.AbstractEngine.prototype.setStencilBackFunction=function(e){this._stencilState.stencilBackFunc=e},M.AbstractEngine.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},M.AbstractEngine.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},M.AbstractEngine.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},M.AbstractEngine.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},M.AbstractEngine.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},M.AbstractEngine.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},M.AbstractEngine.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},M.AbstractEngine.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},M.AbstractEngine.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},M.AbstractEngine.prototype.setStencilBackOperationFail=function(e){this._stencilState.stencilBackOpStencilFail=e},M.AbstractEngine.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},M.AbstractEngine.prototype.setStencilBackOperationDepthFail=function(e){this._stencilState.stencilBackOpDepthFail=e},M.AbstractEngine.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},M.AbstractEngine.prototype.setStencilBackOperationPass=function(e){this._stencilState.stencilBackOpStencilDepthPass=e},M.AbstractEngine.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},M.AbstractEngine.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)},(0,e.i(38080).RegisterAbstractEngineRenderPass)(),(0,e.i(72256).RegisterAbstractEngineTexture)();var D=e.i(20887);let C=!1;C=!0,(0,D.RegisterFileTools)(),M.AbstractEngine.prototype._loadFileAsync=async function(e,t,i){return await new Promise((r,n)=>{this._loadFile(e,e=>{r(e)},void 0,t,i,(e,t)=>{n(t)})})};var P=e.i(30523);M.AbstractEngine.GetCompatibleTextureLoader=P._GetCompatibleTextureLoader;let I=!1;I=!0,t.ThinEngine.prototype.enableScissor=function(e,t,i,r){let n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,i,r)},t.ThinEngine.prototype.disableScissor=function(){let e=this._gl;e.disable(e.SCISSOR_TEST)},e.s([],57415),e.i(57415);var w=e.i(27239);e.s(["Engine",()=>w.Engine],24316)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71829,97991,e=>{"use strict";let t="u">typeof WeakRef;class r{constructor(e,t=!1,r,s){this.initialize(e,t,r,s)}initialize(e,t=!1,r,s){return this.mask=e,this.skipNextObservers=t,this.target=r,this.currentTarget=s,this}}class s{constructor(e,t,r=null){this.callback=e,this.mask=t,this.scope=r,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}}class i{static FromPromise(e,t){let r=new i;return e.then(e=>{r.notifyObservers(e)}).catch(e=>{if(t)t.notifyObservers(e);else throw e}),r}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=[],this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new r(0),e&&(this._onObserverAdded=e)}add(e,r=-1,i=!1,n=null,o=!1){if(!e)return null;let a=new s(e,r,n);a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),this._hasNotified&&this.notifyIfTriggered&&void 0!==this._lastNotifiedValue&&this.notifyObserver(a,this._lastNotifiedValue);let c=t?new WeakRef(this):{deref:()=>this};return a._remove=(e=!1)=>{let t=c.deref();t&&(e?t.remove(a):t._remove(a))},a}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return!!e&&(e._remove=null,-1!==this._observers.indexOf(e)&&(this._deferUnregister(e),!0))}removeCallback(e,t){for(let r=0;r<this._observers.length;r++){let s=this._observers[r];if(!s._willBeUnregistered&&s.callback===e&&(!t||t===s.scope))return this._deferUnregister(s),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;let r=this._observers.indexOf(e);return -1!==r&&(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(r,1),!0)}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,r,s,i){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;let n=this._eventState;for(let o of(n.mask=t,n.target=r,n.currentTarget=s,n.skipNextObservers=!1,n.lastReturnValue=e,n.userInfo=i,this._observers))if(!o._willBeUnregistered&&(o.mask&t&&(o.unregisterOnNextCall&&this._deferUnregister(o),o.scope?n.lastReturnValue=o.callback.apply(o.scope,[e,n]):n.lastReturnValue=o.callback(e,n)),n.skipNextObservers))return!1;return!0}notifyObserver(e,t,r=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;let s=this._eventState;s.mask=r,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){let e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){let e=new i;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(let t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}e.s(["Observable",0,i],97991);class n{static get LastCreatedEngine(){return 0===this.Instances.length?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}n.Instances=[],n.OnEnginesDisposedObservable=new i,n._LastCreatedScene=null,n.UseFallbackTexture=!0,n.FallbackTexture="",e.s(["EngineStore",0,n],71829)},78083,e=>{"use strict";class t{static SetMatrixPrecision(e){if(t.MatrixTrackPrecisionChange=!1,e&&!t.MatrixUse64Bits&&t.MatrixTrackedMatrices)for(let e=0;e<t.MatrixTrackedMatrices.length;++e){let r=t.MatrixTrackedMatrices[e],s=r._m;r._m=Array(16);for(let e=0;e<16;++e)r._m[e]=s[e]}t.MatrixUse64Bits=e,t.MatrixCurrentType=t.MatrixUse64Bits?Array:Float32Array,t.MatrixTrackedMatrices=null}}t.MatrixUse64Bits=!1,t.MatrixTrackPrecisionChange=!0,t.MatrixCurrentType=Float32Array,t.MatrixTrackedMatrices=[],e.s(["PerformanceConfigurator",0,t])},61420,e=>{e.v(t=>Promise.all(["static/chunks/0ay4fjomijs3n.js","static/chunks/3c5iwwj-fhbue.js","static/chunks/2rofu6gu1xzuq.js","static/chunks/03p70i4c7qt0v.js","static/chunks/1bf421g4peccx.js","static/chunks/2q24e72-olbe8.js","static/chunks/0ywvahq9t0tki.js","static/chunks/1p3rgz4aef1gk.js"].map(t=>e.l(t))).then(()=>t(57605)))},76197,e=>{"use strict";function t(e,r=0,s=1){return Math.min(s,Math.max(r,e))}function r(e,t){return e-Math.floor(e/t)*t}function s(e,t){let s=r(t-e,360);return s>180&&(s-=360),s}function i(e,t,r){return Math.abs(t-e)<=r?t:e+Math.sign(t-e)*r}e.s(["Clamp",0,t,"DeltaAngle",0,s,"Denormalize",0,function(e,t,r){return e*(r-t)+t},"ExtractAsInt",0,function(e){return parseInt(e.toString().replace(/\W/g,""))},"Hermite",0,function(e,t,r,s,i){let n=i*i,o=i*n;return e*(2*o-3*n+1)+r*(-2*o+3*n)+t*(o-2*n+i)+s*(o-n)},"Hermite1stDerivative",0,function(e,t,r,s,i){let n=i*i;return(n-i)*6*e+(3*n-4*i+1)*t+(-n+i)*6*r+(3*n-2*i)*s},"HighestCommonFactor",0,function e(t,r){let s=t%r;return 0===s?r:e(r,s)},"ILog2",0,function(e){if(Math.log2)return Math.floor(Math.log2(e));if(e<0)return NaN;if(0===e)return-1/0;let t=0;if(e<1){for(;e<1;)t++,e*=2;t=-t}else if(e>1)for(;e>1;)t++,e=Math.floor(e/2);return t},"InverseLerp",0,function(e,r,s){return e!=r?t((s-e)/(r-e)):0},"Lerp",0,function(e,t,r){return e+(t-e)*r},"LerpAngle",0,function(e,s,i){let n=r(s-e,360);return n>180&&(n-=360),e+n*t(i)},"MoveTowards",0,i,"MoveTowardsAngle",0,function(e,t,r){let n,o=s(e,t);return-r<o&&o<r?n=t:(t=e+o,n=i(e,t,r)),n},"Normalize",0,function(e,t,r){return(e-t)/(r-t)},"NormalizeRadians",0,function(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))},"OutsideRange",0,function(e,t,r,s=1401298e-51){return e<t-s||e>r+s},"PercentToRange",0,function(e,t,r){return(r-t)*e+t},"PingPong",0,function(e,t){let s=r(e,2*t);return t-Math.abs(s-t)},"RandomRange",0,function(e,t){return e===t?e:Math.random()*(t-e)+e},"RangeToPercent",0,function(e,t,r){return(e-t)/(r-t)},"Repeat",0,r,"SmoothStep",0,function(e,r,s){let i=t(s);return r*(i=-2*i*i*i+3*i*i)+e*(1-i)},"ToHex",0,function(e){let t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},"WithinEpsilon",0,function(e,t,r=1401298e-51){return Math.abs(e-t)<=r}])},3427,e=>{"use strict";(0,e.i(56173).RegisterMathVector)(),e.s([])},68282,e=>{"use strict";let t={};e.s(["GetClass",0,function(e){return t[e]},"RegisterClass",0,function(e,r){t[e]=r}])},97900,e=>{"use strict";e.i(3427);var t=e.i(56173);function r(e){let r=new t.Vector3,s=new t.Vector3,i=new t.Vector3;return{reset(){},apply(n){switch(n.type){case"camera_sample":{let t=e.camera??e.scene.activeCamera;if(!t)return;let[i,o,a]=n.position;if(n.target)r.set(n.target[0],n.target[1],n.target[2]);else{let[e,t,s]=n.direction;r.set(i+e,o+t,a+s)}t.setTarget?.(r),"function"==typeof t.setPosition?(s.set(i,o,a),t.setPosition(s)):t.position.set(i,o,a);break}case"pointer_move":case"pointer_click":case"pointer_down":case"pointer_up":e.onPointer?.(n.screen,n.hitPoint,n.hitMesh,n.type);break;case"mesh_interaction":e.onMeshInteraction?.(n.mesh,n.kind,n.point);break;case"custom":e.onCustom?.(n.name,n.props,n.ts);break;case"input_action":e.onInputAction?.({action:n.action,code:n.code,button:n.button,pressed:n.pressed,source:n.source},n.ts);break;case"viewport_resize":e.onLifecycle?.({type:"viewport_resize",width:n.width,height:n.height,dpr:n.dpr},n.ts);break;case"visibility_change":e.onLifecycle?.({type:"visibility_change",state:n.state},n.ts);break;case"focus_change":e.onLifecycle?.({type:"focus_change",focused:n.focused},n.ts);break;case"context_lost":e.onLifecycle?.({type:"context_lost"},n.ts);break;case"context_restored":e.onLifecycle?.({type:"context_restored"},n.ts);break;case"runtime_error":e.onError?.({kind:n.kind,message:n.message,source:n.source,lineno:n.lineno,colno:n.colno,stack:n.stack},n.ts);break;case"camera_gesture":break;case"node_transform":{var o;let r=(o=e.nodes?.[n.nodeId])?"function"==typeof o?o()??null:o:null;if(r)if(void 0!==n.boneId){let e=r.skeleton?.bones?.find(e=>e.name===n.boneId);e&&(e.position?.set(n.position[0],n.position[1],n.position[2]),e.rotationQuaternion=new t.Quaternion(n.rotation[0],n.rotation[1],n.rotation[2],n.rotation[3]),n.scale&&e.scaling?.set(n.scale[0],n.scale[1],n.scale[2]),e.markAsDirty?.())}else{let e=void 0===n.childPath?r:function(e,t){let r=e;for(let e of t.split("/")){if(!e)continue;let t=r?.getChildren?.();if(!Array.isArray(t)||!(r=t.find(t=>t.name===e)??null))return null}return r}(r,n.childPath);e&&("function"==typeof e.setAbsolutePosition?(i.set(n.position[0],n.position[1],n.position[2]),e.setAbsolutePosition(i)):e.position?.set(n.position[0],n.position[1],n.position[2]),e.rotationQuaternion=new t.Quaternion(n.rotation[0],n.rotation[1],n.rotation[2],n.rotation[3]),n.scale&&e.scaling?.set(n.scale[0],n.scale[1],n.scale[2]))}e.onNodeTransform?.(n.nodeId,{boneId:n.boneId,childPath:n.childPath,position:n.position,rotation:n.rotation,scale:n.scale},n.ts)}}}}}async function s(e,t){let r=await e(t?.pluginExtension);r.addAllToScene();let s=!1;return{rootNodes:r.rootNodes??[],meshes:r.meshes??[],container:r,dispose(){s||(s=!0,r.removeAllFromScene?.(),r.dispose?.())}}}async function i(t,r,s){let{LoadAssetContainerAsync:i}=await e.A(61420);return await i(t,r,s?{pluginExtension:s}:void 0)}e.s(["createBabylonReplayDriver",0,r],27012),e.i(27012),e.s(["createBabylonReplayDriver",0,r,"loadSceneBackdrop",0,function(e,t,r){let n=r?.load??i;return s(r=>n(t,e,r),r)}],97900)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93414,e=>{"use strict";var t=e.i(97991),r=e.i(56173),s=e.i(80603),i=e.i(55179),n=e.i(4696),a=e.i(72256),h=e.i(8697),o=e.i(58607),d=e.i(40839),c=e.i(81978),l=e.i(89435),_=e.i(6895),g=e.i(76972);class u{get renderList(){return this._renderList}set renderList(e){this._renderList!==e&&(this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=(0,c._ObserveArray)(e,this._renderListHasChanged)),this._renderList=e)}get disableImageProcessing(){return this._disableImageProcessing}set disableImageProcessing(e){e!==this._disableImageProcessing&&(this._disableImageProcessing=e,this._scene.markAllMaterialsAsDirty(64))}get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e,this._renderingManager.disableDepthPrePass=e}get name(){return this._name}set name(e){if(this._name!==e){if(this._name=e,this._sceneUBOs)for(let e=0;e<this._sceneUBOs.length;++e)this._sceneUBOs[e].name=`Scene ubo #${e} for ${this.name}`;if(this._scene)for(let e=0;e<this._renderPassIds.length;++e){let t=this._renderPassIds[e];this._engine._renderPassNames[t]=`${this._name}#${e}`}}}get renderPassIds(){return this._renderPassIds}get currentRefreshId(){return this._currentRefreshId}getActiveMeshes(){return this._activeMeshes}setMaterialForRendering(e,t){let r;r=Array.isArray(e)?e:[e];for(let e=0;e<r.length;++e)for(let s=0;s<this.options.numPasses;++s){let i=r[e];r[e].isAnInstance&&(i=r[e].sourceMesh),i.setMaterialForRenderPass(this._renderPassIds[s],void 0!==t?Array.isArray(t)?t[s]:t:void 0)}}_freezeActiveMeshes(e){this._freezeActiveMeshesCancel=(0,l._RetryWithInterval)(()=>this._checkReadiness(),()=>{if(this._freezeActiveMeshesCancel=null,e)for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._freeze();this._prepareRenderingManager(0,!0),this._isFrozen=!0},(e,t)=>{this._freezeActiveMeshesCancel=null,t?(h.Logger.Error("ObjectRenderer: Timeout while waiting for the renderer to be ready."),e&&h.Logger.Error(e)):(h.Logger.Error("ObjectRenderer: An unexpected error occurred while waiting for the renderer to be ready."),e&&(h.Logger.Error(e),e.stack&&h.Logger.Error(e.stack)))})}_unfreezeActiveMeshes(){this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null;for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();this._isFrozen=!1}constructor(e,r,s){this._unObserveRenderList=null,this._renderListHasChanged=(e,t)=>{let r=this._renderList?this._renderList.length:0;if(0===t&&r>0||0===r)for(let e of this._scene.meshes)e._markSubMeshesAsLightDirty()},this.particleSystemList=null,this.getCustomRenderList=null,this.renderMeshes=!0,this.renderDepthOnlyMeshes=!0,this.renderOpaqueMeshes=!0,this.renderAlphaTestMeshes=!0,this.renderTransparentMeshes=!0,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.enableBoundingBoxRendering=!1,this.enableOutlineRendering=!0,this._disableImageProcessing=!1,this.dontSetTransformationMatrix=!1,this._disableDepthPrePass=!1,this.onBeforeRenderObservable=new t.Observable,this.onAfterRenderObservable=new t.Observable,this.onBeforeRenderingManagerRenderObservable=new t.Observable,this.onAfterRenderingManagerRenderObservable=new t.Observable,this.onInitRenderingObservable=new t.Observable,this.onFinishRenderingObservable=new t.Observable,this.onFastPathRenderObservable=new t.Observable,this._currentRefreshId=-1,this._refreshRate=1,this._currentApplyByPostProcessSetting=!1,this._activeMeshes=new _.SmartArray(256),this._activeBoundingBoxes=new _.SmartArray(32),this._currentFrameId=-1,this._currentSceneUBOIndex=0,this._isFrozen=!1,this._freezeActiveMeshesCancel=null,this._currentSceneCamera=null,this.name=e,this._scene=r,this._engine=this._scene.getEngine(),this._useUBO=this._engine.supportsUniformBuffers,this.renderList=[],this._renderPassIds=[],this.options={numPasses:1,doNotChangeAspectRatio:!0,enableClusteredLights:!1,...s},this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new d.RenderingManager(r),this._renderingManager._useSceneAutoClearSetup=!0,this.options.enableClusteredLights&&this.onInitRenderingObservable.add(()=>{for(let e of this._scene.lights)e.getTypeID()===g.LightConstants.LIGHTTYPEID_CLUSTERED_CONTAINER&&e.isSupported&&e._updateBatches(this.activeCamera).render()}),this._scene.addObjectRenderer(this)}_releaseRenderPassId(){for(let e=0;e<this.options.numPasses;++e)this._engine.releaseRenderPassId(this._renderPassIds[e]);this._renderPassIds.length=0}_createRenderPassId(){this._releaseRenderPassId();for(let e=0;e<this.options.numPasses;++e)this._renderPassIds[e]=this._engine.createRenderPassId(`${this.name}#${e}`)}_createSceneUBO(e,t){let r=this._scene.getEngine(),s=new o.UniformBuffer(r,void 0,t,e,void 0,!1);return s.addUniform("viewProjection",16),t&&s.addUniform("viewProjectionR",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}_getSceneUBO(){this._currentFrameId!==this._engine.frameId&&(this._currentSceneUBOIndex=0,this._currentFrameId=this._engine.frameId),this._sceneUBOs||(this._sceneUBOs=[],this._sceneUBOIsMultiview=[]);let e=this._engine._currentRenderTarget,t=!!(e&&e.texture?.isMultiview)||!!this._scene._multiviewSceneUboIsActive;if(this._currentSceneUBOIndex>=this._sceneUBOs.length){let e=this._sceneUBOs.length;this._sceneUBOs.push(this._createSceneUBO(`Scene ubo #${e} for ${this.name}`,t)),this._sceneUBOIsMultiview.push(t)}else this._sceneUBOIsMultiview[this._currentSceneUBOIndex]!==t&&(this._sceneUBOs[this._currentSceneUBOIndex].dispose(),this._sceneUBOs[this._currentSceneUBOIndex]=this._createSceneUBO(`Scene ubo #${this._currentSceneUBOIndex} for ${this.name}`,t),this._sceneUBOIsMultiview[this._currentSceneUBOIndex]=t);let r=this._sceneUBOs[this._currentSceneUBOIndex++];return r.unbindEffect(),r}resetRefreshCounter(){this._currentRefreshId=-1}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}shouldRender(){return!!this._engine.snapshotRendering||(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1))}isReadyForRendering(e,t){this.prepareRenderList(),this.initRender(e,t);let r=this._checkReadiness();return this.finishRender(),r}prepareRenderList(){let e=this._scene;if(this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(let t=0;t<this._waitingRenderList.length;t++){let r=this._waitingRenderList[t],s=e.getMeshById(r);s&&this.renderList.push(s)}}this._waitingRenderList=void 0}if(this.renderListPredicate){this.renderList?this.renderList.length=0:this.renderList=[];let e=this._scene.meshes;for(let t=0;t<e.length;t++){let r=e[t];this.renderListPredicate(r)&&this.renderList.push(r)}}this._currentApplyByPostProcessSetting=this._scene.imageProcessingConfiguration.applyByPostProcess,this._disableImageProcessing&&(this._scene.imageProcessingConfiguration._applyByPostProcess=this._disableImageProcessing)}initRender(e,t){let r=this.activeCamera??this._scene.activeCamera;this._currentSceneCamera=this._scene.activeCamera,this._useUBO&&(this._currentSceneUBO=this._scene.getSceneUniformBuffer(),this._currentSceneUBO.unbindEffect(),this._scene.setSceneUniformBuffer(this._getSceneUBO())),this.onInitRenderingObservable.notifyObservers(this),r&&(this.dontSetTransformationMatrix||this._scene.setTransformMatrix(r.getViewMatrix(),r.getProjectionMatrix(!0)),this._scene._activeCamera=r,this._engine.setViewport(r.rigParent?r.rigParent.viewport:r.viewport,e,t)),this._useUBO&&this._scene.finalizeSceneUbo(),this._defaultRenderListPrepared=!1}finishRender(){let e=this._scene;this._useUBO&&this._scene.setSceneUniformBuffer(this._currentSceneUBO),this._disableImageProcessing&&(e.imageProcessingConfiguration._applyByPostProcess=this._currentApplyByPostProcessSetting),e._activeCamera=this._currentSceneCamera,this._currentSceneCamera&&(this.activeCamera&&this.activeCamera!==e.activeCamera&&e.setTransformMatrix(this._currentSceneCamera.getViewMatrix(),this._currentSceneCamera.getProjectionMatrix(!0)),this._engine.setViewport(this._currentSceneCamera.viewport)),e.resetCachedMaterial(),this.onFinishRenderingObservable.notifyObservers(this)}render(e=0,t=!1){let r=this._engine.currentRenderPassId;if(this._engine.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e),this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode)this.onFastPathRenderObservable.notifyObservers(e);else{let t=this._prepareRenderingManager(e),r=this._scene.getOutlineRenderer?.(),s=r?.enabled;r&&(r.enabled=this.enableOutlineRendering),this.onBeforeRenderingManagerRenderObservable.notifyObservers(e),this._renderingManager.render(this.customRenderFunction,t,this.renderParticles,this.renderSprites,this.renderDepthOnlyMeshes,this.renderOpaqueMeshes,this.renderAlphaTestMeshes,this.renderTransparentMeshes,this.customRenderTransparentSubMeshes),this.onAfterRenderingManagerRenderObservable.notifyObservers(e),r&&(r.enabled=s)}t||this.onAfterRenderObservable.notifyObservers(e),this._engine.currentRenderPassId=r}_checkReadiness(){let e=this._scene,t=this._engine.currentRenderPassId,r=!0;e.getViewMatrix()||e.updateTransformMatrix();let s=this.options.numPasses;for(let t=0;t<s&&r;t++){let i=this.renderList?this.renderList:e.frameGraph?e.meshes:e.getActiveMeshes().data,n=this.renderList||e.frameGraph?i.length:e.getActiveMeshes().length;this._engine.currentRenderPassId=this._renderPassIds[t],this.onBeforeRenderObservable.notifyObservers(t);let a=null,h=n;this.getCustomRenderList&&(a=this.getCustomRenderList(t,i,n))&&(h=a.length),a||(a=i),this.options.doNotChangeAspectRatio||e.updateTransformMatrix(!0);for(let e=0;e<h&&r;++e){let t=a[e];if(t.isEnabled()&&!t.isBlocked&&t.isVisible&&t.subMeshes){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(t,this.refreshRate,!0)){r=!1;continue}}else if(!t.isReady(!0)){r=!1;continue}}}this.onAfterRenderObservable.notifyObservers(t),s>1&&(e.incrementRenderId(),e.resetCachedMaterial())}for(let t of this.particleSystemList||e.particleSystems)t.isReady()||(r=!1);return this._engine.currentRenderPassId=t,r}_prepareRenderingManager(e=0,t=!1){let r,s,i=this._scene,n=null,a=this.renderList?this.renderList:i.frameGraph?i.meshes:i.getActiveMeshes().data,h=this.renderList||i.frameGraph?a.length:i.getActiveMeshes().length;if(this.getCustomRenderList&&(n=this.getCustomRenderList(e,a,h)),n)r=n.length,s=this.forceLayerMaskCheck;else{if(this._defaultRenderListPrepared&&!t&&!this._engine.isWebGPU)return a;this._defaultRenderListPrepared=!0,n=a,r=h,s=!this.renderList||this.forceLayerMaskCheck}let o=i.activeCamera,d=this.cameraForLOD??o,c=i.getBoundingBoxRenderer?.();if(i._activeMeshesFrozen&&this._isFrozen){if(this._renderingManager.resetSprites(),this.enableBoundingBoxRendering&&c){c.reset();for(let e=0;e<this._activeBoundingBoxes.length;e++){let t=this._activeBoundingBoxes.data[e];c.renderList.push(t)}}return n}if(this._renderingManager.reset(),this._activeMeshes.reset(),this._activeBoundingBoxes.reset(),c&&c.reset(),this.renderMeshes){let e=i.getRenderId(),t=i.getFrameId();for(let a=0;a<r;a++){let r=n[a];if(r&&!r.isBlocked){let n,a;if(this.customIsReadyFunction){if(!this.customIsReadyFunction(r,this.refreshRate,!1)){this.resetRefreshCounter();continue}}else if(!r.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}if(d){let e=r._internalAbstractMeshDataInfo._currentLOD.get(d);e&&e[1]===t?n=e[0]:(n=i.customLODSelector?i.customLODSelector(r,d):r.getLOD(d),e?(e[0]=n,e[1]=t):r._internalAbstractMeshDataInfo._currentLOD.set(d,[n,t]))}else n=r;if(!n)continue;if(n!==r&&0!==n.billboardMode&&n.computeWorldMatrix(),n._preActivateForIntermediateRendering(e),a=!!s&&!!o&&(r.layerMask&o.layerMask)==0,r.isEnabled()&&r.isVisible&&r.subMeshes&&!a){if(this._activeMeshes.push(r),n._internalAbstractMeshDataInfo._wasActiveLastFrame=!0,n!==r&&n._activate(e,!0),this.enableBoundingBoxRendering&&c&&c._preActiveMesh(r),r._activate(e,!0)&&r.subMeshes.length){r.isAnInstance?r._internalAbstractMeshDataInfo._actAsRegularMesh&&(n=r):n._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,n._internalAbstractMeshDataInfo._isActiveIntermediate=!0,i._prepareSkeleton(n);for(let e=0;e<n.subMeshes.length;e++){let t=n.subMeshes[e];this.enableBoundingBoxRendering&&c&&c._evaluateSubMesh(r,t),this._renderingManager.dispatch(t,n)}}r._postActivate()}}}}if(this.enableBoundingBoxRendering&&c&&t)for(let e=0;e<c.renderList.length;e++){let t=c.renderList.data[e];this._activeBoundingBoxes.push(t)}if(this._scene.particlesEnabled&&this.renderParticles){this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);let e=this.particleSystemList||i.particleSystems;for(let t=0;t<e.length;t++){let r=e[t],s=r.emitter;r.isStarted()&&s&&(!s.position||s.isEnabled())&&this._renderingManager.dispatchParticles(r)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}return n}get renderingManager(){return this._renderingManager}setRenderingOrder(e,t=null,r=null,s=null){this._renderingManager.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t,r=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,r,s),this._renderingManager._useSceneAutoClearSetup=!1}clone(){let e=new u(this.name,this._scene,this.options);return this.renderList&&(e.renderList=this.renderList.slice(0)),e}dispose(){let e=this.renderList?this.renderList:this._scene.getActiveMeshes().data,t=this.renderList?this.renderList.length:this._scene.getActiveMeshes().length;for(let r=0;r<t;r++){let t=e[r];t&&void 0!==t.getMaterialForRenderPass(this.renderPassId)&&t.setMaterialForRenderPass(this.renderPassId,void 0)}if(this.onInitRenderingObservable.clear(),this.onFinishRenderingObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderingManagerRenderObservable.clear(),this.onAfterRenderingManagerRenderObservable.clear(),this.onFastPathRenderObservable.clear(),this._releaseRenderPassId(),this.renderList=null,this._sceneUBOs)for(let e of this._sceneUBOs)e.dispose();this._sceneUBOs=void 0,this._scene.removeObjectRenderer(this)}_rebuild(){this.refreshRate===u.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=u.REFRESHRATE_RENDER_ONCE)}freeRenderingGroups(){this._renderingManager&&this._renderingManager.freeRenderingGroups()}}u.REFRESHRATE_RENDER_ONCE=0,u.REFRESHRATE_RENDER_ONEVERYFRAME=1,u.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2;var R=e.i(30820),b=e.i(49399);class f extends s.Texture{get renderListPredicate(){return this._objectRenderer.renderListPredicate}set renderListPredicate(e){this._objectRenderer.renderListPredicate=e}get renderList(){return this._objectRenderer.renderList}set renderList(e){this._objectRenderer.renderList=e}get particleSystemList(){return this._objectRenderer.particleSystemList}set particleSystemList(e){this._objectRenderer.particleSystemList=e}get getCustomRenderList(){return this._objectRenderer.getCustomRenderList}set getCustomRenderList(e){this._objectRenderer.getCustomRenderList=e}get renderParticles(){return this._objectRenderer.renderParticles}set renderParticles(e){this._objectRenderer.renderParticles=e}get renderSprites(){return this._objectRenderer.renderSprites}set renderSprites(e){this._objectRenderer.renderSprites=e}get enableBoundingBoxRendering(){return this._objectRenderer.enableBoundingBoxRendering}set enableBoundingBoxRendering(e){this._objectRenderer.enableBoundingBoxRendering=e}get enableOutlineRendering(){return this._objectRenderer.enableOutlineRendering}set enableOutlineRendering(e){this._objectRenderer.enableOutlineRendering=e}get forceLayerMaskCheck(){return this._objectRenderer.forceLayerMaskCheck}set forceLayerMaskCheck(e){this._objectRenderer.forceLayerMaskCheck=e}get activeCamera(){return this._objectRenderer.activeCamera}set activeCamera(e){this._objectRenderer.activeCamera=e}get cameraForLOD(){return this._objectRenderer.cameraForLOD}set cameraForLOD(e){this._objectRenderer.cameraForLOD=e}get disableImageProcessing(){return this._objectRenderer.disableImageProcessing}set disableImageProcessing(e){this._objectRenderer.disableImageProcessing=e}get customIsReadyFunction(){return this._objectRenderer.customIsReadyFunction}set customIsReadyFunction(e){this._objectRenderer.customIsReadyFunction=e}get customRenderFunction(){return this._objectRenderer.customRenderFunction}set customRenderFunction(e){this._objectRenderer.customRenderFunction=e}get postProcesses(){return this._postProcesses}get _prePassEnabled(){return!!this._prePassRenderTarget&&this._prePassRenderTarget.enabled}set onAfterUnbind(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)}get onBeforeRenderObservable(){return this._objectRenderer.onBeforeRenderObservable}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}get onAfterRenderObservable(){return this._objectRenderer.onAfterRenderObservable}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}set onClear(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)}get _waitingRenderList(){return this._objectRenderer._waitingRenderList}set _waitingRenderList(e){this._objectRenderer._waitingRenderList=e}get renderPassId(){return this._objectRenderer.renderPassId}get renderPassIds(){return this._objectRenderer.renderPassIds}get currentRefreshId(){return this._objectRenderer.currentRefreshId}setMaterialForRendering(e,t){this._objectRenderer.setMaterialForRendering(e,t)}get isMulti(){return this._renderTarget?.isMulti??!1}get renderTargetOptions(){return this._renderTargetOptions}get renderTarget(){return this._renderTarget}_onRatioRescale(){this._sizeRatio&&this.resize(this._initialSizeParameter)}set boundingBoxSize(e){if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;let t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}get depthStencilTexture(){return this._renderTarget?._depthStencilTexture??null}constructor(e,i,n,a=!1,o=!0,d=0,c=!1,l=s.Texture.TRILINEAR_SAMPLINGMODE,_=!0,g=!1,R=!1,b=5,f=!1,p,O,m=!1,v=!1){let P,M,T=!0,S=!1;if("object"==typeof a){const e=a;a=!!e.generateMipMaps,o=e.doNotChangeAspectRatio??!0,d=e.type??0,c=!!e.isCube,l=e.samplingMode??s.Texture.TRILINEAR_SAMPLINGMODE,_=e.generateDepthBuffer??!0,g=!!e.generateStencilBuffer,R=!!e.isMulti,b=e.format??5,f=!!e.delayAllocation,p=e.samples,O=e.creationFlags,m=!!e.noColorAttachment,v=!!e.useSRGBBuffer,P=e.colorAttachment,T=e.gammaSpace??T,M=e.existingObjectRenderer,S=!!e.enableClusteredLights}if(super(null,n,!a,void 0,l,void 0,void 0,void 0,void 0,b),this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new t.Observable,this.onAfterUnbindObservable=new t.Observable,this.onClearObservable=new t.Observable,this.onResizeObservable=new t.Observable,this._cleared=!1,this.skipInitialClear=!1,this._samples=1,this._canRescale=!0,this._renderTarget=null,this._dontDisposeObjectRenderer=!1,this.boundingBoxPosition=r.Vector3.Zero(),this._disableEngineStages=!1,this._dumpToolsLoading=!1,!(n=this.getScene()))return;const L=this.getScene().getEngine();if(this._gammaSpace=T,this._coordinatesMode=s.Texture.PROJECTION_MODE,this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=i,this._dontDisposeObjectRenderer=!!M,this._processSizeParameter(i),this._objectRenderer=M??new u(e,n,{numPasses:c?6:this.getRenderLayers()||1,doNotChangeAspectRatio:o,enableClusteredLights:S}),this._onBeforeRenderingManagerRenderObserver=this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(()=>{let e=this._scene;if(!this._disableEngineStages)for(let t of e._beforeRenderTargetClearStage)t.action(this,this._currentFaceIndex,this._currentLayer);if(this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(L):this.skipInitialClear||L.clear(this.clearColor??e.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||e.updateTransformMatrix(!0),!this._disableEngineStages)for(let t of e._beforeRenderTargetDrawStage)t.action(this,this._currentFaceIndex,this._currentLayer);L._debugPushGroup&&L._debugPushGroup(`Render to ${this.name} (face #${this._currentFaceIndex} layer #${this._currentLayer})`)}),this._onAfterRenderingManagerRenderObserver=this._objectRenderer.onAfterRenderingManagerRenderObservable.add(()=>{if(L._debugPopGroup&&L._debugPopGroup(),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetDrawStage)e.action(this,this._currentFaceIndex,this._currentLayer);let e=this._texture?.generateMipMaps??!1;if(this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex,this._postProcesses,this.ignoreCameraViewport):this._currentUseCameraPostProcess&&this._scene.postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetPostProcessStage)e.action(this,this._currentFaceIndex,this._currentLayer);this._texture&&(this._texture.generateMipMaps=e),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),this._currentDumpForDebug&&(this._dumpTools?this._dumpTools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),L):h.Logger.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project"))}),this._onFastPathRenderObserver=this._objectRenderer.onFastPathRenderObservable.add(()=>{this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(L):this.skipInitialClear||L.clear(this.clearColor||this._scene.clearColor,!0,!0,!0)}),this._resizeObserver=L.onResizeObservable.add(()=>{}),this._generateMipMaps=!!a,this._doNotChangeAspectRatio=o,R)return;this._renderTargetOptions={generateMipMaps:a,type:d,format:this._format??void 0,samplingMode:this.samplingMode,generateDepthBuffer:_,generateStencilBuffer:g,samples:p,creationFlags:O,noColorAttachment:m,useSRGBBuffer:v,colorAttachment:P,label:this.name},this.samplingMode===s.Texture.NEAREST_SAMPLINGMODE&&(this.wrapU=s.Texture.CLAMP_ADDRESSMODE,this.wrapV=s.Texture.CLAMP_ADDRESSMODE),f||(c?(this._renderTarget=n.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=s.Texture.INVCUBIC_MODE,this._textureMatrix=r.Matrix.Identity()):this._renderTarget=n.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==p&&(this.samples=p))}createDepthStencilTexture(e=0,t=!0,r=!1,s=1,i=14,n){this._renderTarget?.createDepthStencilTexture(e,t,r,s,i,n)}_processSizeParameter(e){if(e.ratio){this._sizeRatio=e.ratio;let t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e}get samples(){return this._renderTarget?.samples??this._samples}set samples(e){this._renderTarget&&(this._samples=this._renderTarget.setSamples(e))}addPostProcess(e){if(!this._postProcessManager){let e=this.getScene();if(!e)return;this._postProcessManager=new i.PostProcessManager(e),this._postProcesses=[]}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1}clearPostProcesses(e=!1){if(this._postProcesses){if(e)for(let e of this._postProcesses)e.dispose();this._postProcesses=[]}}removePostProcess(e){if(!this._postProcesses)return;let t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}resetRefreshCounter(){this._objectRenderer.resetRefreshCounter()}get refreshRate(){return this._objectRenderer.refreshRate}set refreshRate(e){this._objectRenderer.refreshRate=e}_shouldRender(){return this._objectRenderer.shouldRender()}getRenderSize(){return this.getRenderWidth()}getRenderWidth(){return this._size.width?this._size.width:this._size}getRenderHeight(){return this._size.width?this._size.height:this._size}getRenderLayers(){let e=this._size.layers;if(e)return e;let t=this._size.depth;return t||0}disableRescaling(){this._canRescale=!1}get canRescale(){return this._canRescale}scale(e){let t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){let t=this.isCube;this._renderTarget?.dispose(),this._renderTarget=null;let r=this.getScene();r&&(this._processSizeParameter(e),t?this._renderTarget=r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=r.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==this._renderTargetOptions.samples&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){this._render(e,t)}isReadyForRendering(){this._dumpToolsLoading||(this._dumpToolsLoading=!0,e.A(40106).then(e=>this._dumpTools=e)),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight());let t=this._objectRenderer._checkReadiness();return this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),t}_render(e=!1,t=!1){let r=this.getScene();if(!r)return;void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses);let s=r.getEngine();if(s._debugPushGroup&&s._debugPushGroup(`Render to ${this.name}`),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight()),(this.is2DArray||this.is3D)&&!this.isMulti)for(let s=0;s<this.getRenderLayers();s++)this._renderToTarget(0,e,t,s),r.incrementRenderId(),r.resetCachedMaterial();else if(this.isCube&&!this.isMulti)for(let s=0;s<6;s++)this._renderToTarget(s,e,t),r.incrementRenderId(),r.resetCachedMaterial();else this._renderToTarget(0,e,t);this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),s._debugPopGroup&&s._debugPopGroup()}_bestReflectionRenderTargetDimension(e,t){let r=e*t,s=(0,n.NearestPOT)(r+16384/(128+r));return Math.min((0,n.FloorPOT)(e),s)}_bindFrameBuffer(e=0,t=0){let r=this.getScene();if(!r)return;let s=r.getEngine();this._renderTarget&&s.bindFramebuffer(this._renderTarget,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}_unbindFrameBuffer(e,t){this._renderTarget&&e.unBindFramebuffer(this._renderTarget,this.isCube,()=>{this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,r,s){this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses)||this._bindFrameBuffer(t,r):s&&e.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(t,r)}_renderToTarget(e,t,r,s=0){let i=this.getScene();if(!i)return;let n=i.getEngine();this._currentFaceIndex=e,this._currentLayer=s,this._currentUseCameraPostProcess=t,this._currentDumpForDebug=r,this._prepareFrame(i,e,s,t),this._objectRenderer.render(e+s,!0),this._unbindFrameBuffer(n,e),this._texture&&this.isCube&&5===e&&n.generateMipMapsForCubemap(this._texture,!0)}setRenderingOrder(e,t=null,r=null,s=null){this._objectRenderer.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t){this._objectRenderer.setRenderingAutoClearDepthStencil(e,t)}clone(){let e=this.getSize(),t=new f(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){if(!this.name)return null;let e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t<this.renderList.length;t++)e.renderList.push(this.renderList[t].id);return e}disposeFramebufferObjects(){this._renderTarget?.dispose(!0)}releaseInternalTexture(){this._renderTarget?.releaseTextures(),this._texture=null}dispose(){this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this._prePassRenderTarget&&this._prePassRenderTarget.dispose(),this._objectRenderer.onBeforeRenderingManagerRenderObservable.remove(this._onBeforeRenderingManagerRenderObserver),this._objectRenderer.onAfterRenderingManagerRenderObservable.remove(this._onAfterRenderingManagerRenderObserver),this._objectRenderer.onFastPathRenderObservable.remove(this._onFastPathRenderObserver),this._dontDisposeObjectRenderer||this._objectRenderer.dispose(),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null);let e=this.getScene();if(!e)return;let t=e.customRenderTargets.indexOf(this);for(let r of(t>=0&&e.customRenderTargets.splice(t,1),e.cameras))(t=r.customRenderTargets.indexOf(this))>=0&&r.customRenderTargets.splice(t,1);this._renderTarget?.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this._objectRenderer._rebuild(),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._objectRenderer.freeRenderingGroups()}getViewCount(){return 1}}f.REFRESHRATE_RENDER_ONCE=u.REFRESHRATE_RENDER_ONCE,f.REFRESHRATE_RENDER_ONEVERYFRAME=u.REFRESHRATE_RENDER_ONEVERYFRAME,f.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=u.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;let p=!1;Object.getOwnPropertyDescriptor(f.prototype,"noPrePassRenderer")||Object.defineProperty(f.prototype,"noPrePassRenderer",(0,b._MissingSideEffectProperty)("RenderTargetTexture","noPrePassRenderer")),e.s(["RegisterRenderTargetTexture",0,function(){p||(p=!0,(0,a.RegisterAbstractEngineTexture)(),R.Effect.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t,e)},s.Texture._CreateRenderTargetTexture=(e,t,r,s,i)=>new f(e,t,r,s))},"RenderTargetTexture",0,f],93414)}]);