@uptimizr/dashboard 0.1.1 → 0.1.2
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 +2 -2
- package/out/__next._full.txt +2 -2
- package/out/__next._head.txt +1 -1
- package/out/__next._index.txt +1 -1
- package/out/__next._tree.txt +1 -1
- package/out/_next/static/chunks/09e4adtr6w0xe.js +1 -0
- package/out/_next/static/chunks/0gg-ii7i6d_p6.js +1 -0
- package/out/_next/static/chunks/0wwkrsvxwi57d.js +1 -0
- package/out/_next/static/chunks/{30yzu213bqtq0.js → 10fnxpln_5xfd.js} +1 -1
- package/out/_next/static/chunks/2clzipqap01hp.js +1 -0
- package/out/_next/static/chunks/2z5eqx5do5std.js +1 -0
- package/out/_next/static/chunks/3aqbf_wkg2sih.js +3 -0
- package/out/_next/static/chunks/{turbopack-2ropzf0axp1x9.js → turbopack-0sgd6pfbe1fy6.js} +1 -1
- package/out/_not-found/__next._full.txt +1 -1
- package/out/_not-found/__next._head.txt +1 -1
- package/out/_not-found/__next._index.txt +1 -1
- package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/out/_not-found/__next._not-found.txt +1 -1
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +1 -1
- package/out/index.html +1 -1
- package/out/index.txt +2 -2
- package/package.json +4 -4
- package/out/_next/static/chunks/00zdau6mcqeae.js +0 -1
- package/out/_next/static/chunks/1lsg-22yob8dx.js +0 -1
- package/out/_next/static/chunks/21o42k82w4llc.js +0 -1
- package/out/_next/static/chunks/2d09v5u7dfq0q.js +0 -1
- package/out/_next/static/chunks/2tws5udjdcmh3.js +0 -1
- package/out/_next/static/chunks/2yiy_l8bwiw2_.js +0 -3
- package/out/_next/static/chunks/30fq_t9e2_fv-.js +0 -1
- /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → vHD3x58R_2B6QWAhZXCg7}/_buildManifest.js +0 -0
- /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → vHD3x58R_2B6QWAhZXCg7}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{Hn5EPlVBFzONWfhyS_1fO → vHD3x58R_2B6QWAhZXCg7}/_ssgManifest.js +0 -0
package/out/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" as="image" href="/logo.svg"/><link rel="stylesheet" href="/_next/static/chunks/0tx1j_ghpz7rc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3sjq_xoi4rbyg.js"/><script src="/_next/static/chunks/
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" as="image" href="/logo.svg"/><link rel="stylesheet" href="/_next/static/chunks/0tx1j_ghpz7rc.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3sjq_xoi4rbyg.js"/><script src="/_next/static/chunks/10fnxpln_5xfd.js" async=""></script><script src="/_next/static/chunks/0tl_moiyi2txt.js" async=""></script><script src="/_next/static/chunks/turbopack-0sgd6pfbe1fy6.js" async=""></script><script src="/_next/static/chunks/0impkpmxx3ttp.js" async=""></script><script src="/_next/static/chunks/0gg-ii7i6d_p6.js" async=""></script><script src="/_next/static/chunks/1flb8adpj6_2o.js" async=""></script><script src="/_next/static/chunks/3aqbf_wkg2sih.js" async=""></script><meta name="next-size-adjust" content=""/><title>Uptimizr — 3D Scene Analytics</title><meta name="description" content="Open-source analytics dashboard for 3D scenes."/><link rel="icon" href="/icon.svg?icon.08h29dad3pcxg.svg" sizes="any" type="image/svg+xml"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><main class="mx-auto max-w-6xl px-6 py-8"><header class="mb-6 flex items-center gap-3"><img src="/logo.svg" alt="Uptimizr" width="36" height="36" class="h-9 w-9 shrink-0"/><div><h1 class="font-display text-2xl font-bold text-fg-hi">Uptimizr</h1><p class="text-sm text-fg-muted">Analytics for 3D scenes — open-source collector.</p></div></header><form class="mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-edge bg-panel p-4"><label class="flex flex-1 flex-col gap-1 text-xs text-fg-muted">Collector URL<input class="min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron" placeholder="http://localhost:4318" value="http://localhost:4318"/></label><label class="flex flex-1 flex-col gap-1 text-xs text-fg-muted">Project API key<input class="min-w-56 rounded-md border border-edge bg-ink px-3 py-2 text-sm text-fg outline-none focus:border-saffron" type="password" placeholder="utk_…" value=""/></label><button type="submit" class="rounded-md bg-amber px-4 py-2 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-50">Load</button></form><p class="text-sm text-fg-muted">Enter your collector URL and a project API key, then load to view analytics.</p></main><!--$--><!--/$--><script src="/_next/static/chunks/3sjq_xoi4rbyg.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[87346,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n3:I[62327,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\"]\n4:I[97541,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"ClientPageRoot\"]\n5:I[14936,[\"/_next/static/chunks/0impkpmxx3ttp.js\",\"/_next/static/chunks/0gg-ii7i6d_p6.js\",\"/_next/static/chunks/1flb8adpj6_2o.js\",\"/_next/static/chunks/3aqbf_wkg2sih.js\"],\"default\"]\n8:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nb:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"ViewportBoundary\"]\nd:I[96686,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"MetadataBoundary\"]\nf:I[50404,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"style\"]\n:HL[\"/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0impkpmxx3ttp.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L4\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@6\",\"$@7\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0gg-ii7i6d_p6.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/1flb8adpj6_2o.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/3aqbf_wkg2sih.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Le\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0tx1j_ghpz7rc.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"vHD3x58R_2B6QWAhZXCg7\"}\n"])</script><script>self.__next_f.push([1,"6:{}\n7:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"10:I[74838,[\"/_next/static/chunks/0impkpmxx3ttp.js\"],\"IconMark\"]\na:null\ne:[[\"$\",\"title\",\"0\",{\"children\":\"Uptimizr — 3D Scene Analytics\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Open-source analytics dashboard for 3D scenes.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?icon.08h29dad3pcxg.svg\",\"sizes\":\"any\",\"type\":\"image/svg+xml\"}],[\"$\",\"$L10\",\"3\",{}]]\n"])</script></body></html>
|
package/out/index.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
2:I[87346,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
|
|
3
3
|
3:I[62327,["/_next/static/chunks/0impkpmxx3ttp.js"],"default"]
|
|
4
4
|
4:I[97541,["/_next/static/chunks/0impkpmxx3ttp.js"],"ClientPageRoot"]
|
|
5
|
-
5:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/
|
|
5
|
+
5:I[14936,["/_next/static/chunks/0impkpmxx3ttp.js","/_next/static/chunks/0gg-ii7i6d_p6.js","/_next/static/chunks/1flb8adpj6_2o.js","/_next/static/chunks/3aqbf_wkg2sih.js"],"default"]
|
|
6
6
|
8:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"OutletBoundary"]
|
|
7
7
|
9:"$Sreact.suspense"
|
|
8
8
|
b:I[96686,["/_next/static/chunks/0impkpmxx3ttp.js"],"ViewportBoundary"]
|
|
@@ -11,7 +11,7 @@ f:I[50404,["/_next/static/chunks/0impkpmxx3ttp.js"],"default",1]
|
|
|
11
11
|
:HL["/_next/static/chunks/0tx1j_ghpz7rc.css","style"]
|
|
12
12
|
:HL["/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
13
13
|
:HL["/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
14
|
-
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/
|
|
14
|
+
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0impkpmxx3ttp.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"space_grotesk_59d6dcf5-module__z_Ctiq__variable jetbrains_mono_38c99671-module__5Dhsuq__variable","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@6","$@7"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/0gg-ii7i6d_p6.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/1flb8adpj6_2o.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/3aqbf_wkg2sih.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lb",null,{"children":"$Lc"}],["$","div",null,{"hidden":true,"children":["$","$Ld",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Le"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$f",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0tx1j_ghpz7rc.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"vHD3x58R_2B6QWAhZXCg7"}
|
|
15
15
|
6:{}
|
|
16
16
|
7:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
|
|
17
17
|
c:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uptimizr/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Uptimizr analytics dashboard — a static-export SPA that reads the collector query API. Serve it standalone, all-in-one via the collector, or drop the assets on any static host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"uptimizr",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"next": "^16.2.9",
|
|
41
41
|
"react": "^19.2.7",
|
|
42
42
|
"react-dom": "^19.2.7",
|
|
43
|
-
"@uptimizr/
|
|
44
|
-
"@uptimizr/
|
|
45
|
-
"@uptimizr/
|
|
43
|
+
"@uptimizr/heatmap": "0.1.1",
|
|
44
|
+
"@uptimizr/react": "0.2.0",
|
|
45
|
+
"@uptimizr/replay": "0.1.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.19.21",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93425,e=>{"use strict";var t=e.i(29212),r=e.i(94179);function s({children:e,label:r="More information"}){return(0,t.jsxs)("span",{className:"group relative inline-flex",children:[(0,t.jsx)("button",{type:"button","aria-label":r,className:"flex h-4 w-4 items-center justify-center rounded-full border border-edge text-[10px] font-bold leading-none text-fg-muted transition hover:border-amber hover:text-fg-hi focus:outline-none focus:ring-1 focus:ring-amber",children:"?"}),(0,t.jsx)("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-6 z-20 w-64 -translate-x-1/2 rounded-md border border-edge bg-ink/95 p-2.5 text-xs font-normal normal-case leading-relaxed tracking-normal text-fg opacity-0 shadow-lg shadow-black/40 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:e})]})}e.s(["Panel",0,function({title:e,subtitle:n,help:i,children:a,className:u="",collapsible:o=!1,defaultCollapsed:l=!1}){let[c,m]=(0,r.useState)(o&&l),p=(0,t.jsxs)("header",{className:c?"":"mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-fg",children:e}),o?(0,t.jsx)("span",{"aria-hidden":"true",className:"text-xs text-fg-muted",children:c?"▸":"▾"}):null,i?(0,t.jsx)(s,{label:`About: ${e}`,children:i}):null]}),n?(0,t.jsx)("p",{className:"mt-0.5 text-xs text-fg-muted",children:n}):null]});return(0,t.jsxs)("section",{className:`rounded-xl border border-edge bg-panel p-4 shadow-lg shadow-black/20 ${u}`,children:[o?(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),"aria-expanded":c?"false":"true",className:"w-full text-left",children:p}):p,c?null:a]})}])},56054,e=>{"use strict";e.s(["HEAT_GRADIENT",0,"linear-gradient(to right, rgb(178,47,38), rgb(224,123,57), rgb(244,200,75))","heatRgb",0,function(e){let t=Math.max(0,Math.min(1,e)),r=[.878,.482,.224],s=(e,t,r)=>[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r,e[2]+(t[2]-e[2])*r];return t<.5?s([.698,.184,.149],r,t/.5):s(r,[.957,.784,.294],(t-.5)/.5)}])},82665,20880,e=>{"use strict";var t=e.i(23838);let r=!!t.default.env.NEXT_PUBLIC_COLLECTOR_URL,s=t.default.env.NEXT_PUBLIC_COLLECTOR_URL??"http://localhost:4318",n="1"===t.default.env.DASHBOARD_STATIC?"":t.default.env.NEXT_PUBLIC_API_KEY??"",i=t.default.env.NEXT_PUBLIC_PLAYGROUND_URL??"http://localhost:5173";e.s(["COLLECTOR_URL_IS_PINNED",0,r,"DEFAULT_API_KEY",0,n,"DEFAULT_COLLECTOR_URL",0,s,"DEFAULT_PLAYGROUND_URL",0,i],82665);class a extends Error{status;constructor(e,t){super(e),this.status=t,this.name="ApiError"}}function u(e){return e.endsWith("/")?e:`${e}/`}e.s(["ApiError",0,a,"CollectorApi",0,class{baseUrl;apiKey;constructor(e,t){this.baseUrl=e,this.apiKey=t}async get(e,t={}){let r=new URL(e,u(this.baseUrl));for(let[e,s]of Object.entries(t))null!=s&&r.searchParams.set(e,String(s));let s=await fetch(r,{headers:{"x-api-key":this.apiKey},cache:"no-store"});if(!s.ok)throw new a(await s.text().catch(()=>"")||s.statusText,s.status);return await s.json()}sessions(e){return this.get("api/v1/sessions",e).then(e=>e.map(e=>({...e,events:Number(e.events)})))}pointerHeatmap(e){return this.get("api/v1/heatmaps/pointer",e)}cameraHeatmap(e){return this.get("api/v1/heatmaps/camera",e)}topMeshes(e){return this.get("api/v1/meshes/top",e).then(e=>e.map(e=>({...e,count:Number(e.count)})))}perf(e){return this.get("api/v1/perf",e).then(e=>({samples:Number(e.samples??0),avg_fps:Number(e.avg_fps??0),min_fps:Number(e.min_fps??0),p50_fps:Number(e.p50_fps??0)}))}perfDistribution(e){return this.get("api/v1/perf/distribution",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p05_fps:Number(t.p05_fps??0),p50_fps:Number(t.p50_fps??0),p95_fps:Number(t.p95_fps??0)}})}fpsHistogram(e){return this.get("api/v1/perf/fps-histogram",e).then(e=>e.map(e=>({bucket:Number(e.bucket??0),sessions:Number(e.sessions??0)})))}frameTimePercentiles(e){return this.get("api/v1/perf/frame-time",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p50_ms:Number(t.p50_ms??0),p95_ms:Number(t.p95_ms??0)}})}jankRate(e){return this.get("api/v1/perf/jank",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),total_long_frames:Number(t.total_long_frames??0),median_rate:Number(t.median_rate??0),worst_decile_rate:Number(t.worst_decile_rate??0)}})}perfByDevice(e){return this.get("api/v1/perf/by-device",e).then(e=>e.map(e=>({engine:String(e.engine??""),is_mobile:String(e.is_mobile??""),renderer:String(e.renderer??""),sessions:Number(e.sessions??0),samples:Number(e.samples??0),p50_fps:Number(e.p50_fps??0)})))}perfByScene(e){return this.get("api/v1/perf/by-scene",e).then(e=>e.map(e=>({scene_id:String(e.scene_id??""),sessions:Number(e.sessions??0),samples:Number(e.samples??0),p50_fps:Number(e.p50_fps??0)})))}resourcePercentiles(e){return this.get("api/v1/perf/resource-percentiles",e).then(e=>{let t=e[0]??{};return{sessions:Number(t.sessions??0),samples:Number(t.samples??0),p50_js_heap_bytes:Number(t.p50_js_heap_bytes??0),p95_js_heap_bytes:Number(t.p95_js_heap_bytes??0),p50_texture_bytes:Number(t.p50_texture_bytes??0),p95_texture_bytes:Number(t.p95_texture_bytes??0),p50_triangles:Number(t.p50_triangles??0),p95_triangles:Number(t.p95_triangles??0)}})}stabilityCounts(e){return this.get("api/v1/perf/stability",e).then(e=>{let t=e[0]??{};return{context_losses:Number(t.context_losses??0),compile_stalls:Number(t.compile_stalls??0),incidents:Number(t.incidents??0)}})}worldHeatmap(e){return this.get("api/v1/heatmaps/world",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count)})))}gazeHeatmap(e){return this.get("api/v1/heatmaps/gaze",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count)})))}cameraPositionHeatmap(e){return this.get("api/v1/heatmaps/position",e).then(e=>e.map(e=>({gx:Number(e.gx),gz:Number(e.gz),avg_y:Number(e.avg_y??0),count:Number(e.count??0)})))}sessionTrajectory(e,t){return this.get(`api/v1/sessions/${encodeURIComponent(e)}/trajectory`,t).then(e=>e.map(e=>({ts:Number(e.ts),x:Number(e.x),y:Number(e.y),z:Number(e.z)})))}clickRays(e){return this.get("api/v1/heatmaps/click-rays",e).then(e=>e.map(e=>({camVoxel:[Number(e.cam_vx),Number(e.cam_vy),Number(e.cam_vz)],origin:[Number(e.origin_x),Number(e.origin_y),Number(e.origin_z)],hitVoxel:[Number(e.hit_vx),Number(e.hit_vy),Number(e.hit_vz)],hit:[Number(e.hit_x),Number(e.hit_y),Number(e.hit_z)],mesh:String(e.mesh??""),count:Number(e.count)})))}flowHeatmap(e){return this.get("api/v1/heatmaps/flow",e).then(e=>e.map(e=>{let t={azimuth_bin:Number(e.azimuth_bin),elevation_bin:Number(e.elevation_bin),mesh:String(e.mesh??""),count:Number(e.count)};return null!=e.origin_vx&&(t.originVoxel=[Number(e.origin_vx),Number(e.origin_vy),Number(e.origin_vz)],t.origin=[Number(e.origin_x),Number(e.origin_y),Number(e.origin_z)]),t}))}scenes(e){return this.get("api/v1/scenes",e).then(e=>e.map(e=>({...e,events:Number(e.events)})))}timeseries(e){return this.get("api/v1/timeseries",e).then(e=>e.map(e=>({bucket:Number(e.bucket),events:Number(e.events??0),avg_fps:Number(e.avg_fps??0)})))}eventCounts(e){return this.get("api/v1/event-counts",e).then(e=>e.map(e=>({event_type:String(e.event_type),count:Number(e.count??0)})))}coverage(e){return this.get("api/v1/coverage",e).then(e=>e.map(e=>({vx:Number(e.vx),vy:Number(e.vy),vz:Number(e.vz),count:Number(e.count??0)})))}cameraDistance(e){return this.get("api/v1/camera/distance",e).then(e=>e.map(e=>({bucket:Number(e.bucket),count:Number(e.count??0)})))}navigation(e){return this.get("api/v1/navigation",e).then(e=>e.map(e=>({session_id:String(e.session_id??""),segments:Number(e.segments??0),total_distance:Number(e.total_distance??0),active_segments:Number(e.active_segments??0),active_distance:Number(e.active_distance??0)})))}interactionsBySource(e){return this.get("api/v1/interactions/sources",e).then(e=>e.map(e=>({event_type:String(e.event_type??""),source:String(e.source??""),count:Number(e.count??0),sessions:Number(e.sessions??0)})))}sessionMeta(e){return this.get(`api/v1/sessions/${encodeURIComponent(e)}/meta`)}async sceneRepresentation(e){try{return await this.get(`api/v1/scenes/${encodeURIComponent(e)}/representation`)}catch(e){if(e instanceof a&&404===e.status)return null;throw e}}async liveToken(){let e=new URL("api/v1/live/token",u(this.baseUrl)),t=await fetch(e,{method:"POST",headers:{"x-api-key":this.apiKey},cache:"no-store"});if(!t.ok)throw new a(await t.text().catch(()=>"")||t.statusText,t.status);return await t.json()}livePresenceUrl(e){let t=new URL("api/v1/live/presence",u(this.baseUrl));return t.searchParams.set("token",e),t.toString()}liveStreamUrl(e,t){let r=new URL("api/v1/live/stream",u(this.baseUrl));return r.searchParams.set("token",e),t&&t.length>0&&r.searchParams.set("types",t.join(",")),r.toString()}liveSessionUrl(e,t){let r=new URL(`api/v1/live/sessions/${encodeURIComponent(t)}`,u(this.baseUrl));return r.searchParams.set("token",e),r.toString()}}],20880)},88725,e=>{"use strict";var t=e.i(94179);e.i(82665);var r=e.i(20880);function s(e,t,r,s){let n={cancelled:!1,source:null,timer:null},i=0,a=async()=>{let a;if(n.cancelled)return;s(0===i?"connecting":"reconnecting");try{let{token:r}=await e.liveToken();a=t(r)}catch{u();return}if(n.cancelled)return;let o=new EventSource(a);n.source=o,o.onopen=()=>{i=0,s("open")},o.onerror=()=>{o.close(),n.source===o&&(n.source=null),u()},r(o)},u=()=>{if(n.cancelled)return;s("reconnecting");let e=Math.min(1e3*2**i,15e3);i+=1,n.timer=setTimeout(()=>void a(),e)};return a(),()=>{n.cancelled=!0,n.timer&&clearTimeout(n.timer),n.source?.close(),n.source=null}}async function n(e,t,r){let s=e.getReader(),n=new TextDecoder,i="";for(t.addEventListener("abort",()=>void s.cancel().catch(()=>{}));;){let{done:e,value:t}=await s.read();if(e)return;let a=(i+=n.decode(t,{stream:!0})).indexOf("\n\n");for(;a>=0;){let e=i.slice(0,a);i=i.slice(a+2);let t="message",s=[];for(let r of e.split("\n"))!r.startsWith(":")&&(r.startsWith("event:")?t=r.slice(6).trim():r.startsWith("data:")&&s.push(r.slice(5).replace(/^ /,"")));"event"===t&&s.length>0&&r(s.join("\n")),a=i.indexOf("\n\n")}}}e.s(["useLivePresence",0,function(e,n,i){let[a,u]=(0,t.useState)(null),[o,l]=(0,t.useState)("idle");return(0,t.useEffect)(()=>{if(!i||!n||!e){l("idle"),u(null);return}let t=new r.CollectorApi(e,n);return s(t,e=>t.livePresenceUrl(e),e=>{e.addEventListener("presence",e=>{try{u(JSON.parse(e.data))}catch{}})},l)},[e,n,i]),{snapshot:a,status:o}},"useLiveSession",0,function(e,s,i,a,u,o){let[l,c]=(0,t.useState)("idle"),[m,p]=(0,t.useState)(!1),[h,b]=(0,t.useState)(0),v=(0,t.useRef)(u),g=(0,t.useRef)(o);return v.current=u,g.current=o,(0,t.useEffect)(()=>{if(!a||!s||!e||!i)return void c("idle");let t=new r.CollectorApi(e,s),u=!1,o=0,l=null,m=null;p(!1),b(0);let h=()=>{if(u)return;c("reconnecting");let e=Math.min(1e3*2**o,15e3);o+=1,m=setTimeout(()=>void d(),e)},d=async()=>{let e;if(!u){c(0===o?"connecting":"reconnecting"),g.current(),b(0);try{({token:e}=await t.liveToken())}catch{h();return}if(!u){l=new AbortController;try{let r=await fetch(t.liveSessionUrl(e,i),{headers:{accept:"text/event-stream"},cache:"no-store",signal:l.signal});if(403===r.status){p(!0),c("idle");return}if(!r.ok||!r.body)return void h();o=0,c("open"),await n(r.body,l.signal,e=>{try{v.current(JSON.parse(e)),b(e=>e+1)}catch{}}),u||h()}catch{u||h()}}}};return d(),()=>{u=!0,m&&clearTimeout(m),l?.abort()}},[e,s,i,a]),{status:l,gated:m,count:h}},"useLiveStream",0,function(e,n,i,a,u){let[o,l]=(0,t.useState)("idle"),c=(0,t.useRef)(a);c.current=a;let m=u&&u.length>0?[...u].sort().join(","):"";return(0,t.useEffect)(()=>{if(!i||!n||!e)return void l("idle");let t=new r.CollectorApi(e,n),a=m?m.split(","):void 0;return s(t,e=>t.liveStreamUrl(e,a),e=>{e.addEventListener("event",e=>{try{c.current(JSON.parse(e.data))}catch{}})},l)},[e,n,i,m]),{status:o}}])},69091,e=>{e.v(t=>Promise.all(["static/chunks/30fq_t9e2_fv-.js"].map(t=>e.l(t))).then(()=>t(12449)))},33996,e=>{e.v(t=>Promise.all(["static/chunks/21o42k82w4llc.js"].map(t=>e.l(t))).then(()=>t(25453)))},58913,e=>{e.v(t=>Promise.all(["static/chunks/2d09v5u7dfq0q.js"].map(t=>e.l(t))).then(()=>t(98568)))},56403,e=>{e.v(t=>Promise.all(["static/chunks/2tws5udjdcmh3.js"].map(t=>e.l(t))).then(()=>t(61518)))},70019,e=>{e.v(t=>Promise.all(["static/chunks/1lsg-22yob8dx.js"].map(t=>e.l(t))).then(()=>t(36471)))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62238,42279,e=>{"use strict";let t=1/1.2;e.s(["ZOOM_IN_FACTOR",0,t,"ZOOM_OUT_FACTOR",0,1.2,"disableWheelZoom",0,function(e){e.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"stepZoom",0,function(e,t){let n=e.lowerRadiusLimit??.01,s=e.upperRadiusLimit??1/0;e.radius=Math.min(s,Math.max(n,e.radius*t))}],62238);var n=e.i(29212);e.s(["ZoomButtons",0,function({onZoom:e}){let s="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,n.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,n.jsx)("button",{type:"button","aria-label":"Zoom in",className:s,onClick:()=>e(t),children:"+"}),(0,n.jsx)("button",{type:"button","aria-label":"Zoom out",className:s,onClick:()=>e(1.2),children:"−"})]})}],42279)},59683,37660,e=>{"use strict";e.s(["attachMeshHover",0,function(e,t,n){let s=0,a=null,i=t=>{let i=t.offsetX,o=t.offsetY;s||(s=requestAnimationFrame(()=>{var t,l;let r;s=0;let c=e.pick(i,o,e=>e.isPickable&&e.isEnabled()),u=c?.pickedMesh?(t=c.pickedMesh,l=c.thinInstanceIndex??-1,(r=t.metadata)?l>=0&&r.hoverLabels?r.hoverLabels[l]??null:r.hoverLabel??null:null):null;u?n({label:u,x:i,y:o}):null!==a&&n(null),a=u}))},o=()=>{s&&(cancelAnimationFrame(s),s=0),null!==a&&(a=null,n(null))};return t.addEventListener("pointermove",i),t.addEventListener("pointerleave",o),()=>{t.removeEventListener("pointermove",i),t.removeEventListener("pointerleave",o),s&&cancelAnimationFrame(s)}}],59683);var t=e.i(29212),n=e.i(56054);e.s(["HeatLegend",0,function({title:e,lowLabel:s="low",highLabel:a="high",note:i}){return(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:e}),(0,t.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:n.HEAT_GRADIENT}}),(0,t.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,t.jsx)("span",{children:s}),(0,t.jsx)("span",{children:a})]}),i?(0,t.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:i}):null]})}],37660)},24543,e=>{"use strict";var t=e.i(29212),n=e.i(94179);e.i(82665);var s=e.i(20880);let a="__other_sp__",i="__other_mesh__";function o(e){return`${e[0]}|${e[1]}|${e[2]}`}function l(e,t){return t<=1?0:1.4-e/(t-1)*2.8}var r=e.i(56054),c=e.i(62238),u=e.i(59683),h=e.i(37660),d=e.i(93425),m=e.i(42279);let f="__all__",b={maxStandpoints:6,maxMeshes:10,maxRibbons:70};function p(e,t){return`${e}|${t}`}function g({label:e,value:n,onChange:s,allLabel:a,options:i}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:[(0,t.jsx)("span",{className:"font-medium text-fg-muted",children:e}),(0,t.jsxs)("select",{className:"max-w-[12rem] bg-transparent text-white outline-none",value:n,onChange:e=>s(e.target.value),children:[(0,t.jsx)("option",{value:f,children:a}),i.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}function x({active:e,onClick:n,children:s,disabled:a=!1,title:i}){return(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,title:i,className:`rounded px-2 py-0.5 font-medium transition ${a?"cursor-not-allowed text-fg-muted/40":e?"bg-amber text-ink":"text-fg-muted hover:text-fg"}`,children:s})}function v({standpoints:e,proxyMeshes:s,selectedKey:a,onSelect:i}){let o=(0,n.useRef)(null),l=(0,n.useMemo)(()=>e.filter(e=>e.origin),[e]),r=(0,n.useMemo)(()=>{let e=1/0,t=-1/0,n=1/0,a=-1/0,i=(s,i)=>{e=Math.min(e,s),t=Math.max(t,s),n=Math.min(n,i),a=Math.max(a,i)};for(let e of s)i(e.aabb[0],e.aabb[2]),i(e.aabb[3],e.aabb[5]);for(let e of l)i(e.origin[0],e.origin[2]);return Number.isFinite(e)?(t-e<.001&&(e-=1,t+=1),a-n<.001&&(n-=1,a+=1),{minX:e,maxX:t,minZ:n,maxZ:a}):{minX:-1,maxX:1,minZ:-1,maxZ:1}},[s,l]),c=(0,n.useMemo)(()=>{let e=Math.min(134/(r.maxX-r.minX),94/(r.maxZ-r.minZ));return(t,n)=>[8+(t-r.minX)*e,8+(n-r.minZ)*e]},[r]),u=(0,n.useMemo)(()=>l.reduce((e,t)=>Math.max(e,t.count),1),[l]);return(0,n.useEffect)(()=>{let e=o.current,t=e?.getContext("2d");if(!t)return;let n=window.devicePixelRatio||1;for(let a of(e.width=150*n,e.height=110*n,t.setTransform(n,0,0,n,0,0),t.clearRect(0,0,150,110),t.fillStyle="rgba(8,10,14,0.85)",t.fillRect(0,0,150,110),t.strokeStyle="rgba(120,140,170,0.35)",t.lineWidth=1,s)){let[e,n]=c(a.aabb[0],a.aabb[2]),[s,i]=c(a.aabb[3],a.aabb[5]);t.strokeRect(Math.min(e,s),Math.min(n,i),Math.abs(s-e),Math.abs(i-n))}for(let e of l){let[n,s]=c(e.origin[0],e.origin[2]),i=2+e.count/u*4,o=e.key===a;t.beginPath(),t.arc(n,s,i,0,2*Math.PI),t.fillStyle=o?"rgba(242,115,242,1)":"rgba(242,115,242,0.55)",t.fill(),o&&(t.beginPath(),t.arc(n,s,i+2.5,0,2*Math.PI),t.strokeStyle="rgba(255,255,255,0.9)",t.lineWidth=1.5,t.stroke())}},[s,l,c,u,a]),(0,t.jsxs)("div",{className:"absolute right-3 top-3 rounded-md border border-edge bg-ink/80 p-1 backdrop-blur",children:[(0,t.jsx)("div",{className:"px-1 pb-0.5 text-[10px] font-medium text-fg-muted",children:"Standpoints (top view)"}),(0,t.jsx)("canvas",{ref:o,className:"h-27.5 w-37.5 cursor-pointer rounded",onClick:e=>{let t=o.current;if(!t||0===l.length)return;let n=t.getBoundingClientRect(),s=(e.clientX-n.left)/n.width*150,a=(e.clientY-n.top)/n.height*110,r=null,u=1/0;for(let e of l){let[t,n]=c(e.origin[0],e.origin[2]),i=(t-s)**2+(n-a)**2;i<u&&(u=i,r=e)}r&&u<=196&&i(r.key)}})]})}e.s(["FlowSankey3D",0,function({links:k,gridSize:w,proxyMeshes:j=[],maxLinks:z=80,baseUrl:y,apiKey:M,flowQuery:$,hasFirstPerson:_=!1}){let I=(0,n.useRef)(null),C=(0,n.useRef)(null),[P,S]=(0,n.useState)("loading"),[A,B]=(0,n.useState)(null),[L,N]=(0,n.useState)(f),[E,q]=(0,n.useState)(f),[R,O]=(0,n.useState)(f),[Z,T]=(0,n.useState)("aggregate"),[F,V]=(0,n.useState)(null),[W,H]=(0,n.useState)("all"),[X,D]=(0,n.useState)(k),U=!!(y&&$),K=(0,n.useMemo)(()=>$?JSON.stringify($):"",[$]),G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!G.current&&_&&(H("first-person"),G.current=!0)},[_]),(0,n.useEffect)(()=>{_&&"viewer"===W&&H("first-person")},[_,W]),(0,n.useEffect)(()=>{U||D(k)},[k,U]),(0,n.useEffect)(()=>{if(!y||!$)return;let e=!1,t=new s.CollectorApi(y,M??""),n="all"===W?void 0:W;return t.flowHeatmap({...$,bins:w,limit:400,groupByOrigin:!0,cameraMode:n}).then(t=>{e||D(t)}).catch(()=>{e||D([])}),()=>{e=!0}},[y,M,K,W,w]);let Y=(0,n.useMemo)(()=>{let e=new Map;for(let t of X){if(!t.originVoxel)continue;let n=o(t.originVoxel),s=t.origin,a=e.get(n);a?(a.count+=t.count,s&&(a.ox+=s[0]*t.count,a.oy+=s[1]*t.count,a.oz+=s[2]*t.count,a.wsum+=t.count)):e.set(n,{key:n,voxel:t.originVoxel,count:t.count,ox:s?s[0]*t.count:0,oy:s?s[1]*t.count:0,oz:s?s[2]*t.count:0,wsum:s?t.count:0})}return[...e.values()].map(e=>({key:e.key,voxel:e.voxel,count:e.count,origin:e.wsum>0?[e.ox/e.wsum,e.oy/e.wsum,e.oz/e.wsum]:void 0})).sort((e,t)=>t.count-e.count)},[X]),J=Y.length>0,Q=(0,n.useMemo)(()=>R===f?null:Y.find(e=>e.key===R)??null,[Y,R]),ee=(0,n.useMemo)(()=>(function(e,t,n,s){let r=e.filter(e=>e.originVoxel);if(0===r.length)return{standpoints:[],gazes:[],meshes:[],ribbons:[],maxCount:1};let c=t.slice(0,Math.max(1,s.maxStandpoints)),u=new Set(c.map(e=>e.key)),h=e=>{let t=e.originVoxel?o(e.originVoxel):a;return u.has(t)?t:a},d=new Map;for(let e of r)d.set(e.mesh,(d.get(e.mesh)??0)+e.count);let m=new Set([...d.entries()].sort((e,t)=>t[1]-e[1]).slice(0,Math.max(1,s.maxMeshes)).map(([e])=>e)),f=e=>m.has(e)?e:i,b=new Map;for(let e of r){let t=h(e),n=f(e.mesh),s=`${t}|${e.azimuth_bin}|${e.elevation_bin}|${n}`,a=b.get(s);a?a.count+=e.count:b.set(s,{standpointId:t,gazeId:`${t}|${e.azimuth_bin}|${e.elevation_bin}`,meshId:n,azimuthBin:e.azimuth_bin,elevationBin:e.elevation_bin,count:e.count})}let p=[...b.values()].sort((e,t)=>t.count-e.count),g=p.slice(0,Math.max(1,s.maxRibbons)),x=p.slice(Math.max(1,s.maxRibbons));if(x.length>0){let e=new Map(g.map(e=>[`${e.standpointId}|${e.azimuthBin}|${e.elevationBin}|${i}`,e]));for(let t of x){let n=`${t.standpointId}|${t.azimuthBin}|${t.elevationBin}|${i}`,s=e.get(n);if(s)s.count+=t.count;else{let s={standpointId:t.standpointId,gazeId:t.gazeId,meshId:i,azimuthBin:t.azimuthBin,elevationBin:t.elevationBin,count:t.count};e.set(n,s),g.push(s)}}}let v=new Set(g.map(e=>e.standpointId)),k=new Set(g.map(e=>e.meshId)),w=[...c.filter(e=>v.has(e.key)).map(e=>e.key),...v.has(a)?[a]:[]],j=w.map((e,t)=>{let n=c.find(t=>t.key===e),s=g.filter(t=>t.standpointId===e).reduce((e,t)=>e+t.count,0);return{id:e,kind:"standpoint",pos:[-2.6,l(t,w.length),0],count:s,label:n?`[${n.voxel[0]}, ${n.voxel[1]}, ${n.voxel[2]}]`:"Other standpoints",isOther:e===a}}),z=new Map(j.map(e=>[e.id,e.pos[1]])),y=new Map;for(let e of g)y.set(e.meshId,(y.get(e.meshId)??0)+e.count);let M=[...k].sort((e,t)=>(y.get(t)??0)-(y.get(e)??0));M.sort((e,t)=>(e===i)-(t===i));let $=M.map((e,t)=>({id:e,kind:"mesh",pos:[2.6,l(t,M.length),0],count:y.get(e)??0,label:e===i?"Other meshes":e,isOther:e===i})),_=new Map;for(let e of g){let t=_.get(e.gazeId);t?t.count+=e.count:_.set(e.gazeId,{az:e.azimuthBin,el:e.elevationBin,sp:e.standpointId,count:e.count})}let I=[..._.entries()].map(([e,t])=>{let s=z.get(t.sp)??0,a=(t.az+.5)/n-.5;return{id:e,kind:"gaze",pos:[0,s+((t.el+.5)/n-.5)*.85,1.6*a],count:t.count,label:`(${t.az}, ${t.el})`,isOther:!1}}),C=g.reduce((e,t)=>Math.max(e,t.count),1);return{standpoints:j,gazes:I,meshes:$,ribbons:g,maxCount:C}})(X,Y,w,b),[X,Y,w]),et="twostage"===Z&&J;(0,n.useEffect)(()=>{"twostage"!==Z||J||T("aggregate")},[Z,J]);let en=(0,n.useMemo)(()=>{if(R!==f&&J)return X.filter(e=>e.originVoxel&&o(e.originVoxel)===R);if(!J)return X;let e=new Map;for(let t of X){let n=`${t.azimuth_bin}|${t.elevation_bin}|${t.mesh}`,s=e.get(n);s?s.count+=t.count:e.set(n,{azimuth_bin:t.azimuth_bin,elevation_bin:t.elevation_bin,mesh:t.mesh,count:t.count})}return[...e.values()]},[X,R,J]),es=(0,n.useMemo)(()=>[...en].sort((e,t)=>t.count-e.count).slice(0,Math.max(1,z)),[en,z]),ea=(0,n.useMemo)(()=>{let e=new Map;for(let t of es)e.set(t.mesh,(e.get(t.mesh)??0)+t.count);return[...e.entries()].sort((e,t)=>t[1]-e[1])},[es]),ei=(0,n.useMemo)(()=>{let e=new Map;for(let t of es){let n=p(t.azimuth_bin,t.elevation_bin),s=e.get(n);s?s.count+=t.count:e.set(n,{azimuthBin:t.azimuth_bin,elevationBin:t.elevation_bin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count)},[es]);(0,n.useEffect)(()=>{!et&&L!==f&&(ea.some(([e])=>e===L)||N(f))},[et,L,ea]),(0,n.useEffect)(()=>{!et&&E!==f&&(ei.some(e=>p(e.azimuthBin,e.elevationBin)===E)||q(f))},[et,E,ei]),(0,n.useEffect)(()=>{!et&&R!==f&&(Y.some(e=>e.key===R)||O(f))},[et,R,Y]),(0,n.useEffect)(()=>{N(f),q(f),O(f)},[Z]);let eo=(0,n.useMemo)(()=>et?ee.ribbons.filter(e=>{let t=R===f||e.standpointId===R,n=E===f||p(e.azimuthBin,e.elevationBin)===E,s=L===f||e.meshId===L;return t&&n&&s}).length:es.filter(e=>{let t=E===f||p(e.azimuth_bin,e.elevation_bin)===E,n=L===f||e.mesh===L;return t&&n}).length,[et,ee,es,L,E,R]),el=et?ee.ribbons.length:es.length,er=(0,n.useMemo)(()=>et?ee.standpoints.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):Y.slice(0,24).map(e=>({value:e.key,label:`[${e.voxel[0]}, ${e.voxel[1]}, ${e.voxel[2]}] \xb7 ${e.count}`})),[et,ee,Y]),ec=(0,n.useMemo)(()=>{if(et){let e=new Map;for(let t of ee.ribbons){let n=p(t.azimuthBin,t.elevationBin),s=e.get(n);s?s.count+=t.count:e.set(n,{az:t.azimuthBin,el:t.elevationBin,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count).map(e=>({value:p(e.az,e.el),label:`(${e.az}, ${e.el}) \xb7 ${e.count}`}))}return ei.map(e=>({value:p(e.azimuthBin,e.elevationBin),label:`(${e.azimuthBin}, ${e.elevationBin}) \xb7 ${e.count}`}))},[et,ee,ei]),eu=(0,n.useMemo)(()=>et?ee.meshes.map(e=>({value:e.id,label:`${e.label} \xb7 ${e.count}`})):ea.map(([e,t])=>({value:e,label:`${e} \xb7 ${t}`})),[et,ee,ea]);return(0,n.useEffect)(()=>{let t=I.current;if(!t||et)return;if(0===es.length)return void S("empty");let n=!1,s=null;return S("loading"),B(null),(async()=>{try{let[{Engine:a},{Scene:i},{ArcRotateCamera:o},{HemisphericLight:l},{Vector3:h,Color3:d,Color4:m},{MeshBuilder:b},{StandardMaterial:g}]=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(96664)]);if(n)return;let x=new a(t,!0,{preserveDrawingBuffer:!1}),v=new i(x);v.clearColor=new m(.04,.05,.07,1);let k=new Map;for(let e of j)k.set(e.name,function(e){let t=e.aabb;return[(t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2]}(e));let z=new Map,y=ea.map(([e])=>e).filter(e=>!k.has(e));for(let e=0;e<y.length;e++){let t=y[e],n=function(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)}(t),s=e/Math.max(1,y.length)*Math.PI*2+n%100/100*.35;z.set(t,[2.2*Math.cos(s),-.35+(n%7-3)*.06,2.2*Math.sin(s)])}for(let[e,t]of k.entries())z.set(e,t);let M=0,$=0,_=0,I=0;for(let e of z.values())M+=e[0],$+=e[1],_+=e[2],I++;let P=new h(M/Math.max(1,I),$/Math.max(1,I),_/Math.max(1,I)),A=1.8;for(let e of z.values()){let t=e[0]-P.x,n=e[1]-P.y,s=e[2]-P.z;A=Math.max(A,Math.sqrt(t*t+n*n+s*s))}let B=.75*A+1,N=Math.max(1,A/1.8),q=es.reduce((e,t)=>Math.max(e,t.count),1),R=new g("flow-source-node",v);R.disableLighting=!0,R.emissiveColor=new d(.45,.75,1);let O=new g("flow-target-node",v);O.disableLighting=!0,O.emissiveColor=new d(1,.82,.42);let Z=new Set,T=new Set,F=e=>{let t=E===f||p(e.azimuth_bin,e.elevation_bin)===E,n=L===f||e.mesh===L;return t&&n},W=new Set,H=new Set;for(let e of es)F(e)&&(W.add(p(e.azimuth_bin,e.elevation_bin)),H.add(e.mesh));for(let e of es){let t=`${e.azimuth_bin}|${e.elevation_bin}`,n=z.get(e.mesh);if(!n)continue;let s=F(e),a=(e.azimuth_bin+.5)/w*Math.PI*2-Math.PI,i=(e.elevation_bin+.5)/w*Math.PI-Math.PI/2,o=Math.cos(i),l=o*Math.cos(a),c=Math.sin(i),u=o*Math.sin(a),m=new h(P.x+l*B,P.y+c*B,P.z+u*B),p=new h(n[0],n[1],n[2]);if(!Z.has(t)){let e=b.CreateSphere(`flow-src-${t}`,{diameter:.12*N,segments:6},v);e.position=m;let n=R.clone(`flow-src-mat-${t}`);n.alpha=W.has(t)||L===f&&E===f?1:.22,e.material=n,e.isPickable=!1,Z.add(t)}if(!T.has(e.mesh)){let t=b.CreateSphere(`flow-target-${e.mesh}`,{diameter:.2*N,segments:7},v);t.position=p;let n=O.clone(`flow-target-mat-${e.mesh}`);n.alpha=H.has(e.mesh)||L===f&&E===f?1:.22,t.material=n,t.isPickable=!0,t.metadata={hoverLabel:e.mesh},T.add(e.mesh)}let x=m.add(p).scale(.5),k=x.subtract(P),j=Math.sqrt(k.x*k.x+k.y*k.y+k.z*k.z),y=j>1e-6?k.x/j:0,M=j>1e-6?k.y/j:1,$=j>1e-6?k.z/j:0,_=(.35+e.count/q*.75)*N,I=new h(x.x+y*_,x.y+M*_+.12*N,x.z+$*_),C=[];for(let e=0;e<=18;e++){let t=e/18,n=1-t;C.push(new h(n*n*m.x+2*n*t*I.x+t*t*p.x,n*n*m.y+2*n*t*I.y+t*t*p.y,n*n*m.z+2*n*t*I.z+t*t*p.z))}let S=e.count/q,[A,V,X]=(0,r.heatRgb)(S),D=b.CreateTube(`flow-link-${e.mesh}-${t}`,{path:C,radius:(s?1:.4)*(.012+.04*S)*N,tessellation:8,cap:0,sideOrientation:0},v),U=new g(`flow-link-mat-${e.mesh}-${t}`,v);U.disableLighting=!0,U.emissiveColor=new d(A,V,X),U.alpha=s?.35+.65*S:.08,D.material=U,D.isPickable=!0,D.metadata={hoverLabel:e.mesh}}let X=new o("flow-cam",Math.PI/4,Math.PI/3,3.4*A,P,v);X.attachControl(t,!0),(0,c.disableWheelZoom)(X),C.current=X,new l("flow-light",new h(.3,1,.2),v);let D=b.CreateSphere("flow-source-dome",{diameter:2*B,segments:20},v);D.position=P;let U=new g("flow-source-dome-mat",v);U.wireframe=!0,U.disableLighting=!0,U.emissiveColor=new d(.16,.2,.28),U.alpha=.35,D.material=U,D.isPickable=!1;let K=Q?.origin;if(K){let e=new h(K[0],K[1],K[2]),t=b.CreateSphere("flow-standpoint",{diameter:.26*N,segments:10},v);t.position=e;let n=new g("flow-standpoint-mat",v);n.disableLighting=!0,n.emissiveColor=new d(.95,.45,.95),t.material=n,t.isPickable=!1;let s=b.CreateLines("flow-standpoint-stem",{points:[e,new h(e.x,P.y,e.z)]},v);s.color=new d(.95,.45,.95),s.isPickable=!1}x.runRenderLoop(()=>v.render());let G=()=>x.resize();window.addEventListener("resize",G);let Y=(0,u.attachMeshHover)(v,t,V);S("ready"),s=()=>{window.removeEventListener("resize",G),Y(),V(null),C.current=null,v.dispose(),x.dispose()}}catch(e){if(n)return;S("error"),B(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{n=!0,s?.()}},[es,w,j,L,E,Q,et]),(0,n.useEffect)(()=>{let t=I.current;if(!t||!et)return;if(0===ee.ribbons.length)return void S("empty");let n=!1,s=null;return S("loading"),B(null),(async()=>{try{let[{Engine:a},{Scene:i},{ArcRotateCamera:o},{HemisphericLight:l},{Vector3:h,Color3:d,Color4:m},{MeshBuilder:b},{StandardMaterial:g}]=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(96664)]);if(n)return;let x=new a(t,!0,{preserveDrawingBuffer:!1}),v=new i(x);v.clearColor=new m(.04,.05,.07,1);let k=e=>{let t=R===f||e.standpointId===R,n=E===f||p(e.azimuthBin,e.elevationBin)===E,s=L===f||e.meshId===L;return t&&n&&s},w=R!==f||E!==f||L!==f,j=new Set;for(let e of ee.ribbons)k(e)&&(j.add(e.standpointId),j.add(e.gazeId),j.add(e.meshId));let z={standpoint:[.95,.45,.95],gaze:[.45,.75,1],mesh:[1,.82,.42]},y={standpoint:.26,gaze:.13,mesh:.22},M=[...ee.standpoints,...ee.gazes,...ee.meshes],$=new Map(M.map(e=>[e.id,e.pos])),_=new Map(M.map(e=>[e.id,e.label]));for(let e of M){let t=b.CreateSphere(`ts-node-${e.kind}-${e.id}`,{diameter:y[e.kind],segments:8},v);t.position=new h(e.pos[0],e.pos[1],e.pos[2]);let n=new g(`ts-node-mat-${e.kind}-${e.id}`,v);n.disableLighting=!0;let[s,a,i]=z[e.kind];n.emissiveColor=new d(s,a,i),n.alpha=!w||j.has(e.id)?1:.2,t.material=n,t.isPickable=!0,t.metadata={hoverLabel:e.label}}let I=(e,t,n)=>{let s=e[0],a=e[1],i=e[2],o=t[0],l=t[1],r=t[2],c=[(s+o)/2,(a+l)/2+n,(i+r)/2],u=[];for(let e=0;e<=12;e++){let t=e/12,n=1-t;u.push(new h(n*n*s+2*n*t*c[0]+t*t*o,n*n*a+2*n*t*c[1]+t*t*l,n*n*i+2*n*t*c[2]+t*t*r))}return u};for(let e of ee.ribbons){let t=$.get(e.standpointId),n=$.get(e.gazeId),s=$.get(e.meshId);if(!t||!n||!s)continue;let a=e.count/ee.maxCount,i=.18+.5*a,o=[...I(t,n,i),...I(n,s,i).slice(1)],l=k(e),[c,u,h]=(0,r.heatRgb)(a),m=b.CreateTube(`ts-link-${e.standpointId}-${e.gazeId}-${e.meshId}`,{path:o,radius:(l?1:.4)*(.012+.04*a),tessellation:8,cap:0,sideOrientation:0},v),f=new g(`ts-link-mat-${e.standpointId}-${e.gazeId}-${e.meshId}`,v);f.disableLighting=!0,f.emissiveColor=new d(c,u,h),f.alpha=l?.35+.65*a:w?.06:.18,m.material=f,m.isPickable=!0,m.metadata={hoverLabel:_.get(e.meshId)??e.meshId}}let P=new o("ts-cam",Math.PI/2,Math.PI/2.4,8.5,h.Zero(),v);P.attachControl(t,!0),(0,c.disableWheelZoom)(P),C.current=P,new l("ts-light",new h(.3,1,.2),v),x.runRenderLoop(()=>v.render());let A=()=>x.resize();window.addEventListener("resize",A);let B=(0,u.attachMeshHover)(v,t,V);S("ready"),s=()=>{window.removeEventListener("resize",A),B(),V(null),C.current=null,v.dispose(),x.dispose()}}catch(e){if(n)return;S("error"),B(e instanceof Error?e.message:"Failed to render flow links.")}})(),()=>{n=!0,s?.()}},[et,ee,R,E,L]),(0,t.jsx)(d.Panel,{title:"Flow Sankey (3D)",subtitle:"Direction-bin → mesh links (aggregate), or standpoint → gaze → mesh (two-stage)",help:(0,t.jsxs)(t.Fragment,{children:["Each ",(0,t.jsx)("strong",{children:"source"})," is a camera ",(0,t.jsx)("em",{children:"gaze-direction bin"})," — a cell on the sphere of where viewers were looking (grouped by azimuth/elevation). Each"," ",(0,t.jsx)("strong",{children:"target"})," is a ",(0,t.jsx)("em",{children:"mesh that was clicked"}),". A ribbon's thickness is how many clicks on that mesh happened while viewers looked from that direction, so you can see which viewpoints drive interaction with which objects. When the scene reports"," ",(0,t.jsx)("em",{children:"standpoints"}),'(where the viewer stood, §7.8), pick one to gate the flow to clicks made from that vantage — a pin marks it in the scene. "All standpoints" is the aggregate view. Switch to ',(0,t.jsx)("strong",{children:"Two-stage"})," for a three-column"," ",(0,t.jsx)("em",{children:"standpoint → gaze sector → mesh"}),'flow with a birdview minimap; the busiest standpoints/meshes are kept and the tail folds into an "Other" node.']}),children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:I,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),F?(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:F.x+12,top:F.y+12},children:F.label}):null,"ready"===P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex flex-wrap gap-2",children:[J?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(x,{active:!et,onClick:()=>T("aggregate"),children:"Aggregate"}),(0,t.jsx)(x,{active:et,onClick:()=>T("twostage"),children:"Two-stage"})]}):null,U?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-edge bg-ink/80 p-0.5 text-xs backdrop-blur",children:[(0,t.jsx)(x,{active:"first-person"===W,onClick:()=>H("first-person"),children:"Walk"}),(0,t.jsx)(x,{active:"viewer"===W,onClick:()=>H("viewer"),disabled:_,title:_?"Orbit (viewer) flow isn't available for walkable scenes":void 0,children:"Orbit"}),(0,t.jsx)(x,{active:"all"===W,onClick:()=>H("all"),children:"All"})]}):null,J?(0,t.jsx)(g,{label:"Standpoint",value:R,onChange:O,allLabel:"All standpoints",options:er}):null,(0,t.jsx)(g,{label:et?"Gaze":"Source",value:E,onChange:q,allLabel:et?"All gaze sectors":"All sources",options:ec}),(0,t.jsx)(g,{label:"Mesh",value:L,onChange:N,allLabel:"All meshes",options:eu})]}),et?(0,t.jsx)(v,{standpoints:Y,proxyMeshes:j,selectedKey:R,onSelect:e=>O(t=>t===e?f:e)}):null,(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-3 right-3 flex max-w-[20rem] flex-col items-end gap-2",children:[U&&!_?(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg-muted backdrop-blur",children:["Orbit-dominated scene — viewer ",(0,t.jsx)("em",{children:"position"})," adds little here. Use the"," ",(0,t.jsx)("strong",{children:"View dome"})," (§7.5) above for where viewers looked."]}):null,(0,t.jsxs)("div",{className:"rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:["Active links: ",eo,"/",el]})]}),(0,t.jsx)(m.ZoomButtons,{onZoom:e=>C.current&&(0,c.stepZoom)(C.current,e)}),(0,t.jsx)(h.HeatLegend,{title:"Flow volume",lowLabel:"fewer links",highLabel:"dominant links",note:et?"Three columns: standpoint → gaze sector → mesh. Top standpoints/meshes are kept; the tail folds into an “Other” node. Pick a standpoint (or click the minimap), gaze sector, or mesh to emphasize matching ribbons.":"Each arc aggregates clicks from one camera-direction bin to a mesh. Pick a source or mesh to emphasize matching links and dim the rest."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===P?"Rendering…":"empty"===P?"No aggregate flow links in range.":"error"===P?A??"Flow view unavailable.":null})]})})}],24543)},36471,e=>{e.n(e.i(24543))},66022,e=>{e.v(t=>Promise.all(["static/chunks/0ys9-ozuluawt.js","static/chunks/2ycvtdd68gub7.js","static/chunks/0v82oqyoy9zol.js","static/chunks/18u58lorfahxi.js","static/chunks/1nj82er7msdto.js","static/chunks/0ufbyo1x3qkmo.js","static/chunks/1yehxf-fmeicg.js"].map(t=>e.l(t))).then(()=>t(94080)))},48505,e=>{e.v(t=>Promise.all(["static/chunks/3v5ha25nxo43j.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/1nj82er7msdto.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js"].map(t=>e.l(t))).then(()=>t(73073)))},53976,e=>{e.v(t=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/10r_824wzt8hj.js","static/chunks/2aor7m-wbis85.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/25b9x-li-tvk2.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js","static/chunks/18u58lorfahxi.js"].map(t=>e.l(t))).then(()=>t(18662)))},42436,e=>{e.v(t=>Promise.all(["static/chunks/37vzwr3ciejf1.js","static/chunks/157d9euci08yu.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(t=>e.l(t))).then(()=>t(12847)))},89370,e=>{e.v(t=>Promise.all(["static/chunks/0dm32-jq30tg8.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(t=>e.l(t))).then(()=>t(62566)))},67141,e=>{e.v(t=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3mqy-84_ul3t2.js","static/chunks/1_aahautsz2v_.js","static/chunks/3t06schbtqonl.js","static/chunks/1thjncpj7u6pq.js","static/chunks/10r_824wzt8hj.js","static/chunks/1vdjn0pkoyypn.js","static/chunks/1nj82er7msdto.js","static/chunks/0aznt7717miff.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2aelw3far6rii.js","static/chunks/3nz-dh9d7cehk.js"].map(t=>e.l(t))).then(()=>t(97998)))},20693,e=>{e.v(t=>Promise.all(["static/chunks/1-61zh4waha61.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/1zx2q-r32thv1.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2u6shh3oeycm-.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js"].map(t=>e.l(t))).then(()=>t(32550)))},96664,e=>{e.v(t=>Promise.all(["static/chunks/1o1d0p-v1z8ty.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/3pufs8g4ui943.js","static/chunks/1nj82er7msdto.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js","static/chunks/3nz-dh9d7cehk.js"].map(t=>e.l(t))).then(()=>t(44981)))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62238,42279,t=>{"use strict";let e=1/1.2;t.s(["ZOOM_IN_FACTOR",0,e,"ZOOM_OUT_FACTOR",0,1.2,"disableWheelZoom",0,function(t){t.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"stepZoom",0,function(t,e){let s=t.lowerRadiusLimit??.01,a=t.upperRadiusLimit??1/0;t.radius=Math.min(a,Math.max(s,t.radius*e))}],62238);var s=t.i(29212);t.s(["ZoomButtons",0,function({onZoom:t}){let a="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:a,onClick:()=>t(e),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:a,onClick:()=>t(1.2),children:"−"})]})}],42279)},59683,37660,t=>{"use strict";t.s(["attachMeshHover",0,function(t,e,s){let a=0,n=null,i=e=>{let i=e.offsetX,r=e.offsetY;a||(a=requestAnimationFrame(()=>{var e,l;let c;a=0;let o=t.pick(i,r,t=>t.isPickable&&t.isEnabled()),h=o?.pickedMesh?(e=o.pickedMesh,l=o.thinInstanceIndex??-1,(c=e.metadata)?l>=0&&c.hoverLabels?c.hoverLabels[l]??null:c.hoverLabel??null:null):null;h?s({label:h,x:i,y:r}):null!==n&&s(null),n=h}))},r=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",r),()=>{e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",r),a&&cancelAnimationFrame(a)}}],59683);var e=t.i(29212),s=t.i(56054);t.s(["HeatLegend",0,function({title:t,lowLabel:a="low",highLabel:n="high",note:i}){return(0,e.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,e.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:t}),(0,e.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:s.HEAT_GRADIENT}}),(0,e.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:n})]}),i?(0,e.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:i}):null]})}],37660)},38413,t=>{"use strict";var e=t.i(29212),s=t.i(94179),a=t.i(56054),n=t.i(62238),i=t.i(59683),r=t.i(37660),l=t.i(93425),c=t.i(42279);function o({shape:t,onChange:s}){let a=t=>`h-8 px-2.5 text-xs font-medium leading-none transition first:rounded-l-md last:rounded-r-md ${t?"bg-ink text-white":"bg-ink/80 text-fg hover:text-white"}`,n="sphere"===t,i="cube"===t;return(0,e.jsxs)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge backdrop-blur",role:"group","aria-label":"Voxel marker shape",children:[(0,e.jsx)("button",{type:"button",className:a(n),"aria-pressed":n,onClick:()=>s("sphere"),children:"Spheres"}),(0,e.jsx)("button",{type:"button",className:a(i),"aria-pressed":i,onClick:()=>s("cube"),children:"Cubes"})]})}t.s(["WorldHeatmap3D",0,function({voxels:h,cellSize:u,proxyMeshes:d=[],title:m="World heatmap (3D)",subtitle:j="Pointer hit-points voxel-binned in world space — drag to orbit, +/- to zoom",legendTitle:k="Pointer-hit density",legendLow:f="few hits",legendHigh:b="most hits",legendNote:v="Each marker is a voxel where the pointer hit your scene. Color & size scale with hits, normalized to the busiest cell.",emptyLabel:x="No 3D hit-points in range."}){let p=(0,s.useRef)(null),y=(0,s.useRef)(null),[g,w]=(0,s.useState)("loading"),[z,q]=(0,s.useState)(null),[A,M]=(0,s.useState)("sphere"),[_,C]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=p.current;if(!e)return;if(0===h.length&&0===d.length)return void w("empty");let s=!1,r=null;return w("loading"),q(null),(async()=>{try{let[{Engine:l},{Scene:c},{ArcRotateCamera:o},{HemisphericLight:m},{Vector3:j,Color3:k,Color4:f,Matrix:b},{MeshBuilder:v},{StandardMaterial:x}]=await Promise.all([t.A(66022),t.A(48505),t.A(53976),t.A(42436),t.A(89370),t.A(67141),t.A(20693),t.A(9607),t.A(96664)]);if(s)return;let p=h.reduce((t,e)=>Math.max(t,e.count),1),g=0,z=0,q=0,M=0;for(let t of h)g+=(t.vx+.5)*u,z+=(t.vy+.5)*u,q+=(t.vz+.5)*u,M++;if(0===M)for(let t of d)g+=(t.aabb[0]+t.aabb[3])/2,z+=(t.aabb[1]+t.aabb[4])/2,q+=(t.aabb[2]+t.aabb[5])/2,M++;let _=new j(g/M,z/M,q/M),P=4*u;for(let t of h){let e=(t.vx+.5)*u-_.x,s=(t.vy+.5)*u-_.y,a=(t.vz+.5)*u-_.z;P=Math.max(P,Math.sqrt(e*e+s*s+a*a))}for(let t of d){let e=(t.aabb[0]+t.aabb[3])/2-_.x,s=(t.aabb[1]+t.aabb[4])/2-_.y,a=(t.aabb[2]+t.aabb[5])/2-_.z;P=Math.max(P,Math.sqrt(e*e+s*s+a*a))}let L=new l(e,!0,{preserveDrawingBuffer:!1}),N=new c(L);N.clearColor=new f(.04,.05,.07,1);let R=new o("world-cam",Math.PI/4,Math.PI/3,2.4*P,_,N);if(R.attachControl(e,!0),(0,n.disableWheelZoom)(R),y.current=R,new m("world-light",new j(.4,1,.3),N),d.length>0){let t=v.CreateBox("scene-proxy",{size:1},N),e=new x("scene-proxy-mat",N);e.wireframe=!0,e.disableLighting=!0,e.emissiveColor=new k(.32,.4,.52),e.alpha=.35,t.material=e,t.isPickable=!0,t.thinInstanceEnablePicking=!0,t.metadata={hoverLabels:d.map(t=>t.name)};let s=d.length,a=new Float32Array(16*s);for(let t=0;t<s;t++){let e=d[t].aabb,s=Math.max(e[3]-e[0],.001),n=Math.max(e[4]-e[1],.001),i=Math.max(e[5]-e[2],.001);b.Scaling(s,n,i).multiply(b.Translation((e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2)).copyToArray(a,16*t)}t.thinInstanceSetBuffer("matrix",a,16,!0)}if(h.length>0){let t="cube"===A?v.CreateBox("world-voxel",{size:.9*u},N):v.CreateSphere("world-voxel",{diameter:.9*u,segments:6},N),e=new x("world-voxel-mat",N);e.diffuseColor=new k(1,1,1),e.specularColor=new k(0,0,0),t.material=e;let s=h.length,n=new Float32Array(16*s),i=new Float32Array(4*s),r=new Float32Array(s),l=Math.max(.02*P,.25*u)/(.9*u);for(let t=0;t<s;t++){let e=h[t],s=e.count/p,c=l*(.5+.5*s);r[t]=c,b.Scaling(c,c,c).multiply(b.Translation((e.vx+.5)*u,(e.vy+.5)*u,(e.vz+.5)*u)).copyToArray(n,16*t);let[o,d,m]=(0,a.heatRgb)(s);i[4*t]=o,i[4*t+1]=d,i[4*t+2]=m,i[4*t+3]=1}t.thinInstanceSetBuffer("matrix",n,16,!1),t.thinInstanceSetBuffer("color",i,4,!0);let c=R.radius,o=0,d=()=>{let e=Math.min(8,Math.max(.6,R.radius/c));if(!(.01>Math.abs(e-o))){o=e;for(let t=0;t<s;t++){let s=r[t]*e,a=16*t;n[a]=s,n[a+5]=s,n[a+10]=s}t.thinInstanceBufferUpdated("matrix")}};d(),N.onBeforeRenderObservable.add(d)}L.runRenderLoop(()=>N.render());let T=()=>L.resize();window.addEventListener("resize",T);let B=(0,i.attachMeshHover)(N,e,C);w("ready"),r=()=>{window.removeEventListener("resize",T),B(),C(null),y.current=null,N.dispose(),L.dispose()}}catch(t){if(s)return;w("error"),q(t instanceof Error?t.message:"Failed to render heatmap.")}})(),()=>{s=!0,r?.()}},[h,u,d,A]),(0,e.jsx)(l.Panel,{title:m,subtitle:j,children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("canvas",{ref:p,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),_?(0,e.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:_.x+12,top:_.y+12},children:_.label}):null,"ready"===g?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o,{shape:A,onChange:M}),(0,e.jsx)(c.ZoomButtons,{onZoom:t=>y.current&&(0,n.stepZoom)(y.current,t)}),(0,e.jsx)(r.HeatLegend,{title:k,lowLabel:f,highLabel:b,note:v})]}):(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===g?"Rendering…":"empty"===g?x:"error"===g?z??"Heatmap unavailable.":null})]})})}])},25453,t=>{t.n(t.i(38413))},66022,t=>{t.v(e=>Promise.all(["static/chunks/0ys9-ozuluawt.js","static/chunks/2ycvtdd68gub7.js","static/chunks/0v82oqyoy9zol.js","static/chunks/18u58lorfahxi.js","static/chunks/1nj82er7msdto.js","static/chunks/0ufbyo1x3qkmo.js","static/chunks/1yehxf-fmeicg.js"].map(e=>t.l(e))).then(()=>e(94080)))},48505,t=>{t.v(e=>Promise.all(["static/chunks/3v5ha25nxo43j.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/1nj82er7msdto.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js"].map(e=>t.l(e))).then(()=>e(73073)))},53976,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/10r_824wzt8hj.js","static/chunks/2aor7m-wbis85.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/25b9x-li-tvk2.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js","static/chunks/18u58lorfahxi.js"].map(e=>t.l(e))).then(()=>e(18662)))},42436,t=>{t.v(e=>Promise.all(["static/chunks/37vzwr3ciejf1.js","static/chunks/157d9euci08yu.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(12847)))},89370,t=>{t.v(e=>Promise.all(["static/chunks/0dm32-jq30tg8.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(62566)))},67141,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3mqy-84_ul3t2.js","static/chunks/1_aahautsz2v_.js","static/chunks/3t06schbtqonl.js","static/chunks/1thjncpj7u6pq.js","static/chunks/10r_824wzt8hj.js","static/chunks/1vdjn0pkoyypn.js","static/chunks/1nj82er7msdto.js","static/chunks/0aznt7717miff.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2aelw3far6rii.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(97998)))},20693,t=>{t.v(e=>Promise.all(["static/chunks/1-61zh4waha61.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/1zx2q-r32thv1.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2u6shh3oeycm-.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js"].map(e=>t.l(e))).then(()=>e(32550)))},9607,t=>{t.v(e=>Promise.all(["static/chunks/2szdcpl41-kzv.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/3t06schbtqonl.js","static/chunks/10r_824wzt8hj.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/2aelw3far6rii.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(26831)))},96664,t=>{t.v(e=>Promise.all(["static/chunks/1o1d0p-v1z8ty.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/3pufs8g4ui943.js","static/chunks/1nj82er7msdto.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(44981)))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62238,42279,t=>{"use strict";let e=1/1.2;t.s(["ZOOM_IN_FACTOR",0,e,"ZOOM_OUT_FACTOR",0,1.2,"disableWheelZoom",0,function(t){t.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"stepZoom",0,function(t,e){let s=t.lowerRadiusLimit??.01,a=t.upperRadiusLimit??1/0;t.radius=Math.min(a,Math.max(s,t.radius*e))}],62238);var s=t.i(29212);t.s(["ZoomButtons",0,function({onZoom:t}){let a="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:a,onClick:()=>t(e),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:a,onClick:()=>t(1.2),children:"−"})]})}],42279)},59683,37660,t=>{"use strict";t.s(["attachMeshHover",0,function(t,e,s){let a=0,n=null,i=e=>{let i=e.offsetX,o=e.offsetY;a||(a=requestAnimationFrame(()=>{var e,r;let c;a=0;let l=t.pick(i,o,t=>t.isPickable&&t.isEnabled()),h=l?.pickedMesh?(e=l.pickedMesh,r=l.thinInstanceIndex??-1,(c=e.metadata)?r>=0&&c.hoverLabels?c.hoverLabels[r]??null:c.hoverLabel??null:null):null;h?s({label:h,x:i,y:o}):null!==n&&s(null),n=h}))},o=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",o),()=>{e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",o),a&&cancelAnimationFrame(a)}}],59683);var e=t.i(29212),s=t.i(56054);t.s(["HeatLegend",0,function({title:t,lowLabel:a="low",highLabel:n="high",note:i}){return(0,e.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,e.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:t}),(0,e.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:s.HEAT_GRADIENT}}),(0,e.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:n})]}),i?(0,e.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:i}):null]})}],37660)},47273,t=>{"use strict";var e=t.i(29212),s=t.i(94179);function a(t){return Number.isNaN(t)||t<0?0:t>1?1:t}function n(t){let e=a(t),s=[[0,.1,.9],[0,.85,1],[.1,.9,.2],[1,.85,0],[1,.15,0],[1,1,1]],n=s.length-1,i=e*n,o=Math.min(Math.floor(i),n-1),r=i-o,c=s[o],l=s[o+1];return c&&l?[c[0]+(l[0]-c[0])*r,c[1]+(l[1]-c[1])*r,c[2]+(l[2]-c[2])*r]:[1,1,1]}var i=t.i(56054),o=t.i(62238),r=t.i(59683),c=t.i(37660),l=t.i(93425),h=t.i(42279);t.s(["CameraDome3D",0,function({bins:u,gridSize:d}){let m=(0,s.useRef)(null),j=(0,s.useRef)(null),[k,f]=(0,s.useState)("loading"),[v,b]=(0,s.useState)(null),[p,g]=(0,s.useState)("markers"),[w,x]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=m.current;if(!e)return;if(0===u.length)return void f("empty");let s=!1,c=null;return f("loading"),b(null),(async()=>{try{let[{Engine:l},{Scene:h},{ArcRotateCamera:m},{HemisphericLight:k},{Vector3:v,Color3:b,Color4:g,Matrix:w},{MeshBuilder:y},{StandardMaterial:z},{Mesh:M},{DynamicTexture:P}]=await Promise.all([t.A(66022),t.A(48505),t.A(53976),t.A(42436),t.A(89370),t.A(67141),t.A(20693),t.A(8850),t.A(63836),t.A(9607),t.A(96664)]);if(s)return;let _=new l(e,!0,{preserveDrawingBuffer:!1}),q=new h(_);q.clearColor=new g(.04,.05,.07,1);let A=new m("dome-cam",Math.PI/3,Math.PI/2.4,3.6,v.Zero(),q);A.attachControl(e,!0),A.lowerRadiusLimit=1.6,A.upperRadiusLimit=8,(0,o.disableWheelZoom)(A),j.current=A,new k("dome-light",new v(.3,1,.2),q);let I=y.CreateSphere("dome",{diameter:2,segments:20},q),C=new z("dome-mat",q);C.wireframe=!0,C.disableLighting=!0,C.emissiveColor=new b(.16,.2,.28),C.alpha=.5,I.material=C,I.isPickable=!1;let L=[];for(let t=0;t<=64;t++){let e=t/64*Math.PI*2;L.push(new v(Math.cos(e),0,Math.sin(e)))}let N=y.CreateLines("dome-horizon",{points:L},q);N.color=new b(.3,.36,.46),N.isPickable=!1;let B=y.CreateLines("dome-forward",{points:[v.Zero(),new v(1.25,0,0)]},q);B.color=new b(.4,.7,.95),B.isPickable=!1;let R=u.reduce((t,e)=>Math.max(t,e.count),1),S=d>0?d:1;if("markers"===p){let t=y.CreateBox("dome-marker",{size:1},q),e=new z("dome-marker-mat",q);e.disableLighting=!0,e.emissiveColor=b.White(),e.specularColor=new b(0,0,0),t.material=e,t.isPickable=!0,t.thinInstanceEnablePicking=!0;let s=u.length,a=new Float32Array(16*s),n=new Float32Array(4*s),o=Array(s);for(let t=0;t<s;t++){let e=u[t],s=(e.azimuth_bin+.5)/S*Math.PI*2-Math.PI,r=(e.elevation_bin+.5)/S*Math.PI-Math.PI/2,c=Math.cos(r),l=c*Math.cos(s),h=Math.sin(r),d=c*Math.sin(s),m=e.count/R,j=.03+.12*m;w.Scaling(j,j,j).multiply(w.Translation(l,h,d)).copyToArray(a,16*t);let[k,f,v]=(0,i.heatRgb)(m);n[4*t]=k,n[4*t+1]=f,n[4*t+2]=v,n[4*t+3]=1,o[t]=`dir (${e.azimuth_bin}, ${e.elevation_bin}) \xb7 ${e.count}`}t.thinInstanceSetBuffer("matrix",a,16,!0),t.thinInstanceSetBuffer("color",n,4,!0),t.metadata={hoverLabels:o}}else{let t=function(t,e={}){let s=void 0!==e.width&&e.width>0?Math.floor(e.width):256,i=void 0!==e.height&&e.height>0?Math.floor(e.height):Math.max(1,Math.floor(s/2)),o=e.colorRamp??n,r=void 0!==e.blurBins&&e.blurBins>0?e.blurBins:1.5,c=a(e.alphaFloor??0),l=a(e.opacity??1),h=t.gridSize>0?t.gridSize:1,u=new Uint8ClampedArray(s*i*4),d=t.bins.filter(t=>t.count>0);if(0===d.length)return{width:s,height:i,rgba:u};let m=Math.max(1e-4,Math.PI/h*r),j=2*m*m,k=Math.cos(Math.min(Math.PI,3*m)),f=d.map(t=>{var e,s;let a,[n,i]=(e=t.azimuthBin,s=t.elevationBin,[(e+.5)/h*Math.PI*2-Math.PI,(s+.5)/h*Math.PI-Math.PI/2]);return[(a=Math.cos(i))*Math.cos(n),Math.sin(i),a*Math.sin(n)]}),v=new Float32Array(s*i),b=0;for(let t=0;t<i;t++){let e=Math.PI/2-(t+.5)/i*Math.PI,a=Math.cos(e),n=Math.sin(e);for(let e=0;e<s;e++){let i=(e+.5)/s*Math.PI*2-Math.PI,o=a*Math.cos(i),r=a*Math.sin(i),c=0;for(let t=0;t<d.length;t++){let e=f[t],s=o*e[0]+n*e[1]+r*e[2];if(s<k)continue;let a=Math.acos(s>1?1:s<-1?-1:s);c+=d[t].count*Math.exp(-(a*a)/j)}v[t*s+e]=c,c>b&&(b=c)}}if(b<=0)return{width:s,height:i,rgba:u};for(let t=0;t<v.length;t++){let e=a(v[t]/b),[s,n,i]=o(e),r=(c+(1-c)*e)*l,h=4*t;u[h]=Math.round(255*s),u[h+1]=Math.round(255*n),u[h+2]=Math.round(255*i),u[h+3]=Math.round(255*a(r))}return{width:s,height:i,rgba:u}}({bins:u.map(t=>({azimuthBin:t.azimuth_bin,elevationBin:t.elevation_bin,count:t.count})),gridSize:S},{width:256,blurBins:1.5,opacity:.95}),e=new P("dome-skytex",{width:t.width,height:t.height},q,!1);e.hasAlpha=!0;let s=e.getContext(),i=s.createImageData(t.width,t.height);i.data.set(t.rgba),s.putImageData(i,0,0),e.update();let o=y.CreateSphere("dome-sky",{diameter:2,segments:48,sideOrientation:M.DOUBLESIDE},q),r=new z("dome-sky-mat",q);r.disableLighting=!0,r.emissiveColor=b.White(),r.diffuseColor=new b(0,0,0),r.specularColor=new b(0,0,0),r.emissiveTexture=e,r.opacityTexture=e,r.backFaceCulling=!1,o.material=r,o.isPickable=!1}_.runRenderLoop(()=>q.render());let E=()=>_.resize();window.addEventListener("resize",E);let T=(0,r.attachMeshHover)(q,e,x);f("ready"),c=()=>{window.removeEventListener("resize",E),T(),x(null),j.current=null,q.dispose(),_.dispose()}}catch(t){if(s)return;f("error"),b(t instanceof Error?t.message:"Failed to render dome.")}})(),()=>{s=!0,c?.()}},[u,d,p]),(0,e.jsx)(l.Panel,{title:"View-direction dome (3D)",subtitle:"Where the audience looked, mapped onto a sphere — drag to orbit, +/- to zoom",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("canvas",{ref:m,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),w?(0,e.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:w.x+12,top:w.y+12},children:w.label}):null,"ready"===k?(0,e.jsxs)(e.Fragment,{children:[(0,e.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(t=>(0,e.jsx)("button",{type:"button",onClick:()=>g(t),className:`px-2.5 py-1 ${p===t?"bg-fg/15 font-medium text-white":"text-fg-muted hover:text-fg"}`,children:"markers"===t?"Markers":"Skydome"},t))}),(0,e.jsx)(h.ZoomButtons,{onZoom:t=>j.current&&(0,o.stepZoom)(j.current,t)}),(0,e.jsx)(c.HeatLegend,{title:"Gaze density",lowLabel:"rarely",highLabel:"most-viewed",note:"markers"===p?"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,e.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===k?"Rendering…":"empty"===k?"No camera samples in range.":"error"===k?v??"Dome unavailable.":null})]})})}],47273)},98568,t=>{t.n(t.i(47273))},66022,t=>{t.v(e=>Promise.all(["static/chunks/0ys9-ozuluawt.js","static/chunks/2ycvtdd68gub7.js","static/chunks/0v82oqyoy9zol.js","static/chunks/18u58lorfahxi.js","static/chunks/1nj82er7msdto.js","static/chunks/0ufbyo1x3qkmo.js","static/chunks/1yehxf-fmeicg.js"].map(e=>t.l(e))).then(()=>e(94080)))},48505,t=>{t.v(e=>Promise.all(["static/chunks/3v5ha25nxo43j.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/1nj82er7msdto.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js"].map(e=>t.l(e))).then(()=>e(73073)))},53976,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/10r_824wzt8hj.js","static/chunks/2aor7m-wbis85.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/25b9x-li-tvk2.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js","static/chunks/18u58lorfahxi.js"].map(e=>t.l(e))).then(()=>e(18662)))},42436,t=>{t.v(e=>Promise.all(["static/chunks/37vzwr3ciejf1.js","static/chunks/157d9euci08yu.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(12847)))},89370,t=>{t.v(e=>Promise.all(["static/chunks/0dm32-jq30tg8.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(62566)))},67141,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3mqy-84_ul3t2.js","static/chunks/1_aahautsz2v_.js","static/chunks/3t06schbtqonl.js","static/chunks/1thjncpj7u6pq.js","static/chunks/10r_824wzt8hj.js","static/chunks/1vdjn0pkoyypn.js","static/chunks/1nj82er7msdto.js","static/chunks/0aznt7717miff.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2aelw3far6rii.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(97998)))},20693,t=>{t.v(e=>Promise.all(["static/chunks/1-61zh4waha61.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/1zx2q-r32thv1.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2u6shh3oeycm-.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js"].map(e=>t.l(e))).then(()=>e(32550)))},8850,t=>{t.v(e=>Promise.all(["static/chunks/068j6934u8j16.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/3t06schbtqonl.js","static/chunks/10r_824wzt8hj.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(35131)))},63836,t=>{t.v(e=>Promise.all(["static/chunks/2fh-_9b6tqhvb.js","static/chunks/0wwcfw8i3j_zx.js","static/chunks/0v82oqyoy9zol.js","static/chunks/1nj82er7msdto.js","static/chunks/310uz81hnnzsu.js","static/chunks/18u58lorfahxi.js","static/chunks/163fa70v4mgxj.js"].map(e=>t.l(e))).then(()=>e(14960)))},9607,t=>{t.v(e=>Promise.all(["static/chunks/2szdcpl41-kzv.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/3t06schbtqonl.js","static/chunks/10r_824wzt8hj.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/2aelw3far6rii.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(26831)))},96664,t=>{t.v(e=>Promise.all(["static/chunks/1o1d0p-v1z8ty.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/3pufs8g4ui943.js","static/chunks/1nj82er7msdto.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(44981)))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62238,42279,e=>{"use strict";let t=1/1.2;e.s(["ZOOM_IN_FACTOR",0,t,"ZOOM_OUT_FACTOR",0,1.2,"disableWheelZoom",0,function(e){e.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"stepZoom",0,function(e,t){let s=e.lowerRadiusLimit??.01,n=e.upperRadiusLimit??1/0;e.radius=Math.min(n,Math.max(s,e.radius*t))}],62238);var s=e.i(29212);e.s(["ZoomButtons",0,function({onZoom:e}){let n="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:n,onClick:()=>e(t),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:n,onClick:()=>e(1.2),children:"−"})]})}],42279)},59683,37660,e=>{"use strict";e.s(["attachMeshHover",0,function(e,t,s){let n=0,a=null,i=t=>{let i=t.offsetX,l=t.offsetY;n||(n=requestAnimationFrame(()=>{var t,c;let o;n=0;let r=e.pick(i,l,e=>e.isPickable&&e.isEnabled()),h=r?.pickedMesh?(t=r.pickedMesh,c=r.thinInstanceIndex??-1,(o=t.metadata)?c>=0&&o.hoverLabels?o.hoverLabels[c]??null:o.hoverLabel??null:null):null;h?s({label:h,x:i,y:l}):null!==a&&s(null),a=h}))},l=()=>{n&&(cancelAnimationFrame(n),n=0),null!==a&&(a=null,s(null))};return t.addEventListener("pointermove",i),t.addEventListener("pointerleave",l),()=>{t.removeEventListener("pointermove",i),t.removeEventListener("pointerleave",l),n&&cancelAnimationFrame(n)}}],59683);var t=e.i(29212),s=e.i(56054);e.s(["HeatLegend",0,function({title:e,lowLabel:n="low",highLabel:a="high",note:i}){return(0,t.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:e}),(0,t.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:s.HEAT_GRADIENT}}),(0,t.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,t.jsx)("span",{children:n}),(0,t.jsx)("span",{children:a})]}),i?(0,t.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:i}):null]})}],37660)},71028,e=>{"use strict";var t=e.i(29212),s=e.i(94179),n=e.i(56054),a=e.i(62238),i=e.i(59683),l=e.i(37660),c=e.i(93425),o=e.i(42279);let r="__all__";function h(e){return`${e[0]},${e[1]},${e[2]}`}function u({label:e,value:s,onChange:n,allLabel:a,options:i}){return(0,t.jsxs)("label",{className:"flex items-center gap-1.5 rounded-md border border-edge bg-ink/80 px-2 py-1 text-xs text-fg backdrop-blur",children:[(0,t.jsx)("span",{className:"font-medium text-fg-muted",children:e}),(0,t.jsxs)("select",{className:"max-w-[12rem] bg-transparent text-white outline-none",value:s,onChange:e=>n(e.target.value),children:[(0,t.jsx)("option",{value:r,children:a}),i.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}e.s(["ClickRays3D",0,function({rays:m,cellSize:d,proxyMeshes:j=[]}){let k=(0,s.useRef)(null),f=(0,s.useRef)(null),[v,p]=(0,s.useState)("loading"),[x,b]=(0,s.useState)(null),[g,y]=(0,s.useState)(r),[w,z]=(0,s.useState)(r),[q,_]=(0,s.useState)(null),A=(0,s.useMemo)(()=>{let e=new Map;for(let t of m){let s=h(t.camVoxel),n=e.get(s);n?n.count+=t.count:e.set(s,{key:s,voxel:t.camVoxel,count:t.count})}return[...e.values()].sort((e,t)=>t.count-e.count)},[m]),L=(0,s.useMemo)(()=>{let e=new Map;for(let t of m)""!==t.mesh&&e.set(t.mesh,(e.get(t.mesh)??0)+t.count);return[...e.entries()].map(([e,t])=>({name:e,count:t})).sort((e,t)=>t.count-e.count)},[m]);return(0,s.useEffect)(()=>{g!==r&&(A.some(e=>e.key===g)||y(r))},[g,A]),(0,s.useEffect)(()=>{w!==r&&(L.some(e=>e.name===w)||z(r))},[w,L]),(0,s.useEffect)(()=>{let t=k.current;if(!t)return;if(0===m.length)return void p("empty");let s=!1,l=null;return p("loading"),b(null),(async()=>{try{let[{Engine:c},{Scene:o},{ArcRotateCamera:u},{HemisphericLight:k},{Vector3:v,Color3:x,Color4:b,Matrix:y},{MeshBuilder:z},{StandardMaterial:q}]=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(9607),e.A(96664)]);if(s)return;let A=g===r?m:m.filter(e=>h(e.camVoxel)===g);if(0===A.length)return void p("empty");let L=A.reduce((e,t)=>Math.max(e,t.count),1),M=0,C=0,P=0,N=0,E=(e,t,s)=>{M+=e,C+=t,P+=s,N++};for(let e of A)E(e.origin[0],e.origin[1],e.origin[2]),E(e.hit[0],e.hit[1],e.hit[2]);let R=N>0?new v(M/N,C/N,P/N):v.Zero(),T=4*d;for(let e of A)for(let t of[e.origin,e.hit]){let e=t[0]-R.x,s=t[1]-R.y,n=t[2]-R.z;T=Math.max(T,Math.sqrt(e*e+s*s+n*n))}let S=new c(t,!0,{preserveDrawingBuffer:!1}),Z=new o(S);Z.clearColor=new b(.04,.05,.07,1);let I=new u("rays-cam",Math.PI/4,Math.PI/3,2.4*T,R,Z);if(I.attachControl(t,!0),(0,a.disableWheelZoom)(I),f.current=I,new k("rays-light",new v(.4,1,.3),Z),j.length>0){let e=z.CreateBox("scene-proxy",{size:1},Z),t=new q("scene-proxy-mat",Z);t.wireframe=!0,t.disableLighting=!0,t.emissiveColor=new x(.32,.4,.52),t.alpha=.35,e.material=t,e.isPickable=!0,e.thinInstanceEnablePicking=!0,e.metadata={hoverLabels:j.map(e=>e.name)};let s=j.length,n=new Float32Array(16*s);for(let e=0;e<s;e++){let t=j[e].aabb,s=Math.max(t[3]-t[0],.001),a=Math.max(t[4]-t[1],.001),i=Math.max(t[5]-t[2],.001);y.Scaling(s,a,i).multiply(y.Translation((t[0]+t[3])/2,(t[1]+t[4])/2,(t[2]+t[5])/2)).copyToArray(n,16*e)}e.thinInstanceSetBuffer("matrix",n,16,!0)}let B=[],F=[];for(let e of A){let t=e.count/L,[s,a,i]=(0,n.heatRgb)(t),l=new b(s,a,i,.35+.65*t);B.push([new v(e.origin[0],e.origin[1],e.origin[2]),new v(e.hit[0],e.hit[1],e.hit[2])]),F.push([l,l])}B.length>0&&(z.CreateLineSystem("click-rays",{lines:B,colors:F,useVertexAlpha:!0},Z).isPickable=!1);let O=new Map;for(let e of A)O.set(h(e.camVoxel),e.camVoxel);if(O.size>0){let e=z.CreateSphere("rays-eye",{diameter:.6*d,segments:6},Z),t=new q("rays-eye-mat",Z);t.disableLighting=!0,t.emissiveColor=new x(.9,.95,1),e.material=t;let s=[...O.values()],n=new Float32Array(16*s.length);for(let e=0;e<s.length;e++){let t=s[e];y.Translation((t[0]+.5)*d,(t[1]+.5)*d,(t[2]+.5)*d).copyToArray(n,16*e)}e.thinInstanceSetBuffer("matrix",n,16,!0)}if(w!==r){let e=m.filter(e=>e.mesh===w);if(e.length>0){let t,s=j.find(e=>e.name===w);if(s){let e=s.aabb;t=new v((e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2)}else{let s=0,n=0,a=0;for(let t of e)s+=t.hit[0],n+=t.hit[1],a+=t.hit[2];t=new v(s/e.length,n/e.length,a/e.length)}let a=Math.max(3*d,.18*T),i=e.reduce((e,t)=>Math.max(e,t.count),1),l=[],c=[];for(let s of e){let e=s.origin[0]-s.hit[0],o=s.origin[1]-s.hit[1],r=s.origin[2]-s.hit[2],h=Math.sqrt(e*e+o*o+r*r)||1,u=s.count/i,m=a*(.4+.6*u),d=new v(t.x+e/h*m,t.y+o/h*m,t.z+r/h*m),[j,k,f]=(0,n.heatRgb)(u),p=new b(j,k,f,1);l.push([t.clone(),d]),c.push([new b(j,k,f,.25),p])}z.CreateLineSystem("mesh-rose",{lines:l,colors:c,useVertexAlpha:!0},Z).isPickable=!1;let o=z.CreateSphere("mesh-rose-hub",{diameter:.8*d,segments:8},Z),r=new q("mesh-rose-hub-mat",Z);r.disableLighting=!0,r.emissiveColor=new x(1,.85,.4),o.material=r,o.position=t,o.isPickable=!0,o.metadata={hoverLabel:w}}}S.runRenderLoop(()=>Z.render());let V=()=>S.resize();window.addEventListener("resize",V);let $=(0,i.attachMeshHover)(Z,t,_);p("ready"),l=()=>{window.removeEventListener("resize",V),$(),_(null),f.current=null,Z.dispose(),S.dispose()}}catch(e){if(s)return;p("error"),b(e instanceof Error?e.message:"Failed to render click rays.")}})(),()=>{s=!0,l?.()}},[m,d,j,g,w]),(0,t.jsx)(c.Panel,{title:"Click rays (3D)",subtitle:"Each click joined to the view it was made from — gate by viewpoint or focus a mesh",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:k,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),q?(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:q.x+12,top:q.y+12},children:q.label}):null,"ready"===v?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-2",children:[(0,t.jsx)(u,{label:"Viewpoint",value:g,onChange:y,allLabel:"All viewpoints",options:A.map(e=>({value:e.key,label:`(${e.voxel.join(", ")}) \xb7 ${e.count}`}))}),(0,t.jsx)(u,{label:"Mesh rose",value:w,onChange:z,allLabel:"No mesh focus",options:L.map(e=>({value:e.name,label:`${e.name} \xb7 ${e.count}`}))})]}),(0,t.jsx)(o.ZoomButtons,{onZoom:e=>f.current&&(0,a.stepZoom)(f.current,e)}),(0,t.jsx)(l.HeatLegend,{title:"Click volume",lowLabel:"few clicks",highLabel:"most clicks",note:"Lines run from the camera position (bright eye) to where the click landed. Pick a viewpoint to see only clicks made from there; pick a mesh to see which directions its clicks came from."})]}):(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===v?"Rendering…":"empty"===v?"No correlated clicks in range.":"error"===v?x??"Click rays unavailable.":null})]})})}])},61518,e=>{e.n(e.i(71028))},66022,e=>{e.v(t=>Promise.all(["static/chunks/0ys9-ozuluawt.js","static/chunks/2ycvtdd68gub7.js","static/chunks/0v82oqyoy9zol.js","static/chunks/18u58lorfahxi.js","static/chunks/1nj82er7msdto.js","static/chunks/0ufbyo1x3qkmo.js","static/chunks/1yehxf-fmeicg.js"].map(t=>e.l(t))).then(()=>t(94080)))},48505,e=>{e.v(t=>Promise.all(["static/chunks/3v5ha25nxo43j.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/1nj82er7msdto.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js"].map(t=>e.l(t))).then(()=>t(73073)))},53976,e=>{e.v(t=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/10r_824wzt8hj.js","static/chunks/2aor7m-wbis85.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/25b9x-li-tvk2.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js","static/chunks/18u58lorfahxi.js"].map(t=>e.l(t))).then(()=>t(18662)))},42436,e=>{e.v(t=>Promise.all(["static/chunks/37vzwr3ciejf1.js","static/chunks/157d9euci08yu.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(t=>e.l(t))).then(()=>t(12847)))},89370,e=>{e.v(t=>Promise.all(["static/chunks/0dm32-jq30tg8.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(t=>e.l(t))).then(()=>t(62566)))},67141,e=>{e.v(t=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3mqy-84_ul3t2.js","static/chunks/1_aahautsz2v_.js","static/chunks/3t06schbtqonl.js","static/chunks/1thjncpj7u6pq.js","static/chunks/10r_824wzt8hj.js","static/chunks/1vdjn0pkoyypn.js","static/chunks/1nj82er7msdto.js","static/chunks/0aznt7717miff.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2aelw3far6rii.js","static/chunks/3nz-dh9d7cehk.js"].map(t=>e.l(t))).then(()=>t(97998)))},20693,e=>{e.v(t=>Promise.all(["static/chunks/1-61zh4waha61.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/1zx2q-r32thv1.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2u6shh3oeycm-.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js"].map(t=>e.l(t))).then(()=>t(32550)))},9607,e=>{e.v(t=>Promise.all(["static/chunks/2szdcpl41-kzv.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/3t06schbtqonl.js","static/chunks/10r_824wzt8hj.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/2aelw3far6rii.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(t=>e.l(t))).then(()=>t(26831)))},96664,e=>{e.v(t=>Promise.all(["static/chunks/1o1d0p-v1z8ty.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/3pufs8g4ui943.js","static/chunks/1nj82er7msdto.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js","static/chunks/3nz-dh9d7cehk.js"].map(t=>e.l(t))).then(()=>t(44981)))}]);
|
|
@@ -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 p=e.i(56054);function h(e,t=1){let[s,n,l]=(0,p.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);let b="#161210",j={fontSize:13,color:"#a8917c"},v={padding:"6px 10px",fontSize:13,borderTop:"1px solid #34291f"};function y({sessions:e,onSelect:s,selectedId:n}){return 0===e.length?(0,t.jsx)("p",{style:j,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:{...v,fontFamily:"ui-monospace, monospace",color:"#d8c8b8"},children:e.session_id.slice(0,12)}),(0,t.jsx)("td",{style:{...v,fontFamily:"ui-monospace, monospace",color:"#a8917c"},children:e.visitor_id.slice(0,8)}),(0,t.jsx)("td",{style:{...v,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:f(e.events)}),(0,t.jsx)("td",{style:{...v,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 w({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=b,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=h(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 N({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=b,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,p=m+i;e.beginPath(),e.arc(l,r,x,m,p),e.arc(l,r,u,p,m,!0),e.closePath(),e.fillStyle=h(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 S={background:"rgba(32,25,19,0.6)",borderRadius:8,padding:12},k={fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"#a8917c"},P={marginTop:4,fontSize:24,fontWeight:600,color:"#f4eadf",fontVariantNumeric:"tabular-nums"};function M({label:e,value:s}){return(0,t.jsxs)("div",{style:S,children:[(0,t.jsx)("div",{style:k,children:e}),(0,t.jsx)("div",{style:P,children:s})]})}function _({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)(M,{label:"Samples",value:f(e.samples)}),(0,t.jsx)(M,{label:"Avg FPS",value:f(e.avg_fps,1)}),(0,t.jsx)(M,{label:"p50 FPS",value:f(e.p50_fps,1)}),(0,t.jsx)(M,{label:"Min FPS",value:f(e.min_fps,1)})]}):(0,t.jsx)("p",{style:j,children:"No performance samples in range."})}var C=e.i(93425);function R({bins:e,gridSize:s}){return(0,t.jsx)(C.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)(N,{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:p.HEAT_GRADIENT}}),(0,t.jsx)("span",{children:"most-viewed"})]}):null]})})}function T({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=h(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)(C.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 z(e){return null==e?"":new Date(e-6e4*new Date(e).getTimezoneOffset()).toISOString().slice(0,16)}function $(e){if(!e)return;let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}function E({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:z(e.since),onChange:e=>r({since:$(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:z(e.until),onChange:e=>r({until:$(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 A({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)(C.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 I({perf:e}){return(0,t.jsx)(C.Panel,{title:"Rendering performance",subtitle:"frame_perf samples",children:(0,t.jsx)(_,{perf:e})})}function D({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 F(e){return f(e/1048576,1)}function L({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 U({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)(C.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)(D,{label:"p05 FPS (worst)",value:f(s.p05_fps,1)}),(0,t.jsx)(D,{label:"p50 FPS (typical)",value:f(s.p50_fps,1)}),(0,t.jsx)(D,{label:"p95 FPS (best)",value:f(s.p95_fps,1)}),(0,t.jsx)(D,{label:"Sessions",value:f(s.sessions)})]}),(0,t.jsx)(L,{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)(C.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)(D,{label:"p50 frame time",value:f(l.p50_ms,1),unit:"ms"}),(0,t.jsx)(D,{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)(C.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)(D,{label:"Median session",value:f(r.median_rate,2)}),(0,t.jsx)(D,{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)(C.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)(C.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)(C.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)(D,{label:"Context losses",value:f(d.context_losses)}),(0,t.jsx)(D,{label:"Compile stalls",value:f(d.compile_stalls)}),(0,t.jsx)(D,{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)(C.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)(D,{label:"p50 JS heap",value:F(o.p50_js_heap_bytes),unit:"MB"}),(0,t.jsx)(D,{label:"p50 texture",value:F(o.p50_texture_bytes),unit:"MB"}),(0,t.jsx)(D,{label:"p50 triangles",value:f(o.p50_triangles)}),(0,t.jsx)(D,{label:"p95 JS heap",value:F(o.p95_js_heap_bytes),unit:"MB"}),(0,t.jsx)(D,{label:"p95 texture",value:F(o.p95_texture_bytes),unit:"MB"}),(0,t.jsx)(D,{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 O({bins:e,gridSize:s}){return(0,t.jsx)(C.Panel,{title:"Pointer heatmap",subtitle:"Normalized screen positions",children:(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(w,{bins:e,gridSize:s,className:"rounded-lg border border-edge"})})})}function B({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 G({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)(C.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)(B,{label:"Errors",value:f(a),tone:a>0?"bad":"good",hint:r>0?`${x.toFixed(2)} / session`:void 0}),(0,t.jsx)(B,{label:"Context loss",value:f(i),tone:i>0?"warn":"good",hint:"GPU device lost"}),(0,t.jsx)(B,{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)(B,{label:"Sessions",value:f(r)}),(0,t.jsx)(B,{label:"Attention",value:f(o+d),hint:"focus + visibility changes"}),(0,t.jsx)(B,{label:"Resizes",value:f(c),hint:"viewport changes"})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No events in range."})})}function H({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 K({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 V({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)(C.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)(H,{label:"Visited cells",value:f(a),hint:`${f(s,2)} u voxels`}),(0,t.jsx)(H,{label:"Camera samples",value:f(i)}),(0,t.jsx)(H,{label:"Avg travel",value:f(u>0?o/u:0,1),hint:u>0?`over ${f(u)} sessions`:void 0}),(0,t.jsx)(H,{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)(K,{buckets:n,bucketSize:l})]})]}):(0,t.jsx)("p",{className:"text-sm text-fg-muted",children:"No camera samples in range."})})}let W={babylon:"Babylon.js","babylon-lite":"Babylon (lite)",three:"three.js",playcanvas:"PlayCanvas",r3f:"react-three-fiber",aframe:"A-Frame"};function J({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:W[e]??e},e))})]}):1===o.length?(0,t.jsxs)("p",{className:"text-[11px] text-fg-muted",children:["Engine: ",W[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 Q({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 ${W[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)(J,{project:e,playgroundUrl:s,onView:l,onOpenOverlay:o},e.id))})]}):null;return(0,t.jsxs)(C.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 X({sessions:e,onSelect:s,selectedId:n}){return(0,t.jsx)(C.Panel,{title:"Sessions",subtitle:s?`${e.length} most recent \xb7 select to drill in`:`${e.length} most recent`,children:(0,t.jsx)(y,{sessions:e,onSelect:s,selectedId:n})})}function q({meshes:e}){let s=e.reduce((e,t)=>Math.max(e,t.count),0);return(0,t.jsx)(C.Panel,{title:"Top meshes",subtitle:"Most-interacted meshes",children: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 Y({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)(C.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 Z(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 ee({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 p={x:40,y:14,w:Math.max(1,d-40-36),h:114},h=e.length>0?{start:e[0].bucket,end:e[e.length-1].bucket+s}:null,f=(0,n.useCallback)(e=>{if(!h)return 0;let t=(e-p.x)/p.w;return Math.round(h.start+Math.max(0,Math.min(1,t))*(h.end-h.start))},[h,p.x,p.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||!h){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=h.end-h.start,a=Math.max(1,p.w/e.length*.8);for(let t of e){let e=p.x+(t.bucket-h.start)/r*p.w,s=t.events/l*p.h;n.fillStyle="rgba(56, 189, 248, 0.55)",n.fillRect(e,p.y+p.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),p.x-5,p.y+4),n.fillText("0",p.x-5,p.y+p.h),n.textBaseline="alphabetic",n.fillStyle="rgba(56, 189, 248, 0.7)",n.textAlign="left",n.fillText(`events / ${Z(s)}`,p.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,p.y,t-e,p.h),n.strokeStyle="rgba(56, 189, 248, 0.8)",n.lineWidth=1,n.strokeRect(e,p.y,t-e,p.h)}},[e,d,h,x,s,p.x,p.y,p.w,p.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)(C.Panel,{title:"Event volume over time",subtitle:`Bars: events per ${Z(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 et=e.i(19761);function es({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 en({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)(es,{label:e,value:s},e))]})}function el(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 er({baseUrl:e,apiKey:s,sessionId:l,hiddenTypes:r,onToggleType:a,onSetAllHidden:i}){let o,d,c,[u,x]=(0,n.useState)([]),[m,p]=(0,n.useState)("loading"),[h,f]=(0,n.useState)(null),[g,b]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{let t=!1;return p("loading"),f(null),x([]),b(new Set),(async()=>{try{let n=await (0,et.fetchSessionEvents)({endpoint:e,apiKey:s,sessionId:l});if(t)return;x(n),p(0===n.length?"empty":"ready")}catch(e){if(t)return;p("error"),f(e instanceof Error?e.message:"Failed to load session data.")}})(),()=>{t=!0}},[e,s,l]);let{meta:j,byType:v,allTypes:y,sorted:w}=(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)(C.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.":h??"Session data unavailable."})});let N=j.start,S=j.end,k=j.startEvent,P=N&&S?S.ts-N.ts:0,M=e=>e?new Date(e).toLocaleString():"—",_=N?.pageMeta,R=el([["Project",N?.projectId],["Session",N?.sessionId],["Visitor",N?.visitorId],["SDK",N?.sdkVersion],["Scene ID",N?.sceneId],["URL",N?.url],["Started",M(N?.ts)],["Ended",M(S?.ts)],["Duration",(d=Math.floor((o=Math.round(P/1e3))/60),c=o%60,d>0?`${d}m ${c}s`:`${c}s`)],["Events",String(w.length)]]),T=_?el([["Title",_.title],["Language",_.language],["Referrer",_.referrer],["Viewport",_.viewport],["Device pixel ratio",_.devicePixelRatio]]):[],z=k?.type==="session_start"?k.device:void 0,$=k?.type==="session_start"?k.graphics:void 0,E=k?.type==="session_start"?k.scene:void 0,A=k?.type==="session_start"?k.connector:void 0,I=k?.type==="session_start"?k.user:void 0,D=el([["Engine",z?.engine],["Graphics API",$?.api],["Backend",$?.backend],["API version",$?.apiVersion],["Shading language",$?.shadingLanguage],["GPU vendor",z?.vendor],["GPU renderer",z?.renderer],["Max texture size",z?.maxTextureSize],["CPU cores",z?.hardwareConcurrency],["Device memory (GB)",z?.deviceMemoryGb],["Mobile",z?.isMobile]]),F=el([["Connector",A?[A.name,A.version].filter(Boolean).join(" "):null],["Coordinate system",A?.coordinateSystem],["Description",E?.description],["Camera type",E?.cameraType],["Camera name",E?.cameraName],["Mesh count",E?.meshCount],["User id",I?.id],["User traits",I?.traits]]),L=y.every(e=>r.has(e));return(0,t.jsxs)(C.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)(en,{title:"Identity",rows:R}),(0,t.jsx)(en,{title:"Page context",rows:T}),(0,t.jsx)(en,{title:"Device / graphics",rows:D}),(0,t.jsx)(en,{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 (",y.length," event types)"]}),(0,t.jsx)("button",{type:"button",onClick:()=>i(!L,y),className:"rounded-md border border-edge px-2 py-1 text-xs text-fg transition hover:border-amber hover:text-fg-hi",children:L?"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:y.map(e=>{let s=!r.has(e),n=g.has(e),l=w.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:v.get(e)}),(0,t.jsx)("button",{type:"button",onClick:()=>b(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"),(v.get(e)??0)>l.length?`
|
|
2
|
-
|
|
3
|
-
… ${(v.get(e)??0)-l.length} more`:""]}):null]},e)})})]})]})}function ea(e){return e.length>10?`${e.slice(0,8)}…`:e}function ei(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 eo={active:"bg-emerald-400",recent:"bg-amber-400",idle:"bg-fg-muted"},ed={idle:"offline",connecting:"connecting…",open:"live",reconnecting:"reconnecting…"};function ec({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`:ed[e]})]})}function eu({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)(C.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)(ec,{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 ${eo[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:ea(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:ei(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 ${eo[e.activity]}`,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-mono text-xs text-fg",children:ea(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:ei(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:ea(e.sessionId)}),(0,t.jsx)("span",{className:"ml-auto flex-none text-fg-muted",children:ei(e.ts,l)})]},`${e.sessionId}-${e.ts}-${s}`))})]})]})]})}let ex=(0,s.default)(()=>e.A(69091).then(e=>e.SessionReplay),{loadableGenerated:{modules:[12449]},ssr:!1}),em=(0,s.default)(()=>e.A(33996).then(e=>e.WorldHeatmap3D),{loadableGenerated:{modules:[25453]},ssr:!1}),ep=(0,s.default)(()=>e.A(58913).then(e=>e.CameraDome3D),{loadableGenerated:{modules:[98568]},ssr:!1}),eh=(0,s.default)(()=>e.A(56403).then(e=>e.ClickRays3D),{loadableGenerated:{modules:[61518]},ssr:!1}),ef=(0,s.default)(()=>e.A(70019).then(e=>e.FlowSankey3D),{loadableGenerated:{modules:[36471]},ssr:!1}),eg={sessions:[],pointer:[],camera:[],meshes:[],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)([]),[p,h]=(0,n.useState)(""),[f,b]=(0,n.useState)(a),[j,v]=(0,n.useState)([]),[y,w]=(0,n.useState)(eg),[N,S]=(0,n.useState)("idle"),[k,P]=(0,n.useState)(null),[M,_]=(0,n.useState)(null),[C,z]=(0,n.useState)("idle"),[$,D]=(0,n.useState)(new Set),[F,L]=(0,n.useState)([]),[B,H]=(0,n.useState)(()=>Date.now()),K=(0,n.useRef)(f);K.current=f;let W=(0,n.useRef)(a.window),J=(0,n.useRef)(p);J.current=p;let Z=(0,n.useRef)(M);Z.current=M;let et=(0,n.useRef)(null),es=(0,n.useRef)(null),en=(0,n.useRef)(!1),el=(0,n.useCallback)((e,t)=>{let s=`/projects/${encodeURIComponent(e)}`;return t?`${s}/session/${encodeURIComponent(t)}`:s},[]),ea=(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]&&(et.current=decodeURIComponent(e[1]),e[2]&&(es.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=et.current,r=(n?t.find(e=>e.id===n):void 0)??t.find(e=>e.apiKey===l.DEFAULT_API_KEY)??s;r&&(h(r.id),o(r.apiKey),(n&&r.id===n||1===t.length&&!r.scene)&&(en.current=!0))}).catch(()=>{}),()=>{e=!0}},[]);let ei=(0,n.useCallback)(async t=>{let s=t??i;if(!s){S("error"),P("An API key is required.");return}S("loading"),P(null),_(null),z("idle");let n=K.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,p,h,f,g,b,j,y,N,k,P,M]=await Promise.all([o.pointerHeatmap({...l,bins:50}),o.cameraHeatmap({...l,source:void 0,bins:36}),o.topMeshes({...l,source:void 0,scene:void 0,limit:25}),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}})()]);v(f);let _=l.scene??(1===f.length?f[0]?.scene_id:void 0),C=_?(await o.sceneRepresentation(_).catch(()=>null))?.proxy?.meshes??[]:[];w({sessions:e,pointer:r,camera:i,meshes:d,perf:c,world:x,gaze:m,clickRays:p,flowLinks:h,flowQuery:{since:a.since,until:a.until,scene:l.scene,source:l.source},hasFirstPerson:P.length>0,proxyMeshes:C,timeseries:g,counts:b,coverage:j,distance:y,navigation:N,sources:k,floorPlan:P,performance:M,intervalMs:1e3*n}),S("ready")}catch(e){w(eg),S("error"),P(e instanceof r.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[i,e]),eo=(0,n.useCallback)(e=>{h(e.id),o(e.apiKey),ea(el(e.id)),ei(e.apiKey)},[ei,el,ea]);(0,n.useEffect)(()=>{if("idle"===N)return;let e=setTimeout(()=>void ei(),300);return()=>clearTimeout(e)},[f]);let ed="idle"!==N&&!!i,ec=(0,n.useRef)(0),eb=(0,n.useRef)(!1);eb.current=null!=M;let ej=(0,n.useCallback)(e=>{L(t=>[e,...t].slice(0,30));let t=Date.now();eb.current||t-ec.current<5e3||(ec.current=t,ei())},[ei]),{snapshot:ev,status:ey}=(0,g.useLivePresence)(e,i,ed);(0,g.useLiveStream)(e,i,ed,ej),(0,n.useEffect)(()=>{if(!ed)return;let e=setInterval(()=>H(Date.now()),1e3);return()=>clearInterval(e)},[ed]);let ew=(0,n.useCallback)(async t=>{let s=c(K.current),n=new r.CollectorApi(e,i),[l,a,o,d,u]=await Promise.all([n.pointerHeatmap({...s,bins:50,session:t}),n.cameraHeatmap({...s,source:void 0,bins:36,session:t}),n.topMeshes({...s,source:void 0,scene:void 0,limit:25,session:t}),n.perf({...s,source:void 0,session:t}),n.sessionMeta(t).catch(()=>null)]);return{id:t,meta:u,pointer:l,camera:a,meshes:o,perf:d}},[e,i]),eN=(0,n.useCallback)(async e=>{let t=J.current;t&&ea(el(t,e)),window.scrollTo({top:0,behavior:"smooth"}),_({id:e,meta:null,pointer:[],camera:[],meshes:[],perf:null}),z("loading"),D(new Set);try{_(await ew(e)),z("ready")}catch(e){z("error"),P(e instanceof r.ApiError?`${e.status}: ${e.message}`:e instanceof Error?e.message:"Request failed.")}},[ew,el,ea]),eS=(0,n.useCallback)(()=>{let e=J.current;e&&ea(el(e)),_(null),z("idle"),D(new Set)},[el,ea]),ek=(0,n.useCallback)(e=>{let t=x.find(t=>t.id===e);h(e),t&&o(t.apiKey),w(eg),v([]),S("idle"),P(null),_(null),z("idle"),D(new Set)},[x]),eP=(0,n.useCallback)(e=>{D(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),eM=(0,n.useCallback)((e,t)=>{D(e?new Set(t):new Set)},[]),e_=(0,n.useCallback)((e,t)=>{b(s=>("custom"!==s.window&&(W.current=s.window),{...s,window:"custom",since:e,until:t}))},[]),eC=(0,n.useCallback)(()=>{b(e=>({...e,window:W.current}))},[]);(0,n.useEffect)(()=>{en.current&&i&&(en.current=!1,ei())},[x,i,ei]),(0,n.useEffect)(()=>{if("ready"===N&&es.current){let e=es.current;es.current=null,eN(e)}},[N,eN]),(0,n.useEffect)(()=>{let e=()=>{let e=window.location.pathname.match(/^\/projects\/[^/]+(?:\/session\/([^/]+))?/),t=e?.[1]?decodeURIComponent(e[1]):null;t?Z.current?.id!==t&&eN(t):Z.current&&eS()};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[eN,eS]);let eR=!!(M&&ev?.sessions.some(e=>e.sessionId===M.id)),eT=(0,n.useRef)(eR);return(0,n.useEffect)(()=>{let e=eT.current;if(eT.current=eR,!e||eR)return;let t=Z.current;if(!t||"ready"!==C)return;let s=t.id,n=!1;return(async()=>{try{let e=await ew(s);n||Z.current?.id!==s||_(e)}catch{}})(),()=>{n=!0}},[eR,C,ew]),(0,n.useEffect)(()=>{if(!eR||"ready"!==C)return;let e=Z.current?.id;if(!e)return;let t=!1,s=setInterval(()=>{(async()=>{try{let s=await ew(e);t||Z.current?.id!==e||_(s)}catch{}})()},1e3);return()=>{t=!0,clearInterval(s)}},[eR,C,ew]),(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(),p&&ea(el(p)),ei()},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:p,onChange:e=>ek(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"===N,className:"rounded-md bg-amber px-4 py-2 text-sm font-medium text-ink transition hover:bg-ember disabled:opacity-50",children:"loading"===N?"Loading…":"Load"})]}),"idle"!==N?(0,t.jsx)(E,{filters:f,scenes:j,onChange:b,busy:"loading"===N}):null,k?(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:k}):null,"idle"===N?x.length>0?(0,t.jsx)(Q,{projects:x,playgroundUrl:l.DEFAULT_PLAYGROUND_URL,onView:eo}):(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."}):M?(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:M.id}),(0,t.jsx)("p",{className:"mt-1 text-xs text-fg-muted",children:"loading"===C?"Loading session…":[M.meta?.scene?.sceneId?`scene: ${M.meta.scene.sceneId}`:null,M.meta?.device?.gpu?`gpu: ${M.meta.device.gpu}`:null,M.meta?.startedAt?`started: ${M.meta.startedAt}`:null].filter(Boolean).join(" · ")||"No session metadata."})]}),(0,t.jsx)("button",{type:"button",onClick:eS,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)(ex,{baseUrl:e,apiKey:i,sessionId:M.id,hiddenTypes:$,isLive:eR})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(er,{baseUrl:e,apiKey:i,sessionId:M.id,hiddenTypes:$,onToggleType:eP,onSetAllHidden:eM})}),(0,t.jsx)(I,{perf:M.perf}),(0,t.jsx)(q,{meshes:M.meshes}),(0,t.jsx)(O,{bins:M.pointer,gridSize:50}),(0,t.jsx)(R,{bins:M.camera,gridSize:36}),M.meta?.scene?.cameraType==="free"?(0,t.jsx)(Y,{baseUrl:e,apiKey:i,sessionId:M.id,scene:M.meta?.scene?.sceneId??f.scene}):null,(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ep,{bins:M.camera,gridSize:36})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(X,{sessions:y.sessions,selectedId:M.id,onSelect:eN})})]}):(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)(eu,{snapshot:ev,status:ey,feed:F,now:B,onSelectSession:eN})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ee,{buckets:y.timeseries,intervalMs:y.intervalMs,onBrush:e_,brushed:"custom"===f.window,onClear:eC})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(G,{counts:y.counts,perf:y.perf})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(V,{coverage:y.coverage,cellSize:1,distance:y.distance,bucketSize:1,navigation:y.navigation})}),(0,t.jsx)(I,{perf:y.perf}),(0,t.jsx)(q,{meshes:y.meshes}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(U,{data:y.performance})}),(0,t.jsx)(A,{rows:y.sources}),(0,t.jsx)(O,{bins:y.pointer,gridSize:50}),(0,t.jsx)(R,{bins:y.camera,gridSize:36}),"viewer"!==f.cameraMode?(0,t.jsx)(T,{bins:y.floorPlan,cellSize:1}):null,(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ep,{bins:y.camera,gridSize:36})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(em,{voxels:y.world,cellSize:.5,proxyMeshes:y.proxyMeshes})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(em,{voxels:y.gaze,cellSize:.5,proxyMeshes:y.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)(eh,{rays:y.clickRays,cellSize:.5,proxyMeshes:y.proxyMeshes})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(ef,{links:y.flowLinks,gridSize:36,proxyMeshes:y.proxyMeshes,maxLinks:80,baseUrl:e,apiKey:i,flowQuery:y.flowQuery,hasFirstPerson:y.hasFirstPerson})}),(0,t.jsx)("div",{className:"lg:col-span-2",children:(0,t.jsx)(X,{sessions:y.sessions,onSelect:eN})})]})]})}],14936)}]);
|