omnigateway 0.1.6 → 0.1.7
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 +24 -5
- package/bin/omni.js +454 -228
- package/gateway.js +225 -59
- package/package.json +1 -1
- package/public/assets/{Chip-Ccqsb_Mq.js → Chip-C69u2U_b.js} +2 -2
- package/public/assets/{CopyValue-cAwgC1sU.js → CopyValue-CJy2T0H6.js} +1 -1
- package/public/assets/{Field-Devm4K46.js → Field-Sc8mDqJv.js} +1 -1
- package/public/assets/{Lamp-BXSUIAtG.js → Lamp-7jD_9929.js} +2 -2
- package/public/assets/{Meter-Fn8X7t60.js → Meter-C0nUftAa.js} +2 -2
- package/public/assets/{Modal-Dqir9wBz.js → Modal-CiVHSJmm.js} +2 -2
- package/public/assets/Rack-CMqGBP4I.js +147 -0
- package/public/assets/{Readout-BKpOZIGX.js → Readout-Dv2dZWtI.js} +4 -4
- package/public/assets/{States-DBzsiHjQ.js → States-D55MhqMx.js} +10 -10
- package/public/assets/{Table-DPDJeeVc.js → Table-DBB3jdgi.js} +1 -1
- package/public/assets/{Toggle-BhViDMm9.js → Toggle-BoGjb5oi.js} +3 -3
- package/public/assets/_app-p5Mz7sXD.js +1 -0
- package/public/assets/_app.accounts-B5wMO9TH.js +51 -0
- package/public/assets/_app.console-Bka7AkiL.js +25 -0
- package/public/assets/_app.index-MnQuadXb.js +61 -0
- package/public/assets/_app.keys-BX8k8COP.js +39 -0
- package/public/assets/_app.logs-DD-sd4fn.js +33 -0
- package/public/assets/_app.models-CezFNL6y.js +144 -0
- package/public/assets/{_app.settings-DA1aYcR4.js → _app.settings-D1taAt8B.js} +3 -3
- package/public/assets/{_app.usage-DAyYUfIi.js → _app.usage-BRhEvwVr.js} +28 -28
- package/public/assets/index-vCuK1fRQ.js +170 -0
- package/public/assets/{login-DXHM-Noj.js → login-DaC-wVpI.js} +8 -8
- package/public/assets/{queries-BMwc6EvM.js → queries-2E6-CboE.js} +12 -12
- package/public/assets/{trash-2-JF_uX2gE.js → trash-2--aH2iKg-.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/Rack-XtfiZ6GC.js +0 -147
- package/public/assets/_app-B8lqq_ks.js +0 -1
- package/public/assets/_app.accounts-DSMHSYBF.js +0 -51
- package/public/assets/_app.index-DXH5sH41.js +0 -61
- package/public/assets/_app.keys-DdEyVy_b.js +0 -39
- package/public/assets/_app.logs-Camxditb.js +0 -33
- package/public/assets/_app.models-CuD-JtGS.js +0 -144
- package/public/assets/index-BtjyVE1i.js +0 -170
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as e,M as t,O as n,Ot as r,V as i,W as a,kt as o,qt as s}from"./queries-BMwc6EvM.js";import{m as c}from"./Rack-XtfiZ6GC.js";var l=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),u=s(o(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(p,`setRef`);function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(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():p(e[t],null)}}}}f(m,`composeRefs`);function h(...e){return u.useCallback(m(...e),e)}f(h,`useComposedRefs`);var g=r(),_=s(a(),1),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0});function b(e){let t=u.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];E(r)&&typeof ie==`function`&&(r=ie(r._payload)),u.Children.forEach(r,e=>{if(ee(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;E(n)&&typeof ie==`function`&&(n=ie(n._payload)),a=C(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=u.cloneElement(a,void 0,s):!o&&u.Children.count(r)===1&&u.isValidElement(r)&&(a=r);let c=a?T(a):void 0,l=h(n,c);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=w(i,a.props??{});return a.type!==u.Fragment&&(d.ref=n?l:c),u.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}y(b,`createSlot`);var x=Symbol.for(`radix.slottable`);function S(e){let t=y(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=x,t}y(S,`createSlottable`);var C=y((e,t)=>{if(`child`in e.props){let t=e.props.child;return u.isValidElement(t)?u.cloneElement(t,void 0,e.props.children(t.props.children)):null}return u.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function w(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}}y(w,`mergeProps`);function T(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)}y(T,`getElementRef`);function ee(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===x}y(ee,`isSlottable`);var te=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===te&&`_payload`in e&&D(e._payload)}y(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}y(D,`isPromiseLike`);var ne=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),re=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ie=u.use,ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),O=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function se(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}oe(se,`dispatchDiscreteCustomEvent`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0});function le(e,t){let n=u.createContext(t);n.displayName=e+`Context`;let r=k(e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=u.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return k(i,`useContext`),[r,i]}k(le,`createContext`);function ue(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=k(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,g.jsx)(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,d=u.useContext(l);if(d)return d;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return k(s,`useContext`),[o,s]}k(r,`createContext`);let i=k(()=>{let t=n.map(e=>u.createContext(e));return k(function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,de(i,...t)]}k(ue,`createContextScope`);function de(...e){let t=e[0];if(e.length===1)return t;let n=k(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return k(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}k(de,`composeContextScopes`);var fe=Object.defineProperty,A=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),pe=!!(typeof window<`u`&&window.document&&window.document.createElement);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return A(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}A(j,`composeEventHandlers`);function me(e){if(!pe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}A(me,`getOwnerWindow`);function he(e){if(!pe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}A(he,`getOwnerDocument`);function ge(e,t=!1){let{activeElement:n}=he(e);if(!n?.nodeName)return null;if(_e(n)&&n.contentDocument)return ge(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=he(n).getElementById(e);if(t)return t}}return n}A(ge,`getActiveElement`);function _e(e){return e.tagName===`IFRAME`}A(_e,`isFrame`);var M=globalThis?.document?u.useLayoutEffect:()=>{},ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=u.useEffectEvent,xe=u.useInsertionEffect;function Se(e){if(typeof be==`function`)return be(e);let t=u.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof xe==`function`?xe(()=>{t.current=e}):M(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}ye(Se,`useEffectEvent`);var Ce=Object.defineProperty,N=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),we=u.useInsertionEffect||M;function Te({prop:e,defaultProp:t,onChange:n=N(()=>{},`onChange`),caller:r}){let[i,a,o]=Ee({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,u.useCallback(t=>{if(s){let n=De(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}N(Te,`useControllableState`);function Ee({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return we(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}N(Ee,`useUncontrolledState`);function De(e){return typeof e==`function`}N(De,`isFunction`);var Oe=Symbol(`RADIX:SYNC_STATE`);function ke(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Se(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=u.useReducer((t,n)=>{if(n.type===Oe)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...d),m=f.state,h=u.useRef(m);u.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=u.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return u.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Oe,state:i})},[i,f.state,c]),[g,p]}N(ke,`useControllableStateReducer`);var Ae=Object.defineProperty,P=(e,t)=>Ae(e,`name`,{value:t,configurable:!0});function je(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}P(je,`useStateMachine`);var Me=P(e=>{let{present:t,children:n}=e,r=Ne(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=Fe(r.ref,Ie(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function Ne(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),o=u.useRef(void 0),[s,c]=je(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{s===`mounted`?(a.current=o.current??F(r.current),o.current=void 0):a.current=`none`},[s]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=F(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]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=P(a=>{let o=F(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=P(e=>{e.target===t&&(a.current=F(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:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=F(t)}else r.current=null;n(e)},[])}}P(Ne,`usePresence`);function Pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}P(Pe,`setRef`);function Fe(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Pe(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():Pe(n[e],null)}}},[])}P(Fe,`useStableComposedRefs`);function F(e){return e?.animationName||`none`}P(F,`getAnimationName`);function Ie(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)}P(Ie,`getElementRef`);var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=u.useId||(()=>void 0),Be=0;function I(e){let[t,n]=u.useState(ze());return M(()=>{e||n(e=>e??String(Be++))},[e]),e||(t?`radix-${t}`:``)}Re(I,`useId`);var Ve=Object.defineProperty,He=(e,t)=>Ve(e,`name`,{value:t,configurable:!0});function L(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}He(L,`useCallbackRef`);var Ue=Object.defineProperty,R=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),We=`dismissableLayer.update`,Ge=`dismissableLayer.pointerDownOutside`,Ke=`dismissableLayer.focusOutside`,qe,Je=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ye=u.forwardRef(R(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,d=u.useContext(Je),[f,p]=u.useState(null),m=f?.ownerDocument??globalThis?.document,[,_]=u.useState({}),v=h(t,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=u.useRef(!1),ee=Qe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),te=$e(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?S===y.length-1:!1,D=L(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return u.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),et(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=qe))}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),et())},[f,d]),u.useEffect(()=>{let e=R(()=>_({}),`handleUpdate`);return document.addEventListener(We,e),()=>document.removeEventListener(We,e)},[]),(0,g.jsx)(O.div,{...l,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,te.onFocusCapture),onBlurCapture:j(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Xe(){let e=u.useContext(Je),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(Xe,`useDismissableLayerSurface`);var Ze=R(()=>!0,`IS_TRUE`);function Qe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ze}=t,s=L(e),c=u.useRef(!1),l=u.useRef(!1),d=u.useRef(new Map),f=u.useRef(()=>{});return u.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}R(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}R(t,`isOutsideInteractionIntercepted`);function u(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}R(u,`handleInteractionCapture`);function p(e){l.current&&d.current.set(e.type,!1)}R(p,`handleInteractionBubble`);let m=R(a=>{if(a.target&&!c.current){let u=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||tt(Ge,s,p,{discrete:!0})};if(R(u,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?u():(n.removeEventListener(`click`,f.current),f.current=u,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,u,!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`,f.current);for(let e of h)n.removeEventListener(e,u,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:R(()=>c.current=!0,`onPointerDownCapture`)}}R(Qe,`usePointerDownOutside`);function $e(e,t=globalThis?.document){let n=L(e),r=u.useRef(!1);return u.useEffect(()=>{let e=R(e=>{e.target&&!r.current&&tt(Ke,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:R(()=>r.current=!0,`onFocusCapture`),onBlurCapture:R(()=>r.current=!1,`onBlurCapture`)}}R($e,`useFocusOutside`);function et(){let e=new CustomEvent(We);document.dispatchEvent(e)}R(et,`dispatchUpdate`);function tt(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?se(i,a):i.dispatchEvent(a)}R(tt,`handleAndDispatchCustomEvent`);var nt=Object.defineProperty,z=(e,t)=>nt(e,`name`,{value:t,configurable:!0}),rt=`focusScope.autoFocusOnMount`,it=`focusScope.autoFocusOnUnmount`,at={bubbles:!1,cancelable:!0},ot=u.forwardRef(z(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=L(i),d=L(a),f=u.useRef(null),p=h(t,c),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:B(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||B(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(s)};z(e,`handleFocusIn`),z(t,`handleFocusOut`),z(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,m.paused]),u.useEffect(()=>{if(s){pt.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rt,at);s.addEventListener(rt,l),s.dispatchEvent(t),t.defaultPrevented||(st(gt(lt(s)),{select:!0}),document.activeElement===e&&B(s))}return()=>{s.removeEventListener(rt,l),setTimeout(()=>{let t=new CustomEvent(it,at);s.addEventListener(it,d),s.dispatchEvent(t),t.defaultPrevented||B(e??document.body,{select:!0}),s.removeEventListener(it,d),pt.remove(m)},0)}}},[s,l,d,m]);let _=u.useCallback(e=>{if(!n&&!r||m.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]=ct(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&B(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&B(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,g.jsx)(O.div,{tabIndex:-1,...o,ref:p,onKeyDown:_})},`FocusScope`));function st(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(B(r,{select:t}),document.activeElement!==n)return}z(st,`focusFirst`);function ct(e){let t=lt(e);return[ut(t,e),ut(t.reverse(),e)]}z(ct,`getTabbableEdges`);function lt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:z(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}z(lt,`getTabbableCandidates`);function ut(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dt(r,{upTo:t})))return r}z(ut,`findVisible`);function dt(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}z(dt,`isHidden`);function ft(e){return e instanceof HTMLInputElement&&`select`in e}z(ft,`isSelectableInput`);function B(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ft(e)&&t&&e.select()}}z(B,`focus`);var pt=mt();function mt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ht(e,t),e.unshift(t)},remove(t){e=ht(e,t),e[0]?.resume()}}}z(mt,`createFocusScopesStack`);function ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}z(ht,`arrayRemove`);function gt(e){return e.filter(e=>e.tagName!==`A`)}z(gt,`removeLinks`);var _t=Object.defineProperty,vt=u.forwardRef(((e,t)=>_t(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=u.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_.createPortal((0,g.jsx)(O.div,{...r,ref:t}),o):null},`Portal`)),yt=Object.defineProperty,bt=(e,t)=>yt(e,`name`,{value:t,configurable:!0}),V=0,H=null;function xt(e){return St(),e.children}bt(xt,`FocusGuards`);function St(){u.useEffect(()=>{H||={start:Ct(),end:Ct()};let{start:e,end:t}=H;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),V++,()=>{V===1&&(H?.start.remove(),H?.end.remove(),H=null),V=Math.max(0,V-1)}},[])}bt(St,`useFocusGuards`);function Ct(){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}bt(Ct,`createFocusGuard`);var U=function(){return U=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},U.apply(this,arguments)};function wt(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 Tt(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 W=`right-scroll-bar-position`,G=`width-before-scroll-bar`,Et=`with-scroll-bars-hidden`,Dt=`--removed-body-scroll-bar-size`;function Ot(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kt(e,t){var n=(0,u.useState)(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 At=typeof window<`u`?u.useLayoutEffect:u.useEffect,jt=new WeakMap;function Mt(e,t){var n=kt(t||null,function(t){return e.forEach(function(e){return Ot(e,t)})});return At(function(){var t=jt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ot(e,null)}),i.forEach(function(e){r.has(e)||Ot(e,a)})}jt.set(n,e)},[e]),n}function Nt(e){return e}function Pt(e,t){t===void 0&&(t=Nt);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 Ft(e){e===void 0&&(e={});var t=Pt(null);return t.options=U({async:!0,ssr:!1},e),t}var It=function(e){var t=e.sideCar,n=wt(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 u.createElement(r,U({},n))};It.isSideCarExport=!0;function Lt(e,t){return e.useMedium(t),It}var Rt=Ft(),zt=function(){},K=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:zt,onWheelCapture:zt,onTouchMoveCapture:zt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=wt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Mt([n,t]),w=U(U({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:Rt,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),U(U({},w),{ref:C})):u.createElement(y,U({},w,{className:c,ref:C}),s))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},K.classNames={fullWidth:G,zeroRight:W};var Bt,Vt=function(){if(Bt)return Bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ht(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vt();return t&&e.setAttribute(`nonce`,t),e}function Ut(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ht())&&(Ut(t,n),Wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kt=function(){var e=Gt();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qt=function(){var e=Kt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jt={left:0,top:0,right:0,gap:0},Yt=function(e){return parseInt(e||``,10)||0},Xt=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[Yt(n),Yt(r),Yt(i)]},Zt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jt;var t=Xt(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])}},Qt=qt(),q=`data-scroll-locked`,$t=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{A as e,B as t,F as n,Mt as r,W as i,Xt as a,jt as o,q as s}from"./queries-2E6-CboE.js";import{m as c}from"./Rack-CMqGBP4I.js";var l=c(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),u=a(r(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}f(p,`setRef`);function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(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():p(e[t],null)}}}}f(m,`composeRefs`);function h(...e){return u.useCallback(m(...e),e)}f(h,`useComposedRefs`);var g=o(),_=a(s(),1),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0});function b(e){let t=u.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];E(r)&&typeof ie==`function`&&(r=ie(r._payload)),u.Children.forEach(r,e=>{if(ee(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;E(n)&&typeof ie==`function`&&(n=ie(n._payload)),a=C(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=u.cloneElement(a,void 0,s):!o&&u.Children.count(r)===1&&u.isValidElement(r)&&(a=r);let c=a?T(a):void 0,l=h(n,c);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=w(i,a.props??{});return a.type!==u.Fragment&&(d.ref=n?l:c),u.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}y(b,`createSlot`);var x=Symbol.for(`radix.slottable`);function S(e){let t=y(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=x,t}y(S,`createSlottable`);var C=y((e,t)=>{if(`child`in e.props){let t=e.props.child;return u.isValidElement(t)?u.cloneElement(t,void 0,e.props.children(t.props.children)):null}return u.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function w(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}}y(w,`mergeProps`);function T(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)}y(T,`getElementRef`);function ee(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===x}y(ee,`isSlottable`);var te=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===te&&`_payload`in e&&D(e._payload)}y(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}y(D,`isPromiseLike`);var ne=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),re=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ie=u.use,ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),O=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function se(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}oe(se,`dispatchDiscreteCustomEvent`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0});function le(e,t){let n=u.createContext(t);n.displayName=e+`Context`;let r=k(e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=u.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return k(i,`useContext`),[r,i]}k(le,`createContext`);function ue(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=k(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,g.jsx)(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,d=u.useContext(l);if(d)return d;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return k(s,`useContext`),[o,s]}k(r,`createContext`);let i=k(()=>{let t=n.map(e=>u.createContext(e));return k(function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,de(i,...t)]}k(ue,`createContextScope`);function de(...e){let t=e[0];if(e.length===1)return t;let n=k(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return k(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}k(de,`composeContextScopes`);var fe=Object.defineProperty,A=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),pe=!!(typeof window<`u`&&window.document&&window.document.createElement);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return A(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}A(j,`composeEventHandlers`);function me(e){if(!pe)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}A(me,`getOwnerWindow`);function he(e){if(!pe)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}A(he,`getOwnerDocument`);function ge(e,t=!1){let{activeElement:n}=he(e);if(!n?.nodeName)return null;if(_e(n)&&n.contentDocument)return ge(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=he(n).getElementById(e);if(t)return t}}return n}A(ge,`getActiveElement`);function _e(e){return e.tagName===`IFRAME`}A(_e,`isFrame`);var M=globalThis?.document?u.useLayoutEffect:()=>{},ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=u.useEffectEvent,xe=u.useInsertionEffect;function Se(e){if(typeof be==`function`)return be(e);let t=u.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof xe==`function`?xe(()=>{t.current=e}):M(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}ye(Se,`useEffectEvent`);var Ce=Object.defineProperty,N=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),we=u.useInsertionEffect||M;function Te({prop:e,defaultProp:t,onChange:n=N(()=>{},`onChange`),caller:r}){let[i,a,o]=Ee({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,u.useCallback(t=>{if(s){let n=De(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}N(Te,`useControllableState`);function Ee({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return we(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}N(Ee,`useUncontrolledState`);function De(e){return typeof e==`function`}N(De,`isFunction`);var Oe=Symbol(`RADIX:SYNC_STATE`);function ke(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Se(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=u.useReducer((t,n)=>{if(n.type===Oe)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...d),m=f.state,h=u.useRef(m);u.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=u.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return u.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Oe,state:i})},[i,f.state,c]),[g,p]}N(ke,`useControllableStateReducer`);var Ae=Object.defineProperty,P=(e,t)=>Ae(e,`name`,{value:t,configurable:!0});function je(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}P(je,`useStateMachine`);var Me=P(e=>{let{present:t,children:n}=e,r=Ne(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=Fe(r.ref,Ie(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null},`Presence`);function Ne(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),o=u.useRef(void 0),[s,c]=je(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{s===`mounted`?(a.current=o.current??F(r.current),o.current=void 0):a.current=`none`},[s]),M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=F(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]),M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=P(a=>{let o=F(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=P(e=>{e.target===t&&(a.current=F(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:u.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=F(t)}else r.current=null;n(e)},[])}}P(Ne,`usePresence`);function Pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}P(Pe,`setRef`);function Fe(...e){let t=u.useRef(e);return t.current=e,u.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Pe(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():Pe(n[e],null)}}},[])}P(Fe,`useStableComposedRefs`);function F(e){return e?.animationName||`none`}P(F,`getAnimationName`);function Ie(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)}P(Ie,`getElementRef`);var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=u.useId||(()=>void 0),Be=0;function I(e){let[t,n]=u.useState(ze());return M(()=>{e||n(e=>e??String(Be++))},[e]),e||(t?`radix-${t}`:``)}Re(I,`useId`);var Ve=Object.defineProperty,He=(e,t)=>Ve(e,`name`,{value:t,configurable:!0});function L(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>((...e)=>t.current?.(...e)),[])}He(L,`useCallbackRef`);var Ue=Object.defineProperty,R=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),We=`dismissableLayer.update`,Ge=`dismissableLayer.pointerDownOutside`,Ke=`dismissableLayer.focusOutside`,qe,Je=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ye=u.forwardRef(R(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,d=u.useContext(Je),[f,p]=u.useState(null),m=f?.ownerDocument??globalThis?.document,[,_]=u.useState({}),v=h(t,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=u.useRef(!1),ee=Qe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),te=$e(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?S===y.length-1:!1,D=L(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return u.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),et(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=qe))}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),et())},[f,d]),u.useEffect(()=>{let e=R(()=>_({}),`handleUpdate`);return document.addEventListener(We,e),()=>document.removeEventListener(We,e)},[]),(0,g.jsx)(O.div,{...l,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,te.onFocusCapture),onBlurCapture:j(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Xe(){let e=u.useContext(Je),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(Xe,`useDismissableLayerSurface`);var Ze=R(()=>!0,`IS_TRUE`);function Qe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ze}=t,s=L(e),c=u.useRef(!1),l=u.useRef(!1),d=u.useRef(new Map),f=u.useRef(()=>{});return u.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}R(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}R(t,`isOutsideInteractionIntercepted`);function u(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}R(u,`handleInteractionCapture`);function p(e){l.current&&d.current.set(e.type,!1)}R(p,`handleInteractionBubble`);let m=R(a=>{if(a.target&&!c.current){let u=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||tt(Ge,s,p,{discrete:!0})};if(R(u,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?u():(n.removeEventListener(`click`,f.current),f.current=u,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,u,!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`,f.current);for(let e of h)n.removeEventListener(e,u,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:R(()=>c.current=!0,`onPointerDownCapture`)}}R(Qe,`usePointerDownOutside`);function $e(e,t=globalThis?.document){let n=L(e),r=u.useRef(!1);return u.useEffect(()=>{let e=R(e=>{e.target&&!r.current&&tt(Ke,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:R(()=>r.current=!0,`onFocusCapture`),onBlurCapture:R(()=>r.current=!1,`onBlurCapture`)}}R($e,`useFocusOutside`);function et(){let e=new CustomEvent(We);document.dispatchEvent(e)}R(et,`dispatchUpdate`);function tt(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?se(i,a):i.dispatchEvent(a)}R(tt,`handleAndDispatchCustomEvent`);var nt=Object.defineProperty,z=(e,t)=>nt(e,`name`,{value:t,configurable:!0}),rt=`focusScope.autoFocusOnMount`,it=`focusScope.autoFocusOnUnmount`,at={bubbles:!1,cancelable:!0},ot=u.forwardRef(z(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=L(i),d=L(a),f=u.useRef(null),p=h(t,c),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:B(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||B(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&B(s)};z(e,`handleFocusIn`),z(t,`handleFocusOut`),z(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,m.paused]),u.useEffect(()=>{if(s){pt.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rt,at);s.addEventListener(rt,l),s.dispatchEvent(t),t.defaultPrevented||(st(gt(lt(s)),{select:!0}),document.activeElement===e&&B(s))}return()=>{s.removeEventListener(rt,l),setTimeout(()=>{let t=new CustomEvent(it,at);s.addEventListener(it,d),s.dispatchEvent(t),t.defaultPrevented||B(e??document.body,{select:!0}),s.removeEventListener(it,d),pt.remove(m)},0)}}},[s,l,d,m]);let _=u.useCallback(e=>{if(!n&&!r||m.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]=ct(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&B(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&B(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,g.jsx)(O.div,{tabIndex:-1,...o,ref:p,onKeyDown:_})},`FocusScope`));function st(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(B(r,{select:t}),document.activeElement!==n)return}z(st,`focusFirst`);function ct(e){let t=lt(e);return[ut(t,e),ut(t.reverse(),e)]}z(ct,`getTabbableEdges`);function lt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:z(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}z(lt,`getTabbableCandidates`);function ut(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):dt(r,{upTo:t})))return r}z(ut,`findVisible`);function dt(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}z(dt,`isHidden`);function ft(e){return e instanceof HTMLInputElement&&`select`in e}z(ft,`isSelectableInput`);function B(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ft(e)&&t&&e.select()}}z(B,`focus`);var pt=mt();function mt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ht(e,t),e.unshift(t)},remove(t){e=ht(e,t),e[0]?.resume()}}}z(mt,`createFocusScopesStack`);function ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}z(ht,`arrayRemove`);function gt(e){return e.filter(e=>e.tagName!==`A`)}z(gt,`removeLinks`);var _t=Object.defineProperty,vt=u.forwardRef(((e,t)=>_t(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=u.useState(!1);M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?_.createPortal((0,g.jsx)(O.div,{...r,ref:t}),o):null},`Portal`)),yt=Object.defineProperty,bt=(e,t)=>yt(e,`name`,{value:t,configurable:!0}),V=0,H=null;function xt(e){return St(),e.children}bt(xt,`FocusGuards`);function St(){u.useEffect(()=>{H||={start:Ct(),end:Ct()};let{start:e,end:t}=H;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),V++,()=>{V===1&&(H?.start.remove(),H?.end.remove(),H=null),V=Math.max(0,V-1)}},[])}bt(St,`useFocusGuards`);function Ct(){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}bt(Ct,`createFocusGuard`);var U=function(){return U=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},U.apply(this,arguments)};function wt(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 Tt(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 W=`right-scroll-bar-position`,G=`width-before-scroll-bar`,Et=`with-scroll-bars-hidden`,Dt=`--removed-body-scroll-bar-size`;function Ot(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kt(e,t){var n=(0,u.useState)(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 At=typeof window<`u`?u.useLayoutEffect:u.useEffect,jt=new WeakMap;function Mt(e,t){var n=kt(t||null,function(t){return e.forEach(function(e){return Ot(e,t)})});return At(function(){var t=jt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ot(e,null)}),i.forEach(function(e){r.has(e)||Ot(e,a)})}jt.set(n,e)},[e]),n}function Nt(e){return e}function Pt(e,t){t===void 0&&(t=Nt);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 Ft(e){e===void 0&&(e={});var t=Pt(null);return t.options=U({async:!0,ssr:!1},e),t}var It=function(e){var t=e.sideCar,n=wt(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 u.createElement(r,U({},n))};It.isSideCarExport=!0;function Lt(e,t){return e.useMedium(t),It}var Rt=Ft(),zt=function(){},K=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:zt,onWheelCapture:zt,onTouchMoveCapture:zt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=wt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Mt([n,t]),w=U(U({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:Rt,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),U(U({},w),{ref:C})):u.createElement(y,U({},w,{className:c,ref:C}),s))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},K.classNames={fullWidth:G,zeroRight:W};var Bt,Vt=function(){if(Bt)return Bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ht(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vt();return t&&e.setAttribute(`nonce`,t),e}function Ut(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ht())&&(Ut(t,n),Wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kt=function(){var e=Gt();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qt=function(){var e=Kt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jt={left:0,top:0,right:0,gap:0},Yt=function(e){return parseInt(e||``,10)||0},Xt=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[Yt(n),Yt(r),Yt(i)]},Zt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jt;var t=Xt(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])}},Qt=qt(),q=`data-scroll-locked`,$t=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${Et} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -79,4 +79,4 @@ import{L as e,M as t,O as n,Ot as r,V as i,W as a,kt as o,qt as s}from"./queries
|
|
|
79
79
|
margin: 0 0 ${({theme:e})=>e.space(3)};
|
|
80
80
|
font-size: 12px;
|
|
81
81
|
color: ${({theme:e})=>e.color.inkDim};
|
|
82
|
-
`;function fr({open:r,onOpenChange:i,title:a,description:o,footer:s,width:c=`560px`,children:u}){return(0,g.jsx)(Bn,{open:r,onOpenChange:i,children:(0,g.jsxs)(Wn,{children:[(0,g.jsx)(or,{}),(0,g.jsxs)(sr,{$width:c,children:[(0,g.jsxs)(cr,{children:[(0,g.jsx)(er,{asChild:!0,children:(0,g.jsx)(
|
|
82
|
+
`;function fr({open:r,onOpenChange:i,title:a,description:o,footer:s,width:c=`560px`,children:u}){return(0,g.jsx)(Bn,{open:r,onOpenChange:i,children:(0,g.jsxs)(Wn,{children:[(0,g.jsx)(or,{}),(0,g.jsxs)(sr,{$width:c,children:[(0,g.jsxs)(cr,{children:[(0,g.jsx)(er,{asChild:!0,children:(0,g.jsx)(e,{as:`h2`,children:a})}),(0,g.jsx)(n,{}),(0,g.jsx)(ir,{asChild:!0,children:(0,g.jsx)(t,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Close`,children:(0,g.jsx)(l,{})})})]}),(0,g.jsxs)(lr,{children:[o===void 0?null:(0,g.jsx)(dr,{children:o}),u]}),s===void 0?null:(0,g.jsx)(ur,{children:s})]})]})})}export{ue as a,j as i,Te as n,O as o,M as r,h as s,fr as t};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import{A as e,B as t,F as n,J as r,K as i,Mt as a,N as o,R as s,W as c,Xt as l,_ as u,g as d,j as f,jt as p,z as m}from"./queries-2E6-CboE.js";import{t as h}from"./index-vCuK1fRQ.js";import{f as g,r as _,t as v}from"./Lamp-7jD_9929.js";var y=l(a(),1),b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),C=e=>{let t=S(e);return t.charAt(0).toUpperCase()+t.slice(1)},w={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`},T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=(0,y.createContext)({}),D=()=>(0,y.useContext)(E),O=(0,y.forwardRef)(({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=``}=D()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,y.createElement)(`svg`,{ref:c,...w,width:t??l??w.width,height:t??l??w.height,stroke:e??f,strokeWidth:m,className:b(`lucide`,p,i),...!a&&!T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),k=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(O,{ref:i,iconNode:t,className:b(`lucide-${x(C(e))}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},A=k(`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`}]]),ee=k(`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=k(`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`}]]),ne=k(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),re=k(`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`}]]),ie=k(`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=k(`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`}]]),oe=k(`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`}]]),se=k(`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`}]]),ce=k(`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`}]]),le=k(`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`}]]),j=k(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),M=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1}),N=new Intl.NumberFormat(`en-US`);function P(e){return Number.isFinite(e)?e<1e4?N.format(Math.round(e)):M.format(e).toLowerCase():`—`}function F(e){return Number.isFinite(e)?e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<100?`$${e.toFixed(2)}`:`$${M.format(e).toLowerCase()}`:`—`}function I(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/6e4)}m`}function L(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:`—`}var R=[[6e4,1e3,`s`],[36e5,6e4,`m`],[864e5,36e5,`h`],[1/0,864e5,`d`]];function z(e){let t=Math.abs(e);if(t<1e3)return`0s`;let n=R.find(([e])=>t<e);return n===void 0?`—`:`${Math.floor(t/n[1])}${n[2]}`}function B(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=e-t;return Math.abs(n)<5e3?`just now`:n<0?`${z(n)} ago`:`in ${z(n)}`}function V(e){return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}function H(e){return e==null||!Number.isFinite(e)?`—`:new Date(e).toLocaleString(`en-GB`,{year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function U(e,t=8){return e.length<=t?e:`${e.slice(0,t)}…`}var W=p(),G=(0,y.createContext)(null);function ue({children:e}){let[t,n]=(0,y.useState)(!0),r=(0,y.useCallback)(()=>n(e=>!e),[]),i=(0,y.useMemo)(()=>({live:t,toggle:r,cadence:e=>t?e:!1}),[t,r]);return(0,W.jsx)(G,{value:i,children:e})}function K(){return(0,y.use)(G)??{live:!1,toggle:()=>{},cadence:()=>!1}}var de=c.svg`
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: visible;
|
|
6
|
+
`;function q(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 J({values:e,overlay:t,height:n=28,color:r,overlayColor:i,scaleTo:a,label:o,className:s}){let c=(0,y.useId)(),l=a===void 0?Math.max(1,...e,...t??[]):Math.max(1,a),u=q(e,100,n,l),d=u.length===0?``:`${u} L100,${n} L0,${n} Z`;return(0,W.jsxs)(de,{className:s,viewBox:`0 0 100 ${n}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o,style:{height:n},children:[(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:c,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:r??`var(--accent)`,stopOpacity:`0.28`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:r??`var(--accent)`,stopOpacity:`0`})]})}),d.length===0?null:(0,W.jsx)(`path`,{d,fill:`url(#${c})`}),t===void 0?null:(0,W.jsx)(`path`,{d:q(t,100,n,l),fill:`none`,stroke:i??`var(--down)`,strokeWidth:`1.25`,vectorEffect:`non-scaling-stroke`}),(0,W.jsx)(`path`,{d:u,fill:`none`,stroke:r??`var(--accent)`,strokeWidth:`1.5`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})}var fe=c.header`
|
|
7
|
+
grid-area: chassis;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
11
|
+
height: 48px;
|
|
12
|
+
padding: 0 ${({theme:e})=>e.space(3)};
|
|
13
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
14
|
+
background: ${({theme:e})=>e.color.panel};
|
|
15
|
+
${s}
|
|
16
|
+
position: sticky;
|
|
17
|
+
top: 0;
|
|
18
|
+
z-index: ${({theme:e})=>e.z.chassis};
|
|
19
|
+
`,pe=c.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: baseline;
|
|
22
|
+
gap: 7px;
|
|
23
|
+
font-stretch: 74%;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
letter-spacing: 0.2em;
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
flex: none;
|
|
29
|
+
`,me=c(o)`
|
|
30
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
|
|
33
|
+
@media (max-width: 860px) {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
`,Y=c.div`
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: baseline;
|
|
39
|
+
gap: 6px;
|
|
40
|
+
padding-left: ${({theme:e})=>e.space(3)};
|
|
41
|
+
border-left: 1px solid ${({theme:e})=>e.color.rule};
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
`,he=c(Y)`
|
|
44
|
+
width: 96px;
|
|
45
|
+
align-items: center;
|
|
46
|
+
`,ge=c.div`
|
|
47
|
+
flex: 1;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
`,_e=c(m)`
|
|
50
|
+
gap: 6px;
|
|
51
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
52
|
+
letter-spacing: 0.08em;
|
|
53
|
+
`,X=[`system`,`light`,`dark`],Z={system:`Match system theme`,light:`Light theme`,dark:`Dark theme`},Q=6e5;function ve(){let i=r(),{live:a,toggle:o,cadence:s}=K(),{mode:c,setMode:l}=h(),p=d(),m=u(200,s(1e4)),b=Date.now(),x=(0,y.useMemo)(()=>(m.data??[]).filter(e=>b-e.at<=Q),[m.data,b]),S=g(x,Q),C=_(x,{now:b,spanMs:Q,count:24}),w=X[(X.indexOf(c)+1)%X.length]??`system`,T=c===`light`?le:c===`dark`?oe:ae,E=m.isError||S.errorRate>=.25?`down`:S.errorRate>=.05?`warn`:x.length===0?`idle`:`ok`;return(0,W.jsxs)(fe,{children:[(0,W.jsxs)(pe,{children:[(0,W.jsx)(v,{state:E,label:m.isError?`gateway unreachable`:`error rate ${L(S.errorRate)}`}),`Omnigateway`]}),(0,W.jsxs)(me,{children:[(0,W.jsxs)(he,{children:[(0,W.jsx)(e,{children:`req`}),(0,W.jsx)(ge,{children:(0,W.jsx)(J,{values:C.map(e=>e.total),overlay:C.map(e=>e.errors),height:22,label:`${S.requests} requests in the last 10 minutes`})})]}),(0,W.jsxs)(Y,{children:[(0,W.jsx)(e,{children:`rate`}),(0,W.jsx)(f,{children:S.ratePerMin.toFixed(1)}),(0,W.jsx)(e,{children:`/min`})]}),(0,W.jsxs)(Y,{children:[(0,W.jsx)(e,{children:`err`}),(0,W.jsx)(f,{style:{color:S.errorRate>=.05?`var(--down)`:void 0},children:L(S.errorRate)})]}),(0,W.jsxs)(Y,{children:[(0,W.jsx)(e,{children:`ttft p50`}),(0,W.jsx)(f,{children:I(S.ttftP50)})]}),(0,W.jsxs)(Y,{children:[(0,W.jsx)(e,{children:`spend`}),(0,W.jsx)(f,{children:F(S.costUsd)})]})]}),(0,W.jsx)(n,{}),(0,W.jsxs)(_e,{type:`button`,$size:`sm`,onClick:o,"aria-pressed":a,title:a?`Pause polling`:`Resume polling`,children:[(0,W.jsx)(v,{state:a?`ok`:`idle`,label:a?`polling`:`paused`}),a?`LIVE`:`PAUSED`]}),(0,W.jsx)(t,{type:`button`,$variant:`ghost`,$size:`sm`,onClick:()=>l(w),"aria-label":Z[c],title:`${Z[c]} — switch to ${Z[w].toLowerCase()}`,children:(0,W.jsx)(T,{})}),(0,W.jsx)(t,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Sign out`,title:`Sign out`,disabled:p.isPending,onClick:()=>{p.mutate(void 0,{onSuccess:()=>void i({to:`/login`})})},children:(0,W.jsx)(ie,{})})]})}var ye=[{to:`/`,label:`Rack`,blurb:`Live state of every account and model`,Icon:A},{to:`/accounts`,label:`Accounts`,blurb:`Provider credentials and their health`,Icon:te},{to:`/models`,label:`Models`,blurb:`Virtual models, targets, and routing`,Icon:ee},{to:`/keys`,label:`Keys`,blurb:`Gateway API keys and their limits`,Icon:re},{to:`/usage`,label:`Usage`,blurb:`Requests, tokens, and spend over time`,Icon:ne},{to:`/logs`,label:`Logs`,blurb:`Recent requests, one row each`,Icon:se},{to:`/console`,label:`Console`,blurb:`The gateway's own output, as it was printed`,Icon:j},{to:`/settings`,label:`Settings`,blurb:`Routing weights, retries, retention`,Icon:ce}],be=c.nav`
|
|
54
|
+
grid-area: rail;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 2px;
|
|
58
|
+
padding: ${({theme:e})=>e.space(2)};
|
|
59
|
+
border-right: 1px solid ${({theme:e})=>e.color.rule};
|
|
60
|
+
background: ${({theme:e})=>e.color.panel};
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
|
|
63
|
+
@media (max-width: 720px) {
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
overflow-x: auto;
|
|
66
|
+
border-right: 0;
|
|
67
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
68
|
+
}
|
|
69
|
+
`,xe=c(i)`
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
73
|
+
padding: 7px ${({theme:e})=>e.space(2)};
|
|
74
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
75
|
+
border-left: 2px solid transparent;
|
|
76
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
77
|
+
font-size: 12.5px;
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
transition:
|
|
81
|
+
background 120ms ease,
|
|
82
|
+
color 120ms ease;
|
|
83
|
+
|
|
84
|
+
svg {
|
|
85
|
+
width: 15px;
|
|
86
|
+
height: 15px;
|
|
87
|
+
flex: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
92
|
+
color: ${({theme:e})=>e.color.ink};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[data-status="active"] {
|
|
96
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
97
|
+
border-left-color: ${({theme:e})=>e.color.accent};
|
|
98
|
+
color: ${({theme:e})=>e.color.accent};
|
|
99
|
+
}
|
|
100
|
+
`;function Se(){return(0,W.jsx)(be,{"aria-label":`Console sections`,children:ye.map(({to:e,label:t,blurb:n,Icon:r})=>(0,W.jsxs)(xe,{to:e,title:n,activeOptions:{exact:e===`/`},children:[(0,W.jsx)(r,{}),t]},e))})}var Ce=c.div`
|
|
101
|
+
display: grid;
|
|
102
|
+
grid-template-areas:
|
|
103
|
+
"chassis chassis"
|
|
104
|
+
"rail main";
|
|
105
|
+
grid-template-columns: 168px minmax(0, 1fr);
|
|
106
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
107
|
+
min-height: 100%;
|
|
108
|
+
|
|
109
|
+
@media (max-width: 720px) {
|
|
110
|
+
grid-template-areas:
|
|
111
|
+
"chassis"
|
|
112
|
+
"rail"
|
|
113
|
+
"main";
|
|
114
|
+
grid-template-columns: minmax(0, 1fr);
|
|
115
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
116
|
+
}
|
|
117
|
+
`,$=c.main`
|
|
118
|
+
grid-area: main;
|
|
119
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
123
|
+
min-width: 0;
|
|
124
|
+
|
|
125
|
+
@media (max-width: 720px) {
|
|
126
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
127
|
+
}
|
|
128
|
+
`;function we({children:e}){return(0,W.jsxs)(Ce,{children:[(0,W.jsx)(ve,{}),(0,W.jsx)(Se,{}),(0,W.jsx)($,{children:e})]})}var Te=c.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: flex-end;
|
|
131
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
132
|
+
flex-wrap: wrap;
|
|
133
|
+
`,Ee=c.h1`
|
|
134
|
+
font-size: 20px;
|
|
135
|
+
font-weight: 600;
|
|
136
|
+
font-stretch: 88%;
|
|
137
|
+
letter-spacing: -0.01em;
|
|
138
|
+
`,De=c.p`
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
141
|
+
max-width: 68ch;
|
|
142
|
+
`,Oe=c.div`
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
gap: 6px;
|
|
146
|
+
min-width: 0;
|
|
147
|
+
`;function ke({legend:t,title:r,summary:i,actions:a}){return(0,W.jsxs)(Te,{children:[(0,W.jsxs)(Oe,{children:[(0,W.jsx)(e,{children:t}),(0,W.jsx)(Ee,{children:r}),(0,W.jsx)(De,{children:i})]}),(0,W.jsx)(n,{}),a]})}export{K as a,H as c,B as d,F as f,ue as i,I as l,k as m,we as n,V as o,U as p,J as r,P as s,ke as t,L as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as e,W as t,jt as n}from"./queries-2E6-CboE.js";var r=n(),i=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 6px;
|
|
@@ -7,7 +7,7 @@ import{O as e,Ot as t,V as n}from"./queries-BMwc6EvM.js";var r=t(),i=n.div`
|
|
|
7
7
|
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
8
8
|
border-radius: ${({theme:e})=>e.radius.panel};
|
|
9
9
|
min-width: 0;
|
|
10
|
-
`,a=
|
|
10
|
+
`,a=t.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: baseline;
|
|
13
13
|
gap: 4px;
|
|
@@ -18,10 +18,10 @@ import{O as e,Ot as t,V as n}from"./queries-BMwc6EvM.js";var r=t(),i=n.div`
|
|
|
18
18
|
letter-spacing: -0.02em;
|
|
19
19
|
line-height: 1.1;
|
|
20
20
|
color: ${({theme:e,$tone:t})=>t===`ok`?e.color.ok:t===`warn`?e.color.warn:t===`down`?e.color.down:e.color.ink};
|
|
21
|
-
`,o=
|
|
21
|
+
`,o=t.span`
|
|
22
22
|
font-size: 11px;
|
|
23
23
|
font-weight: 400;
|
|
24
24
|
color: ${({theme:e})=>e.color.inkFaint};
|
|
25
|
-
`,s=
|
|
25
|
+
`,s=t.div`
|
|
26
26
|
margin-top: 2px;
|
|
27
27
|
`;function c({legend:t,value:n,unit:c,tone:l,trace:u,className:d}){return(0,r.jsxs)(i,{className:d,children:[(0,r.jsx)(e,{children:t}),(0,r.jsxs)(a,{...l===void 0?{}:{$tone:l},children:[(0,r.jsx)(`span`,{children:n}),c===void 0?null:(0,r.jsx)(o,{children:c})]}),u===void 0?null:(0,r.jsx)(s,{children:u})]})}export{c as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,D as t,F as n,N as r,V as i,W as a,jt as o,z as s}from"./queries-2E6-CboE.js";var c=o(),l=a.section`
|
|
2
2
|
background: ${({theme:e})=>e.color.panel};
|
|
3
3
|
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
4
4
|
border-radius: ${({theme:e})=>e.radius.panel};
|
|
@@ -7,7 +7,7 @@ import{A as e,I as t,M as n,O as r,Ot as i,R as a,T as o,V as s}from"./queries-B
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
min-width: 0;
|
|
10
|
-
`,u=
|
|
10
|
+
`,u=a.header`
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
gap: ${({theme:e})=>e.space(2)};
|
|
@@ -15,14 +15,14 @@ import{A as e,I as t,M as n,O as r,Ot as i,R as a,T as o,V as s}from"./queries-B
|
|
|
15
15
|
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
16
16
|
background: ${({theme:e})=>e.color.panelSunk};
|
|
17
17
|
min-height: 34px;
|
|
18
|
-
`,d=
|
|
18
|
+
`,d=a.div`
|
|
19
19
|
padding: ${({theme:e,$flush:t})=>t===!0?`0`:e.space(3)};
|
|
20
20
|
min-width: 0;
|
|
21
|
-
`,f=
|
|
21
|
+
`,f=a.footer`
|
|
22
22
|
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
23
23
|
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
24
24
|
background: ${({theme:e})=>e.color.panelSunk};
|
|
25
|
-
`;function p({legend:t,meta:i,actions:a,footer:o,flush:s,className:p,children:m}){return(0,c.jsxs)(l,{className:p,children:[(0,c.jsxs)(u,{children:[(0,c.jsx)(
|
|
25
|
+
`;function p({legend:t,meta:i,actions:a,footer:o,flush:s,className:p,children:m}){return(0,c.jsxs)(l,{className:p,children:[(0,c.jsxs)(u,{children:[(0,c.jsx)(e,{children:t}),i===void 0?null:(0,c.jsx)(e,{as:`span`,children:i}),(0,c.jsx)(n,{}),a===void 0?null:(0,c.jsx)(r,{$gap:1,children:a})]}),(0,c.jsx)(d,{...s===!0?{$flush:!0}:{},children:m}),o===void 0?null:(0,c.jsx)(f,{children:o})]})}var m=a.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
align-items: center;
|
|
@@ -30,23 +30,23 @@ import{A as e,I as t,M as n,O as r,Ot as i,R as a,T as o,V as s}from"./queries-B
|
|
|
30
30
|
gap: ${({theme:e})=>e.space(2)};
|
|
31
31
|
padding: ${({theme:e})=>e.space(8)} ${({theme:e})=>e.space(4)};
|
|
32
32
|
text-align: center;
|
|
33
|
-
`,h=
|
|
33
|
+
`,h=a.p`
|
|
34
34
|
max-width: 44ch;
|
|
35
35
|
font-size: 13px;
|
|
36
36
|
color: ${({theme:e})=>e.color.inkDim};
|
|
37
|
-
`;function g({legend:
|
|
37
|
+
`;function g({legend:t,message:n,action:r}){return(0,c.jsxs)(m,{children:[(0,c.jsx)(e,{children:t}),(0,c.jsx)(h,{children:n}),r]})}var _=a(h)`
|
|
38
38
|
color: ${({theme:e})=>e.color.down};
|
|
39
|
-
`;function v(e){return e instanceof
|
|
39
|
+
`;function v(e){return e instanceof t||e instanceof Error?e.message:`The gateway did not answer.`}function y({legend:t=`Request failed`,error:n,onRetry:r}){return(0,c.jsxs)(m,{children:[(0,c.jsx)(e,{children:t}),(0,c.jsx)(_,{children:v(n)}),r===void 0?null:(0,c.jsx)(s,{type:`button`,$size:`sm`,onClick:r,children:`Try again`})]})}var b=i`
|
|
40
40
|
0% { opacity: 0.35; }
|
|
41
41
|
50% { opacity: 0.7; }
|
|
42
42
|
100% { opacity: 0.35; }
|
|
43
|
-
`,x=
|
|
43
|
+
`,x=a.div`
|
|
44
44
|
height: ${({$height:e})=>e??12}px;
|
|
45
45
|
width: ${({$width:e})=>e??`100%`};
|
|
46
46
|
border-radius: 2px;
|
|
47
47
|
background: ${({theme:e})=>e.color.ruleStrong};
|
|
48
48
|
animation: ${b} 1.4s ease-in-out infinite;
|
|
49
|
-
`,S=
|
|
49
|
+
`,S=a.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
gap: ${({theme:e})=>e.space(2)};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mt as e,W as t,Xt as n,jt as r,z as i}from"./queries-2E6-CboE.js";import{m as a}from"./Rack-CMqGBP4I.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./Modal-CiVHSJmm.js";var p=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),m=n(e(),1),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e){let[t,n]=m.useState(void 0);return u(()=>{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}g(_,`useSize`);var v=r(),y=Object.defineProperty,b=(e,t)=>y(e,`name`,{value:t,configurable:!0}),x=`Switch`,[S,C]=o(x),[w,T]=S(x);function E(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,h]=c({prop:n,defaultProp:i??!1,onChange:l,caller:x}),[g,_]=m.useState(null),[y,b]=m.useState(null),S=m.useRef(!1),[C,T]=m.useReducer(e=>e+1,0),E={checked:p,setChecked:h,disabled:a,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:S,userInteractionCount:C,onUserInteraction:T,required:u,defaultChecked:i,isFormControl:!g||!!o||!!g.closest(`form`),bubbleInput:y,setBubbleInput:b};return(0,v.jsx)(w,{scope:t,...E,children:P(f)?f(E):r})}b(E,`SwitchProvider`);var D=`SwitchTrigger`,O=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:u,required:f,setControl:p,setChecked:h,hasConsumerStoppedPropagationRef:g,onUserInteraction:_,isFormControl:y,bubbleInput:x}=T(D,e),S=d(r,p),C=m.useRef(u);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=b(()=>h(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,h]),(0,v.jsx)(l.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":f,"data-state":F(u),"data-disabled":c?``:void 0,disabled:c,value:o,...n,ref:S,onClick:s(t,e=>{_(),h(e=>!e),x&&y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})},`SwitchTrigger`)),k=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(E,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(O,{...d,ref:t,__scopeSwitch:n}),e&&(0,v.jsx)(N,{__scopeSwitch:n})]})})},`Switch`)),A=`SwitchThumb`,j=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,...r}=e,i=T(A,n);return(0,v.jsx)(l.span,{"data-state":F(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),M=`SwitchBubbleInput`,N=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:u,required:f,disabled:p,name:h,value:g,form:y,bubbleInput:b,setBubbleInput:x}=T(M,e),S=d(r,x),C=_(i),w=m.useRef(!1),E=m.useRef(c),D=m.useRef(o);m.useEffect(()=>{let e=b;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==D.current;D.current=o;let i=E.current!==c;E.current=c;let s=!(r&&a.current);if(i&&n){w.current=!r;let t=new Event(`click`,{bubbles:s});n.call(e,c),e.dispatchEvent(t),w.current=!1}},[b,c,a,o]);let O=m.useRef(c);return(0,v.jsx)(l.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??O.current,required:f,disabled:p,name:h,value:g,form:y,...n,tabIndex:-1,ref:S,onClick:s(t,e=>{w.current&&e.stopPropagation()}),style:{...n.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function P(e){return typeof e==`function`}b(P,`isFunction`);function F(e){return e?`checked`:`unchecked`}b(F,`getState`);var I=t.p`
|
|
2
2
|
font-size: 13px;
|
|
3
3
|
color: ${({theme:e})=>e.color.inkDim};
|
|
4
|
-
`;function L({open:
|
|
4
|
+
`;function L({open:e,onOpenChange:t,title:n,body:r,confirmLabel:a,busy:o,onConfirm:s}){return(0,v.jsx)(f,{open:e,onOpenChange:t,title:n,width:`420px`,footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(i,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),(0,v.jsx)(i,{type:`button`,$variant:`danger`,disabled:o===!0,onClick:s,children:a})]}),children:(0,v.jsx)(I,{children:r})})}var R=t(k)`
|
|
5
5
|
all: unset;
|
|
6
6
|
width: 30px;
|
|
7
7
|
height: 16px;
|
|
@@ -26,7 +26,7 @@ import{I as e,Ot as t,V as n,kt as r,qt as i}from"./queries-BMwc6EvM.js";import{
|
|
|
26
26
|
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
27
27
|
outline-offset: 2px;
|
|
28
28
|
}
|
|
29
|
-
`,z=
|
|
29
|
+
`,z=t(j)`
|
|
30
30
|
display: block;
|
|
31
31
|
width: 12px;
|
|
32
32
|
height: 12px;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jt as e}from"./queries-2E6-CboE.js";import{o as t}from"./index-vCuK1fRQ.js";import{i as n,n as r}from"./Rack-CMqGBP4I.js";var i=e(),a=()=>(0,i.jsx)(n,{children:(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as component};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{A as e,B as t,I as n,Mt as r,N as i,P as a,S as o,T as s,W as c,Xt as l,a as u,d,jt as f,l as p,o as m,r as h,u as g,z as _}from"./queries-2E6-CboE.js";import{a as v,d as y,l as b,m as x,t as S}from"./Rack-CMqGBP4I.js";import{t as C}from"./CopyValue-CJy2T0H6.js";import{n as w,r as T,t as ee}from"./Toggle-BoGjb5oi.js";import{t as E}from"./trash-2--aH2iKg-.js";import{t as D}from"./Modal-CiVHSJmm.js";import{a as O,d as te,i as ne,n as re,t as k,u as A}from"./Lamp-7jD_9929.js";import{t as j}from"./Chip-C69u2U_b.js";import{i as M,n as N,r as P,t as F}from"./Field-Sc8mDqJv.js";import{t as ie}from"./Meter-C0nUftAa.js";import{a as I,i as L,n as R,r as z,t as B}from"./States-D55MhqMx.js";import{i as V,n as H,r as U,t as W}from"./Table-DBB3jdgi.js";import{t as G}from"./catalog-C_OQ0icG.js";var K=x(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),q=l(r(),1),J=f(),ae=Object.keys(G),Y={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},X={anthropic:`Authorize in the browser, then paste the code Anthropic shows you.`,openai:`Authorize in the browser. When it redirects to localhost, paste the whole URL.`,kimi:`Enter the code on Kimi's device page. This dialog finishes on its own.`},oe=c.ol`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
5
|
+
`,se=c.div`
|
|
6
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
7
|
+
font-size: 26px;
|
|
8
|
+
letter-spacing: 0.22em;
|
|
9
|
+
text-align: center;
|
|
10
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
11
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
12
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
13
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
14
|
+
`,ce=c.p`
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: ${({theme:e})=>e.color.down};
|
|
17
|
+
`,le=c.p`
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
20
|
+
`;function ue({open:t,onOpenChange:r,onConnected:a}){let[o,s]=(0,q.useState)(`anthropic`),[c,l]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,g]=(0,q.useState)(``),[v,y]=(0,q.useState)(null),b=m(),x=u(),S=(0,q.useCallback)(()=>{f(null),g(``),y(null),l(``),b.reset(),x.reset()},[b,x]),w=(0,q.useCallback)(e=>{e||S(),r(e)},[r,S]);return(0,q.useEffect)(()=>{if(d===null||d.kind!==`device`)return;let e=!1,t=async()=>{try{let t=await h(d.flowId);if(e)return;if(t.status===`complete`){S(),r(!1),a();return}}catch(t){if(e)return;y(L(t)),f(null);return}e||(n=setTimeout(()=>void t(),d.pollIntervalMs))},n=setTimeout(()=>void t(),d.pollIntervalMs);return()=>{e=!0,clearTimeout(n)}},[d,a,r,S]),(0,J.jsx)(D,{open:t,onOpenChange:w,title:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:d===null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(_,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(_,{type:`button`,$variant:`primary`,disabled:b.isPending,onClick:()=>{y(null),b.mutate({provider:o,label:c.trim().length===0?Y[o]:c.trim()},{onSuccess:e=>f(e),onError:e=>y(L(e))})},children:b.isPending?`Starting…`:`Start authorization`})]}):d.kind===`device`?(0,J.jsx)(_,{type:`button`,onClick:()=>w(!1),children:`Cancel`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(_,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(_,{type:`button`,$variant:`primary`,disabled:x.isPending||p.trim().length===0,onClick:()=>{d!==null&&(y(null),x.mutate({flowId:d.flowId,code:p.trim()},{onSuccess:()=>{S(),r(!1),a()},onError:e=>y(L(e))}))},children:x.isPending?`Finishing…`:`Finish connecting`})]}),children:(0,J.jsxs)(oe,{children:[d===null?(0,J.jsxs)(n,{$gap:3,children:[(0,J.jsx)(F,{label:`Provider`,children:e=>(0,J.jsx)(M,{...e,value:o,onChange:e=>s(e.target.value),children:ae.map(e=>(0,J.jsx)(`option`,{value:e,children:Y[e]},e))})}),(0,J.jsx)(F,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>(0,J.jsx)(N,{...e,value:c,placeholder:Y[o],onChange:e=>l(e.target.value)})})]}):(0,J.jsxs)(n,{$gap:3,children:[(0,J.jsxs)(n,{$gap:1,children:[(0,J.jsx)(e,{children:`Step 1 — authorize`}),(0,J.jsx)(i,{$gap:2,children:(0,J.jsxs)(_,{as:`a`,href:d.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[(0,J.jsx)(K,{}),`Open `,Y[o]]})}),(0,J.jsx)(C,{value:d.authorizeUrl,label:`Copy authorization link`})]}),d.userCode===null?null:(0,J.jsxs)(n,{$gap:1,children:[(0,J.jsx)(e,{children:`Step 2 — enter this code`}),(0,J.jsx)(se,{children:d.userCode})]}),d.kind===`device`?(0,J.jsxs)(le,{children:[X[o],` Waiting for authorization…`]}):(0,J.jsx)(F,{label:`Authorization code`,hint:X[o],...v===null?{}:{problem:v},children:e=>(0,J.jsx)(N,{...e,value:p,autoFocus:!0,placeholder:o===`openai`?`http://localhost:1455/auth/callback?code=…`:`code#state`,onChange:e=>g(e.target.value)})})]}),v===null||d?.kind===`pkce`?null:(0,J.jsx)(ce,{children:v})]})})}var de=[`anthropic`,`openai`,`kimi`],Z={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},fe=c(I)`
|
|
21
|
+
border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
|
|
22
|
+
`,pe=c(N)`
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 140px;
|
|
25
|
+
height: 26px;
|
|
26
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
27
|
+
font-size: 12.5px;
|
|
28
|
+
background: transparent;
|
|
29
|
+
border-color: transparent;
|
|
30
|
+
|
|
31
|
+
&:hover:not(:disabled),
|
|
32
|
+
&:focus {
|
|
33
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
34
|
+
border-color: ${({theme:e})=>e.color.ruleStrong};
|
|
35
|
+
}
|
|
36
|
+
`,Q=c(P)`
|
|
37
|
+
width: 62px;
|
|
38
|
+
height: 26px;
|
|
39
|
+
`,me=c.span`
|
|
40
|
+
display: block;
|
|
41
|
+
padding-left: 9px;
|
|
42
|
+
font-size: 11px;
|
|
43
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
44
|
+
`,he=c(i)`
|
|
45
|
+
min-width: 130px;
|
|
46
|
+
gap: 6px;
|
|
47
|
+
`,ge=c.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
`;function $(){let e=s();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function _e(){let{cadence:r}=v(),s=g(),c=p(r(1e4)),l=o(),u=d(),{commit:f}=$(),[m,h]=(0,q.useState)(!1),[x,C]=(0,q.useState)(null),D=Date.now(),M=s.data??[],N=O(c.data?.health??[],e=>e.credentialId),P=O(c.data?.quota??[],e=>e.credentialId),F=l.data?.quotaPollIntervalMs??3e5,L=M.filter(e=>e.enabled).length,G=s.isLoading?`Reading connected accounts…`:M.length===0?`No provider credentials are connected, so every request fails at the router.`:`${L} of ${M.length} accounts are enabled and eligible for routing.`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(S,{legend:`Accounts`,title:`Provider accounts`,summary:G,actions:(0,J.jsxs)(_,{type:`button`,$variant:`primary`,onClick:()=>h(!0),children:[(0,J.jsx)(T,{}),`Connect an account`]})}),s.isError?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(R,{error:s.error,onRetry:()=>void s.refetch()})}):s.isLoading?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(z,{rows:5})}):M.length===0?(0,J.jsx)(I,{legend:`Accounts`,children:(0,J.jsx)(B,{legend:`Nothing connected`,message:`Connect a provider account to give the router something to dispatch to. Tokens are encrypted at rest and never shown again.`,action:(0,J.jsx)(_,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>h(!0),children:`Connect an account`})})}):(0,J.jsx)(n,{$gap:4,children:de.filter(e=>M.some(t=>t.provider===e)).map(n=>{let r=M.filter(e=>e.provider===n);return(0,J.jsx)(fe,{$provider:n,legend:Z[n],meta:`${r.length} account${r.length===1?``:`s`}`,flush:!0,children:(0,J.jsx)(a,{children:(0,J.jsxs)(W,{children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(U,{$width:`24%`,children:`Account`}),(0,J.jsx)(U,{$width:`20%`,children:`Sign-in`}),(0,J.jsx)(U,{$align:`right`,$width:`86px`,children:`Tier`}),(0,J.jsx)(U,{$align:`right`,$width:`94px`,children:`Weight`}),(0,J.jsx)(U,{$align:`center`,$width:`86px`,children:`Enabled`}),(0,J.jsx)(U,{$width:`160px`,children:`Quota`}),(0,J.jsx)(U,{$align:`right`,$width:`88px`,children:`TTFT`}),(0,J.jsx)(U,{$align:`right`,$width:`130px`,children:`Token expires`}),(0,J.jsx)(U,{$width:`48px`})]})}),(0,J.jsx)(`tbody`,{children:r.map(n=>{let r=ne(N.get(n.id)??[],D,n.enabled,n.disabledReason),a=te(P.get(n.id)??[]);return(0,J.jsxs)(V,{children:[(0,J.jsxs)(H,{children:[(0,J.jsxs)(i,{$gap:2,children:[(0,J.jsx)(k,{state:r.state,label:r.note===``?`healthy`:r.note}),(0,J.jsx)(pe,{defaultValue:n.label,"aria-label":`Label for ${n.label}`,onBlur:e=>{let t=e.target.value.trim();if(t.length===0||t===n.label){e.target.value=n.label;return}f(n.id,{label:t})}})]}),r.note===``?null:(0,J.jsx)(me,{children:r.note})]}),(0,J.jsx)(H,{children:(0,J.jsxs)(i,{$gap:1,children:[(0,J.jsx)(j,{children:n.authType===`oauth`?`oauth`:`api key`}),n.accountEmail===null?null:(0,J.jsx)(e,{children:n.accountEmail})]})}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(Q,{min:1,step:1,defaultValue:n.tier,"aria-label":`Tier for ${n.label}`,onBlur:e=>{let t=Number(e.target.value);if(!Number.isInteger(t)||t<1||t===n.tier){e.target.value=String(n.tier);return}f(n.id,{tier:t})}})}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(Q,{min:.1,step:.1,defaultValue:n.weight,"aria-label":`Weight for ${n.label}`,onBlur:e=>{let t=Number(e.target.value);if(!Number.isFinite(t)||t<=0||t===n.weight){e.target.value=String(n.weight);return}f(n.id,{weight:t})}})}),(0,J.jsx)(H,{$align:`center`,children:(0,J.jsx)(ee,{checked:n.enabled,label:`Route to ${n.label}`,onCheckedChange:e=>f(n.id,{enabled:e})})}),(0,J.jsx)(H,{children:a.length===0?(0,J.jsx)(e,{children:`unknown`}):(0,J.jsx)(ge,{children:a.map(({window:t,fraction:n})=>(0,J.jsxs)(he,{children:[(0,J.jsx)(ie,{fraction:n,label:`${re[t.windowType]} window, ${Math.round(n*100)}% used`}),(0,J.jsx)(e,{children:A(t,D,F,y)})]},t.windowType))})}),(0,J.jsx)(H,{$align:`right`,$mono:!0,children:b(r.ttftMs)}),(0,J.jsx)(H,{$align:`right`,$mono:!0,children:n.expiresAt===null?`never`:y(n.expiresAt,D)}),(0,J.jsx)(H,{$align:`right`,children:(0,J.jsx)(t,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${n.label}`,title:`Remove ${n.label}`,onClick:()=>C(n),children:(0,J.jsx)(E,{})})})]},n.id)})})]})})},n)})}),(0,J.jsx)(ue,{open:m,onOpenChange:h,onConnected:()=>void s.refetch()}),(0,J.jsx)(w,{open:x!==null,onOpenChange:e=>{e||C(null)},title:`Remove account`,body:x===null?``:`Removing "${x.label}" deletes its stored token. Any model target pointing at ${Z[x.provider]} loses this account, and reconnecting means authorizing again.`,confirmLabel:`Remove account`,busy:u.isPending,onConfirm:()=>{x!==null&&u.mutate(x.id,{onSettled:()=>C(null)})}})]})}var ve=_e;export{ve as component};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{M as e,Mt as t,N as n,W as r,Xt as i,jt as a,s as o,t as s}from"./queries-2E6-CboE.js";import{a as c,s as l,t as u}from"./Rack-CMqGBP4I.js";import{i as d}from"./Field-Sc8mDqJv.js";import{a as f,n as p,r as m,t as h}from"./States-D55MhqMx.js";var g=i(t(),1),_=a(),v=[100,200,500],y=[{value:``,label:`All levels`},{value:`debug`,label:`Debug and above`},{value:`info`,label:`Info and above`},{value:`warn`,label:`Warnings and errors`},{value:`error`,label:`Errors only`}],b=r(n)`
|
|
2
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
`,x=r(d)`
|
|
5
|
+
width: auto;
|
|
6
|
+
`,S=r.pre`
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
9
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
10
|
+
font-size: 12px;
|
|
11
|
+
line-height: 1.65;
|
|
12
|
+
overflow-x: auto;
|
|
13
|
+
white-space: pre;
|
|
14
|
+
`,C=r.div`
|
|
15
|
+
color: ${({theme:e,$level:t})=>t===`error`?e.color.down:t===`warn`?e.color.warn:t===`debug`?e.color.inkFaint:e.color.ink};
|
|
16
|
+
`,w=r.p`
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
19
|
+
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
20
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
`,T=r.code`
|
|
23
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
24
|
+
word-break: break-all;
|
|
25
|
+
`;function E({read:e}){return e.source===`file`?(0,_.jsxs)(w,{children:[`Reading `,(0,_.jsx)(T,{children:e.path}),`, named by `,(0,_.jsx)(T,{children:`OMNI_LOG_FILE`}),`. That variable says where the gateway's output is being captured; it does not redirect it.`]}):e.source===`journal`?(0,_.jsxs)(w,{children:[`Reading the systemd journal for `,(0,_.jsx)(T,{children:`omnigateway.service`}),`. To read a file instead, redirect the gateway's output to one and point `,(0,_.jsx)(T,{children:`OMNI_LOG_FILE`}),` at the same path.`]}):null}function D(){let{cadence:t}=c(),[n,r]=(0,g.useState)(200),[i,a]=(0,g.useState)(``),d=o(n,i,t(s)),w=d.data,T=w?.lines??[];return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{legend:`Console`,title:`Gateway output`,summary:d.isLoading?`Reading the gateway's own output…`:`${l(T.length)} lines of what this process is doing. Requests are in Logs; prompt bodies, tokens and keys are never written here.`,actions:(0,_.jsxs)(b,{children:[(0,_.jsx)(x,{value:i,"aria-label":`Which levels to show`,onChange:e=>a(e.target.value),children:y.map(e=>(0,_.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,_.jsx)(x,{value:n,"aria-label":`How many lines to fetch`,onChange:e=>r(Number(e.target.value)),children:v.map(e=>(0,_.jsxs)(`option`,{value:e,children:[`last `,e]},e))})]})}),(0,_.jsx)(f,{legend:`Process output`,meta:w===void 0?void 0:(0,_.jsx)(e,{children:O(w)}),flush:!0,children:d.isError?(0,_.jsx)(p,{error:d.error,onRetry:()=>void d.refetch()}):d.isLoading?(0,_.jsx)(`div`,{style:{padding:12},children:(0,_.jsx)(m,{rows:10})}):w!==void 0&&w.source===`none`?(0,_.jsx)(h,{legend:`Nothing is capturing this gateway`,message:"Its output is going to a terminal, so there is nothing to read back. To capture it, run the gateway under systemd with `omni service install`, or start it with `omni start`, which redirects output to a file and points OMNI_LOG_FILE at it."}):(0,_.jsxs)(_.Fragment,{children:[T.length===0?(0,_.jsx)(h,{legend:`Nothing to show`,message:i===``?`This log is empty. The gateway writes here when it boots, refreshes a token, or polls a quota.`:`No line in this window is at that level. Widen the filter to see everything.`}):(0,_.jsx)(S,{children:T.map((e,t)=>(0,_.jsx)(C,{$level:e.level,children:e.raw},`${e.at??0}-${t}`))}),w===void 0?null:(0,_.jsx)(E,{read:w})]})})]})}function O(e){return e.source===`file`?`log file`:e.source===`journal`?`systemd journal`:`not captured`}var k=D;export{k as component};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{A as e,E as t,F as n,I as r,K as i,L as a,N as o,P as s,S as c,W as l,_ as u,j as d,jt as f,k as p,l as m,u as h,v as g,z as _}from"./queries-2E6-CboE.js";import{a as v,d as y,f as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./Rack-CMqGBP4I.js";import{a as D,c as O,d as k,f as A,i as j,l as M,n as ee,r as te,s as N,t as P,u as F}from"./Lamp-7jD_9929.js";import{n as I,t as L}from"./Chip-C69u2U_b.js";import{t as R}from"./Meter-C0nUftAa.js";import{a as z,n as B,t as V}from"./States-D55MhqMx.js";import{i as H,n as U,r as W,t as G}from"./Table-DBB3jdgi.js";import{t as K}from"./Readout-Dv2dZWtI.js";var q=f(),ne=l(a)`
|
|
2
|
+
font-weight: 500;
|
|
3
|
+
display: block;
|
|
4
|
+
max-width: 24ch;
|
|
5
|
+
`,J=l.span`
|
|
6
|
+
font-size: 11px;
|
|
7
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
8
|
+
`,Y=l.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
width: 118px;
|
|
13
|
+
`,X=l.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 4px;
|
|
17
|
+
`;function Z({credentials:t,health:n,quota:r,usage:a,quotaPollIntervalMs:c,now:l}){let u=D(n,e=>e.credentialId),d=D(r,e=>e.credentialId),f=new Map(a.map(e=>[e.key,e])),p={down:0,warn:1,ok:2,idle:3,live:3},m=t.map(e=>({credential:e,status:j(u.get(e.id)??[],l,e.enabled,e.disabledReason),quota:k(d.get(e.id)??[]),usage:f.get(e.id)})).sort((e,t)=>p[e.status.state]-p[t.status.state]||e.credential.tier-t.credential.tier);return(0,q.jsx)(z,{legend:`Accounts`,meta:`${t.length} connected`,flush:!0,actions:(0,q.jsx)(_,{as:i,to:`/accounts`,$size:`sm`,children:`Manage accounts`}),children:t.length===0?(0,q.jsx)(V,{legend:`No accounts`,message:`The gateway has no provider credentials, so every request will fail. Connect one to start routing.`,action:(0,q.jsx)(_,{as:i,to:`/accounts`,$variant:`primary`,$size:`sm`,children:`Connect an account`})}):(0,q.jsx)(s,{children:(0,q.jsxs)(G,{children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(W,{children:`Account`}),(0,q.jsx)(W,{children:`Provider`}),(0,q.jsx)(W,{$align:`right`,children:`Tier`}),(0,q.jsx)(W,{children:`Quota`}),(0,q.jsx)(W,{$align:`right`,children:`TTFT`}),(0,q.jsx)(W,{$align:`right`,children:`Requests`}),(0,q.jsx)(W,{$align:`right`,children:`Last used`})]})}),(0,q.jsx)(`tbody`,{children:m.map(({credential:t,status:n,quota:r,usage:i})=>(0,q.jsxs)(H,{children:[(0,q.jsx)(U,{children:(0,q.jsxs)(o,{$gap:2,children:[(0,q.jsx)(P,{state:n.state,label:n.note===``?`healthy`:n.note}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(ne,{children:t.label}),n.note===``?null:(0,q.jsx)(J,{children:n.note})]})]})}),(0,q.jsx)(U,{children:(0,q.jsx)(I,{provider:t.provider})}),(0,q.jsx)(U,{$align:`right`,$mono:!0,children:t.tier}),(0,q.jsx)(U,{children:r.length===0?(0,q.jsx)(J,{children:`unknown`}):(0,q.jsx)(X,{children:r.map(({window:t,fraction:n})=>(0,q.jsxs)(Y,{children:[(0,q.jsx)(R,{fraction:n,label:`${ee[t.windowType]} window, ${Math.round(n*100)}% used`}),(0,q.jsx)(e,{children:F(t,l,c,y)})]},t.windowType))})}),(0,q.jsx)(U,{$align:`right`,$mono:!0,children:x(n.ttftMs)}),(0,q.jsx)(U,{$align:`right`,$mono:!0,children:i===void 0?`—`:w(i.requests)}),(0,q.jsx)(U,{$align:`right`,$mono:!0,children:y(n.lastUsedAt,l)})]},t.id))})]})})})}var re=l.ul`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
`,ie=l.li`
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
24
|
+
padding: 6px ${({theme:e})=>e.space(3)};
|
|
25
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
26
|
+
|
|
27
|
+
&:last-child {
|
|
28
|
+
border-bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
`,ae=l(a)`
|
|
31
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
max-width: 30ch;
|
|
34
|
+
`,oe=l(d)`
|
|
35
|
+
color: ${({theme:e})=>e.color.down};
|
|
36
|
+
font-size: 11px;
|
|
37
|
+
`;function se({logs:e}){let t=e.slice(0,12);return(0,q.jsx)(z,{legend:`Activity`,meta:`most recent first`,flush:!0,actions:(0,q.jsx)(_,{as:i,to:`/logs`,$size:`sm`,children:`Open logs`}),children:t.length===0?(0,q.jsx)(V,{legend:`No traffic yet`,message:`Point a client at this gateway with an API key and the requests will appear here.`}):(0,q.jsx)(re,{children:t.map(e=>(0,q.jsxs)(ie,{children:[(0,q.jsx)(P,{state:M(e),label:O(e)}),(0,q.jsx)(d,{$dim:!0,children:S(e.at)}),(0,q.jsx)(ae,{title:e.requestedModel,children:e.requestedModel||`—`}),e.resolvedProvider===null?null:(0,q.jsx)(d,{$dim:!0,style:{color:`var(--p-${e.resolvedProvider})`},children:e.resolvedProvider}),(0,q.jsx)(n,{}),N(e)?null:(0,q.jsxs)(q.Fragment,{children:[e.errorCode===null?null:(0,q.jsx)(oe,{children:e.errorCode}),e.attempts>1?(0,q.jsxs)(d,{$dim:!0,children:[e.attempts,`×`]}):null,(0,q.jsx)(d,{$dim:!0,children:x(e.durationMs)}),(0,q.jsx)(d,{$dim:!0,children:b(e.costUsd)})]})]},e.id))})})}var ce=l.ul`
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
41
|
+
`,le=l(a)`
|
|
42
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
43
|
+
font-size: 12.5px;
|
|
44
|
+
`,Q=l.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
height: 5px;
|
|
47
|
+
border-radius: 2px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
50
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
51
|
+
`,ue=l.div`
|
|
52
|
+
flex: ${({$grow:e})=>e} 0 0;
|
|
53
|
+
background: ${({$color:e})=>e};
|
|
54
|
+
opacity: 0.8;
|
|
55
|
+
`,de=l.div`
|
|
56
|
+
flex: ${({$grow:e})=>e} 0 0;
|
|
57
|
+
`;function fe({models:t,logs:r}){let a=new Map;for(let e of r){let t=a.get(e.requestedModel)??{requests:0,costUsd:0};t.requests+=1,t.costUsd+=e.costUsd,a.set(e.requestedModel,t)}let s=Math.max(1,...[...a.values()].map(e=>e.requests)),c=[...t].map(e=>({model:e,used:a.get(e.id)})).sort((e,t)=>(t.used?.requests??0)-(e.used?.requests??0)).slice(0,8);return(0,q.jsx)(z,{legend:`Models`,meta:`${t.length} configured`,actions:(0,q.jsx)(_,{as:i,to:`/models`,$size:`sm`,children:`Edit routing`}),children:t.length===0?(0,q.jsx)(V,{legend:`No models`,message:`Nothing is routable yet. Create a virtual model and point it at one or more provider targets.`,action:(0,q.jsx)(_,{as:i,to:`/models`,$variant:`primary`,$size:`sm`,children:`Create a model`})}):(0,q.jsx)(ce,{children:c.map(({model:t,used:r})=>{let i=(r?.requests??0)/s,a=[...new Set(t.targets.map(e=>e.provider))];return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(o,{$gap:2,children:[(0,q.jsx)(le,{title:t.id,children:t.id}),t.isAlias?(0,q.jsx)(L,{children:`alias`}):null,(0,q.jsx)(L,{$tone:`accent`,children:t.strategy}),(0,q.jsx)(n,{}),(0,q.jsx)(d,{$dim:!0,children:w(r?.requests??0)}),(0,q.jsx)(e,{children:`req`}),(0,q.jsx)(d,{$dim:!0,children:b(r?.costUsd??0)})]}),(0,q.jsxs)(Q,{style:{marginTop:6},title:`${Math.round(i*100)}% of the busiest model`,children:[a.map(e=>(0,q.jsx)(ue,{$color:`var(--p-${e})`,$grow:i/a.length},e)),(0,q.jsx)(de,{$grow:Math.max(0,1-i)})]})]},t.id)})})})}var pe=l.div`
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
|
|
60
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
61
|
+
`;function me({logs:e,windowMs:t,now:n}){let r=e.filter(e=>n-e.at<=t),i=A(r,t),a=te(r,{now:n,spanMs:t,count:32}),o=i.errorRate>=.25?`down`:i.errorRate>=.05?`warn`:`ok`;return(0,q.jsxs)(pe,{children:[(0,q.jsx)(K,{legend:`Requests`,value:w(i.requests),unit:`${i.ratePerMin.toFixed(1)}/min`,trace:(0,q.jsx)(C,{values:a.map(e=>e.total),overlay:a.map(e=>e.errors),label:`${i.requests} requests, ${i.errors} of them failed`})}),(0,q.jsx)(K,{legend:`Error rate`,value:E(i.errorRate),unit:`${w(i.errors)} failed`,tone:i.requests===0?`ink`:o,trace:(0,q.jsx)(C,{values:a.map(e=>e.errors),scaleTo:Math.max(...a.map(e=>e.total)),color:`var(--down)`,label:`${i.errors} failed requests against ${i.requests} total`})}),(0,q.jsx)(K,{legend:`Time to first token`,value:x(i.ttftP50),unit:`p95 ${x(i.ttftP95)}`,trace:(0,q.jsx)(C,{values:a.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${x(i.ttftP50)}`})}),(0,q.jsx)(K,{legend:`Spend`,value:b(i.costUsd),unit:`${w(i.inputTokens+i.outputTokens)} tokens`,trace:(0,q.jsx)(C,{values:a.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${b(i.costUsd)} total`})})]})}var $=36e5;function he(){let{cadence:e}=v(),n=h(),i=m(e(1e4)),a=g(),o=u(500,e(1e4)),s=c(),l=Date.now(),d=Math.floor((l-$)/6e4)*6e4,f=t({groupBy:`credential`,since:d},e(6e4)),_=n.data??[],y=D(i.data?.health??[],e=>e.credentialId),b=_.filter(e=>j(y.get(e.id)??[],l,e.enabled,e.disabledReason).state===`down`),x=n.isLoading||o.isLoading?`Reading the gateway…`:_.length===0?`No accounts are connected, so every request fails at the router.`:b.length>0?`${b.length} account${b.length===1?` is`:`s are`} out of rotation.`:`All ${_.length} accounts are answering. Nothing needs attention.`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(T,{legend:`Rack`,title:`Gateway`,summary:x}),o.isError?(0,q.jsx)(z,{legend:`Traffic`,children:(0,q.jsx)(B,{legend:`The gateway did not answer`,error:o.error,onRetry:()=>void o.refetch()})}):(0,q.jsxs)(r,{$gap:4,children:[(0,q.jsx)(me,{logs:o.data??[],windowMs:$,now:l}),(0,q.jsx)(Z,{credentials:_,health:i.data?.health??[],quota:i.data?.quota??[],usage:f.data??[],quotaPollIntervalMs:s.data?.quotaPollIntervalMs??3e5,now:l}),(0,q.jsxs)(p,{$min:`340px`,$gap:4,children:[(0,q.jsx)(fe,{models:a.data??[],logs:o.data??[]}),(0,q.jsx)(se,{logs:o.data??[]})]})]})]})}var ge=he;export{ge as component};
|