omnigateway 0.7.1 → 0.7.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/README.md +6 -4
- package/bin/omni.js +79 -30
- package/gateway.js +782 -64
- package/package.json +1 -1
- package/public/assets/{Chip-BWxO0uV7.js → Chip-BOyBT5TP.js} +1 -1
- package/public/assets/{CopyValue-DIR5A6PG.js → CopyValue-DRHHQlN_.js} +3 -3
- package/public/assets/{Field-DI5YTYOX.js → Field-DK5zaBVA.js} +1 -1
- package/public/assets/Lamp-ZlMzNs5N.js +25 -0
- package/public/assets/{Panel-BCpZVY4U.js → Panel-CYQvfI3L.js} +19 -19
- package/public/assets/Rack-D798XvPQ.js +466 -0
- package/public/assets/{Readout-B0TZE8aA.js → Readout-D6-aurU8.js} +1 -1
- package/public/assets/{RequestTable-D4z82uxG.js → RequestTable-CEBhwDs7.js} +2 -2
- package/public/assets/{SummaryDeck-CzozuXOu.js → SummaryDeck-DBCSHihY.js} +2 -2
- package/public/assets/{Toggle-ByxBCMfb.js → Toggle-CdCCoDEo.js} +1 -1
- package/public/assets/{TokenBreakdown-BMEiZhRX.js → TokenBreakdown-DDI9uTPW.js} +1 -1
- package/public/assets/{WindowChart-nxC4SCRC.js → WindowChart-C-Y6U3WF.js} +2 -2
- package/public/assets/_app-BWNEo1e-.js +1 -0
- package/public/assets/_app.accounts-CLLLwN77.js +59 -0
- package/public/assets/{_app.console-D6lrTxJt.js → _app.console-Dr9qxU7J.js} +3 -3
- package/public/assets/{_app.database-Y3lFDxoP.js → _app.database-D0W0pcxC.js} +4 -4
- package/public/assets/{_app.index-DUFa7RRT.js → _app.index-CyxnfhVX.js} +8 -8
- package/public/assets/{_app.keys-DRfXCzMJ.js → _app.keys-D9qmw9Tj.js} +11 -11
- package/public/assets/{_app.logs-BQT3kFZr.js → _app.logs-DtXUZETW.js} +4 -4
- package/public/assets/{_app.models-CDpbIYHW.js → _app.models-CNxwXyFl.js} +11 -11
- package/public/assets/{_app.plugins._pluginId-jaswB8Z5.js → _app.plugins._pluginId-87Ox_hkW.js} +1 -1
- package/public/assets/_app.plugins._pluginId-CZWipH1n.js +2 -0
- package/public/assets/_app.settings-DjiMSl1Y.js +88 -0
- package/public/assets/{_app.usage-BaT54Vee.js → _app.usage-CZz9raYR.js} +6 -6
- package/public/assets/{chevron-right-0adI8395.js → chevron-right-CPoaXYHw.js} +1 -1
- package/public/assets/client-CZnyYbay.js +39 -0
- package/public/assets/{index-BRrBGt1i.js → index-DNSPtYpM.js} +3 -3
- package/public/assets/{login-BSWCo_Fz.js → login-BtlMmyKj.js} +3 -3
- package/public/assets/login-dV42ZQIA.js +2 -0
- package/public/assets/plus-_zo43Lvf.js +1 -0
- package/public/assets/{preload-helper-CD37DT-E.js → preload-helper-4wSmu2-E.js} +1 -1
- package/public/assets/{shared-dShKzjig.js → shared-OJcoRCqT.js} +1 -1
- package/public/assets/{stream-BD4FhzLn.js → stream-CEb81tzM.js} +1 -1
- package/public/assets/{trash-2-DrDlpCqO.js → trash-2-BjpqTubo.js} +1 -1
- package/public/index.html +8 -8
- package/public/assets/Lamp-DN2EKL4m.js +0 -25
- package/public/assets/Rack-B03tpeW-.js +0 -466
- package/public/assets/_app-D9B6OIjd.js +0 -1
- package/public/assets/_app.accounts-BiRGhH3s.js +0 -59
- package/public/assets/_app.plugins._pluginId-CtEAGvad.js +0 -2
- package/public/assets/_app.settings-CG63splg.js +0 -58
- package/public/assets/client-_6YMm6vh.js +0 -39
- package/public/assets/login-C7v-Fr28.js +0 -2
- package/public/assets/plus-B_f8M9yB.js +0 -1
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import{Et as e,I as t,Lt as n,N as r,P as i,St as a,Ut as o,Wt as s,_t as c,bt as l,i as u,t as d,x as f,yt as p}from"./Lamp-ZlMzNs5N.js";import{C as m,D as h,E as g,O as _,S as v,T as y,_ as b,b as x,o as S,v as C}from"./Panel-CYQvfI3L.js";import*as w from"react";import{createContext as ee,createElement as T,forwardRef as E,use as te,useCallback as ne,useContext as re,useEffect as ie,useId as ae,useMemo as oe,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import*as se from"react-dom";import j,{ThemeProvider as ce,createGlobalStyle as le,css as ue}from"styled-components";import{LiveProvider as de,useLive as fe}from"@omnigateway/dashboard-sdk";var pe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),me=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),he=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ge=e=>{let t=he(e);return t.charAt(0).toUpperCase()+t.slice(1)},_e={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ve=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ye=ee({}),be=()=>re(ye),xe=E(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=be()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return T(`svg`,{ref:c,..._e,width:t??l??_e.width,height:t??l??_e.height,stroke:e??f,strokeWidth:m,className:pe(`lucide`,p,i),...!a&&!ve(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>T(e,t)),...Array.isArray(a)?a:[a]])}),M=(e,t)=>{let n=E(({className:n,...r},i)=>T(xe,{ref:i,iconNode:t,className:pe(`lucide-${me(ge(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ge(e),n},Se=M(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Ce=M(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),we=M(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Te=M(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Ee=M(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),De=M(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Oe=M(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),ke=M(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Ae=M(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),je=M(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Me=M(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ne=M(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Pe=M(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Fe=M(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Ie=M(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Le=M(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Re=M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function ze(e,t){return e.flatMap(({id:e,colour:n})=>{let r=n?.[t];return typeof r==`string`?[`--p-${e}: ${r};`]:[]}).join(`
|
|
2
|
+
`)}var Be=le`
|
|
3
|
+
:root {
|
|
4
|
+
${({$providers:e})=>ze(e,`light`)}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dark {
|
|
8
|
+
${({$providers:e})=>ze(e,`dark`)}
|
|
9
|
+
}
|
|
10
|
+
`,Ve=le`
|
|
11
|
+
:root {
|
|
12
|
+
color-scheme: light;
|
|
13
|
+
|
|
14
|
+
--rack: oklch(0.962 0.004 258);
|
|
15
|
+
--panel: oklch(1 0 0);
|
|
16
|
+
--panel-sunk: oklch(0.972 0.004 258);
|
|
17
|
+
--panel-raised: oklch(0.988 0.003 258);
|
|
18
|
+
--rule: oklch(0.9 0.006 258);
|
|
19
|
+
--rule-strong: oklch(0.82 0.008 258);
|
|
20
|
+
|
|
21
|
+
--ink: oklch(0.22 0.017 258);
|
|
22
|
+
--ink-dim: oklch(0.45 0.015 258);
|
|
23
|
+
--ink-faint: oklch(0.62 0.012 258);
|
|
24
|
+
|
|
25
|
+
--accent: oklch(0.52 0.17 262);
|
|
26
|
+
--accent-ink: oklch(0.99 0 0);
|
|
27
|
+
--accent-wash: oklch(0.52 0.17 262 / 0.11);
|
|
28
|
+
|
|
29
|
+
--ok: oklch(0.52 0.13 162);
|
|
30
|
+
--warn: oklch(0.58 0.13 72);
|
|
31
|
+
--down: oklch(0.53 0.2 27);
|
|
32
|
+
--ok-wash: oklch(0.52 0.13 162 / 0.12);
|
|
33
|
+
--warn-wash: oklch(0.58 0.13 72 / 0.14);
|
|
34
|
+
--down-wash: oklch(0.53 0.2 27 / 0.11);
|
|
35
|
+
|
|
36
|
+
--grid-line: oklch(0.22 0.017 258 / 0.055);
|
|
37
|
+
--shadow: 0 1px 2px oklch(0.22 0.017 258 / 0.06);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dark {
|
|
41
|
+
color-scheme: dark;
|
|
42
|
+
|
|
43
|
+
--rack: oklch(0.163 0.013 258);
|
|
44
|
+
--panel: oklch(0.204 0.013 258);
|
|
45
|
+
--panel-sunk: oklch(0.183 0.013 258);
|
|
46
|
+
--panel-raised: oklch(0.246 0.013 258);
|
|
47
|
+
--rule: oklch(0.3 0.012 258);
|
|
48
|
+
--rule-strong: oklch(0.4 0.014 258);
|
|
49
|
+
|
|
50
|
+
--ink: oklch(0.94 0.006 250);
|
|
51
|
+
--ink-dim: oklch(0.72 0.011 253);
|
|
52
|
+
--ink-faint: oklch(0.55 0.012 255);
|
|
53
|
+
|
|
54
|
+
--accent: oklch(0.74 0.13 262);
|
|
55
|
+
--accent-ink: oklch(0.17 0.02 262);
|
|
56
|
+
--accent-wash: oklch(0.74 0.13 262 / 0.18);
|
|
57
|
+
|
|
58
|
+
--ok: oklch(0.75 0.14 162);
|
|
59
|
+
--warn: oklch(0.82 0.14 80);
|
|
60
|
+
--down: oklch(0.68 0.19 25);
|
|
61
|
+
--ok-wash: oklch(0.75 0.14 162 / 0.16);
|
|
62
|
+
--warn-wash: oklch(0.82 0.14 80 / 0.16);
|
|
63
|
+
--down-wash: oklch(0.68 0.19 25 / 0.16);
|
|
64
|
+
|
|
65
|
+
--grid-line: oklch(0.94 0.006 250 / 0.045);
|
|
66
|
+
--shadow: 0 1px 2px oklch(0 0 0 / 0.3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
*,
|
|
70
|
+
*::before,
|
|
71
|
+
*::after {
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
html,
|
|
76
|
+
body,
|
|
77
|
+
#root {
|
|
78
|
+
height: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
html {
|
|
82
|
+
background: ${({theme:e})=>e.color.rack};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
body {
|
|
86
|
+
margin: 0;
|
|
87
|
+
background: ${({theme:e})=>e.color.rack};
|
|
88
|
+
color: ${({theme:e})=>e.color.ink};
|
|
89
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
line-height: 1.45;
|
|
92
|
+
-webkit-font-smoothing: antialiased;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
h1, h2, h3, h4, p, figure, dl, dd {
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
ul, ol {
|
|
100
|
+
margin: 0;
|
|
101
|
+
padding: 0;
|
|
102
|
+
list-style: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
button, input, select, textarea {
|
|
106
|
+
font: inherit;
|
|
107
|
+
color: inherit;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
a {
|
|
111
|
+
color: inherit;
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:focus-visible {
|
|
116
|
+
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
117
|
+
outline-offset: 1px;
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
::selection {
|
|
122
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
::-webkit-scrollbar {
|
|
126
|
+
width: 10px;
|
|
127
|
+
height: 10px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
::-webkit-scrollbar-track {
|
|
131
|
+
background: transparent;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
::-webkit-scrollbar-thumb {
|
|
135
|
+
background: ${({theme:e})=>e.color.ruleStrong};
|
|
136
|
+
border: 3px solid transparent;
|
|
137
|
+
background-clip: padding-box;
|
|
138
|
+
border-radius: 6px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media (prefers-reduced-motion: reduce) {
|
|
142
|
+
*,
|
|
143
|
+
*::before,
|
|
144
|
+
*::after {
|
|
145
|
+
animation-duration: 0.01ms !important;
|
|
146
|
+
animation-iteration-count: 1 !important;
|
|
147
|
+
transition-duration: 0.01ms !important;
|
|
148
|
+
scroll-behavior: auto !important;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,He={color:{rack:`var(--rack)`,panel:`var(--panel)`,panelSunk:`var(--panel-sunk)`,panelRaised:`var(--panel-raised)`,rule:`var(--rule)`,ruleStrong:`var(--rule-strong)`,ink:`var(--ink)`,inkDim:`var(--ink-dim)`,inkFaint:`var(--ink-faint)`,accent:`var(--accent)`,accentInk:`var(--accent-ink)`,accentWash:`var(--accent-wash)`,ok:`var(--ok)`,warn:`var(--warn)`,down:`var(--down)`,okWash:`var(--ok-wash)`,warnWash:`var(--warn-wash)`,downWash:`var(--down-wash)`,shadow:`var(--shadow)`},font:{sans:`"Archivo Variable", ui-sans-serif, system-ui, sans-serif`,mono:`"Spline Sans Mono Variable", ui-monospace, "SF Mono", Menlo, monospace`},radius:{panel:`4px`,control:`3px`,chip:`2px`},space:e=>`${e*4}px`,z:{rail:20,chassis:30,overlay:40,dialog:50,toast:60}},Ue=/^[a-z][a-z0-9-]{0,31}$/;function We(e){return Ue.test(e)?`var(--p-${e}, var(--ink-faint))`:`var(--ink-faint)`}var Ge=`omni-theme`;function Ke(e){return e===`light`||e===`dark`||e===`system`}function qe(){try{let e=localStorage.getItem(Ge);return Ke(e)?e:`system`}catch{return`system`}}function Je(){return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function Ye(e){return e===`system`?Je()?`dark`:`light`:e}function Xe(e){let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}var Ze=ee(null);function Qe(){let e=te(Ze);if(e===null)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function $e({children:e}){let[t,n]=D(qe),[r,i]=D(()=>Ye(qe())),a=ne(e=>{n(e);try{localStorage.setItem(Ge,e)}catch{}},[]);return ie(()=>{let e=Ye(t);i(e),Xe(e)},[t]),ie(()=>{if(t!==`system`||typeof matchMedia!=`function`)return;let e=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=Je()?`dark`:`light`;i(e),Xe(e)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),k(Ze,{value:{mode:t,resolved:r,setMode:a},children:A(ce,{theme:He,children:[k(Ve,{}),e]})})}var et=j.svg`
|
|
152
|
+
display: block;
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
overflow: visible;
|
|
156
|
+
`;function tt(e,t,n,r){if(e.length===0)return``;let i=e.length===1?0:t/(e.length-1);return e.map((e,t)=>{let a=t*i,o=n-(r===0?0:e/r*n);return`${t===0?`M`:`L`}${a.toFixed(2)},${o.toFixed(2)}`}).join(` `)}function nt({values:e,overlay:t,height:n=28,color:r,overlayColor:i,scaleTo:a,label:o,className:s}){let c=ae(),l=a===void 0?Math.max(1,...e,...t??[]):Math.max(1,a),u=tt(e,100,n,l),d=u.length===0?``:`${u} L100,${n} L0,${n} Z`;return A(et,{className:s,viewBox:`0 0 100 ${n}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o,style:{height:n},children:[k(`defs`,{children:A(`linearGradient`,{id:c,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[k(`stop`,{offset:`0%`,stopColor:r??`var(--accent)`,stopOpacity:`0.28`}),k(`stop`,{offset:`100%`,stopColor:r??`var(--accent)`,stopOpacity:`0`})]})}),d.length===0?null:k(`path`,{d,fill:`url(#${c})`}),t===void 0?null:k(`path`,{d:tt(t,100,n,l),fill:`none`,stroke:i??`var(--down)`,strokeWidth:`1.25`,vectorEffect:`non-scaling-stroke`}),k(`path`,{d:u,fill:`none`,stroke:r??`var(--accent)`,strokeWidth:`1.5`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})}var rt=j.header`
|
|
157
|
+
grid-area: chassis;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
161
|
+
height: 48px;
|
|
162
|
+
padding: 0 ${({theme:e})=>e.space(3)};
|
|
163
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
164
|
+
background: ${({theme:e})=>e.color.panel};
|
|
165
|
+
${g}
|
|
166
|
+
position: sticky;
|
|
167
|
+
top: 0;
|
|
168
|
+
z-index: ${({theme:e})=>e.z.chassis};
|
|
169
|
+
`,it=j.div`
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: baseline;
|
|
172
|
+
gap: 7px;
|
|
173
|
+
font-stretch: 74%;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
letter-spacing: 0.2em;
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
text-transform: uppercase;
|
|
178
|
+
flex: none;
|
|
179
|
+
`,at=j(x)`
|
|
180
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
|
|
183
|
+
@media (max-width: 860px) {
|
|
184
|
+
display: none;
|
|
185
|
+
}
|
|
186
|
+
`,N=j.div`
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: baseline;
|
|
189
|
+
gap: 6px;
|
|
190
|
+
padding-left: ${({theme:e})=>e.space(3)};
|
|
191
|
+
border-left: 1px solid ${({theme:e})=>e.color.rule};
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
`,ot=j(N)`
|
|
194
|
+
width: 96px;
|
|
195
|
+
align-items: center;
|
|
196
|
+
`,st=j.div`
|
|
197
|
+
flex: 1;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
`,ct=j(h)`
|
|
200
|
+
gap: 6px;
|
|
201
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
202
|
+
letter-spacing: 0.08em;
|
|
203
|
+
`,lt=j.span`
|
|
204
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
205
|
+
`,ut={push:{name:`live, pushing`,lamp:`live`,head:`LIVE`,tail:`PUSH`,title:`Refreshing on gateway push — pause refreshing`},poll:{name:`live, polling`,lamp:`ok`,head:`LIVE`,tail:`POLL`,title:`Refreshing on a timer — pause refreshing`},paused:{name:`paused`,lamp:`idle`,head:`PAUSED`,tail:null,title:`Resume refreshing`},offline:{name:`offline`,lamp:`down`,head:`OFFLINE`,tail:null,title:`Not refreshing — this session ended, sign in again`}},dt=[`system`,`light`,`dark`],ft={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},pt=6e5;function mt({logs:e,logsFailed:n,signOut:a}){let{live:o,toggle:s,connection:c}=fe(),{mode:l,setMode:p}=Qe(),m=Date.now(),h=oe(()=>e.filter(e=>m-e.at<=pt),[e,m]),g=f(h,pt),y=u(h,{now:m,spanMs:pt,count:24}),x=dt[(dt.indexOf(l)+1)%dt.length]??`system`,S=l===`light`?Ie:l===`dark`?je:Ae,w=ut[o?c.status===`offline`?`offline`:c.status===`push`?`push`:`poll`:`paused`],ee=n||g.errorRate>=.25?`down`:g.errorRate>=.05?`warn`:h.length===0?`idle`:`ok`;return A(rt,{children:[A(it,{children:[k(d,{state:ee,label:n?`request log unreadable`:`error rate ${i(g.errorRate)}`}),`Omnigateway`]}),A(at,{children:[A(ot,{children:[k(b,{children:`req`}),k(st,{children:k(nt,{values:y.map(e=>e.total),overlay:y.map(e=>e.errors),height:22,label:`${g.requests} requests in the last 10 minutes`})})]}),A(N,{children:[k(b,{children:`rate`}),k(C,{children:g.ratePerMin.toFixed(1)}),k(b,{children:`/min`})]}),A(N,{children:[k(b,{children:`err`}),k(C,{style:{color:g.errorRate>=.05?`var(--down)`:void 0},children:i(g.errorRate)})]}),A(N,{children:[k(b,{children:`ttft p50`}),k(C,{children:r(g.ttftP50)})]}),A(N,{children:[k(b,{children:`spend`}),k(C,{children:t(g.costUsd)})]})]}),k(v,{}),A(ct,{type:`button`,$size:`sm`,onClick:s,"aria-pressed":o,"aria-label":w.name,title:w.title,children:[k(d,{state:w.lamp,label:w.name}),w.head,w.tail===null?null:A(O,{children:[k(lt,{"aria-hidden":`true`,children:`·`}),w.tail]})]}),k(_,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>p(x),"aria-label":ft[l],title:`${ft[l]} — switch to ${ft[x].toLowerCase()}`,children:k(S,{})}),k(_,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:a.pending,onClick:a.run,children:k(ke,{})})]})}function ht(){let e=s(),{cadence:t}=fe(),n=p(),r=l(200,t(1e4,`res:logs`));return k(mt,{logs:r.data??[],logsFailed:r.isError,signOut:{pending:n.isPending,run:()=>{n.mutate(void 0,{onSuccess:()=>void e({to:`/login`})})}}})}function gt(e){return`/plugins/${e}`}function _t(e){return e.filter(e=>e.nav!==null&&e.ui!==null).sort((e,t)=>e.id.localeCompare(t.id)).map(e=>({id:e.id,label:e.nav?.label??e.name,disabledReason:vt(e)}))}function vt(e){let t=e.ui;return t===null||t.compatible&&t.entry!==null?null:t.reason??`This plugin's interface does not match this gateway.`}var yt=Object.defineProperty,bt=(e,t)=>yt(e,`name`,{value:t,configurable:!0});function xt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}bt(xt,`setRef`);function St(...e){return t=>{let n=!1,r=e.map(e=>{let r=xt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():xt(e[t],null)}}}}bt(St,`composeRefs`);function P(...e){return w.useCallback(St(...e),e)}bt(P,`useComposedRefs`);var Ct=Object.defineProperty,F=(e,t)=>Ct(e,`name`,{value:t,configurable:!0});function wt(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Mt(r)&&typeof It==`function`&&(r=It(r._payload)),w.Children.forEach(r,e=>{if(At(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Mt(n)&&typeof It==`function`&&(n=It(n._payload)),a=Dt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?kt(a):void 0,l=P(n,c);if(!a){if(r||r===0)throw Error(o?Ft(e):Pt(e));return r}let u=Ot(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}F(wt,`createSlot`);var Tt=Symbol.for(`radix.slottable`);function Et(e){let t=F(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Tt,t}F(Et,`createSlottable`);var Dt=F((e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ot(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}F(Ot,`mergeProps`);function kt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}F(kt,`getElementRef`);function At(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Tt}F(At,`isSlottable`);var jt=Symbol.for(`react.lazy`);function Mt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===jt&&`_payload`in e&&Nt(e._payload)}F(Mt,`isLazyComponent`);function Nt(e){return typeof e==`object`&&!!e&&`then`in e}F(Nt,`isPromiseLike`);var Pt=F(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ft=F(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),It=w.use,Lt=Object.defineProperty,Rt=(e,t)=>Lt(e,`name`,{value:t,configurable:!0}),I=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=wt(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),k(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zt(e,t){e&&se.flushSync(()=>e.dispatchEvent(t))}Rt(zt,`dispatchDiscreteCustomEvent`);var Bt=Object.defineProperty,L=(e,t)=>Bt(e,`name`,{value:t,configurable:!0});function Vt(e,t){let n=w.createContext(t);n.displayName=e+`Context`;let r=L(e=>{let{children:t,...r}=e,i=w.useMemo(()=>r,Object.values(r));return k(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=w.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return L(i,`useContext`),[r,i]}L(Vt,`createContext`);function Ht(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=L(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return k(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=w.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return L(s,`useContext`),[o,s]}L(r,`createContext`);let i=L(()=>{let t=n.map(e=>w.createContext(e));return L(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Ut(i,...t)]}L(Ht,`createContextScope`);function Ut(...e){let t=e[0];if(e.length===1)return t;let n=L(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return L(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}L(Ut,`composeContextScopes`);var Wt=Object.defineProperty,R=(e,t)=>Wt(e,`name`,{value:t,configurable:!0}),Gt=!!(typeof window<`u`&&window.document&&window.document.createElement);function z(e,t,{checkForDefaultPrevented:n=!0}={}){return R(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}R(z,`composeEventHandlers`);function Kt(e){if(!Gt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}R(Kt,`getOwnerWindow`);function qt(e){if(!Gt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}R(qt,`getOwnerDocument`);function Jt(e,t=!1){let{activeElement:n}=qt(e);if(!n?.nodeName)return null;if(Yt(n)&&n.contentDocument)return Jt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=qt(n).getElementById(e);if(t)return t}}return n}R(Jt,`getActiveElement`);function Yt(e){return e.tagName===`IFRAME`}R(Yt,`isFrame`);var B=globalThis?.document?w.useLayoutEffect:()=>{},Xt=Object.defineProperty,Zt=(e,t)=>Xt(e,`name`,{value:t,configurable:!0}),Qt=w.useEffectEvent,$t=w.useInsertionEffect;function en(e){if(typeof Qt==`function`)return Qt(e);let t=w.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $t==`function`?$t(()=>{t.current=e}):B(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zt(en,`useEffectEvent`);var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0}),rn=w.useInsertionEffect||B;function an({prop:e,defaultProp:t,onChange:n=nn(()=>{},`onChange`),caller:r}){let[i,a,o]=on({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,w.useCallback(t=>{if(s){let n=sn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nn(an,`useControllableState`);function on({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),i=w.useRef(n),a=w.useRef(t);return rn(()=>{a.current=t},[t]),w.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nn(on,`useUncontrolledState`);function sn(e){return typeof e==`function`}nn(sn,`isFunction`);var cn=Symbol(`RADIX:SYNC_STATE`);function ln(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=en(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===cn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=w.useRef(p);w.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=w.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return w.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:cn,state:i})},[i,d.state,c]),[h,f]}nn(ln,`useControllableStateReducer`);var un=Object.defineProperty,V=(e,t)=>un(e,`name`,{value:t,configurable:!0});function dn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}V(dn,`useStateMachine`);var fn=V(e=>{let{present:t,children:n}=e,r=pn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=hn(r.ref,gn(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null},`Presence`);function pn(e){let[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),a=w.useRef(`none`),o=w.useRef(void 0),[s,c]=dn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{s===`mounted`?(a.current=o.current??H(r.current),o.current=void 0):a.current=`none`},[s]),B(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=H(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),B(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=V(a=>{let o=H(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=V(e=>{e.target===t&&(a.current=H(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=H(t)}else r.current=null;n(e)},[])}}V(pn,`usePresence`);function mn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}V(mn,`setRef`);function hn(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=mn(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():mn(n[e],null)}}},[])}V(hn,`useStableComposedRefs`);function H(e){return e?.animationName||`none`}V(H,`getAnimationName`);function gn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}V(gn,`getElementRef`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=w.useId||(()=>void 0),bn=0;function xn(e){let[t,n]=w.useState(yn());return B(()=>{e||n(e=>e??String(bn++))},[e]),e||(t?`radix-${t}`:``)}vn(xn,`useId`);var Sn=Object.defineProperty,Cn=(e,t)=>Sn(e,`name`,{value:t,configurable:!0});function U(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>((...e)=>t.current?.(...e)),[])}Cn(U,`useCallbackRef`);var wn=Object.defineProperty,W=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),Tn=`dismissableLayer.update`,En=`dismissableLayer.pointerDownOutside`,Dn=`dismissableLayer.focusOutside`,On,kn=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),An=w.forwardRef(W(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(kn),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=w.useState({}),h=P(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=w.useRef(!1),C=Nn(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),ee=Pn(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=U(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return w.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(On=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Fn(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=On))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Fn())},[d,u]),w.useEffect(()=>{let e=W(()=>m({}),`handleUpdate`);return document.addEventListener(Tn,e),()=>document.removeEventListener(Tn,e)},[]),k(I.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:z(e.onFocusCapture,ee.onFocusCapture),onBlurCapture:z(e.onBlurCapture,ee.onBlurCapture),onPointerDownCapture:z(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function jn(){let e=w.useContext(kn),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}W(jn,`useDismissableLayerSurface`);var Mn=W(()=>!0,`IS_TRUE`);function Nn(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Mn}=t,s=U(e),c=w.useRef(!1),l=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}W(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}W(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}W(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}W(p,`handleInteractionBubble`);let m=W(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||In(En,s,p,{discrete:!0})};if(W(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:W(()=>c.current=!0,`onPointerDownCapture`)}}W(Nn,`usePointerDownOutside`);function Pn(e,t=globalThis?.document){let n=U(e),r=w.useRef(!1);return w.useEffect(()=>{let e=W(e=>{e.target&&!r.current&&In(Dn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:W(()=>r.current=!0,`onFocusCapture`),onBlurCapture:W(()=>r.current=!1,`onBlurCapture`)}}W(Pn,`useFocusOutside`);function Fn(){let e=new CustomEvent(Tn);document.dispatchEvent(e)}W(Fn,`dispatchUpdate`);function In(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zt(i,a):i.dispatchEvent(a)}W(In,`handleAndDispatchCustomEvent`);var Ln=Object.defineProperty,G=(e,t)=>Ln(e,`name`,{value:t,configurable:!0}),Rn=`focusScope.autoFocusOnMount`,zn=`focusScope.autoFocusOnUnmount`,Bn={bubbles:!1,cancelable:!0},Vn=w.forwardRef(G(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=w.useState(null),l=U(i),u=U(a),d=w.useRef(null),f=P(t,c),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:K(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||K(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)};G(e,`handleFocusIn`),G(t,`handleFocusOut`),G(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),w.useEffect(()=>{if(s){Jn.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Rn,Bn);s.addEventListener(Rn,l),s.dispatchEvent(t),t.defaultPrevented||(Hn(Zn(Wn(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(Rn,l),setTimeout(()=>{let t=new CustomEvent(zn,Bn);s.addEventListener(zn,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(zn,u),Jn.remove(p)},0)}}},[s,l,u,p]);let m=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Un(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&K(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&K(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return k(I.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Hn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}G(Hn,`focusFirst`);function Un(e){let t=Wn(e);return[Gn(t,e),Gn(t.reverse(),e)]}G(Un,`getTabbableEdges`);function Wn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:G(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}G(Wn,`getTabbableCandidates`);function Gn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Kn(r,{upTo:t})))return r}G(Gn,`findVisible`);function Kn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}G(Kn,`isHidden`);function qn(e){return e instanceof HTMLInputElement&&`select`in e}G(qn,`isSelectableInput`);function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qn(e)&&t&&e.select()}}G(K,`focus`);var Jn=Yn();function Yn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xn(e,t),e.unshift(t)},remove(t){e=Xn(e,t),e[0]?.resume()}}}G(Yn,`createFocusScopesStack`);function Xn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}G(Xn,`arrayRemove`);function Zn(e){return e.filter(e=>e.tagName!==`A`)}G(Zn,`removeLinks`);var Qn=Object.defineProperty,$n=w.forwardRef(((e,t)=>Qn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=w.useState(!1);B(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?se.createPortal(k(I.div,{...r,ref:t}),o):null},`Portal`)),er=Object.defineProperty,tr=(e,t)=>er(e,`name`,{value:t,configurable:!0}),nr=0,rr=null;function ir(e){return ar(),e.children}tr(ir,`FocusGuards`);function ar(){w.useEffect(()=>{rr||={start:or(),end:or()};let{start:e,end:t}=rr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),nr++,()=>{nr===1&&(rr?.start.remove(),rr?.end.remove(),rr=null),nr=Math.max(0,nr-1)}},[])}tr(ar,`useFocusGuards`);function or(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}tr(or,`createFocusGuard`);var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},q.apply(this,arguments)};function sr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var lr=`right-scroll-bar-position`,ur=`width-before-scroll-bar`,dr=`with-scroll-bars-hidden`,fr=`--removed-body-scroll-bar-size`;function pr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function mr(e,t){var n=D(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hr=typeof window<`u`?w.useLayoutEffect:w.useEffect,gr=new WeakMap;function _r(e,t){var n=mr(t||null,function(t){return e.forEach(function(e){return pr(e,t)})});return hr(function(){var t=gr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||pr(e,null)}),i.forEach(function(e){r.has(e)||pr(e,a)})}gr.set(n,e)},[e]),n}function vr(e){return e}function yr(e,t){t===void 0&&(t=vr);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function br(e){e===void 0&&(e={});var t=yr(null);return t.options=q({async:!0,ssr:!1},e),t}var xr=function(e){var t=e.sideCar,n=sr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return w.createElement(r,q({},n))};xr.isSideCarExport=!0;function Sr(e,t){return e.useMedium(t),xr}var Cr=br(),wr=function(){},Tr=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:wr,onWheelCapture:wr,onTouchMoveCapture:wr}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=sr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=_r([n,t]),C=q(q({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(x,{sideCar:Cr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?w.cloneElement(w.Children.only(s),q(q({},C),{ref:S})):w.createElement(v,q({},C,{className:c,ref:S}),s))});Tr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tr.classNames={fullWidth:ur,zeroRight:lr};var Er,Dr=function(){if(Er)return Er;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Or(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Dr();return t&&e.setAttribute(`nonce`,t),e}function kr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ar(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Or())&&(kr(t,n),Ar(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mr=function(){var e=jr();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nr=function(){var e=Mr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Pr={left:0,top:0,right:0,gap:0},Fr=function(e){return parseInt(e||``,10)||0},Ir=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Fr(n),Fr(r),Fr(i)]},Lr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Pr;var t=Ir(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Rr=Nr(),zr=`data-scroll-locked`,Br=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
206
|
+
.${dr} {
|
|
207
|
+
overflow: hidden ${r};
|
|
208
|
+
padding-right: ${s}px ${r};
|
|
209
|
+
}
|
|
210
|
+
body[${zr}] {
|
|
211
|
+
overflow: hidden ${r};
|
|
212
|
+
overscroll-behavior: contain;
|
|
213
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
214
|
+
padding-left: ${i}px;
|
|
215
|
+
padding-top: ${a}px;
|
|
216
|
+
padding-right: ${o}px;
|
|
217
|
+
margin-left:0;
|
|
218
|
+
margin-top:0;
|
|
219
|
+
margin-right: ${s}px ${r};
|
|
220
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.${lr} {
|
|
224
|
+
right: ${s}px ${r};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.${ur} {
|
|
228
|
+
margin-right: ${s}px ${r};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.${lr} .${lr} {
|
|
232
|
+
right: 0 ${r};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.${ur} .${ur} {
|
|
236
|
+
margin-right: 0 ${r};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
body[${zr}] {
|
|
240
|
+
${fr}: ${s}px;
|
|
241
|
+
}
|
|
242
|
+
`},Vr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Hr=function(){w.useEffect(function(){return document.body.setAttribute(zr,(Vr()+1).toString()),function(){var e=Vr()-1;e<=0?document.body.removeAttribute(zr):document.body.setAttribute(zr,e.toString())}},[])},Ur=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Hr();var a=w.useMemo(function(){return Lr(i)},[i]);return w.createElement(Rr,{styles:Br(a,!t,i,n?``:`!important`)})},Wr=!1;if(typeof window<`u`)try{var Gr=Object.defineProperty({},"passive",{get:function(){return Wr=!0,!0}});window.addEventListener(`test`,Gr,Gr),window.removeEventListener(`test`,Gr,Gr)}catch{Wr=!1}var J=Wr?{passive:!1}:!1,Kr=function(e){return e.tagName===`TEXTAREA`},qr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Kr(e)&&n[t]===`visible`)},Jr=function(e){return qr(e,`overflowY`)},Yr=function(e){return qr(e,`overflowX`)},Xr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),$r(e,r)){var i=ei(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Qr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},$r=function(e,t){return e===`v`?Jr(t):Yr(t)},ei=function(e,t){return e===`v`?Zr(t):Qr(t)},ti=function(e,t){return e===`h`&&t===`rtl`?-1:1},ni=function(e,t,n,r,i){var a=ti(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=ei(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&$r(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ri=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ii=function(e){return[e.deltaX,e.deltaY]},ai=function(e){return e&&`current`in e?e.current:e},oi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},si=function(e){return`
|
|
243
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
244
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
245
|
+
`},ci=0,Y=[];function li(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(ci++)[0],a=w.useState(Nr)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=cr([e.lockRef.current],(e.shards||[]).map(ai),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ri(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Xr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Xr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ni(h,t,e,h===`h`?s:c,!0)},[]),c=w.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?ii(n):ri(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&oi(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ai).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=w.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ui(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=w.useCallback(function(e){n.current=ri(e),r.current=void 0},[]),d=w.useCallback(function(t){l(t.type,ii(t),t.target,s(t,e.lockRef.current))},[]),f=w.useCallback(function(t){l(t.type,ri(t),t.target,s(t,e.lockRef.current))},[]);w.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,u,J),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,u,J)}},[]);var p=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(a,{styles:si(i)}):null,p?w.createElement(Ur,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ui(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var di=Sr(Cr,li),fi=w.forwardRef(function(e,t){return w.createElement(Tr,q({},e,{ref:t,sideCar:di}))});fi.classNames=Tr.classNames;var pi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,mi=new WeakMap,hi={},gi=0,_i=function(e){return e&&(e.host||_i(e.parentNode))},vi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=_i(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},yi=function(e,t,n,r){var i=vi(t,Array.isArray(e)?e:[e]);hi[n]||(hi[n]=new WeakMap);var a=hi[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&mi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),gi++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(mi.has(e)||e.removeAttribute(r),mi.delete(e)),i||e.removeAttribute(n)}),gi--,gi||(X=new WeakMap,X=new WeakMap,mi=new WeakMap,hi={})}},bi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||pi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),yi(r,i,n,`aria-hidden`)):function(){return null}},xi=Object.defineProperty,Z=(e,t)=>xi(e,`name`,{value:t,configurable:!0}),Si=`Dialog`,[Ci,wi]=Ht(Si),[Ti,Q]=Ci(Si),Ei=Z(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=w.useRef(null),c=w.useRef(null),[l,u]=an({prop:r,defaultProp:i??!1,onChange:a,caller:Si}),[d,f]=w.useState(0),[p,m]=w.useState(0);return k(Ti,{scope:t,triggerRef:s,contentRef:c,contentId:xn(),titleId:xn(),descriptionId:xn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Di=`DialogPortal`,[Oi,ki]=Ci(Di,{forceMount:void 0}),Ai=Z(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Q(Di,t);return k(Oi,{scope:t,forceMount:n,children:w.Children.map(r,e=>k(fn,{present:n||a.open,children:k($n,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ji=`DialogOverlay`,Mi=w.forwardRef(Z(function(e,t){let n=ki(ji,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q(ji,e.__scopeDialog);return a.modal?k(fn,{present:r||a.open,children:k(Pi,{...i,ref:t})}):null},`DialogOverlay`)),Ni=wt(`DialogOverlay.RemoveScroll`),Pi=w.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(ji,n),a=P(t,jn());return k(fi,{as:Ni,allowPinchZoom:!0,shards:[i.contentRef],children:k(I.div,{"data-state":Gi(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),$=`DialogContent`,Fi=w.forwardRef(Z(function(e,t){let n=ki($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q($,e.__scopeDialog);return k(fn,{present:r||a.open,children:a.modal?k(Ii,{...i,ref:t}):k(Li,{...i,ref:t})})},`DialogContent`)),Ii=w.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=w.useRef(null),i=P(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return bi(e)},[]),k(Ri,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Li=w.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return k(Ri,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ri=w.forwardRef(Z(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Q($,n);return ar(),k(O,{children:k(Vn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:k(An,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Gi(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),zi=`DialogTitle`,Bi=w.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(zi,n),{setTitleCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),k(I.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Vi=`DialogDescription`,Hi=w.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Vi,n),{setDescriptionCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),k(I.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ui=`DialogClose`,Wi=w.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Ui,n);return k(I.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Gi(e){return e?`open`:`closed`}Z(Gi,`getState`);var Ki=j(Mi)`
|
|
246
|
+
position: fixed;
|
|
247
|
+
inset: 0;
|
|
248
|
+
z-index: ${({theme:e})=>e.z.overlay};
|
|
249
|
+
background: oklch(0 0 0 / 0.5);
|
|
250
|
+
backdrop-filter: blur(2px);
|
|
251
|
+
`,qi=j(Fi)`
|
|
252
|
+
position: fixed;
|
|
253
|
+
z-index: ${({theme:e})=>e.z.dialog};
|
|
254
|
+
top: 50%;
|
|
255
|
+
left: 50%;
|
|
256
|
+
transform: translate(-50%, -50%);
|
|
257
|
+
width: min(${({$width:e})=>e}, calc(100vw - 32px));
|
|
258
|
+
max-height: calc(100vh - 64px);
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
background: ${({theme:e})=>e.color.panel};
|
|
262
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
263
|
+
border-radius: ${({theme:e})=>e.radius.panel};
|
|
264
|
+
box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
|
|
265
|
+
`,Ji=j.div`
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
269
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(2)} ${e.space(2)} ${e.space(3)}`};
|
|
270
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
271
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
272
|
+
`,Yi=j.div`
|
|
273
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
274
|
+
overflow-y: auto;
|
|
275
|
+
`,Xi=j.div`
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: flex-end;
|
|
278
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
279
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
280
|
+
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
281
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
282
|
+
`,Zi=j(Hi)`
|
|
283
|
+
margin: 0 0 ${({theme:e})=>e.space(3)};
|
|
284
|
+
font-size: 12px;
|
|
285
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
286
|
+
`;function Qi({open:e,onOpenChange:t,title:n,description:r,footer:i,width:a=`560px`,children:o}){return k(Ei,{open:e,onOpenChange:t,children:A(Ai,{children:[k(Ki,{}),A(qi,{$width:a,children:[A(Ji,{children:[k(Bi,{asChild:!0,children:k(b,{as:`h2`,children:n})}),k(v,{}),k(Wi,{asChild:!0,children:k(_,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Close`,children:k(Re,{})})})]}),A(Yi,{children:[r===void 0?null:k(Zi,{children:r}),o]}),i===void 0?null:k(Xi,{children:i})]})]})})}var $i=j.p`
|
|
287
|
+
font-size: 13px;
|
|
288
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
289
|
+
`;function ea({open:e,onOpenChange:t,title:n,body:r,confirmLabel:i,busy:a,onConfirm:o}){return k(Qi,{open:e,onOpenChange:t,title:n,width:`420px`,footer:A(O,{children:[k(h,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),k(h,{type:`button`,$variant:`danger`,disabled:a===!0,onClick:o,children:i})]}),children:k($i,{children:r})})}var ta={systemd:`systemd is capturing this process, so a restart asks the manager to bring the unit back rather than signalling the gateway itself.`,container:`This gateway is running in a container, so a restart is an exit and the container's restart policy decides what happens next.`,none:`Nothing is supervising this process. It was started directly, and whatever stops it leaves it stopped.`},na=j.hr`
|
|
290
|
+
flex: none;
|
|
291
|
+
border: 0;
|
|
292
|
+
margin: 0;
|
|
293
|
+
height: 1px;
|
|
294
|
+
align-self: stretch;
|
|
295
|
+
background: ${({theme:e})=>e.color.rule};
|
|
296
|
+
|
|
297
|
+
/* The rail turns on its side below 720px, and so does the rule that closes it. */
|
|
298
|
+
@media (max-width: 720px) {
|
|
299
|
+
height: auto;
|
|
300
|
+
width: 1px;
|
|
301
|
+
margin-left: ${({theme:e})=>e.space(2)};
|
|
302
|
+
}
|
|
303
|
+
`,ra=j.div`
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
gap: 6px;
|
|
307
|
+
padding-top: ${({theme:e})=>e.space(2)};
|
|
308
|
+
|
|
309
|
+
@media (max-width: 720px) {
|
|
310
|
+
padding-top: 0;
|
|
311
|
+
padding-left: ${({theme:e})=>e.space(2)};
|
|
312
|
+
flex-direction: row;
|
|
313
|
+
align-items: center;
|
|
314
|
+
}
|
|
315
|
+
`,ia=j(h)`
|
|
316
|
+
justify-content: flex-start;
|
|
317
|
+
width: 100%;
|
|
318
|
+
|
|
319
|
+
@media (max-width: 720px) {
|
|
320
|
+
width: auto;
|
|
321
|
+
}
|
|
322
|
+
`,aa=j.p`
|
|
323
|
+
font-size: 10.5px;
|
|
324
|
+
line-height: 1.3;
|
|
325
|
+
color: ${({theme:e})=>e.color.warn};
|
|
326
|
+
`,oa=j.p`
|
|
327
|
+
font-size: 10.5px;
|
|
328
|
+
line-height: 1.3;
|
|
329
|
+
color: ${({theme:e})=>e.color.down};
|
|
330
|
+
`,sa=j.p`
|
|
331
|
+
font-size: 10.5px;
|
|
332
|
+
line-height: 1.3;
|
|
333
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
334
|
+
${y}
|
|
335
|
+
`,ca=j.p`
|
|
336
|
+
font-size: 10.5px;
|
|
337
|
+
line-height: 1.3;
|
|
338
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
339
|
+
`,la=9e4;async function ua(){try{return(await fetch(`/health`,{cache:`no-store`})).ok}catch{return!1}}function da({pollMs:t=750}){let r=c(),i=e(),a=n(),[o,s]=D(null),[l,u]=D(!1),[d,f]=D(!1),[p,h]=D(`idle`),g=r.data;ie(()=>{if(!l)return;let e=!1,n,r=!1,i=0,a=Math.max(1,Math.ceil(la/t)),o=async()=>{let s=await ua();if(!e){if(!r&&!s)r=!0,h(`returning`);else if(r&&s){window.location.reload();return}if(i+=1,i>=a){h(`lost`),u(!1);return}n=setTimeout(()=>void o(),t)}};return n=setTimeout(()=>void o(),t),()=>{e=!0,n!==void 0&&clearTimeout(n)}},[l,t]);let _=()=>{h(`leaving`),i.mutate(void 0,{onSuccess:()=>u(!0),onError:()=>h(`idle`)})};return d?A(O,{children:[k(v,{}),k(na,{}),k(ra,{children:A(m,{$gap:1,children:[k(b,{children:`Gateway stopped`}),A(ca,{children:[`Nothing on this screen will update again, and nothing here can start it: that needs`,` `,g?.supervisor===`container`?`the host that runs this container`:`a shell on the machine it runs on`,`.`]})]})})]}):A(O,{children:[k(v,{}),k(na,{}),A(ra,{title:g===void 0?void 0:ta[g.supervisor],children:[A(ia,{type:`button`,$size:`sm`,"aria-label":`Restart gateway`,disabled:g===void 0||!g.canRestart||i.isPending||l,onClick:()=>s(`restart`),children:[k(Ne,{}),`Restart`]}),A(ia,{type:`button`,$size:`sm`,$variant:`danger`,"aria-label":`Shut down gateway`,disabled:g===void 0||!g.canShutdown||a.isPending||l,onClick:()=>s(`shutdown`),children:[k(Me,{}),`Shut down`]}),g?.note===void 0?null:k(aa,{children:g.note}),p===`leaving`?k(sa,{role:`status`,children:`Restarting. Waiting for the gateway to stop answering.`}):p===`returning`?k(sa,{role:`status`,children:`The gateway has stopped answering. Waiting for it to come back, then this page reloads.`}):p===`lost`?k(oa,{role:`alert`,children:`The gateway has not come back. Reload this page once it is running again, or check the machine it runs on.`}):null,i.isError?k(oa,{role:`alert`,children:S(i.error)}):null,a.isError?k(oa,{role:`alert`,children:S(a.error)}):null]}),k(ea,{open:o===`restart`,onOpenChange:e=>{e||s(null)},title:`Restart gateway`,body:`${g===void 0?``:`${ta[g.supervisor]} `}Requests in flight are dropped when the process goes. This console waits for the gateway to stop answering and to answer again, then reloads itself.`,confirmLabel:`Restart now`,busy:i.isPending,onConfirm:()=>{s(null),_()}}),k(ea,{open:o===`shutdown`,onOpenChange:e=>{e||s(null)},title:`Shut down gateway`,body:g?.supervisor===`container`?`Stopping the only process in this container takes this dashboard with it, and the dashboard is what would have restarted the gateway. Unless the container's restart policy brings it back, getting it running again needs access to the host.`:`The gateway stops serving and stays stopped. This console goes with it, so starting the gateway again needs a shell on the machine it runs on.`,confirmLabel:`Shut down now`,busy:a.isPending,onConfirm:()=>{s(null),a.mutate(void 0,{onSuccess:()=>f(!0)})}})]})}var fa=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:Se},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:Te},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:we},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:Oe},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:De},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:Pe},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:Le},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:Fe},{to:`/database`,label:`Database`,blurb:`Size, snapshots, and retention`,Icon:Ee}],pa=j.nav`
|
|
340
|
+
grid-area: rail;
|
|
341
|
+
display: flex;
|
|
342
|
+
flex-direction: column;
|
|
343
|
+
gap: 2px;
|
|
344
|
+
padding: ${({theme:e})=>e.space(2)};
|
|
345
|
+
border-right: 1px solid ${({theme:e})=>e.color.rule};
|
|
346
|
+
background: ${({theme:e})=>e.color.panel};
|
|
347
|
+
overflow-y: auto;
|
|
348
|
+
|
|
349
|
+
@media (max-width: 720px) {
|
|
350
|
+
flex-direction: row;
|
|
351
|
+
overflow-x: auto;
|
|
352
|
+
border-right: 0;
|
|
353
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
354
|
+
}
|
|
355
|
+
`,ma=ue`
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
359
|
+
padding: 7px ${({theme:e})=>e.space(2)};
|
|
360
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
361
|
+
border-left: 2px solid transparent;
|
|
362
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
363
|
+
font-size: 12.5px;
|
|
364
|
+
font-weight: 500;
|
|
365
|
+
white-space: nowrap;
|
|
366
|
+
transition:
|
|
367
|
+
background 120ms ease,
|
|
368
|
+
color 120ms ease;
|
|
369
|
+
|
|
370
|
+
svg {
|
|
371
|
+
width: 15px;
|
|
372
|
+
height: 15px;
|
|
373
|
+
flex: none;
|
|
374
|
+
}
|
|
375
|
+
`,ha=j(o)`
|
|
376
|
+
${ma}
|
|
377
|
+
|
|
378
|
+
&:hover {
|
|
379
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
380
|
+
color: ${({theme:e})=>e.color.ink};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
&[data-status="active"] {
|
|
384
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
385
|
+
border-left-color: ${({theme:e})=>e.color.accent};
|
|
386
|
+
color: ${({theme:e})=>e.color.accent};
|
|
387
|
+
}
|
|
388
|
+
`,ga=j.button`
|
|
389
|
+
${ma}
|
|
390
|
+
align-items: flex-start;
|
|
391
|
+
width: 100%;
|
|
392
|
+
text-align: left;
|
|
393
|
+
white-space: normal;
|
|
394
|
+
background: none;
|
|
395
|
+
border-top: 0;
|
|
396
|
+
border-right: 0;
|
|
397
|
+
border-bottom: 0;
|
|
398
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
399
|
+
cursor: not-allowed;
|
|
400
|
+
font-family: inherit;
|
|
401
|
+
|
|
402
|
+
svg {
|
|
403
|
+
margin-top: 2px;
|
|
404
|
+
}
|
|
405
|
+
`,_a=j.span`
|
|
406
|
+
display: flex;
|
|
407
|
+
flex-direction: column;
|
|
408
|
+
gap: 2px;
|
|
409
|
+
min-width: 0;
|
|
410
|
+
`,va=j.span`
|
|
411
|
+
font-size: 10.5px;
|
|
412
|
+
font-weight: 400;
|
|
413
|
+
line-height: 1.3;
|
|
414
|
+
color: ${({theme:e})=>e.color.warn};
|
|
415
|
+
`;function ya(){let e=a();return A(pa,{"aria-label":`Console sections`,children:[fa.map(({to:e,label:t,blurb:n,Icon:r})=>A(ha,{to:e,title:n,activeOptions:{exact:e===`/`},children:[k(r,{}),t]},e)),_t(e.data??[]).map(({id:e,label:t,disabledReason:n})=>n===null?A(ha,{to:gt(e),title:`Provided by the ${e} plugin`,children:[k(Ce,{}),t]},e):A(ga,{type:`button`,disabled:!0,children:[k(Ce,{}),A(_a,{children:[t,k(va,{children:n})]})]},e)),k(da,{})]})}var ba=j.div`
|
|
416
|
+
display: grid;
|
|
417
|
+
grid-template-areas:
|
|
418
|
+
"chassis chassis"
|
|
419
|
+
"rail main";
|
|
420
|
+
grid-template-columns: 168px minmax(0, 1fr);
|
|
421
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
422
|
+
height: 100vh;
|
|
423
|
+
min-height: 0;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
|
|
426
|
+
@media (max-width: 720px) {
|
|
427
|
+
grid-template-areas:
|
|
428
|
+
"chassis"
|
|
429
|
+
"rail"
|
|
430
|
+
"main";
|
|
431
|
+
grid-template-columns: minmax(0, 1fr);
|
|
432
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
433
|
+
}
|
|
434
|
+
`,xa=j.main`
|
|
435
|
+
grid-area: main;
|
|
436
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
437
|
+
display: flex;
|
|
438
|
+
flex-direction: column;
|
|
439
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
440
|
+
min-width: 0;
|
|
441
|
+
min-height: 0;
|
|
442
|
+
overflow-y: auto;
|
|
443
|
+
|
|
444
|
+
@media (max-width: 720px) {
|
|
445
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
446
|
+
}
|
|
447
|
+
`;function Sa({children:e}){return A(ba,{"data-testid":`rack-shell`,children:[k(ht,{}),k(ya,{}),k(xa,{children:e})]})}var Ca=j.div`
|
|
448
|
+
display: flex;
|
|
449
|
+
align-items: flex-end;
|
|
450
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
451
|
+
flex-wrap: wrap;
|
|
452
|
+
`,wa=j.h1`
|
|
453
|
+
font-size: 20px;
|
|
454
|
+
font-weight: 600;
|
|
455
|
+
font-stretch: 88%;
|
|
456
|
+
letter-spacing: -0.01em;
|
|
457
|
+
`,Ta=j.p`
|
|
458
|
+
font-size: 13px;
|
|
459
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
460
|
+
max-width: 68ch;
|
|
461
|
+
`,Ea=j.div`
|
|
462
|
+
display: flex;
|
|
463
|
+
flex-direction: column;
|
|
464
|
+
gap: 6px;
|
|
465
|
+
min-width: 0;
|
|
466
|
+
`;function Da({legend:e,title:t,summary:n,actions:r}){return A(Ca,{children:[A(Ea,{children:[k(b,{children:e}),k(wa,{children:t}),k(Ta,{children:n})]}),k(v,{}),r]})}export{fe as _,an as a,M as b,Ht as c,mt as d,nt as f,de as g,Be as h,Qi as i,I as l,We as m,Sa as n,B as o,$e as p,ea as r,z as s,Da as t,P as u,Fe as v,Ee as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_ as e}from"./Panel-CYQvfI3L.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import r from"styled-components";var i=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 6px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-
|
|
1
|
+
import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t as u,u as d}from"./Lamp-ZlMzNs5N.js";import{C as f,_ as p,b as m,v as h,w as g}from"./Panel-CYQvfI3L.js";import{n as _,r as v,t as y}from"./TokenBreakdown-DDI9uTPW.js";import{n as b,t as x}from"./Chip-BOyBT5TP.js";import{i as S,n as C,r as w,t as T}from"./Table-CVDZ69Zx.js";import{useEffect as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import j from"styled-components";function M(e){let[t,n]=D(Date.now);return E(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function N(e,t,n){if(t.length===0||e.requestedModel.toLowerCase().includes(t)||(e.resolvedModel??``).toLowerCase().includes(t)||(e.errorCode??``).toLowerCase().includes(t))return!0;if(n===void 0)return!1;let r=e.credentialId==null?``:n.accounts.get(e.credentialId)??``,i=e.apiKeyId==null?``:n.keys.get(e.apiKeyId)??e.apiKeyId;return r.toLowerCase().includes(t)||i.toLowerCase().includes(t)}function P(e,t,n,r){let i=n.trim().toLowerCase();return e.filter(e=>(t!==`failed`||c(e))&&N(e,i,r))}function F({log:e}){return k(C,{$align:`right`,$mono:!0,...d(e)?{"aria-label":`processing`}:{title:v(e)},children:d(e)?k(y,{}):k(_,{tokens:e})})}function I({rows:e,now:c,names:f,onOpen:_}){return A(T,{children:[k(`thead`,{children:A(`tr`,{children:[k(w,{}),k(w,{$align:`right`,children:`Time`}),k(w,{children:`Requested`}),k(w,{children:`Routed to`}),f===void 0?null:A(O,{children:[k(w,{children:`Account`}),k(w,{children:`Key`})]}),k(w,{$align:`right`,children:`Try`}),k(w,{$align:`right`,children:`TTFT`}),k(w,{$align:`right`,children:`Total`}),k(w,{$align:`right`,children:`Tokens`}),k(w,{$align:`right`,children:`Cost`}),k(w,{children:`Outcome`})]})}),k(`tbody`,{children:e.map(e=>A(S,{$selectable:!0,onClick:()=>_(e),children:[k(C,{children:k(u,{state:l(e),label:a(e)})}),k(C,{$align:`right`,$mono:!0,title:o(e.at),children:s(e.at)}),k(C,{$mono:!0,children:k(g,{style:{display:`block`,maxWidth:`20ch`},children:e.requestedModel||`—`})}),k(C,{children:e.resolvedProvider===null?k(p,{children:d(e)?`routing…`:`not routed`}):A(m,{$gap:1,children:[k(b,{provider:e.resolvedProvider}),k(h,{$dim:!0,children:e.resolvedModel??`—`})]})}),f===void 0?null:A(O,{children:[k(C,{children:k(g,{style:{display:`block`,maxWidth:`18ch`},children:e.credentialId==null?`—`:f.accounts.get(e.credentialId)??i(e.credentialId)})}),k(C,{children:k(g,{style:{display:`block`,maxWidth:`16ch`},title:e.apiKeyId??void 0,children:e.apiKeyId==null?`—`:f.keys.get(e.apiKeyId)??i(e.apiKeyId)})})]}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:e.attempts}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:r(e.ttftMs)}),k(C,{$align:`right`,$mono:!0,children:d(e)?n(Math.max(0,c-e.at)):r(e.durationMs)}),k(F,{log:e}),k(C,{$align:`right`,$mono:!0,children:d(e)?`—`:t(e.costUsd)}),k(C,{children:d(e)?k(x,{$tone:`accent`,children:`live`}):e.errorCode===null?k(x,{$tone:`ok`,children:e.status}):k(x,{$tone:`down`,children:e.errorCode})})]},e.id))})]})}var L=j.dl`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
|
|
4
4
|
gap: 6px ${({theme:e})=>e.space(3)};
|
|
@@ -8,4 +8,4 @@ import{A as e,I as t,M as n,N as r,R as i,f as a,j as o,k as s,l as c,p as l,t a
|
|
|
8
8
|
margin: 0;
|
|
9
9
|
font-family: ${({theme:e})=>e.font.mono};
|
|
10
10
|
word-break: break-all;
|
|
11
|
-
`;function z({log:n,names:i,children:a}){return A(
|
|
11
|
+
`;function z({log:n,names:i,children:a}){return A(f,{$gap:3,children:[A(L,{children:[k(p,{as:`dt`,children:`Request id`}),k(R,{children:n.id}),k(p,{as:`dt`,children:`At`}),k(R,{children:o(n.at)}),k(p,{as:`dt`,children:`Requested model`}),k(R,{children:n.requestedModel||`—`}),k(p,{as:`dt`,children:`Routed to`}),k(R,{children:d(n)?`—`:n.resolvedProvider===null?`not routed`:`${n.resolvedProvider} · ${n.resolvedModel??`—`}`}),i===void 0?null:A(O,{children:[k(p,{as:`dt`,children:`Account`}),k(R,{children:n.credentialId==null?`—`:i.accounts.get(n.credentialId)??n.credentialId}),k(p,{as:`dt`,children:`Key`}),k(R,{children:n.apiKeyId==null?`—`:i.keys.get(n.apiKeyId)??n.apiKeyId})]}),k(p,{as:`dt`,children:`Attempts`}),k(R,{children:d(n)?`—`:n.attempts}),k(p,{as:`dt`,children:`Status`}),k(R,{children:d(n)?`in flight`:n.errorCode===null?n.status:`${n.status} ${n.errorCode}`}),k(p,{as:`dt`,children:`Timing`}),k(R,{children:d(n)?`—`:`first token ${r(n.ttftMs)} · total ${r(n.durationMs)}`}),k(p,{as:`dt`,children:`Tokens`}),k(R,{children:d(n)?`—`:A(O,{children:[e(n.inputTokens),` in · `,e(n.outputTokens),` out ·`,` `,e(n.cacheReadTokens),` cache read · `,e(n.cacheWriteTokens),` `,`cache write`]})}),k(p,{as:`dt`,children:`Cost`}),k(R,{children:d(n)?`—`:t(n.costUsd)}),k(p,{as:`dt`,children:`RTK compression`}),k(R,{children:d(n)?`—`:n.rtkApplied?n.rtkFilterHits===void 0?`~${e(n.rtkEstimatedTokensSaved)} tokens saved`:`${e(n.rtkFilterHits)} hits · ${e(n.rtkOriginalCodeUnits??0)} → ${e(n.rtkCompressedCodeUnits??0)} code units · ~${e(n.rtkEstimatedTokensSaved)} tokens saved`:`not applied`}),n.rtkFilters===void 0?null:A(O,{children:[k(p,{as:`dt`,children:`RTK filters`}),k(R,{children:n.rtkFilters.length===0?`—`:n.rtkFilters.join(`, `)})]})]}),n.degradations.length===0?null:A(f,{$gap:1,children:[k(p,{children:`Capabilities dropped to fit the target`}),k(m,{$gap:1,$wrap:!0,children:n.degradations.map(e=>k(x,{$tone:`warn`,children:e},e))})]}),a]})}export{M as i,I as n,P as r,z as t};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{b as e,p as t,y as n}from"./shared-
|
|
1
|
+
import{b as e,p as t,y as n}from"./shared-OJcoRCqT.js";import{A as r,I as i,N as a,P as o}from"./Lamp-ZlMzNs5N.js";import{D as s,a as c,b as l,i as u,r as d,t as f}from"./Panel-CYQvfI3L.js";import{f as p}from"./Rack-D798XvPQ.js";import{t as m}from"./Readout-D6-aurU8.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";function v({legend:e,meta:t,actions:n,footer:r,query:i,failure:a,empty:o,isEmpty:s,children:l}){return h(f,{legend:e,...t===void 0?{}:{meta:t},...n===void 0?{}:{actions:n},...r===void 0?{}:{footer:r},children:i.isError?h(u,{...a===void 0?{}:{legend:a},error:i.error,onRetry:i.refetch}):i.isLoading?h(c,{rows:4}):s?h(d,{legend:o.legend,message:o.message}):l})}var y=_(s)`
|
|
2
2
|
border-color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.ruleStrong};
|
|
3
3
|
color: ${({theme:e,$on:t})=>t?e.color.accent:e.color.inkDim};
|
|
4
4
|
background: ${({theme:e,$on:t})=>t?e.color.accentWash:e.color.panelRaised};
|
|
5
|
-
`,b=_(
|
|
5
|
+
`,b=_(l)`
|
|
6
6
|
gap: ${({theme:e})=>e.space(1)};
|
|
7
7
|
flex-wrap: wrap;
|
|
8
8
|
`,x=_.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-
|
|
1
|
+
import{a as e,c as t,l as n,o as r,s as i,u as a}from"./Rack-D798XvPQ.js";import*as o from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import u from"styled-components";var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let[t,n]=o.useState(void 0);return r(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}f(p,`useSize`);var m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Switch`,[_,v]=t(g),[y,b]=_(g);function x(t){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:a,disabled:s,form:l,name:u,onCheckedChange:d,required:f,value:p=`on`,internal_do_not_use_render:m}=t,[h,_]=e({prop:r,defaultProp:a??!1,onChange:d,caller:g}),[v,b]=o.useState(null),[x,S]=o.useState(null),C=o.useRef(!1),[w,T]=o.useReducer(e=>e+1,0),E={checked:h,setChecked:_,disabled:s,control:v,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:a,isFormControl:!v||!!l||!!v.closest(`form`),bubbleInput:x,setBubbleInput:S};return c(y,{scope:n,...E,children:k(m)?m(E):i})}h(x,`SwitchProvider`);var S=`SwitchTrigger`,C=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,form:u,value:d,disabled:f,checked:p,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=a(s,g),T=o.useRef(p);return o.useEffect(()=>{let e=u?l?.ownerDocument.getElementById(u):l?.form;if(e instanceof HTMLFormElement){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[l,u,_]),c(n.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":A(p),"data-disabled":f?``:void 0,disabled:f,value:d,...r,ref:w,onClick:i(t,e=>{y(),_(e=>!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`SwitchTrigger`)),w=o.forwardRef(h(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:u,value:d,onCheckedChange:f,form:p,...m}=e;return c(x,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:u,required:o,onCheckedChange:f,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:e})=>l(s,{children:[c(C,{...m,ref:t,__scopeSwitch:n}),e&&c(O,{__scopeSwitch:n})]})})},`Switch`)),T=`SwitchThumb`,E=o.forwardRef(h(function(e,t){let{__scopeSwitch:r,...i}=e,a=b(T,r);return c(n.span,{"data-state":A(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})},`SwitchThumb`)),D=`SwitchBubbleInput`,O=o.forwardRef(h(function({__scopeSwitch:e,onClick:t,...r},s){let{control:l,hasConsumerStoppedPropagationRef:u,userInteractionCount:d,checked:f,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=a(s,S),w=p(l),T=o.useRef(!1),E=o.useRef(f),O=o.useRef(d);o.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=d!==O.current;O.current=d;let i=E.current!==f;E.current=f;let a=!(r&&u.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,f),e.dispatchEvent(t),T.current=!1}},[x,f,u,d]);let k=o.useRef(f);return c(n.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...r,tabIndex:-1,ref:C,onClick:i(t,e=>{T.current&&e.stopPropagation()}),style:{...r.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e?`checked`:`unchecked`}h(A,`getState`);var j=u(w)`
|
|
2
2
|
all: unset;
|
|
3
3
|
width: 30px;
|
|
4
4
|
height: 16px;
|