@uptimizr/dashboard 0.4.7 → 1.0.0
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.
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +9 -9
- package/out/__next._full.txt +10 -10
- package/out/__next._tree.txt +1 -1
- package/out/_next/static/chunks/{209sxygecny37.js → 0-6mdj5wxsfid.js} +1 -1
- package/out/_next/static/chunks/{0ybs1u66q26su.js → 0-qthfqvm1jyj.js} +1 -1
- package/out/_next/static/chunks/01viyuclp2gm9.js +1 -0
- package/out/_next/static/chunks/02aym4t2hgo5c.js +1 -0
- package/out/_next/static/chunks/02ic9b5ejugow.js +1 -0
- package/out/_next/static/chunks/03p70i4c7qt0v.js +1 -0
- package/out/_next/static/chunks/{33i36o_l69sm5.js → 03pjr-ivdicng.js} +1 -1
- package/out/_next/static/chunks/041a06-lxipy5.js +1 -0
- package/out/_next/static/chunks/{1zm6eo861i3c8.js → 06dzkwetqis-5.js} +1 -1
- package/out/_next/static/chunks/{3ipx7xbxchsq9.js → 06kvanz5-fo52.js} +1 -1
- package/out/_next/static/chunks/07y8ke_iy59dn.js +1 -0
- package/out/_next/static/chunks/09jukc-4jl735.js +1 -0
- package/out/_next/static/chunks/{35sne1llxnc-m.js → 09khmdgez3t0a.js} +18 -18
- package/out/_next/static/chunks/{02qk_wmkf9at-.js → 0_dca4876jshu.js} +38 -38
- package/out/_next/static/chunks/0axcgnl5qzr6e.js +1 -0
- package/out/_next/static/chunks/0ay4fjomijs3n.js +1 -0
- package/out/_next/static/chunks/0c7fy79wlccat.js +1 -0
- package/out/_next/static/chunks/0cqe4-l3imct3.js +1 -0
- package/out/_next/static/chunks/0cssvelju788j.js +1 -0
- package/out/_next/static/chunks/{0-_j1khfoib6l.js → 0ctain5xq2wsd.js} +12 -12
- package/out/_next/static/chunks/{22yqh0zlo_vwr.js → 0df-dr3otg_4w.js} +1 -1
- package/out/_next/static/chunks/{26y9sv8_-ykxf.js → 0endw997j7ao9.js} +1 -1
- package/out/_next/static/chunks/0ev_pbit1v_qg.js +1 -0
- package/out/_next/static/chunks/0eyw9oiwipywb.js +1 -0
- package/out/_next/static/chunks/0fkzbuo1tex4u.js +1 -0
- package/out/_next/static/chunks/0govas0u0t4w3.js +1 -0
- package/out/_next/static/chunks/{0grasqqf5dw7r.js → 0guzhnususp3-.js} +2 -2
- package/out/_next/static/chunks/0h7bq_ysu17q7.js +3 -0
- package/out/_next/static/chunks/0hneh_3xzlo28.js +1 -0
- package/out/_next/static/chunks/0iaqwme19z_0s.js +1 -0
- package/out/_next/static/chunks/0ibmar10xndpn.js +1 -0
- package/out/_next/static/chunks/0ii8mqoteppgh.js +11 -0
- package/out/_next/static/chunks/{1uh9zgsy69g92.js → 0ip6v64di_l6x.js} +1 -1
- package/out/_next/static/chunks/{267prao6fyt22.js → 0ixymgjgz3grn.js} +10 -10
- package/out/_next/static/chunks/0kuah8g7lt5ox.js +1 -0
- package/out/_next/static/chunks/0l3k4j19vxm17.js +1 -0
- package/out/_next/static/chunks/0l6hg0ohwh9-m.js +1 -0
- package/out/_next/static/chunks/0m4um4ylhlfan.js +1 -0
- package/out/_next/static/chunks/0mj837d4h0ddq.js +1 -0
- package/out/_next/static/chunks/0nyn-f4905o91.js +1 -0
- package/out/_next/static/chunks/0og6i9rsgkuif.js +1 -0
- package/out/_next/static/chunks/0os1x-fxzgnxs.js +1 -0
- package/out/_next/static/chunks/0otnra7mp0hog.js +1 -0
- package/out/_next/static/chunks/{1gttu-n9am66k.js → 0oyf2xzv8ofkk.js} +21 -21
- package/out/_next/static/chunks/0qvsy3gcqjm12.js +1 -0
- package/out/_next/static/chunks/{1qg1l7t00nyib.js → 0rl4ddh2vgxyl.js} +14 -14
- package/out/_next/static/chunks/0rwpttmsmqvn_.js +1 -0
- package/out/_next/static/chunks/0so3wjp9ch93y.js +1 -0
- package/out/_next/static/chunks/{43fp64xnfy646.js → 0te4g160_rb5d.js} +1 -1
- package/out/_next/static/chunks/0uby-zvu799ef.js +1 -0
- package/out/_next/static/chunks/{3h6akt2uu05ku.js → 0uvn0op2mlr2u.js} +12 -12
- package/out/_next/static/chunks/0vwj4hxjm0igv.js +1 -0
- package/out/_next/static/chunks/{1m9zc5gm-327d.js → 0w7c30w07uct2.js} +10 -10
- package/out/_next/static/chunks/0wm38z3u2133a.js +1 -0
- package/out/_next/static/chunks/0y7yk5al7_p8q.js +4 -0
- package/out/_next/static/chunks/0ywvahq9t0tki.js +1 -0
- package/out/_next/static/chunks/0zh6nslagkby-.js +1 -0
- package/out/_next/static/chunks/{3vbamaoiuk9yj.js → 0zo8xa0nej3ex.js} +1 -1
- package/out/_next/static/chunks/{2of8q0kaeqpf0.js → 0zsir95gpf3xw.js} +1 -1
- package/out/_next/static/chunks/0zu6ryyj0ig-j.js +3 -0
- package/out/_next/static/chunks/{2c721vfva711t.js → 1-jv8k10q_1uw.js} +1 -1
- package/out/_next/static/chunks/1-s5ioie9a94e.js +1 -0
- package/out/_next/static/chunks/{13zcn4lv0qj76.js → 1-yos1h0qws5e.js} +11 -11
- package/out/_next/static/chunks/10o7brc3x027r.js +1 -0
- package/out/_next/static/chunks/{060iult6f68_e.js → 10pae4gb9i929.js} +29 -29
- package/out/_next/static/chunks/13p93itm8a3ym.js +1 -0
- package/out/_next/static/chunks/{0btmk0wmekl02.js → 147s8i_lktp4_.js} +2 -2
- package/out/_next/static/chunks/{3njwfothmmg7u.js → 14tgo5xt_3j4w.js} +1 -1
- package/out/_next/static/chunks/1699hx-vlak0n.js +22 -0
- package/out/_next/static/chunks/16d6n9e77rqti.js +1 -0
- package/out/_next/static/chunks/{3zs7l4362msjd.js → 16f3d5dv83rsr.js} +1 -1
- package/out/_next/static/chunks/16i_tpwn_cmr-.js +1 -0
- package/out/_next/static/chunks/{1by60_b14x-3o.js → 16rfr165nbha0.js} +1 -1
- package/out/_next/static/chunks/{0zqgq0lwtz9tn.js → 16sl51pvzo4tf.js} +1 -1
- package/out/_next/static/chunks/{2n-pveub8b_5t.js → 1760s-32qpwgg.js} +1 -1
- package/out/_next/static/chunks/{1u8snlm6a7uhi.js → 18kq07c5xy_4g.js} +4 -4
- package/out/_next/static/chunks/{1rcdimhu0qhlu.js → 190tbzt861ao3.js} +39 -39
- package/out/_next/static/chunks/19bhv6cupnnyj.js +1 -0
- package/out/_next/static/chunks/1_14pn2wwebxy.js +1 -0
- package/out/_next/static/chunks/{3huu0tqmxwowu.js → 1_kikmeubh0wq.js} +30 -30
- package/out/_next/static/chunks/1ay3z6agelsvz.js +1 -0
- package/out/_next/static/chunks/1b-fi3bfmpe31.js +1 -0
- package/out/_next/static/chunks/1bae3tqv53x9_.js +1 -0
- package/out/_next/static/chunks/1bf421g4peccx.js +2 -0
- package/out/_next/static/chunks/1bfony5qsc5tp.js +1 -0
- package/out/_next/static/chunks/{1e8_jl2cxd3rp.js → 1ddt0ot7kl8vq.js} +40 -40
- package/out/_next/static/chunks/1emz2vjkgck4z.js +1 -0
- package/out/_next/static/chunks/1eogzzw8i1wsg.js +1 -0
- package/out/_next/static/chunks/{2apihn9ra2ufp.js → 1g9p2h1-31q8o.js} +1 -1
- package/out/_next/static/chunks/1gcz1k1v1woca.js +1 -0
- package/out/_next/static/chunks/{3v-0c2aj6c0on.js → 1h8lyicgqhpxa.js} +1 -1
- package/out/_next/static/chunks/{3772oce1n3t_g.js → 1hot663akaepl.js} +1 -1
- package/out/_next/static/chunks/1i7pgl3ks5ye0.js +1 -0
- package/out/_next/static/chunks/{2sys9nj8lo3uk.js → 1i8sk_qgpdjhs.js} +1 -1
- package/out/_next/static/chunks/1k8erl2uygr8g.js +1 -0
- package/out/_next/static/chunks/{30bhz7czzs4mf.js → 1kk3ct7pkpf3b.js} +1 -1
- package/out/_next/static/chunks/{33hp-khdfohdq.js → 1kq9o8del67le.js} +1 -1
- package/out/_next/static/chunks/{3d-i_skta_wes.js → 1l7tzyx2mumlq.js} +1 -1
- package/out/_next/static/chunks/1n_uwed9o--go.js +1 -0
- package/out/_next/static/chunks/1o351eldttogn.js +1 -0
- package/out/_next/static/chunks/1ogs4_aj84bfn.js +1 -0
- package/out/_next/static/chunks/{0sw-8gxbg4x0l.js → 1p206txlluipi.js} +18 -18
- package/out/_next/static/chunks/1p2bt1w845v6c.js +1 -0
- package/out/_next/static/chunks/1p3rgz4aef1gk.js +1 -0
- package/out/_next/static/chunks/{41b5gpyqbj58m.js → 1qcgdx9yl0gfx.js} +4 -4
- package/out/_next/static/chunks/1ql3mm2w5r-m8.js +1 -0
- package/out/_next/static/chunks/1qvcyuyshi3ll.js +53 -0
- package/out/_next/static/chunks/1r0yyg5a_0knc.js +1 -0
- package/out/_next/static/chunks/{15o4_2t-l3rj5.js → 1sa6qiidtcyk2.js} +1 -1
- package/out/_next/static/chunks/1t-9vrdrsi8le.js +1 -0
- package/out/_next/static/chunks/{1rlfg62jxqj3z.js → 1t97zo0tlpbnz.js} +1 -1
- package/out/_next/static/chunks/1te2tinzqnwck.js +1 -0
- package/out/_next/static/chunks/{3sa_hlx3konc7.js → 1trt-m2nrck0v.js} +1 -1
- package/out/_next/static/chunks/1ty9jpwr3o_st.js +1 -0
- package/out/_next/static/chunks/1u6w6veke8rze.js +1 -0
- package/out/_next/static/chunks/1u900urmrbv73.js +1 -0
- package/out/_next/static/chunks/{3_dgblylldcgb.js → 1vz2gd8k74lpi.js} +1 -1
- package/out/_next/static/chunks/1wkpl9bfb0wn7.js +1 -0
- package/out/_next/static/chunks/1wrly9a9c3teq.js +1 -0
- package/out/_next/static/chunks/1x0m05155yy4e.js +1 -0
- package/out/_next/static/chunks/{3xl-op0hwxytg.js → 1xf1wfow43ekc.js} +5 -5
- package/out/_next/static/chunks/1y10o40v9odam.js +1 -0
- package/out/_next/static/chunks/{2s6kpclh6ie7o.js → 1y_zykt3fpen4.js} +29 -29
- package/out/_next/static/chunks/1ye6xtbm16pg4.js +1 -0
- package/out/_next/static/chunks/{1t5oynmttpfsw.js → 1z6_57k5h31u7.js} +1 -1
- package/out/_next/static/chunks/{0lep3_bqwfuin.js → 1zboqft0h6mop.js} +1 -1
- package/out/_next/static/chunks/{43v4y2gu5z9_h.js → 1zr3c351x0ri5.js} +1 -1
- package/out/_next/static/chunks/2-5p2lcedvrli.js +1 -0
- package/out/_next/static/chunks/206hxrq60f1_e.js +1 -0
- package/out/_next/static/chunks/20r05k3-studj.js +1 -0
- package/out/_next/static/chunks/221j_mhvdpitn.js +1 -0
- package/out/_next/static/chunks/22gs24kj2du56.js +1 -0
- package/out/_next/static/chunks/22x5pd1gyp7sf.js +1 -0
- package/out/_next/static/chunks/{2a07so920b6aa.js → 22z-2t_yp1jzs.js} +1 -1
- package/out/_next/static/chunks/{30n4y_uu8chbh.js → 23hmfdw6z5zfy.js} +30 -30
- package/out/_next/static/chunks/23y1krqnc-8sm.js +1 -0
- package/out/_next/static/chunks/{3f8qelpscqfym.js → 24tbkj1qkux88.js} +2 -2
- package/out/_next/static/chunks/{2ao-3jzz7yw3p.js → 26cmri51v7497.js} +11 -11
- package/out/_next/static/chunks/27jalbk9zu-2b.js +1 -0
- package/out/_next/static/chunks/285d2s9096ryc.js +1 -0
- package/out/_next/static/chunks/296ykep2nvppv.js +1 -0
- package/out/_next/static/chunks/29nehg5cal-ug.js +1 -0
- package/out/_next/static/chunks/2_a56_k3x7to6.js +1 -0
- package/out/_next/static/chunks/2a-0l6eb1blh3.js +4 -0
- package/out/_next/static/chunks/{3qn6r8-0u6dij.js → 2a31-txop1jzg.js} +38 -38
- package/out/_next/static/chunks/2aanowvpmkmvj.js +1 -0
- package/out/_next/static/chunks/2bse5vll1o-x0.js +1 -0
- package/out/_next/static/chunks/2ct40spu9wfj7.js +1 -0
- package/out/_next/static/chunks/{2kok6zedeeltw.js → 2ept01b7t-e03.js} +1 -1
- package/out/_next/static/chunks/{3w59kt5ztyvoq.js → 2ey5dqelco_g5.js} +1 -1
- package/out/_next/static/chunks/2fd_009hw7y0m.js +1 -0
- package/out/_next/static/chunks/{0fd-0i1yt23kz.js → 2ftz9kaxrsgxh.js} +1 -1
- package/out/_next/static/chunks/2gefdnozflr7p.js +1 -0
- package/out/_next/static/chunks/{2izok2otbk8-2.js → 2gs-u1n5uv7iz.js} +37 -37
- package/out/_next/static/chunks/{2r96kyeehsji9.js → 2hizqql79u-54.js} +1 -1
- package/out/_next/static/chunks/2iqf2dpdg_vfl.js +1 -0
- package/out/_next/static/chunks/2j7z127s_ycjd.js +1 -0
- package/out/_next/static/chunks/2kax7uslfxdnx.js +31 -0
- package/out/_next/static/chunks/2lh_w9rzy3vek.js +1 -0
- package/out/_next/static/chunks/{0rracz73p38mo.js → 2ln1na26qwp-3.js} +9 -9
- package/out/_next/static/chunks/2n08l1q5o_27e.js +1 -0
- package/out/_next/static/chunks/2n7268gyd9z-6.js +1 -0
- package/out/_next/static/chunks/2nq9cgjmtqwvp.js +1 -0
- package/out/_next/static/chunks/{005bbq_px7lke.js → 2oj8qc_pv14nk.js} +2 -2
- package/out/_next/static/chunks/2q24e72-olbe8.js +1 -0
- package/out/_next/static/chunks/2qc4hscs26cro.js +1 -0
- package/out/_next/static/chunks/{0gf-ztg86zd80.js → 2qe46redkqhfg.js} +1 -1
- package/out/_next/static/chunks/2qtc0nbl_521e.js +1 -0
- package/out/_next/static/chunks/{0e1jfrmioeuws.js → 2rofu6gu1xzuq.js} +1 -1
- package/out/_next/static/chunks/2tdi94rkq739i.js +1 -0
- package/out/_next/static/chunks/2u_2sacqa9xa7.js +1 -0
- package/out/_next/static/chunks/2ujqz6088shm5.js +1 -0
- package/out/_next/static/chunks/{1l_3oidssbhns.js → 2urh9qafp3fiw.js} +17 -17
- package/out/_next/static/chunks/{05v-nubi896jg.js → 2v06n4z8wsmn9.js} +1 -1
- package/out/_next/static/chunks/2vp-5skbk1nfu.js +1 -0
- package/out/_next/static/chunks/2vu973j_n6cpx.js +1 -0
- package/out/_next/static/chunks/{37cnbm5ft1mqf.js → 2wwra56rehfcj.js} +1 -1
- package/out/_next/static/chunks/2xpwr97h2asal.js +1 -0
- package/out/_next/static/chunks/3000-0b8n9t_2.js +1 -0
- package/out/_next/static/chunks/30t3203d7p2da.js +1 -0
- package/out/_next/static/chunks/31kto7-dxkt3z.js +1 -0
- package/out/_next/static/chunks/{2lsvk7xcfkarc.js → 32oflcl79d8mu.js} +1 -1
- package/out/_next/static/chunks/32ovg81ae0l03.js +1 -0
- package/out/_next/static/chunks/{0z9erbl3llr_b.js → 331kthnvoma7n.js} +16 -16
- package/out/_next/static/chunks/{0q75860p8u_ii.js → 337kn1mn34rc6.js} +1 -1
- package/out/_next/static/chunks/{2tc3e-iqv71y_.js → 33xug8kf0-a1o.js} +1 -1
- package/out/_next/static/chunks/{1-ogak5u00kwa.js → 34dcb7_flbrvo.js} +1 -1
- package/out/_next/static/chunks/34g070edw165e.js +3 -0
- package/out/_next/static/chunks/34zotyeqrz_nq.js +1 -0
- package/out/_next/static/chunks/351wsmi75l8db.js +1 -0
- package/out/_next/static/chunks/{15jlgfcaeaki9.js → 36yv-ialtpx98.js} +1 -1
- package/out/_next/static/chunks/37hwasxtee5e0.js +1 -0
- package/out/_next/static/chunks/37t0iclgxes05.js +1 -0
- package/out/_next/static/chunks/{1q4lkgxfnqnew.js → 37xnvnx1jxfaf.js} +1 -1
- package/out/_next/static/chunks/{2z_iab7ozohhq.js → 38w74ixqt-9co.js} +16 -16
- package/out/_next/static/chunks/{2h249uvhh2sij.js → 39t2x_9zd2rst.js} +10 -10
- package/out/_next/static/chunks/{2n3xu_wbvtj7h.js → 3_xqc3658d8sw.js} +12 -12
- package/out/_next/static/chunks/3ba8eudvlczwe.js +1 -0
- package/out/_next/static/chunks/{2q6l-xdqzgmpf.js → 3buezhxqc8n6n.js} +1 -1
- package/out/_next/static/chunks/{1zt1xxovnjhkm.js → 3c5iwwj-fhbue.js} +1 -1
- package/out/_next/static/chunks/{2urx6fow8c8c9.js → 3d8ot2tw6yqfq.js} +12 -12
- package/out/_next/static/chunks/3dc057ffe7ij-.js +1 -0
- package/out/_next/static/chunks/3djnlzwj9869o.js +1 -0
- package/out/_next/static/chunks/{2y8i7_nxm4r05.js → 3fuqxjjf8o1v9.js} +5 -5
- package/out/_next/static/chunks/{0z004fn14pbcu.js → 3gt6rzg9qw-an.js} +1 -1
- package/out/_next/static/chunks/{1tgj55b305g4h.js → 3h_05w5j8x538.js} +1 -1
- package/out/_next/static/chunks/{3j9xvdz55bi4p.js → 3hkhd1_k8xohv.js} +33 -33
- package/out/_next/static/chunks/{42ymanq326mo7.js → 3ijcc5tfisfnj.js} +1 -1
- package/out/_next/static/chunks/3j0dbpd9zop3p.js +1 -0
- package/out/_next/static/chunks/{1zkd8v-qka--j.js → 3ju83xk-ca7ma.js} +21 -21
- package/out/_next/static/chunks/3jxhl4apmhbm1.js +13 -0
- package/out/_next/static/chunks/{302qk2fjdrthp.js → 3la99oz_0p0r6.js} +5 -5
- package/out/_next/static/chunks/3n1b34fd5fdrh.js +1 -0
- package/out/_next/static/chunks/{2j120dkh7q3uf.js → 3nq_hq4x3rn3r.js} +1 -1
- package/out/_next/static/chunks/3pgb1kkqrdl9t.js +1 -0
- package/out/_next/static/chunks/3pik_-jj-zkfl.js +1 -0
- package/out/_next/static/chunks/{2w99knknr5i8c.js → 3q38kdbzd2nbd.js} +1 -1
- package/out/_next/static/chunks/3q5zl4ks17au2.js +1 -0
- package/out/_next/static/chunks/{2uo6vm7mfgrbf.js → 3qr10445lte-n.js} +1 -1
- package/out/_next/static/chunks/3r-8bnguvxsyo.js +1 -0
- package/out/_next/static/chunks/3sg56j8boe-3o.js +1 -0
- package/out/_next/static/chunks/{2q8yg63br2jc9.js → 3u7zj1-jdg781.js} +1 -1
- package/out/_next/static/chunks/{32_c4mbb6j1l6.js → 3wj5dmf6cywz8.js} +22 -22
- package/out/_next/static/chunks/{3oqxl46ukaojj.js → 3wr_oijfsq8lr.js} +11 -11
- package/out/_next/static/chunks/3xu0dh1ikzwj2.js +1 -0
- package/out/_next/static/chunks/3y5tpixt23-fl.js +1 -0
- package/out/_next/static/chunks/40gjf-_jt8upu.js +5 -0
- package/out/_next/static/chunks/41f12o_5lf-i9.js +1 -0
- package/out/_next/static/chunks/42ma8lqduohlc.js +1 -0
- package/out/_next/static/chunks/{0ai0zgbgjqb92.js → 43usshq2nc125.js} +1 -1
- package/out/_next/static/chunks/{0hajwk2yd-rwr.js → 44bl4ufopbmyh.js} +1 -1
- package/out/_next/static/chunks/44iutzkw9r21x.js +1 -0
- package/out/_next/static/chunks/turbopack-1xrxa3noq196-.js +1 -0
- package/out/_not-found/__next._full.txt +8 -8
- package/out/_not-found/__next._not-found.__PAGE__.txt +7 -7
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +8 -8
- package/out/index.html +1 -1
- package/out/index.txt +10 -10
- package/package.json +10 -10
- package/out/_next/static/chunks/00fbhtmui-yxg.js +0 -1
- package/out/_next/static/chunks/017pn-pen381_.js +0 -1
- package/out/_next/static/chunks/01vov6inx1zzt.js +0 -1
- package/out/_next/static/chunks/03bd5plut08tg.js +0 -1
- package/out/_next/static/chunks/03dwfqmo73w_z.js +0 -1
- package/out/_next/static/chunks/03sn4419dam-h.js +0 -5
- package/out/_next/static/chunks/05ere0-228syf.js +0 -1
- package/out/_next/static/chunks/05h8u5lrypn5m.js +0 -1
- package/out/_next/static/chunks/05z79zh625ezu.js +0 -1
- package/out/_next/static/chunks/08lvtnv7b1cxp.js +0 -1
- package/out/_next/static/chunks/0_v2luu_qmeid.js +0 -1
- package/out/_next/static/chunks/0boov9mwycanf.js +0 -1
- package/out/_next/static/chunks/0d8x8m2x6ca_m.js +0 -1
- package/out/_next/static/chunks/0dmrdrwtd093b.js +0 -1
- package/out/_next/static/chunks/0e7nlxmneb2j_.js +0 -1
- package/out/_next/static/chunks/0es97pusfxupl.js +0 -1
- package/out/_next/static/chunks/0fxdyvb1w23d1.js +0 -1
- package/out/_next/static/chunks/0fxhc24djjcgq.js +0 -1
- package/out/_next/static/chunks/0hk1wg7h4araz.js +0 -1
- package/out/_next/static/chunks/0j74ipw4fps-n.js +0 -1
- package/out/_next/static/chunks/0kj-vckdn7t5p.js +0 -1
- package/out/_next/static/chunks/0lbs5xdyjuzuo.js +0 -1
- package/out/_next/static/chunks/0mp0jh1gj7290.js +0 -1
- package/out/_next/static/chunks/0ngpoj2g5i4kz.js +0 -1
- package/out/_next/static/chunks/0nhljhguceh66.js +0 -1
- package/out/_next/static/chunks/0p6z73afb9dj2.js +0 -1
- package/out/_next/static/chunks/0p9zfmidzqkps.js +0 -1
- package/out/_next/static/chunks/0sx-6rf3eteqn.js +0 -1
- package/out/_next/static/chunks/0thw099xk3_0p.js +0 -3
- package/out/_next/static/chunks/0u85f0dhb4i8e.js +0 -1
- package/out/_next/static/chunks/0uk7kigzm4vi2.js +0 -31
- package/out/_next/static/chunks/0ulufxnsrou61.js +0 -1
- package/out/_next/static/chunks/0xa9dyg6ezzyd.js +0 -2
- package/out/_next/static/chunks/0xvrfvur0p534.js +0 -1
- package/out/_next/static/chunks/0ydfhk-p6zvm0.js +0 -1
- package/out/_next/static/chunks/0zcsxvcvog9ue.js +0 -1
- package/out/_next/static/chunks/10_5p5-xf2aoo.js +0 -1
- package/out/_next/static/chunks/118qlrzdwpfmo.js +0 -1
- package/out/_next/static/chunks/11km5p4gd0ut4.js +0 -1
- package/out/_next/static/chunks/120rl4l29q9xs.js +0 -1
- package/out/_next/static/chunks/129m5i93ltoym.js +0 -1
- package/out/_next/static/chunks/12n73o884lyyl.js +0 -1
- package/out/_next/static/chunks/133glnfos64oo.js +0 -1
- package/out/_next/static/chunks/175st2ogkg_1o.js +0 -1
- package/out/_next/static/chunks/19rsodtu91ja_.js +0 -1
- package/out/_next/static/chunks/1a2ouhup611bz.js +0 -1
- package/out/_next/static/chunks/1cyq7i39885sl.js +0 -1
- package/out/_next/static/chunks/1d9it6yocgt54.js +0 -1
- package/out/_next/static/chunks/1dp1s1t-y7gal.js +0 -1
- package/out/_next/static/chunks/1dr7gh6xgypl8.js +0 -1
- package/out/_next/static/chunks/1dt30s_sp8415.js +0 -1
- package/out/_next/static/chunks/1f1rek_fxk3of.js +0 -1
- package/out/_next/static/chunks/1f2mna0k5efeq.js +0 -1
- package/out/_next/static/chunks/1gfz3sxwkkg3d.js +0 -1
- package/out/_next/static/chunks/1gr35qeguuws0.js +0 -1
- package/out/_next/static/chunks/1imi0xwi9hd99.js +0 -1
- package/out/_next/static/chunks/1ka5v5zu0cstt.js +0 -1
- package/out/_next/static/chunks/1n9nhz-6azcp3.js +0 -3
- package/out/_next/static/chunks/1ncqwe81t_9_x.js +0 -1
- package/out/_next/static/chunks/1nix_lulkpklo.js +0 -1
- package/out/_next/static/chunks/1ntqovuz2c217.js +0 -1
- package/out/_next/static/chunks/1pgs-98tfkq9_.js +0 -1
- package/out/_next/static/chunks/1q2z0aeopo8t8.js +0 -1
- package/out/_next/static/chunks/1ses023uud001.js +0 -1
- package/out/_next/static/chunks/1t9i20i5-f8ze.js +0 -1
- package/out/_next/static/chunks/1ug4k-1zhr63a.js +0 -1
- package/out/_next/static/chunks/1vrpzlif-z_p0.js +0 -1
- package/out/_next/static/chunks/1vurgl6oz2qey.js +0 -17
- package/out/_next/static/chunks/1w-qc09n9ijtq.js +0 -1
- package/out/_next/static/chunks/1ycqxcht6x54p.js +0 -1
- package/out/_next/static/chunks/1zj4307ugq0qz.js +0 -1
- package/out/_next/static/chunks/1zm52cjrfrq7c.js +0 -1
- package/out/_next/static/chunks/1zp9363yfhpom.js +0 -1
- package/out/_next/static/chunks/2-3hk_db5fpok.js +0 -1
- package/out/_next/static/chunks/2-bv9a_0zgw1f.js +0 -1
- package/out/_next/static/chunks/216uiih3_vdfd.js +0 -1
- package/out/_next/static/chunks/21kfpd_bityxt.js +0 -1
- package/out/_next/static/chunks/24ecas0m9tao7.js +0 -3
- package/out/_next/static/chunks/24pq9210rng3f.js +0 -1
- package/out/_next/static/chunks/26skkagvj1z96.js +0 -1
- package/out/_next/static/chunks/2701xfv_07wz_.js +0 -1
- package/out/_next/static/chunks/271333m8y3k0e.js +0 -1
- package/out/_next/static/chunks/29rkmguzky-bp.js +0 -1
- package/out/_next/static/chunks/2a2oy8ryz2tsk.js +0 -1
- package/out/_next/static/chunks/2apnpj0-fs9ks.js +0 -1
- package/out/_next/static/chunks/2b481pitl4k85.js +0 -1
- package/out/_next/static/chunks/2bettxaqt3d2p.js +0 -1
- package/out/_next/static/chunks/2d2kl_m64j9cb.js +0 -1
- package/out/_next/static/chunks/2droqjmvmgj13.js +0 -1
- package/out/_next/static/chunks/2dxbvwbbgpzoq.js +0 -1
- package/out/_next/static/chunks/2eqbsut829r5l.js +0 -1
- package/out/_next/static/chunks/2f3_mzxjh3gso.js +0 -1
- package/out/_next/static/chunks/2fsde0jwi5qtt.js +0 -1
- package/out/_next/static/chunks/2j2ynchpqh34-.js +0 -1
- package/out/_next/static/chunks/2kj6pzs_wap1v.js +0 -1
- package/out/_next/static/chunks/2lnj9jruy4nrv.js +0 -1
- package/out/_next/static/chunks/2ofwtw6p08sfz.js +0 -1
- package/out/_next/static/chunks/2phl5ta4iim7l.js +0 -12
- package/out/_next/static/chunks/2r5qgieqldcd9.js +0 -1
- package/out/_next/static/chunks/2r7y401cvjc1s.js +0 -1
- package/out/_next/static/chunks/2rmc6ru7mc-kg.js +0 -1
- package/out/_next/static/chunks/2w2k1gveljyb7.js +0 -1
- package/out/_next/static/chunks/2w_ptlw-ad8-9.js +0 -4
- package/out/_next/static/chunks/2ws1s9d52ayv8.js +0 -1
- package/out/_next/static/chunks/2x7enks3ydgai.js +0 -1
- package/out/_next/static/chunks/2ydub0t01728d.js +0 -1
- package/out/_next/static/chunks/3-m_vzabs1uez.js +0 -1
- package/out/_next/static/chunks/3527r3jo5fj3i.js +0 -1
- package/out/_next/static/chunks/355dg8yaa94hr.js +0 -1
- package/out/_next/static/chunks/35ntbr_c-yx44.js +0 -1
- package/out/_next/static/chunks/36enkx1skkv2-.js +0 -4
- package/out/_next/static/chunks/38xdo3cifphut.js +0 -1
- package/out/_next/static/chunks/3beawo-qwuk8k.js +0 -1
- package/out/_next/static/chunks/3cj_6sl9kr3e9.js +0 -1
- package/out/_next/static/chunks/3df_l2we755bb.js +0 -1
- package/out/_next/static/chunks/3eve5y7fpzx2h.js +0 -1
- package/out/_next/static/chunks/3ewgyb4y19w-3.js +0 -1
- package/out/_next/static/chunks/3f3789eh18_oy.js +0 -1
- package/out/_next/static/chunks/3g3-e9m1en45q.js +0 -1
- package/out/_next/static/chunks/3i239y-1hbkm-.js +0 -1
- package/out/_next/static/chunks/3kp8qmhoi24oz.js +0 -1
- package/out/_next/static/chunks/3ksq69yq-40_r.js +0 -1
- package/out/_next/static/chunks/3qye1lytea2i8.js +0 -1
- package/out/_next/static/chunks/3rlp9yr75liz7.js +0 -1
- package/out/_next/static/chunks/3tyo643l62h3m.js +0 -1
- package/out/_next/static/chunks/3tz2tpqa9uvwm.js +0 -1
- package/out/_next/static/chunks/3utpc-fc6_y0f.js +0 -1
- package/out/_next/static/chunks/3v6nxa28rxngq.js +0 -1
- package/out/_next/static/chunks/3vv99btjc-mky.js +0 -1
- package/out/_next/static/chunks/3x02lxdo28u9i.js +0 -1
- package/out/_next/static/chunks/3ydnxyc4rvad_.js +0 -1
- package/out/_next/static/chunks/3ylg4gfetwgxw.js +0 -1
- package/out/_next/static/chunks/3zdtteq-r2fs5.js +0 -62
- package/out/_next/static/chunks/3zkwt0gybqtgm.js +0 -1
- package/out/_next/static/chunks/40etabvml_71y.js +0 -1
- package/out/_next/static/chunks/417jkzz0slv9m.js +0 -1
- package/out/_next/static/chunks/41u2-5jayyajf.js +0 -22
- package/out/_next/static/chunks/42gcpy51w7lk1.js +0 -1
- package/out/_next/static/chunks/44cer242u-f8v.js +0 -1
- package/out/_next/static/chunks/44zi0gl0a6a8w.js +0 -1
- package/out/_next/static/chunks/turbopack-0n2o5_bkskckx.js +0 -1
- /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_buildManifest.js +0 -0
- /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55206,36838,23037,689,17462,87659,76895,e=>{"use strict";let t,i,s,r,a,n,o,l,h,c,u,d,f,g,_,m,p,M,I,x,b,y,D,V,v,B,S,A,P,T,C,O,R,F,E,w,U,L,W;var N,K,k,z,G,Q,j,q,H,Z,Y,X,$,J,ee,et,ei,es,er,ea,en,eo,el,eh,ec=e.i(42704),eu=e.i(40379),ed=e.i(33169),ef=e.i(13645),eg=e.i(80145);function e_(e,t,i){try{let s=e.next();s.done?t(s):s.value?s.value.then(()=>{s.value=void 0,t(s)},i):t(s)}catch(e){i(e)}}function em(e=25){let t;return(i,s,r)=>{let a=performance.now();void 0===t||a-t>e?(t=a,setTimeout(()=>{e_(i,s,r)},0)):e_(i,s,r)}}function ep(e,t,i,s,r){let a=()=>{let n,o=e=>{e.done?i(e.value):void 0===n?n=!0:a()};do n=void 0,r&&r.aborted?s(Error("Aborted")):t(e,o,s),void 0===n&&(n=!1);while(n)};a()}function eM(e,t){let i;return ep(e,e_,e=>i=e,e=>{throw e},t),i}async function eI(e,t,i){return await new Promise((s,r)=>{ep(e,t,s,r,i)})}function ex(e,t){return(...i)=>eM(e(...i),t)}e.s(["createYieldingScheduler",0,em,"makeSyncFunction",0,ex,"runCoroutineAsync",0,eI,"runCoroutineSync",0,eM],36838);var eb=e.i(51509),ey=e.i(72003),eD=e.i(64073),eV=e.i(75481),ev=e.i(56145),eB=e.i(4112),eS=e.i(43880),eA=e.i(85789),eP=e.i(91679),eT=e.i(30465),eC=e.i(50545);class eO{}let eR=(a=[],N=class{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=ex(this._applyToCoroutine.bind(this)),this.uniqueId=N._UniqueIdGenerator,N._UniqueIdGenerator++}set(e,t){switch(!e.length&&eA.Logger.Warn(`Setting vertex data kind '${t}' with an empty array`),t){case ev.VertexBuffer.PositionKind:this.positions=e;break;case ev.VertexBuffer.NormalKind:this.normals=e;break;case ev.VertexBuffer.TangentKind:this.tangents=e;break;case ev.VertexBuffer.UVKind:this.uvs=e;break;case ev.VertexBuffer.UV2Kind:this.uvs2=e;break;case ev.VertexBuffer.UV3Kind:this.uvs3=e;break;case ev.VertexBuffer.UV4Kind:this.uvs4=e;break;case ev.VertexBuffer.UV5Kind:this.uvs5=e;break;case ev.VertexBuffer.UV6Kind:this.uvs6=e;break;case ev.VertexBuffer.ColorKind:this.colors=e;break;case ev.VertexBuffer.MatricesIndicesKind:this.matricesIndices=e;break;case ev.VertexBuffer.MatricesWeightsKind:this.matricesWeights=e;break;case ev.VertexBuffer.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case ev.VertexBuffer.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}}applyToMesh(e,t){return this._applyTo(e,t,!1),this}applyToGeometry(e,t){return this._applyTo(e,t,!1),this}updateMesh(e){return this._update(e),this}updateGeometry(e){return this._update(e),this}*_applyToCoroutine(e,t=!1,i){if(this.positions&&(e.setVerticesData(ev.VertexBuffer.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(ev.VertexBuffer.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(ev.VertexBuffer.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(ev.VertexBuffer.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(ev.VertexBuffer.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(ev.VertexBuffer.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(ev.VertexBuffer.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(ev.VertexBuffer.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(ev.VertexBuffer.UV6Kind,this.uvs6,t),i&&(yield)),this.colors){let s=this.positions&&this.colors.length===this.positions.length?3:4;e.setVerticesData(ev.VertexBuffer.ColorKind,this.colors,t,s),this.hasVertexAlpha&&void 0!==e.hasVertexAlpha&&(e.hasVertexAlpha=!0),i&&(yield)}if(this.matricesIndices&&(e.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),e.subMeshes&&this.materialInfos&&this.materialInfos.length>1)for(let t of(e.subMeshes=[],this.materialInfos))new eC.SubMesh(t.materialIndex,t.verticesStart,t.verticesCount,t.indexStart,t.indexCount,e);return this}_update(e,t,i){return this.positions&&e.updateVerticesData(ev.VertexBuffer.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(ev.VertexBuffer.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(ev.VertexBuffer.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(ev.VertexBuffer.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(ev.VertexBuffer.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(ev.VertexBuffer.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(ev.VertexBuffer.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(ev.VertexBuffer.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(ev.VertexBuffer.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(ev.VertexBuffer.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1];for(let n=i;n<i+s;n+=3)ey.Vector3.FromArrayToRef(e,n,r),ey.Vector3.TransformCoordinatesToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z}static _TransformVector3Normals(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1];for(let n=i;n<i+s;n+=3)ey.Vector3.FromArrayToRef(e,n,r),ey.Vector3.TransformNormalToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z}static _TransformVector4Normals(e,t,i=0,s=e.length){let r=ey.TmpVectors.Vector4[0],a=ey.TmpVectors.Vector4[1];for(let n=i;n<i+s;n+=4)ey.Vector4.FromArrayToRef(e,n,r),ey.Vector4.TransformNormalToRef(r,t,a),e[n]=a.x,e[n+1]=a.y,e[n+2]=a.z,e[n+3]=a.w}static _FlipFaces(e,t=0,i=e.length){for(let s=t;s<t+i;s+=3){let t=e[s+1];e[s+1]=e[s+2],e[s+2]=t}}transform(e){let t=0>e.determinant();return this.positions&&N._TransformVector3Coordinates(this.positions,e),this.normals&&N._TransformVector3Normals(this.normals,e),this.tangents&&N._TransformVector4Normals(this.tangents,e),t&&this.indices&&N._FlipFaces(this.indices),this}splitBasedOnMaterialID(){if(!this.materialInfos||this.materialInfos.length<2)return[this];let e=[];for(let t of this.materialInfos){let i=new N;if(this.positions&&(i.positions=this.positions.slice(3*t.verticesStart,(t.verticesCount+t.verticesStart)*3)),this.normals&&(i.normals=this.normals.slice(3*t.verticesStart,(t.verticesCount+t.verticesStart)*3)),this.tangents&&(i.tangents=this.tangents.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.colors&&(i.colors=this.colors.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.uvs&&(i.uvs=this.uvs.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs2&&(i.uvs2=this.uvs2.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs3&&(i.uvs3=this.uvs3.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs4&&(i.uvs4=this.uvs4.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs5&&(i.uvs5=this.uvs5.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.uvs6&&(i.uvs6=this.uvs6.slice(2*t.verticesStart,(t.verticesCount+t.verticesStart)*2)),this.matricesIndices&&(i.matricesIndices=this.matricesIndices.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesIndicesExtra&&(i.matricesIndicesExtra=this.matricesIndicesExtra.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesWeights&&(i.matricesWeights=this.matricesWeights.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.matricesWeightsExtra&&(i.matricesWeightsExtra=this.matricesWeightsExtra.slice(4*t.verticesStart,(t.verticesCount+t.verticesStart)*4)),this.indices){i.indices=[];for(let e=t.indexStart;e<t.indexStart+t.indexCount;e++)i.indices.push(this.indices[e]-t.verticesStart)}let s=new eO;s.indexStart=0,s.indexCount=i.indices?i.indices.length:0,s.materialIndex=t.materialIndex,s.verticesStart=0,s.verticesCount=(i.positions?i.positions.length:0)/3,i.materialInfos=[s],e.push(i)}return e}merge(e,t=!1,i=!1,s=!1,r=!1){let a=Array.isArray(e)?e.map(e=>({vertexData:e})):[{vertexData:e}];return eM(this._mergeCoroutine(void 0,a,t,!1,i,s,r))}*_mergeCoroutine(e,t,i=!1,s,r,a=!1,n=!1){this._validate();let o=t.map(e=>e.vertexData),l=this;if(n)for(let e of o)e&&(e._validate(),!this.normals&&e.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&e.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&e.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&e.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&e.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&e.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&e.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&e.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&e.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&e.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&e.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&e.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&e.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(let e of o)if(e){if(n)this.normals&&!e.normals&&(e.normals=new Float32Array(e.positions.length)),this.tangents&&!e.tangents&&(e.tangents=new Float32Array(e.positions.length/3*4)),this.uvs&&!e.uvs&&(e.uvs=new Float32Array(e.positions.length/3*2)),this.uvs2&&!e.uvs2&&(e.uvs2=new Float32Array(e.positions.length/3*2)),this.uvs3&&!e.uvs3&&(e.uvs3=new Float32Array(e.positions.length/3*2)),this.uvs4&&!e.uvs4&&(e.uvs4=new Float32Array(e.positions.length/3*2)),this.uvs5&&!e.uvs5&&(e.uvs5=new Float32Array(e.positions.length/3*2)),this.uvs6&&!e.uvs6&&(e.uvs6=new Float32Array(e.positions.length/3*2)),this.colors&&!e.colors&&(e.colors=new Float32Array(e.positions.length/3*4),e.colors.fill(1)),this.matricesIndices&&!e.matricesIndices&&(e.matricesIndices=new Float32Array(e.positions.length/3*4)),this.matricesWeights&&!e.matricesWeights&&(e.matricesWeights=new Float32Array(e.positions.length/3*4)),this.matricesIndicesExtra&&!e.matricesIndicesExtra&&(e.matricesIndicesExtra=new Float32Array(e.positions.length/3*4)),this.matricesWeightsExtra&&!e.matricesWeightsExtra&&(e.matricesWeightsExtra=new Float32Array(e.positions.length/3*4));else if(e._validate(),!this.normals!=!e.normals||!this.tangents!=!e.tangents||!this.uvs!=!e.uvs||!this.uvs2!=!e.uvs2||!this.uvs3!=!e.uvs3||!this.uvs4!=!e.uvs4||!this.uvs5!=!e.uvs5||!this.uvs6!=!e.uvs6||!this.colors!=!e.colors||!this.matricesIndices!=!e.matricesIndices||!this.matricesWeights!=!e.matricesWeights||!this.matricesIndicesExtra!=!e.matricesIndicesExtra||!this.matricesWeightsExtra!=!e.matricesWeightsExtra)throw Error("Cannot merge vertex data that do not have the same set of attributes")}if(a){let i,s=0,r=0,a=[],n=null,h=[];for(let t of this.splitBasedOnMaterialID())h.push({vertexData:t,transform:e});for(let e of t)if(e.vertexData)for(let t of e.vertexData.splitBasedOnMaterialID())h.push({vertexData:t,transform:e.transform});for(let e of(h.sort((e,t)=>{let i=e.vertexData.materialInfos?e.vertexData.materialInfos[0].materialIndex:0,s=t.vertexData.materialInfos?t.vertexData.materialInfos[0].materialIndex:0;return i>s?1:i===s?0:-1}),h)){let t=e.vertexData;if(i=t.materialInfos?t.materialInfos[0].materialIndex:0,n&&n.materialIndex===i)n.indexCount+=t.indices.length,n.verticesCount+=t.positions.length/3;else{let e=new eO;e.materialIndex=i,e.indexStart=s,e.indexCount=t.indices.length,e.verticesStart=r,e.verticesCount=t.positions.length/3,a.push(e),n=e}s+=t.indices.length,r+=t.positions.length/3}let c=h.splice(0,1)[0];l=c.vertexData,e=c.transform,o=h.map(e=>e.vertexData),t=h,this.materialInfos=a}let h=o.reduce((e,t)=>e+(t.indices?.length??0),l.indices?.length??0),c=r||o.some(e=>e.indices===l.indices)?l.indices?.slice():l.indices;if(h>0){let r=c?.length??0;if(c||(c=Array(h)),c.length!==h){if(Array.isArray(c))c.length=h;else{let e=i||c instanceof Uint32Array?new Uint32Array(h):new Uint16Array(h);e.set(c),c=e}e&&0>e.determinant()&&N._FlipFaces(c,0,r)}let a=l.positions?l.positions.length/3:0;for(let{vertexData:e,transform:i}of t)if(e.indices){for(let t=0;t<e.indices.length;t++)c[r+t]=e.indices[t]+a;i&&0>i.determinant()&&N._FlipFaces(c,r,e.indices.length),a+=e.positions.length/3,r+=e.indices.length,s&&(yield)}}return this.indices=c,this.positions=N._MergeElement(ev.VertexBuffer.PositionKind,l.positions,e,t.map(e=>[e.vertexData.positions,e.transform])),s&&(yield),l.normals&&(this.normals=N._MergeElement(ev.VertexBuffer.NormalKind,l.normals,e,t.map(e=>[e.vertexData.normals,e.transform])),s&&(yield)),l.tangents&&(this.tangents=N._MergeElement(ev.VertexBuffer.TangentKind,l.tangents,e,t.map(e=>[e.vertexData.tangents,e.transform])),s&&(yield)),l.uvs&&(this.uvs=N._MergeElement(ev.VertexBuffer.UVKind,l.uvs,e,t.map(e=>[e.vertexData.uvs,e.transform])),s&&(yield)),l.uvs2&&(this.uvs2=N._MergeElement(ev.VertexBuffer.UV2Kind,l.uvs2,e,t.map(e=>[e.vertexData.uvs2,e.transform])),s&&(yield)),l.uvs3&&(this.uvs3=N._MergeElement(ev.VertexBuffer.UV3Kind,l.uvs3,e,t.map(e=>[e.vertexData.uvs3,e.transform])),s&&(yield)),l.uvs4&&(this.uvs4=N._MergeElement(ev.VertexBuffer.UV4Kind,l.uvs4,e,t.map(e=>[e.vertexData.uvs4,e.transform])),s&&(yield)),l.uvs5&&(this.uvs5=N._MergeElement(ev.VertexBuffer.UV5Kind,l.uvs5,e,t.map(e=>[e.vertexData.uvs5,e.transform])),s&&(yield)),l.uvs6&&(this.uvs6=N._MergeElement(ev.VertexBuffer.UV6Kind,l.uvs6,e,t.map(e=>[e.vertexData.uvs6,e.transform])),s&&(yield)),l.colors&&(this.colors=N._MergeElement(ev.VertexBuffer.ColorKind,l.colors,e,t.map(e=>[e.vertexData.colors,e.transform])),(void 0!==l.hasVertexAlpha||t.some(e=>void 0!==e.vertexData.hasVertexAlpha))&&(this.hasVertexAlpha=l.hasVertexAlpha||t.some(e=>e.vertexData.hasVertexAlpha)),s&&(yield)),l.matricesIndices&&(this.matricesIndices=N._MergeElement(ev.VertexBuffer.MatricesIndicesKind,l.matricesIndices,e,t.map(e=>[e.vertexData.matricesIndices,e.transform])),s&&(yield)),l.matricesWeights&&(this.matricesWeights=N._MergeElement(ev.VertexBuffer.MatricesWeightsKind,l.matricesWeights,e,t.map(e=>[e.vertexData.matricesWeights,e.transform])),s&&(yield)),l.matricesIndicesExtra&&(this.matricesIndicesExtra=N._MergeElement(ev.VertexBuffer.MatricesIndicesExtraKind,l.matricesIndicesExtra,e,t.map(e=>[e.vertexData.matricesIndicesExtra,e.transform])),s&&(yield)),l.matricesWeightsExtra&&(this.matricesWeightsExtra=N._MergeElement(ev.VertexBuffer.MatricesWeightsExtraKind,l.matricesWeightsExtra,e,t.map(e=>[e.vertexData.matricesWeightsExtra,e.transform]))),this}static _MergeElement(e,t,i,s){let r=s.filter(e=>null!==e[0]&&void 0!==e[0]);if(!t&&0==r.length)return t;if(!t)return this._MergeElement(e,r[0][0],r[0][1],r.slice(1));let a=r.reduce((e,t)=>e+t[0].length,t.length),n=e===ev.VertexBuffer.PositionKind?N._TransformVector3Coordinates:e===ev.VertexBuffer.NormalKind?N._TransformVector3Normals:e===ev.VertexBuffer.TangentKind?N._TransformVector4Normals:()=>{};if(t instanceof Float32Array){let e=new Float32Array(a);e.set(t),i&&n(e,i,0,t.length);let s=t.length;for(let[t,i]of r)e.set(t,s),i&&n(e,i,s,t.length),s+=t.length;return e}{let e=Array(a);for(let i=0;i<t.length;i++)e[i]=t[i];i&&n(e,i,0,t.length);let s=t.length;for(let[t,i]of r){for(let i=0;i<t.length;i++)e[s+i]=t[i];i&&n(e,i,s,t.length),s+=t.length}return e}}_validate(){if(!this.positions)throw new eT.RuntimeError("Positions are required",eT.ErrorCodes.MeshInvalidPositionsError);let e=(e,t)=>{let i=(0,ev.VertexBufferDeduceStride)(e);if(t.length%i!=0)throw Error("The "+e+"s array count must be a multiple of "+i);return t.length/i},t=e(ev.VertexBuffer.PositionKind,this.positions),i=(i,s)=>{let r=e(i,s);if(r!==t)throw Error("The "+i+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(ev.VertexBuffer.NormalKind,this.normals),this.tangents&&i(ev.VertexBuffer.TangentKind,this.tangents),this.uvs&&i(ev.VertexBuffer.UVKind,this.uvs),this.uvs2&&i(ev.VertexBuffer.UV2Kind,this.uvs2),this.uvs3&&i(ev.VertexBuffer.UV3Kind,this.uvs3),this.uvs4&&i(ev.VertexBuffer.UV4Kind,this.uvs4),this.uvs5&&i(ev.VertexBuffer.UV5Kind,this.uvs5),this.uvs6&&i(ev.VertexBuffer.UV6Kind,this.uvs6),this.colors&&i(ev.VertexBuffer.ColorKind,this.colors),this.matricesIndices&&i(ev.VertexBuffer.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(ev.VertexBuffer.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(ev.VertexBuffer.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(ev.VertexBuffer.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){let e=this.serialize();return N.Parse(e)}serialize(){let e={};if(this.positions&&(e.positions=Array.from(this.positions)),this.normals&&(e.normals=Array.from(this.normals)),this.tangents&&(e.tangents=Array.from(this.tangents)),this.uvs&&(e.uvs=Array.from(this.uvs)),this.uvs2&&(e.uvs2=Array.from(this.uvs2)),this.uvs3&&(e.uvs3=Array.from(this.uvs3)),this.uvs4&&(e.uvs4=Array.from(this.uvs4)),this.uvs5&&(e.uvs5=Array.from(this.uvs5)),this.uvs6&&(e.uvs6=Array.from(this.uvs6)),this.colors&&(e.colors=Array.from(this.colors),e.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(e.matricesIndices=Array.from(this.matricesIndices),e.matricesIndicesExpanded=!0),this.matricesWeights&&(e.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(e.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),e.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),e.indices=this.indices?Array.from(this.indices):[],this.materialInfos)for(let t of(e.materialInfos=[],this.materialInfos)){let i={indexStart:t.indexStart,indexCount:t.indexCount,materialIndex:t.materialIndex,verticesStart:t.verticesStart,verticesCount:t.verticesCount};e.materialInfos.push(i)}return e}static ExtractFromMesh(e,t,i){return N._ExtractFrom(e,t,i)}static ExtractFromGeometry(e,t,i){return N._ExtractFrom(e,t,i)}static _ExtractFrom(e,t,i){let s=new N;if(e.isVerticesDataPresent(ev.VertexBuffer.PositionKind)&&(s.positions=e.getVerticesData(ev.VertexBuffer.PositionKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&(s.normals=e.getVerticesData(ev.VertexBuffer.NormalKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.TangentKind)&&(s.tangents=e.getVerticesData(ev.VertexBuffer.TangentKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UVKind)&&(s.uvs=e.getVerticesData(ev.VertexBuffer.UVKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV2Kind)&&(s.uvs2=e.getVerticesData(ev.VertexBuffer.UV2Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV3Kind)&&(s.uvs3=e.getVerticesData(ev.VertexBuffer.UV3Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV4Kind)&&(s.uvs4=e.getVerticesData(ev.VertexBuffer.UV4Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV5Kind)&&(s.uvs5=e.getVerticesData(ev.VertexBuffer.UV5Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.UV6Kind)&&(s.uvs6=e.getVerticesData(ev.VertexBuffer.UV6Kind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.ColorKind)){let r=e.geometry||e,a=r.getVertexBuffer(ev.VertexBuffer.ColorKind),n=r.getVerticesData(ev.VertexBuffer.ColorKind,t,i);if(3===a.getSize()){let e=new Float32Array(4*n.length/3);for(let t=0,i=0;t<n.length;t+=3,i+=4)e[i]=n[t],e[i+1]=n[t+1],e[i+2]=n[t+2],e[i+3]=1;s.colors=e}else if(4===a.getSize())s.colors=n;else throw Error(`Unexpected number of color components: ${a.getSize()}`)}return e.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&(s.matricesIndices=e.getVerticesData(ev.VertexBuffer.MatricesIndicesKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(s.matricesWeights=e.getVerticesData(ev.VertexBuffer.MatricesWeightsKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesExtraKind)&&(s.matricesIndicesExtra=e.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,t,i)),e.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsExtraKind)&&(s.matricesWeightsExtra=e.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,t,i)),s.indices=e.getIndices(t,i),s}static CreateRibbon(e){throw(0,eS._WarnImport)("ribbonBuilder")}static CreateBox(e){throw(0,eS._WarnImport)("boxBuilder")}static CreateTiledBox(e){throw(0,eS._WarnImport)("tiledBoxBuilder")}static CreateTiledPlane(e){throw(0,eS._WarnImport)("tiledPlaneBuilder")}static CreateSphere(e){throw(0,eS._WarnImport)("sphereBuilder")}static CreateCylinder(e){throw(0,eS._WarnImport)("cylinderBuilder")}static CreateTorus(e){throw(0,eS._WarnImport)("torusBuilder")}static CreateLineSystem(e){throw(0,eS._WarnImport)("linesBuilder")}static CreateDashedLines(e){throw(0,eS._WarnImport)("linesBuilder")}static CreateGround(e){throw(0,eS._WarnImport)("groundBuilder")}static CreateTiledGround(e){throw(0,eS._WarnImport)("groundBuilder")}static CreateGroundFromHeightMap(e){throw(0,eS._WarnImport)("groundBuilder")}static CreatePlane(e){throw(0,eS._WarnImport)("planeBuilder")}static CreateDisc(e){throw(0,eS._WarnImport)("discBuilder")}static CreatePolygon(e,t,i,s,r,a,n){throw(0,eS._WarnImport)("polygonBuilder")}static CreateIcoSphere(e){throw(0,eS._WarnImport)("icoSphereBuilder")}static CreatePolyhedron(e){throw(0,eS._WarnImport)("polyhedronBuilder")}static CreateCapsule(e={orientation:ey.Vector3.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw(0,eS._WarnImport)("capsuleBuilder")}static CreateTorusKnot(e){throw(0,eS._WarnImport)("torusKnotBuilder")}static ComputeNormals(e,t,i,s){let r,a,n,o,l,h,c,u,d,f,g,_,m,p,M,I,x,b,y,D,V=!1,v=!1,B=!1,S=!1,A=1,P=0,T=null;s&&(V=!!s.facetNormals,v=!!s.facetPositions,B=!!s.facetPartitioning,A=!0===s.useRightHandedSystem?-1:1,P=s.ratio||0,S=!!s.depthSort,T=s.distanceTo,S&&void 0===T&&(T=ey.Vector3.Zero()));let C=0,O=0,R=0,F=0;for(B&&s&&s.bbSize&&(C=s.subDiv.X*P/s.bbSize.x,O=s.subDiv.Y*P/s.bbSize.y,R=s.subDiv.Z*P/s.bbSize.z,F=s.subDiv.max*s.subDiv.max,s.facetPartitioning.length=0),r=0;r<e.length;r++)i[r]=0;let E=t.length/3|0;for(r=0;r<E;r++){if(m=(_=3*t[3*r])+1,p=_+2,I=(M=3*t[3*r+1])+1,x=M+2,y=(b=3*t[3*r+2])+1,D=b+2,a=e[_]-e[M],n=e[m]-e[I],o=e[p]-e[x],l=e[b]-e[M],h=e[y]-e[I],g=0===(g=Math.sqrt((u=A*(n*(c=e[D]-e[x])-o*h))*u+(d=A*(o*l-a*c))*d+(f=A*(a*h-n*l))*f))?1:g,u/=g,d/=g,f/=g,V&&s&&(s.facetNormals[r].x=u,s.facetNormals[r].y=d,s.facetNormals[r].z=f),v&&s&&(s.facetPositions[r].x=(e[_]+e[M]+e[b])/3,s.facetPositions[r].y=(e[m]+e[I]+e[y])/3,s.facetPositions[r].z=(e[p]+e[x]+e[D])/3),B&&s){let t=Math.floor((s.facetPositions[r].x-s.bInfo.minimum.x*P)*C),i=Math.floor((s.facetPositions[r].y-s.bInfo.minimum.y*P)*O),a=Math.floor((s.facetPositions[r].z-s.bInfo.minimum.z*P)*R),n=Math.floor((e[_]-s.bInfo.minimum.x*P)*C),o=Math.floor((e[m]-s.bInfo.minimum.y*P)*O),l=Math.floor((e[p]-s.bInfo.minimum.z*P)*R),h=Math.floor((e[M]-s.bInfo.minimum.x*P)*C),c=Math.floor((e[I]-s.bInfo.minimum.y*P)*O),u=Math.floor((e[x]-s.bInfo.minimum.z*P)*R),d=Math.floor((e[b]-s.bInfo.minimum.x*P)*C),f=Math.floor((e[y]-s.bInfo.minimum.y*P)*O),g=Math.floor((e[D]-s.bInfo.minimum.z*P)*R),V=n+s.subDiv.max*o+F*l,v=h+s.subDiv.max*c+F*u,B=d+s.subDiv.max*f+F*g,S=t+s.subDiv.max*i+F*a;s.facetPartitioning[S]=s.facetPartitioning[S]?s.facetPartitioning[S]:[],s.facetPartitioning[V]=s.facetPartitioning[V]?s.facetPartitioning[V]:[],s.facetPartitioning[v]=s.facetPartitioning[v]?s.facetPartitioning[v]:[],s.facetPartitioning[B]=s.facetPartitioning[B]?s.facetPartitioning[B]:[],s.facetPartitioning[V].push(r),v!=V&&s.facetPartitioning[v].push(r),B!=v&&B!=V&&s.facetPartitioning[B].push(r),S!=V&&S!=v&&S!=B&&s.facetPartitioning[S].push(r)}if(S&&s&&s.facetPositions){let e=s.depthSortedFacets[r];e.ind=3*r,e.sqDistance=ey.Vector3.DistanceSquared(s.facetPositions[r],T)}i[_]+=u,i[m]+=d,i[p]+=f,i[M]+=u,i[I]+=d,i[x]+=f,i[b]+=u,i[y]+=d,i[D]+=f}for(r=0;r<i.length/3;r++)u=i[3*r],g=0===(g=Math.sqrt(u*u+(d=i[3*r+1])*d+(f=i[3*r+2])*f))?1:g,u/=g,d/=g,f/=g,i[3*r]=u,i[3*r+1]=d,i[3*r+2]=f}static _ComputeSides(e,t,i,s,r,a,n){let o,l,h=i.length,c=s.length;switch(e=e||N.DEFAULTSIDE){case N.FRONTSIDE:break;case N.BACKSIDE:for(o=0;o<h;o+=3){let e=i[o];i[o]=i[o+2],i[o+2]=e}for(l=0;l<c;l++)s[l]=-s[l];break;case N.DOUBLESIDE:{let e,u=t.length,d=u/3;for(let e=0;e<u;e++)t[u+e]=t[e];for(o=0;o<h;o+=3)i[o+h]=i[o+2]+d,i[o+1+h]=i[o+1]+d,i[o+2+h]=i[o]+d;for(l=0;l<c;l++)s[c+l]=-s[l];let f=r.length;for(e=0;e<f;e++)r[e+f]=r[e];for(a=a||new ey.Vector4(0,0,1,1),n=n||new ey.Vector4(0,0,1,1),e=0,o=0;o<f/2;o++)r[e]=a.x+(a.z-a.x)*r[e],r[e+1]=a.y+(a.w-a.y)*r[e+1],r[e+f]=n.x+(n.z-n.x)*r[e+f],r[e+f+1]=n.y+(n.w-n.y)*r[e+f+1],e+=2}}}static Parse(e){let t=new N,i=e.positions;i&&t.set(i,ev.VertexBuffer.PositionKind);let s=e.normals;s&&t.set(s,ev.VertexBuffer.NormalKind);let r=e.tangents;r&&t.set(r,ev.VertexBuffer.TangentKind);let a=e.uvs;a&&t.set(a,ev.VertexBuffer.UVKind);let n=e.uvs2;n&&t.set(n,ev.VertexBuffer.UV2Kind);let o=e.uvs3;o&&t.set(o,ev.VertexBuffer.UV3Kind);let l=e.uvs4;l&&t.set(l,ev.VertexBuffer.UV4Kind);let h=e.uvs5;h&&t.set(h,ev.VertexBuffer.UV5Kind);let c=e.uvs6;c&&t.set(c,ev.VertexBuffer.UV6Kind);let u=e.colors;u&&(t.set(eD.Color4.CheckColors4(u,i.length/3),ev.VertexBuffer.ColorKind),void 0!==e.hasVertexAlpha&&(t.hasVertexAlpha=e.hasVertexAlpha));let d=e.matricesIndices;d&&t.set(d,ev.VertexBuffer.MatricesIndicesKind);let f=e.matricesWeights;f&&t.set(f,ev.VertexBuffer.MatricesWeightsKind);let g=e.indices;g&&(t.indices=g);let _=e.materialInfos;if(_)for(let e of(t.materialInfos=[],_)){let i=new eO;i.indexCount=e.indexCount,i.indexStart=e.indexStart,i.verticesCount=e.verticesCount,i.verticesStart=e.verticesStart,i.materialIndex=e.materialIndex,t.materialInfos.push(i)}return t}static ImportVertexData(e,t){let i=N.Parse(e);t.setAllVerticesData(i,e.updatable)}},n="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0,t=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],i=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],s=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],r=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],(0,eB.__esDecorate)(N,null,t,{kind:"method",name:"_TransformVector3Coordinates",static:!0,private:!1,access:{has:e=>"_TransformVector3Coordinates"in e,get:e=>e._TransformVector3Coordinates},metadata:n},null,a),(0,eB.__esDecorate)(N,null,i,{kind:"method",name:"_TransformVector3Normals",static:!0,private:!1,access:{has:e=>"_TransformVector3Normals"in e,get:e=>e._TransformVector3Normals},metadata:n},null,a),(0,eB.__esDecorate)(N,null,s,{kind:"method",name:"_TransformVector4Normals",static:!0,private:!1,access:{has:e=>"_TransformVector4Normals"in e,get:e=>e._TransformVector4Normals},metadata:n},null,a),(0,eB.__esDecorate)(N,null,r,{kind:"method",name:"_FlipFaces",static:!0,private:!1,access:{has:e=>"_FlipFaces"in e,get:e=>e._FlipFaces},metadata:n},null,a),n&&Object.defineProperty(N,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),N.FRONTSIDE=((0,eB.__runInitializers)(N,a),0),N.BACKSIDE=1,N.DOUBLESIDE=2,N.DEFAULTSIDE=0,N._UniqueIdGenerator=0,N);e.s(["VertexData",0,eR],23037);var eF=e.i(54523),eE=e.i(97363),ew=e.i(8395),eU=e.i(72986),eL=e.i(58773),eW=e.i(63615);class eN{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){let t=new eN(eN.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,r=null,a=null){if(this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new ey.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new ey.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||eU.EngineStore.LastCreatedScene,!this._scene)return;this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,null!==a&&(this._totalVertices=a),i?this.setAllVerticesData(i,s):null===a&&(this._totalVertices=0),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),r&&(this.applyToMesh(r),r.computeWorldMatrix(!0))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return 1===this.delayLoadState||0===this.delayLoadState}get doNotSerialize(){for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){this._vertexArrayObjects&&(this._vertexArrayObjects={}),0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));let e=new Set;for(let t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(e=>{e._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));let r=new ev.VertexBuffer(this._engine,t,e,{updatable:i,postponeInternalCreation:0===this._meshes.length,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(r)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){let s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;let r=this._meshes,a=r.length;if(s===ev.VertexBuffer.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(this.useBoundingInfoFromGeometry&&this._boundingInfo?null:e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();let i=this._extend&&this._extend.minimum||new ey.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),s=this._extend&&this._extend.maximum||new ey.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<a;e++){let t=r[e];t.buildBoundingInfo(i,s),t._createGlobalSubMesh(t.isUnIndexed),t.computeWorldMatrix(!0),t.synchronizeInstances()}}this._notifyUpdate(s)}updateVerticesDataDirectly(e,t,i,s=!1){let r=this.getVertexBuffer(e);r&&(r.updateDirectly(t,i,s),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){let s=this.getVertexBuffer(e);s&&(s.update(t),e===ev.VertexBuffer.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e)for(let e of this._meshes)for(let t of(e.hasBoundingInfo?e.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e.subMeshes))t.refreshBoundingInfo()}_bind(e,t,i,s){if(!e)return;void 0===t&&(t=this._indexBuffer);let r=this.getVertexBuffers();if(!r)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!s)return void this._engine.bindBuffers(r,t,e,i);let a=s||this._vertexArrayObjects,n=this._engine;a[e.key]||(a[e.key]=n.recordVertexArrayObject(r,t,e,i)),n.bindVertexArrayObject(a[e.key],t)}getTotalVertices(){return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){let s=this.getVertexBuffer(e);return s?s.getFloatData(this._totalVertices,i||t&&1!==this._meshes.length):null}copyVerticesData(e,t){let i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));let s=i.getData();s&&(0,eW.CopyFloatData)(s,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){let t=this._vertexBuffers[e];return!!t&&t.isUpdatable()}getVertexBuffer(e){return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){return this._vertexBuffers?void 0!==this._vertexBuffers[e]:!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}getVerticesDataKinds(){let e,t=[];if(!this._vertexBuffers&&this._delayInfo)for(e in this._delayInfo)t.push(e);else for(e in this._vertexBuffers)t.push(e);return t}updateIndices(e,t,i=!1){if(this._indexBuffer)if(this._indexBufferIsUpdatable){let s=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),s)for(let e of this._meshes)e._createGlobalSubMesh(!0)}else this.setIndices(e,null,!0)}setIndexBuffer(e,t,i,s=null){for(let r of(this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,null===s?e.is32Bits=t>65535:e.is32Bits=s,this._meshes))r._createGlobalSubMesh(!0),r.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){for(let r of(this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,0!==this._meshes.length&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),void 0!=t&&(this._totalVertices=t),this._meshes))r._createGlobalSubMesh(!s),r.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?void 0!==this._totalIndices?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;let i=this._indices;return t||e&&1!==this._meshes.length?i.slice():i}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){e&&this._vertexArrayObjects&&this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){let i=this._meshes,s=i.indexOf(e);-1!==s&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,0===i.length&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;let t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();let i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&!(e=this.getVerticesData(ev.VertexBuffer.PositionKind)))return;this._extend=(0,ew.extractMinAndMax)(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){for(let t in this._vertexBuffers){let i=this._vertexBuffers[t];i._buffer.getBuffer()||i.create(),t===ev.VertexBuffer.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo())}!this._indexBuffer&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){for(let t of(this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects(),this._meshes))t._markSubMeshesAsAttributesDirty()}load(e,t){if(2!==this.delayLoadState){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),(async()=>{try{let i=await e._loadDelayedFileAsync(this.delayLoadingFile,!1,!0);if(!this._delayLoadingFunction)return void e.removePendingData(this);this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);let s=this._meshes,r=s.length;for(let e=0;e<r;e++)this._applyToMesh(s[e]);t&&t()}catch(t){e.removePendingData(this),e.isDisposed||eA.Logger.Error(`Unable to delay load geometry "${this.id}" from "${this.delayLoadingFile}": ${t}`)}})())}toLeftHanded(){let e=this.getIndices(!1);if(null!=e&&e.length>0){for(let t=0;t<e.length;t+=3){let i=e[t+0];e[t+0]=e[t+2],e[t+2]=i}this.setIndices(e)}let t=this.getVerticesData(ev.VertexBuffer.PositionKind,!1);if(null!=t&&t.length>0){for(let e=0;e<t.length;e+=3)t[e+2]=-t[e+2];this.setVerticesData(ev.VertexBuffer.PositionKind,t,!1)}let i=this.getVerticesData(ev.VertexBuffer.NormalKind,!1);if(null!=i&&i.length>0){for(let e=0;e<i.length;e+=3)i[e+2]=-i[e+2];this.setVerticesData(ev.VertexBuffer.NormalKind,i,!1)}}_resetPointsArrayCache(){this._positions=null}_generatePointsArray(){if(this._positions)return!0;let e=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!e||0===e.length)return!1;for(let t=3*this._positionsCache.length,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=ey.Vector3.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){return this._isDisposed}_disposeVertexArrayObjects(){if(this._vertexArrayObjects){for(let e in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e]);this._vertexArrayObjects={};let e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){let e,t=this._meshes,i=t.length;for(e=0;e<i;e++)this.releaseForMesh(t[e]);for(let e in this._meshes.length=0,this._disposeVertexArrayObjects(),this._vertexBuffers)this._vertexBuffers[e].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){let e=this._parentContainer.geometries.indexOf(this);e>-1&&this._parentContainer.geometries.splice(e,1),this._parentContainer=null}this._isDisposed=!0}copy(e){let t,i=new eN(e,this._scene),s=this.getIndices(void 0,!0);s&&i.setIndices(s);let r=!1;for(t in this._vertexBuffers){let e=this.getVertexBuffer(t),s=e.getData();if(!s)continue;let a=e.isUpdatable(),n=e.getSize(),{type:o,byteOffset:l,byteStride:h,normalized:c}=e;r=r||a;let u=this._totalVertices;e.getIsInstanced()&&(u=(s instanceof Array?4*s.length:s.byteLength)/h);let d=(0,eW.GetTypedArrayData)(s,n,o,l,h,u,!0),f=new ev.VertexBuffer(this._engine,d,t,{updatable:a,useBytes:!1,stride:n,size:n,offset:0,type:o,normalized:c,takeBufferOwnership:!0,instanced:e.getIsInstanced()});i.setVerticesBuffer(f,u)}for(t in i._updatable=r,i.delayLoadState=this.delayLoadState,i.delayLoadingFile=this.delayLoadingFile,i._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)i._delayInfo=i._delayInfo||[],i._delayInfo.push(t);return i._boundingInfo=new eE.BoundingInfo(this._extend.minimum,this._extend.maximum),i}serialize(){let e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,eg.Tags&&eg.Tags.HasTags(this)&&(e.tags=eg.Tags.GetTags(this)),e}_toNumberArray(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){for(let e in this._totalIndices=this._indices.length,this._indices=[],this._resetPointsArrayCache(),this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){let e=this.serialize();return this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.PositionKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.NormalKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.TangentKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UVKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV2Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV3Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV4Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV5Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.UV6Kind)),this.isVertexBufferUpdatable(ev.VertexBuffer.UV6Kind)&&(e.uvs6Updatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.ColorKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(ev.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind)),this.isVertexBufferUpdatable(ev.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){let i=e._geometry;return i?i.copy(t):null}static RandomId(){return eu.Tools.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){let i=t.getScene(),s=e.geometryUniqueId,r=e.geometryId;if(s||r){let e=s?this._GetGeometryByLoadedUniqueId(s,i):i.getGeometryById(r);e&&e.applyToMesh(t)}else if(e instanceof ArrayBuffer){let i=t._binaryInfo;if(i.positionsAttrDesc&&i.positionsAttrDesc.count>0){let s=new Float32Array(e,i.positionsAttrDesc.offset,i.positionsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.PositionKind,s,!1)}if(i.normalsAttrDesc&&i.normalsAttrDesc.count>0){let s=new Float32Array(e,i.normalsAttrDesc.offset,i.normalsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.NormalKind,s,!1)}if(i.tangetsAttrDesc&&i.tangetsAttrDesc.count>0){let s=new Float32Array(e,i.tangetsAttrDesc.offset,i.tangetsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.TangentKind,s,!1)}if(i.uvsAttrDesc&&i.uvsAttrDesc.count>0){let s=new Float32Array(e,i.uvsAttrDesc.offset,i.uvsAttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UVKind,s,!1)}if(i.uvs2AttrDesc&&i.uvs2AttrDesc.count>0){let s=new Float32Array(e,i.uvs2AttrDesc.offset,i.uvs2AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV2Kind,s,!1)}if(i.uvs3AttrDesc&&i.uvs3AttrDesc.count>0){let s=new Float32Array(e,i.uvs3AttrDesc.offset,i.uvs3AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV3Kind,s,!1)}if(i.uvs4AttrDesc&&i.uvs4AttrDesc.count>0){let s=new Float32Array(e,i.uvs4AttrDesc.offset,i.uvs4AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV4Kind,s,!1)}if(i.uvs5AttrDesc&&i.uvs5AttrDesc.count>0){let s=new Float32Array(e,i.uvs5AttrDesc.offset,i.uvs5AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV5Kind,s,!1)}if(i.uvs6AttrDesc&&i.uvs6AttrDesc.count>0){let s=new Float32Array(e,i.uvs6AttrDesc.offset,i.uvs6AttrDesc.count);if(eL.useOpenGLOrientationForUV)for(let e=1;e<s.length;e+=2)s[e]=1-s[e];t.setVerticesData(ev.VertexBuffer.UV6Kind,s,!1)}if(i.colorsAttrDesc&&i.colorsAttrDesc.count>0){let s=new Float32Array(e,i.colorsAttrDesc.offset,i.colorsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.ColorKind,s,!1,i.colorsAttrDesc.stride)}if(i.matricesIndicesAttrDesc&&i.matricesIndicesAttrDesc.count>0){let s=new Int32Array(e,i.matricesIndicesAttrDesc.offset,i.matricesIndicesAttrDesc.count),r=[];for(let e=0;e<s.length;e++){let t=s[e];r.push(255&t),r.push((65280&t)>>8),r.push((0xff0000&t)>>16),r.push(t>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,r,!1)}if(i.matricesIndicesExtraAttrDesc&&i.matricesIndicesExtraAttrDesc.count>0){let s=new Int32Array(e,i.matricesIndicesExtraAttrDesc.offset,i.matricesIndicesExtraAttrDesc.count),r=[];for(let e=0;e<s.length;e++){let t=s[e];r.push(255&t),r.push((65280&t)>>8),r.push((0xff0000&t)>>16),r.push(t>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,r,!1)}if(i.matricesWeightsAttrDesc&&i.matricesWeightsAttrDesc.count>0){let s=new Float32Array(e,i.matricesWeightsAttrDesc.offset,i.matricesWeightsAttrDesc.count);t.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,s,!1)}if(i.indicesAttrDesc&&i.indicesAttrDesc.count>0){let s=new Int32Array(e,i.indicesAttrDesc.offset,i.indicesAttrDesc.count);t.setIndices(s,null)}if(i.subMeshesAttrDesc&&i.subMeshesAttrDesc.count>0){let s=new Int32Array(e,i.subMeshesAttrDesc.offset,5*i.subMeshesAttrDesc.count);t.subMeshes=[];for(let e=0;e<i.subMeshesAttrDesc.count;e++){let i=s[5*e+0],r=s[5*e+1],a=s[5*e+2],n=s[5*e+3],o=s[5*e+4];eC.SubMesh.AddToMesh(i,r,a,n,o,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(ev.VertexBuffer.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(ev.VertexBuffer.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(ev.VertexBuffer.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(ev.VertexBuffer.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(ev.VertexBuffer.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(ev.VertexBuffer.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(ev.VertexBuffer.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(ev.VertexBuffer.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(ev.VertexBuffer.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(ev.VertexBuffer.ColorKind,eD.Color4.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(e.matricesIndices._isExpanded||e.matricesIndicesExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);else{let i=[];for(let t=0;t<e.matricesIndices.length;t++){let s=e.matricesIndices[t];i.push(255&s),i.push((65280&s)>>8),i.push((0xff0000&s)>>16),i.push(s>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,i,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{let i=[];for(let t=0;t<e.matricesIndicesExtra.length;t++){let s=e.matricesIndicesExtra[t];i.push(255&s),i.push((65280&s)>>8),i.push((0xff0000&s)>>16),i.push(s>>24&255)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,i,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}e.matricesWeights&&(eN._CleanMatricesWeights(e,t),t.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let i=0;i<e.subMeshes.length;i++){let s=e.subMeshes[i];eC.SubMesh.AddToMesh(s.materialIndex,s.verticesStart,s.verticesCount,s.indexStart,s.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){let i;if(!eF.SceneLoaderFlags.CleanBoneMatrixWeights||!(e.skeletonId>-1))return;{let s=t.getScene().getLastSkeletonById(e.skeletonId);if(!s)return;i=s.bones.length}let s=t.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),r=t.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind),a=e.matricesWeights,n=e.matricesWeightsExtra,o=e.numBoneInfluencer,l=a.length;for(let e=0;e<l;e+=4){let t=0,l=-1;for(let i=0;i<4;i++){let s=a[e+i];t+=s,s<.001&&l<0&&(l=i)}if(n)for(let i=0;i<4;i++){let s=n[e+i];t+=s,s<.001&&l<0&&(l=i+4)}if((l<0||l>o-1)&&(l=o-1),t>.001){let i=1/t;for(let t=0;t<4;t++)a[e+t]*=i;if(n)for(let t=0;t<4;t++)n[e+t]*=i}else l>=4?(n[e+l-4]=1-t,r[e+l-4]=i):(a[e+l]=1-t,s[e+l]=i)}t.setVerticesData(ev.VertexBuffer.MatricesIndicesKind,s),e.matricesWeightsExtra&&t.setVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind,r)}static Parse(e,t,i){let s=new eN(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new eE.BoundingInfo(ey.Vector3.FromArray(e.boundingBoxMinimum),ey.Vector3.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(ev.VertexBuffer.UVKind),e.hasUVs2&&s._delayInfo.push(ev.VertexBuffer.UV2Kind),e.hasUVs3&&s._delayInfo.push(ev.VertexBuffer.UV3Kind),e.hasUVs4&&s._delayInfo.push(ev.VertexBuffer.UV4Kind),e.hasUVs5&&s._delayInfo.push(ev.VertexBuffer.UV5Kind),e.hasUVs6&&s._delayInfo.push(ev.VertexBuffer.UV6Kind),e.hasColors&&s._delayInfo.push(ev.VertexBuffer.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(ev.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(ev.VertexBuffer.MatricesWeightsKind),s._delayLoadingFunction=eR.ImportVertexData):eR.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}e.s(["Geometry",0,eN],689);var eK=e.i(22832);let ek=(m=eV.Node,p=[],M=[],I=[],x=[],b=[],y=[],D=[],V=[],v=[],B=[],S=[],A=[],P=[],T=[],C=[],O=[],R=[],F=[],K=class extends m{get billboardMode(){return this._billboardMode}set billboardMode(e){this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=(this._billboardMode&K.BILLBOARDMODE_USE_POSITION)!=0)}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)}constructor(e,t=null,i=!0){super(e,t,!1),this._forward=new ey.Vector3(0,0,1),this._up=new ey.Vector3(0,1,0),this._right=new ey.Vector3(1,0,0),this._position=(0,eB.__runInitializers)(this,p,ey.Vector3.Zero()),this._rotation=((0,eB.__runInitializers)(this,M),(0,eB.__runInitializers)(this,I,ey.Vector3.Zero())),this._rotationQuaternion=((0,eB.__runInitializers)(this,x),(0,eB.__runInitializers)(this,b,null)),this._scaling=((0,eB.__runInitializers)(this,y),(0,eB.__runInitializers)(this,D,ey.Vector3.One())),this._transformToBoneReferal=((0,eB.__runInitializers)(this,V),null),this._isAbsoluteSynced=!1,this._billboardMode=(0,eB.__runInitializers)(this,v,K.BILLBOARDMODE_NONE),this.scalingDeterminant=((0,eB.__runInitializers)(this,B),(0,eB.__runInitializers)(this,S,1)),this._infiniteDistance=((0,eB.__runInitializers)(this,A),(0,eB.__runInitializers)(this,P,!1)),this.ignoreNonUniformScaling=((0,eB.__runInitializers)(this,T),(0,eB.__runInitializers)(this,C,!1)),this.reIntegrateRotationIntoRotationQuaternion=((0,eB.__runInitializers)(this,O),(0,eB.__runInitializers)(this,R,!1)),this._poseMatrix=((0,eB.__runInitializers)(this,F),null),this._localMatrix=ey.Matrix.Zero(),this._usePivotMatrix=!1,this._absolutePosition=ey.Vector3.Zero(),this._absoluteScaling=ey.Vector3.Zero(),this._absoluteRotationQuaternion=ey.Quaternion.Identity(),this._pivotMatrix=ey.Matrix.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new ec.Observable,this._nonUniformScaling=!1,i&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(e){this._position=e,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(e){this._scaling=e,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){!this._isDirty&&(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return ey.Vector3.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return ey.Vector3.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return ey.Vector3.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(e){return this._poseMatrix?this._poseMatrix.copyFrom(e):this._poseMatrix=e.clone(),this}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=ey.Matrix.Identity()),this._poseMatrix}_isSynchronized(){let e=this._cache;return this._billboardMode===e.billboardMode&&this._billboardMode===K.BILLBOARDMODE_NONE&&!e.pivotMatrixUpdated&&!this._infiniteDistance&&!this._position._isDirty&&!this._scaling._isDirty&&(!this._rotationQuaternion||!this._rotationQuaternion._isDirty)&&!this._rotation._isDirty&&!0}_initCache(){super._initCache();let e=this._cache;e.localMatrixUpdated=!1,e.billboardMode=-1,e.infiniteDistance=!1,e.useBillboardPosition=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(e){return this.setPivotMatrix(e,!1)}setPivotMatrix(e,t=!0){return this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=ey.Matrix.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(e=null,t,i){let s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);for(let e of(s&&i&&i(this,s),this.getChildTransformNodes(!0)))e.instantiateHierarchy(s,t,i);return s}freezeWorldMatrix(e=null,t=!1){return e?t?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||ey.Quaternion.Identity(),e.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=e,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(e){let t,i,s;if(!e)return this;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],s=arguments[2]}else t=e.x,i=e.y,s=e.z;if(this.parent){let e=ey.TmpVectors.Matrix[0];this.parent.getWorldMatrix().invertToRef(e),ey.Vector3.TransformCoordinatesFromFloatsToRef(t,i,s,e,this.position)}else this.position.x=t,this.position.y=i,this.position.z=s;return this._absolutePosition.copyFrom(e),this}setPositionWithLocalVector(e){return this.computeWorldMatrix(),this.position=ey.Vector3.TransformNormal(e,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();let e=ey.TmpVectors.Matrix[0];return this._localMatrix.invertToRef(e),ey.Vector3.TransformNormal(this.position,e)}locallyTranslate(e){return this.computeWorldMatrix(!0),this.position=ey.Vector3.TransformCoordinates(e,this._localMatrix),this}lookAt(e,t=0,i=0,s=0,r=0){let a=K._LookAtVectorCache,n=0===r?this.position:this.getAbsolutePosition();if(e.subtractToRef(n,a),this.setDirection(a,t,i,s),1===r&&this.parent)if(this.rotationQuaternion){let e=ey.TmpVectors.Matrix[0];this.rotationQuaternion.toRotationMatrix(e);let t=ey.TmpVectors.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(t),t.invert(),e.multiplyToRef(t,e),this.rotationQuaternion.fromRotationMatrix(e)}else{let e=ey.TmpVectors.Quaternion[0];ey.Quaternion.FromEulerVectorToRef(this.rotation,e);let t=ey.TmpVectors.Matrix[0];e.toRotationMatrix(t);let i=ey.TmpVectors.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(i),i.invert(),t.multiplyToRef(i,t),e.fromRotationMatrix(t),e.toEulerAnglesToRef(this.rotation)}return this}getDirection(e){let t=ey.Vector3.Zero();return this.getDirectionToRef(e,t),t}getDirectionToRef(e,t){return ey.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t),this}setDirection(e,t=0,i=0,s=0){let r=-Math.atan2(e.z,e.x)+Math.PI/2,a=Math.sqrt(e.x*e.x+e.z*e.z),n=-Math.atan2(e.y,a);return this.rotationQuaternion?ey.Quaternion.RotationYawPitchRollToRef(r+t,n+i,s,this.rotationQuaternion):(this.rotation.x=n+i,this.rotation.y=r+t,this.rotation.z=s),this}setPivotPoint(e,t=0){0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);let i=this.getWorldMatrix();if(1==t){let t=ey.TmpVectors.Matrix[0];i.invertToRef(t),e=ey.Vector3.TransformCoordinates(e,t)}return this.setPivotMatrix(ey.Matrix.Translation(-e.x,-e.y,-e.z),!0)}getPivotPoint(){let e=ey.Vector3.Zero();return this.getPivotPointToRef(e),e}getPivotPointToRef(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){let e=ey.Vector3.Zero();return this.getAbsolutePivotPointToRef(e),e}getAbsolutePivotPointToRef(e){return this.getPivotPointToRef(e),ey.Vector3.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this}markAsDirty(e){if(this._isDirty)return this;if(this._children)for(let t of this._children)t.markAsDirty(e);return super.markAsDirty(e)}setParent(e,t=!1,i=!1){if(!e&&!this.parent)return this;let s=ey.TmpVectors.Quaternion[0],r=ey.TmpVectors.Vector3[0],a=ey.TmpVectors.Vector3[1],n=ey.TmpVectors.Matrix[1];ey.Matrix.IdentityToRef(n);let o=ey.TmpVectors.Matrix[0];this.computeWorldMatrix(!0);let l=this.rotationQuaternion;return l||(l=K._TmpRotation,ey.Quaternion.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),ey.Matrix.ComposeToRef(this.scaling,l,this.position,o),this.parent&&o.multiplyToRef(this.parent.computeWorldMatrix(!0),o),e&&(e.computeWorldMatrix(!0).invertToRef(n),o.multiplyToRef(n,o)),o.decompose(a,s,r,t?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(s):s.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(a),this.position.copyFrom(r),this.parent=e,i&&this.setPivotMatrix(ey.Matrix.Identity()),this}addChild(e,t=!1){return e.setParent(this,t),this}removeChild(e,t=!1){return e.parent!==this||e.setParent(null,t),this}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)}attachToBone(e,t){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(!0),0>e.getFinalMatrix().determinant()&&(this.scalingDeterminant*=-1),this}detachFromBone(e=!1){return this.parent?(0>this.parent.getWorldMatrix().determinant()&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,e?this.parent=this._currentParentWhenAttachingToBone:this.parent=null):e&&(this.parent=this._currentParentWhenAttachingToBone),this}rotate(e,t,i){let s;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),i&&0!==i){if(this.parent){let i=this.parent.getWorldMatrix(),s=ey.TmpVectors.Matrix[0];i.invertToRef(s),e=ey.Vector3.TransformNormal(e,s),0>i.determinant()&&(t*=-1)}(s=ey.Quaternion.RotationAxisToRef(e,t,K._RotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else s=ey.Quaternion.RotationAxisToRef(e,t,K._RotationAxisCache),this.rotationQuaternion.multiplyToRef(s,this.rotationQuaternion);return this}rotateAround(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=ey.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));let s=ey.TmpVectors.Vector3[0],r=ey.TmpVectors.Vector3[1],a=ey.TmpVectors.Vector3[2],n=ey.TmpVectors.Quaternion[0],o=ey.TmpVectors.Matrix[0],l=ey.TmpVectors.Matrix[1],h=ey.TmpVectors.Matrix[2],c=ey.TmpVectors.Matrix[3];return e.subtractToRef(this.position,s),ey.Matrix.TranslationToRef(s.x,s.y,s.z,o),ey.Matrix.TranslationToRef(-s.x,-s.y,-s.z,l),ey.Matrix.RotationAxisToRef(t,i,h),l.multiplyToRef(h,c),c.multiplyToRef(o,c),c.decompose(r,n,a),this.position.addInPlace(a),n.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(e,t,i){let s=e.scale(t);if(i&&0!==i)this.setAbsolutePosition(this.getAbsolutePosition().add(s));else{let e=this.getPositionExpressedInLocalSpace().add(s);this.setPositionWithLocalVector(e)}return this}addRotation(e,t,i){let s;this.rotationQuaternion?s=this.rotationQuaternion:(s=ey.TmpVectors.Quaternion[1],ey.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s));let r=ey.TmpVectors.Quaternion[0];return ey.Quaternion.RotationYawPitchRollToRef(t,e,i,r),s.multiplyInPlace(r),this.rotationQuaternion||s.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==K.BILLBOARDMODE_NONE}computeWorldMatrix(e=!1,t=null){let i;if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;let s=this.getScene().getRenderId();if(!this._isDirty&&!e&&(this._currentRenderId===s||this.isSynchronized()))return this._currentRenderId=s,this._worldMatrix;t=t||this.getScene().activeCamera,this._updateCache();let r=this._cache;r.pivotMatrixUpdated=!1,r.billboardMode=this.billboardMode,r.infiniteDistance=this.infiniteDistance,r.parent=this._parentNode,this._currentRenderId=s,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;let a=this._getEffectiveParent(),n=K._TmpScaling,o=this._position;if(this._infiniteDistance&&!this.parent&&t){let e=t.getWorldMatrix().m;(o=K._TmpTranslation).copyFromFloats(this._position.x+e[12],this._position.y+e[13],this._position.z+e[14])}if(n.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant),this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,i=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(ey.Quaternion.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(i=K._TmpRotation,ey.Quaternion.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,i)),this._usePivotMatrix){let e=ey.TmpVectors.Matrix[1];ey.Matrix.ScalingToRef(n.x,n.y,n.z,e);let t=ey.TmpVectors.Matrix[0];i.toRotationMatrix(t),this._pivotMatrix.multiplyToRef(e,ey.TmpVectors.Matrix[4]),ey.TmpVectors.Matrix[4].multiplyToRef(t,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(o.x,o.y,o.z)}else ey.Matrix.ComposeToRef(n,i,o,this._localMatrix);if(a&&a.getWorldMatrix){if(e&&a.computeWorldMatrix(e),this.billboardMode){if(this._transformToBoneReferal){let e=this.parent;e.getSkeleton().prepare(),e.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),ey.TmpVectors.Matrix[7])}else ey.TmpVectors.Matrix[7].copyFrom(a.getWorldMatrix());let e=ey.TmpVectors.Vector3[5],t=ey.TmpVectors.Vector3[6],i=ey.TmpVectors.Quaternion[0];ey.TmpVectors.Matrix[7].decompose(t,i,e),ey.Matrix.ScalingToRef(t.x,t.y,t.z,ey.TmpVectors.Matrix[7]),ey.TmpVectors.Matrix[7].setTranslation(e),K.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(i,e),this._localMatrix.setTranslation(e)),this._localMatrix.multiplyToRef(ey.TmpVectors.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){let e=this.parent;e.getSkeleton().prepare(),this._localMatrix.multiplyToRef(e.getFinalMatrix(),ey.TmpVectors.Matrix[6]),ey.TmpVectors.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(a.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(t&&this.billboardMode)if(r.useBillboardPosition){let e=ey.TmpVectors.Vector3[0];this._worldMatrix.getTranslationToRef(e);let i=t.globalPosition;this._worldMatrix.invertToRef(ey.TmpVectors.Matrix[1]);let s=ey.TmpVectors.Vector3[1];ey.Vector3.TransformCoordinatesToRef(i,ey.TmpVectors.Matrix[1],s),s.normalize();let r=-Math.atan2(s.z,s.x)+Math.PI/2,a=Math.sqrt(s.x*s.x+s.z*s.z),n=-Math.atan2(s.y,a);if(ey.Quaternion.RotationYawPitchRollToRef(r,n,0,ey.TmpVectors.Quaternion[0]),(this.billboardMode&K.BILLBOARDMODE_ALL)!==K.BILLBOARDMODE_ALL){let e=ey.TmpVectors.Vector3[1];ey.TmpVectors.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&K.BILLBOARDMODE_X)!==K.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&K.BILLBOARDMODE_Y)!==K.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&K.BILLBOARDMODE_Z)!==K.BILLBOARDMODE_Z&&(e.z=0),ey.Matrix.RotationYawPitchRollToRef(e.y,e.x,e.z,ey.TmpVectors.Matrix[0])}else ey.Matrix.FromQuaternionToRef(ey.TmpVectors.Quaternion[0],ey.TmpVectors.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ey.TmpVectors.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ey.TmpVectors.Vector3[0])}else{let e=ey.TmpVectors.Vector3[0];this._worldMatrix.getTranslationToRef(e),ey.TmpVectors.Matrix[1].copyFrom(t.getViewMatrix());let i=this.getScene().useRightHandedSystem;if(i&&ey.TmpVectors.Matrix[1].multiplyToRef(K._TmpRHRestore,ey.TmpVectors.Matrix[1]),ey.TmpVectors.Matrix[1].setTranslationFromFloats(0,0,0),ey.TmpVectors.Matrix[1].invertToRef(ey.TmpVectors.Matrix[0]),(this.billboardMode&K.BILLBOARDMODE_ALL)!==K.BILLBOARDMODE_ALL){ey.TmpVectors.Matrix[0].decompose(void 0,ey.TmpVectors.Quaternion[0],void 0);let e=ey.TmpVectors.Vector3[1];ey.TmpVectors.Quaternion[0].toEulerAnglesToRef(e),(this.billboardMode&K.BILLBOARDMODE_X)!==K.BILLBOARDMODE_X&&(e.x=0),(this.billboardMode&K.BILLBOARDMODE_Y)!==K.BILLBOARDMODE_Y&&(e.y=0),(this.billboardMode&K.BILLBOARDMODE_Z)!==K.BILLBOARDMODE_Z&&(e.z=0),i&&(e.y+=Math.PI),ey.Matrix.RotationYawPitchRollToRef(e.y,e.x,e.z,ey.TmpVectors.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ey.TmpVectors.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ey.TmpVectors.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):a&&a._nonUniformScaling?this._updateNonUniformScalingState(a._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=ey.Matrix.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if(this.computeWorldMatrix(),e){let e=this.getChildren();for(let t=0;t<e.length;++t){let i=e[t];if(i){i.computeWorldMatrix();let e=ey.TmpVectors.Matrix[0];i._localMatrix.multiplyToRef(this._localMatrix,e);let t=ey.TmpVectors.Quaternion[0];e.decompose(i.scaling,t,i.position),i.rotationQuaternion?i.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(i.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=ey.Quaternion.Identity()),this._worldMatrix=ey.Matrix.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this}unregisterAfterWorldMatrixUpdate(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this}getPositionInCameraSpace(e=null){return e||(e=this.getScene().activeCamera),ey.Vector3.TransformCoordinates(this.getAbsolutePosition(),e.getViewMatrix())}getDistanceToCamera(e=null){return e||(e=this.getScene().activeCamera),this.getAbsolutePosition().subtract(e.globalPosition).length()}clone(e,t,i){let s=eK.SerializationHelper.Clone(()=>new K(e,this.getScene()),this);if(s.name=e,s.id=e,t&&(s.parent=t),!i){let t=this.getDescendants(!0);for(let i=0;i<t.length;i++){let r=t[i];r.clone&&r.clone(e+"."+r.name,s)}}return s}serialize(e){let t=eK.SerializationHelper.Serialize(this,e);return t.type=this.getClassName(),t.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent(t),t.localMatrix=this.getPivotMatrix().asArray(),t.isEnabled=this.isEnabled(),this._isWorldMatrixFrozen&&(t.freezeWorldMatrix=!0),eK.SerializationHelper.AppendSerializedAnimations(this,t),t.ranges=this.serializeAnimationRanges(),t}getChildTransformNodes(e,t){let i=[];return this._getDescendants(i,e,e=>(!t||t(e))&&e instanceof K),i}dispose(e,t=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){let e=this._parentContainer.transformNodes.indexOf(this);e>-1&&this._parentContainer.transformNodes.splice(e,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),e)for(let e of this.getChildTransformNodes(!0))e.parent=null,e.computeWorldMatrix(!0);super.dispose(e,t)}normalizeToUnitCube(e=!0,t=!1,i){let s=null,r=null;t&&(this.rotationQuaternion?(r=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(s=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));let a=this.getHierarchyBoundingVectors(e,i),n=a.max.subtract(a.min),o=Math.max(n.x,n.y,n.z);return 0===o||(this.scaling.scaleInPlace(1/o),t&&(this.rotationQuaternion&&r?this.rotationQuaternion.copyFrom(r):this.rotation&&s&&this.rotation.copyFrom(s))),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}},E="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0,o=[(0,eP.serializeAsVector3)("position")],l=[(0,eP.serializeAsVector3)("rotation")],h=[(0,eP.serializeAsQuaternion)("rotationQuaternion")],c=[(0,eP.serializeAsVector3)("scaling")],u=[(0,eP.serialize)("billboardMode")],d=[(0,eP.serialize)()],f=[(0,eP.serialize)("infiniteDistance")],g=[(0,eP.serialize)()],_=[(0,eP.serialize)()],(0,eB.__esDecorate)(null,null,o,{kind:"field",name:"_position",static:!1,private:!1,access:{has:e=>"_position"in e,get:e=>e._position,set:(e,t)=>{e._position=t}},metadata:E},p,M),(0,eB.__esDecorate)(null,null,l,{kind:"field",name:"_rotation",static:!1,private:!1,access:{has:e=>"_rotation"in e,get:e=>e._rotation,set:(e,t)=>{e._rotation=t}},metadata:E},I,x),(0,eB.__esDecorate)(null,null,h,{kind:"field",name:"_rotationQuaternion",static:!1,private:!1,access:{has:e=>"_rotationQuaternion"in e,get:e=>e._rotationQuaternion,set:(e,t)=>{e._rotationQuaternion=t}},metadata:E},b,y),(0,eB.__esDecorate)(null,null,c,{kind:"field",name:"_scaling",static:!1,private:!1,access:{has:e=>"_scaling"in e,get:e=>e._scaling,set:(e,t)=>{e._scaling=t}},metadata:E},D,V),(0,eB.__esDecorate)(null,null,u,{kind:"field",name:"_billboardMode",static:!1,private:!1,access:{has:e=>"_billboardMode"in e,get:e=>e._billboardMode,set:(e,t)=>{e._billboardMode=t}},metadata:E},v,B),(0,eB.__esDecorate)(null,null,d,{kind:"field",name:"scalingDeterminant",static:!1,private:!1,access:{has:e=>"scalingDeterminant"in e,get:e=>e.scalingDeterminant,set:(e,t)=>{e.scalingDeterminant=t}},metadata:E},S,A),(0,eB.__esDecorate)(null,null,f,{kind:"field",name:"_infiniteDistance",static:!1,private:!1,access:{has:e=>"_infiniteDistance"in e,get:e=>e._infiniteDistance,set:(e,t)=>{e._infiniteDistance=t}},metadata:E},P,T),(0,eB.__esDecorate)(null,null,g,{kind:"field",name:"ignoreNonUniformScaling",static:!1,private:!1,access:{has:e=>"ignoreNonUniformScaling"in e,get:e=>e.ignoreNonUniformScaling,set:(e,t)=>{e.ignoreNonUniformScaling=t}},metadata:E},C,O),(0,eB.__esDecorate)(null,null,_,{kind:"field",name:"reIntegrateRotationIntoRotationQuaternion",static:!1,private:!1,access:{has:e=>"reIntegrateRotationIntoRotationQuaternion"in e,get:e=>e.reIntegrateRotationIntoRotationQuaternion,set:(e,t)=>{e.reIntegrateRotationIntoRotationQuaternion=t}},metadata:E},R,F),E&&Object.defineProperty(K,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E}),K.BILLBOARDMODE_NONE=0,K.BILLBOARDMODE_X=1,K.BILLBOARDMODE_Y=2,K.BILLBOARDMODE_Z=4,K.BILLBOARDMODE_ALL=7,K.BILLBOARDMODE_USE_POSITION=128,K.BillboardUseParentOrientation=!1,K._TmpRotation=ey.Quaternion.Zero(),K._TmpScaling=ey.Vector3.Zero(),K._TmpTranslation=ey.Vector3.Zero(),K._TmpRHRestore=ey.Matrix.Scaling(1,1,-1),K._LookAtVectorCache=new ey.Vector3(0,0,0),K._RotationAxisCache=new ey.Quaternion,K);(z=ek.prototype).getPhysicsBody??(z.getPhysicsBody=(0,eS._MissingSideEffect)("TransformNode","getPhysicsBody")),(G=ek.prototype).applyImpulse??(G.applyImpulse=(0,eS._MissingSideEffect)("TransformNode","applyImpulse")),(Q=ek.prototype).applyAngularImpulse??(Q.applyAngularImpulse=(0,eS._MissingSideEffect)("TransformNode","applyAngularImpulse")),(j=ek.prototype).applyTorque??(j.applyTorque=(0,eS._MissingSideEffect)("TransformNode","applyTorque")),Object.getOwnPropertyDescriptor(ek.prototype,"physicsBody")||Object.defineProperty(ek.prototype,"physicsBody",(0,eS._MissingSideEffectProperty)("TransformNode","physicsBody")),e.s(["TransformNode",0,ek],17462);var ez=e.i(79428),eG=e.i(81127);class eQ{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new ey.Vector3(0,0,0),this._diffPositionForCollisions=new ey.Vector3(0,0,0),this._collisionResponse=!0}}var ej=e.i(66464),eq=e.i(26747),eH=e.i(92356),eZ=e.i(99429),eY=e.i(99493);function eX(e,t){return e-Math.floor(e/t)*t}function e$(e,t,i){e instanceof Float32Array?ey.Matrix.FromArrayToRef(e,t,i):i.copyFromFloats((0,ej.FromHalfFloat)(e[t]),(0,ej.FromHalfFloat)(e[t+1]),(0,ej.FromHalfFloat)(e[t+2]),(0,ej.FromHalfFloat)(e[t+3]),(0,ej.FromHalfFloat)(e[t+4]),(0,ej.FromHalfFloat)(e[t+5]),(0,ej.FromHalfFloat)(e[t+6]),(0,ej.FromHalfFloat)(e[t+7]),(0,ej.FromHalfFloat)(e[t+8]),(0,ej.FromHalfFloat)(e[t+9]),(0,ej.FromHalfFloat)(e[t+10]),(0,ej.FromHalfFloat)(e[t+11]),(0,ej.FromHalfFloat)(e[t+12]),(0,ej.FromHalfFloat)(e[t+13]),(0,ej.FromHalfFloat)(e[t+14]),(0,ej.FromHalfFloat)(e[t+15]))}class eJ{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=ey.Vector3.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class e0{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new eJ,this._visibility=1,this._skeleton=null,this._layerMask=0xfffffff,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new eQ,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._wasActiveLastFrame=!1}}let e1=(U=ek,L=[],k=class extends U{static get BILLBOARDMODE_NONE(){return ek.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return ek.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return ek.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return ek.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return ek.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return ek.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(e){this._internalAbstractMeshDataInfo._collisionRetryCount=e}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(e){this._internalAbstractMeshDataInfo._morphTargetManager!==e&&(this._internalAbstractMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(e){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==e&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=e,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(e){return!!super._updateNonUniformScalingState(e)&&(this._markSubMeshesAsMiscDirty(),!0)}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(e){this._internalAbstractMeshDataInfo._rawBoundingInfo=e}set onCollide(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)}set onCollisionPositionChange(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(e){if(this._internalAbstractMeshDataInfo._visibility===e)return;let t=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=e,(1===t&&1!==e||1!==t&&1===e)&&this._markSubMeshesAsDirty(e=>{e.markAsMiscDirty(),e.markAsPrePassDirty()})}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(e){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=e}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(e){this._internalAbstractMeshDataInfo._renderingGroupId=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){this._setMaterial(e)}_setMaterial(e){this._internalAbstractMeshDataInfo._material===e||(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,null==e),this._unBindEffect()))}getMaterialForRenderPass(e){return this._internalAbstractMeshDataInfo._materialForRenderPass?.[e]}setMaterialForRenderPass(e,t){this.resetDrawCache(e),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);let i=this._internalAbstractMeshDataInfo._materialForRenderPass[e];i?.meshMap?.[this.uniqueId]&&(i.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[e]=t,t&&t.meshMap&&(t.meshMap[this.uniqueId]=this)}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(e){this._internalAbstractMeshDataInfo._enableDistantPicking=e}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(e)?-1:e}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=e}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(e)?-1:e}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(e){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=e}get lightSources(){return this._lightSources}set skeleton(e){let t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(e,t=null){switch(super(e,t,!1),this._internalAbstractMeshDataInfo=new e0,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this._waitingSkeletonId=null,this._waitingSkeletonUniqueId=null,this.cullingStrategy=k.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new ec.Observable,this.onCollisionPositionChangeObservable=new ec.Observable,this.onMaterialChangedObservable=new ec.Observable,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isPickable=k.DefaultIsPickable,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=eD.Color3.Red(),this.outlineWidth=.02,this.overlayColor=eD.Color3.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new ey.Vector3(.5,1,.5),this.ellipsoidOffset=new ey.Vector3(0,0,0),this.edgesWidth=1,this.edgesColor=new eD.Color4(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=[],this._unIndexed=!1,this._lightSources=[],this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new ec.Observable,this._onCollisionPositionChange=(e,t,i=null)=>{t.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>eZ.AbstractEngine.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),i&&this.onCollideObservable.notifyObservers(i),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},t=this.getScene(),this.layerMask=t.defaultRenderableLayerMask,t.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new eG.UniformBuffer(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(e){let t=this._uniformBuffer;t.updateMatrix("world",e),t.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),t.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(e){let t="Name: "+this.name+", isInstance: "+("InstancedMesh"===this.getClassName()?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);let i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode]+", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==ek.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(e,t=!0){if(this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;else if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_releaseRenderPassId(e){}_rebuild(e=!1){if(this.onRebuildObservable.notifyObservers(this),null!==this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes){for(let e of this.subMeshes)e._rebuild();this.resetDrawCache()}}_resyncLightSources(){for(let e of(this._lightSources.length=0,this.getScene().lights))e.isEnabled()&&e.canAffectMesh(this)&&this._lightSources.push(e);this._markSubMeshesAsLightDirty()}_resyncLightSource(e){let t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e),s=!1;if(-1===i){if(!t)return;this._lightSources.push(e)}else{if(t)return;s=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(s)}_unBindEffect(){for(let e of this.subMeshes)e.setEffect(null)}_removeLightSource(e,t){let i=this._lightSources.indexOf(e);-1!==i&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))}_markSubMeshesAsDirty(e){if(this.subMeshes)for(let t of this.subMeshes)for(let i=0;i<t._drawWrappers.length;++i){let s=t._drawWrappers[i];s&&s.defines&&s.defines.markAllAsDirty&&e(s.defines)}}_markSubMeshesAsLightDirty(e=!1){this._markSubMeshesAsDirty(t=>t.markAsLightDirty(e))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(e=>e.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(e=>e.markAsMiscDirty())}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(e),this._isDirty=!0,this}resetDrawCache(e,t=!1){if(this.subMeshes)for(let i of this.subMeshes)i.resetDrawCache(e,t)}get isBlocked(){return!1}getLOD(e){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(e){return null}setVerticesData(e,t,i,s){return this}updateVerticesData(e,t,i,s){return this}setIndices(e,t){return this}isVerticesDataPresent(e){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(e){return this._boundingInfo=e,this}get hasBoundingInfo(){return null!==this._boundingInfo}buildBoundingInfo(e,t,i){return this._boundingInfo=new eE.BoundingInfo(e,t,i),this._boundingInfo}normalizeToUnitCube(e=!0,t=!1,i){return super.normalizeToUnitCube(e,t,i)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)&&this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===ek.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(e,t,i){return this.position.addInPlace(this.calcMovePOV(e,t,i)),this}calcMovePOV(e,t,i){let s=new ey.Matrix;(this.rotationQuaternion?this.rotationQuaternion:ey.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(s);let r=ey.Vector3.Zero(),a=this.definedFacingForward?-1:1;return ey.Vector3.TransformCoordinatesFromFloatsToRef(e*a,t,i*a,s,r),r}rotatePOV(e,t,i){return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this}calcRotatePOV(e,t,i){let s=this.definedFacingForward?1:-1;return new ey.Vector3(e*s,t,i*s)}_refreshBoundingInfo(e,t){if(e){let i=(0,ew.extractMinAndMax)(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new eE.BoundingInfo(i.minimum,i.maximum)}if(this.subMeshes)for(let t=0;t<this.subMeshes.length;t++)this.subMeshes[t].refreshBoundingInfo(e);this._updateBoundingInfo()}_refreshBoundingInfoDirect(e){if(this._boundingInfo?this._boundingInfo.reConstruct(e.minimum,e.maximum):this._boundingInfo=new eE.BoundingInfo(e.minimum,e.maximum),this.subMeshes)for(let e=0;e<this.subMeshes.length;e++)this.subMeshes[e].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(e,t,i,s,r,a,n){!function(e,t,i,s,r,a,n){let o=ey.TmpVectors.Vector3[0],l=ey.TmpVectors.Matrix[0],h=ey.TmpVectors.Matrix[1],c=t===ev.VertexBuffer.NormalKind?ey.Vector3.TransformNormalFromFloatsToRef:ey.Vector3.TransformCoordinatesFromFloatsToRef;for(let t=0,u=0;t<e.length;t+=3,u+=4){let d,f;for(l.reset(),d=0;d<4;d++)(f=r[u+d])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(i,Math.floor(16*s[u+d]),f,h),l.addToSelf(h));if(a&&n)for(d=0;d<4;d++)(f=n[u+d])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(i,Math.floor(16*a[u+d]),f,h),l.addToSelf(h));c(e[t],e[t+1],e[t+2],l,o),o.toArray(e,t)}}(e,t,i,s,r,a,n)}_getData(e,t,i=ev.VertexBuffer.PositionKind){let s=e.cache,r=e=>{if(s){let t=s._vertexData||(s._vertexData={});return t[e]||this.copyVerticesData(e,t),t[e]}return this.getVerticesData(e)};if(t||(t=r(i)),!t)return null;s?(s._outputData?s._outputData.set(t):s._outputData=new Float32Array(t),t=s._outputData):(e.applyMorph&&this.morphTargetManager||e.applySkeleton&&this.skeleton||e.applyBakedVertexAnimation&&this.bakedVertexAnimationManager?.isEnabled)&&(t=t.slice()),e.applyMorph&&this.morphTargetManager&&function(e,t,i){let s;switch(t){case ev.VertexBuffer.PositionKind:s=e=>e.getPositions();break;case ev.VertexBuffer.NormalKind:s=e=>e.getNormals();break;case ev.VertexBuffer.TangentKind:s=e=>e.getTangents();break;case ev.VertexBuffer.UVKind:s=e=>e.getUVs();break;case ev.VertexBuffer.UV2Kind:s=e=>e.getUV2s();break;case ev.VertexBuffer.ColorKind:s=e=>e.getColors();break;default:return}for(let t=0;t<e.length;t++){let r=e[t];for(let a=0;a<i.numTargets;a++){let n=i.getTarget(a),o=n.influence;if(0!==o){let i=s(n);i&&(r+=(i[t]-e[t])*o)}}e[t]=r}}(t,i,this.morphTargetManager);let a=this.bakedVertexAnimationManager,n=!1;if(e.applyBakedVertexAnimation&&a?.isEnabled){let s=r(ev.VertexBuffer.MatricesIndicesKind),o=r(ev.VertexBuffer.MatricesWeightsKind);if(o&&s){let l=this.numBoneInfluencers>4,h=l?r(ev.VertexBuffer.MatricesIndicesExtraKind):null,c=l?r(ev.VertexBuffer.MatricesWeightsExtraKind):null;n=function(e,t,i,s,r,a,n,o,l){var h;let c,u,d,f,g,_=i.texture,m=_?.getInternalTexture(),p=m?._bufferView;if(!(p instanceof Float32Array)&&!(p instanceof Uint16Array))return eA.Logger.Warn("Baked vertex animation bounding info requires CPU-readable Float32Array or Uint16Array texture data.",1),!1;let M=_.getSize(),I=(h=i.time,c=s.y-s.x+1,d=(u=h*s.w/c)<1?0:1,f=c-d,g=eX(u-Math.floor(u),1)*f,Math.floor(g=eX(g+s.z,f))+s.x+d);if(!isFinite(I)||I<0||I>=M.height)return eA.Logger.Warn("Baked vertex animation bounding info could not be refreshed because the computed frame is outside the texture.",1),!1;let x=ey.TmpVectors.Vector3[0],b=ey.TmpVectors.Matrix[0],y=ey.TmpVectors.Matrix[1],D=I*M.width*4,V=t===ev.VertexBuffer.NormalKind?ey.Vector3.TransformNormalFromFloatsToRef:ey.Vector3.TransformCoordinatesFromFloatsToRef;for(let t=0,i=0;t<e.length;t+=3,i+=4){let s,h;for(b.reset(),s=0;s<4&&s<l;s++)(h=a[i+s])>0&&(e$(p,D+16*Math.floor(r[i+s]),y),y.scaleAndAddToRef(h,b));if(n&&o)for(s=0;s<4&&s+4<l;s++)(h=o[i+s])>0&&(e$(p,D+16*Math.floor(n[i+s]),y),y.scaleAndAddToRef(h,b));V(e[t],e[t+1],e[t+2],b,x),x.toArray(e,t)}return!0}(t,i,a,e.bakedVertexAnimationSettings??a.animationParameters,s,o,h,c,this.numBoneInfluencers)}}if(!n&&e.applySkeleton&&this.skeleton){let e=r(ev.VertexBuffer.MatricesIndicesKind),s=r(ev.VertexBuffer.MatricesWeightsKind);if(s&&e){let a=this.numBoneInfluencers>4,n=a?r(ev.VertexBuffer.MatricesIndicesExtraKind):null,o=a?r(ev.VertexBuffer.MatricesWeightsExtraKind):null,l=this.skeleton.getTransformMatrices(this);k._ApplySkeleton(t,i,l,e,s,n,o)}}if(!1!==e.updatePositionsArray&&i===ev.VertexBuffer.PositionKind){let e=this._internalAbstractMeshDataInfo._positions||[],i=e.length;if(e.length=t.length/3,i<e.length)for(let t=i;t<e.length;t++)e[t]=new ey.Vector3;for(let i=0,s=0;i<e.length;i++,s+=3)e[i].copyFromFloats(t[s],t[s+1],t[s+2]);this._internalAbstractMeshDataInfo._positions=e}return t}getNormalsData(e=!1,t=!1){return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},null,ev.VertexBuffer.NormalKind)}getPositionData(e=!1,t=!1,i=null){return this._getData({applySkeleton:e,applyMorph:t,updatePositionsArray:!1},i,ev.VertexBuffer.PositionKind)}_updateBoundingInfo(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new eE.BoundingInfo(ey.Vector3.Zero(),ey.Vector3.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(e){if(!this.subMeshes)return this;let t=this.subMeshes.length;for(let i=0;i<t;i++){let s=this.subMeshes[i];(t>1||!s.IsGlobal)&&s.updateBoundingInfo(e)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(e){return this.getBoundingInfo().isInFrustum(e,this.cullingStrategy)}isCompletelyInFrustum(e){return this.getBoundingInfo().isCompletelyInFrustum(e)}intersectsMesh(e,t=!1,i){let s=this.getBoundingInfo(),r=e.getBoundingInfo();if(s.intersects(r,t))return!0;if(i){for(let i of this.getChildMeshes())if(i.intersectsMesh(e,t,!0))return!0}return!1}intersectsPoint(e){return this.getBoundingInfo().intersectsPoint(e)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(e){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=e}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(e,t=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);let i=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=i.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,i.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,e,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,t),this}_collideForSubMesh(e,t,i){if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];let i=e.verticesStart,s=e.verticesStart+e.verticesCount;for(let r=i;r<s;r++)e._lastColliderWorldVertices.push(ey.Vector3.TransformCoordinates(this._positions[r],t))}return i._collide(e._trianglePlanes,e._lastColliderWorldVertices,this.getIndices(),e.indexStart,e.indexStart+e.indexCount,e.verticesStart,!!e.getMaterial(),this,this._shouldConvertRHS(),e.getMaterial()?.fillMode===7),this}_processCollisionsForSubMeshes(e,t){let i=this._scene.getCollidingSubMeshCandidates(this,e),s=i.length;for(let r=0;r<s;r++){let a=i.data[r];(!(s>1)||a._checkCollision(e))&&this._collideForSubMesh(a,t,e)}return this}_shouldConvertRHS(){return!1}_checkCollision(e){if(!this.getBoundingInfo()._checkCollision(e))return this;let t=ey.TmpVectors.Matrix[0],i=ey.TmpVectors.Matrix[1];return ey.Matrix.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this}_generatePointsArray(){return!1}intersects(e,t,i,s=!1,r,a=!1){let n=new ez.PickingInfo,o=this.getClassName(),l="InstancedLinesMesh"===o||"LinesMesh"===o||"GreasedLineMesh"===o?this.intersectionThreshold:0,h=this.getBoundingInfo();if(!this.subMeshes||!a&&(!e.intersectsSphere(h.boundingSphere,l)||!e.intersectsBox(h.boundingBox,l)))return n;if(s)return n.hit=!a,n.pickedMesh=a?null:this,n.distance=a?0:ey.Vector3.Distance(e.origin,h.boundingSphere.center),n.subMeshId=0,n;if(!this._generatePointsArray())return n;let c=null,u=this._scene.getIntersectingSubMeshCandidates(this,e),d=u.length,f=!1;for(let e=0;e<d;e++){let t=u.data[e].getMaterial();if(t&&(7==t.fillMode||0==t.fillMode||1==t.fillMode||2==t.fillMode||4==t.fillMode)){f=!0;break}}if(!f)return n.hit=!0,n.pickedMesh=this,n.distance=ey.Vector3.Distance(e.origin,h.boundingSphere.center),n.subMeshId=-1,n;for(let s=0;s<d;s++){let r=u.data[s];if(d>1&&!a&&!r.canIntersects(e))continue;let n=r.intersects(e,this._positions,this.getIndices(),t,i);if(n&&(t||!c||n.distance<c.distance)&&((c=n).subMeshId=r._id,c._internalSubMeshId=s,t))break}if(c){let t=r??this.getWorldMatrix(),i=ey.TmpVectors.Vector3[0],s=ey.TmpVectors.Vector3[1];ey.Vector3.TransformCoordinatesToRef(e.origin,t,i),e.direction.scaleToRef(c.distance,s);let a=ey.Vector3.TransformNormal(s,t).addInPlace(i);n.hit=!0,n.distance=ey.Vector3.Distance(i,a),n.pickedPoint=a,n.pickedMesh=this,n.bu=c.bu||0,n.bv=c.bv||0,n.subMeshFaceId=c.faceId,n.faceId=c.faceId+u.data[c._internalSubMeshId].indexStart/(-1!==this.getClassName().indexOf("LinesMesh")?2:3),n.subMeshId=c.subMeshId}return n}clone(e,t,i){return null}releaseSubMeshes(e=!1){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(e);else this.subMeshes=[];return this}dispose(e,t=!1){let i,s=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),s.freeActiveMeshes(),s.freeRenderingGroups(),s.renderingManager.maintainStateBetweenFrames&&s.renderingManager.restoreDispachedFlags(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(e=>e!==this&&e.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),i=0;i<this._intersectionsInProgress.length;i++){let e=this._intersectionsInProgress[i],t=e._intersectionsInProgress.indexOf(this);e._intersectionsInProgress.splice(t,1)}for(let e of(this._intersectionsInProgress.length=0,s.lights)){let t=e.includedOnlyMeshes.indexOf(this);-1!==t&&e.includedOnlyMeshes.splice(t,1),-1!==(t=e.excludedMeshes.indexOf(this))&&e.excludedMeshes.splice(t,1);let i=e.getShadowGenerators();if(i){let e=i.values();for(let i=e.next();!0!==i.done;i=e.next()){let e=i.value.getShadowMap();e&&e.renderList&&-1!==(t=e.renderList.indexOf(this))&&e.renderList.splice(t,1)}}}this.releaseSubMeshes(s._isDisposing);let r=s.getEngine();if(null!==this._occlusionQuery&&(this.isOcclusionQueryInProgress=!1,r.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),r.wipeCaches(),s.removeMesh(this),this._parentContainer){let e=this._parentContainer.meshes.indexOf(this);e>-1&&this._parentContainer.meshes.splice(e,1),this._parentContainer=null}if(t&&this.material&&("MultiMaterial"===this.material.getClassName()?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!e)for(i=0;i<s.particleSystems.length;i++)s.particleSystems[i].emitter===this&&(s.particleSystems[i].dispose(),i--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(e,t)}_initFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;e.facetNormals||(e.facetNormals=[]),e.facetPositions||(e.facetPositions=[]),e.facetPartitioning||(e.facetPartitioning=[]),e.facetNb=this.getIndices().length/3|0,e.partitioningSubdivisions=e.partitioningSubdivisions?e.partitioningSubdivisions:10,e.partitioningBBoxRatio=e.partitioningBBoxRatio?e.partitioningBBoxRatio:1.01;for(let t=0;t<e.facetNb;t++)e.facetNormals[t]=ey.Vector3.Zero(),e.facetPositions[t]=ey.Vector3.Zero();return e.facetDataEnabled=!0,this}updateFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;e.facetDataEnabled||this._initFacetData();let t=this.getVerticesData(ev.VertexBuffer.PositionKind),i=this.getIndices(),s=this.getVerticesData(ev.VertexBuffer.NormalKind)?.slice(),r=this.getBoundingInfo();if(e.facetDepthSort&&!e.facetDepthSortEnabled){if(e.facetDepthSortEnabled=!0,i instanceof Uint16Array)e.depthSortedIndices=new Uint16Array(i);else if(i instanceof Uint32Array)e.depthSortedIndices=new Uint32Array(i);else{let t=!1;for(let e=0;e<i.length;e++)if(i[e]>65535){t=!0;break}t?e.depthSortedIndices=new Uint32Array(i):e.depthSortedIndices=new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){let t=this.getScene().activeCamera;e.facetDepthSortFrom=t?t.position:ey.Vector3.Zero()}e.depthSortedFacets=[];for(let t=0;t<e.facetNb;t++){let i={ind:3*t,sqDistance:0};e.depthSortedFacets.push(i)}e.invertedMatrix=ey.Matrix.Identity(),e.facetDepthSortOrigin=ey.Vector3.Zero()}e.bbSize.x=r.maximum.x-r.minimum.x>eq.Epsilon?r.maximum.x-r.minimum.x:eq.Epsilon,e.bbSize.y=r.maximum.y-r.minimum.y>eq.Epsilon?r.maximum.y-r.minimum.y:eq.Epsilon,e.bbSize.z=r.maximum.z-r.minimum.z>eq.Epsilon?r.maximum.z-r.minimum.z:eq.Epsilon;let a=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(a=a>e.bbSize.z?a:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/a),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/a),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/a),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=r,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),ey.Vector3.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,s&&eR.ComputeNormals(t,i,s,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);let t=e.depthSortedIndices.length/3|0;for(let s=0;s<t;s++){let t=e.depthSortedFacets[s].ind;e.depthSortedIndices[3*s]=i[t],e.depthSortedIndices[3*s+1]=i[t+1],e.depthSortedIndices[3*s+2]=i[t+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetNormals||this.updateFacetData(),e.facetNormals}getFacetLocalPositions(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetPositions||this.updateFacetData(),e.facetPositions}getFacetLocalPartitioning(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetPartitioning||this.updateFacetData(),e.facetPartitioning}getFacetPosition(e){let t=ey.Vector3.Zero();return this.getFacetPositionToRef(e,t),t}getFacetPositionToRef(e,t){let i=this.getFacetLocalPositions()[e],s=this.getWorldMatrix();return ey.Vector3.TransformCoordinatesToRef(i,s,t),this}getFacetNormal(e){let t=ey.Vector3.Zero();return this.getFacetNormalToRef(e,t),t}getFacetNormalToRef(e,t){let i=this.getFacetLocalNormals()[e];return ey.Vector3.TransformNormalToRef(i,this.getWorldMatrix(),t),this}getFacetsAtLocalCoordinates(e,t,i){let s=this.getBoundingInfo(),r=this._internalAbstractMeshDataInfo._facetData,a=Math.floor((e-s.minimum.x*r.partitioningBBoxRatio)*r.subDiv.X*r.partitioningBBoxRatio/r.bbSize.x),n=Math.floor((t-s.minimum.y*r.partitioningBBoxRatio)*r.subDiv.Y*r.partitioningBBoxRatio/r.bbSize.y),o=Math.floor((i-s.minimum.z*r.partitioningBBoxRatio)*r.subDiv.Z*r.partitioningBBoxRatio/r.bbSize.z);return a<0||a>r.subDiv.max||n<0||n>r.subDiv.max||o<0||o>r.subDiv.max?null:r.facetPartitioning[a+r.subDiv.max*n+r.subDiv.max*r.subDiv.max*o]}getClosestFacetAtCoordinates(e,t,i,s,r=!1,a=!0){let n=this.getWorldMatrix(),o=ey.TmpVectors.Matrix[5];n.invertToRef(o);let l=ey.TmpVectors.Vector3[8];ey.Vector3.TransformCoordinatesFromFloatsToRef(e,t,i,o,l);let h=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,s,r,a);return s&&ey.Vector3.TransformCoordinatesFromFloatsToRef(s.x,s.y,s.z,n,s),h}getClosestFacetAtLocalCoordinates(e,t,i,s,r=!1,a=!0){let n,o,l,h,c,u,d,f,g,_,m,p,M=null,I=this.getFacetLocalPositions(),x=this.getFacetLocalNormals(),b=this.getFacetsAtLocalCoordinates(e,t,i);if(!b)return null;let y=Number.MAX_VALUE;for(let D=0;D<b.length;D++)m=x[_=b[D]],h=(e-(p=I[_]).x)*m.x+(t-p.y)*m.y+(i-p.z)*m.z,(!r||r&&a&&h>=0||r&&!a&&h<=0)&&(h=m.x*p.x+m.y*p.y+m.z*p.z,c=-(m.x*e+m.y*t+m.z*i-h)/(m.x*m.x+m.y*m.y+m.z*m.z),u=e+m.x*c,d=t+m.y*c,f=i+m.z*c,(g=(n=u-e)*n+(o=d-t)*o+(l=f-i)*l)<y&&(y=g,M=_,s&&(s.x=u,s.y=d,s.z=f)));return M}getFacetDataParameters(){return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){let e=this._internalAbstractMeshDataInfo._facetData;return e.facetDataEnabled&&(e.facetDataEnabled=!1,e.facetPositions=[],e.facetNormals=[],e.facetPartitioning=[],e.facetParameters={},e.depthSortedIndices=new Uint32Array(0)),this}updateIndices(e,t,i=!1){return this}createNormals(e){let t,i=this.getVerticesData(ev.VertexBuffer.PositionKind),s=this.getIndices();return t=this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)?this.getVerticesData(ev.VertexBuffer.NormalKind):[],eR.ComputeNormals(i,s,t,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(ev.VertexBuffer.NormalKind,t,e),this}async optimizeIndicesAsync(){let t=this.getIndices();if(!t)return this;let{OptimizeIndices:i}=await e.A(46717);return i(t),this.setIndices(t,this.getTotalVertices()),this}alignWithNormal(e,t){t||(t=eH.Axis.Y);let i=ey.TmpVectors.Vector3[0],s=ey.TmpVectors.Vector3[1];return ey.Vector3.CrossToRef(t,e,s),ey.Vector3.CrossToRef(e,s,i),this.rotationQuaternion?ey.Quaternion.RotationQuaternionFromAxisToRef(i,e,s,this.rotationQuaternion):ey.Vector3.RotationFromAxisToRef(i,e,s,this.rotation),this}_checkOcclusionQuery(e=!1){return!1}disableEdgesRendering(){throw(0,eS._WarnImport)("EdgesRenderer")}enableEdgesRendering(e,t,i){throw(0,eS._WarnImport)("EdgesRenderer")}getConnectedParticleSystems(){return this._scene.particleSystems.filter(e=>e.emitter===this)}},W="function"==typeof Symbol&&Symbol.metadata?Object.create(U[Symbol.metadata]??null):void 0,w=[eP.nativeOverride.filter((...e)=>!Array.isArray(e[0])&&!Array.isArray(e[3])&&!Array.isArray(e[4])&&!Array.isArray(e[5])&&!Array.isArray(e[6]))],(0,eB.__esDecorate)(k,null,w,{kind:"method",name:"_ApplySkeleton",static:!0,private:!1,access:{has:e=>"_ApplySkeleton"in e,get:e=>e._ApplySkeleton},metadata:W},null,L),W&&Object.defineProperty(k,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:W}),k.OCCLUSION_TYPE_NONE=((0,eB.__runInitializers)(k,L),0),k.OCCLUSION_TYPE_OPTIMISTIC=1,k.OCCLUSION_TYPE_STRICT=2,k.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,k.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,k.CULLINGSTRATEGY_STANDARD=0,k.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,k.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,k.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,k.DefaultIsPickable=!0,k),e3=!1;(q=e1.prototype).createOrUpdateSubmeshesOctree??(q.createOrUpdateSubmeshesOctree=(0,eS._MissingSideEffect)("AbstractMesh","createOrUpdateSubmeshesOctree")),(H=e1.prototype).getPhysicsImpostor??(H.getPhysicsImpostor=(0,eS._MissingSideEffect)("AbstractMesh","getPhysicsImpostor")),(Z=e1.prototype).setPhysicsLinkWith??(Z.setPhysicsLinkWith=(0,eS._MissingSideEffect)("AbstractMesh","setPhysicsLinkWith")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionRetryCount")||Object.defineProperty(e1.prototype,"occlusionRetryCount",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionRetryCount")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionType")||Object.defineProperty(e1.prototype,"occlusionType",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionType")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionQueryAlgorithmType")||Object.defineProperty(e1.prototype,"occlusionQueryAlgorithmType",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionQueryAlgorithmType")),Object.getOwnPropertyDescriptor(e1.prototype,"isOccluded")||Object.defineProperty(e1.prototype,"isOccluded",(0,eS._MissingSideEffectProperty)("AbstractMesh","isOccluded")),Object.getOwnPropertyDescriptor(e1.prototype,"isOcclusionQueryInProgress")||Object.defineProperty(e1.prototype,"isOcclusionQueryInProgress",(0,eS._MissingSideEffectProperty)("AbstractMesh","isOcclusionQueryInProgress")),Object.getOwnPropertyDescriptor(e1.prototype,"forceRenderingWhenOccluded")||Object.defineProperty(e1.prototype,"forceRenderingWhenOccluded",(0,eS._MissingSideEffectProperty)("AbstractMesh","forceRenderingWhenOccluded")),Object.getOwnPropertyDescriptor(e1.prototype,"occlusionForRenderPassId")||Object.defineProperty(e1.prototype,"occlusionForRenderPassId",(0,eS._MissingSideEffectProperty)("AbstractMesh","occlusionForRenderPassId")),Object.getOwnPropertyDescriptor(e1.prototype,"decalMap")||Object.defineProperty(e1.prototype,"decalMap",(0,eS._MissingSideEffectProperty)("AbstractMesh","decalMap")),Object.getOwnPropertyDescriptor(e1.prototype,"instancedBuffers")||Object.defineProperty(e1.prototype,"instancedBuffers",(0,eS._MissingSideEffectProperty)("AbstractMesh","instancedBuffers")),Object.getOwnPropertyDescriptor(e1.prototype,"physicsImpostor")||Object.defineProperty(e1.prototype,"physicsImpostor",(0,eS._MissingSideEffectProperty)("AbstractMesh","physicsImpostor")),Object.getOwnPropertyDescriptor(e1.prototype,"showBoundingBox")||Object.defineProperty(e1.prototype,"showBoundingBox",(0,eS._MissingSideEffectProperty)("AbstractMesh","showBoundingBox")),Object.getOwnPropertyDescriptor(e1.prototype,"edgesRenderer")||Object.defineProperty(e1.prototype,"edgesRenderer",(0,eS._MissingSideEffectProperty)("AbstractMesh","edgesRenderer")),Object.getOwnPropertyDescriptor(e1.prototype,"renderOutline")||Object.defineProperty(e1.prototype,"renderOutline",(0,eS._MissingSideEffectProperty)("AbstractMesh","renderOutline")),Object.getOwnPropertyDescriptor(e1.prototype,"renderOverlay")||Object.defineProperty(e1.prototype,"renderOverlay",(0,eS._MissingSideEffectProperty)("AbstractMesh","renderOverlay")),e.s(["AbstractMesh",0,e1,"RegisterAbstractMesh",0,function(){e3||(e3=!0,(0,eY.RegisterClass)("BABYLON.AbstractMesh",e1))}],87659);var e2=e.i(7361),e4=e2;class e5 extends e4.Material{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){let t=e.push;e.push=(...i)=>{let s=t.apply(e,i);return this._markAllSubMeshesAsTexturesDirty(),s};let i=e.splice;e.splice=(t,s)=>{let r=i.call(e,t,s??e.length);return this._markAllSubMeshesAsTexturesDirty(),r}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){return"MultiMaterial"}isReadyForSubMesh(e,t,i){for(let s=0;s<this.subMaterials.length;s++){let r=this.subMaterials[s];if(r){if(r._storeEffectOnSubMeshes){if(!r.isReadyForSubMesh(e,t,i))return!1;continue}if(!r.isReady(e))return!1}}return!0}clone(e,t){let i=new e5(e,this.getScene());for(let s=0;s<this.subMaterials.length;s++){let r,a=this.subMaterials[s];r=t&&a?a.clone(e+"-"+a.name):this.subMaterials[s],i.subMaterials.push(r)}return i}serialize(){let e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,eg.Tags&&(e.tags=eg.Tags.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){let i=this.subMaterials[t];i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){let s=this.getScene();if(!s)return;if(i)for(let i=0;i<this.subMaterials.length;i++){let s=this.subMaterials[i];s&&s.dispose(e,t)}let r=s.multiMaterials.indexOf(this);r>=0&&s.multiMaterials.splice(r,1),super.dispose(e,t)}}let e6=!1;function e8(e,t){let i=new e5(e.name,t);if(i.id=e.id,i._loadedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(i,e.tags),e.materialsUniqueIds)i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds;else for(let s of e.materials)i.subMaterials.push(t.getLastMaterialById(s));return i}e.s(["MultiMaterial",0,e5,"RegisterMultiMaterial",0,function(){e6||(e6=!0,e5.ParseMultiMaterial=e8,(0,eY.RegisterClass)("BABYLON.MultiMaterial",e5))}],76895);var e7=e.i(17828);class e9{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}class te{constructor(){this.batchCache=new ti(this),this.batchCacheReplacementModeInFrozenMode=new ti(this),this.instancesBufferSize=2048}}class tt{constructor(){this.renderPasses={}}}class ti{constructor(e){this.parent=e,this.mustReturn=!1,this.visibleInstances=[],this.renderSelf=[],this.hardwareInstancedRendering=[]}}class ts{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class tr{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=[],this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}let ta={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class tn extends e1{static _GetDefaultSideOrientation(e){return e||tn.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(ev.VertexBuffer.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(ev.VertexBuffer.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new ec.Observable),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new ec.Observable),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new ec.Observable),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&1===e||!this._scene.useRightHandedSystem&&0===e}get _effectiveSideOrientation(){return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&null===this.material.sideOrientation||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){let e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){let e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,s=!1){let r=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),ef.DeepCopier.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,r.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){let t=e._ranges;for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]&&this.createAnimationRange(e,t[e].from,t[e].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,eg.Tags&&eg.Tags.HasTags(e)&&eg.Tags.AddTagsTo(this,eg.Tags.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){let r=e.getDescendants(!0);for(let e=0;e<r.length;e++){let a=r[e];a._isMesh?(ta.parent=this,ta.doNotCloneChildren=t,ta.clonePhysicsImpostor=i,ta.cloneThinInstances=s,a.clone(this.name+"."+a.name,ta)):a.clone&&a.clone(this.name+"."+a.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),(0,eS._IsSideEffectImplemented)(r.getPhysicsEngine)){let t=r.getPhysicsEngine();if(i&&t)if(1===t.getPluginVersion()){let i=t.getImpostorForPhysicsObject(e);i&&(this.physicsImpostor=i.clone(this))}else 2===t.getPluginVersion()&&e.physicsBody&&e.physicsBody.clone(this)}for(let t=0;t<r.particleSystems.length;t++){let i=r.particleSystems[t];i.emitter===e&&i.clone(i.name,this)}if(this.skeleton=e.skeleton,s&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){let t=e._userThinInstanceBuffersStorage;for(let e in t.data)this.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!t.vertexBuffers?.[e]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,s=null,r,a=!0){let n;super(e,t),this._internalMeshDataInfo=new tr,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new ts,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=tn.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new tt,this._instanceDataStorage.engine=t.getEngine(),this._instanceDataStorage.useMonoDataStorageRenderPass=!this._instanceDataStorage.engine.isWebGPU,this._instanceDataStorage.useMonoDataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass=new te),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(e,t,i)=>{e&&i&&(this._uniformBuffer?this.transferToEffect(t):i.bindOnlyWorldMatrix(t))};let o=!1;i&&void 0===i._addToSceneRootNodes?(n=i.parent??null,s=i.source??null,r=i.doNotCloneChildren??!1,a=i.clonePhysicsImpostor??!0,o=i.cloneThinInstances??!1):n=i,s&&this._copySource(s,r,a,o),null!==n&&(this.parent=n),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=e=>{e.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new ec.Observable(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){let s=0===this.getTotalVertices()||t&&t.doNotInstantiate&&(!0===t.doNotInstantiate||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));for(let r of(s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s),this.getChildTransformNodes(!0)))"InstancedMesh"===r.getClassName()&&"Mesh"===s.getClassName()&&r.sourceMesh===this?r.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):r.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){let e=this.getIndices(),i=this.getVerticesData(ev.VertexBuffer.PositionKind);i&&e&&(t+=", flat shading: "+(i.length/3===e.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){for(let e of(super._unBindEffect(),this.instances))e._unBindEffect()}get hasLODLevels(){return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){let e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return eA.Logger.Warn("You cannot use a mesh as LOD level twice"),this;let i=new e9(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){let t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){let s=t._LODLevels[i];if(s.distanceOrScreenCoverage===e)return s.mesh}return null}removeLODLevel(e){let t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){let i=this._internalMeshDataInfo;if(!i._LODLevels||0===i._LODLevels.length)return this;let s=t||this.getBoundingInfo().boundingSphere,r=e.mode===eb.Camera.ORTHOGRAPHIC_CAMERA?e.minZ:s.centerWorld.subtract(e.globalPosition).length(),a=r,n=1;if(i._useLODScreenCoverage){let t=e.screenArea,i=s.radiusWorld*e.minZ/r;a=(i=i*i*Math.PI)/t,n=-1}if(n*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>n*a)return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,this),this;for(let e=0;e<i._LODLevels.length;e++){let t=i._LODLevels[e];if(n*t.distanceOrScreenCoverage<n*a){if(t.mesh){if(4===t.mesh.delayLoadState)return t.mesh._checkDelayState(),this;if(2===t.mesh.delayLoadState)return this;t.mesh._preActivate(),t.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,t.mesh),t.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(a,this,this),this}get geometry(){return this._geometry}getTotalVertices(){return null===this._geometry||void 0===this._geometry?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,s){if(!this._geometry)return null;let r=s?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&1!==this._geometry.meshes.length);return r||(r=this._geometry.getVerticesData(e,t,i)),r}copyVerticesData(e,t){this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){return this._geometry?!t&&this._userInstancedBuffersStorage?.vertexBuffers[e]!==void 0||this._geometry.isVerticesDataPresent(e):!!this._delayInfo&&-1!==this._delayInfo.indexOf(e)}isVertexBufferUpdatable(e,t){if(!this._geometry)return!!this._delayInfo&&-1!==this._delayInfo.indexOf(e);if(!t){let t=this._userInstancedBuffersStorage?.vertexBuffers[e];if(t)return t.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){if(!this._geometry){let e=[];if(this._delayInfo)for(let t of this._delayInfo)e.push(t);return e}let t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(let e in this._userInstancedBuffersStorage.vertexBuffers)-1===t.indexOf(e)&&t.push(e);return t}getTotalIndices(){return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){return null!==this._masterMesh&&void 0!==this._masterMesh}isReady(e=!1,t=!1){if(2===this.delayLoadState||!super.isReady(e))return!1;if(!this.subMeshes||0===this.subMeshes.length||!e)return!0;let i=this.getEngine(),s=this.getScene(),r=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();let a=this.material||s.defaultMaterial;if(a){if(a._storeEffectOnSubMeshes)for(let e of this.subMeshes){let t=e.getMaterial();if(t){if(t._storeEffectOnSubMeshes){if(!t.isReadyForSubMesh(this,e,r))return!1}else if(!t.isReady(this,r))return!1}}else if(!a.isReady(this,r))return!1}let n=i.currentRenderPassId;for(let e of this.lightSources){let t=e.getShadowGenerators();if(!t)continue;let s=t.values();for(let e=s.next();!0!==e.done;e=s.next()){let t=e.value;if(t&&(!t.getShadowMap()?.renderList||t.getShadowMap()?.renderList&&t.getShadowMap()?.renderList?.indexOf(this)!==-1)){let e=t.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let s=0;s<e.length;++s)for(let a of(i.currentRenderPassId=e[s],this.subMeshes))if(!t.isReady(a,r,a.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=n,!1;i.currentRenderPassId=n}}}for(let e of this._internalMeshDataInfo._LODLevels)if(e.mesh&&!e.mesh.isReady(r))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){if(this._instanceDataStorage.useMonoDataStorageRenderPass)return this._instanceDataStorage.dataStorageRenderPass;let e=this._instanceDataStorage.engine.currentRenderPassId,t=this._instanceDataStorage.renderPasses[e];return t||(t=new te,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){let e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t||(e._preActivateId=t,this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass.visibleInstances=null:this._getInstanceDataStorage().visibleInstances=null),this}_preActivateForIntermediateRendering(e){let t=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){let i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(void 0!==i.previousRenderId&&(!this._instanceDataStorage.useMonoDataStorageRenderPass||this._instanceDataStorage.isFrozen)&&delete i.visibleInstances[i.previousRenderId],i.previousRenderId=t,i.visibleInstances[t]=[]),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData("object"==typeof e?e:{applySkeleton:e,applyMorph:t},null,ev.VertexBuffer.PositionKind),i),this}_createGlobalSubMesh(e){let t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){let i=this.getIndices();if(!i)return null;let s=i.length,r=!1;if(e)r=!0;else for(let e of this.subMeshes)if(e.indexStart+e.indexCount>s||e.verticesStart+e.verticesCount>t){r=!0;break}if(!r)return this.subMeshes[0]}return this.releaseSubMeshes(),new eC.SubMesh(0,0,t,0,this.getTotalIndices()||(this.isUnIndexed?t:0),this)}subdivide(e){if(e<1)return;let t=this.getTotalIndices(),i=t/e|0,s=0;for(;i%3!=0;)i++;this.releaseSubMeshes();for(let r=0;r<e&&!(s>=t);r++)eC.SubMesh.CreateFromIndices(0,s,s+i>=t?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{let s=new eR;s.set(t,e);let r=this.getScene();new eN(eN.RandomId(),r,s,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){let i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0,i=null){return this._geometry||(this._geometry=eN.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,i,t),this}updateVerticesData(e,t,i,s){return this._geometry&&(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i)),this}updateMeshPositions(e,t=!0){let i=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(ev.VertexBuffer.PositionKind,i,!1,!1),t){let e=this.getIndices(),t=this.getVerticesData(ev.VertexBuffer.NormalKind);if(!t)return this;eR.ComputeNormals(i,e,t),this.updateVerticesData(ev.VertexBuffer.NormalKind,t,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry||1===this._geometry.meshes.length)return this;let e=this._geometry,t=this._geometry.copy(eN.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,s=null){let r=this._geometry;r||(r=new eN(eN.RandomId(),this.getScene(),void 0,void 0,this)),r.setIndexBuffer(e,t,i,s)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{let s=new eR;s.indices=e;let r=this.getScene();new eN(eN.RandomId(),r,s,i,this,t)}return this}updateIndices(e,t,i=!1){return this._geometry&&this._geometry.updateIndices(e,t,i),this}toLeftHanded(){return this._geometry&&this._geometry.toLeftHanded(),this}_bind(e,t,i,s=!0){let r;if(!this._geometry)return this;let a=this.getScene().getEngine();if(this._unIndexed)r=this._getRenderingFillMode(i)===e2.Material.WireFrameFillMode?e._getLinesIndexBuffer(this.getIndices(),a):null;else switch(this._getRenderingFillMode(i)){case e2.Material.PointFillMode:r=null;break;case e2.Material.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),a);break;default:case e2.Material.TriangleFillMode:r=this._geometry.getIndexBuffer()}return this._bindDirect(t,r,s)}_bindDirect(e,t,i=!0){if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),i&&this._userInstancedBuffersStorage&&!this.hasThinInstances){if(!this._instanceDataStorage.useMonoDataStorageRenderPass&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){let e=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(let t in e)this._userInstancedBuffersStorage.vertexBuffers[t]=e[t]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}else this._geometry._bind(e,t);return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);let s=this.getScene().getEngine(),r=s._currentMaterialContext,a=r&&r.useVertexPulling;return this._unIndexed&&t!==e2.Material.WireFrameFillMode||t==e2.Material.PointFillMode?s.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==e2.Material.WireFrameFillMode?s.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):a?s.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):s.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){let i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}let s=this.getScene(),r=s._isInIntermediateRendering(),a=r?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,n=i.batchCache;if(n.mustReturn=!1,n.renderSelf[e]=t||!a&&this.isEnabled()&&this.isVisible,n.visibleInstances[e]=null,i.visibleInstances&&!t){let t=i.visibleInstances,a=s.getRenderId(),o=r?t.intermediateDefaultRenderId:t.defaultRenderId;n.visibleInstances[e]=t[a],!n.visibleInstances[e]&&o&&(n.visibleInstances[e]=t[o])}return n.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==n.visibleInstances[e]&&void 0!==n.visibleInstances[e],i.previousBatch=n,n}_updateInstancedBuffers(e,t,i,s,r,a){let n=t.visibleInstances[e._id],o=n?n.length:0,l=t.parent,h=this._instanceDataStorage,c=l.instancesBuffer,u=l.instancesPreviousBuffer,d=0,f=0,g=t.renderSelf[e._id],_=this._scene.floatingOriginOffset,m=!c||i!==l.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!l.instancesPreviousBuffer;if(this._instanceDataStorage.manualUpdate||h.isFrozen&&!m)f=+!!g+o;else{let t=this.getWorldMatrix();if(g){this._scene.needsPreviousWorldMatrices&&(h.masterMeshPreviousWorldMatrix?(h.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData,d),h.masterMeshPreviousWorldMatrix.copyFrom(t)):(h.masterMeshPreviousWorldMatrix=t.clone(),h.masterMeshPreviousWorldMatrix.copyToArray(l.instancesPreviousData,d))),t.copyToArray(l.instancesData,d);let e=t.asArray();l.instancesData[d+12]=e[12]-_.x,l.instancesData[d+13]=e[13]-_.y,l.instancesData[d+14]=e[14]-_.z,d+=16,f++}if(n){if(tn.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){let e=this._scene.activeCamera.globalPosition;for(let t=0;t<n.length;t++){let i=n[t];i._distanceToCamera=ey.Vector3.Distance(i.getBoundingInfo().boundingSphere.centerWorld,e)}n.sort((e,t)=>e._distanceToCamera>t._distanceToCamera?-1:+(e._distanceToCamera<t._distanceToCamera))}for(let e=0;e<n.length;e++){let t=n[e],i=t.getWorldMatrix();i.copyToArray(l.instancesData,d),this._scene.needsPreviousWorldMatrices&&(t._previousWorldMatrix?(t._previousWorldMatrix.copyToArray(l.instancesPreviousData,d),t._previousWorldMatrix.copyFrom(i)):(t._previousWorldMatrix=i.clone(),t._previousWorldMatrix.copyToArray(l.instancesPreviousData,d)));let s=i.asArray();l.instancesData[d+12]=s[12]-_.x,l.instancesData[d+13]=s[13]-_.y,l.instancesData[d+14]=s[14]-_.z,d+=16,f++}}}if(m){let e;if(c&&c.dispose(),u&&u.dispose(),c=new ev.Buffer(s,l.instancesData,!0,16,!1,!0),l.instancesBuffer=c,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0}),this._instanceDataStorage.useMonoDataStorageRenderPass)e=this._userInstancedBuffersStorage.vertexBuffers;else{this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});let t=this._instanceDataStorage.engine.currentRenderPassId;(e=this._userInstancedBuffersStorage.renderPasses[t])||(this._userInstancedBuffersStorage.renderPasses[t]=e={})}e.world0=c.createVertexBuffer("world0",0,4),e.world1=c.createVertexBuffer("world1",4,4),e.world2=c.createVertexBuffer("world2",8,4),e.world3=c.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(u=new ev.Buffer(s,l.instancesPreviousData,!0,16,!1,!0),l.instancesPreviousBuffer=u,e.previousWorld0=u.createVertexBuffer("previousWorld0",0,4),e.previousWorld1=u.createVertexBuffer("previousWorld1",4,4),e.previousWorld2=u.createVertexBuffer("previousWorld2",8,4),e.previousWorld3=u.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&(c.updateDirectly(l.instancesData,0,f),this._scene.needsPreviousWorldMatrices&&(!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.previousManualUpdate)&&u.updateDirectly(l.instancesPreviousData,0,f));this._processInstancedBuffers(n,g),a&&void 0!==r&&(this.getScene()._activeIndices.addCount(e.indexCount*f,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,a,r),this._draw(e,r,f)),this._scene.needsPreviousWorldMatrices&&!m&&this._instanceDataStorage.manualUpdate&&(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&!this._instanceDataStorage.previousManualUpdate&&u.updateDirectly(l.instancesData,0,f)}_renderWithInstances(e,t,i,s,r){let a=i.visibleInstances[e._id],n=a?a.length:0,o=i.parent,l=o.instancesBufferSize,h=16*(n+1)*4;for(;o.instancesBufferSize<h;)o.instancesBufferSize*=2;return o.instancesData&&l==o.instancesBufferSize||(o.instancesData=new Float32Array(o.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!o.instancesPreviousData||l!=o.instancesBufferSize)&&(o.instancesPreviousData=new Float32Array(o.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,l,r,t,s),r.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,s){let r=this._thinInstanceDataStorage?.instancesCount??0;this.getScene()._activeIndices.addCount(e.indexCount*r,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,r),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,r):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),s.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,s,r,a,n,o){let l=this.getScene(),h=l.getEngine();if(s=this._getRenderingFillMode(s),a&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,s,i,h),this;if(a)this._renderWithInstances(t,s,r,i,h);else{h._currentDrawContext&&(h._currentDrawContext.useInstancing=!1);let i=0;r.renderSelf[t._id]&&(n&&n(!1,e.getWorldMatrix(),o),i++,this._draw(t,s,this._instanceDataStorage.overridenInstanceCount));let a=r.visibleInstances[t._id];if(a){let e=a.length;i+=e;for(let i=0;i<e;i++){let e=a[i].getWorldMatrix();n&&n(!0,e,o),this._draw(t,s)}}l._activeIndices.addCount(t.indexCount*i,!1)}return this}_disposeInstanceDataStorageRenderPass(e,t=!1){e?.instancesBuffer&&(t&&e.instancesBuffer.dispose(),e.instancesBuffer=null),e?.instancesPreviousBuffer&&(t&&e.instancesPreviousBuffer.dispose(),e.instancesPreviousBuffer=null)}_rebuild(e=!1){for(let t in this._instanceDataStorage.renderPasses){let i=this._instanceDataStorage.renderPasses[t];this._disposeInstanceDataStorageRenderPass(i,e)}if(this._disposeInstanceDataStorageRenderPass(this._instanceDataStorage.dataStorageRenderPass,e),this._userInstancedBuffersStorage){for(let t in this._userInstancedBuffersStorage.vertexBuffers){let i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_releaseRenderPassId(e){let t=this._instanceDataStorage.renderPasses[e];if(t&&(this._disposeInstanceDataStorageRenderPass(t,!0),delete this._instanceDataStorage.renderPasses[e]),this._userInstancedBuffersStorage?.renderPasses){let t=this._userInstancedBuffersStorage.renderPasses[e];if(t)for(let e in t)t[e]?.dispose();delete this._userInstancedBuffersStorage.renderPasses[e]}}_freeze(){if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){for(let e in this._instanceDataStorage.isFrozen=!1,this._instanceDataStorage.renderPasses)this._instanceDataStorage.renderPasses[e].previousBatch=null;this._instanceDataStorage.dataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass.previousBatch=null)}renderWithRenderPassId(e,t,i,s,r=!0){let a=this._scene.getEngine(),n=a.currentRenderPassId;if(void 0!==e&&(a.currentRenderPassId=e),s)(!r||r&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i);else for(let e=0;e<this.subMeshes.length;e++){let s=this.subMeshes[e];(!r||r&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i)}return void 0!==e&&(a.currentRenderPassId=n),this}directRender(){if(!this.subMeshes)return this;for(let e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){let s,r,a=this.getScene(),n=a.getEngine();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;let o=a.activeCameras?.length??0,l=o>1&&a.activeCamera===a.activeCameras[0]||o<=1,h=this._occlusionDataStorage&&-1!==this._occlusionDataStorage.occlusionForRenderPassId&&this._occlusionDataStorage.occlusionForRenderPassId!==n.currentRenderPassId;if(l&&this._checkOcclusionQuery(h)&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;let c=this._getInstancesRenderList(e._id,!!i);if(c.mustReturn||!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let u=0,d=null;this.ignoreCameraMaxZ&&a.activeCamera&&!a._isInIntermediateRendering()&&(u=a.activeCamera.maxZ,d=a.activeCamera,a.activeCamera.maxZ=0,a.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);let f=e.getRenderingMesh(),g=c.hardwareInstancedRendering[e._id]||f.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,_=this._instanceDataStorage,m=e.getMaterial();if(!m)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;if(_.isFrozen&&this._internalMeshDataInfo._effectiveMaterial&&this._internalMeshDataInfo._effectiveMaterial===m){if(m._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!m._storeEffectOnSubMeshes&&!m._getDrawWrapper()._wasPreviouslyReady)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this}else{if(m._storeEffectOnSubMeshes){if(!m.isReadyForSubMesh(this,e,g))return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this}else if(!m.isReady(this,g))return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=m}if(t){let e=this._internalMeshDataInfo._effectiveMaterial;if(1===e.alphaModes.length)n.setAlphaMode(e.alphaMode);else for(let t=0;t<e.alphaModes.length;t++){let i=e.alphaModes[t];n.setAlphaMode(void 0!==i?i:2,!1,t)}}s=this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?e._drawWrapper:this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();let p=s?.effect??null;for(let t of a._beforeRenderingMeshStage)t.action(this,e,c,p);if(!s||!p)return d&&(d.maxZ=u,a.updateTransformMatrix(!0)),this;let M=i||this;if(!_.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||null!==this._internalMeshDataInfo._effectiveMaterial.sideOrientation||this._internalMeshDataInfo._effectiveMaterial._twoSidedLighting)){let e=M._getWorldMatrixDeterminant();r=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),e<0&&(r=r===e2.Material.ClockWiseSideOrientation?e2.Material.CounterClockWiseSideOrientation:e2.Material.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=r}let I=this._internalMeshDataInfo._effectiveMaterial._preBind(s,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&n.setDepthWrite(!0);let x=this._internalMeshDataInfo._effectiveMaterial,b=x.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),g||this._bind(e,p,b,!1);let y=M.getWorldMatrix();for(let t of(x._storeEffectOnSubMeshes?x.bindForSubMesh(y,this,e):x.bind(y,this),!x.backFaceCulling&&x.separateCullingPass&&(n.setState(!0,x.zOffset,!1,!I,x.cullBackFaces,x.stencil,x.zOffsetUnits),this._processRendering(this,e,p,b,c,g,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),n.setState(!0,x.zOffset,!1,I,x.cullBackFaces,x.stencil,x.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,p,b,c,g,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind(),a._afterRenderingMeshStage))t.action(this,e,c,p);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),d&&(d.maxZ=u,a.updateTransformMatrix(!0)),2!==a.performancePriority||_.isFrozen||this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)&&(this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){let t=e[i]+e[i+1]+e[i+2]+e[i+3];if(0===t)e[i]=1;else{let s=1/t;e[i]*=s,e[i+1]*=s,e[i+2]*=s,e[i+3]*=s}}this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind),i=t.length;for(let s=0;s<i;s+=4){let i=t[s]+t[s+1]+t[s+2]+t[s+3];if(0===(i+=e[s]+e[s+1]+e[s+2]+e[s+3]))t[s]=1;else{let r=1/i;t[s]*=r,t[s+1]*=r,t[s+2]*=r,t[s+3]*=r,e[s]*=r,e[s+1]*=r,e[s+2]*=r,e[s+3]*=r}}this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,t),this.setVerticesData(ev.VertexBuffer.MatricesWeightsKind,e)}validateSkinning(){let e=this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind);if(null===t||null==this.skeleton)return{skinned:!1,valid:!0,report:"not skinned"};let i=t.length,s=0,r=0,a=0,n=0,o=null===e?4:8,l=[];for(let e=0;e<=o;e++)l[e]=0;for(let h=0;h<i;h+=4){let i=t[h],c=i,u=+(0!==c);for(let r=1;r<o;r++){let a=r<4?t[h+r]:e[h+r-4];a>i&&s++,0!==a&&u++,c+=a,i=a}if(l[u]++,u>a&&(a=u),0===c)r++;else{let i=1/c,s=0;for(let r=0;r<o;r++)r<4?s+=Math.abs(t[h+r]-t[h+r]*i):s+=Math.abs(e[h+r-4]-e[h+r-4]*i);s>.001&&n++}}let h=this.skeleton.bones.length,c=this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),u=this.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind),d=0;for(let e=0;e<i;e+=4)for(let t=0;t<o;t++){let i=t<4?c[e+t]:u[e+t-4];(i>=h||i<0)&&d++}let f="Number of Weights = "+i/4+"\nMaximum influences = "+a+"\nMissing Weights = "+r+"\nNot Sorted = "+s+"\nNot Normalized = "+n+"\nWeightCounts = ["+l+"]\nNumber of bones = "+h+"\nBad Bone Indices = "+d;return{skinned:!0,valid:0===r&&0===n&&0===d,report:f}}_checkDelayState(){let e=this.getScene();return this._geometry?this._geometry.load(e):4===this.delayLoadState&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);let t=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return(async()=>{try{let i=await e._loadDelayedFileAsync(this.delayLoadingFile,t,!0);for(let e of(i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this),this.instances))e.refreshBoundingInfo(),e._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)}catch(t){e.removePendingData(this),e.isDisposed||eA.Logger.Error(`Unable to delay load geometry data for mesh "${this.name}" from "${this.delayLoadingFile}": ${t}`)}})(),this}isInFrustum(e){return 2!==this.delayLoadState&&!!super.isInFrustum(e)&&(this._checkDelayState(),!0)}setMaterialById(e){let t,i=this.getScene().materials;for(t=i.length-1;t>-1;t--)if(i[t].id===e)return this.material=i[t],this;let s=this.getScene().multiMaterials;for(t=s.length-1;t>-1;t--)if(s[t].id===e){this.material=s[t];break}return this}getAnimatables(){let e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){let t;if(!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind))return this;let i=this.subMeshes.splice(0);this._resetPointsArrayCache();let s=this.getVerticesData(ev.VertexBuffer.PositionKind),r=ey.Vector3.Zero();for(t=0;t<s.length;t+=3)ey.Vector3.TransformCoordinatesFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).toArray(s,t);if(this.setVerticesData(ev.VertexBuffer.PositionKind,s,this.getVertexBuffer(ev.VertexBuffer.PositionKind).isUpdatable()),this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)){for(s=this.getVerticesData(ev.VertexBuffer.NormalKind),t=0;t<s.length;t+=3)ey.Vector3.TransformNormalFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).normalize().toArray(s,t);this.setVerticesData(ev.VertexBuffer.NormalKind,s,this.getVertexBuffer(ev.VertexBuffer.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(ev.VertexBuffer.TangentKind)){for(s=this.getVerticesData(ev.VertexBuffer.TangentKind),t=0;t<s.length;t+=4)ey.Vector3.TransformNormalFromFloatsToRef(s[t],s[t+1],s[t+2],e,r).normalize().toArray(s,t);this.setVerticesData(ev.VertexBuffer.TangentKind,s,this.getVertexBuffer(ev.VertexBuffer.TangentKind).isUpdatable())}return 0>e.determinant()&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=i,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){return!!this._geometry&&this._geometry._generatePointsArray()}clone(e="",t=null,i,s=!0){return t&&void 0===t._addToSceneRootNodes?(ta.source=this,ta.doNotCloneChildren=t.doNotCloneChildren,ta.clonePhysicsImpostor=t.clonePhysicsImpostor,ta.cloneThinInstances=t.cloneThinInstances,new tn(e,this.getScene(),ta)):new tn(e,this.getScene(),t,this,i,s)}dispose(e,t=!1){this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);let i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(let e in i.meshMap){let t=i.meshMap[e];t&&(t._internalMeshDataInfo._source=null,i.meshMap[e]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else for(let e of this.getScene().meshes)e._internalMeshDataInfo&&e._internalMeshDataInfo._source&&e._internalMeshDataInfo._source===this&&(e._internalMeshDataInfo._source=null);i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,s,r,a,n=!1,o){let l=this.getScene(),h=e=>{let o=e.width,l=e.height,h=this.getEngine().createCanvas(o,l).getContext("2d");h.drawImage(e,0,0);let c=h.getImageData(0,0,o,l).data;this.applyDisplacementMapFromBuffer(c,o,l,t,i,r,a,n),s&&s(this)};return(0,ed.LoadImage)(e,h,o||(()=>{}),l.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,r,a,n,o=!1){if(!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)||!this.isVerticesDataPresent(ev.VertexBuffer.UVKind))return eA.Logger.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;let l=this.getVerticesData(ev.VertexBuffer.PositionKind,!0,!0),h=this.getVerticesData(ev.VertexBuffer.NormalKind),c=this.getVerticesData(ev.VertexBuffer.UVKind),u=ey.Vector3.Zero(),d=ey.Vector3.Zero(),f=ey.Vector2.Zero();a=a||ey.Vector2.Zero(),n=n||new ey.Vector2(1,1);for(let o=0;o<l.length;o+=3){ey.Vector3.FromArrayToRef(l,o,u),ey.Vector3.FromArrayToRef(h,o,d),ey.Vector2.FromArrayToRef(c,o/3*2,f);let g=((Math.abs(f.x*n.x+a.x%1)*(t-1)%t|0)+(Math.abs(f.y*n.y+a.y%1)*(i-1)%i|0)*t)*4,_=.3*(e[g]/255)+.59*(e[g+1]/255)+.11*(e[g+2]/255);d.normalize(),d.scaleInPlace(s+(r-s)*_),(u=u.add(d)).toArray(l,o)}return eR.ComputeNormals(l,this.getIndices(),h),o?(this.setVerticesData(ev.VertexBuffer.PositionKind,l),this.setVerticesData(ev.VertexBuffer.NormalKind,h),this.setVerticesData(ev.VertexBuffer.UVKind,c)):(this.updateVerticesData(ev.VertexBuffer.PositionKind,l),this.updateVerticesData(ev.VertexBuffer.NormalKind,h)),this}_getFlattenedNormals(e,t){let i=new Float32Array(3*e.length),s=0,r=this.sideOrientation===+!!this._scene.useRightHandedSystem;for(let a=0;a<e.length;a+=3){let n=ey.Vector3.FromArray(t,3*e[a]),o=ey.Vector3.FromArray(t,3*e[a+1]),l=ey.Vector3.FromArray(t,3*e[a+2]),h=n.subtract(o),c=l.subtract(o),u=ey.Vector3.Normalize(ey.Vector3.Cross(h,c));r&&u.scaleInPlace(-1);for(let e=0;e<3;e++)i[s++]=u.x,i[s++]=u.y,i[s++]=u.z}return i}_convertToUnIndexedMesh(e=!1){let t=this.getVerticesDataKinds().filter(e=>!this.getVertexBuffer(e)?.getIsInstanced()),i=this.getIndices(!1,!0),s={},r=(e,t)=>{let s=new Float32Array(i.length*t),r=0;for(let a=0;a<i.length;a++)for(let n=0;n<t;n++)s[r++]=e[i[a]*t+n];return s},a=this.getBoundingInfo(),n=this.geometry?this.subMeshes.slice(0):[];for(let e of t)s[e]=this.getVerticesData(e);for(let a of t){let t=this.getVertexBuffer(a),n=t.getSize();if(e&&a===ev.VertexBuffer.NormalKind){let e=this._getFlattenedNormals(i,s[ev.VertexBuffer.PositionKind]);this.setVerticesData(ev.VertexBuffer.NormalKind,e,t.isUpdatable(),n)}else this.setVerticesData(a,r(s[a],n),t.isUpdatable(),n)}if(this.morphTargetManager){for(let t=0;t<this.morphTargetManager.numTargets;t++){let s=this.morphTargetManager.getTarget(t),a=s.getPositions();s.setPositions(r(a,3));let n=s.getNormals();n&&s.setNormals(e?this._getFlattenedNormals(i,a):r(n,3));let o=s.getTangents();o&&s.setTangents(r(o,3));let l=s.getUVs();l&&s.setUVs(r(l,2));let h=s.getColors();h&&s.setColors(r(h,4))}this.morphTargetManager.synchronize()}for(let e=0;e<i.length;e++)i[e]=e;for(let e of(this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes(),n)){let t=e.getBoundingInfo();eC.SubMesh.AddToMesh(e.materialIndex,e.indexStart,e.indexCount,e.indexStart,e.indexCount,this).setBoundingInfo(t)}return this.setBoundingInfo(a),this.synchronizeInstances(),this}convertToFlatShadedMesh(){return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){return this._convertToUnIndexedMesh()}flipFaces(e=!1){let t,i=eR.ExtractFromMesh(this);if(e&&this.isVerticesDataPresent(ev.VertexBuffer.NormalKind)&&i.normals){for(t=0;t<i.normals.length;t++)i.normals[t]*=-1;this.setVerticesData(ev.VertexBuffer.NormalKind,i.normals,this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind))}if(i.indices){let e;for(t=0;t<i.indices.length;t+=3)e=i.indices[t+1],i.indices[t+1]=i.indices[t+2],i.indices[t+2]=e;this.setIndices(i.indices,null,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind),!0)}return this}increaseVertices(e=1){let t=eR.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,s=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,r=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,a=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(i&&s){let n,o,l,h,c;t.indices=i,t.positions=s,r&&(t.uvs=r),a&&(t.normals=a);let u=e+1,d=[];for(let e=0;e<u+1;e++)d[e]=[];let f=new ey.Vector3(0,0,0),g=new ey.Vector3(0,0,0),_=new ey.Vector2(0,0),m=[],p=[],M=[],I=s.length;r&&(h=r.length),a&&(c=a.length);for(let e=0;e<i.length;e+=3){p[0]=i[e],p[1]=i[e+1],p[2]=i[e+2];for(let e=0;e<3;e++)if(n=p[e],o=p[(e+1)%3],void 0===M[n]&&void 0===M[o]?(M[n]=[],M[o]=[]):(void 0===M[n]&&(M[n]=[]),void 0===M[o]&&(M[o]=[])),void 0===M[n][o]&&void 0===M[o][n]){M[n][o]=[],f.x=(s[3*o]-s[3*n])/u,f.y=(s[3*o+1]-s[3*n+1])/u,f.z=(s[3*o+2]-s[3*n+2])/u,a&&(g.x=(a[3*o]-a[3*n])/u,g.y=(a[3*o+1]-a[3*n+1])/u,g.z=(a[3*o+2]-a[3*n+2])/u),r&&(_.x=(r[2*o]-r[2*n])/u,_.y=(r[2*o+1]-r[2*n+1])/u),M[n][o].push(n);for(let e=1;e<u;e++)M[n][o].push(s.length/3),s[I++]=s[3*n]+e*f.x,s[I++]=s[3*n+1]+e*f.y,s[I++]=s[3*n+2]+e*f.z,a&&(a[c++]=a[3*n]+e*g.x,a[c++]=a[3*n+1]+e*g.y,a[c++]=a[3*n+2]+e*g.z),r&&(r[h++]=r[2*n]+e*_.x,r[h++]=r[2*n+1]+e*_.y);M[n][o].push(o),M[o][n]=[],l=M[n][o].length;for(let e=0;e<l;e++)M[o][n][e]=M[n][o][l-1-e]}d[0][0]=i[e],d[1][0]=M[i[e]][i[e+1]][1],d[1][1]=M[i[e]][i[e+2]][1];for(let t=2;t<u;t++){d[t][0]=M[i[e]][i[e+1]][t],d[t][t]=M[i[e]][i[e+2]][t],f.x=(s[3*d[t][t]]-s[3*d[t][0]])/t,f.y=(s[3*d[t][t]+1]-s[3*d[t][0]+1])/t,f.z=(s[3*d[t][t]+2]-s[3*d[t][0]+2])/t,a&&(g.x=(a[3*d[t][t]]-a[3*d[t][0]])/t,g.y=(a[3*d[t][t]+1]-a[3*d[t][0]+1])/t,g.z=(a[3*d[t][t]+2]-a[3*d[t][0]+2])/t),r&&(_.x=(r[2*d[t][t]]-r[2*d[t][0]])/t,_.y=(r[2*d[t][t]+1]-r[2*d[t][0]+1])/t);for(let e=1;e<t;e++)d[t][e]=s.length/3,s[I++]=s[3*d[t][0]]+e*f.x,s[I++]=s[3*d[t][0]+1]+e*f.y,s[I++]=s[3*d[t][0]+2]+e*f.z,a&&(a[c++]=a[3*d[t][0]]+e*g.x,a[c++]=a[3*d[t][0]+1]+e*g.y,a[c++]=a[3*d[t][0]+2]+e*g.z),r&&(r[h++]=r[2*d[t][0]]+e*_.x,r[h++]=r[2*d[t][0]+1]+e*_.y)}d[u]=M[i[e+1]][i[e+2]],m.push(d[0][0],d[1][0],d[1][1]);for(let e=1;e<u;e++){let t;for(t=0;t<e;t++)m.push(d[e][t],d[e+1][t],d[e+1][t+1]),m.push(d[e][t],d[e+1][t+1],d[e][t+1]);m.push(d[e][t],d[e+1][t],d[e+1][t+1])}}t.indices=m,t.applyToMesh(this,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind))}else eA.Logger.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions")}forceSharedVertices(){let e=eR.ExtractFromMesh(this),t=e.uvs,i=e.indices,s=e.positions,r=e.colors,a=e.matricesIndices,n=e.matricesWeights,o=e.matricesIndicesExtra,l=e.matricesWeightsExtra;if(void 0===i||void 0===s||null===i||null===s)eA.Logger.Warn("VertexData contains empty entries");else{let h,c,u,d=[],f=[],g=[],_=[],m=[],p=[],M=[],I=[],x=0,b={};for(let e=0;e<i.length;e+=3){u=[i[e],i[e+1],i[e+2]],h=[];for(let e=0;e<3;e++){h[e]="";for(let t=0;t<3;t++)1e-8>Math.abs(s[3*u[e]+t])&&(s[3*u[e]+t]=0),h[e]+=s[3*u[e]+t]+"|"}if(h[0]!=h[1]&&h[0]!=h[2]&&h[1]!=h[2])for(let e=0;e<3;e++){if(void 0===(c=b[h[e]])){b[h[e]]=x,c=x++;for(let t=0;t<3;t++)d.push(s[3*u[e]+t]);if(null!=r)for(let t=0;t<4;t++)_.push(r[4*u[e]+t]);if(null!=t)for(let i=0;i<2;i++)g.push(t[2*u[e]+i]);if(null!=a)for(let t=0;t<4;t++)m.push(a[4*u[e]+t]);if(null!=n)for(let t=0;t<4;t++)p.push(n[4*u[e]+t]);if(null!=o)for(let t=0;t<4;t++)M.push(o[4*u[e]+t]);if(null!=l)for(let t=0;t<4;t++)I.push(l[4*u[e]+t])}f.push(c)}}let y=[];eR.ComputeNormals(d,f,y),e.positions=d,e.indices=f,e.normals=y,null!=t&&(e.uvs=g),null!=r&&(e.colors=_),null!=a&&(e.matricesIndices=m),null!=n&&(e.matricesWeights=p),null!=o&&(e.matricesIndicesExtra=M),null!=n&&(e.matricesWeightsExtra=I),e.applyToMesh(this,this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind))}}static _instancedMeshFactory(e,t){throw(0,eS._WarnImport)("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){throw(0,eS._WarnImport)("PhysicsImpostor")}createInstance(e){let t=tn._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){for(let e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this}optimizeIndices(e){let t=this.getIndices(),i=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!i||!t)return this;let s=[];for(let e=0;e<i.length;e+=3)s.push(ey.Vector3.FromArray(i,e));let r=[];return eu.AsyncLoop.SyncAsyncForLoop(s.length,40,e=>{let t=s.length-1-e,i=s[t];for(let e=0;e<t;++e){let a=s[e];if(i.equals(a)){r[t]=e;break}}},()=>{for(let e=0;e<t.length;++e)t[e]=r[t[e]]||t[e];let i=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=i,e&&e(this)}),this}serialize(e={}){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),eg.Tags&&eg.Tags.HasTags(this)&&(e.tags=eg.Tags.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this._isWorldMatrixFrozen&&(e.freezeWorldMatrix=!0),this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;let t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let t=0;t<this.subMeshes.length;t++){let i=this.subMeshes[t];e.subMeshes.push({materialIndex:i.materialIndex,verticesStart:i.verticesStart,verticesCount:i.verticesCount,indexStart:i.indexStart,indexCount:i.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.skeletonUniqueId=this.skeleton.uniqueId,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(e7.SceneComponentConstants.NAME_PHYSICSENGINE)){let t=this.getPhysicsImpostor?.();t&&(e.physicsMass=t.getParam("mass"),e.physicsFriction=t.getParam("friction"),e.physicsRestitution=t.getParam("mass"),e.physicsImpostor=t.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let t=0;t<this.instances.length;t++){let i=this.instances[t];if(i.doNotSerialize)continue;let s={name:i.name,id:i.id,isEnabled:i.isEnabled(!1),isVisible:i.isVisible,isPickable:i.isPickable,checkCollisions:i.checkCollisions,position:i.position.asArray(),scaling:i.scaling.asArray()};if(i.parent&&i.parent._serializeAsParent(s),i.rotationQuaternion?s.rotationQuaternion=i.rotationQuaternion.asArray():i.rotation&&(s.rotation=i.rotation.asArray()),this.getScene()._getComponent(e7.SceneComponentConstants.NAME_PHYSICSENGINE)){let e=i.getPhysicsImpostor?.();e&&(s.physicsMass=e.getParam("mass"),s.physicsFriction=e.getParam("friction"),s.physicsRestitution=e.getParam("mass"),s.physicsImpostor=e.type)}i.metadata&&(s.metadata=i.metadata),i.actionManager&&(s.actions=i.actionManager.serialize(i.name)),e.instances.push(s),eK.SerializationHelper.AppendSerializedAnimations(i,s),s.ranges=i.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){let t={data:{},sizes:{},strides:{}};for(let e in this._userThinInstanceBuffersStorage.data)t.data[e]=Array.from(this._userThinInstanceBuffersStorage.data[e]),t.sizes[e]=this._userThinInstanceBuffersStorage.sizes[e],t.strides[e]=this._userThinInstanceBuffersStorage.strides[e];e.thinInstances.userThinInstance=t}return eK.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();let e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices()){eA.Logger.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),this.morphTargetManager=null;return}if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){let i=e.getActiveTarget(t),s=i.getPositions();if(!s)return void eA.Logger.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(ev.VertexBuffer.PositionKind+t,s,!1,3);let r=i.getNormals();r&&this.geometry.setVerticesData(ev.VertexBuffer.NormalKind+t,r,!1,3);let a=i.getTangents();a&&this.geometry.setVerticesData(ev.VertexBuffer.TangentKind+t,a,!1,3);let n=i.getUVs();n&&this.geometry.setVerticesData(ev.VertexBuffer.UVKind+"_"+t,n,!1,2);let o=i.getUV2s();o&&this.geometry.setVerticesData(ev.VertexBuffer.UV2Kind+"_"+t,o,!1,2);let l=i.getColors();l&&this.geometry.setVerticesData(ev.VertexBuffer.ColorKind+t,l,!1,4)}}else{let e=0;for(;this.geometry.isVerticesDataPresent(ev.VertexBuffer.PositionKind+e);)this.geometry.removeVerticesData(ev.VertexBuffer.PositionKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.NormalKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.NormalKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.TangentKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.TangentKind+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.UVKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.UVKind+"_"+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.UV2Kind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.UV2Kind+"_"+e),this.geometry.isVerticesDataPresent(ev.VertexBuffer.ColorKind+e)&&this.geometry.removeVerticesData(ev.VertexBuffer.ColorKind+e),e++}}static Parse(e,t,i){let s,r=!1;if(e.type&&"LinesMesh"===e.type?s=tn._LinesMeshParser(e,t):e.type&&"GroundMesh"===e.type?s=tn._GroundMeshParser(e,t):e.type&&"GoldbergMesh"===e.type?s=tn._GoldbergMeshParser(e,t):e.type&&"GreasedLineMesh"===e.type?s=tn._GreasedLineMeshParser(e,t):e.type&&"TrailMesh"===e.type?s=tn._TrailMeshParser(e,t):e.type&&"GaussianSplattingMesh"===e.type?(s=e._isCompound?tn._GaussianSplattingCompoundMeshParser(e,t):tn._GaussianSplattingMeshParser(e,t),r=!0):e.type&&"GaussianSplattingPartProxyMesh"===e.type?(s=tn._GaussianSplattingPartProxyMeshParser(e,t),r=!0):s=new tn(e.name,t),s.id=e.id,s._waitingParsedUniqueId=e.uniqueId,eg.Tags&&eg.Tags.AddTagsTo(s,e.tags),s.position=ey.Vector3.FromArray(e.position),void 0!==e.metadata&&(s.metadata=e.metadata),e.rotationQuaternion?s.rotationQuaternion=ey.Quaternion.FromArray(e.rotationQuaternion):e.rotation&&(s.rotation=ey.Vector3.FromArray(e.rotation)),s.scaling=ey.Vector3.FromArray(e.scaling),e.localMatrix?s.setPreTransformMatrix(ey.Matrix.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(ey.Matrix.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s.isVisible=e.isVisible,s.infiniteDistance=e.infiniteDistance,s.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,s.showBoundingBox=e.showBoundingBox,s.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,void 0!==e.applyFog&&(s.applyFog=e.applyFog),void 0!==e.pickable&&(s.isPickable=e.pickable),void 0!==e.alphaIndex&&(s.alphaIndex=e.alphaIndex),s.receiveShadows=e.receiveShadows,void 0!==e.billboardMode&&(s.billboardMode=e.billboardMode),void 0!==e.visibility&&(s.visibility=e.visibility),s.checkCollisions=e.checkCollisions,s.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(s.ellipsoid=ey.Vector3.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(s.ellipsoidOffset=ey.Vector3.FromArray(e.ellipsoidOffset)),null!=e.overrideMaterialSideOrientation&&(s.sideOrientation=e.overrideMaterialSideOrientation),void 0!==e.sideOrientation&&(s.sideOrientation=e.sideOrientation),void 0!==e.isBlocker&&(s.isBlocker=e.isBlocker),s._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(s._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),void 0!==e.parentId&&(s._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),void 0!==e.actions&&(s._waitingData.actions=e.actions),void 0!==e.overlayAlpha&&(s.overlayAlpha=e.overlayAlpha),void 0!==e.overlayColor&&(s.overlayColor=eD.Color3.FromArray(e.overlayColor)),void 0!==e.renderOverlay&&(s.renderOverlay=e.renderOverlay),s.isUnIndexed=!!e.isUnIndexed,s.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s.buildBoundingInfo(ey.Vector3.FromArray(e.boundingBoxMinimum),ey.Vector3.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(s._binaryInfo=e._binaryInfo),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(ev.VertexBuffer.UVKind),e.hasUVs2&&s._delayInfo.push(ev.VertexBuffer.UV2Kind),e.hasUVs3&&s._delayInfo.push(ev.VertexBuffer.UV3Kind),e.hasUVs4&&s._delayInfo.push(ev.VertexBuffer.UV4Kind),e.hasUVs5&&s._delayInfo.push(ev.VertexBuffer.UV5Kind),e.hasUVs6&&s._delayInfo.push(ev.VertexBuffer.UV6Kind),e.hasColors&&s._delayInfo.push(ev.VertexBuffer.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(ev.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(ev.VertexBuffer.MatricesWeightsKind),s._delayLoadingFunction=eN._ImportGeometry,eF.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&s._checkDelayState()):r||eN._ImportGeometry(e,s),e.materialUniqueId?s._waitingMaterialId=e.materialUniqueId:e.materialId&&(s._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),void 0!==e.skeletonId&&null!==e.skeletonId&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),s._waitingSkeletonId=e.skeletonId,e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),void 0!==e.skeletonUniqueId&&null!==e.skeletonUniqueId&&(s._waitingSkeletonUniqueId=e.skeletonUniqueId),e.animations){for(let t=0;t<e.animations.length;t++){let i=e.animations[t],r=(0,eY.GetClass)("BABYLON.Animation");r&&s.animations.push(r.Parse(i))}eV.Node.ParseAnimationRanges(s,e,t)}if(e.autoAnimate&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?s.layerMask=Math.abs(parseInt(e.layerMask)):s.layerMask=0xfffffff,e.physicsImpostor&&(s.physicsImpostor=tn._PhysicsImpostorParser(t,s,e)),e.lodMeshIds&&(s._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let i=0;i<e.instances.length;i++){let r=e.instances[i],a=s.createInstance(r.name);if(r.id&&(a.id=r.id),eg.Tags&&(r.tags?eg.Tags.AddTagsTo(a,r.tags):eg.Tags.AddTagsTo(a,e.tags)),a.position=ey.Vector3.FromArray(r.position),void 0!==r.metadata&&(a.metadata=r.metadata),void 0!==r.parentId&&(a._waitingParentId=r.parentId),void 0!==r.parentInstanceIndex&&(a._waitingParentInstanceIndex=r.parentInstanceIndex),void 0!==r.isEnabled&&null!==r.isEnabled&&a.setEnabled(r.isEnabled),void 0!==r.isVisible&&null!==r.isVisible&&(a.isVisible=r.isVisible),void 0!==r.isPickable&&null!==r.isPickable&&(a.isPickable=r.isPickable),r.rotationQuaternion?a.rotationQuaternion=ey.Quaternion.FromArray(r.rotationQuaternion):r.rotation&&(a.rotation=ey.Vector3.FromArray(r.rotation)),a.scaling=ey.Vector3.FromArray(r.scaling),void 0!=r.checkCollisions&&null!=r.checkCollisions&&(a.checkCollisions=r.checkCollisions),void 0!=r.pickable&&null!=r.pickable&&(a.isPickable=r.pickable),void 0!=r.showBoundingBox&&null!=r.showBoundingBox&&(a.showBoundingBox=r.showBoundingBox),void 0!=r.showSubMeshesBoundingBox&&null!=r.showSubMeshesBoundingBox&&(a.showSubMeshesBoundingBox=r.showSubMeshesBoundingBox),void 0!=r.alphaIndex&&null!=r.showSubMeshesBoundingBox&&(a.alphaIndex=r.alphaIndex),r.physicsImpostor&&(a.physicsImpostor=tn._PhysicsImpostorParser(t,a,r)),void 0!==r.actions&&(a._waitingData.actions=r.actions),r.animations){for(let e=0;e<r.animations.length;e++){let t=r.animations[e],i=(0,eY.GetClass)("BABYLON.Animation");i&&a.animations.push(i.Parse(t))}eV.Node.ParseAnimationRanges(a,r,t),r.autoAnimate&&t.beginAnimation(a,r.autoAnimateFrom,r.autoAnimateTo,r.autoAnimateLoop,r.autoAnimateSpeed||1)}}if(e.thinInstances){let t=e.thinInstances;if(s.thinInstanceEnablePicking=!!t.enablePicking,t.matrixData?(s.thinInstanceSetBuffer("matrix",new Float32Array(t.matrixData),16,!1),s._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,s._thinInstanceDataStorage.instancesCount=t.instancesCount):s._thinInstanceDataStorage.matrixBufferSize=t.matrixBufferSize,e.thinInstances.userThinInstance){let t=e.thinInstances.userThinInstance;for(let e in t.data)s.thinInstanceSetBuffer(e,new Float32Array(t.data[e]),t.strides[e],!1),s._userThinInstanceBuffersStorage.sizes[e]=t.sizes[e]}}return s}setPositionsForCPUSkinning(){let e=this._internalMeshDataInfo;if(!e._sourcePositions){let t=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(ev.VertexBuffer.PositionKind)||this.setVerticesData(ev.VertexBuffer.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){let e=this._internalMeshDataInfo;if(!e._sourceNormals){let t=this.getVerticesData(ev.VertexBuffer.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(ev.VertexBuffer.NormalKind)||this.setVerticesData(ev.VertexBuffer.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){let t;if(!this.geometry||this.geometry._softwareSkinningFrameId==this.getScene().getFrameId()||(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(ev.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(ev.VertexBuffer.MatricesIndicesKind)||!this.isVerticesDataPresent(ev.VertexBuffer.MatricesWeightsKind)))return this;let i=this.isVerticesDataPresent(ev.VertexBuffer.NormalKind),s=this._internalMeshDataInfo;if(!s._sourcePositions){let e=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=e}i&&!s._sourceNormals&&this.setNormalsForCPUSkinning();let r=this.getVerticesData(ev.VertexBuffer.PositionKind);if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r));let a=this.getVerticesData(ev.VertexBuffer.NormalKind);if(i){if(!a)return this;a instanceof Float32Array||(a=new Float32Array(a))}let n=this.getVerticesData(ev.VertexBuffer.MatricesIndicesKind),o=this.getVerticesData(ev.VertexBuffer.MatricesWeightsKind);if(!o||!n)return this;let l=this.numBoneInfluencers>4,h=l?this.getVerticesData(ev.VertexBuffer.MatricesIndicesExtraKind):null,c=l?this.getVerticesData(ev.VertexBuffer.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),d=ey.Vector3.Zero(),f=new ey.Matrix,g=new ey.Matrix,_=0;for(let e=0;e<r.length;e+=3,_+=4){let m;for(t=0;t<4;t++)(m=o[_+t])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*n[_+t]),m,g),f.addToSelf(g));if(l)for(t=0;t<4;t++)(m=c[_+t])>0&&(ey.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*h[_+t]),m,g),f.addToSelf(g));ey.Vector3.TransformCoordinatesFromFloatsToRef(s._sourcePositions[e],s._sourcePositions[e+1],s._sourcePositions[e+2],f,d),d.toArray(r,e),i&&(ey.Vector3.TransformNormalFromFloatsToRef(s._sourceNormals[e],s._sourceNormals[e+1],s._sourceNormals[e+2],f,d),d.toArray(a,e)),f.reset()}return this.updateVerticesData(ev.VertexBuffer.PositionKind,r),i&&this.updateVerticesData(ev.VertexBuffer.NormalKind,a),this}static MinMax(e){let t=null,i=null;for(let s of e){let e=s.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(e.minimumWorld),i.maximizeInPlace(e.maximumWorld)):(t=e.minimumWorld.clone(),i=e.maximumWorld.clone())}return t&&i?{min:t,max:i}:{min:ey.Vector3.Zero(),max:ey.Vector3.Zero()}}static Center(e){let t=e instanceof Array?tn.MinMax(e):e;return ey.Vector3.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,r,a){return eM(tn._MergeMeshesCoroutine(e,t,i,s,r,a,!1))}static async MergeMeshesAsync(e,t=!0,i,s,r,a){return await eI(tn._MergeMeshesCoroutine(e,t,i,s,r,a,!0),em())}static*_MergeMeshesCoroutine(e,t=!0,i,s,r,a,n){let o;if(0===(e=e.filter(Boolean)).length)return null;if(!i){let t=0;for(o=0;o<e.length;o++)if((t+=e[o].getTotalVertices())>=65536)return eA.Logger.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}let l=e[0];a&&(r=!1,e.sort((e,t)=>(e.material?.uniqueId??-1)-(t.material?.uniqueId??-1)));let h=[],c=[],u=[],d=e[0].sideOrientation;for(o=0;o<e.length;o++){let t=e[o];if(t.isAnInstance)return eA.Logger.Warn("Cannot merge instance meshes."),null;if(d!==t.sideOrientation)return eA.Logger.Warn("Cannot merge meshes with different sideOrientation values."),null;if(r||a){let e=u.reduce((e,t)=>Math.max(e,t.start+t.count),0);if(a)if(t.material){let i=t.material;if(i instanceof e5){for(let e=0;e<i.subMaterials.length;e++)0>h.indexOf(i.subMaterials[e])&&h.push(i.subMaterials[e]);for(let s=0;s<t.subMeshes.length;s++)c.push(h.indexOf(i.subMaterials[t.subMeshes[s].materialIndex])),u.push({start:e+t.subMeshes[s].indexStart,count:t.subMeshes[s].indexCount})}else{0>h.indexOf(i)&&h.push(i);for(let s=0;s<t.subMeshes.length;s++)c.push(h.indexOf(i)),u.push({start:e+t.subMeshes[s].indexStart,count:t.subMeshes[s].indexCount})}}else for(let i=0;i<t.subMeshes.length;i++)c.push(0),u.push({start:e+t.subMeshes[i].indexStart,count:t.subMeshes[i].indexCount});else u.push({start:e,count:t.getTotalIndices()})}}if(a&&u.length>1){let e=0;for(let t=1;t<u.length;t++){let i=u[e],s=u[t];c[t]===c[e]&&i.start+i.count===s.start?i.count+=s.count:(u[++e]=s,c[e]=c[t])}u.length=e+1,c.length=e+1}let f=e=>{let t=e.computeWorldMatrix(!0);return{vertexData:eR.ExtractFromMesh(e,!1,!1),transform:t}},{vertexData:g,transform:_}=f(e[0]);n&&(yield);let m=Array(e.length-1);for(let t=1;t<e.length;t++)m[t-1]=f(e[t]),n&&(yield);let p=g._mergeCoroutine(_,m,i,n,!t),M=p.next();for(;!M.done;)n&&(yield),M=p.next();let I=M.value;s||(s=new tn(l.name+"_merged",l.getScene()));let x=I._applyToCoroutine(s,void 0,n),b=x.next();for(;!b.done;)n&&(yield),b=x.next();if(s.checkCollisions=l.checkCollisions,s.sideOrientation=l.sideOrientation,t)for(o=0;o<e.length;o++)e[o].dispose();if(r||a){for(s.releaseSubMeshes(),o=0;o<u.length;)eC.SubMesh.CreateFromIndices(0,u[o].start,u[o].count,s,void 0,!1),o++;for(let e of s.subMeshes)e.refreshBoundingInfo();s.computeWorldMatrix(!0)}if(a){let e=new e5(l.name+"_merged",l.getScene());e.subMaterials=h;for(let e=0;e<s.subMeshes.length;e++)s.subMeshes[e].materialIndex=c[e];s.material=e}else s.material=l.material;return s}addInstance(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){let t=e._indexInSourceMeshInstanceArray;if(-1!=t){if(t!==this.instances.length-1){let e=this.instances[this.instances.length-1];this.instances[t]=e,e._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){return this._scene.useRightHandedSystem&&this.sideOrientation===e2.Material.CounterClockWiseSideOrientation}_getRenderingFillMode(e){let t=this.getScene();return t.forcePointsCloud?e2.Material.PointFillMode:t.forceWireframe?e2.Material.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){return this.setMaterialById(e)}static CreateRibbon(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,s){throw Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,s,r,a,n,o){throw Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,s,r,a,n,o){throw Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,s,r,a,n,o,l,h,c,u){throw Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,s,r,a,n){throw Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,s,r){throw Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,s,r,a,n,o,l){throw Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,s,r,a,n,o,l,h,c){throw Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,s,r,a,n,o,l,h){throw Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){throw Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){throw Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,s,r,a){throw Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){throw Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){throw Error("Import MeshBuilder to populate this function")}}tn.FRONTSIDE=eR.FRONTSIDE,tn.BACKSIDE=eR.BACKSIDE,tn.DOUBLESIDE=eR.DOUBLESIDE,tn.DEFAULTSIDE=eR.DEFAULTSIDE,tn.NO_CAP=0,tn.CAP_START=1,tn.CAP_END=2,tn.CAP_ALL=3,tn.NO_FLIP=0,tn.FLIP_TILE=1,tn.ROTATE_TILE=2,tn.FLIP_ROW=3,tn.ROTATE_ROW=4,tn.FLIP_N_ROTATE_TILE=5,tn.FLIP_N_ROTATE_ROW=6,tn.CENTER=0,tn.LEFT=1,tn.RIGHT=2,tn.TOP=3,tn.BOTTOM=4,tn.INSTANCEDMESH_SORT_TRANSPARENT=!1,tn._GroundMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GroundMesh")},tn._GoldbergMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GoldbergMesh")},tn._LinesMeshParser=(e,t)=>{throw(0,eS._WarnImport)("LinesMesh")},tn._GreasedLineMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GreasedLineMesh")},tn._GreasedLineRibbonMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GreasedLineRibbonMesh")},tn._TrailMeshParser=(e,t)=>{throw(0,eS._WarnImport)("TrailMesh")},tn._GaussianSplattingMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingMesh")},tn._GaussianSplattingPartProxyMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingPartProxyMesh")},tn._GaussianSplattingCompoundMeshParser=(e,t)=>{throw(0,eS._WarnImport)("GaussianSplattingCompoundMesh")};let to=!1;(Y=tn.prototype).registerInstancedBuffer??(Y.registerInstancedBuffer=(0,eS._MissingSideEffect)("Mesh","registerInstancedBuffer")),(X=tn.prototype).simplify??(X.simplify=(0,eS._MissingSideEffect)("Mesh","simplify")),($=tn.prototype).thinInstanceAdd??($.thinInstanceAdd=(0,eS._MissingSideEffect)("Mesh","thinInstanceAdd")),(J=tn.prototype).thinInstanceAddSelf??(J.thinInstanceAddSelf=(0,eS._MissingSideEffect)("Mesh","thinInstanceAddSelf")),(ee=tn.prototype).thinInstanceRegisterAttribute??(ee.thinInstanceRegisterAttribute=(0,eS._MissingSideEffect)("Mesh","thinInstanceRegisterAttribute")),(et=tn.prototype).thinInstanceSetMatrixAt??(et.thinInstanceSetMatrixAt=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetMatrixAt")),(ei=tn.prototype).thinInstanceSetAttributeAt??(ei.thinInstanceSetAttributeAt=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetAttributeAt")),(es=tn.prototype).thinInstanceSetBuffer??(es.thinInstanceSetBuffer=(0,eS._MissingSideEffect)("Mesh","thinInstanceSetBuffer")),(er=tn.prototype).thinInstanceGetWorldMatrices??(er.thinInstanceGetWorldMatrices=(0,eS._MissingSideEffect)("Mesh","thinInstanceGetWorldMatrices")),(ea=tn.prototype).thinInstanceBufferUpdated??(ea.thinInstanceBufferUpdated=(0,eS._MissingSideEffect)("Mesh","thinInstanceBufferUpdated")),(en=tn.prototype).thinInstancePartialBufferUpdate??(en.thinInstancePartialBufferUpdate=(0,eS._MissingSideEffect)("Mesh","thinInstancePartialBufferUpdate")),(eo=tn.prototype).thinInstanceRefreshBoundingInfo??(eo.thinInstanceRefreshBoundingInfo=(0,eS._MissingSideEffect)("Mesh","thinInstanceRefreshBoundingInfo")),(el=tn.prototype).getEmittedParticleSystems??(el.getEmittedParticleSystems=(0,eS._MissingSideEffect)("Mesh","getEmittedParticleSystems")),(eh=tn.prototype).getHierarchyEmittedParticleSystems??(eh.getHierarchyEmittedParticleSystems=(0,eS._MissingSideEffect)("Mesh","getHierarchyEmittedParticleSystems")),Object.getOwnPropertyDescriptor(tn.prototype,"edgesShareWithInstances")||Object.defineProperty(tn.prototype,"edgesShareWithInstances",(0,eS._MissingSideEffectProperty)("Mesh","edgesShareWithInstances")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceEnablePicking")||Object.defineProperty(tn.prototype,"thinInstanceEnablePicking",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceEnablePicking")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation")||Object.defineProperty(tn.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceAllowAutomaticStaticBufferRecreation")),Object.getOwnPropertyDescriptor(tn.prototype,"thinInstanceCount")||Object.defineProperty(tn.prototype,"thinInstanceCount",(0,eS._MissingSideEffectProperty)("Mesh","thinInstanceCount")),e.s(["Mesh",0,tn,"RegisterMesh",0,function(){to||(to=!0,(0,eY.RegisterClass)("BABYLON.Mesh",tn))},"_CreationDataStorage",0,class{},"_InstancesBatch",0,ti],55206)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56145,t=>{"use strict";var e=t.i(44744),r=t.i(85789),i=t.i(63615),s=t.i(5554);class a{get isDisposed(){return this._isDisposed}constructor(t,r,i,a=0,f=!1,n=!1,u=!1,o,h){this._isAlreadyOwned=!1,this._isDisposed=!1,(0,s.RegisterEngineDynamicBuffer)(),t&&t.getScene?this._engine=t.getScene().getEngine():this._engine=t,this._updatable=i,this._instanced=n,this._divisor=o||1,this._label=h,r instanceof e.DataBuffer?(this._data=null,this._buffer=r):(this._data=r,this._buffer=null),this.byteStride=u?a:a*Float32Array.BYTES_PER_ELEMENT,f||this.create()}createVertexBuffer(t,e,r,i,s,a=!1,n){let u=a?e:e*Float32Array.BYTES_PER_ELEMENT,o=i?a?i:i*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new f(this._engine,this,t,this._updatable,!0,o,void 0===s?this._instanced:s,u,r,void 0,void 0,!0,this._divisor||n)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(t=null){!t&&this._buffer||(t=t||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t),this._data=t):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(t,this._label),this._data=t):this._buffer=this._engine.createVertexBuffer(t,void 0,this._label))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else if(this._buffer){if(this._buffer.capacity>0)return void(this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label));r.Logger.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(t){this.create(t)}updateDirectly(t,e,r,i=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t,i?e:e*Float32Array.BYTES_PER_ELEMENT,r?r*this.byteStride:void 0),0===e&&void 0===r?this._data=t:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class f{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(t){let e=0!=t;this._instanceDivisor=t,e!==this._instanced&&(this._instanced=e,this._computeHashCode())}get _maxVerticesCount(){let t=this.getData();return t?Array.isArray(t)?t.length/(this.byteStride/4)-this.byteOffset/4:(t.byteLength-this.byteOffset)/this.byteStride:0}constructor(t,e,r,s,o,h,_,d,E,c,l=!1,p=!1,m=1,T=!1){let A;if(this._isDisposed=!1,this.engine=t,"object"==typeof s&&null!==s?(A=s.updatable??!1,o=s.postponeInternalCreation,h=s.stride,_=s.instanced,d=s.offset,E=s.size,c=s.type,l=s.normalized??!1,p=s.useBytes??!1,m=s.divisor??1,T=s.takeBufferOwnership??!1,this._label=s.label):A=!!s,e instanceof a?(this._buffer=e,this._ownsBuffer=T):(this._buffer=new a(t,e,A,h,o,_,p,m,this._label),this._ownsBuffer=!0),this.uniqueId=f._Counter++,this._kind=r,void 0===c){const t=this.getData();this.type=t?u(t):f.FLOAT}else this.type=c;const R=(0,i.GetTypeByteLength)(this.type);p?(this._size=E||(h?h/R:n(r)),this.byteStride=h||this._buffer.byteStride||this._size*R,this.byteOffset=d||0):(this._size=E||h||n(r),this.byteStride=h?h*R:this._buffer.byteStride||this._size*R,this.byteOffset=(d||0)*R),this.normalized=l,this._instanced=void 0!==_&&_,this._instanceDivisor=_?m:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(t){switch(t){case f.BYTE:return 0;case f.UNSIGNED_BYTE:return 1;case f.SHORT:return 2;case f.UNSIGNED_SHORT:return 3;case f.INT:return 4;case f.UNSIGNED_INT:return 5;case f.FLOAT:return 6;case f.HALF_FLOAT:return 7;default:throw Error(`Invalid vertex buffer type '${t}'`)}}_computeHashCode(){this.hashCode=(0|f._GetTypeHashIndex(this.type))+(!!this.normalized<<3)+(this._size-1<<4)+(!!this._instanced<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(t,e){let r=this.getData();return r?(0,i.GetFloatData)(r,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,t,e):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/(0,i.GetTypeByteLength)(this.type)}getOffset(){return this.byteOffset/(0,i.GetTypeByteLength)(this.type)}getSize(t=!1){return t?this._size*(0,i.GetTypeByteLength)(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(t){this._buffer.create(t),this._alignBuffer()}update(t){this._buffer.update(t),this._alignBuffer()}updateDirectly(t,e,r=!1){this._buffer.updateDirectly(t,e,void 0,r),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(t,e){(0,i.EnumerateFloatValues)(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,t,this.normalized,(t,r)=>{for(let i=0;i<this._size;i++)e(t[i],r+i)})}_alignBuffer(){}}function n(t){switch(t){case f.UVKind:case f.UV2Kind:case f.UV3Kind:case f.UV4Kind:case f.UV5Kind:case f.UV6Kind:return 2;case f.NormalKind:case f.PositionKind:return 3;case f.ColorKind:case f.ColorInstanceKind:case f.MatricesIndicesKind:case f.MatricesIndicesExtraKind:case f.MatricesWeightsKind:case f.MatricesWeightsExtraKind:case f.TangentKind:return 4;default:throw Error("Invalid kind '"+t+"'")}}function u(t){if(t instanceof Int8Array)return f.BYTE;if(t instanceof Uint8Array)return f.UNSIGNED_BYTE;if(t instanceof Int16Array)return f.SHORT;if(t instanceof Uint16Array)return f.UNSIGNED_SHORT;if(t instanceof Int32Array)return f.INT;else if(t instanceof Uint32Array)return f.UNSIGNED_INT;else return f.FLOAT}function o(t){return(0,i.GetTypeByteLength)(t)}function h(t,e,r,s,a,f,n,u){(0,i.EnumerateFloatValues)(t,e,r,s,a,f,n,(t,e)=>{for(let r=0;r<s;r++)u(t[r],e+r)})}function _(t,e,r,s,a,f,n,u){return(0,i.GetFloatData)(t,e,r,s,a,f,n,u)}f._Counter=0,f.BYTE=5120,f.UNSIGNED_BYTE=5121,f.SHORT=5122,f.UNSIGNED_SHORT=5123,f.INT=5124,f.UNSIGNED_INT=5125,f.FLOAT=5126,f.HALF_FLOAT=5131,f.PositionKind="position",f.NormalKind="normal",f.TangentKind="tangent",f.UVKind="uv",f.UV2Kind="uv2",f.UV3Kind="uv3",f.UV4Kind="uv4",f.UV5Kind="uv5",f.UV6Kind="uv6",f.ColorKind="color",f.ColorInstanceKind="instanceColor",f.MatricesIndicesKind="matricesIndices",f.MatricesWeightsKind="matricesWeights",f.MatricesIndicesExtraKind="matricesIndicesExtra",f.MatricesWeightsExtraKind="matricesWeightsExtra";let d=!1;t.s(["Buffer",0,a,"RegisterVertexBuffer",0,function(){d||(d=!0,f.DeduceStride=n,f.GetDataType=u,f.GetTypeByteLength=o,f.ForEach=h,f.GetFloatData=_)},"VertexBuffer",0,f,"VertexBufferDeduceStride",0,n,"VertexBufferForEach",0,h,"VertexBufferGetTypeByteLength",0,o])},17972,t=>{"use strict";var e=t.i(80592),r=t.i(72003),i=t.i(49940),s=t.i(81127);let a=new r.Matrix,f=new r.Matrix,n=new r.Matrix,u={getScene:()=>void 0,eyeAtCamera:!0};function o(t,e,r){let i=r.asArray(),s=e.asArray();for(let t=0;t<16;t++)i[t]=s[t];return i[12]-=t.x,i[13]-=t.y,i[14]-=t.z,r.markAsUpdated(),r}function h(t,e,r){if(!u.eyeAtCamera)return(0,i.InvertMatrixToRef)(e,f),o(t,f,n),(0,i.InvertMatrixToRef)(n,r),r;let s=r.asArray(),a=e.asArray();for(let t=0;t<16;t++)s[t]=a[t];return s[12]=0,s[13]=0,s[14]=0,r.markAsUpdated(),r}function _(t,e,r,s){return(0,i.MultiplyMatricesToRef)(h(t,e,s),r,s),s}function d(t,e,r,s){return(0,i.InvertMatrixToRef)(r,f),(0,i.MultiplyMatricesToRef)(e,f,n),o(t,n,f),h(t,r,n),(0,i.MultiplyMatricesToRef)(f,n,s),s}function E(t,e,r,s,a,u){return(0,i.InvertMatrixToRef)(r,f),(0,i.MultiplyMatricesToRef)(e,f,n),o(t,n,f),_(t,s,a,n),(0,i.MultiplyMatricesToRef)(f,n,u),u}function c(t,e){let r=u.getScene();if(!r||a===e)return e;a.updateFlag=e.updateFlag;let i=r.floatingOriginOffset;switch(t){case"world":return o(i,e,a);case"view":return h(i,e,a);case"worldView":return d(i,e,r.getViewMatrix(),a);case"viewProjection":return _(i,r.getViewMatrix(),r.getProjectionMatrix(),a);case"worldViewProjection":return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),a);default:if(t.startsWith("u_")){let s=t.toLowerCase();if(s.startsWith("u_worldviewprojection"))return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),a);if(s.startsWith("u_viewprojection"))return _(i,r.getViewMatrix(),r.getProjectionMatrix(),a);if(s.startsWith("u_worldview"))return d(i,e,r.getViewMatrix(),a);if(s.startsWith("u_world"))return o(i,e,a);if(s.startsWith("u_view"))return h(i,e,a)}return e}}let l=s.UniformBuffer,p=e.Effect,m=l.prototype._updateMatrixForUniform,T=e.Effect.prototype.setMatrix;t.s(["FloatingOriginCurrentScene",0,u,"OverrideMatrixFunctions",0,function(){p.prototype._setMatrixOverride=T,p.prototype.setMatrix=function(t,e){return this._setMatrixOverride(t,c(t,e)),this},l.prototype._updateMatrixForUniformOverride=m,l.prototype._updateMatrixForUniform=function(t,e){this._updateMatrixForUniformOverride(t,c(t,e))}},"ResetMatrixFunctions",0,function(){e.Effect.prototype.setMatrix=T,p._setMatrixOverride=void 0,l.prototype._updateMatrixForUniform=m,l.prototype._updateMatrixForUniformOverride=void 0}])},81127,26801,t=>{"use strict";var e=t.i(85789),r=t.i(40379);class i{constructor(t,e,r=!1,i,s=!1,a){this._uniformNames=[],this._valueCache={},this._engine=t,this._noUBO=!t.supportsUniformBuffers||s,this._dynamic=r,this._name=i??"no-name",this._data=e||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(void 0===a&&this._engine._features.trackUbosInFrame||!0===a)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(t){let e;if(e=t<=2?t:4,this._uniformLocationPointer%e!=0){let t=this._uniformLocationPointer;this._uniformLocationPointer+=e-this._uniformLocationPointer%e;let r=this._uniformLocationPointer-t;for(let t=0;t<r;t++)this._data.push(0)}}addUniform(t,e,r=0){let i;if((r>0&&"number"==typeof e&&(this._uniformArraySizes[t]={strideSize:e,arraySize:r}),void 0===this._uniformLocations[t])&&(this._uniformNames.push(t),!this._noUBO)){if(r>0){if(e instanceof Array)throw"addUniform should not be use with Array in UBO: "+t;if(this._fillAlignment(4),16==e)e*=r;else{let t=4-e;e=e*r+t*r}i=[];for(let t=0;t<e;t++)i.push(0)}else{if(e instanceof Array)e=(i=e).length;else{i=[];for(let t=0;t<e;t++)i.push(0)}this._fillAlignment(e)}this._uniformSizes[t]=e,this._uniformLocations[t]=this._uniformLocationPointer,this._uniformLocationPointer+=e;for(let t=0;t<e;t++)this._data.push(i[t]);this._needSync=!0}}addMatrix(t,e){this.addUniform(t,Array.prototype.slice.call(e.asArray()))}addFloat2(t,e,r){this.addUniform(t,[e,r])}addFloat3(t,e,r,i){this.addUniform(t,[e,r,i])}addColor3(t,e){let r=[e.r,e.g,e.b];this.addUniform(t,r)}addColor4(t,e,r){let i=[e.r,e.g,e.b,r];this.addUniform(t,i)}addVector3(t,e){let r=[e.x,e.y,e.z];this.addUniform(t,r)}addMatrix3x3(t){this.addUniform(t,12)}addMatrix2x2(t){this.addUniform(t,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){let t=[],e=0;for(let r in this._uniformLocations)if(t.push(r),10==++e)break;return t.join(",")}_rebuild(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(t){this._name=t}get currentEffect(){return this._currentEffect}_buffersEqual(t,e){for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}_copyBuffer(t,e){for(let r=0;r<t.length;++r)e[r]=t[r]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer)return void this.create();if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(1===this._buffers.length?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=0!==this._bufferIndex,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(t,r,i){this._checkNewFrame();let s=this._uniformLocations[t];if(void 0===s){if(this._buffer)return void e.Logger.Error("Cannot add an uniform after UBO has been created. uniformName="+t);this.addUniform(t,i),s=this._uniformLocations[t]}if(this._buffer||this.create(),this._dynamic)for(let t=0;t<i;t++)this._bufferData[s+t]=r[t];else{let t=!1;for(let e=0;e<i;e++)(16!==i||this._engine._features.uniformBufferHardCheckMatrix)&&this._bufferData[s+e]===Math.fround(r[e])||(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+e]=r[e]);this._needSync=this._needSync||t}}updateUniformArray(t,i,s){this._checkNewFrame();let a=this._uniformLocations[t];if(void 0===a)return void e.Logger.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer||this.create();let f=this._uniformArraySizes[t];if(this._dynamic)for(let t=0;t<s;t++)this._bufferData[a+t]=i[t];else{let t=!1,e=0,n=0;for(let u=0;u<s;u++)if(this._bufferData[a+4*n+e]!==r.Tools.FloatRound(i[u])&&(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[a+4*n+e]=i[u]),++e===f.strideSize){for(;e<4;e++)this._bufferData[a+4*n+e]=0;e=0,n++}this._needSync=this._needSync||t}}_cacheMatrix(t,e){this._checkNewFrame();let r=this._valueCache[t],i=e.updateFlag;return(void 0===r||r!==i)&&(this._valueCache[t]=i,!0)}_updateMatrix3x3ForUniform(t,e){for(let t=0;t<3;t++)i._TempBuffer[4*t]=e[3*t],i._TempBuffer[4*t+1]=e[3*t+1],i._TempBuffer[4*t+2]=e[3*t+2],i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,12)}_updateMatrix3x3ForEffect(t,e){this._currentEffect.setMatrix3x3(t,e)}_updateMatrix2x2ForEffect(t,e){this._currentEffect.setMatrix2x2(t,e)}_updateMatrix2x2ForUniform(t,e){for(let t=0;t<2;t++)i._TempBuffer[4*t]=e[2*t],i._TempBuffer[4*t+1]=e[2*t+1],i._TempBuffer[4*t+2]=0,i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,8)}_updateFloatForEffect(t,e,r=""){this._currentEffect.setFloat(t+r,e)}_updateFloatForUniform(t,e){i._TempBuffer[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateFloat2ForEffect(t,e,r,i=""){this._currentEffect.setFloat2(t+i,e,r)}_updateFloat2ForUniform(t,e,r){i._TempBuffer[0]=e,i._TempBuffer[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateFloat3ForEffect(t,e,r,i,s=""){this._currentEffect.setFloat3(t+s,e,r,i)}_updateFloat3ForUniform(t,e,r,s){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateFloat4ForEffect(t,e,r,i,s,a=""){this._currentEffect.setFloat4(t+a,e,r,i,s)}_updateFloat4ForUniform(t,e,r,s,a){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=s,i._TempBuffer[3]=a,this.updateUniform(t,i._TempBuffer,4)}_updateFloatArrayForEffect(t,e,r=""){switch(this._uniformArraySizes[t]?.strideSize){case 2:this._currentEffect.setFloatArray2(t+r,e);break;case 3:this._currentEffect.setFloatArray3(t+r,e);break;case 4:this._currentEffect.setFloatArray4(t+r,e);break;default:this._currentEffect.setFloatArray(t+r,e)}}_updateFloatArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateArrayForEffect(t,e){this._currentEffect.setArray(t,e)}_updateArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateIntArrayForEffect(t,e){this._currentEffect.setIntArray(t,e)}_updateIntArrayForUniform(t,e){i._TempBufferInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateUIntArrayForEffect(t,e){this._currentEffect.setUIntArray(t,e)}_updateUIntArrayForUniform(t,e){i._TempBufferUInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateMatrixForEffect(t,e){this._currentEffect.setMatrix(t,e)}_updateMatrixForUniform(t,e){this._cacheMatrix(t,e)&&this.updateUniform(t,e.asArray(),16)}_updateMatricesForEffect(t,e){this._currentEffect.setMatrices(t,e)}_updateMatricesForUniform(t,e){this.updateUniform(t,e,e.length)}_updateVector3ForEffect(t,e){this._currentEffect.setVector3(t,e)}_updateVector3ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,this.updateUniform(t,i._TempBuffer,3)}_updateVector4ForEffect(t,e){this._currentEffect.setVector4(t,e)}_updateVector4ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,i._TempBuffer[3]=e.w,this.updateUniform(t,i._TempBuffer,4)}_updateColor3ForEffect(t,e,r=""){this._currentEffect.setColor3(t+r,e)}_updateColor3ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,this.updateUniform(t,i._TempBuffer,3)}_updateColor4ForEffect(t,e,r,i=""){this._currentEffect.setColor4(t+i,e,r)}_updateDirectColor4ForEffect(t,e,r=""){this._currentEffect.setDirectColor4(t+r,e)}_updateColor4ForUniform(t,e,r){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=r,this.updateUniform(t,i._TempBuffer,4)}_updateDirectColor4ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=e.a,this.updateUniform(t,i._TempBuffer,4)}_updateIntForEffect(t,e,r=""){this._currentEffect.setInt(t+r,e)}_updateIntForUniform(t,e){i._TempBufferInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateInt2ForEffect(t,e,r,i=""){this._currentEffect.setInt2(t+i,e,r)}_updateInt2ForUniform(t,e,r){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateInt3ForEffect(t,e,r,i,s=""){this._currentEffect.setInt3(t+s,e,r,i)}_updateInt3ForUniform(t,e,r,s){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateInt4ForEffect(t,e,r,i,s,a=""){this._currentEffect.setInt4(t+a,e,r,i,s)}_updateInt4ForUniform(t,e,r,s,a){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=s,i._TempBufferInt32View[3]=a,this.updateUniform(t,i._TempBuffer,4)}_updateUIntForEffect(t,e,r=""){this._currentEffect.setUInt(t+r,e)}_updateUIntForUniform(t,e){i._TempBufferUInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateUInt2ForEffect(t,e,r,i=""){this._currentEffect.setUInt2(t+i,e,r)}_updateUInt2ForUniform(t,e,r){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateUInt3ForEffect(t,e,r,i,s=""){this._currentEffect.setUInt3(t+s,e,r,i)}_updateUInt3ForUniform(t,e,r,s){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateUInt4ForEffect(t,e,r,i,s,a=""){this._currentEffect.setUInt4(t+a,e,r,i,s)}_updateUInt4ForUniform(t,e,r,s,a){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=s,i._TempBufferUInt32View[3]=a,this.updateUniform(t,i._TempBuffer,4)}setTexture(t,e){this._currentEffect.setTexture(t,e)}setTextureArray(t,e){this._currentEffect.setTextureArray(t,e)}bindTexture(t,e){this._currentEffect._bindTexture(t,e)}updateUniformDirectly(t,e){this.updateUniform(t,e,e.length),this.update()}bindToEffect(t,e){this._currentEffect=t,this._currentEffectName=e}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(t){if(!this._buffers)return this._buffer===t;for(let e=0;e<this._buffers.length;++e)if(this._buffers[e][0]===t)return this._bufferIndex=e,this._buffer=t,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[e][1]&&this._bufferData.set(this._buffers[e][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(t){return void 0!==this._uniformLocations[t]}dispose(){if(this._noUBO)return;let t=this._engine._uniformBuffers,e=t.indexOf(this);if(-1!==e&&(t[e]=t[t.length-1],t.pop()),this._trackUBOsInFrame&&this._buffers)for(let t=0;t<this._buffers.length;++t){let e=this._buffers[t][0];this._engine._releaseBuffer(e)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}i._MAX_UNIFORM_SIZE=256,i._TempBuffer=new Float32Array(i._MAX_UNIFORM_SIZE),i._TempBufferInt32View=new Int32Array(i._TempBuffer.buffer),i._TempBufferUInt32View=new Uint32Array(i._TempBuffer.buffer),t.s(["UniformBuffer",0,i],81127);class s{static CompareLightsPriority(t,e){return t.shadowEnabled!==e.shadowEnabled?!!e.shadowEnabled-!!t.shadowEnabled:e.renderPriority-t.renderPriority}}s.FALLOFF_DEFAULT=0,s.FALLOFF_PHYSICAL=1,s.FALLOFF_GLTF=2,s.FALLOFF_STANDARD=3,s.LIGHTMAP_DEFAULT=0,s.LIGHTMAP_SPECULAR=1,s.LIGHTMAP_SHADOWSONLY=2,s.INTENSITYMODE_AUTOMATIC=0,s.INTENSITYMODE_LUMINOUSPOWER=1,s.INTENSITYMODE_LUMINOUSINTENSITY=2,s.INTENSITYMODE_ILLUMINANCE=3,s.INTENSITYMODE_LUMINANCE=4,s.LIGHTTYPEID_POINTLIGHT=0,s.LIGHTTYPEID_DIRECTIONALLIGHT=1,s.LIGHTTYPEID_SPOTLIGHT=2,s.LIGHTTYPEID_HEMISPHERICLIGHT=3,s.LIGHTTYPEID_RECT_AREALIGHT=4,s.LIGHTTYPEID_CLUSTERED_CONTAINER=5,t.s(["LightConstants",0,s],26801)},1306,t=>{"use strict";var e=t.i(72003);class r{constructor(t,r,i,s){this.normal=new e.Vector3(t,r,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new r(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let t=this.normal.getHashCode();return 397*t^this.d}normalize(){let t=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),e=0;return 0!==t&&(e=1/t),this.normal.x*=e,this.normal.y*=e,this.normal.z*=e,this.d*=e,this}transform(t){let e=r._TmpMatrix;t.invertToRef(e);let i=e.m,s=this.normal.x,a=this.normal.y,f=this.normal.z,n=this.d;return new r(s*i[0]+a*i[1]+f*i[2]+n*i[3],s*i[4]+a*i[5]+f*i[6]+n*i[7],s*i[8]+a*i[9]+f*i[10]+n*i[11],s*i[12]+a*i[13]+f*i[14]+n*i[15])}dotCoordinate(t){return this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z+this.d}copyFromPoints(t,e,r){let i,s=e.x-t.x,a=e.y-t.y,f=e.z-t.z,n=r.x-t.x,u=r.y-t.y,o=r.z-t.z,h=a*o-f*u,_=f*n-s*o,d=s*u-a*n,E=Math.sqrt(h*h+_*_+d*d);return i=0!==E?1/E:0,this.normal.x=h*i,this.normal.y=_*i,this.normal.z=d*i,this.d=-(this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z),this}isFrontFacingTo(t,r){return e.Vector3.Dot(this.normal,t)<=r}signedDistanceTo(t){return e.Vector3.Dot(t,this.normal)+this.d}static FromArray(t){return new r(t[0],t[1],t[2],t[3])}static FromPoints(t,e,i){let s=new r(0,0,0,0);return s.copyFromPoints(t,e,i),s}static FromPositionAndNormal(t,e){let i=new r(0,0,0,0);return this.FromPositionAndNormalToRef(t,e,i)}static FromPositionAndNormalToRef(t,e,r){return r.normal.copyFrom(e),r.normal.normalize(),r.d=-t.dot(r.normal),r}static SignedDistanceToPlaneFromPositionAndNormal(t,r,i){let s=-(r.x*t.x+r.y*t.y+r.z*t.z);return e.Vector3.Dot(i,r)+s}}r._TmpMatrix=e.Matrix.Identity(),t.s(["Plane",0,r])},36598,t=>{"use strict";class e{constructor(t){this.length=0,this.data=Array(t),this._id=e._GlobalId++}push(t){this.data[this.length++]=t,this.length>this.data.length&&(this.data.length*=2)}forEach(t){for(let e=0;e<this.length;e++)t(this.data[e])}sort(t){this.data.sort(t)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++)this.data[this.length++]=(t.data||t)[e]}}indexOf(t){let e=this.data.indexOf(t);return e>=this.length?-1:e}contains(t){return -1!==this.indexOf(t)}}e._GlobalId=0,t.s(["SmartArray",0,e,"SmartArrayNoDuplicate",0,class extends e{constructor(){super(...arguments),this._duplicateId=0}push(t){super.push(t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(t){return(!t.__smartArrayFlags||t.__smartArrayFlags[this._id]!==this._duplicateId)&&(this.push(t),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++){let r=(t.data||t)[e];this.pushNoDuplicate(r)}}}}])},17828,t=>{"use strict";class e{}e.NAME_EFFECTLAYER="EffectLayer",e.NAME_LAYER="Layer",e.NAME_LENSFLARESYSTEM="LensFlareSystem",e.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",e.NAME_PARTICLESYSTEM="ParticleSystem",e.NAME_GAMEPAD="Gamepad",e.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",e.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",e.NAME_PREPASSRENDERER="PrePassRenderer",e.NAME_DEPTHRENDERER="DepthRenderer",e.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer",e.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",e.NAME_SPRITE="Sprite",e.NAME_SUBSURFACE="SubSurface",e.NAME_OUTLINERENDERER="Outline",e.NAME_PROCEDURALTEXTURE="ProceduralTexture",e.NAME_SHADOWGENERATOR="ShadowGenerator",e.NAME_OCTREE="Octree",e.NAME_PHYSICSENGINE="PhysicsEngine",e.NAME_AUDIO="Audio",e.NAME_FLUIDRENDERER="FluidRenderer",e.NAME_IBLCDFGENERATOR="iblCDFGenerator",e.NAME_CLUSTEREDLIGHTING="ClusteredLighting",e.STEP_ISREADYFORMESH_EFFECTLAYER=0,e.STEP_ISREADYFORMESH_DEPTHRENDERER=1,e.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,e.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_PREPASS=0,e.STEP_BEFORECAMERADRAW_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_LAYER=2,e.STEP_BEFORERENDERTARGETDRAW_PREPASS=0,e.STEP_BEFORERENDERTARGETDRAW_LAYER=1,e.STEP_BEFORERENDERINGMESH_PREPASS=0,e.STEP_BEFORERENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGMESH_PREPASS=0,e.STEP_AFTERRENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,e.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,e.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,e.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,e.STEP_BEFORECLEAR_PREPASS=1,e.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0,e.STEP_AFTERRENDERTARGETDRAW_PREPASS=0,e.STEP_AFTERRENDERTARGETDRAW_LAYER=1,e.STEP_AFTERCAMERADRAW_PREPASS=0,e.STEP_AFTERCAMERADRAW_EFFECTLAYER=1,e.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2,e.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3,e.STEP_AFTERCAMERADRAW_LAYER=4,e.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5,e.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0,e.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0,e.STEP_AFTERRENDER_AUDIO=0,e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1,e.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2,e.STEP_POINTERMOVE_SPRITE=0,e.STEP_POINTERDOWN_SPRITE=0,e.STEP_POINTERUP_SPRITE=0;class r extends Array{constructor(t){super(...t)}static Create(){return Object.create(r.prototype)}registerStep(t,e,r){let i=0;for(;i<this.length&&!(t<this[i].index);i++);this.splice(i,0,{index:t,component:e,action:r.bind(e)})}clear(){this.length=0}}t.s(["SceneComponentConstants",0,e,"Stage",0,r])}]);
|