omnigateway 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -33
- package/bin/omni.js +917 -161
- package/gateway.js +3247 -300
- package/package.json +1 -1
- package/public/assets/{Chip-C69u2U_b.js → Chip-BB_5C1Zp.js} +1 -1
- package/public/assets/Confirm-B6aAiVbT.js +4 -0
- package/public/assets/{CopyValue-CJy2T0H6.js → CopyValue-CRQDLo7k.js} +4 -4
- package/public/assets/{Field-Sc8mDqJv.js → Field-uHZxl4fI.js} +8 -8
- package/public/assets/Lamp-B-5SjXbG.js +25 -0
- package/public/assets/{Meter-C0nUftAa.js → Meter-DI_BRUKt.js} +1 -1
- package/public/assets/Modal-CI6jk2D4.js +82 -0
- package/public/assets/{Rack-CMqGBP4I.js → Rack-D1WJswv3.js} +23 -19
- package/public/assets/{Readout-Dv2dZWtI.js → Readout-BocZ2HXP.js} +5 -5
- package/public/assets/{States-D55MhqMx.js → States-Bbiu5cHE.js} +10 -10
- package/public/assets/{Table-DBB3jdgi.js → Table-CdPWxYaz.js} +1 -1
- package/public/assets/Toggle-CiLC67Dw.js +39 -0
- package/public/assets/TokenBreakdown-B96iPBm9.js +28 -0
- package/public/assets/_app-BBOF6A0T.js +1 -0
- package/public/assets/_app.accounts-BNkhpvaB.js +54 -0
- package/public/assets/_app.console-Daz4aKhf.js +44 -0
- package/public/assets/_app.index-LO6d38oe.js +62 -0
- package/public/assets/{_app.keys-BX8k8COP.js → _app.keys-kBqLqoFf.js} +8 -8
- package/public/assets/_app.logs-_wYNS47N.js +32 -0
- package/public/assets/_app.models-Cjng8ohC.js +144 -0
- package/public/assets/_app.settings-a0FKyQAi.js +38 -0
- package/public/assets/{_app.usage-BRhEvwVr.js → _app.usage-D3KtgLrC.js} +32 -29
- package/public/assets/dist-C-IbPRiV.js +1 -0
- package/public/assets/index-PW6EvVh5.js +170 -0
- package/public/assets/{login-DaC-wVpI.js → login-CTvH_KAd.js} +8 -8
- package/public/assets/queries-D2o-X8Pj.js +144 -0
- package/public/assets/{trash-2--aH2iKg-.js → trash-2-BcZb-sCT.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/Lamp-7jD_9929.js +0 -25
- package/public/assets/Modal-CiVHSJmm.js +0 -82
- package/public/assets/Toggle-BoGjb5oi.js +0 -42
- package/public/assets/_app-p5Mz7sXD.js +0 -1
- package/public/assets/_app.accounts-B5wMO9TH.js +0 -51
- package/public/assets/_app.console-Bka7AkiL.js +0 -25
- package/public/assets/_app.index-MnQuadXb.js +0 -61
- package/public/assets/_app.logs-DD-sd4fn.js +0 -33
- package/public/assets/_app.models-CezFNL6y.js +0 -144
- package/public/assets/_app.settings-D1taAt8B.js +0 -16
- package/public/assets/index-vCuK1fRQ.js +0 -170
- package/public/assets/queries-2E6-CboE.js +0 -144
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
.${Et} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${q}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${W} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${G} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${W} .${W} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${G} .${G} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${q}] {
|
|
36
|
-
${Dt}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},en=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},tn=function(){u.useEffect(function(){return document.body.setAttribute(q,(en()+1).toString()),function(){var e=en()-1;e<=0?document.body.removeAttribute(q):document.body.setAttribute(q,e.toString())}},[])},nn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;tn();var a=u.useMemo(function(){return Zt(i)},[i]);return u.createElement(Qt,{styles:$t(a,!t,i,n?``:`!important`)})},rn=!1;if(typeof window<`u`)try{var an=Object.defineProperty({},"passive",{get:function(){return rn=!0,!0}});window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var J=rn?{passive:!1}:!1,on=function(e){return e.tagName===`TEXTAREA`},sn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!on(e)&&n[t]===`visible`)},cn=function(e){return sn(e,`overflowY`)},ln=function(e){return sn(e,`overflowX`)},un=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),pn(e,r)){var i=mn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},fn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pn=function(e,t){return e===`v`?cn(t):ln(t)},mn=function(e,t){return e===`v`?dn(t):fn(t)},hn=function(e,t){return e===`h`&&t===`rtl`?-1:1},gn=function(e,t,n,r,i){var a=hn(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=mn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&pn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},_n=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vn=function(e){return[e.deltaX,e.deltaY]},yn=function(e){return e&&`current`in e?e.current:e},bn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xn=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},Sn=0,Y=[];function Cn(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),i=u.useState(Sn++)[0],a=u.useState(qt)[0],o=u.useRef(e);u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Tt([e.lockRef.current],(e.shards||[]).map(yn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=_n(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=un(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=un(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return gn(h,t,e,h===`h`?s:c,!0)},[]),c=u.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?vn(n):_n(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&bn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(yn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=u.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:wn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=u.useCallback(function(e){n.current=_n(e),r.current=void 0},[]),f=u.useCallback(function(t){l(t.type,vn(t),t.target,s(t,e.lockRef.current))},[]),p=u.useCallback(function(t){l(t.type,_n(t),t.target,s(t,e.lockRef.current))},[]);u.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,d,J),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,d,J)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:xn(i)}):null,m?u.createElement(nn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Tn=Lt(Rt,Cn),En=u.forwardRef(function(e,t){return u.createElement(K,U({},e,{ref:t,sideCar:Tn}))});En.classNames=K.classNames;var Dn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,On=new WeakMap,kn={},An=0,jn=function(e){return e&&(e.host||jn(e.parentNode))},Mn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=jn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Nn=function(e,t,n,r){var i=Mn(t,Array.isArray(e)?e:[e]);kn[n]||(kn[n]=new WeakMap);var a=kn[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&On.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),An++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(On.has(e)||e.removeAttribute(r),On.delete(e)),i||e.removeAttribute(n)}),An--,An||(X=new WeakMap,X=new WeakMap,On=new WeakMap,kn={})}},Pn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Dn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Nn(r,i,n,`aria-hidden`)):function(){return null}},Fn=Object.defineProperty,Z=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),In=`Dialog`,[Ln,Rn]=ue(In),[zn,Q]=Ln(In),Bn=Z(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=u.useRef(null),c=u.useRef(null),[l,d]=Te({prop:r,defaultProp:i??!1,onChange:a,caller:In}),[f,p]=u.useState(0),[m,h]=u.useState(0);return(0,g.jsx)(zn,{scope:t,triggerRef:s,contentRef:c,contentId:I(),titleId:I(),descriptionId:I(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:l,onOpenChange:d,onOpenToggle:u.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})},`Dialog`),Vn=`DialogPortal`,[Hn,Un]=Ln(Vn,{forceMount:void 0}),Wn=Z(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Q(Vn,t);return(0,g.jsx)(Hn,{scope:t,forceMount:n,children:u.Children.map(r,e=>(0,g.jsx)(Me,{present:n||a.open,children:(0,g.jsx)(vt,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Gn=`DialogOverlay`,Kn=u.forwardRef(Z(function(e,t){let n=Un(Gn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q(Gn,e.__scopeDialog);return a.modal?(0,g.jsx)(Me,{present:r||a.open,children:(0,g.jsx)(Jn,{...i,ref:t})}):null},`DialogOverlay`)),qn=b(`DialogOverlay.RemoveScroll`),Jn=u.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(Gn,n),a=h(t,Xe());return(0,g.jsx)(En,{as:qn,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(O.div,{"data-state":ar(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),$=`DialogContent`,Yn=u.forwardRef(Z(function(e,t){let n=Un($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q($,e.__scopeDialog);return(0,g.jsx)(Me,{present:r||a.open,children:a.modal?(0,g.jsx)(Xn,{...i,ref:t}):(0,g.jsx)(Zn,{...i,ref:t})})},`DialogContent`)),Xn=u.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=u.useRef(null),i=h(t,n.contentRef,r);return u.useEffect(()=>{let e=r.current;if(e)return Pn(e)},[]),(0,g.jsx)(Qn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Zn=u.forwardRef(Z(function(e,t){let n=Q($,e.__scopeDialog),r=u.useRef(!1),i=u.useRef(!1);return(0,g.jsx)(Qn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Qn=u.forwardRef(Z(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Q($,n);return St(),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(ot,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,g.jsx)(Ye,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":ar(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),$n=`DialogTitle`,er=u.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q($n,n),{setTitleCount:a}=i;return M(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,g.jsx)(O.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),tr=`DialogDescription`,nr=u.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(tr,n),{setDescriptionCount:a}=i;return M(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,g.jsx)(O.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),rr=`DialogClose`,ir=u.forwardRef(Z(function(e,t){let{__scopeDialog:n,...r}=e,i=Q(rr,n);return(0,g.jsx)(O.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function ar(e){return e?`open`:`closed`}Z(ar,`getState`);var or=i(Kn)`
|
|
42
|
-
position: fixed;
|
|
43
|
-
inset: 0;
|
|
44
|
-
z-index: ${({theme:e})=>e.z.overlay};
|
|
45
|
-
background: oklch(0 0 0 / 0.5);
|
|
46
|
-
backdrop-filter: blur(2px);
|
|
47
|
-
`,sr=i(Yn)`
|
|
48
|
-
position: fixed;
|
|
49
|
-
z-index: ${({theme:e})=>e.z.dialog};
|
|
50
|
-
top: 50%;
|
|
51
|
-
left: 50%;
|
|
52
|
-
transform: translate(-50%, -50%);
|
|
53
|
-
width: min(${({$width:e})=>e}, calc(100vw - 32px));
|
|
54
|
-
max-height: calc(100vh - 64px);
|
|
55
|
-
display: flex;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
background: ${({theme:e})=>e.color.panel};
|
|
58
|
-
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
59
|
-
border-radius: ${({theme:e})=>e.radius.panel};
|
|
60
|
-
box-shadow: 0 12px 40px oklch(0 0 0 / 0.35);
|
|
61
|
-
`,cr=i.div`
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
65
|
-
padding: ${({theme:e})=>`${e.space(2)} ${e.space(2)} ${e.space(2)} ${e.space(3)}`};
|
|
66
|
-
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
67
|
-
background: ${({theme:e})=>e.color.panelSunk};
|
|
68
|
-
`,lr=i.div`
|
|
69
|
-
padding: ${({theme:e})=>e.space(3)};
|
|
70
|
-
overflow-y: auto;
|
|
71
|
-
`,ur=i.div`
|
|
72
|
-
display: flex;
|
|
73
|
-
justify-content: flex-end;
|
|
74
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
75
|
-
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
76
|
-
border-top: 1px solid ${({theme:e})=>e.color.rule};
|
|
77
|
-
background: ${({theme:e})=>e.color.panelSunk};
|
|
78
|
-
`,dr=i(nr)`
|
|
79
|
-
margin: 0 0 ${({theme:e})=>e.space(3)};
|
|
80
|
-
font-size: 12px;
|
|
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)(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};
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
font-size: 13px;
|
|
3
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
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
|
-
all: unset;
|
|
6
|
-
width: 30px;
|
|
7
|
-
height: 16px;
|
|
8
|
-
padding: 2px;
|
|
9
|
-
border-radius: 9px;
|
|
10
|
-
background: ${({theme:e})=>e.color.ruleStrong};
|
|
11
|
-
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
transition: background 140ms ease;
|
|
14
|
-
flex: none;
|
|
15
|
-
|
|
16
|
-
&[data-state="checked"] {
|
|
17
|
-
background: ${({theme:e})=>e.color.ok};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&:disabled {
|
|
21
|
-
opacity: 0.5;
|
|
22
|
-
cursor: not-allowed;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:focus-visible {
|
|
26
|
-
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
27
|
-
outline-offset: 2px;
|
|
28
|
-
}
|
|
29
|
-
`,z=t(j)`
|
|
30
|
-
display: block;
|
|
31
|
-
width: 12px;
|
|
32
|
-
height: 12px;
|
|
33
|
-
border-radius: 50%;
|
|
34
|
-
background: ${({theme:e})=>e.color.panel};
|
|
35
|
-
transition: transform 140ms ease;
|
|
36
|
-
transform: translateX(0);
|
|
37
|
-
will-change: transform;
|
|
38
|
-
|
|
39
|
-
&[data-state="checked"] {
|
|
40
|
-
transform: translateX(14px);
|
|
41
|
-
}
|
|
42
|
-
`;function B({checked:e,onCheckedChange:t,label:n,disabled:r,id:i}){return(0,v.jsx)(R,{checked:e,onCheckedChange:t,"aria-label":n,...r===void 0?{}:{disabled:r},...i===void 0?{}:{id:i},children:(0,v.jsx)(z,{})})}export{L as n,p as r,B as t};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1,51 +0,0 @@
|
|
|
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};
|
|
@@ -1,25 +0,0 @@
|
|
|
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};
|
|
@@ -1,61 +0,0 @@
|
|
|
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};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{A as e,I as t,L as n,Mt as r,N as i,P as ee,W as a,Xt as o,_ as s,j as c,jt as l,m as u,n as d,u as f,z as p}from"./queries-2E6-CboE.js";import{a as m,c as h,f as g,l as _,m as v,o as te,p as y,s as b,t as x}from"./Rack-CMqGBP4I.js";import{t as ne}from"./Modal-CiVHSJmm.js";import{c as re,l as S,o as C,s as w,t as T}from"./Lamp-7jD_9929.js";import{n as E,t as D}from"./Chip-C69u2U_b.js";import{i as O,n as k}from"./Field-Sc8mDqJv.js";import{a as ie,n as ae,r as oe,t as se}from"./States-D55MhqMx.js";import{i as ce,n as A,r as j,t as M}from"./Table-DBB3jdgi.js";var N=v(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),P=v(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),F=v(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),I=o(r(),1),L=l(),R=[50,100,250,500],z=new Intl.NumberFormat(`en-US`);function B(e){return`${z.format(e.inputTokens)} input, ${z.format(e.outputTokens)} output, ${z.format(e.cacheReadTokens)} cache read, ${z.format(e.cacheWriteTokens)} cache write tokens`}var V=a(i)`
|
|
2
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
3
|
-
flex-wrap: wrap;
|
|
4
|
-
`,H=a(k)`
|
|
5
|
-
width: 220px;
|
|
6
|
-
`,U=a(O)`
|
|
7
|
-
width: auto;
|
|
8
|
-
`,W=a.span`
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 6px;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,G=a.span`
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
gap: 2px;
|
|
17
|
-
|
|
18
|
-
svg {
|
|
19
|
-
width: 12px;
|
|
20
|
-
height: 12px;
|
|
21
|
-
stroke-width: 1.75;
|
|
22
|
-
}
|
|
23
|
-
`;function le(e){let[t,n]=(0,I.useState)(Date.now);return(0,I.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function K({log:e}){if(w(e))return(0,L.jsx)(A,{$align:`right`,$mono:!0,children:`—`});let t=B(e);return(0,L.jsx)(A,{$align:`right`,$mono:!0,"aria-label":t,title:t,children:(0,L.jsxs)(W,{"aria-hidden":`true`,children:[(0,L.jsxs)(G,{children:[(0,L.jsx)(N,{}),b(e.inputTokens)]}),(0,L.jsxs)(G,{children:[(0,L.jsx)(P,{}),b(e.outputTokens)]}),(0,L.jsxs)(G,{children:[(0,L.jsx)(F,{}),(0,L.jsx)(N,{}),b(e.cacheReadTokens)]}),(0,L.jsxs)(G,{children:[(0,L.jsx)(F,{}),(0,L.jsx)(P,{}),b(e.cacheWriteTokens)]})]})})}var ue=a.dl`
|
|
24
|
-
display: grid;
|
|
25
|
-
grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
|
|
26
|
-
gap: 6px ${({theme:e})=>e.space(3)};
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-size: 12.5px;
|
|
29
|
-
`,q=a.dd`
|
|
30
|
-
margin: 0;
|
|
31
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
32
|
-
word-break: break-all;
|
|
33
|
-
`;function J(){let{cadence:r,live:a}=m(),[o,l]=(0,I.useState)(100),[v,O]=(0,I.useState)(`all`),[k,N]=(0,I.useState)(``),[P,F]=(0,I.useState)(null),z=s(o,r(d)),B=f(),W=u(),G=(z.data??[]).some(w),J=le(a&&G),Y=(0,I.useMemo)(()=>{let e=new Map;for(let t of B.data??[])e.set(t.id,t.label);return e},[B.data]),X=(0,I.useMemo)(()=>{let e=new Map;for(let t of W.data??[])e.set(t.id,t.label);return e},[W.data]),Z=k.trim().toLowerCase(),Q=(z.data??[]).filter(e=>v===`failed`&&!C(e)?!1:Z.length===0||e.requestedModel.toLowerCase().includes(Z)||(e.resolvedModel??``).toLowerCase().includes(Z)||(e.errorCode??``).toLowerCase().includes(Z)||(e.credentialId===null?``:Y.get(e.credentialId)??``).toLowerCase().includes(Z)||(e.apiKeyId===null?``:X.get(e.apiKeyId)??e.apiKeyId).toLowerCase().includes(Z)),de=(z.data??[]).filter(C).length,$=(z.data??[]).filter(w).length;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(x,{legend:`Logs`,title:`Recent requests`,summary:z.isLoading?`Reading the request log…`:`${b(z.data?.length??0)} recent requests, ${b(de)} of them failed${$===0?``:`, ${b($)} still running`}. Prompt and response bodies are never recorded.`,actions:(0,L.jsxs)(V,{children:[(0,L.jsx)(H,{value:k,placeholder:`Filter by model, account, key, or error`,"aria-label":`Filter requests`,onChange:e=>N(e.target.value)}),(0,L.jsxs)(U,{value:v,"aria-label":`Show which requests`,onChange:e=>O(e.target.value),children:[(0,L.jsx)(`option`,{value:`all`,children:`All requests`}),(0,L.jsx)(`option`,{value:`failed`,children:`Failed only`})]}),(0,L.jsx)(U,{value:o,"aria-label":`How many requests to fetch`,onChange:e=>l(Number(e.target.value)),children:R.map(e=>(0,L.jsxs)(`option`,{value:e,children:[`last `,e]},e))})]})}),(0,L.jsx)(ie,{legend:`Request log`,meta:`${Q.length} shown`,flush:!0,children:z.isError?(0,L.jsx)(ae,{error:z.error,onRetry:()=>void z.refetch()}):z.isLoading?(0,L.jsx)(`div`,{style:{padding:12},children:(0,L.jsx)(oe,{rows:8})}):Q.length===0?(0,L.jsx)(se,{legend:`Nothing to show`,message:(z.data?.length??0)===0?`No requests have reached the gateway yet.`:`No request in this window matches the filter. Clear it to see everything.`}):(0,L.jsx)(ee,{children:(0,L.jsxs)(M,{children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(j,{}),(0,L.jsx)(j,{$align:`right`,children:`Time`}),(0,L.jsx)(j,{children:`Requested`}),(0,L.jsx)(j,{children:`Routed to`}),(0,L.jsx)(j,{children:`Account`}),(0,L.jsx)(j,{children:`Key`}),(0,L.jsx)(j,{$align:`right`,children:`Try`}),(0,L.jsx)(j,{$align:`right`,children:`TTFT`}),(0,L.jsx)(j,{$align:`right`,children:`Total`}),(0,L.jsx)(j,{$align:`right`,children:`Tokens`}),(0,L.jsx)(j,{$align:`right`,children:`Cost`}),(0,L.jsx)(j,{children:`Outcome`})]})}),(0,L.jsx)(`tbody`,{children:Q.map(t=>(0,L.jsxs)(ce,{$selectable:!0,onClick:()=>F(t),children:[(0,L.jsx)(A,{children:(0,L.jsx)(T,{state:S(t),label:re(t)})}),(0,L.jsx)(A,{$align:`right`,$mono:!0,title:h(t.at),children:te(t.at)}),(0,L.jsx)(A,{$mono:!0,children:(0,L.jsx)(n,{style:{display:`block`,maxWidth:`20ch`},children:t.requestedModel||`—`})}),(0,L.jsx)(A,{children:t.resolvedProvider===null?(0,L.jsx)(e,{children:w(t)?`routing…`:`not routed`}):(0,L.jsxs)(i,{$gap:1,children:[(0,L.jsx)(E,{provider:t.resolvedProvider}),(0,L.jsx)(c,{$dim:!0,children:t.resolvedModel??`—`})]})}),(0,L.jsx)(A,{children:(0,L.jsx)(n,{style:{display:`block`,maxWidth:`18ch`},children:t.credentialId===null?`—`:Y.get(t.credentialId)??y(t.credentialId)})}),(0,L.jsx)(A,{children:(0,L.jsx)(n,{style:{display:`block`,maxWidth:`16ch`},title:t.apiKeyId??void 0,children:t.apiKeyId===null?`—`:X.get(t.apiKeyId)??y(t.apiKeyId)})}),(0,L.jsx)(A,{$align:`right`,$mono:!0,children:w(t)?`—`:t.attempts}),(0,L.jsx)(A,{$align:`right`,$mono:!0,children:w(t)?`—`:_(t.ttftMs)}),(0,L.jsx)(A,{$align:`right`,$mono:!0,children:_(w(t)?Math.max(0,J-t.at):t.durationMs)}),(0,L.jsx)(K,{log:t}),(0,L.jsx)(A,{$align:`right`,$mono:!0,children:w(t)?`—`:g(t.costUsd)}),(0,L.jsx)(A,{children:w(t)?(0,L.jsx)(D,{$tone:`accent`,children:`live`}):t.errorCode===null?(0,L.jsx)(D,{$tone:`ok`,children:t.status}):(0,L.jsx)(D,{$tone:`down`,children:t.errorCode})})]},t.id))})]})})}),(0,L.jsx)(ne,{open:P!==null,onOpenChange:e=>{e||F(null)},title:`Request detail`,width:`600px`,footer:(0,L.jsx)(p,{type:`button`,onClick:()=>F(null),children:`Close`}),children:P===null?null:(0,L.jsxs)(t,{$gap:3,children:[(0,L.jsxs)(ue,{children:[(0,L.jsx)(e,{as:`dt`,children:`Request id`}),(0,L.jsx)(q,{children:P.id}),(0,L.jsx)(e,{as:`dt`,children:`At`}),(0,L.jsx)(q,{children:h(P.at)}),(0,L.jsx)(e,{as:`dt`,children:`Requested model`}),(0,L.jsx)(q,{children:P.requestedModel||`—`}),(0,L.jsx)(e,{as:`dt`,children:`Routed to`}),(0,L.jsx)(q,{children:w(P)?`—`:P.resolvedProvider===null?`not routed`:`${P.resolvedProvider} · ${P.resolvedModel??`—`}`}),(0,L.jsx)(e,{as:`dt`,children:`Account`}),(0,L.jsx)(q,{children:P.credentialId===null?`—`:Y.get(P.credentialId)??P.credentialId}),(0,L.jsx)(e,{as:`dt`,children:`Key`}),(0,L.jsx)(q,{children:P.apiKeyId===null?`—`:X.get(P.apiKeyId)??P.apiKeyId}),(0,L.jsx)(e,{as:`dt`,children:`Attempts`}),(0,L.jsx)(q,{children:w(P)?`—`:P.attempts}),(0,L.jsx)(e,{as:`dt`,children:`Status`}),(0,L.jsx)(q,{children:w(P)?`in flight`:P.errorCode===null?P.status:`${P.status} ${P.errorCode}`}),(0,L.jsx)(e,{as:`dt`,children:`Timing`}),(0,L.jsx)(q,{children:w(P)?`—`:`first token ${_(P.ttftMs)} · total ${_(P.durationMs)}`}),(0,L.jsx)(e,{as:`dt`,children:`Tokens`}),(0,L.jsx)(q,{children:w(P)?`—`:(0,L.jsxs)(L.Fragment,{children:[b(P.inputTokens),` in · `,b(P.outputTokens),` out ·`,` `,b(P.cacheReadTokens),` cache read ·`,` `,b(P.cacheWriteTokens),` cache write`]})}),(0,L.jsx)(e,{as:`dt`,children:`Cost`}),(0,L.jsx)(q,{children:w(P)?`—`:g(P.costUsd)})]}),P.degradations.length===0?null:(0,L.jsxs)(t,{$gap:1,children:[(0,L.jsx)(e,{children:`Capabilities dropped to fit the target`}),(0,L.jsx)(i,{$gap:1,$wrap:!0,children:P.degradations.map(e=>(0,L.jsx)(D,{$tone:`warn`,children:e},e))})]})]})})]})}var Y=J;export{Y as component};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import{A as e,B as t,F as n,I as r,L as i,Mt as a,N as o,S as s,W as c,Xt as l,b as u,f as d,j as f,jt as p,p as m,v as h,z as g}from"./queries-2E6-CboE.js";import{m as _,t as v}from"./Rack-CMqGBP4I.js";import{n as y,r as b,t as x}from"./Toggle-BoGjb5oi.js";import{t as S}from"./trash-2--aH2iKg-.js";import{n as C,t as w}from"./Chip-C69u2U_b.js";import{i as T,n as E,r as D,t as O}from"./Field-Sc8mDqJv.js";import{t as ee}from"./Meter-C0nUftAa.js";import{a as k,i as A,n as te,r as j,t as M}from"./States-D55MhqMx.js";import{n as ne,r as re,t as N}from"./catalog-C_OQ0icG.js";var P=_(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ie=_(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),F=l(a(),1),I=p(),L=[`tier`,`health`,`quota`,`cost`,`latency`,`recency`],ae={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price against the other candidates`,latency:`Observed time to first token`,recency:`How long this pair has been idle`},oe=c.li`
|
|
2
|
-
padding: ${({theme:e})=>e.space(2)} 0;
|
|
3
|
-
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
4
|
-
|
|
5
|
-
&:last-child {
|
|
6
|
-
border-bottom: 0;
|
|
7
|
-
}
|
|
8
|
-
`,se=c(f)`
|
|
9
|
-
width: 22px;
|
|
10
|
-
color: ${({theme:e})=>e.color.inkFaint};
|
|
11
|
-
flex: none;
|
|
12
|
-
`,ce=c(w)`
|
|
13
|
-
border-color: ${({theme:e})=>e.color.ok};
|
|
14
|
-
color: ${({theme:e})=>e.color.ok};
|
|
15
|
-
background: ${({theme:e})=>e.color.okWash};
|
|
16
|
-
`,le=c.div`
|
|
17
|
-
display: grid;
|
|
18
|
-
grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
|
|
19
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
20
|
-
margin-top: ${({theme:e})=>e.space(2)};
|
|
21
|
-
padding-left: 30px;
|
|
22
|
-
`,ue=c.div`
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
gap: 3px;
|
|
26
|
-
min-width: 0;
|
|
27
|
-
`,de=c.div`
|
|
28
|
-
display: flex;
|
|
29
|
-
align-items: baseline;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
gap: 6px;
|
|
32
|
-
`,fe=c.li`
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
36
|
-
padding: 5px 0;
|
|
37
|
-
`,pe=c(o)`
|
|
38
|
-
gap: ${({theme:e})=>e.space(3)};
|
|
39
|
-
flex-wrap: wrap;
|
|
40
|
-
`,R=c.label`
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
gap: 6px;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
font-size: 12.5px;
|
|
46
|
-
`,z=c.p`
|
|
47
|
-
font-size: 12px;
|
|
48
|
-
color: ${({theme:e})=>e.color.down};
|
|
49
|
-
`;function B(e,t,n){return(e[t]??0)*n[t]}function me({modelId:t}){let[a,c]=(0,F.useState)({tools:!1,images:!1,reasoning:!1}),[l,u]=(0,F.useState)(null),[d,p]=(0,F.useState)(null),h=s(),_=m(),v=h.data?.weights,y=()=>{t!==null&&(p(null),_.mutate({modelId:t,need:a},{onSuccess:e=>u(e),onError:e=>{u(null),p(A(e))}}))},b=new Map(L.map(e=>[e,Math.max(1e-4,...(l?.candidates??[]).map(t=>v===void 0?0:Math.abs(B(t.reasons,e,v))))]));return(0,I.jsx)(k,{legend:`Explain`,meta:t??`no model selected`,actions:(0,I.jsxs)(g,{type:`button`,$size:`sm`,$variant:`primary`,disabled:t===null||_.isPending,onClick:y,children:[(0,I.jsx)(P,{}),_.isPending?`Ranking…`:`Rank candidates`]}),children:(0,I.jsxs)(r,{$gap:3,children:[(0,I.jsxs)(r,{$gap:1,children:[(0,I.jsx)(e,{children:`Pretend the request needs`}),(0,I.jsxs)(pe,{children:[(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:a.tools,label:`Probe request uses tools`,onCheckedChange:e=>c({...a,tools:e})}),`Tools`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:a.images,label:`Probe request includes an image`,onCheckedChange:e=>c({...a,images:e})}),`Images`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:a.reasoning,label:`Probe request asks for reasoning`,onCheckedChange:e=>c({...a,reasoning:e})}),`Reasoning`]})]})]}),d===null?null:(0,I.jsx)(z,{children:d}),l===null?(0,I.jsx)(M,{legend:`Not ranked yet`,message:t===null?`Select a model to see which account the router would pick for it.`:`Run the ranking to see which account wins, by how much, and what was filtered out.`}):(0,I.jsxs)(r,{$gap:3,children:[(0,I.jsxs)(o,{$gap:2,$wrap:!0,children:[(0,I.jsx)(w,{$tone:`accent`,children:l.strategy}),l.deterministic?null:(0,I.jsx)(w,{$tone:`warn`,children:`order varies per request`}),(0,I.jsx)(n,{}),(0,I.jsxs)(e,{children:[l.candidates.length,` eligible · `,l.excluded.length,` filtered out`]})]}),l.candidates.length===0?(0,I.jsx)(M,{legend:`Nothing eligible`,message:`Every target was filtered out. The reasons below say which rule removed each one.`}):(0,I.jsx)(`ul`,{children:l.candidates.map((t,r)=>(0,I.jsxs)(oe,{children:[(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsx)(se,{children:r+1}),(0,I.jsx)(C,{provider:t.provider}),(0,I.jsx)(i,{style:{maxWidth:`22ch`},children:t.credentialLabel}),(0,I.jsx)(f,{$dim:!0,children:t.model}),(0,I.jsxs)(w,{children:[`tier `,t.tier]}),(0,I.jsx)(n,{}),r===0?(0,I.jsx)(ce,{children:`would be used`}):null,(0,I.jsx)(f,{children:t.score.toFixed(2)})]}),v===void 0?null:(0,I.jsx)(le,{children:L.map(n=>{let r=B(t.reasons,n,v),i=b.get(n)??1;return(0,I.jsxs)(ue,{title:ae[n],children:[(0,I.jsxs)(de,{children:[(0,I.jsx)(e,{children:n}),(0,I.jsx)(f,{$dim:!0,$size:`10.5px`,children:r.toFixed(2)})]}),(0,I.jsx)(ee,{fraction:Math.abs(r)/i,height:4,tone:`var(--accent)`,label:`${n} contributes ${r.toFixed(2)} of ${t.score.toFixed(2)}`})]},n)})})]},`${t.credentialId}:${t.model}`))}),l.excluded.length===0?null:(0,I.jsxs)(r,{$gap:1,children:[(0,I.jsx)(e,{children:`Filtered out`}),(0,I.jsx)(`ul`,{children:l.excluded.map(e=>(0,I.jsxs)(fe,{children:[(0,I.jsx)(f,{$dim:!0,children:e.model}),(0,I.jsx)(n,{}),(0,I.jsx)(w,{$tone:e.reason.startsWith(`capability`)?`warn`:`down`,children:e.reason})]},`${e.credentialId}:${e.model}:${e.reason}`))})]})]})]})})}var V=[{id:`score`,label:`Best score`,blurb:`Rank every eligible target by the routing weights and take the best one.`},{id:`priority`,label:`Lowest tier`,blurb:`Always prefer the lowest tier. Score only breaks ties inside a tier.`},{id:`roundRobin`,label:`Round robin`,blurb:`Take whichever eligible target has been idle longest, to spread load evenly.`},{id:`weighted`,label:`Weighted draw`,blurb:`Pick at random, biased by weight. The order differs from request to request.`}],H=0;function U(){return H+=1,`target-${H}`}function W(e,t){let n=re(e,t);return n===null?null:{costInput:String(n.input),costOutput:String(n.output),costCacheRead:String(n.cacheRead),costCacheWrite5m:String(n.cacheWrite5m),costCacheWrite1h:String(n.cacheWrite1h)}}function he(e,t){let n=ne(e,t);return n===null?null:{contextWindow:String(n.contextWindow),maxOutputTokens:String(n.maxOutputTokens)}}function ge(e,t){return{...e,...t,...W(t.provider,t.model)??{},contextWindow:``,maxOutputTokens:``}}function G(e=`anthropic`){let t=N[e].defaultModel,n=W(e,t);return{key:U(),provider:e,model:t,tier:`1`,weight:`1`,costInput:n?.costInput??`0`,costOutput:n?.costOutput??`0`,costCacheRead:n?.costCacheRead??``,costCacheWrite5m:n?.costCacheWrite5m??``,costCacheWrite1h:n?.costCacheWrite1h??``,contextWindow:``,maxOutputTokens:``,tools:!0,images:!0,reasoning:!0}}function K(){return{id:``,strategy:`score`,isAlias:!1,targets:[G()]}}function q(e){return{id:e.id,strategy:e.strategy,isAlias:e.isAlias,targets:e.targets.map(e=>({key:U(),provider:e.provider,model:e.model,tier:String(e.tier),weight:String(e.weight),costInput:String(e.costPerMTok.input),costOutput:String(e.costPerMTok.output),costCacheRead:e.costPerMTok.cacheRead===void 0?``:String(e.costPerMTok.cacheRead),costCacheWrite5m:e.costPerMTok.cacheWrite5m===void 0?``:String(e.costPerMTok.cacheWrite5m),costCacheWrite1h:e.costPerMTok.cacheWrite1h===void 0?``:String(e.costPerMTok.cacheWrite1h),contextWindow:e.contextWindow===void 0?``:String(e.contextWindow),maxOutputTokens:e.maxOutputTokens===void 0?``:String(e.maxOutputTokens),tools:e.capabilities.tools,images:e.capabilities.images,reasoning:e.capabilities.reasoning}))}}function _e(e){let t=e.id.trim();if(t.length===0)return{ok:!1,problem:`Give the model a name clients will ask for.`};if(e.targets.length===0)return{ok:!1,problem:`A model needs at least one target to route to.`};let n=[];for(let[t,r]of e.targets.entries()){let e=`Target ${t+1}`,i=r.model.trim();if(i.length===0)return{ok:!1,problem:`${e} needs a provider model name.`};let a=Number(r.tier);if(!Number.isInteger(a)||a<1)return{ok:!1,problem:`${e}: tier must be a whole number of 1 or more.`};let o=Number(r.weight);if(!Number.isFinite(o)||o<=0)return{ok:!1,problem:`${e}: weight must be greater than zero.`};let s=Number(r.costInput),c=Number(r.costOutput);if(!Number.isFinite(s)||s<0||!Number.isFinite(c)||c<0)return{ok:!1,problem:`${e}: prices cannot be negative.`};let l=r.costCacheRead.trim().length>0,u=Number(r.costCacheRead);if(l&&(!Number.isFinite(u)||u<0))return{ok:!1,problem:`${e}: the cache-read price cannot be negative.`};let d=r.costCacheWrite5m.trim().length>0,f=Number(r.costCacheWrite5m);if(d&&(!Number.isFinite(f)||f<0))return{ok:!1,problem:`${e}: the 5m cache-write price must be a number of 0 or more.`};let p=r.costCacheWrite1h.trim().length>0,m=Number(r.costCacheWrite1h);if(p&&(!Number.isFinite(m)||m<0))return{ok:!1,problem:`${e}: the 1h cache-write price must be a number of 0 or more.`};let h=r.contextWindow.trim().length>0,g=Number(r.contextWindow);if(h&&(!Number.isInteger(g)||g<1))return{ok:!1,problem:`${e}: the context window must be a whole number of tokens.`};let _=r.maxOutputTokens.trim().length>0,v=Number(r.maxOutputTokens);if(_&&(!Number.isInteger(v)||v<1))return{ok:!1,problem:`${e}: the output limit must be a whole number of tokens.`};n.push({provider:r.provider,model:i,tier:a,weight:o,costPerMTok:{input:s,output:c,...l?{cacheRead:u}:{},...d?{cacheWrite5m:f}:{},...p?{cacheWrite1h:m}:{}},...h?{contextWindow:g}:{},..._?{maxOutputTokens:v}:{},capabilities:{tools:r.tools,images:r.images,reasoning:r.reasoning}})}return{ok:!0,model:{id:t,strategy:e.strategy,isAlias:e.isAlias,targets:n}}}var ve=Object.keys(N),ye=c.fieldset`
|
|
50
|
-
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
51
|
-
border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
|
|
52
|
-
border-radius: ${({theme:e})=>e.radius.control};
|
|
53
|
-
padding: ${({theme:e})=>e.space(3)};
|
|
54
|
-
margin: 0;
|
|
55
|
-
background: ${({theme:e})=>e.color.panelSunk};
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-direction: column;
|
|
58
|
-
gap: ${({theme:e})=>e.space(3)};
|
|
59
|
-
min-width: 0;
|
|
60
|
-
`,be=c.div`
|
|
61
|
-
display: grid;
|
|
62
|
-
grid-template-columns: minmax(140px, 1.4fr) minmax(160px, 2fr) 72px 72px;
|
|
63
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
64
|
-
align-items: end;
|
|
65
|
-
|
|
66
|
-
@media (max-width: 720px) {
|
|
67
|
-
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
68
|
-
}
|
|
69
|
-
`,J=c.div`
|
|
70
|
-
display: grid;
|
|
71
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
72
|
-
gap: ${({theme:e})=>e.space(2)};
|
|
73
|
-
align-items: end;
|
|
74
|
-
`,Y=c.div`
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
gap: 4px;
|
|
78
|
-
min-width: 0;
|
|
79
|
-
`,xe=c(o)`
|
|
80
|
-
gap: ${({theme:e})=>e.space(3)};
|
|
81
|
-
flex-wrap: wrap;
|
|
82
|
-
`,X=c.label`
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
gap: 6px;
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
`;function Se({target:i,index:a,onChange:s,onRemove:c,removable:l}){let u=(0,F.useId)(),d=N[i.provider],f=(e,t)=>{s({...i,[e]:t})},p=W(i.provider,i.model),m=he(i.provider,i.model),h=e=>{s(ge(i,e))};return(0,I.jsxs)(ye,{$provider:i.provider,children:[(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsxs)(e,{as:`legend`,children:[`Target `,a+1]}),(0,I.jsx)(n,{}),(0,I.jsx)(t,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:!l,"aria-label":`Remove target ${a+1}`,title:l?`Remove target ${a+1}`:`A model needs at least one target`,onClick:c,children:(0,I.jsx)(S,{})})]}),(0,I.jsxs)(be,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-provider`,children:`Provider`}),(0,I.jsx)(T,{id:`${u}-provider`,value:i.provider,onChange:e=>{let t=e.target.value,n=N[t].models.some(e=>e.id===i.model);h({provider:t,model:n?i.model:N[t].defaultModel})},children:ve.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-model`,children:`Provider model`}),(0,I.jsx)(E,{id:`${u}-model`,list:`${u}-catalog`,value:i.model,placeholder:d.defaultModel,onChange:e=>h({provider:i.provider,model:e.target.value})}),(0,I.jsx)(`datalist`,{id:`${u}-catalog`,children:d.models.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-tier`,children:`Tier`}),(0,I.jsx)(D,{id:`${u}-tier`,min:1,step:1,value:i.tier,onChange:e=>f(`tier`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-weight`,children:`Weight`}),(0,I.jsx)(D,{id:`${u}-weight`,min:0,step:.1,value:i.weight,onChange:e=>f(`weight`,e.target.value)})]})]}),(0,I.jsxs)(r,{$gap:1,children:[(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsx)(e,{children:`Price per million tokens`}),(0,I.jsx)(n,{}),p===null?(0,I.jsx)(e,{as:`span`,children:`not in the catalog — price it yourself`}):(0,I.jsxs)(g,{type:`button`,$size:`sm`,$variant:`ghost`,disabled:i.costInput===p.costInput&&i.costOutput===p.costOutput&&i.costCacheRead===p.costCacheRead&&i.costCacheWrite5m===p.costCacheWrite5m&&i.costCacheWrite1h===p.costCacheWrite1h,onClick:()=>s({...i,...p}),children:[(0,I.jsx)(ie,{}),`Use list price`]})]}),(0,I.jsxs)(J,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-in`,children:`Input`}),(0,I.jsx)(D,{id:`${u}-in`,min:0,step:.01,value:i.costInput,onChange:e=>f(`costInput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-out`,children:`Output`}),(0,I.jsx)(D,{id:`${u}-out`,min:0,step:.01,value:i.costOutput,onChange:e=>f(`costOutput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-cache`,children:`Cache read`}),(0,I.jsx)(D,{id:`${u}-cache`,min:0,step:.01,placeholder:`same as input`,value:i.costCacheRead,onChange:e=>f(`costCacheRead`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-write5m`,children:`Cache write 5m`}),(0,I.jsx)(D,{id:`${u}-write5m`,min:0,step:.01,placeholder:`1.25x input`,value:i.costCacheWrite5m,onChange:e=>f(`costCacheWrite5m`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-write1h`,children:`Cache write 1h`}),(0,I.jsx)(D,{id:`${u}-write1h`,min:0,step:.01,placeholder:`2x input`,value:i.costCacheWrite1h,onChange:e=>f(`costCacheWrite1h`,e.target.value)})]})]})]}),(0,I.jsxs)(r,{$gap:1,children:[(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsx)(e,{children:`Token limits`}),(0,I.jsx)(n,{}),m===null?(0,I.jsx)(e,{as:`span`,children:`not in the catalog — state them yourself`}):(0,I.jsx)(e,{as:`span`,children:`left empty, the published figures are used — and for an OpenAI target, the narrower ones its OAuth backend allows`})]}),(0,I.jsxs)(J,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-context`,children:`Context window`}),(0,I.jsx)(D,{id:`${u}-context`,min:1,step:1024,placeholder:m?.contextWindow??`published`,value:i.contextWindow,onChange:e=>f(`contextWindow`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(e,{as:`label`,htmlFor:`${u}-maxout`,children:`Max output`}),(0,I.jsx)(D,{id:`${u}-maxout`,min:1,step:1024,placeholder:m?.maxOutputTokens??`published`,value:i.maxOutputTokens,onChange:e=>f(`maxOutputTokens`,e.target.value)})]})]})]}),(0,I.jsxs)(r,{$gap:1,children:[(0,I.jsx)(e,{children:`Capabilities`}),(0,I.jsxs)(xe,{children:[(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:i.tools,label:`Target ${a+1} supports tools`,onCheckedChange:e=>f(`tools`,e)}),`Tools`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:i.images,label:`Target ${a+1} supports images`,onCheckedChange:e=>f(`images`,e)}),`Images`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:i.reasoning,label:`Target ${a+1} supports reasoning`,onCheckedChange:e=>f(`reasoning`,e)}),`Reasoning`]})]})]})]})}var Z=c.p`
|
|
88
|
-
font-size: 11.5px;
|
|
89
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
90
|
-
`,Ce=c.p`
|
|
91
|
-
font-size: 12px;
|
|
92
|
-
color: ${({theme:e})=>e.color.down};
|
|
93
|
-
`,we=c.p`
|
|
94
|
-
font-size: 12px;
|
|
95
|
-
color: ${({theme:e})=>e.color.ok};
|
|
96
|
-
`,Te=c(o)`
|
|
97
|
-
gap: 8px;
|
|
98
|
-
`;function Ee({model:t,onSaved:i,onDeleted:a}){let[s,c]=(0,F.useState)(()=>t===null?K():q(t)),[l,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(!1),[h,_]=(0,F.useState)(!1),v=u(),S=d(),C=t?.id??null;(0,F.useEffect)(()=>{c(t===null?K():q(t)),f(null),m(!1)},[C]);let w=V.find(e=>e.id===s.strategy);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{legend:t===null?`New model`:`Edit model`,meta:t===null?void 0:t.id,actions:(0,I.jsxs)(I.Fragment,{children:[t===null?null:(0,I.jsx)(g,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>_(!0),children:`Delete`}),(0,I.jsx)(g,{type:`button`,$variant:`primary`,$size:`sm`,disabled:v.isPending,onClick:()=>{m(!1);let e=_e(s);if(!e.ok){f(e.problem);return}f(null),v.mutate(e.model,{onSuccess:()=>{m(!0),i(e.model.id)},onError:e=>f(A(e))})},children:v.isPending?`Saving…`:t===null?`Create model`:`Save changes`})]}),children:(0,I.jsxs)(r,{$gap:3,children:[(0,I.jsx)(O,{label:`Model name`,hint:t===null?`What clients send as the model. Anything not listed here is rejected.`:`Fixed once created. To rename, create a model under the new name and delete this one.`,children:e=>(0,I.jsx)(E,{...e,value:s.id,disabled:t!==null,placeholder:`fast`,onChange:e=>c({...s,id:e.target.value})})}),(0,I.jsx)(O,{label:`Routing strategy`,children:e=>(0,I.jsx)(T,{...e,value:s.strategy,onChange:e=>c({...s,strategy:e.target.value}),children:V.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})}),w===void 0?null:(0,I.jsx)(Z,{children:w.blurb}),(0,I.jsxs)(Te,{children:[(0,I.jsx)(x,{checked:s.isAlias,label:`This model is an alias for a provider model name`,onCheckedChange:e=>c({...s,isAlias:e})}),(0,I.jsxs)(r,{$gap:0,children:[(0,I.jsx)(e,{as:`span`,children:`Alias`}),(0,I.jsx)(Z,{children:`Mark this when the name mirrors a provider's own model name.`})]})]}),(0,I.jsxs)(r,{$gap:2,children:[(0,I.jsxs)(o,{children:[(0,I.jsx)(e,{children:`Targets`}),(0,I.jsx)(n,{}),(0,I.jsxs)(g,{type:`button`,$size:`sm`,onClick:()=>c({...s,targets:[...s.targets,G(s.targets.at(-1)?.provider??`anthropic`)]}),children:[(0,I.jsx)(b,{}),`Add target`]})]}),s.targets.map((e,t)=>(0,I.jsx)(Se,{target:e,index:t,removable:s.targets.length>1,onChange:t=>c({...s,targets:s.targets.map(n=>n.key===e.key?t:n)}),onRemove:()=>c({...s,targets:s.targets.filter(t=>t.key!==e.key)})},e.key))]}),l===null?null:(0,I.jsx)(Ce,{role:`alert`,children:l}),p&&l===null?(0,I.jsx)(we,{role:`status`,children:`Saved.`}):null]})}),(0,I.jsx)(y,{open:h,onOpenChange:_,title:`Delete model`,body:t===null?``:`Deleting "${t.id}" makes it unroutable. Clients asking for it will get a model-unavailable error, and any key allowlisting it keeps a name that no longer resolves.`,confirmLabel:`Delete model`,busy:S.isPending,onConfirm:()=>{t!==null&&S.mutate(t.id,{onSuccess:()=>{_(!1),a()},onError:e=>{_(!1),f(A(e))}})}})]})}var De=c.div`
|
|
99
|
-
display: grid;
|
|
100
|
-
grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
|
|
101
|
-
gap: ${({theme:e})=>e.space(4)};
|
|
102
|
-
align-items: start;
|
|
103
|
-
|
|
104
|
-
@media (max-width: 980px) {
|
|
105
|
-
grid-template-columns: minmax(0, 1fr);
|
|
106
|
-
}
|
|
107
|
-
`,Oe=c(r)`
|
|
108
|
-
gap: ${({theme:e})=>e.space(4)};
|
|
109
|
-
min-width: 0;
|
|
110
|
-
`,Q=c.button`
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
gap: 4px;
|
|
114
|
-
width: 100%;
|
|
115
|
-
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
116
|
-
text-align: left;
|
|
117
|
-
background: ${({theme:e,$selected:t})=>t?e.color.accentWash:`transparent`};
|
|
118
|
-
border: 0;
|
|
119
|
-
border-left: 2px solid
|
|
120
|
-
${({theme:e,$selected:t})=>t?e.color.accent:`transparent`};
|
|
121
|
-
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
122
|
-
cursor: pointer;
|
|
123
|
-
|
|
124
|
-
&:hover {
|
|
125
|
-
background: ${({theme:e,$selected:t})=>t?e.color.accentWash:e.color.panelSunk};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
&:last-child {
|
|
129
|
-
border-bottom: 0;
|
|
130
|
-
}
|
|
131
|
-
`,ke=c(i)`
|
|
132
|
-
font-family: ${({theme:e})=>e.font.mono};
|
|
133
|
-
font-size: 12.5px;
|
|
134
|
-
display: block;
|
|
135
|
-
max-width: 100%;
|
|
136
|
-
`,Ae=c.div`
|
|
137
|
-
display: flex;
|
|
138
|
-
gap: 2px;
|
|
139
|
-
`,je=c.span`
|
|
140
|
-
width: 12px;
|
|
141
|
-
height: 3px;
|
|
142
|
-
border-radius: 1px;
|
|
143
|
-
background: ${({$provider:e})=>`var(--p-${e})`};
|
|
144
|
-
`,$=`\0new`;function Me(){let t=h(),[r,i]=(0,F.useState)(null),a=t.data??[],s=r===$?null:a.find(e=>e.id===r)??null,c=r===$||r===null&&!t.isLoading&&a.length===0;(0,F.useEffect)(()=>{r===null&&a.length!==0&&i(a[0]?.id??null)},[a,r]);let l=t.isLoading?`Reading configured models…`:a.length===0?`No virtual models exist yet, so no client request can resolve to an upstream.`:`${a.length} model${a.length===1?``:`s`} routing to ${a.reduce((e,t)=>e+t.targets.length,0)} targets.`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(v,{legend:`Models`,title:`Virtual models`,summary:l,actions:(0,I.jsxs)(g,{type:`button`,$variant:`primary`,onClick:()=>i($),children:[(0,I.jsx)(b,{}),`New model`]})}),(0,I.jsxs)(De,{children:[(0,I.jsx)(k,{legend:`Configured`,meta:`${a.length}`,flush:!0,children:t.isError?(0,I.jsx)(te,{error:t.error,onRetry:()=>void t.refetch()}):t.isLoading?(0,I.jsx)(`div`,{style:{padding:12},children:(0,I.jsx)(j,{rows:4})}):a.length===0?(0,I.jsx)(M,{legend:`No models`,message:`Create a model to give clients something to ask for.`,action:(0,I.jsx)(g,{type:`button`,$size:`sm`,$variant:`primary`,onClick:()=>i($),children:`New model`})}):(0,I.jsx)(`div`,{children:a.map(t=>{let a=[...new Set(t.targets.map(e=>e.provider))];return(0,I.jsxs)(Q,{type:`button`,$selected:t.id===r,"aria-pressed":t.id===r,onClick:()=>i(t.id),children:[(0,I.jsxs)(o,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(ke,{title:t.id,children:t.id}),(0,I.jsx)(n,{}),t.isAlias?(0,I.jsx)(w,{children:`alias`}):null]}),(0,I.jsxs)(o,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(Ae,{children:a.map(e=>(0,I.jsx)(je,{$provider:e,title:e},e))}),(0,I.jsx)(e,{children:t.strategy}),(0,I.jsx)(n,{}),(0,I.jsxs)(f,{$dim:!0,$size:`11px`,children:[t.targets.length,` target`,t.targets.length===1?``:`s`]})]})]},t.id)})})}),(0,I.jsxs)(Oe,{children:[s===null&&!c?(0,I.jsx)(k,{legend:`Editor`,children:t.isLoading?(0,I.jsx)(j,{rows:5}):(0,I.jsx)(M,{legend:`Nothing selected`,message:`Pick a model on the left to change its targets, or create a new one.`})}):(0,I.jsx)(Ee,{model:s,onSaved:e=>{i(e),t.refetch()},onDeleted:()=>{i(null),t.refetch()}}),(0,I.jsx)(me,{modelId:s?.id??null})]})]})]})}var Ne=Me;export{Ne as component};
|