@uptimizr/dashboard 0.1.2 → 0.2.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 +4 -4
- package/out/__next._full.txt +11 -11
- package/out/__next._head.txt +4 -4
- package/out/__next._index.txt +4 -4
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
- package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
- package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
- package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
- package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
- package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
- package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
- package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
- package/out/_next/static/chunks/0927l-ygd5c8d.js +1 -0
- package/out/_next/static/chunks/09510356f0lad.js +1 -0
- package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
- package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
- package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
- package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
- package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
- package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
- package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
- package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
- package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
- package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
- package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
- package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
- package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
- package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
- package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
- package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
- package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
- package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
- package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
- package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
- package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
- package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
- package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
- package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
- package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
- package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
- package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
- package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
- package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
- package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
- package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
- package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
- package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
- package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
- package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
- package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
- package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
- package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
- package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
- package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
- package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
- package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
- package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
- package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
- package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
- package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
- package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
- package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
- package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
- package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
- package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
- package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
- package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
- package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
- package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
- package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
- package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
- package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
- package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
- package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
- package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
- package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
- package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
- package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
- package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
- package/out/_next/static/chunks/1tta1a064979p.js +1 -0
- package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
- package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
- package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
- package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
- package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
- package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
- package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
- package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
- package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
- package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
- package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
- package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
- package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
- package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
- package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
- package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
- package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
- package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
- package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
- package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
- package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
- package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
- package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
- package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
- package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
- package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
- package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
- package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
- package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
- package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
- package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
- package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
- package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
- package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
- package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
- package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
- package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
- package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
- package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
- package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
- package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
- package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
- package/out/_next/static/chunks/2x-00glogc485.js +1 -0
- package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
- package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
- package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
- package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
- package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
- package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
- package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
- package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
- package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
- package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
- package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
- package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
- package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
- package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
- package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
- package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
- package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
- package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
- package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
- package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
- package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
- package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
- package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
- package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
- package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
- package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
- package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
- package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
- package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
- package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
- package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
- package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
- package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
- package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
- package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
- package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
- package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
- package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
- package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
- package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
- package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
- package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
- package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
- package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
- package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
- package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
- package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
- package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
- package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
- package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
- package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
- package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
- package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
- package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
- package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
- package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
- package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
- package/out/_not-found/__next._full.txt +9 -9
- package/out/_not-found/__next._head.txt +4 -4
- package/out/_not-found/__next._index.txt +4 -4
- package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +9 -9
- package/out/index.html +1 -1
- package/out/index.txt +11 -11
- package/package.json +5 -4
- package/out/_next/static/chunks/068j6934u8j16.js +0 -1
- package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
- package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
- package/out/_next/static/chunks/0aznt7717miff.js +0 -1
- package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
- package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
- package/out/_next/static/chunks/0gg-ii7i6d_p6.js +0 -1
- package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
- package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
- package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
- package/out/_next/static/chunks/0wwkrsvxwi57d.js +0 -1
- package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
- package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
- package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
- package/out/_next/static/chunks/123xxske5c9na.js +0 -1
- package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
- package/out/_next/static/chunks/157d9euci08yu.js +0 -1
- package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
- package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
- package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
- package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
- package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
- package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
- package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
- package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
- package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
- package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
- package/out/_next/static/chunks/2clzipqap01hp.js +0 -1
- package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
- package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
- package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
- package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
- package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
- package/out/_next/static/chunks/2z5eqx5do5std.js +0 -1
- package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
- package/out/_next/static/chunks/3aqbf_wkg2sih.js +0 -3
- package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
- package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
- package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
- package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
- package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
- package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
- package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
- package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51581,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let n=e.r(59922);function l({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},16201,(e,t,s)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return n}})},1299,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return o}});let n=e.r(29212),l=e.r(90611),r=e.r(50803),a=e.r(16201),i=e.r(29434);function o({moduleIds:e}){if("u">typeof window)return null;let t=r.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;s.push(...e)}}if(0===s.length)return null;let d=(0,i.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,l.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},89699,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let n=e.r(29212),l=e.r(94179),r=e.r(51581),a=e.r(1299);function i(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},d=function(e){let t={...o,...e},s=(0,l.lazy)(()=>t.loader().then(i)),d=t.loading;function c(e){let i=d?(0,n.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?l.Suspense:l.Fragment,u=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(s,{...e})]}):(0,n.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(s,{...e})});return(0,n.jsx)(c,{...o?{fallback:i}:{},children:u})}return c.displayName="LoadableComponent",c}},80268,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return l}});let n=e.r(81258)._(e.r(89699));function l(e,t){let s={};"function"==typeof e&&(s.loader=e);let l={...s,...t};return(0,n.default)({...l,modules:l.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},14936,e=>{"use strict";e.i(23838);var t=e.i(29212),s=e.i(80268),n=e.i(94179),l=e.i(82665),r=e.i(20880);let a={window:"1h"},i=[{id:"1h",label:"Last hour"},{id:"24h",label:"Last 24h"},{id:"7d",label:"Last 7 days"},{id:"all",label:"All time"}],o={"1h":36e5,"24h":864e5,"7d":6048e5};function d(e,t=Date.now()){return"all"===e.window?{}:"custom"===e.window?{since:e.since,until:e.until}:{since:t-o[e.window],until:t}}function c(e,t=Date.now()){return{...d(e,t),scene:e.scene&&e.scene.length>0?e.scene:void 0,source:e.source,cameraMode:e.cameraMode}}let u=[60,300,900,1800,3600,10800,21600,43200,86400,604800];function x(e){return"xr-controller"===e?"XR controller":e.charAt(0).toUpperCase()+e.slice(1)}let m=["mouse","touch","stylus","pen","xr-controller","hand","gaze","transient","other"];var h=e.i(56054);function p(e,t=1){let[s,n,l]=(0,h.heatRgb)(e);return`rgba(${Math.round(255*s)}, ${Math.round(255*n)}, ${Math.round(255*l)}, ${t})`}function f(e,t=0){return Number.isFinite(e)?e.toLocaleString(void 0,{maximumFractionDigits:t}):"—"}var g=e.i(88725),b=e.i(93425);function v({panels:e,ctx:s,surface:n,revision:l=0}){let r=e.filter(e=>!!(e.surfaces??["overview"]).includes(n)&&(!e.enabled||e.enabled(s)));return(0,t.jsx)(t.Fragment,{children:r.map(e=>(0,t.jsx)("div",{className:2===e.span?"lg:col-span-2":void 0,children:(0,t.jsx)(j,{panel:e,ctx:s,revision:l})},e.id))})}function j({panel:e,ctx:s,revision:l}){let{data:r,loading:a,error:i}=function(e,t,s=0){let[l,r]=(0,n.useState)({data:null,loading:!!e.load,error:null}),a=JSON.stringify(t.params);return(0,n.useEffect)(()=>{if(!e.load)return void r({data:null,loading:!1,error:null});let s=!0,n=new AbortController;return r(e=>({...e,loading:!0,error:null})),e.load({...t,signal:n.signal}).then(e=>{s&&r({data:e,loading:!1,error:null})},e=>{s&&!n.signal.aborted&&r({data:null,loading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{s=!1,n.abort()}},[e,a,t.surface,t.sessionId,s]),l}(e,s,l),o="function"==typeof e.subtitle?e.subtitle(s):e.subtitle,d=function(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>t(!0),[]),e}(),c=!e.clientOnly||d;return(0,t.jsx)(b.Panel,{title:e.title,subtitle:o,help:e.help,collapsible:e.collapsible,children:c?i?(0,t.jsxs)("p",{className:"text-sm text-fg-muted",children:["Could not load: ",i.message]}):a&&e.load?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Loading…"}):e.render({data:r,ctx:s}):null})}function y(e){return Number.isNaN(e)||e<0?0:e>1?1:e}function w(e){let t=y(e),s=[[0,.1,.9],[0,.85,1],[.1,.9,.2],[1,.85,0],[1,.15,0],[1,1,1]],n=s.length-1,l=t*n,r=Math.min(Math.floor(l),n-1),a=l-r,i=s[r],o=s[r+1];return i&&o?[i[0]+(o[0]-i[0])*a,i[1]+(o[1]-i[1])*a,i[2]+(o[2]-i[2])*a]:[1,1,1]}var N=e.i(62238),S=e.i(59683),k=e.i(37660),M=e.i(42279);function P({bins:s,gridSize:l}){let r=(0,n.useRef)(null),a=(0,n.useRef)(null),[i,o]=(0,n.useState)("loading"),[d,c]=(0,n.useState)(null),[u,x]=(0,n.useState)("markers"),[m,p]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let t=r.current;if(!t)return;if(0===s.length)return void o("empty");let n=!1,i=null;return o("loading"),c(null),(async()=>{try{let[{Engine:r},{Scene:d},{ArcRotateCamera:c},{HemisphericLight:x},{Vector3:m,Color3:f,Color4:g,Matrix:b},{MeshBuilder:v},{StandardMaterial:j},{Mesh:k},{DynamicTexture:M}]=await Promise.all([e.A(66022),e.A(48505),e.A(53976),e.A(42436),e.A(89370),e.A(67141),e.A(20693),e.A(8850),e.A(63836),e.A(9607),e.A(96664)]);if(n)return;let P=new r(t,!0,{preserveDrawingBuffer:!1}),C=new d(P);C.clearColor=new g(.04,.05,.07,1);let _=new c("dome-cam",Math.PI/3,Math.PI/2.4,3.6,m.Zero(),C);_.attachControl(t,!0),_.lowerRadiusLimit=1.6,_.upperRadiusLimit=8,(0,N.disableWheelZoom)(_),a.current=_,new x("dome-light",new m(.3,1,.2),C);let R=v.CreateSphere("dome",{diameter:2,segments:20},C),z=new j("dome-mat",C);z.wireframe=!0,z.disableLighting=!0,z.emissiveColor=new f(.16,.2,.28),z.alpha=.5,R.material=z,R.isPickable=!1;let I=[];for(let e=0;e<=64;e++){let t=e/64*Math.PI*2;I.push(new m(Math.cos(t),0,Math.sin(t)))}let T=v.CreateLines("dome-horizon",{points:I},C);T.color=new f(.3,.36,.46),T.isPickable=!1;let A=v.CreateLines("dome-forward",{points:[m.Zero(),new m(1.25,0,0)]},C);A.color=new f(.4,.7,.95),A.isPickable=!1;let E=s.reduce((e,t)=>Math.max(e,t.count),1),$=l>0?l:1;if("markers"===u){let e=v.CreateBox("dome-marker",{size:1},C),t=new j("dome-marker-mat",C);t.disableLighting=!0,t.emissiveColor=f.White(),t.specularColor=new f(0,0,0),e.material=t,e.isPickable=!0,e.thinInstanceEnablePicking=!0;let n=s.length,l=new Float32Array(16*n),r=new Float32Array(4*n),a=Array(n);for(let e=0;e<n;e++){let t=s[e],n=(t.azimuth_bin+.5)/$*Math.PI*2-Math.PI,i=(t.elevation_bin+.5)/$*Math.PI-Math.PI/2,o=Math.cos(i),d=o*Math.cos(n),c=Math.sin(i),u=o*Math.sin(n),x=t.count/E,m=.03+.12*x;b.Scaling(m,m,m).multiply(b.Translation(d,c,u)).copyToArray(l,16*e);let[p,f,g]=(0,h.heatRgb)(x);r[4*e]=p,r[4*e+1]=f,r[4*e+2]=g,r[4*e+3]=1,a[e]=`dir (${t.azimuth_bin}, ${t.elevation_bin}) \xb7 ${t.count}`}e.thinInstanceSetBuffer("matrix",l,16,!0),e.thinInstanceSetBuffer("color",r,4,!0),e.metadata={hoverLabels:a}}else{let e=function(e,t={}){let s=void 0!==t.width&&t.width>0?Math.floor(t.width):256,n=void 0!==t.height&&t.height>0?Math.floor(t.height):Math.max(1,Math.floor(s/2)),l=t.colorRamp??w,r=void 0!==t.blurBins&&t.blurBins>0?t.blurBins:1.5,a=y(t.alphaFloor??0),i=y(t.opacity??1),o=e.gridSize>0?e.gridSize:1,d=new Uint8ClampedArray(s*n*4),c=e.bins.filter(e=>e.count>0);if(0===c.length)return{width:s,height:n,rgba:d};let u=Math.max(1e-4,Math.PI/o*r),x=2*u*u,m=Math.cos(Math.min(Math.PI,3*u)),h=c.map(e=>{var t,s;let n,[l,r]=(t=e.azimuthBin,s=e.elevationBin,[(t+.5)/o*Math.PI*2-Math.PI,(s+.5)/o*Math.PI-Math.PI/2]);return[(n=Math.cos(r))*Math.cos(l),Math.sin(r),n*Math.sin(l)]}),p=new Float32Array(s*n),f=0;for(let e=0;e<n;e++){let t=Math.PI/2-(e+.5)/n*Math.PI,l=Math.cos(t),r=Math.sin(t);for(let t=0;t<s;t++){let n=(t+.5)/s*Math.PI*2-Math.PI,a=l*Math.cos(n),i=l*Math.sin(n),o=0;for(let e=0;e<c.length;e++){let t=h[e],s=a*t[0]+r*t[1]+i*t[2];if(s<m)continue;let n=Math.acos(s>1?1:s<-1?-1:s);o+=c[e].count*Math.exp(-(n*n)/x)}p[e*s+t]=o,o>f&&(f=o)}}if(f<=0)return{width:s,height:n,rgba:d};for(let e=0;e<p.length;e++){let t=y(p[e]/f),[s,n,r]=l(t),o=(a+(1-a)*t)*i,c=4*e;d[c]=Math.round(255*s),d[c+1]=Math.round(255*n),d[c+2]=Math.round(255*r),d[c+3]=Math.round(255*y(o))}return{width:s,height:n,rgba:d}}({bins:s.map(e=>({azimuthBin:e.azimuth_bin,elevationBin:e.elevation_bin,count:e.count})),gridSize:$},{width:256,blurBins:1.5,opacity:.95}),t=new M("dome-skytex",{width:e.width,height:e.height},C,!1);t.hasAlpha=!0;let n=t.getContext(),l=n.createImageData(e.width,e.height);l.data.set(e.rgba),n.putImageData(l,0,0),t.update();let r=v.CreateSphere("dome-sky",{diameter:2,segments:48,sideOrientation:k.DOUBLESIDE},C),a=new j("dome-sky-mat",C);a.disableLighting=!0,a.emissiveColor=f.White(),a.diffuseColor=new f(0,0,0),a.specularColor=new f(0,0,0),a.emissiveTexture=t,a.opacityTexture=t,a.backFaceCulling=!1,r.material=a,r.isPickable=!1}P.runRenderLoop(()=>C.render());let L=()=>P.resize();window.addEventListener("resize",L);let F=(0,S.attachMeshHover)(C,t,p);o("ready"),i=()=>{window.removeEventListener("resize",L),F(),p(null),a.current=null,C.dispose(),P.dispose()}}catch(e){if(n)return;o("error"),c(e instanceof Error?e.message:"Failed to render dome.")}})(),()=>{n=!0,i?.()}},[s,l,u]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:r,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),m?(0,t.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-[16rem] truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:m.x+12,top:m.y+12},children:m.label}):null,"ready"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge bg-ink/80 text-xs backdrop-blur",children:["markers","skydome"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>x(e),className:`px-2.5 py-1 ${u===e?"bg-fg/15 font-medium text-white":"text-fg-muted hover:text-fg"}`,children:"markers"===e?"Markers":"Skydome"},e))}),(0,t.jsx)(M.ZoomButtons,{onZoom:e=>a.current&&(0,N.stepZoom)(a.current,e)}),(0,t.jsx)(k.HeatLegend,{title:"Gaze density",lowLabel:"rarely",highLabel:"most-viewed",note:"markers"===u?"Each marker is a look-direction (camera forward). Blue line = forward, ring = horizon. Color & size scale with how often that direction was viewed.":"Continuous equirectangular heat field: the same gaze bins splatted into a smooth thermal texture wrapped on the dome. The in-scene SDK overlay (showGazeSkydome) renders this inward so you can stand inside it in WebXR."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===i?"Rendering…":"empty"===i?"No camera samples in range.":"error"===i?d??"Dome unavailable.":null})]})}let C="#161210",_={fontSize:13,color:"#a8917c"},R={padding:"6px 10px",fontSize:13,borderTop:"1px solid #34291f"};function z({sessions:e,onSelect:s,selectedId:n}){return 0===e.length?(0,t.jsx)("p",{style:_,children:"No sessions in range."}):(0,t.jsx)("div",{style:{maxHeight:320,overflow:"auto"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left"},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{fontSize:11,textTransform:"uppercase",color:"#a8917c"},children:[(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Session"}),(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Visitor"}),(0,t.jsx)("th",{style:{padding:"6px 10px",textAlign:"right"},children:"Events"}),(0,t.jsx)("th",{style:{padding:"6px 10px"},children:"Started"})]})}),(0,t.jsx)("tbody",{children:e.map(e=>{var l;let r,a=e.session_id===n;return(0,t.jsxs)("tr",{onClick:s?()=>s(e.session_id):void 0,style:{cursor:s?"pointer":"default",background:a?"rgba(237,166,62,0.15)":void 0},children:[(0,t.jsx)("td",{style:{...R,fontFamily:"ui-monospace, monospace",color:"#d8c8b8"},children:e.session_id.slice(0,12)}),(0,t.jsx)("td",{style:{...R,fontFamily:"ui-monospace, monospace",color:"#a8917c"},children:e.visitor_id.slice(0,8)}),(0,t.jsx)("td",{style:{...R,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:f(e.events)}),(0,t.jsx)("td",{style:{...R,fontSize:12,color:"#a8917c"},children:Number.isNaN((r=new Date((l=e.started_at).includes("T")?l:l.replace(" ","T")+"Z")).getTime())?l:r.toLocaleString()})]},e.session_id)})})]})})}function I({bins:e,gridSize:s,size:l=320,className:r,style:a}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=i.current;if(!t)return;let n=t.getContext("2d");n&&function(e,t,s,n){if(e.clearRect(0,0,n,n),e.fillStyle=C,e.fillRect(0,0,n,n),0===t.length)return;let l=t.reduce((e,t)=>Math.max(e,t.count),0),r=n/s;for(let s of t)e.fillStyle=p(l>0?s.count/l:0,.85),e.fillRect(s.gx*r,s.gy*r,Math.ceil(r),Math.ceil(r))}(n,e,s,l)},[e,s,l]),(0,t.jsx)("canvas",{ref:i,width:l,height:l,className:r,style:a,"aria-label":"Pointer heatmap"})}function T({bins:e,gridSize:s,size:l=340,className:r,style:a}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=i.current;if(!t)return;let n=t.getContext("2d");if(!n)return;let r=Math.min(window.devicePixelRatio||1,2);t.width=l*r,t.height=l*r,n.setTransform(r,0,0,r,0,0),function(e,t,s,n){let l=n/2,r=n/2,a=n/2-18;if(e.clearRect(0,0,n,n),e.fillStyle=C,e.fillRect(0,0,n,n),e.strokeStyle="#34291f",e.lineWidth=1,e.beginPath(),e.arc(l,r,a,0,2*Math.PI),e.stroke(),e.beginPath(),e.arc(l,r,a/2,0,2*Math.PI),e.stroke(),t.length>0){let n=t.reduce((e,t)=>Math.max(e,t.count),0),i=2*Math.PI/s;for(let o of t){let t=n>0?o.count/n:0,d=1-(o.elevation_bin+1)/s,c=1-o.elevation_bin/s,u=Math.max(0,d)*a,x=Math.max(0,c)*a,m=o.azimuth_bin*i,h=m+i;e.beginPath(),e.arc(l,r,x,m,h),e.arc(l,r,u,h,m,!0),e.closePath(),e.fillStyle=p(t,.85),e.fill()}}let i=(t,s,n)=>{e.lineWidth=3,e.strokeStyle="rgba(22,18,16,0.9)",e.strokeText(t,s,n),e.fillStyle="#d8c8b8",e.fillText(t,s,n)};for(let t of(e.font="600 10px ui-sans-serif, system-ui, sans-serif",e.textAlign="left",e.textBaseline="middle",e.strokeStyle="rgba(203,213,225,0.35)",e.lineWidth=1,e.beginPath(),e.moveTo(l,r),e.lineTo(l,r-a),e.stroke(),[0,a/2,a]))e.beginPath(),e.moveTo(l-3,r-t),e.lineTo(l+3,r-t),e.stroke();i("up",l+6,r),i("horizon",l+6,r-a/2),i("down",l+6,r-a+2)}(n,e,s,l)},[e,s,l]),(0,t.jsx)("canvas",{ref:i,className:r,style:{width:l,height:l,...a},"aria-label":"Camera view-direction heatmap: top-down polar plot where the center is looking up, the middle ring is the horizon, and the rim is looking down; color shows how often each direction was viewed."})}let A={background:"rgba(32,25,19,0.6)",borderRadius:8,padding:12},E={fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"#a8917c"},$={marginTop:4,fontSize:24,fontWeight:600,color:"#f4eadf",fontVariantNumeric:"tabular-nums"};function L({label:e,value:s}){return(0,t.jsxs)("div",{style:A,children:[(0,t.jsx)("div",{style:E,children:e}),(0,t.jsx)("div",{style:$,children:s})]})}function F({perf:e}){return e&&0!==e.samples?(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:12},children:[(0,t.jsx)(L,{label:"Samples",value:f(e.samples)}),(0,t.jsx)(L,{label:"Avg FPS",value:f(e.avg_fps,1)}),(0,t.jsx)(L,{label:"p50 FPS",value:f(e.p50_fps,1)}),(0,t.jsx)(L,{label:"Min FPS",value:f(e.min_fps,1)})]}):(0,t.jsx)("p",{style:_,children:"No performance samples in range."})}function D({bins:e,gridSize:s}){return(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(I,{bins:e,gridSize:s,className:"rounded-lg border border-edge"})})}function U({meshes:e}){let s=e.reduce((e,t)=>Math.max(e,t.count),0);return 0===e.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No mesh interactions in range."}):(0,t.jsx)("ul",{className:"space-y-1.5",children:e.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",children:e.mesh}),(0,t.jsx)("span",{className:"tabular-nums text-fg-muted",children:f(e.count)})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-amber",style:{width:`${s>0?e.count/s*100:0}%`}})})]},e.mesh))})}function B(e){return"session"===e.surface&&e.sessionId?{...e.params,session:e.sessionId}:e.params}let O=[{id:"top-meshes",title:"Top meshes",subtitle:"Most-interacted meshes",span:1,surfaces:["overview","session"],load:e=>e.api.topMeshes({...B(e),source:void 0,scene:void 0,limit:25}),render:({data:e})=>(0,t.jsx)(U,{meshes:e??[]})},{id:"pointer-heatmap",title:"Pointer heatmap",subtitle:"Normalized screen positions",span:1,surfaces:["overview","session"],clientOnly:!0,load:e=>e.api.pointerHeatmap({...B(e),bins:50}),render:({data:e})=>(0,t.jsx)(D,{bins:e??[],gridSize:50})},{id:"camera-dome-3d",title:"View-direction dome (3D)",subtitle:"Where the audience looked, mapped onto a sphere — drag to orbit, +/- to zoom",span:2,surfaces:["overview","session"],clientOnly:!0,load:e=>e.api.cameraHeatmap({...B(e),source:void 0,bins:36}),render:({data:e})=>(0,t.jsx)(P,{bins:e??[],gridSize:36})}];function G({bins:e,gridSize:s}){return(0,t.jsx)(b.Panel,{title:"View-direction heatmap",subtitle:"Top-down sphere — center = looking up, rim = looking down",help:(0,t.jsxs)(t.Fragment,{children:["A flattened top-down view of where the camera pointed."," ",(0,t.jsx)("strong",{children:"Distance from the center"})," is the up/down tilt: the ",(0,t.jsx)("strong",{children:"center"})," ","is looking straight up, the ",(0,t.jsx)("strong",{children:"middle ring"})," is the horizon (level), and the"," ",(0,t.jsx)("strong",{children:"outer rim"})," is looking straight down. The"," ",(0,t.jsx)("strong",{children:"angle around the disc"})," is the facing (azimuth) direction. Color shows how often each direction was viewed, normalized to the most-viewed direction in range."]}),children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(T,{bins:e,gridSize:s,className:"rounded-lg border border-edge"}),e.length>0?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-fg-muted",children:[(0,t.jsx)("span",{className:"font-medium text-fg",children:"View density"}),(0,t.jsx)("span",{children:"rarely"}),(0,t.jsx)("span",{className:"h-2 w-28 rounded-sm",style:{background:h.HEAT_GRADIENT}}),(0,t.jsx)("span",{children:"most-viewed"})]}):null]})})}function W({bins:e,cellSize:s}){let l=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t=l.current;if(!t)return;let s=t.getContext("2d");if(!s||(s.clearRect(0,0,360,360),s.fillStyle="#0b0e14",s.fillRect(0,0,360,360),0===e.length))return;let n=1/0,r=-1/0,a=1/0,i=-1/0,o=0;for(let t of e)t.gx<n&&(n=t.gx),t.gx>r&&(r=t.gx),t.gz<a&&(a=t.gz),t.gz>i&&(i=t.gz),t.count>o&&(o=t.count);let d=344/Math.max(r-n+1,i-a+1);for(let t of e){s.fillStyle=p(o>0?t.count/o:0,.9);let e=8+(t.gx-n)*d,l=8+(i-t.gz)*d;s.fillRect(e,l,Math.ceil(d),Math.ceil(d))}},[e,s]),(0,t.jsxs)(b.Panel,{title:"Floor-plan heatmap",subtitle:"Where visitors stand (top-down, first-person)",help:"Camera positions binned on the ground plane — the first-person counterpart of the pointer heatmap. Filter to the first-person camera mode to isolate walkable sessions.",children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("canvas",{ref:l,width:360,height:360,className:"rounded-lg border border-edge","aria-label":"Floor-plan position heatmap"})}),0===e.length?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"No camera-position data in range. Capture a first-person session to populate the plan."}):null]})}function H(e){return null==e?"":new Date(e-6e4*new Date(e).getTimezoneOffset()).toISOString().slice(0,16)}function K(e){if(!e)return;let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}function V({filters:e,scenes:s,onChange:n,busy:l}){let r=t=>n({...e,...t});return(0,t.jsxs)("section",{className:"mb-6 flex flex-wrap items-end gap-x-4 gap-y-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-fg-muted",children:"Time window"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Time window",children:[i.map(s=>{let n=e.window===s.id;return(0,t.jsx)("button",{type:"button",onClick:()=>r({window:s.id}),className:`rounded-md border px-2.5 py-1.5 text-xs transition ${n?"border-amber bg-amber/10 text-saffron":"border-edge text-fg hover:border-amber/60 hover:text-fg-hi"}`,children:s.label},s.id)}),(0,t.jsx)("button",{type:"button",onClick:()=>r({window:"custom",since:e.since??Date.now()-864e5,until:e.until??Date.now()}),className:`rounded-md border px-2.5 py-1.5 text-xs transition ${"custom"===e.window?"border-amber bg-amber/10 text-saffron":"border-edge text-fg hover:border-amber/60 hover:text-fg-hi"}`,children:"Custom"})]})]}),"custom"===e.window?(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["From",(0,t.jsx)("input",{type:"datetime-local",value:H(e.since),onChange:e=>r({since:K(e.target.value)}),className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["To",(0,t.jsx)("input",{type:"datetime-local",value:H(e.until),onChange:e=>r({until:K(e.target.value)}),className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron"})]})]}):null,(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Scene",(0,t.jsxs)("select",{value:e.scene??"",onChange:e=>r({scene:e.target.value||void 0}),className:"min-w-40 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All scenes"}),s.map(e=>(0,t.jsxs)("option",{value:e.scene_id,children:[e.scene_id," (",e.events.toLocaleString(),")"]},e.scene_id))]})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Input source",(0,t.jsxs)("select",{value:e.source??"",onChange:e=>r({source:e.target.value||void 0}),className:"min-w-36 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All sources"}),m.map(e=>(0,t.jsx)("option",{value:e,children:x(e)},e))]})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Camera mode",(0,t.jsxs)("select",{value:e.cameraMode??"",onChange:e=>r({cameraMode:e.target.value||void 0}),className:"min-w-36 rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",children:[(0,t.jsx)("option",{value:"",children:"All cameras"}),(0,t.jsx)("option",{value:"viewer",children:"Viewer (orbit)"}),(0,t.jsx)("option",{value:"first-person",children:"First-person (walk)"})]})]}),(0,t.jsx)("span",{className:`ml-auto text-xs ${l?"text-saffron":"text-fg-muted"}`,"aria-live":"polite",children:l?"Refreshing…":"Up to date"})]})}function Z({rows:e}){let s=function(e){let t=new Map;for(let s of e){let e=t.get(s.source);e||(e={source:s.source,total:0,sessions:0,byType:[]},t.set(s.source,e)),e.total+=s.count,e.sessions=Math.max(e.sessions,s.sessions),e.byType.push({event_type:s.event_type,count:s.count})}for(let e of t.values())e.byType.sort((e,t)=>t.count-e.count);return[...t.values()].sort((e,t)=>t.total-e.total)}(e),n=s.reduce((e,t)=>Math.max(e,t.total),0);return(0,t.jsx)(b.Panel,{title:"Input sources",subtitle:"Interactions by input source",children:0===s.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No source-bearing interactions in range."}):(0,t.jsx)("ul",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("li",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-medium text-fg",children:x(e.source)}),(0,t.jsxs)("span",{className:"tabular-nums text-fg-muted",children:[f(e.total),(0,t.jsxs)("span",{className:"ml-1 text-xs text-fg-muted",children:["· ",f(e.sessions)," ",1===e.sessions?"session":"sessions"]})]})]}),(0,t.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-amber",style:{width:`${n>0?e.total/n*100:0}%`}})}),(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:e.byType.map(e=>{let s;return(0,t.jsxs)("span",{className:"rounded bg-ink/60 px-1.5 py-0.5 font-mono text-[11px] text-fg-muted",children:[(s=e.event_type.replace(/_/g," ")).charAt(0).toUpperCase()+s.slice(1)," ",f(e.count)]},e.event_type)})})]},e.source))})})}function J({perf:e}){return(0,t.jsx)(b.Panel,{title:"Rendering performance",subtitle:"frame_perf samples",children:(0,t.jsx)(F,{perf:e})})}function X({label:e,value:s,unit:n}){return(0,t.jsxs)("div",{className:"rounded-lg bg-ink/60 p-3",children:[(0,t.jsx)("div",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsxs)("div",{className:"mt-1 text-2xl font-semibold tabular-nums text-fg-hi",children:[s,n?(0,t.jsx)("span",{className:"ml-1 text-sm font-normal text-fg-muted",children:n}):null]})]})}function Q(e){return f(e/1048576,1)}function q({bins:e}){if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No FPS samples in range."});let s=[...e].sort((e,t)=>e.bucket-t.bucket),n=s.reduce((e,t)=>Math.max(e,t.sessions),0)||1,l=s.length>1?s[1].bucket-s[0].bucket:10;return(0,t.jsx)("div",{className:"space-y-1.5",children:s.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"w-16 shrink-0 text-right tabular-nums text-fg-muted",children:[e.bucket,"–",e.bucket+l]}),(0,t.jsx)("div",{className:"h-4 flex-1 overflow-hidden rounded bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded bg-emerald-500/70",style:{width:`${e.sessions/n*100}%`}})}),(0,t.jsx)("span",{className:"w-10 shrink-0 tabular-nums text-fg-muted",children:e.sessions})]},e.bucket))})}function Y({data:e}){let{distribution:s,histogram:n,frameTime:l,jank:r,byDevice:a,byScene:i,resources:o,stability:d}=e,c=(s?.samples??0)>0;return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-fg-muted",children:"Performance"}),(0,t.jsx)(b.Panel,{title:"FPS distribution",subtitle:"per-session p05 / p50 / p95, summarized across sessions",children:c?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(X,{label:"p05 FPS (worst)",value:f(s.p05_fps,1)}),(0,t.jsx)(X,{label:"p50 FPS (typical)",value:f(s.p50_fps,1)}),(0,t.jsx)(X,{label:"p95 FPS (best)",value:f(s.p95_fps,1)}),(0,t.jsx)(X,{label:"Sessions",value:f(s.sessions)})]}),(0,t.jsx)(q,{bins:n})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No performance samples in range."})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsx)(b.Panel,{title:"Frame time",subtitle:"per-session median & worst-window p95",children:l&&0!==l.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(X,{label:"p50 frame time",value:f(l.p50_ms,1),unit:"ms"}),(0,t.jsx)(X,{label:"p95 frame time",value:f(l.p95_ms,1),unit:"ms"})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No frame-time samples in range."})}),(0,t.jsx)(b.Panel,{title:"Jank",subtitle:"long frames per sample window",children:r&&0!==r.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(X,{label:"Median session",value:f(r.median_rate,2)}),(0,t.jsx)(X,{label:"Worst decile",value:f(r.worst_decile_rate,2)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No jank data in range."})})]}),(0,t.jsx)(b.Panel,{title:"FPS by device",subtitle:"per-session median FPS, attributed to session_start.device",children:0===a.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No device data in range."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,t.jsx)("thead",{className:"text-xs uppercase tracking-wide text-fg-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Backend"}),(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Mobile"}),(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"GPU"}),(0,t.jsx)("th",{className:"py-1 pr-4 text-right font-medium",children:"Sessions"}),(0,t.jsx)("th",{className:"py-1 text-right font-medium",children:"p50 FPS"})]})}),(0,t.jsx)("tbody",{className:"text-fg",children:a.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t border-ink/60",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.engine||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:"true"===e.is_mobile?"yes":"no"}),(0,t.jsx)("td",{className:"py-1 pr-4 max-w-[16rem] truncate",title:e.renderer,children:e.renderer||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4 text-right tabular-nums",children:f(e.sessions)}),(0,t.jsx)("td",{className:"py-1 text-right tabular-nums",children:f(e.p50_fps,1)})]},`${e.engine}|${e.is_mobile}|${e.renderer}|${s}`))})]})})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsx)(b.Panel,{title:"FPS by scene",subtitle:"per-session median FPS per scene",children:0===i.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No scene data in range."}):(0,t.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,t.jsx)("thead",{className:"text-xs uppercase tracking-wide text-fg-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"py-1 pr-4 font-medium",children:"Scene"}),(0,t.jsx)("th",{className:"py-1 pr-4 text-right font-medium",children:"Sessions"}),(0,t.jsx)("th",{className:"py-1 text-right font-medium",children:"p50 FPS"})]})}),(0,t.jsx)("tbody",{className:"text-fg",children:i.map(e=>(0,t.jsxs)("tr",{className:"border-t border-ink/60",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.scene_id||"—"}),(0,t.jsx)("td",{className:"py-1 pr-4 text-right tabular-nums",children:f(e.sessions)}),(0,t.jsx)("td",{className:"py-1 text-right tabular-nums",children:f(e.p50_fps,1)})]},e.scene_id))})]})}),(0,t.jsx)(b.Panel,{title:"Stability",subtitle:"hard failures frame_perf can't show",children:d?(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(X,{label:"Context losses",value:f(d.context_losses)}),(0,t.jsx)(X,{label:"Compile stalls",value:f(d.compile_stalls)}),(0,t.jsx)(X,{label:"Incidents",value:f(d.incidents)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No stability data in range."})})]}),(0,t.jsx)(b.Panel,{title:"Resource footprint",subtitle:"per-session p50 / p95 of what the scene asked of the device",children:o&&0!==o.sessions?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,t.jsx)(X,{label:"p50 JS heap",value:Q(o.p50_js_heap_bytes),unit:"MB"}),(0,t.jsx)(X,{label:"p50 texture",value:Q(o.p50_texture_bytes),unit:"MB"}),(0,t.jsx)(X,{label:"p50 triangles",value:f(o.p50_triangles)}),(0,t.jsx)(X,{label:"p95 JS heap",value:Q(o.p95_js_heap_bytes),unit:"MB"}),(0,t.jsx)(X,{label:"p95 texture",value:Q(o.p95_texture_bytes),unit:"MB"}),(0,t.jsx)(X,{label:"p95 triangles",value:f(o.p95_triangles)})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No resource samples in range."})})]})}function ee({label:e,value:s,tone:n="neutral",hint:l}){return(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("p",{className:`mt-0.5 text-lg font-semibold tabular-nums ${"bad"===n?"text-red-300":"warn"===n?"text-amber-300":"good"===n?"text-emerald-300":"text-fg-hi"}`,children:s}),l?(0,t.jsx)("p",{className:"text-[11px] text-fg-muted",children:l}):null]})}function et({counts:e,perf:s}){let n=new Map(e.map(e=>[e.event_type,e.count])),l=e=>n.get(e)??0,r=l("session_start"),a=l("runtime_error"),i=l("context_lost"),o=l("focus_change"),d=l("visibility_change"),c=l("viewport_resize"),u=e.reduce((e,t)=>e+t.count,0),x=r>0?a/r:0;return(0,t.jsx)(b.Panel,{title:"Scene health",subtitle:"Errors, GPU context loss & attention gaps in the selected window",children:u>0?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:[(0,t.jsx)(ee,{label:"Errors",value:f(a),tone:a>0?"bad":"good",hint:r>0?`${x.toFixed(2)} / session`:void 0}),(0,t.jsx)(ee,{label:"Context loss",value:f(i),tone:i>0?"warn":"good",hint:"GPU device lost"}),(0,t.jsx)(ee,{label:"Avg FPS",value:s&&s.samples>0?f(s.avg_fps,1):"—",tone:s&&s.samples>0?s.avg_fps>=50?"good":"warn":"neutral",hint:s&&s.samples>0?`min ${f(s.min_fps,0)}`:void 0}),(0,t.jsx)(ee,{label:"Sessions",value:f(r)}),(0,t.jsx)(ee,{label:"Attention",value:f(o+d),hint:"focus + visibility changes"}),(0,t.jsx)(ee,{label:"Resizes",value:f(c),hint:"viewport changes"})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No events in range."})})}function es({label:e,value:s,hint:n}){return(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("p",{className:"mt-0.5 text-lg font-semibold tabular-nums text-fg-hi",children:s}),n?(0,t.jsx)("p",{className:"text-[11px] text-fg-muted",children:n}):null]})}function en({buckets:e,bucketSize:s}){if(0===e.length)return(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera samples in range."});let n=[...e].sort((e,t)=>e.bucket-t.bucket),l=n.reduce((e,t)=>Math.max(e,t.count),0)||1;return(0,t.jsx)("div",{className:"flex flex-col gap-1",children:n.map(e=>{let n=e.bucket*s;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"w-24 shrink-0 text-right font-mono text-[11px] text-fg-muted",children:[f(n,1),"–",f(n+s,1)]}),(0,t.jsx)("div",{className:"h-3.5 flex-1 overflow-hidden rounded-sm bg-ink/60",children:(0,t.jsx)("div",{className:"h-full rounded-sm bg-amber",style:{width:`${e.count/l*100}%`}})}),(0,t.jsx)("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] text-fg-muted",children:f(e.count)})]},e.bucket)})})}function el({coverage:e,cellSize:s,distance:n,bucketSize:l,navigation:r}){let a=e.length,i=e.reduce((e,t)=>e+t.count,0),o=r.reduce((e,t)=>e+t.total_distance,0),d=r.reduce((e,t)=>e+t.segments,0),c=r.reduce((e,t)=>e+t.active_segments,0),u=r.length,x=a>0||r.length>0;return(0,t.jsx)(b.Panel,{title:"Scene traversal",subtitle:"Coverage, camera distance & navigation effort — derived from camera_sample",collapsible:!0,defaultCollapsed:!0,children:x?(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[(0,t.jsx)(es,{label:"Visited cells",value:f(a),hint:`${f(s,2)} u voxels`}),(0,t.jsx)(es,{label:"Camera samples",value:f(i)}),(0,t.jsx)(es,{label:"Avg travel",value:f(u>0?o/u:0,1),hint:u>0?`over ${f(u)} sessions`:void 0}),(0,t.jsx)(es,{label:"Active movement",value:`${f(100*(d>0?c/d:0),0)}%`,hint:"of camera segments"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs uppercase tracking-wide text-fg-muted",children:"Camera distance distribution"}),(0,t.jsx)(en,{buckets:n,bucketSize:l})]})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera samples in range."})})}let er={babylon:"Babylon.js","babylon-lite":"Babylon (lite)",three:"three.js",playcanvas:"PlayCanvas",r3f:"react-three-fiber",aframe:"A-Frame"};function ea({project:e,playgroundUrl:s,onView:l,onOpenOverlay:r}){var a;let i=e.scene,o=i?.engines.length?i.engines:[],[d,c]=(0,n.useState)(i?.defaultEngine??o[0]??""),u=s.length>0&&d.length>0;return(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-fg-hi",children:i?.label??e.name}),(0,t.jsx)("p",{className:"text-xs text-fg-muted",children:e.name})]}),i?(0,t.jsx)("span",{className:"shrink-0 rounded-full border border-edge bg-ink/50 px-2 py-0.5 text-[11px] text-fg-muted",children:"first-person"===i.cameraMode?"first-person":"viewer"}):null]}),i?.description?(0,t.jsx)("p",{className:"text-xs leading-relaxed text-fg-muted",children:i.description}):(0,t.jsx)("p",{className:"text-xs leading-relaxed text-fg-muted",children:"A project without scene metadata — open its analytics directly."}),o.length>1?(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-[11px] text-fg-muted",children:["Engine",(0,t.jsx)("select",{className:"rounded-md border border-edge bg-ink px-2 py-1.5 text-xs text-fg outline-none focus:border-saffron",value:d,onChange:e=>c(e.target.value),children:o.map(e=>(0,t.jsx)("option",{value:e,children:er[e]??e},e))})]}):1===o.length?(0,t.jsxs)("p",{className:"text-[11px] text-fg-muted",children:["Engine: ",er[a=o[0]]??a]}):null,(0,t.jsxs)("div",{className:"mt-auto flex flex-wrap gap-2 pt-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>l(e),className:"rounded-md bg-amber px-3 py-1.5 text-xs font-medium text-ink transition hover:bg-ember",children:"View analytics"}),i?(0,t.jsx)("button",{type:"button",disabled:!u,onClick:()=>r(e,d),className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi disabled:opacity-40",children:"Open live scene"}):null]})]})}function ei({projects:e,playgroundUrl:s,onView:l}){let[r,a]=(0,n.useState)(null),i=(0,n.useMemo)(()=>{let t=[],s=[],n=[];for(let l of e)l.scene?"first-person"===l.scene.cameraMode?s.push(l):t.push(l):n.push(l);return{viewer:t,firstPerson:s,other:n}},[e]),o=(e,t)=>{let n=e.scene;n&&s&&a({url:`${s.replace(/\/$/,"")}/?scene=${encodeURIComponent(n.id)}&engine=${encodeURIComponent(t)}`,title:`${n.label} \xb7 ${er[t]??t}`})},d=(e,n)=>n.length>0?(0,t.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,t.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-fg-muted",children:e}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:n.map(e=>(0,t.jsx)(ea,{project:e,playgroundUrl:s,onView:l,onOpenOverlay:o},e.id))})]}):null;return(0,t.jsxs)(b.Panel,{title:"Scenes",subtitle:"Pick a scene to explore its analytics, or open it live to test capture.",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[d("Viewer",i.viewer),d("First-person",i.firstPerson),d("Other projects",i.other)]}),r?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/70 p-4 sm:p-8",role:"dialog","aria-modal":"true","aria-label":"Live scene overlay",children:(0,t.jsxs)("div",{className:"mx-auto flex h-full w-full max-w-6xl flex-col overflow-hidden rounded-xl border border-edge bg-panel",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-edge px-4 py-2.5",children:[(0,t.jsx)("p",{className:"text-sm text-fg",children:r.title}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("a",{href:r.url,target:"_blank",rel:"noreferrer",className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Open in new tab ↗"}),(0,t.jsx)("button",{type:"button",onClick:()=>a(null),className:"rounded-md border border-edge px-3 py-1.5 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Close ✕"})]})]}),(0,t.jsx)("iframe",{title:r.title,src:r.url,className:"h-full w-full flex-1 bg-ink"})]})}):null]})}function eo({sessions:e,onSelect:s,selectedId:n}){return(0,t.jsx)(b.Panel,{title:"Sessions",subtitle:s?`${e.length} most recent \xb7 select to drill in`:`${e.length} most recent`,children:(0,t.jsx)(z,{sessions:e,onSelect:s,selectedId:n})})}function ed({baseUrl:e,apiKey:s,sessionId:l,scene:a}){let i=(0,n.useRef)(null),[o,d]=(0,n.useState)([]),[c,u]=(0,n.useState)("loading");return(0,n.useEffect)(()=>{let t=!1;return u("loading"),new r.CollectorApi(e,s).sessionTrajectory(l,{scene:a,limit:5e3}).then(e=>{t||(d(e),u("ready"))}).catch(()=>{t||(d([]),u("error"))}),()=>{t=!0}},[e,s,l,a]),(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=e.getContext("2d");if(!t||(t.clearRect(0,0,360,360),t.fillStyle="#0b0e14",t.fillRect(0,0,360,360),0===o.length))return;let s=1/0,n=-1/0,l=1/0,r=-1/0;for(let e of o)e.x<s&&(s=e.x),e.x>n&&(n=e.x),e.z<l&&(l=e.z),e.z>r&&(r=e.z);let a=328/Math.max(n-s,r-l,.001),d=e=>[16+(e.x-s)*a,16+(r-e.z)*a];t.lineWidth=2,t.strokeStyle="#38bdf8",t.beginPath(),o.forEach((e,s)=>{let[n,l]=d(e);0===s?t.moveTo(n,l):t.lineTo(n,l)}),t.stroke();let c=o[0],u=o[o.length-1];if(c){let[e,s]=d(c);t.fillStyle="#22c55e",t.beginPath(),t.arc(e,s,5,0,2*Math.PI),t.fill()}if(u){let[e,s]=d(u);t.fillStyle="#ef4444",t.beginPath(),t.arc(e,s,5,0,2*Math.PI),t.fill()}},[o]),(0,t.jsxs)(b.Panel,{title:"Walked path",subtitle:"Camera trajectory (top-down)",help:"The ordered route this session's camera took across the X/Z ground plane — green is the start, red is the end. Meaningful for first-person (walkable) sessions.",children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("canvas",{ref:i,width:360,height:360,className:"rounded-lg border border-edge","aria-label":"Session camera trajectory"})}),"loading"===c?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"Loading trajectory…"}):"error"===c?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-red-400",children:"Failed to load trajectory."}):0===o.length?(0,t.jsx)("p",{className:"mt-2 text-center text-xs text-fg-muted",children:"No camera movement recorded for this session."}):null]})}function ec(e){return e>=36e5?`${Math.round(e/36e5)}h`:e>=6e4?`${Math.round(e/6e4)}m`:e>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function eu({buckets:e,intervalMs:s,onBrush:l,onClear:r,brushed:a}){let i=(0,n.useRef)(null),o=(0,n.useRef)(null),[d,c]=(0,n.useState)(640),u=(0,n.useRef)(null),[x,m]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>c(Math.max(320,e.clientWidth));t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[]);let h={x:40,y:14,w:Math.max(1,d-40-36),h:114},p=e.length>0?{start:e[0].bucket,end:e[e.length-1].bucket+s}:null,f=(0,n.useCallback)(e=>{if(!p)return 0;let t=(e-h.x)/h.w;return Math.round(p.start+Math.max(0,Math.min(1,t))*(p.end-p.start))},[p,h.x,h.w]);(0,n.useEffect)(()=>{let t=o.current;if(!t)return;let n=t.getContext("2d");if(!n)return;if(n.clearRect(0,0,d,150),n.fillStyle="#0b0e14",n.fillRect(0,0,d,150),0===e.length||!p){n.fillStyle="#64748b",n.font="12px system-ui, sans-serif",n.textAlign="center",n.fillText("No events in range",d/2,75);return}let l=e.reduce((e,t)=>Math.max(e,t.events),0)||1,r=p.end-p.start,a=Math.max(1,h.w/e.length*.8);for(let t of e){let e=h.x+(t.bucket-p.start)/r*h.w,s=t.events/l*h.h;n.fillStyle="rgba(56, 189, 248, 0.55)",n.fillRect(e,h.y+h.h-s,a,s)}if(n.font="10px system-ui, sans-serif",n.textBaseline="middle",n.fillStyle="rgba(56, 189, 248, 0.95)",n.textAlign="right",n.fillText(String(l),h.x-5,h.y+4),n.fillText("0",h.x-5,h.y+h.h),n.textBaseline="alphabetic",n.fillStyle="rgba(56, 189, 248, 0.7)",n.textAlign="left",n.fillText(`events / ${ec(s)}`,h.x,144),x){let e=Math.min(x.x0,x.x1),t=Math.max(x.x0,x.x1);n.fillStyle="rgba(56, 189, 248, 0.18)",n.fillRect(e,h.y,t-e,h.h),n.strokeStyle="rgba(56, 189, 248, 0.8)",n.lineWidth=1,n.strokeRect(e,h.y,t-e,h.h)}},[e,d,p,x,s,h.x,h.y,h.w,h.h]);let g=()=>{let e=u.current;if(u.current=null,m(null),!e||4>Math.abs(e.x1-e.x0))return;let t=f(Math.min(e.x0,e.x1)),s=f(Math.max(e.x0,e.x1));s>t&&l(t,s)};return(0,t.jsx)(b.Panel,{title:"Event volume over time",subtitle:`Bars: events per ${ec(s)} \xb7 drag to zoom the time window`,children:(0,t.jsxs)("div",{ref:i,className:"relative",children:[(0,t.jsx)("canvas",{ref:o,width:d,height:150,className:"w-full cursor-crosshair rounded-lg border border-edge",onMouseDown:e=>{let t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left;u.current={x0:s,x1:s},m({x0:s,x1:s})},onMouseMove:e=>{if(!u.current)return;let t=e.currentTarget.getBoundingClientRect(),s={...u.current,x1:e.clientX-t.left};u.current=s,m(s)},onMouseUp:g,onMouseLeave:g,"aria-label":"Event volume time series"}),a&&r?(0,t.jsx)("button",{type:"button",onClick:r,className:"absolute right-2 top-2 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:"Clear zoom"}):null]})})}var ex=e.i(19761);function em({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 py-0.5",children:[(0,t.jsx)("span",{className:"shrink-0 text-xs text-fg-muted",children:e}),(0,t.jsx)("span",{className:"min-w-0 truncate text-right font-mono text-xs text-fg",title:s,children:s})]})}function eh({title:e,rows:s}){return 0===s.length?null:(0,t.jsxs)("div",{className:"rounded-lg border border-edge bg-ink/40 p-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-fg-muted",children:e}),s.map(([e,s])=>(0,t.jsx)(em,{label:e,value:s},e))]})}function ep(e){let t=[];for(let[s,n]of e){let e=null==n||""===n?null:Array.isArray(n)?n.join(" × "):"boolean"==typeof n?n?"yes":"no":"object"==typeof n?JSON.stringify(n):String(n);null!=e&&t.push([s,e])}return t}function ef({baseUrl:e,apiKey:s,sessionId:l,hiddenTypes:r,onToggleType:a,onSetAllHidden:i}){let o,d,c,[u,x]=(0,n.useState)([]),[m,h]=(0,n.useState)("loading"),[p,f]=(0,n.useState)(null),[g,v]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let t=!1;return h("loading"),f(null),x([]),v(new Set),(async()=>{try{let n=await (0,ex.fetchSessionEvents)({endpoint:e,apiKey:s,sessionId:l});if(t)return;x(n),h(0===n.length?"empty":"ready")}catch(e){if(t)return;h("error"),f(e instanceof Error?e.message:"Failed to load session data.")}})(),()=>{t=!0}},[e,s,l]);let{meta:j,byType:y,allTypes:w,sorted:N}=(0,n.useMemo)(()=>{let e=[...u].sort((e,t)=>e.ts-t.ts),t=new Map;for(let s of e)t.set(s.type,(t.get(s.type)??0)+1);let s=[...t.keys()].sort(),n=e[0];return{meta:{start:n,end:e[e.length-1],startEvent:e.find(e=>"session_start"===e.type)},byType:t,allTypes:s,sorted:e}},[u]);if("ready"!==m)return(0,t.jsx)(b.Panel,{title:"Session data",subtitle:"Metadata and captured event breakdown",children:(0,t.jsx)("p",{className:"py-6 text-center text-sm text-fg-muted",children:"loading"===m?"Loading session data…":"empty"===m?"No events captured for this session.":p??"Session data unavailable."})});let S=j.start,k=j.end,M=j.startEvent,P=S&&k?k.ts-S.ts:0,C=e=>e?new Date(e).toLocaleString():"—",_=S?.pageMeta,R=ep([["Project",S?.projectId],["Session",S?.sessionId],["Visitor",S?.visitorId],["SDK",S?.sdkVersion],["Scene ID",S?.sceneId],["URL",S?.url],["Started",C(S?.ts)],["Ended",C(k?.ts)],["Duration",(d=Math.floor((o=Math.round(P/1e3))/60),c=o%60,d>0?`${d}m ${c}s`:`${c}s`)],["Events",String(N.length)]]),z=_?ep([["Title",_.title],["Language",_.language],["Referrer",_.referrer],["Viewport",_.viewport],["Device pixel ratio",_.devicePixelRatio]]):[],I=M?.type==="session_start"?M.device:void 0,T=M?.type==="session_start"?M.graphics:void 0,A=M?.type==="session_start"?M.scene:void 0,E=M?.type==="session_start"?M.connector:void 0,$=M?.type==="session_start"?M.user:void 0,L=ep([["Engine",I?.engine],["Graphics API",T?.api],["Backend",T?.backend],["API version",T?.apiVersion],["Shading language",T?.shadingLanguage],["GPU vendor",I?.vendor],["GPU renderer",I?.renderer],["Max texture size",I?.maxTextureSize],["CPU cores",I?.hardwareConcurrency],["Device memory (GB)",I?.deviceMemoryGb],["Mobile",I?.isMobile]]),F=ep([["Connector",E?[E.name,E.version].filter(Boolean).join(" "):null],["Coordinate system",E?.coordinateSystem],["Description",A?.description],["Camera type",A?.cameraType],["Camera name",A?.cameraName],["Mesh count",A?.meshCount],["User id",$?.id],["User traits",$?.traits]]),D=w.every(e=>r.has(e));return(0,t.jsxs)(b.Panel,{title:"Session data",subtitle:"Metadata that was sent and a per-feature breakdown — toggle a type to show/hide it in the replay, expand to inspect raw payloads",help:(0,t.jsxs)(t.Fragment,{children:["Project-level metadata beyond the ",(0,t.jsx)("strong",{children:"Project ID"}),"isn't stored in the OSS collector (Phase 1) — everything here is derived from the session's own events. The"," ",(0,t.jsx)("strong",{children:"Device / graphics"})," and ",(0,t.jsx)("strong",{children:"Scene / connector"})," blocks come from the one-time ",(0,t.jsx)("code",{children:"session_start"})," event."]}),children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsx)(eh,{title:"Identity",rows:R}),(0,t.jsx)(eh,{title:"Page context",rows:z}),(0,t.jsx)(eh,{title:"Device / graphics",rows:L}),(0,t.jsx)(eh,{title:"Scene / connector",rows:F})]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-fg-muted",children:["Captured features (",w.length," event types)"]}),(0,t.jsx)("button",{type:"button",onClick:()=>i(!D,w),className:"rounded-md border border-edge px-2 py-1 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:D?"Show all":"Hide all"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2 lg:grid-cols-3",children:w.map(e=>{let s=!r.has(e),n=g.has(e),l=N.filter(t=>t.type===e).slice(0,3);return(0,t.jsxs)("div",{className:`self-start rounded-lg border border-edge bg-ink/40 ${n?"sm:col-span-2 lg:col-span-3":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:s,onChange:()=>a(e),className:"accent-amber"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-fg",children:e})]}),(0,t.jsx)("span",{className:"tabular-nums text-xs text-fg-muted",children:y.get(e)}),(0,t.jsx)("button",{type:"button",onClick:()=>v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),"aria-expanded":n?"true":"false",className:"rounded border border-edge px-1.5 py-0.5 text-[10px] text-fg-muted transition hover:border-amber hover:text-fg-hi",children:n?"Hide raw":"Raw"})]}),n?(0,t.jsxs)("pre",{className:"max-h-64 overflow-auto border-t border-edge bg-black/30 px-3 py-2 text-[10px] leading-relaxed text-fg",children:[l.map(e=>JSON.stringify(e,null,2)).join("\n\n"),(y.get(e)??0)>l.length?`
|
|
2
|
-
|
|
3
|
-
… ${(y.get(e)??0)-l.length} more`:""]}):null]},e)})})]})]})}function eg(e){return e.length>10?`${e.slice(0,8)}…`:e}function eb(e,t){let s=Math.max(0,Math.round((t-e)/1e3));if(s<60)return`${s}s ago`;let n=Math.floor(s/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}let ev={active:"bg-emerald-400",recent:"bg-amber-400",idle:"bg-fg-muted"},ej={idle:"offline",connecting:"connecting…",open:"live",reconnecting:"reconnecting…"};function ey({status:e,sessions:s}){let n="open"===e;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-edge bg-ink px-3 py-1 text-xs",children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[n?(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}):null,(0,t.jsx)("span",{className:`relative inline-flex h-2 w-2 rounded-full ${n?"bg-emerald-400":"idle"===e?"bg-fg-muted":"bg-amber-400"}`})]}),(0,t.jsx)("span",{className:"font-medium text-fg",children:n?`${f(s)} live now`:ej[e]})]})}function ew({snapshot:e,status:s,feed:n,now:l,onSelectSession:r}){let a=e?.sessions??[],i=e?.activeSessions??0,o=e?.activeVisitors??0;return(0,t.jsxs)(b.Panel,{title:"Live now",subtitle:"Active sessions and a real-time event feed, updating in place.",help:(0,t.jsx)(t.Fragment,{children:"Sessions seen within the liveness window, streamed over SSE from the collector. The roster is intentionally non-identifying — no geo, user-agent, or visitor id. Click a session to follow it live."}),children:[(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-4",children:[(0,t.jsx)(ey,{status:s,sessions:i}),(0,t.jsxs)("span",{className:"text-xs text-fg-muted",children:[(0,t.jsx)("span",{className:"font-semibold text-fg",children:f(o)})," visitor",1===o?"":"s"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-2 text-xs uppercase tracking-wide text-fg-muted",children:["Sessions (",a.length,")"]}),0===a.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"open"===s?"No active sessions right now.":"Waiting for live data…"}):(0,t.jsx)("ul",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto pr-1",children:a.map(e=>(0,t.jsx)("li",{children:r?(0,t.jsxs)("button",{type:"button",onClick:()=>r(e.sessionId),className:"flex w-full items-center gap-2 rounded-md border border-transparent px-2 py-1.5 text-left transition hover:border-edge hover:bg-ink",children:[(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${ev[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:eg(e.sessionId)}),(0,t.jsx)("span",{className:"truncate text-xs text-fg-muted",children:e.sceneId}),(0,t.jsx)("span",{className:"ml-auto flex-none text-xs text-fg-muted",children:eb(e.lastSeen,l)})]}):(0,t.jsxs)("div",{className:"flex w-full items-center gap-2 px-2 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${ev[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:eg(e.sessionId)}),(0,t.jsx)("span",{className:"truncate text-xs text-fg-muted",children:e.sceneId}),(0,t.jsx)("span",{className:"ml-auto flex-none text-xs text-fg-muted",children:eb(e.lastSeen,l)})]})},e.sessionId))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs uppercase tracking-wide text-fg-muted",children:"Event feed"}),0===n.length?(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"open"===s?"Listening for events…":"Waiting for live data…"}):(0,t.jsx)("ul",{className:"flex max-h-64 flex-col gap-1 overflow-y-auto pr-1 font-mono text-xs",children:n.map((e,s)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 rounded-md px-2 py-1",children:[(0,t.jsx)("span",{className:"flex-none rounded bg-amber/15 px-1.5 py-0.5 text-[11px] text-saffron",children:e.type}),(0,t.jsx)("span",{className:"text-fg-muted",children:eg(e.sessionId)}),(0,t.jsx)("span",{className:"ml-auto flex-none text-fg-muted",children:eb(e.ts,l)})]},`${e.sessionId}-${e.ts}-${s}`))})]})]})]})}let eN=(0,s.default)(()=>e.A(69091).then(e=>e.SessionReplay),{loadableGenerated:{modules:[12449]},ssr:!1}),eS=(0,s.default)(()=>e.A(33996).then(e=>e.WorldHeatmap3D),{loadableGenerated:{modules:[25453]},ssr:!1}),ek=(0,s.default)(()=>e.A(56403).then(e=>e.ClickRays3D),{loadableGenerated:{modules:[61518]},ssr:!1}),eM=(0,s.default)(()=>e.A(70019).then(e=>e.FlowSankey3D),{loadableGenerated:{modules:[36471]},ssr:!1}),eP={sessions:[],camera:[],perf:null,world:[],gaze:[],clickRays:[],flowLinks:[],flowQuery:{},hasFirstPerson:!1,proxyMeshes:[],timeseries:[],counts:[],coverage:[],distance:[],navigation:[],sources:[],floorPlan:[],performance:{distribution:null,histogram:[],frameTime:null,jank:null,byDevice:[],byScene:[],resources:null,stability:null},intervalMs:36e5};e.s(["default",0,function(){let[e,s]=(0,n.useState)(l.DEFAULT_COLLECTOR_URL),[i,o]=(0,n.useState)(l.DEFAULT_API_KEY),[x,m]=(0,n.useState)([]),[h,p]=(0,n.useState)(""),[f,b]=(0,n.useState)(a),[j,y]=(0,n.useState)([]),[w,N]=(0,n.useState)(eP),[S,k]=(0,n.useState)("idle"),[M,P]=(0,n.useState)(null),[C,_]=(0,n.useState)(null),[R,z]=(0,n.useState)("idle"),[I,T]=(0,n.useState)(new Set),[A,E]=(0,n.useState)([]),[$,L]=(0,n.useState)(()=>Date.now()),[F,D]=(0,n.useState)(0),U=(0,n.useRef)(new Set),B=(0,n.useRef)(f);B.current=f;let H=(0,n.useRef)(a.window),K=(0,n.useRef)(h);K.current=h;let X=(0,n.useRef)(C);X.current=C;let Q=(0,n.useRef)(null),q=(0,n.useRef)(null),ee=(0,n.useRef)(!1),es=(0,n.useCallback)((e,t)=>{let s=`/projects/${encodeURIComponent(e)}`;return t?`${s}/session/${encodeURIComponent(t)}`:s},[]),en=(0,n.useCallback)(e=>{window.location.pathname!==e&&window.history.pushState({},"",e)},[]);(0,n.useEffect)(()=>{let e=window.location.pathname.match(/^\/projects\/([^/]+)(?:\/session\/([^/]+))?/);e?.[1]&&(Q.current=decodeURIComponent(e[1]),e[2]&&(q.current=decodeURIComponent(e[2])))},[]),(0,n.useEffect)(()=>{l.COLLECTOR_URL_IS_PINNED||s(window.location.origin)},[]),(0,n.useEffect)(()=>{let e=!1;return fetch("/api/projects").then(e=>e.ok?e.json():[]).then(t=>{if(e||!Array.isArray(t)||0===t.length)return;m(t);let[s]=t,n=Q.current,r=(n?t.find(e=>e.id===n):void 0)??t.find(e=>e.apiKey===l.DEFAULT_API_KEY)??s;r&&(p(r.id),o(r.apiKey),(n&&r.id===n||1===t.length&&!r.scene)&&(ee.current=!0))}).catch(()=>{}),()=>{e=!0}},[]);let er=(0,n.useCallback)(async t=>{let s=t??i;if(!s){k("error"),P("An API key is required.");return}k("loading"),P(null),_(null),z("idle");let n=B.current,l=c(n),a=d(n),o=new r.CollectorApi(e,s);try{let e=await o.sessions({...l,source:void 0,limit:100}),t=a.until??Date.now(),s=a.since;if(null==s){let n=e.reduce((e,t)=>{var s;let n=(s=t.started_at,new Date(s.includes("T")?s:s.replace(" ","T")+"Z").getTime());return Number.isFinite(n)?Math.min(e,n):e},Date.now());s=Number.isFinite(n)?n:t-864e5}let n=function(e,t=80){let s=Math.max(60,Math.round(e/t/1e3));return u.find(e=>e>=s)??604800}(Math.max(6e4,t-s)),[r,i,d,c,x,m,h,p,f,g,b,v,j,w,S]=await Promise.all([o.cameraHeatmap({...l,source:void 0,bins:36}),o.perf({...l,source:void 0}),o.worldHeatmap({...l,cellSize:.5}),o.gazeHeatmap({...l,source:void 0,cellSize:.5}),o.clickRays({...l,cellSize:.5}),o.flowHeatmap({...l,bins:36,limit:400,groupByOrigin:!0}),o.scenes({since:a.since,until:a.until,limit:200}),o.timeseries({since:a.since,until:a.until,scene:l.scene,interval:n}),o.eventCounts({since:a.since,until:a.until,scene:l.scene}),o.coverage({...l,source:void 0,cellSize:1}),o.cameraDistance({...l,source:void 0,bucketSize:1}),o.navigation({...l,source:void 0}),o.interactionsBySource(l),o.cameraPositionHeatmap({...l,source:void 0,cameraMode:"first-person",cellSize:1}),(async()=>{let[e,t,s,n,r,a,i,d]=await Promise.all([o.perfDistribution({...l,source:void 0}),o.fpsHistogram({...l,source:void 0}),o.frameTimePercentiles({...l,source:void 0}),o.jankRate({...l,source:void 0}),o.perfByDevice({...l,source:void 0}),o.perfByScene({...l,source:void 0,scene:void 0}),o.resourcePercentiles({...l,source:void 0}),o.stabilityCounts({...l,source:void 0})]);return{distribution:e,histogram:t,frameTime:s,jank:n,byDevice:r,byScene:a,resources:i,stability:d}})()]);y(h);let M=l.scene??(1===h.length?h[0]?.scene_id:void 0),P=M?(await o.sceneRepresentation(M).catch(()=>null))?.proxy?.meshes??[]:[];N({sessions:e,camera:r,perf:i,world:d,gaze:c,clickRays:x,flowLinks:m,flowQuery:{since:a.since,until:a.until,scene:l.scene,source:l.source},hasFirstPerson:w.length>0,proxyMeshes:P,timeseries:p,counts:f,coverage:g,distance:b,navigation:v,sources:j,floorPlan:w,performance:S,intervalMs:1e3*n}),k("ready")}catch(e){N(eP),k("error"),P(e instanceof r.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[i,e]),ea=(0,n.useCallback)(e=>{p(e.id),o(e.apiKey),en(es(e.id)),er(e.apiKey)},[er,es,en]);(0,n.useEffect)(()=>{if("idle"===S)return;let e=setTimeout(()=>void er(),300);return()=>clearTimeout(e)},[f]);let ec="idle"!==S&&!!i,ex=(0,n.useRef)(0),em=(0,n.useRef)(!1);em.current=null!=C;let eh=(0,n.useCallback)(e=>{E(t=>[e,...t].slice(0,30)),U.current.forEach(t=>t(e));let t=Date.now();em.current||t-ex.current<5e3||(ex.current=t,er(),D(e=>e+1))},[er]),{snapshot:ep,status:eg}=(0,g.useLivePresence)(e,i,ec);(0,g.useLiveStream)(e,i,ec,eh),(0,n.useEffect)(()=>{if(!ec)return;let e=setInterval(()=>L(Date.now()),1e3);return()=>clearInterval(e)},[ec]);let eb=(0,n.useCallback)(async t=>{let s=c(B.current),n=new r.CollectorApi(e,i),[l,a,o]=await Promise.all([n.cameraHeatmap({...s,source:void 0,bins:36,session:t}),n.perf({...s,source:void 0,session:t}),n.sessionMeta(t).catch(()=>null)]);return{id:t,meta:o,camera:l,perf:a}},[e,i]),ev=(0,n.useCallback)(async e=>{let t=K.current;t&&en(es(t,e)),window.scrollTo({top:0,behavior:"smooth"}),_({id:e,meta:null,camera:[],perf:null}),z("loading"),T(new Set);try{_(await eb(e)),z("ready")}catch(e){z("error"),P(e instanceof r.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[eb,es,en]),ej=(0,n.useCallback)(()=>{let e=K.current;e&&en(es(e)),_(null),z("idle"),T(new Set)},[es,en]),ey=(0,n.useCallback)(e=>{let t=x.find(t=>t.id===e);p(e),t&&o(t.apiKey),N(eP),y([]),k("idle"),P(null),_(null),z("idle"),T(new Set)},[x]),eC=(0,n.useCallback)(e=>{T(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),e_=(0,n.useCallback)((e,t)=>{T(e?new Set(t):new Set)},[]),eR=(0,n.useCallback)((e,t)=>{b(s=>("custom"!==s.window&&(H.current=s.window),{...s,window:"custom",since:e,until:t}))},[]),ez=(0,n.useCallback)(()=>{b(e=>({...e,window:H.current}))},[]);(0,n.useEffect)(()=>{ee.current&&i&&(ee.current=!1,er())},[x,i,er]),(0,n.useEffect)(()=>{if("ready"===S&&q.current){let e=q.current;q.current=null,ev(e)}},[S,ev]),(0,n.useEffect)(()=>{let e=()=>{let e=window.location.pathname.match(/^\/projects\/[^/]+(?:\/session\/([^/]+))?/),t=e?.[1]?decodeURIComponent(e[1]):null;t?X.current?.id!==t&&ev(t):X.current&&ej()};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[ev,ej]);let eI=(0,n.useMemo)(()=>new r.CollectorApi(e,i),[e,i]),eT=(0,n.useMemo)(()=>c(f),[f,F]),eA=(0,n.useCallback)(e=>{let t=U.current;return t.add(e),()=>{t.delete(e)}},[]),eE=(0,n.useMemo)(()=>({selectSession:e=>void ev(e),setTimeRange:(e,t)=>eR(e,t),setFilters:e=>b(t=>({...t,...e}))}),[ev,eR]),e$={api:eI,baseUrl:e,apiKey:i,params:eT,filters:f,capabilities:{hasFirstPerson:w.hasFirstPerson},actions:eE,live:{presence:ep,enabled:ec,subscribe:eA}},eL={...e$,surface:"overview"},eF=C?{...e$,surface:"session",sessionId:C.id}:null,eD=!!(C&&ep?.sessions.some(e=>e.sessionId===C.id)),eU=(0,n.useRef)(eD);return(0,n.useEffect)(()=>{let e=eU.current;if(eU.current=eD,!e||eD)return;let t=X.current;if(!t||"ready"!==R)return;let s=t.id,n=!1;return(async()=>{try{let e=await eb(s);n||X.current?.id!==s||_(e)}catch{}})(),()=>{n=!0}},[eD,R,eb]),(0,n.useEffect)(()=>{if(!eD||"ready"!==R)return;let e=X.current?.id;if(!e)return;let t=!1,s=setInterval(()=>{(async()=>{try{let s=await eb(e);t||X.current?.id!==e||_(s)}catch{}})()},1e3);return()=>{t=!0,clearInterval(s)}},[eD,R,eb]),(0,t.jsxs)("main",{className:"mx-auto max-w-6xl px-6 py-8",children:[(0,t.jsxs)("header",{className:"mb-6 flex items-center gap-3",children:[(0,t.jsx)("img",{src:"/logo.svg",alt:"Uptimizr",width:36,height:36,className:"h-9 w-9 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"font-display text-2xl font-bold text-fg-hi",children:"Uptimizr"}),(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Analytics for 3D scenes — open-source collector."})]})]}),(0,t.jsxs)("form",{className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-edge bg-panel p-4",onSubmit:e=>{e.preventDefault(),h&&en(es(h)),er()},children:[x.length>0?(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-fg-muted",children:["Project",(0,t.jsx)("select",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:h,onChange:e=>ey(e.target.value),children:x.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))})]}):null,(0,t.jsxs)("label",{className:"flex flex-1 flex-col gap-1 text-xs text-fg-muted",children:["Collector URL",(0,t.jsx)("input",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:e,onChange:e=>s(e.target.value),placeholder:"http://localhost:4318"})]}),(0,t.jsxs)("label",{className:"flex flex-1 flex-col gap-1 text-xs text-fg-muted",children:["Project API key",(0,t.jsx)("input",{className:"min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron",value:i,onChange:e=>o(e.target.value),type:"password",placeholder:"utk_…"})]}),(0,t.jsx)("button",{type:"submit",disabled:"loading"===S,className:"rounded-md bg-amber px-4 py-2 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-50",children:"loading"===S?"Loading…":"Load"})]}),"idle"!==S?(0,t.jsx)(V,{filters:f,scenes:j,onChange:b,busy:"loading"===S}):null,M?(0,t.jsx)("div",{className:"mb-6 rounded-lg border border-red-900/60 bg-red-950/40 px-4 py-3 text-sm text-red-300",children:M}):null,"idle"===S?x.length>0?(0,t.jsx)(ei,{projects:x,playgroundUrl:l.DEFAULT_PLAYGROUND_URL,onView:ea}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"Enter your collector URL and a project API key, then load to view analytics."}):C?(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-edge bg-panel p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-fg-muted",children:"Session"}),(0,t.jsx)("p",{className:"font-mono text-sm text-fg",children:C.id}),(0,t.jsx)("p",{className:"mt-1 text-xs text-fg-muted",children:"loading"===R?"Loading session…":[C.meta?.scene?.sceneId?`scene: ${C.meta.scene.sceneId}`:null,C.meta?.device?.gpu?`gpu: ${C.meta.device.gpu}`:null,C.meta?.startedAt?`started: ${C.meta.startedAt}`:null].filter(Boolean).join(" · ")||"No session metadata."})]}),(0,t.jsx)("button",{type:"button",onClick:ej,className:"rounded-md border border-edge px-3 py-2 text-sm text-fg transition hover:border-amber hover:text-fg-hi",children:"← All sessions"})]}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eN,{baseUrl:e,apiKey:i,sessionId:C.id,hiddenTypes:I,isLive:eD})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ef,{baseUrl:e,apiKey:i,sessionId:C.id,hiddenTypes:I,onToggleType:eC,onSetAllHidden:e_})}),(0,t.jsx)(J,{perf:C.perf}),eF?(0,t.jsx)(v,{panels:O,ctx:eF,surface:"session",revision:F}):null,(0,t.jsx)(G,{bins:C.camera,gridSize:36}),C.meta?.scene?.cameraType==="free"?(0,t.jsx)(ed,{baseUrl:e,apiKey:i,sessionId:C.id,scene:C.meta?.scene?.sceneId??f.scene}):null,(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eo,{sessions:w.sessions,selectedId:C.id,onSelect:ev})})]}):(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ew,{snapshot:ep,status:eg,feed:A,now:$,onSelectSession:ev})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eu,{buckets:w.timeseries,intervalMs:w.intervalMs,onBrush:eR,brushed:"custom"===f.window,onClear:ez})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(et,{counts:w.counts,perf:w.perf})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(el,{coverage:w.coverage,cellSize:1,distance:w.distance,bucketSize:1,navigation:w.navigation})}),(0,t.jsx)(J,{perf:w.perf}),(0,t.jsx)(v,{panels:O,ctx:eL,surface:"overview",revision:F}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(Y,{data:w.performance})}),(0,t.jsx)(Z,{rows:w.sources}),(0,t.jsx)(G,{bins:w.camera,gridSize:36}),"viewer"!==f.cameraMode?(0,t.jsx)(W,{bins:w.floorPlan,cellSize:1}):null,(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eS,{voxels:w.world,cellSize:.5,proxyMeshes:w.proxyMeshes})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eS,{voxels:w.gaze,cellSize:.5,proxyMeshes:w.proxyMeshes,title:"Gaze heatmap (3D)",subtitle:"Camera-pose gaze hit-points voxel-binned in world space — what viewers actually look at",legendTitle:"Gaze density",legendLow:"few looks",legendHigh:"most looks",legendNote:"Each marker is a voxel where the camera-forward (gaze) ray hit your scene. Enable gaze capture in the SDK to populate this.",emptyLabel:"No gaze hit-points in range. Enable gaze capture in the SDK."})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ek,{rays:w.clickRays,cellSize:.5,proxyMeshes:w.proxyMeshes})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eM,{links:w.flowLinks,gridSize:36,proxyMeshes:w.proxyMeshes,maxLinks:80,baseUrl:e,apiKey:i,flowQuery:w.flowQuery,hasFirstPerson:w.hasFirstPerson})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(eo,{sessions:w.sessions,onSelect:ev})})]})]})}],14936)}]);
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65296,e=>{"use strict";var o=e.i(12423);let a="helperFunctions",r=`const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08;
|
|
2
|
-
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
|
|
3
|
-
#define saturate(x) clamp(x,0.0,1.0)
|
|
4
|
-
#define absEps(x) abs(x)+Epsilon
|
|
5
|
-
#define maxEps(x) max(x,Epsilon)
|
|
6
|
-
#define saturateEps(x) clamp(x,Epsilon,1.0)
|
|
7
|
-
mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
|
|
8
|
-
vec3(i0.x,i1.x,i2.x),
|
|
9
|
-
vec3(i0.y,i1.y,i2.y),
|
|
10
|
-
vec3(i0.z,i1.z,i2.z)
|
|
11
|
-
);return outMatrix;}
|
|
12
|
-
mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
|
|
13
|
-
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
|
|
14
|
-
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
|
|
15
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
16
|
-
vec3 toLinearSpaceExact(vec3 color)
|
|
17
|
-
{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
|
|
18
|
-
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
19
|
-
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
|
|
20
|
-
#else
|
|
21
|
-
return
|
|
22
|
-
vec3(
|
|
23
|
-
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
|
|
24
|
-
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
|
|
25
|
-
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
|
|
26
|
-
#endif
|
|
27
|
-
}
|
|
28
|
-
vec3 toGammaSpaceExact(vec3 color)
|
|
29
|
-
{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
|
|
30
|
-
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
31
|
-
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
|
|
32
|
-
#else
|
|
33
|
-
return
|
|
34
|
-
vec3(
|
|
35
|
-
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
|
|
36
|
-
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
|
|
37
|
-
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
|
|
38
|
-
#endif
|
|
39
|
-
}
|
|
40
|
-
#endif
|
|
41
|
-
float toLinearSpace(float color)
|
|
42
|
-
{
|
|
43
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
44
|
-
float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
|
|
45
|
-
#else
|
|
46
|
-
return pow(color,LinearEncodePowerApprox);
|
|
47
|
-
#endif
|
|
48
|
-
}
|
|
49
|
-
vec3 toLinearSpace(vec3 color)
|
|
50
|
-
{
|
|
51
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
52
|
-
return toLinearSpaceExact(color);
|
|
53
|
-
#else
|
|
54
|
-
return pow(color,vec3(LinearEncodePowerApprox));
|
|
55
|
-
#endif
|
|
56
|
-
}
|
|
57
|
-
vec4 toLinearSpace(vec4 color)
|
|
58
|
-
{
|
|
59
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
60
|
-
return vec4(toLinearSpaceExact(color.rgb),color.a);
|
|
61
|
-
#else
|
|
62
|
-
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
|
|
63
|
-
#endif
|
|
64
|
-
}
|
|
65
|
-
float toGammaSpace(float color)
|
|
66
|
-
{
|
|
67
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
68
|
-
float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
|
|
69
|
-
#else
|
|
70
|
-
return pow(color,GammaEncodePowerApprox);
|
|
71
|
-
#endif
|
|
72
|
-
}
|
|
73
|
-
vec3 toGammaSpace(vec3 color)
|
|
74
|
-
{
|
|
75
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
76
|
-
return toGammaSpaceExact(color);
|
|
77
|
-
#else
|
|
78
|
-
return pow(color,vec3(GammaEncodePowerApprox));
|
|
79
|
-
#endif
|
|
80
|
-
}
|
|
81
|
-
vec4 toGammaSpace(vec4 color)
|
|
82
|
-
{
|
|
83
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
84
|
-
return vec4(toGammaSpaceExact(color.rgb),color.a);
|
|
85
|
-
#else
|
|
86
|
-
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
|
|
87
|
-
#endif
|
|
88
|
-
}
|
|
89
|
-
float square(float value)
|
|
90
|
-
{return value*value;}
|
|
91
|
-
vec3 square(vec3 value)
|
|
92
|
-
{return value*value;}
|
|
93
|
-
float pow5(float value) {float sq=value*value;return sq*sq*value;}
|
|
94
|
-
vec3 double_refract(vec3 I,vec3 N,float eta) {vec3 Tfront=refract(I,N,1.0/eta);vec3 Nback=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
|
|
95
|
-
float getLuminanceUnclamped(vec3 color)
|
|
96
|
-
{return dot(color,LuminanceEncodeApprox);}
|
|
97
|
-
float getLuminance(vec3 color)
|
|
98
|
-
{return saturate(getLuminanceUnclamped(color));}
|
|
99
|
-
float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
|
|
100
|
-
float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
|
|
101
|
-
const float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}
|
|
102
|
-
vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
|
|
103
|
-
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
104
|
-
vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
105
|
-
float sqrtClamped(float value) {return sqrt(max(value,0.));}
|
|
106
|
-
float avg(vec3 value) {return dot(value,vec3(0.333333333));}
|
|
107
|
-
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
108
|
-
uint extractBits(uint value,int offset,int width) {return (value>>offset) & ((1u<<width)-1u);}
|
|
109
|
-
int onlyBitPosition(uint value) {return (floatBitsToInt(float(value))>>23)-0x7f;}
|
|
110
|
-
vec3 singleScatterToMultiScatterAlbedo(vec3 rho_ss) {vec3 s=sqrt(max(vec3(1.0)-rho_ss,vec3(0.0)));return (vec3(1.0)-s)*(vec3(1.0)-vec3(0.139)*s)/(vec3(1.0)+vec3(1.17)*s);}
|
|
111
|
-
vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return 1.0-s*s;}
|
|
112
|
-
vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms,float aniso) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return (1.0-s*s)/maxEps(1.0-aniso*s*s);}
|
|
113
|
-
float min3(vec3 v) {return min(v.x,min(v.y,v.z));}
|
|
114
|
-
float max3(vec3 v) {return max(v.x,max(v.y,v.z));}
|
|
115
|
-
float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
|
|
116
|
-
vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
|
|
117
|
-
uint2float(rstate*2447445414u));}
|
|
118
|
-
#endif
|
|
119
|
-
`;o.ShaderStore.IncludesShadersStore[a]||(o.ShaderStore.IncludesShadersStore[a]=r),e.s(["helperFunctions",0,{name:a,shader:r}])},85668,6232,44661,92692,97226,e=>{"use strict";var o=e.i(12423);let a="sceneUboDeclaration",r=`layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;
|
|
120
|
-
#ifdef MULTIVIEW
|
|
121
|
-
mat4 viewProjectionR;
|
|
122
|
-
#endif
|
|
123
|
-
mat4 view;mat4 projection;vec4 vEyePosition;mat4 inverseProjection;};
|
|
124
|
-
`;o.ShaderStore.IncludesShadersStore[a]||(o.ShaderStore.IncludesShadersStore[a]=r),e.s(["sceneUboDeclaration",0,{name:a,shader:r}],85668);let t="meshUboDeclaration",i=`#ifdef WEBGL2
|
|
125
|
-
uniform mat4 world;uniform float visibility;
|
|
126
|
-
#else
|
|
127
|
-
layout(std140,column_major) uniform;uniform Mesh
|
|
128
|
-
{mat4 world;float visibility;};
|
|
129
|
-
#endif
|
|
130
|
-
#define WORLD_UBO
|
|
131
|
-
`;o.ShaderStore.IncludesShadersStore[t]||(o.ShaderStore.IncludesShadersStore[t]=i),e.s(["meshUboDeclaration",0,{name:t,shader:i}],6232);let n="defaultUboDeclaration",c=`layout(std140,column_major) uniform;uniform Material
|
|
132
|
-
{vec4 diffuseLeftColor;vec4 diffuseRightColor;vec4 opacityParts;vec4 reflectionLeftColor;vec4 reflectionRightColor;vec4 refractionLeftColor;vec4 refractionRightColor;vec4 emissiveLeftColor;vec4 emissiveRightColor;vec2 vDiffuseInfos;vec2 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec2 vSpecularInfos;vec3 vBumpInfos;mat4 diffuseMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 specularMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;float pointSize;float alphaCutOff;mat4 refractionMatrix;vec4 vRefractionInfos;vec3 vRefractionPosition;vec3 vRefractionSize;vec4 vSpecularColor;vec3 vEmissiveColor;vec4 vDiffuseColor;vec3 vAmbientColor;vec4 cameraInfo;vec4 vTextureRepetitionHexTilingParams;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionPosition;vec3 vReflectionSize;
|
|
133
|
-
#define ADDITIONAL_UBO_DECLARATION
|
|
134
|
-
};
|
|
135
|
-
#include<sceneUboDeclaration>
|
|
136
|
-
#include<meshUboDeclaration>
|
|
137
|
-
`;o.ShaderStore.IncludesShadersStore[n]||(o.ShaderStore.IncludesShadersStore[n]=c),e.s(["defaultUboDeclaration",0,{name:n,shader:c}],44661);let l="mainUVVaryingDeclaration",f=`#ifdef MAINUV{X}
|
|
138
|
-
varying vec2 vMainUV{X};
|
|
139
|
-
#endif
|
|
140
|
-
`;o.ShaderStore.IncludesShadersStore[l]||(o.ShaderStore.IncludesShadersStore[l]=f),e.s(["mainUVVaryingDeclaration",0,{name:l,shader:f}],92692);let s="logDepthDeclaration",d=`#ifdef LOGARITHMICDEPTH
|
|
141
|
-
uniform float logarithmicDepthConstant;varying float vFragmentDepth;
|
|
142
|
-
#endif
|
|
143
|
-
`;o.ShaderStore.IncludesShadersStore[s]||(o.ShaderStore.IncludesShadersStore[s]=d),e.s(["logDepthDeclaration",0,{name:s,shader:d}],97226)},29981,56770,69838,40671,e=>{"use strict";var o=e.i(12423);let a="clipPlaneFragmentDeclaration",r=`#ifdef CLIPPLANE
|
|
144
|
-
varying float fClipDistance;
|
|
145
|
-
#endif
|
|
146
|
-
#ifdef CLIPPLANE2
|
|
147
|
-
varying float fClipDistance2;
|
|
148
|
-
#endif
|
|
149
|
-
#ifdef CLIPPLANE3
|
|
150
|
-
varying float fClipDistance3;
|
|
151
|
-
#endif
|
|
152
|
-
#ifdef CLIPPLANE4
|
|
153
|
-
varying float fClipDistance4;
|
|
154
|
-
#endif
|
|
155
|
-
#ifdef CLIPPLANE5
|
|
156
|
-
varying float fClipDistance5;
|
|
157
|
-
#endif
|
|
158
|
-
#ifdef CLIPPLANE6
|
|
159
|
-
varying float fClipDistance6;
|
|
160
|
-
#endif
|
|
161
|
-
`;o.ShaderStore.IncludesShadersStore[a]||(o.ShaderStore.IncludesShadersStore[a]=r),e.s(["clipPlaneFragmentDeclaration",0,{name:a,shader:r}],29981);let t="fogFragmentDeclaration",i=`#ifdef FOG
|
|
162
|
-
#define FOGMODE_NONE 0.
|
|
163
|
-
#define FOGMODE_EXP 1.
|
|
164
|
-
#define FOGMODE_EXP2 2.
|
|
165
|
-
#define FOGMODE_LINEAR 3.
|
|
166
|
-
#define E 2.71828
|
|
167
|
-
uniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor()
|
|
168
|
-
{float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x)
|
|
169
|
-
{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
|
|
170
|
-
else if (FOGMODE_EXP==vFogInfos.x)
|
|
171
|
-
{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
|
|
172
|
-
else if (FOGMODE_EXP2==vFogInfos.x)
|
|
173
|
-
{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
|
|
174
|
-
return clamp(fogCoeff,0.0,1.0);}
|
|
175
|
-
#endif
|
|
176
|
-
`;o.ShaderStore.IncludesShadersStore[t]||(o.ShaderStore.IncludesShadersStore[t]=i),e.s(["fogFragmentDeclaration",0,{name:t,shader:i}],56770);let n="clipPlaneFragment",c=`#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
|
|
177
|
-
if (false) {}
|
|
178
|
-
#endif
|
|
179
|
-
#ifdef CLIPPLANE
|
|
180
|
-
else if (fClipDistance>0.0)
|
|
181
|
-
{discard;}
|
|
182
|
-
#endif
|
|
183
|
-
#ifdef CLIPPLANE2
|
|
184
|
-
else if (fClipDistance2>0.0)
|
|
185
|
-
{discard;}
|
|
186
|
-
#endif
|
|
187
|
-
#ifdef CLIPPLANE3
|
|
188
|
-
else if (fClipDistance3>0.0)
|
|
189
|
-
{discard;}
|
|
190
|
-
#endif
|
|
191
|
-
#ifdef CLIPPLANE4
|
|
192
|
-
else if (fClipDistance4>0.0)
|
|
193
|
-
{discard;}
|
|
194
|
-
#endif
|
|
195
|
-
#ifdef CLIPPLANE5
|
|
196
|
-
else if (fClipDistance5>0.0)
|
|
197
|
-
{discard;}
|
|
198
|
-
#endif
|
|
199
|
-
#ifdef CLIPPLANE6
|
|
200
|
-
else if (fClipDistance6>0.0)
|
|
201
|
-
{discard;}
|
|
202
|
-
#endif
|
|
203
|
-
`;o.ShaderStore.IncludesShadersStore[n]||(o.ShaderStore.IncludesShadersStore[n]=c),e.s(["clipPlaneFragment",0,{name:n,shader:c}],69838);let l="fogFragment",f=`#ifdef FOG
|
|
204
|
-
float fog=CalcFogFactor();
|
|
205
|
-
#ifdef PBR
|
|
206
|
-
fog=toLinearSpace(fog);
|
|
207
|
-
#endif
|
|
208
|
-
color.rgb=mix(vFogColor,color.rgb,fog);
|
|
209
|
-
#endif
|
|
210
|
-
`;o.ShaderStore.IncludesShadersStore[l]||(o.ShaderStore.IncludesShadersStore[l]=f),e.s(["fogFragment",0,{name:l,shader:f}],40671)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,t=>{"use strict";class e{static GetShadersRepository(t=0){return 0===t?e.ShadersRepository:e.ShadersRepositoryWGSL}static GetShadersStore(t=0){return 0===t?e.ShadersStore:e.ShadersStoreWGSL}static GetIncludesShadersStore(t=0){return 0===t?e.IncludesShadersStore:e.IncludesShadersStoreWGSL}}e.ShadersRepository="src/Shaders/",e.ShadersStore={},e.IncludesShadersStore={},e.ShadersRepositoryWGSL="src/ShadersWGSL/",e.ShadersStoreWGSL={},e.IncludesShadersStoreWGSL={},t.s(["ShaderStore",0,e])},21222,t=>{"use strict";var e=t.i(96265);class s{}s.POINTERDOWN=1,s.POINTERUP=2,s.POINTERMOVE=4,s.POINTERWHEEL=8,s.POINTERPICK=16,s.POINTERTAP=32,s.POINTERDOUBLETAP=64;class i{constructor(t,e){this.type=t,this.event=e}}t.s(["PointerEventTypes",0,s,"PointerInfo",0,class extends i{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(t,e,s,i=null){super(t,e),this._pickInfo=s,this._inputManager=i}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends i{constructor(t,s,i,n){super(t,s),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new e.Vector2(i,n)}}])},36365,t=>{"use strict";class e{}e.KEYDOWN=1,e.KEYUP=2;class s{constructor(t,e){this.type=t,this.event=e}}t.s(["KeyboardEventTypes",0,e,"KeyboardInfo",0,s,"KeyboardInfoPre",0,class extends s{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(t){this.skipOnKeyboardObservable=t}constructor(t,e){super(t,e),this.type=t,this.event=e,this.skipOnKeyboardObservable=!1}}])},76696,t=>{"use strict";var e,s;(s=e||(e={}))[s.PointerMove=0]="PointerMove",s[s.PointerDown=1]="PointerDown",s[s.PointerUp=2]="PointerUp";class i{}i.DOM_DELTA_PIXEL=0,i.DOM_DELTA_LINE=1,i.DOM_DELTA_PAGE=2,t.s(["EventConstants",0,i])},67359,t=>{"use strict";var e=t.i(36395);class s{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._lastSecValueCount++}addCount(t,e){s.Enabled&&(this._current+=t,e&&this._fetchResult())}beginMonitoring(){s.Enabled&&(this._startMonitoringTime=e.PrecisionDate.Now)}endMonitoring(t=!0){if(!s.Enabled)return;t&&this.fetchNewFrame();let i=e.PrecisionDate.Now;this._current=i-this._startMonitoringTime,t&&this._fetchResult()}endFrame(){this._fetchResult()}_fetchResult(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;let t=e.PrecisionDate.Now;t-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=t,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}s.Enabled=!0,t.s(["PerfCounter",0,s])},1773,t=>{"use strict";t.s(["useOpenGLOrientationForUV",()=>!1])},25348,t=>{"use strict";class e{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}toGlobal(t,s){return new e(this.x*t,this.y*s,this.width*t,this.height*s)}toGlobalToRef(t,e,s){return s.x=this.x*t,s.y=this.y*e,s.width=this.width*t,s.height=this.height*e,this}clone(){return new e(this.x,this.y,this.width,this.height)}}t.s(["Viewport",0,e])},70247,t=>{"use strict";var e,s,i,n,r=t.i(96265);(e=i||(i={}))[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE";class a{}a.X=new r.Vector3(1,0,0),a.Y=new r.Vector3(0,1,0),a.Z=new r.Vector3(0,0,1),(s=n||(n={}))[s.X=0]="X",s[s.Y=1]="Y",s[s.Z=2]="Z",t.s(["Axis",0,a,"Coordinate",0,n,"Space",0,i])},44939,t=>{"use strict";var e=t.i(23240);t.s(["DrawWrapper",0,class{static GetEffect(t){return void 0===t.getPipelineContext?t.effect:t}constructor(t,e=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=t.createDrawContext(),e&&(this.materialContext=t.createMaterialContext())}setEffect(t,e,s=!0){this.effect=t,void 0!==e&&(this.defines=e),s&&this.drawContext?.reset()}dispose(t=!1){if(this.effect){let s=this.effect;t?s.dispose():e.TimingTools.SetImmediate(()=>{s.getEngine().onEndFrameObservable.addOnce(()=>{s.dispose()})}),this.effect=null}this.drawContext?.dispose()}}])},49007,t=>{"use strict";t.s(["IntersectionInfo",0,class{constructor(t,e,s){this.bu=t,this.bv=e,this.distance=s,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}])},75991,t=>{"use strict";var e,s,i=t.i(46703),n=t.i(96265),r=t.i(89030);(e=s||(s={}))[e.CW=0]="CW",e[e.CCW=1]="CCW";class a{constructor(t){this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return 180*this._radians/Math.PI}radians(){return this._radians}static BetweenTwoPoints(t,e){let s=e.subtract(t);return new a(Math.atan2(s.y,s.x))}static BetweenTwoVectors(t,e){let s=t.lengthSquared()*e.lengthSquared();if(0===s)return new a(Math.PI/2);s=Math.sqrt(s);let n=t.dot(e)/s;return new a(Math.acos(n=(0,i.Clamp)(n,-1,1)))}static FromRadians(t){return new a(t)}static FromDegrees(t){return new a(t*Math.PI/180)}}class o{constructor(t,e,s){this.startPoint=t,this.midPoint=e,this.endPoint=s;const i=Math.pow(e.x,2)+Math.pow(e.y,2),r=(Math.pow(t.x,2)+Math.pow(t.y,2)-i)/2,o=(i-Math.pow(s.x,2)-Math.pow(s.y,2))/2,h=(t.x-e.x)*(e.y-s.y)-(e.x-s.x)*(t.y-e.y);this.centerPoint=new n.Vector2((r*(e.y-s.y)-o*(t.y-e.y))/h,((t.x-e.x)*o-(e.x-s.x)*r)/h),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=a.BetweenTwoPoints(this.centerPoint,this.startPoint);const l=this.startAngle.degrees();let c=a.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),u=a.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();c-l>180&&(c-=360),c-l<-180&&(c+=360),u-c>180&&(u-=360),u-c<-180&&(u+=360),this.orientation=c-l<0?0:1,this.angle=a.FromDegrees(0===this.orientation?l-u:u-l)}}class h{constructor(t,e){this._points=[],this._length=0,this.closed=!1,this._points.push(new n.Vector2(t,e))}addLineTo(t,e){if(this.closed)return this;let s=new n.Vector2(t,e),i=this._points[this._points.length-1];return this._points.push(s),this._length+=s.subtract(i).length(),this}addArcTo(t,e,s,i,r=36){if(this.closed)return this;let a=new o(this._points[this._points.length-1],new n.Vector2(t,e),new n.Vector2(s,i)),h=a.angle.radians()/r;0===a.orientation&&(h*=-1);let l=a.startAngle.radians()+h;for(let t=0;t<r;t++){let t=Math.cos(l)*a.radius+a.centerPoint.x,e=Math.sin(l)*a.radius+a.centerPoint.y;this.addLineTo(t,e),l+=h}return this}addQuadraticCurveTo(t,e,s,i,n=36){if(this.closed)return this;let r=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i,a=this._points[this._points.length-1];for(let o=0;o<=n;o++){let h=o/n,l=r(h,a.x,t,s),c=r(h,a.y,e,i);this.addLineTo(l,c)}return this}addBezierCurveTo(t,e,s,i,n,r,a=36){if(this.closed)return this;let o=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n,h=this._points[this._points.length-1];for(let l=0;l<=a;l++){let c=l/a,u=o(c,h.x,t,s,n),_=o(c,h.y,e,i,r);this.addLineTo(u,_)}return this}isPointInside(t){let e=!1,s=this._points.length;for(let i=s-1,n=0;n<s;i=n++){let s=this._points[i],r=this._points[n],a=r.x-s.x,o=r.y-s.y;if(Math.abs(o)>Number.EPSILON){if(o<0&&(s=this._points[n],a=-a,r=this._points[i],o=-o),t.y<s.y||t.y>r.y)continue;if(t.y===s.y&&t.x===s.x)return!0;{let i=o*(t.x-s.x)-a*(t.y-s.y);if(0===i)return!0;if(i<0)continue;e=!e}}else{if(t.y!==s.y)continue;if(r.x<=t.x&&t.x<=s.x||s.x<=t.x&&t.x<=r.x)return!0}}return e}close(){return this.closed=!0,this}length(){let t=this._length;if(this.closed){let e=this._points[this._points.length-1];t+=this._points[0].subtract(e).length()}return t}area(){let t=this._points.length,e=0;for(let s=t-1,i=0;i<t;s=i++)e+=this._points[s].x*this._points[i].y-this._points[i].x*this._points[s].y;return .5*e}getPoints(){return this._points}getPointAtLengthPosition(t){if(t<0||t>1)return n.Vector2.Zero();let e=t*this.length(),s=0;for(let t=0;t<this._points.length;t++){let i=(t+1)%this._points.length,r=this._points[t],a=this._points[i].subtract(r),o=a.length()+s;if(e>=s&&e<=o){let t=a.normalize(),i=e-s;return new n.Vector2(r.x+t.x*i,r.y+t.y*i)}s=o}return n.Vector2.Zero()}static StartingAt(t,e){return new h(t,e)}}class l{constructor(t,e=null,s,i=!1){this.path=t,this._curve=[],this._distances=[],this._tangents=[],this._normals=[],this._binormals=[],this._pointAtData={id:0,point:n.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:n.Matrix.Identity()};for(let e=0;e<t.length;e++)this._curve[e]=t[e].clone();this._raw=s||!1,this._alignTangentsWithPath=i,this._compute(e,i)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(t){return this._updatePointAtData(t).point}getTangentAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(t){return this.length()*t}getPreviousPointIndexAt(t){return this._updatePointAtData(t),this._pointAtData.previousPointArrayIndex}getSubPositionAt(t){return this._updatePointAtData(t),this._pointAtData.subPosition}getClosestPositionTo(t){let e=Number.MAX_VALUE,s=0;for(let i=0;i<this._curve.length-1;i++){let r=this._curve[i+0],a=this._curve[i+1].subtract(r).normalize(),o=this._distances[i+1]-this._distances[i+0],h=Math.min(Math.max(n.Vector3.Dot(a,t.subtract(r).normalize()),0)*n.Vector3.Distance(r,t)/o,1),l=n.Vector3.Distance(r.add(a.scale(h*o)),t);l<e&&(e=l,s=(this._distances[i+0]+o*h)/this.length())}return s}slice(t=0,e=1){if(t<0&&(t=1- -1*t%1),e<0&&(e=1- -1*e%1),t>e){let s=t;t=e,e=s}let s=this.getCurve(),i=this.getPointAt(t),n=this.getPreviousPointIndexAt(t),r=this.getPointAt(e),a=this.getPreviousPointIndexAt(e)+1,o=[];return 0!==t&&(n++,o.push(i)),o.push(...s.slice(n,a)),(1!==e||1===t)&&o.push(r),new l(o,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)}update(t,e=null,s=!1){for(let e=0;e<t.length;e++)this._curve[e].x=t[e].x,this._curve[e].y=t[e].y,this._curve[e].z=t[e].z;return this._compute(e,s),this}_compute(t,e=!1){let s,i,r,a,o,h=this._curve.length;if(h<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[h-1]=this._curve[h-1].subtract(this._curve[h-2]),this._raw||this._tangents[h-1].normalize();let l=this._tangents[0],c=this._normalVector(l,t);this._normals[0]=c,this._raw||this._normals[0].normalize(),this._binormals[0]=n.Vector3.Cross(l,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(let t=1;t<h;t++)s=this._getLastNonNullVector(t),t<h-1&&(i=this._getFirstNonNullVector(t),this._tangents[t]=e?i:s.add(i),this._tangents[t].normalize()),this._distances[t]=this._distances[t-1]+this._curve[t].subtract(this._curve[t-1]).length(),r=this._tangents[t],o=this._binormals[t-1],this._normals[t]=n.Vector3.Cross(o,r),this._raw||(0===this._normals[t].length()?(a=this._normals[t-1],this._normals[t]=a.clone()):this._normals[t].normalize()),this._binormals[t]=n.Vector3.Cross(r,this._normals[t]),this._raw||this._binormals[t].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(t){let e=1,s=this._curve[t+e].subtract(this._curve[t]);for(;0===s.length()&&t+e+1<this._curve.length;)e++,s=this._curve[t+e].subtract(this._curve[t]);return s}_getLastNonNullVector(t){let e=1,s=this._curve[t].subtract(this._curve[t-e]);for(;0===s.length()&&t>e+1;)e++,s=this._curve[t].subtract(this._curve[t-e]);return s}_normalVector(t,e){let s,a=t.length();if(0===a&&(a=1),null==e){let e;e=(0,i.WithinEpsilon)(Math.abs(t.y)/a,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.x)/a,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.z)/a,1,r.Epsilon)?n.Vector3.Zero():new n.Vector3(0,0,1):new n.Vector3(1,0,0):new n.Vector3(0,-1,0),s=n.Vector3.Cross(t,e)}else s=n.Vector3.Cross(t,e),n.Vector3.CrossToRef(s,t,s);return s.normalize(),s}_updatePointAtData(t,e=!1){let s;if(this._pointAtData.id===t)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=t;let i=this.getPoints();if(t<=0)return this._setPointAtData(0,0,i[0],0,e);if(t>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,e);let r=i[0],a=0,o=t*this.length();for(let h=1;h<i.length;h++){s=i[h];let l=n.Vector3.Distance(r,s);if((a+=l)===o)return this._setPointAtData(t,1,s,h,e);if(a>o){let i=(a-o)/l,n=r.subtract(s),c=s.add(n.scaleInPlace(i));return this._setPointAtData(t,1-i,c,h-1,e)}r=s}return this._pointAtData}_setPointAtData(t,e,s,i,n){return this._pointAtData.point=s,this._pointAtData.position=t,this._pointAtData.subPosition=e,this._pointAtData.previousPointArrayIndex=i,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=n.Matrix.Identity();let t=this._pointAtData.previousPointArrayIndex;if(t!==this._tangents.length-1){let e=t+1,s=this._tangents[t].clone(),i=this._normals[t].clone(),r=this._binormals[t].clone(),a=this._tangents[e].clone(),o=this._normals[e].clone(),h=this._binormals[e].clone(),l=n.Quaternion.RotationQuaternionFromAxis(i,r,s),c=n.Quaternion.RotationQuaternionFromAxis(o,h,a);n.Quaternion.Slerp(l,c,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class c{static CreateQuadraticBezier(t,e,s,i){i=i>2?i:3;let r=[],a=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i;for(let o=0;o<=i;o++)r.push(new n.Vector3(a(o/i,t.x,e.x,s.x),a(o/i,t.y,e.y,s.y),a(o/i,t.z,e.z,s.z)));return new c(r)}static CreateCubicBezier(t,e,s,i,r){r=r>3?r:4;let a=[],o=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n;for(let h=0;h<=r;h++)a.push(new n.Vector3(o(h/r,t.x,e.x,s.x,i.x),o(h/r,t.y,e.y,s.y,i.y),o(h/r,t.z,e.z,s.z,i.z)));return new c(a)}static CreateHermiteSpline(t,e,s,i,r){let a=[],o=1/r;for(let h=0;h<=r;h++)a.push(n.Vector3.Hermite(t,e,s,i,h*o));return new c(a)}static CreateCatmullRomSpline(t,e,s){let i=[],r=1/e,a=0;if(s){let s=t.length;for(let o=0;o<s;o++){a=0;for(let h=0;h<e;h++)i.push(n.Vector3.CatmullRom(t[o%s],t[(o+1)%s],t[(o+2)%s],t[(o+3)%s],a)),a+=r}i.push(i[0])}else{let s=[];s.push(t[0].clone()),s.push(...t),s.push(t[t.length-1].clone());let o=0;for(;o<s.length-3;o++){a=0;for(let t=0;t<e;t++)i.push(n.Vector3.CatmullRom(s[o],s[o+1],s[o+2],s[o+3],a)),a+=r}o--,i.push(n.Vector3.CatmullRom(s[o],s[o+1],s[o+2],s[o+3],a))}return new c(i)}static ArcThru3Points(t,e,s,i=32,r=!1,a=!1){let o=[],h=e.subtract(t),l=s.subtract(e),u=t.subtract(s),_=n.Vector3.Cross(h,l),d=_.length();if(d<1e-8)return new c(o);let p=h.lengthSquared(),g=l.lengthSquared(),f=u.lengthSquared(),m=_.lengthSquared(),P=.5*h.length()*l.length()*u.length()/d,x=n.Vector3.Dot(h,u),b=n.Vector3.Dot(h,l),v=n.Vector3.Dot(l,u),M=t.scale(-.5*g*x/m).add(e.scale(-.5*f*b/m)).add(s.scale(-.5*p*v/m)),y=t.subtract(M).normalize(),A=n.Vector3.Cross(_,y).normalize();if(a){let e=2*Math.PI/i;for(let t=0;t<=2*Math.PI;t+=e)o.push(M.add(y.scale(P*Math.cos(t)).add(A.scale(P*Math.sin(t)))));o.push(t)}else{let e,n=1/i,a=0;do e=M.add(y.scale(P*Math.cos(a)).add(A.scale(P*Math.sin(a)))),o.push(e),a+=n;while(!e.equalsWithEpsilon(s,P*n*1.1))o.push(s),r&&o.push(t)}return new c(o)}constructor(t){this._length=0,this._points=t,this._length=this._computeLength(t)}getPoints(){return this._points}length(){return this._length}continue(t){let e=this._points[this._points.length-1],s=this._points.slice(),i=t.getPoints();for(let t=1;t<i.length;t++)s.push(i[t].subtract(i[0]).add(e));return new c(s)}_computeLength(t){let e=0;for(let s=1;s<t.length;s++)e+=t[s].subtract(t[s-1]).length();return e}}t.s(["Angle",0,a,"Arc2",0,o,"BezierCurve",0,class{static Interpolate(t,e,s,i,n){if(0===t)return 0;let r=1-3*i+3*e,a=3*i-6*e,o=3*e,h=t;for(let e=0;e<5;e++){let e=h*h,s=e*h*r+a*e+o*h,i=1/(3*r*e+2*a*h+o);h-=(s-t)*i,h=Math.min(1,Math.max(0,h))}return 3*Math.pow(1-h,2)*h*s+3*(1-h)*Math.pow(h,2)*n+Math.pow(h,3)}},"Curve3",0,c,"Orientation",0,s,"Path2",0,h,"Path3D",0,l])},31278,t=>{"use strict";t.s(["EffectFallbacks",0,class{constructor(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}unBindMesh(){this._mesh=null}addFallback(t,e){this._defines[t]||(t<this._currentRank&&(this._currentRank=t),t>this._maxRank&&(this._maxRank=t),this._defines[t]=[]),this._defines[t].push(e)}addCPUSkinningFallback(t,e){this._mesh=e,t<this._currentRank&&(this._currentRank=t),t>this._maxRank&&(this._maxRank=t)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(t,e){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,t=t.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),e._bonesComputationForcedToCPU=!0;let s=this._mesh.getScene();for(let t=0;t<s.meshes.length;t++){let i=s.meshes[t];if(!i.material){!this._mesh.material&&i.computeBonesUsingShaders&&i.numBoneInfluencers>0&&(i.computeBonesUsingShaders=!1);continue}if(i.computeBonesUsingShaders&&0!==i.numBoneInfluencers){if(i.material.getEffect()===e)i.computeBonesUsingShaders=!1;else if(i.subMeshes){for(let t of i.subMeshes)if(t.effect===e){i.computeBonesUsingShaders=!1;break}}}}}else{let e=this._defines[this._currentRank];if(e)for(let s=0;s<e.length;s++)t=t.replace("#define "+e[s],"");this._currentRank++}return t}}])},22369,t=>{"use strict";var e=t.i(96265),s=t.i(23507);class i extends s.Material{constructor(t,s,i=!0,n=!1){super(t,s,void 0,n),this._normalMatrix=new e.Matrix,this._storeEffectOnSubMeshes=i}getEffect(){return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(t,e){return!!t&&(!this._storeEffectOnSubMeshes||!t.subMeshes||0===t.subMeshes.length||this.isReadyForSubMesh(t,t.subMeshes[0],e))}_isReadyForSubMesh(t){let e=t.materialDefines;return!this.checkReadyOnEveryCall&&!!t.effect&&!!e&&e._renderId===this.getScene().getRenderId()}bindOnlyWorldMatrix(t){this._activeEffect.setMatrix("world",t)}bindOnlyNormalMatrix(t){this._activeEffect.setMatrix("normalMatrix",t)}bind(t,e){e&&this.bindForSubMesh(t,e,e.subMeshes[0])}_afterBind(t,e=null,s){super._afterBind(t,e,s),this.getScene()._cachedEffect=e,s?s._drawWrapper._forceRebindOnNextCall=!1:this._drawWrapper._forceRebindOnNextCall=!1}_mustRebind(t,e,s,i=1){return s._drawWrapper._forceRebindOnNextCall||t.isCachedMaterialInvalid(this,e,i)}dispose(t,e,s){this._activeEffect=void 0,super.dispose(t,e,s)}}t.s(["PushMaterial",0,i])},12033,t=>{"use strict";let e=new WeakMap;t.s(["BindVertexPullingUniforms",0,function(t,e){e.forEach((e,s)=>{let i=`vp_${s}_info`;t.setFloat4(i,e.offset,e.stride,e.type,+!!e.normalized)})},"PrepareVertexPullingUniforms",0,function(t){let s=t.getVertexBuffers();if(!s)return null;let i=e.get(t);if(i){let t=!1;for(let e in s)if(!i.has(e)){t=!0;break}if(!t)return i}else i=new Map,e.set(t,i);for(let t in s){let e=s[t];if(e){let s=e.byteOffset,n=e.byteStride,r=e.type,a=e.normalized;i.set(t,{offset:s,stride:n,type:r,normalized:a})}}return i}])},42829,t=>{t.v(e=>Promise.all(["static/chunks/3l1dr_qm_x5kp.js"].map(e=>t.l(e))).then(()=>e(47786)))},76121,t=>{t.v(e=>Promise.all(["static/chunks/00k_j_r7bv_eb.js"].map(e=>t.l(e))).then(()=>e(24572)))},83228,t=>{t.v(e=>Promise.all(["static/chunks/0gv7mblzv3dl3.js"].map(e=>t.l(e))).then(()=>e(24445)))},20169,t=>{t.v(e=>Promise.all(["static/chunks/2p2vv6cc9i-3q.js"].map(e=>t.l(e))).then(()=>e(65644)))},57284,t=>{t.v(e=>Promise.all(["static/chunks/0-2y-_oomza2l.js"].map(e=>t.l(e))).then(()=>e(51075)))}]);
|