omnigateway 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/public/assets/{Confirm-gd8Y6snu.js → Confirm-BO1xS6uH.js} +1 -1
- package/public/assets/{CopyValue-Dds-Ow9a.js → CopyValue-BiiqC_Z2.js} +1 -1
- package/public/assets/{Field-D-14HF0x.js → Field-b0ohzqzR.js} +1 -1
- package/public/assets/{Match-CgNxphvS.js → Match-B2ZxNor3.js} +1 -1
- package/public/assets/{Modal-Dj3LvMS9.js → Modal-OALemCh6.js} +1 -1
- package/public/assets/{Rack-B4c0dbIb.js → Rack-DhVnjAjC.js} +1 -1
- package/public/assets/{Readout-Du15WYx0.js → Readout-VYnpaTMg.js} +1 -1
- package/public/assets/{States-CxLDlCaw.js → States-6G9NsYha.js} +1 -1
- package/public/assets/{TokenBreakdown-BySwFK6Q.js → TokenBreakdown-B9RanXin.js} +1 -1
- package/public/assets/_app-ChlUa_Ov.js +1 -0
- package/public/assets/_app.accounts-CJ6lFXIx.js +64 -0
- package/public/assets/{_app.console-CoaRdkB1.js → _app.console-eFiUh-OA.js} +1 -1
- package/public/assets/{_app.database-CES5ec5g.js → _app.database-BHaMpXld.js} +1 -1
- package/public/assets/{_app.index-DwOZe1A-.js → _app.index-C1vtrxnM.js} +1 -1
- package/public/assets/{_app.keys-B5HrAu2U.js → _app.keys-Bz6-VVJi.js} +1 -1
- package/public/assets/{_app.logs-NbfIexz0.js → _app.logs-DV7O6ZUp.js} +1 -1
- package/public/assets/{_app.models-B1MdFRtQ.js → _app.models-KIctkivt.js} +1 -1
- package/public/assets/{_app.plugins._pluginId-ByMziW8p.js → _app.plugins._pluginId-BbqXEJUB.js} +1 -1
- package/public/assets/{_app.settings-BkDkGkKF.js → _app.settings-B8zjCira.js} +1 -1
- package/public/assets/_app.usage-C4GR06sI.js +83 -0
- package/public/assets/{index-gMv8Qs7m.js → index-B2twwe7y.js} +3 -3
- package/public/assets/{login-cCXnl34r.js → login-CJz2YA-O.js} +1 -1
- package/public/assets/plus-C7a0RuII.js +1 -0
- package/public/assets/queries-BOAAI06M.js +142 -0
- package/public/assets/shared-Rzhx6i7s.js +84 -0
- package/public/assets/{trash-2-ZPh3619D.js → trash-2-C7-QrCg5.js} +1 -1
- package/public/index.html +3 -3
- package/public/assets/_app-Dx_xnlud.js +0 -1
- package/public/assets/_app.accounts-DvBYnbfS.js +0 -64
- package/public/assets/_app.usage-DNpM8Nub.js +0 -83
- package/public/assets/plus-fXfUTt6_.js +0 -1
- package/public/assets/queries-CIOPbRcE.js +0 -142
- package/public/assets/shared-B4o-2quR.js +0 -84
package/README.md
CHANGED
|
@@ -779,10 +779,10 @@ two bugs hid in exactly that gap.
|
|
|
779
779
|
|
|
780
780
|
| Plugin | What it does |
|
|
781
781
|
| --- | --- |
|
|
782
|
-
| [
|
|
782
|
+
| [`@omnigateway/pokemon`](https://github.com/harismawan/omnigateway-plugin-pokemon) | A Pokémon companion. Each gateway key raises one that hatches, evolves, and graduates into a Pokédex on the tokens that key spends, with a shop that spends a wallet of those same tokens. |
|
|
783
783
|
|
|
784
784
|
```bash
|
|
785
|
-
omni plugin install omnigateway
|
|
785
|
+
omni plugin install @omnigateway/pokemon
|
|
786
786
|
omni plugin verify pokemon
|
|
787
787
|
omni restart
|
|
788
788
|
```
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{lt as e}from"./queries-
|
|
1
|
+
import{lt as e}from"./queries-BOAAI06M.js";import{t}from"./Modal-OALemCh6.js";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import a from"styled-components";var o=a.p`
|
|
2
2
|
font-size: 13px;
|
|
3
3
|
color: ${({theme:e})=>e.color.inkDim};
|
|
4
4
|
`;function s({open:a,onOpenChange:s,title:c,body:l,confirmLabel:u,busy:d,onConfirm:f}){return r(t,{open:a,onOpenChange:s,title:c,width:`420px`,footer:i(n,{children:[r(e,{type:`button`,onClick:()=>s(!1),children:`Cancel`}),r(e,{type:`button`,$variant:`danger`,disabled:d===!0,onClick:f,children:u})]}),children:r(o,{children:l})})}export{s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{at as e,ut as t}from"./queries-
|
|
1
|
+
import{at as e,ut as t}from"./queries-BOAAI06M.js";import{c as n}from"./Rack-DhVnjAjC.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),d=n(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),f=n(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=n(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);function m(e){if(e===null||typeof getSelection!=`function`)return!1;let t=getSelection();if(t===null)return!1;try{let n=document.createRange();return n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),!0}catch{return!1}}async function h(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=m(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var g=l.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: stretch;
|
|
4
4
|
gap: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e}from"./queries-
|
|
1
|
+
import{$ as e}from"./queries-BOAAI06M.js";import{useId as t}from"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import i from"styled-components";var a=`
|
|
2
2
|
width: 100%;
|
|
3
3
|
border-radius: 3px;
|
|
4
4
|
transition: border-color 120ms ease;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_t as e,ht as t,pt as n}from"./queries-
|
|
1
|
+
import{_t as e,ht as t,pt as n}from"./queries-BOAAI06M.js";import{n as r}from"./matchContext-BOenO3J2.js";import*as i from"react";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){return e?.isNotFound===!0}function l(e){return o(u,{...e})}var u=class extends i.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?i.createElement(this.props.errorComponent??d,{error:e,reset:this.reset}):this.props.children}};function d({error:e}){let[t,n]=i.useState(!1);return s(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[s(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[o(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),o(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),o(`div`,{style:{height:`.25rem`}}),t?o(`div`,{children:o(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?o(`code`,{children:e.message}):null})}):null]})}function f(e){let r=t(),i=`not-found-${n(r.stores.location,e=>e.pathname)}-${n(r.stores.status,e=>e)}`;return o(l,{getResetKey:()=>i,onCatch:(t,n)=>{if(c(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(c(t))return e.fallback?.(t);throw t},children:e.children})}function p(){return o(`p`,{children:`Not Found`})}function m(e){return o(a,{children:e.children})}function h(e,t,n){return t.options.notFoundComponent?o(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?o(e.options.defaultNotFoundComponent,{...n}):o(p,{})}function g(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?o(n,{}):null}var _=(e,t)=>e[0]===t[0]&&e[1]===t[1],v=i.memo(function({routeId:e}){let r=t();return o(y,{router:r,match:n(r.stores.getMatchStore(e),e=>e)})});function y({router:t,match:n}){let a=t.routesById[n.routeId],u=g(t,a),d=a.options.errorComponent??t.options.defaultErrorComponent,p=a.options.onCatch??t.options.defaultOnCatch,h=a.isRoot?a.options.notFoundComponent??t.options.notFoundRoute?.options.component:a.options.notFoundComponent,_=n.ssr===!1||n.ssr===`data-only`,v=a.options.wrapInSuspense??u??(a.options.errorComponent?.preload||_)?i.Suspense:m,y=d?l:m,x=h?f:m;return s(a.isRoot?a.options.shellComponent??m:m,{children:[o(r.Provider,{value:n.routeId,children:o(v,{fallback:u,children:o(y,{getResetKey:()=>n,errorComponent:d,onCatch:(e,t)=>{if(c(e))throw e.routeId??=n.routeId,e;p?.(e,t)},children:o(x,{fallback:e=>{if(e.routeId??=n.routeId,e.routeId!==n.routeId)throw e;return i.createElement(h,e)},children:_?o(e,{fallback:u,children:o(b,{match:n})}):o(b,{match:n})})})})}),null]})}var b=i.memo(function({match:e}){let n=t(),r=e.routeId,a=n.routesById[r],s=i.useMemo(()=>{let t=(a.options.remountDeps??n.options.defaultRemountDeps)?.({routeId:r,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return t?JSON.stringify(t):void 0},[r,e.loaderDeps,e._strictParams,e._strictSearch,a.options.remountDeps,n.options.defaultRemountDeps]),c=i.useMemo(()=>{let e=a.options.component??n.options.defaultComponent;return e?o(e,{},s):o(x,{})},[s,a.options.component,n.options.defaultComponent]);if(e.status===`pending`){if(n._tx)throw n._tx[5];return g(n,a)}if(e.status===`notFound`)return h(n,a,e.error);if(e.status===`error`)throw e.error;return c}),x=i.memo(function(){let e=t(),a=i.useContext(r),s,c,l;{let t=e.stores.getMatchStore(a);[s,c]=n(t,e=>[!!e._notFound,e.error],_),l=n(e.stores.ids,e=>e[e.indexOf(a)+1])}if(s)return h(e,e.routesById[a],c);if(!l)return null;let u=o(v,{routeId:l});return a===`__root__`?o(i.Suspense,{fallback:g(e),children:u}):u});export{l as a,m as i,x as n,c as o,g as r,v as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,it as t,ut as n}from"./queries-CIOPbRcE.js";import{c as r}from"./Rack-B4c0dbIb.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-9ps0Qd15.js";import*as f from"react";import{useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import*as _ from"react-dom";import v from"styled-components";var ee=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),te=Object.defineProperty,y=(e,t)=>te(e,`name`,{value:t,configurable:!0});function b(e,t){return f.useReducer((e,n)=>t[e][n]??e,e)}y(b,`useStateMachine`);var x=y(e=>{let{present:t,children:n}=e,r=S(t),i=typeof n==`function`?n({present:r.isPresent}):f.Children.only(n),a=w(r.ref,ne(i));return typeof n==`function`||r.isPresent?f.cloneElement(i,{ref:a}):null},`Presence`);function S(e){let[t,n]=f.useState(),r=f.useRef(null),i=f.useRef(e),a=f.useRef(`none`),o=f.useRef(void 0),[c,l]=b(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return f.useEffect(()=>{c===`mounted`?(a.current=o.current??T(r.current),o.current=void 0):a.current=`none`},[c]),s(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=T(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),s(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=y(a=>{let o=T(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`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=y(e=>{e.target===t&&(a.current=T(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)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:f.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=T(t)}else r.current=null;n(e)},[])}}y(S,`usePresence`);function C(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}y(C,`setRef`);function w(...e){let t=f.useRef(e);return t.current=e,f.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=C(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():C(n[e],null)}}},[])}y(w,`useStableComposedRefs`);function T(e){return e?.animationName||`none`}y(T,`getAnimationName`);function ne(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(ne,`getElementRef`);var re=Object.defineProperty,ie=(e,t)=>re(e,`name`,{value:t,configurable:!0}),E=f.useId||(()=>void 0),ae=0;function D(e){let[t,n]=f.useState(E());return s(()=>{e||n(e=>e??String(ae++))},[e]),e||(t?`radix-${t}`:``)}ie(D,`useId`);var oe=Object.defineProperty,se=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function O(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}se(O,`useCallbackRef`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0}),le=`dismissableLayer.update`,ue=`dismissableLayer.pointerDownOutside`,de=`dismissableLayer.focusOutside`,fe,pe=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),me=f.forwardRef(k(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...p}=e,m=f.useContext(pe),[g,_]=f.useState(null),v=g?.ownerDocument??globalThis?.document,[,ee]=f.useState({}),te=a(t,_),y=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=g?y.indexOf(g):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=f.useRef(!1),ne=_e(e=>{s?.(e),u?.(e),e.defaultPrevented||d?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return w&&!t},[m.branches,w])}),re=ve(e=>{if(r&&T.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(c?.(e),u?.(e),e.defaultPrevented||d?.())},v),ie=g?S===y.length-1:!1,E=O(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return f.useEffect(()=>{if(ie)return v.addEventListener(`keydown`,E,{capture:!0}),()=>v.removeEventListener(`keydown`,E,{capture:!0})},[v,ie,E]),f.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(fe=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),ye(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(g),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=fe))}},[g,v,n,m]),f.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),ye())},[g,m]),f.useEffect(()=>{let e=k(()=>ee({}),`handleUpdate`);return document.addEventListener(le,e),()=>document.removeEventListener(le,e)},[]),h(i.div,{...p,ref:te,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:l(e.onFocusCapture,re.onFocusCapture),onBlurCapture:l(e.onBlurCapture,re.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,ne.onPointerDownCapture)})},`DismissableLayer`));function he(){let e=f.useContext(pe),[t,n]=f.useState(null);return f.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}k(he,`useDismissableLayerSurface`);var ge=k(()=>!0,`IS_TRUE`);function _e(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ge}=t,s=O(e),c=f.useRef(!1),l=f.useRef(!1),u=f.useRef(new Map),d=f.useRef(()=>{});return f.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}k(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}k(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}k(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}k(p,`handleInteractionBubble`);let m=k(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||be(ue,s,p,{discrete:!0})};if(k(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:k(()=>c.current=!0,`onPointerDownCapture`)}}k(_e,`usePointerDownOutside`);function ve(e,t=globalThis?.document){let n=O(e),r=f.useRef(!1);return f.useEffect(()=>{let e=k(e=>{e.target&&!r.current&&be(de,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:k(()=>r.current=!0,`onFocusCapture`),onBlurCapture:k(()=>r.current=!1,`onBlurCapture`)}}k(ve,`useFocusOutside`);function ye(){let e=new CustomEvent(le);document.dispatchEvent(e)}k(ye,`dispatchUpdate`);function be(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?c(i,a):i.dispatchEvent(a)}k(be,`handleAndDispatchCustomEvent`);var xe=Object.defineProperty,A=(e,t)=>xe(e,`name`,{value:t,configurable:!0}),Se=`focusScope.autoFocusOnMount`,Ce=`focusScope.autoFocusOnUnmount`,we={bubbles:!1,cancelable:!0},Te=f.forwardRef(A(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[l,u]=f.useState(null),d=O(o),p=O(s),m=f.useRef(null),g=a(t,u),_=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?m.current=t:M(m.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||M(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(l)};A(e,`handleFocusIn`),A(t,`handleFocusOut`),A(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),f.useEffect(()=>{if(l){je.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Se,we);l.addEventListener(Se,d),l.dispatchEvent(t),t.defaultPrevented||(Ee(Ne(j(l)),{select:!0}),document.activeElement===e&&M(l))}return()=>{l.removeEventListener(Se,d),setTimeout(()=>{let t=new CustomEvent(Ce,we);l.addEventListener(Ce,p),l.dispatchEvent(t),t.defaultPrevented||M(e??document.body,{select:!0}),l.removeEventListener(Ce,p),je.remove(_)},0)}}},[l,d,p,_]);let v=f.useCallback(e=>{if(!n&&!r||_.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]=De(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&M(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&M(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return h(i.div,{tabIndex:-1,...c,ref:g,onKeyDown:v})},`FocusScope`));function Ee(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}A(Ee,`focusFirst`);function De(e){let t=j(e);return[Oe(t,e),Oe(t.reverse(),e)]}A(De,`getTabbableEdges`);function j(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A(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}A(j,`getTabbableCandidates`);function Oe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ke(r,{upTo:t})))return r}A(Oe,`findVisible`);function ke(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}A(ke,`isHidden`);function Ae(e){return e instanceof HTMLInputElement&&`select`in e}A(Ae,`isSelectableInput`);function M(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ae(e)&&t&&e.select()}}A(M,`focus`);var je=Me();function Me(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=N(e,t),e.unshift(t)},remove(t){e=N(e,t),e[0]?.resume()}}}A(Me,`createFocusScopesStack`);function N(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}A(N,`arrayRemove`);function Ne(e){return e.filter(e=>e.tagName!==`A`)}A(Ne,`removeLinks`);var Pe=Object.defineProperty,Fe=f.forwardRef(((e,t)=>Pe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[a,o]=f.useState(!1);s(()=>o(!0),[]);let c=n||a&&globalThis?.document?.body;return c?_.createPortal(h(i.div,{...r,ref:t}),c):null},`Portal`)),Ie=Object.defineProperty,Le=(e,t)=>Ie(e,`name`,{value:t,configurable:!0}),P=0,F=null;function Re(e){return ze(),e.children}Le(Re,`FocusGuards`);function ze(){f.useEffect(()=>{F||={start:Be(),end:Be()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}Le(ze,`useFocusGuards`);function Be(){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}Le(Be,`createFocusGuard`);var I=function(){return I=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},I.apply(this,arguments)};function Ve(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 He(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 L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ue=`with-scroll-bars-hidden`,We=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ge(e,t){var n=p(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 Ke=typeof window<`u`?f.useLayoutEffect:f.useEffect,qe=new WeakMap;function Je(e,t){var n=Ge(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return Ke(function(){var t=qe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}qe.set(n,e)},[e]),n}function Ye(e){return e}function Xe(e,t){t===void 0&&(t=Ye);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 Ze(e){e===void 0&&(e={});var t=Xe(null);return t.options=I({async:!0,ssr:!1},e),t}var Qe=function(e){var t=e.sideCar,n=Ve(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 f.createElement(r,I({},n))};Qe.isSideCarExport=!0;function $e(e,t){return e.useMedium(t),Qe}var et=Ze(),B=function(){},V=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,ee=v===void 0?`div`:v,te=e.gapMode,y=Ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),b=p,x=Je([n,t]),S=I(I({},y),i);return f.createElement(f.Fragment,null,u&&f.createElement(b,{sideCar:et,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:te}),o?f.cloneElement(f.Children.only(s),I(I({},S),{ref:x})):f.createElement(ee,I({},S,{className:c,ref:x}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var tt,nt=function(){if(tt)return tt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function rt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=nt();return t&&e.setAttribute(`nonce`,t),e}function it(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function at(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ot=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rt())&&(it(t,n),at(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},st=function(){var e=ot();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ct=function(){var e=st();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lt={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},ut=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[H(n),H(r),H(i)]},dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return lt;var t=ut(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])}},ft=ct(),U=`data-scroll-locked`,pt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{$ as e,it as t,ut as n}from"./queries-BOAAI06M.js";import{c as r}from"./Rack-DhVnjAjC.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-9ps0Qd15.js";import*as f from"react";import{useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import*as _ from"react-dom";import v from"styled-components";var ee=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),te=Object.defineProperty,y=(e,t)=>te(e,`name`,{value:t,configurable:!0});function b(e,t){return f.useReducer((e,n)=>t[e][n]??e,e)}y(b,`useStateMachine`);var x=y(e=>{let{present:t,children:n}=e,r=S(t),i=typeof n==`function`?n({present:r.isPresent}):f.Children.only(n),a=w(r.ref,ne(i));return typeof n==`function`||r.isPresent?f.cloneElement(i,{ref:a}):null},`Presence`);function S(e){let[t,n]=f.useState(),r=f.useRef(null),i=f.useRef(e),a=f.useRef(`none`),o=f.useRef(void 0),[c,l]=b(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return f.useEffect(()=>{c===`mounted`?(a.current=o.current??T(r.current),o.current=void 0):a.current=`none`},[c]),s(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=T(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),s(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=y(a=>{let o=T(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`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=y(e=>{e.target===t&&(a.current=T(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)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:f.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=T(t)}else r.current=null;n(e)},[])}}y(S,`usePresence`);function C(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}y(C,`setRef`);function w(...e){let t=f.useRef(e);return t.current=e,f.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=C(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():C(n[e],null)}}},[])}y(w,`useStableComposedRefs`);function T(e){return e?.animationName||`none`}y(T,`getAnimationName`);function ne(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(ne,`getElementRef`);var re=Object.defineProperty,ie=(e,t)=>re(e,`name`,{value:t,configurable:!0}),E=f.useId||(()=>void 0),ae=0;function D(e){let[t,n]=f.useState(E());return s(()=>{e||n(e=>e??String(ae++))},[e]),e||(t?`radix-${t}`:``)}ie(D,`useId`);var oe=Object.defineProperty,se=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function O(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}se(O,`useCallbackRef`);var ce=Object.defineProperty,k=(e,t)=>ce(e,`name`,{value:t,configurable:!0}),le=`dismissableLayer.update`,ue=`dismissableLayer.pointerDownOutside`,de=`dismissableLayer.focusOutside`,fe,pe=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),me=f.forwardRef(k(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...p}=e,m=f.useContext(pe),[g,_]=f.useState(null),v=g?.ownerDocument??globalThis?.document,[,ee]=f.useState({}),te=a(t,_),y=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=g?y.indexOf(g):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=f.useRef(!1),ne=_e(e=>{s?.(e),u?.(e),e.defaultPrevented||d?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return w&&!t},[m.branches,w])}),re=ve(e=>{if(r&&T.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(c?.(e),u?.(e),e.defaultPrevented||d?.())},v),ie=g?S===y.length-1:!1,E=O(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return f.useEffect(()=>{if(ie)return v.addEventListener(`keydown`,E,{capture:!0}),()=>v.removeEventListener(`keydown`,E,{capture:!0})},[v,ie,E]),f.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(fe=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),ye(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(g),m.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=fe))}},[g,v,n,m]),f.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),ye())},[g,m]),f.useEffect(()=>{let e=k(()=>ee({}),`handleUpdate`);return document.addEventListener(le,e),()=>document.removeEventListener(le,e)},[]),h(i.div,{...p,ref:te,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:l(e.onFocusCapture,re.onFocusCapture),onBlurCapture:l(e.onBlurCapture,re.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,ne.onPointerDownCapture)})},`DismissableLayer`));function he(){let e=f.useContext(pe),[t,n]=f.useState(null);return f.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}k(he,`useDismissableLayerSurface`);var ge=k(()=>!0,`IS_TRUE`);function _e(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ge}=t,s=O(e),c=f.useRef(!1),l=f.useRef(!1),u=f.useRef(new Map),d=f.useRef(()=>{});return f.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}k(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}k(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}k(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}k(p,`handleInteractionBubble`);let m=k(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||be(ue,s,p,{discrete:!0})};if(k(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:k(()=>c.current=!0,`onPointerDownCapture`)}}k(_e,`usePointerDownOutside`);function ve(e,t=globalThis?.document){let n=O(e),r=f.useRef(!1);return f.useEffect(()=>{let e=k(e=>{e.target&&!r.current&&be(de,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:k(()=>r.current=!0,`onFocusCapture`),onBlurCapture:k(()=>r.current=!1,`onBlurCapture`)}}k(ve,`useFocusOutside`);function ye(){let e=new CustomEvent(le);document.dispatchEvent(e)}k(ye,`dispatchUpdate`);function be(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?c(i,a):i.dispatchEvent(a)}k(be,`handleAndDispatchCustomEvent`);var xe=Object.defineProperty,A=(e,t)=>xe(e,`name`,{value:t,configurable:!0}),Se=`focusScope.autoFocusOnMount`,Ce=`focusScope.autoFocusOnUnmount`,we={bubbles:!1,cancelable:!0},Te=f.forwardRef(A(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[l,u]=f.useState(null),d=O(o),p=O(s),m=f.useRef(null),g=a(t,u),_=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?m.current=t:M(m.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||M(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&M(l)};A(e,`handleFocusIn`),A(t,`handleFocusOut`),A(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),f.useEffect(()=>{if(l){je.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Se,we);l.addEventListener(Se,d),l.dispatchEvent(t),t.defaultPrevented||(Ee(Ne(j(l)),{select:!0}),document.activeElement===e&&M(l))}return()=>{l.removeEventListener(Se,d),setTimeout(()=>{let t=new CustomEvent(Ce,we);l.addEventListener(Ce,p),l.dispatchEvent(t),t.defaultPrevented||M(e??document.body,{select:!0}),l.removeEventListener(Ce,p),je.remove(_)},0)}}},[l,d,p,_]);let v=f.useCallback(e=>{if(!n&&!r||_.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]=De(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&M(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&M(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return h(i.div,{tabIndex:-1,...c,ref:g,onKeyDown:v})},`FocusScope`));function Ee(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(M(r,{select:t}),document.activeElement!==n)return}A(Ee,`focusFirst`);function De(e){let t=j(e);return[Oe(t,e),Oe(t.reverse(),e)]}A(De,`getTabbableEdges`);function j(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A(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}A(j,`getTabbableCandidates`);function Oe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ke(r,{upTo:t})))return r}A(Oe,`findVisible`);function ke(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}A(ke,`isHidden`);function Ae(e){return e instanceof HTMLInputElement&&`select`in e}A(Ae,`isSelectableInput`);function M(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ae(e)&&t&&e.select()}}A(M,`focus`);var je=Me();function Me(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=N(e,t),e.unshift(t)},remove(t){e=N(e,t),e[0]?.resume()}}}A(Me,`createFocusScopesStack`);function N(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}A(N,`arrayRemove`);function Ne(e){return e.filter(e=>e.tagName!==`A`)}A(Ne,`removeLinks`);var Pe=Object.defineProperty,Fe=f.forwardRef(((e,t)=>Pe(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[a,o]=f.useState(!1);s(()=>o(!0),[]);let c=n||a&&globalThis?.document?.body;return c?_.createPortal(h(i.div,{...r,ref:t}),c):null},`Portal`)),Ie=Object.defineProperty,Le=(e,t)=>Ie(e,`name`,{value:t,configurable:!0}),P=0,F=null;function Re(e){return ze(),e.children}Le(Re,`FocusGuards`);function ze(){f.useEffect(()=>{F||={start:Be(),end:Be()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}Le(ze,`useFocusGuards`);function Be(){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}Le(Be,`createFocusGuard`);var I=function(){return I=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},I.apply(this,arguments)};function Ve(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 He(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 L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ue=`with-scroll-bars-hidden`,We=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ge(e,t){var n=p(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 Ke=typeof window<`u`?f.useLayoutEffect:f.useEffect,qe=new WeakMap;function Je(e,t){var n=Ge(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return Ke(function(){var t=qe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}qe.set(n,e)},[e]),n}function Ye(e){return e}function Xe(e,t){t===void 0&&(t=Ye);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 Ze(e){e===void 0&&(e={});var t=Xe(null);return t.options=I({async:!0,ssr:!1},e),t}var Qe=function(e){var t=e.sideCar,n=Ve(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 f.createElement(r,I({},n))};Qe.isSideCarExport=!0;function $e(e,t){return e.useMedium(t),Qe}var et=Ze(),B=function(){},V=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,ee=v===void 0?`div`:v,te=e.gapMode,y=Ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),b=p,x=Je([n,t]),S=I(I({},y),i);return f.createElement(f.Fragment,null,u&&f.createElement(b,{sideCar:et,removeScrollBar:l,shards:d,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:te}),o?f.cloneElement(f.Children.only(s),I(I({},S),{ref:x})):f.createElement(ee,I({},S,{className:c,ref:x}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var tt,nt=function(){if(tt)return tt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function rt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=nt();return t&&e.setAttribute(`nonce`,t),e}function it(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function at(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ot=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rt())&&(it(t,n),at(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},st=function(){var e=ot();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ct=function(){var e=st();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lt={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},ut=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[H(n),H(r),H(i)]},dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return lt;var t=ut(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])}},ft=ct(),U=`data-scroll-locked`,pt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${Ue} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,D as t,E as n,ct as r,dt as i,et as a,ft as o,it as s,k as c,lt as l,nt as u,ut as d}from"./queries-
|
|
1
|
+
import{$ as e,D as t,E as n,ct as r,dt as i,et as a,ft as o,it as s,k as c,lt as l,nt as u,ut as d}from"./queries-BOAAI06M.js";import{t as f}from"./index-B2twwe7y.js";import{E as p,O as m,T as h,_ as ee,r as te,t as g}from"./Lamp-BDf7-dMa.js";import{createContext as _,createElement as v,forwardRef as y,use as b,useCallback as x,useContext as S,useId as C,useMemo as w,useState as T}from"react";import{jsx as E,jsxs as D}from"react/jsx-runtime";import O,{css as k}from"styled-components";var A=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ne=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),re=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),j=e=>{let t=re(e);return t.charAt(0).toUpperCase()+t.slice(1)},M={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ie=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ae=_({}),oe=()=>S(ae),se=y(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=oe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return v(`svg`,{ref:c,...M,width:t??l??M.width,height:t??l??M.height,stroke:e??f,strokeWidth:m,className:A(`lucide`,p,i),...!a&&!ie(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>v(e,t)),...Array.isArray(a)?a:[a]])}),N=(e,t)=>{let n=y(({className:n,...r},i)=>v(se,{ref:i,iconNode:t,className:A(`lucide-${ne(j(e))}`,`lucide-${e}`,n),...r}));return n.displayName=j(e),n},ce=N(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),P=N(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),le=N(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ue=N(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),F=N(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),de=N(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),I=N(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),L=N(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),R=N(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),z=N(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),B=N(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),V=N(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),H=N(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),fe=N(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),U=_(null);function pe({children:e}){let[t,n]=T(!0),r=x(()=>n(e=>!e),[]),i=w(()=>({live:t,toggle:r,cadence:e=>t?e:!1}),[t,r]);return E(U,{value:i,children:e})}function W(){return b(U)??{live:!1,toggle:()=>{},cadence:()=>!1}}var me=O.svg`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e}from"./queries-
|
|
1
|
+
import{$ as e}from"./queries-BOAAI06M.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import r from"styled-components";var i=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 6px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,it as t,lt as n,nt as r,q as i}from"./queries-
|
|
1
|
+
import{$ as e,it as t,lt as n,nt as r,q as i}from"./queries-BOAAI06M.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import s,{keyframes as c}from"styled-components";var l=s.section`
|
|
2
2
|
background: ${({theme:e})=>e.color.panel};
|
|
3
3
|
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
4
4
|
border-radius: ${({theme:e})=>e.radius.panel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,s as t}from"./Rack-
|
|
1
|
+
import{c as e,s as t}from"./Rack-DhVnjAjC.js";import{S as n}from"./Lamp-BDf7-dMa.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a,{keyframes as o}from"styled-components";var s=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=e(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),l=new Intl.NumberFormat(`en-US`);function u(e){return`${l.format(e.inputTokens)} input, ${l.format(e.outputTokens)} output, ${l.format(e.cacheReadTokens)} cache read, ${l.format(e.cacheWriteTokens)} cache write tokens`}var d=a.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
flex-wrap: wrap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./Match-B2ZxNor3.js";import{i as t,n}from"./Rack-DhVnjAjC.js";import{jsx as r}from"react/jsx-runtime";var i=()=>r(t,{children:r(n,{children:r(e,{})})});export{i as component};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{A as e,C as t,E as n,J as r,T as i,Y as a,c as o,dt as s,t as c,w as l}from"./shared-Rzhx6i7s.js";import{$ as u,A as d,W as f,at as p,et as m,f as h,g,h as _,l as v,lt as y,nt as b,r as x,rt as S,u as C,ut as w,v as T,z as E}from"./queries-BOAAI06M.js";import{a as D,c as O,t as k}from"./Rack-DhVnjAjC.js";import{n as A,r as ee,t as te}from"./CopyValue-BiiqC_Z2.js";import{t as ne}from"./plus-C7a0RuII.js";import{t as j}from"./trash-2-C7-QrCg5.js";import{t as re}from"./Modal-OALemCh6.js";import{t as M}from"./Toggle-DMk46RX2.js";import{t as N}from"./Confirm-BO1xS6uH.js";import{D as P,S as F,T as I,a as L,g as ie,h as ae,i as oe,m as se,n as ce,o as le,p as ue,s as R,t as de,u as fe,v as pe,w as me,x as he,y as ge}from"./Lamp-BDf7-dMa.js";import{t as _e}from"./Chip-BltJSw8A.js";import{i as z,n as B,r as ve,t as V}from"./Field-b0ohzqzR.js";import{t as ye}from"./Meter-stpt3vQu.js";import{a as H,i as U,n as be,r as xe,t as Se}from"./States-6G9NsYha.js";import{i as Ce,n as W,r as G,t as we}from"./Table-CVDZ69Zx.js";import{t as Te}from"./catalog-BBKm8Ih8.js";import*as Ee from"react";import{Fragment as De,forwardRef as Oe,useCallback as ke,useEffect as Ae,useState as K}from"react";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";var je=O(`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`}]]),Me=Object.keys(Te);function Ne(e){return Te[e].authTypes}function Pe(e){return Ne(e).includes(`oauth`)?`oauth`:`apiKey`}var Fe={oauth:`Authorize in the browser`,apiKey:`Paste an API key`},Z={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`,kilo:`Kilo`,grok:`Grok`,custom:`OpenAI Compatible`},Ie={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.`,kilo:`Approve the code on Kilo's device page. This dialog finishes on its own.`,grok:`Authorize in the browser. When it redirects to 127.0.0.1, paste the whole URL.`,custom:`Enter endpoint metadata and API key.`},Le={openai:`http://localhost:1455/auth/callback?code=…`,grok:`http://127.0.0.1:56121/callback?code=…`},Re=X.ol`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
5
|
+
`,ze=X.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
|
+
`,Be=X.p`
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: ${({theme:e})=>e.color.down};
|
|
17
|
+
`,Ve=X.p`
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
20
|
+
`;function He({open:e,credentials:t,onOpenChange:n,onConnected:r}){let[i,a]=K(`anthropic`),[o,s]=K(Pe(`anthropic`)),[c,l]=K(``),[d,f]=K(null),[m,g]=K(``),[_,S]=K(``),w=(t??[]).filter((e,t,n)=>e.provider===`custom`&&n.findIndex(t=>t.provider===`custom`&&t.providerData.endpointId===e.providerData.endpointId)===t),[T,E]=K(``),[D,O]=K(``),[k,A]=K(`chat_completions`),[ee,ne]=K(``),[j,M]=K(null),N=C(),P=v(),F=h(),I=ke(()=>{f(null),g(``),S(``),E(``),O(``),A(`chat_completions`),ne(``),M(null),l(``),N.reset(),P.reset(),F.reset()},[N,P,F]),L=ke(e=>{e||I(),n(e)},[n,I]);return Ae(()=>{if(d===null||d.kind!==`device`)return;let e=!1,t=async()=>{try{let t=await x(d.flowId);if(e)return;if(t.status===`complete`){I(),n(!1),r();return}}catch(t){if(e)return;M(U(t)),f(null);return}e||(i=setTimeout(()=>void t(),d.pollIntervalMs))},i=setTimeout(()=>void t(),d.pollIntervalMs);return()=>{e=!0,clearTimeout(i)}},[d,r,n,I]),J(re,{open:e,onOpenChange:L,title:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:d===null?Y(q,{children:[J(y,{type:`button`,onClick:()=>L(!1),children:`Cancel`}),J(y,{type:`button`,$variant:`primary`,disabled:N.isPending||F.isPending,onClick:()=>{if(M(null),o===`apiKey`){F.mutate({provider:i,apiKey:ee,label:c.trim()||void 0,...i===`custom`?{endpointId:_,endpointLabel:T,origin:D,protocol:k}:{}},{onSuccess:()=>{I(),n(!1),r()},onError:e=>M(U(e))});return}N.mutate({provider:i,label:c.trim().length===0?Z[i]:c.trim()},{onSuccess:e=>f(e),onError:e=>M(U(e))})},children:o===`apiKey`?F.isPending?`Adding…`:`Add API key`:N.isPending?`Starting…`:`Start authorization`})]}):d.kind===`device`?J(y,{type:`button`,onClick:()=>L(!1),children:`Cancel`}):Y(q,{children:[J(y,{type:`button`,onClick:()=>L(!1),children:`Cancel`}),J(y,{type:`button`,$variant:`primary`,disabled:P.isPending||m.trim().length===0,onClick:()=>{d!==null&&(M(null),P.mutate({flowId:d.flowId,code:m.trim()},{onSuccess:()=>{I(),n(!1),r()},onError:e=>M(U(e))}))},children:P.isPending?`Finishing…`:`Finish connecting`})]}),children:Y(Re,{children:[d===null?Y(p,{$gap:3,children:[J(V,{label:`Provider`,children:e=>J(z,{...e,value:i,onChange:e=>{let t=e.target.value;a(t),s(Pe(t))},children:Me.map(e=>J(`option`,{value:e,children:Z[e]},e))})}),Ne(i).length>1?J(V,{label:`How to connect`,children:e=>J(z,{...e,value:o,onChange:e=>s(e.target.value),children:Ne(i).map(e=>J(`option`,{value:e,children:Fe[e]},e))})}):null,i===`custom`?Y(q,{children:[w.length===0?null:J(V,{label:`Existing endpoint`,children:e=>Y(z,{...e,value:_,onChange:e=>{let t=w.find(t=>t.providerData.endpointId===e.target.value);if(t===void 0){S(``),E(``),O(``),A(`chat_completions`);return}S(String(t.providerData.endpointId)),E(String(t.providerData.endpointLabel)),O(String(t.providerData.origin)),A(t.providerData.protocol===`responses`?`responses`:`chat_completions`)},children:[J(`option`,{value:``,children:`Create new endpoint`}),w.map(e=>J(`option`,{value:String(e.providerData.endpointId),children:String(e.providerData.endpointLabel)},String(e.providerData.endpointId)))]})}),J(V,{label:`Endpoint ID`,children:e=>J(B,{...e,value:_,onChange:e=>S(e.target.value)})}),J(V,{label:`Endpoint label`,children:e=>J(B,{...e,value:T,onChange:e=>E(e.target.value)})}),J(V,{label:`Server origin`,children:e=>J(B,{...e,value:D,placeholder:`https://server.example`,onChange:e=>O(e.target.value)})}),D.trim().toLowerCase().startsWith(`http://`)?J(Be,{children:`Plaintext transport sends prompts and API keys without TLS.`}):null,J(V,{label:`Protocol`,children:e=>Y(z,{...e,value:k,onChange:e=>A(e.target.value),children:[J(`option`,{value:`chat_completions`,children:`Chat Completions (/v1/chat/completions)`}),J(`option`,{value:`responses`,children:`Responses (/v1/responses)`})]})})]}):null,o===`apiKey`?J(V,{label:`API key`,children:e=>J(B,{...e,type:`password`,value:ee,autoComplete:`off`,onChange:e=>ne(e.target.value)})}):null,J(V,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>J(B,{...e,value:c,placeholder:Z[i],onChange:e=>l(e.target.value)})})]}):Y(p,{$gap:3,children:[Y(p,{$gap:1,children:[J(u,{children:`Step 1 — authorize`}),J(b,{$gap:2,children:Y(y,{as:`a`,href:d.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[J(je,{}),`Open `,Z[i]]})}),J(te,{value:d.authorizeUrl,label:`Copy authorization link`})]}),d.userCode===null?null:Y(p,{$gap:1,children:[J(u,{children:`Step 2 — enter this code`}),J(ze,{children:d.userCode})]}),d.kind===`device`?Y(Ve,{children:[Ie[i],` Waiting for authorization…`]}):J(V,{label:`Authorization code`,hint:Ie[i],...j===null?{}:{problem:j},children:e=>J(B,{...e,value:m,autoFocus:!0,placeholder:Le[i]??`code#state`,onChange:e=>g(e.target.value)})})]}),j===null||d?.kind===`pkce`?null:J(Be,{children:j})]})})}var Ue=[`axis`],We=Oe((e,n)=>Ee.createElement(t,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Ue,tooltipPayloadSearcher:a,categoricalChartProps:e,ref:n})),Ge=X(b)`
|
|
21
|
+
gap: ${({theme:e})=>e.space(5)};
|
|
22
|
+
flex-wrap: wrap;
|
|
23
|
+
`,Q=X.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 2px;
|
|
27
|
+
`,$=X.span`
|
|
28
|
+
font-size: 11.5px;
|
|
29
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
30
|
+
`,Ke={budget:`1 4`,projection:`6 4`},qe=`projected`;function Je(e){let t=new Map;for(let{key:n,points:r}of e)for(let e of r){let r=t.get(e.at)??{at:e.at};r[n]=e.percent,t.set(e.at,r)}return[...t.values()].sort((e,t)=>e.at-t.at)}function Ye(e,t,n){return[Math.min(e,...n.map(e=>e.pace.from.at)),Math.max(t,...n.map(e=>e.pace.to.at))]}function Xe(e,t){let n=t?.windowStartsAt??null;return n===null||e.resetsAt===null?null:n-(e.resetsAt-n)}function Ze({credentialId:e,windows:t,burn:n,pollIntervalMs:r,now:i}){let a=t.map(e=>{let t=L(n,e.windowType);return{window:e,estimate:t,since:Xe(e,t)}}),o=a.map(e=>e.since).filter(e=>e!==null),s=o.length===0?0:Math.min(...o),c=d({credentialId:e,since:s},o.length>0),l=c.data?.samples??[],u=c.data?.gatewayRates??[];return J(p,{$gap:4,children:a.map(e=>J($e,{window:e.window,estimate:e.estimate,since:e.since,samples:l.filter(t=>t.windowType===e.window.windowType&&t.observedAt>=(e.since??0)),gatewayRate:u.find(t=>t.windowType===e.window.windowType),pollIntervalMs:r,now:i},e.window.windowType))})}function Qe(e,t,n){let r=ge(e,t);return r===`ok`?`lasts the window`:r!==`empty`||t.exhaustsAt===null?`unknown`:t.exhaustsAt<=n?`empty now`:`empty ~${me(t.exhaustsAt-n)} before it resets`}function $e({window:t,estimate:a,since:d,samples:f,gatewayRate:h,pollIntervalMs:g,now:_}){let v=ce[t.windowType],y=t.limit===null?`${F(t.used)} used`:`${F(t.used)} of ${F(t.limit)} used`;if(a===void 0||a.stale||fe(t,_,g))return Y(p,{$gap:2,children:[Y(b,{$gap:2,$wrap:!0,children:[Y(u,{children:[v,` window`]}),J($,{children:y})]}),J($,{children:`reading is stale`})]});let x=pe(ae(f),t),S=x.flatMap(e=>{let t=oe(e);return t===null?[]:[{key:`${e.key}-budget`,pace:t}]}),C=ue(t,a),w=Je([...x,...S.map(e=>({key:e.key,points:[e.pace.from,e.pace.to]})),...C===null?[]:[{key:qe,points:[C.from,C.to]}]]),T=new Set(x.map(e=>e.key)),E=Math.max(100,...C===null?[]:[C.from.percent,C.to.percent].map(e=>Math.ceil(e)));return Y(p,{$gap:2,children:[Y(b,{$gap:2,$wrap:!0,children:[Y(u,{children:[v,` window`]}),J($,{children:y})]}),Y(Ge,{children:[Y(Q,{children:[J(u,{children:`Window average`}),J(m,{children:a.ratePerHour===null?`unknown`:`${F(a.ratePerHour)}/h`})]}),Y(Q,{children:[J(u,{children:`Estimate`}),J(m,{children:Qe(t,a,_)})]}),Y(Q,{children:[J(u,{children:`Projected`}),J(m,{children:C===null?`unknown`:`${Math.round(C.to.percent)}% of limit by reset`})]}),Y(Q,{children:[J(u,{children:`This gateway accounts for`}),J(m,{children:h?.gatewayRatePerHour===void 0||h.gatewayRatePerHour===null?`unknown`:`${F(h.gatewayRatePerHour)} tokens/h`})]})]}),t.limit===null?J($,{children:`no ceiling reported`}):t.resetsAt===null||d===null?J($,{children:`no reset reported`}):x.length===0?J($,{children:`not yet observed`}):Y(q,{children:[J(u,{children:[`Used, this window and the one before`,...S.length===0?[]:[`budget dotted`],...C===null?[]:[`projection dashed`]].join(` · `)}),J(c,{$height:160,children:J(s,{width:`100%`,height:`100%`,children:Y(We,{data:w,margin:{top:4,right:8,bottom:4,left:4},children:[J(e,{stroke:`var(--rule)`,vertical:!1}),J(i,{dataKey:`at`,type:`number`,scale:`time`,domain:Ye(d,t.resetsAt,S),tickFormatter:e=>he(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,minTickGap:40}),J(l,{domain:[0,E],allowDataOverflow:!0,tickFormatter:e=>`${Math.round(e)}%`,tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(r,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t})=>{if(e!==!0||t===void 0||t.length===0)return null;let n=t.find(e=>T.has(String(e.dataKey)));if(n===void 0||typeof n.value!=`number`)return null;let r=n.payload.at;return Y(o,{children:[J(`div`,{children:he(r)}),Y(`div`,{children:[n.value.toFixed(1),`% used`]})]})}}),x.map(e=>J(n,{type:`monotone`,dataKey:e.key,stroke:`var(--accent)`,strokeWidth:2,dot:e.points.length===1&&{r:2.5,fill:`var(--accent)`,stroke:`var(--accent)`},connectNulls:!0,isAnimationActive:!1},e.key)),S.map(e=>J(n,{type:`linear`,dataKey:e.key,stroke:`var(--ink-faint)`,strokeWidth:1.5,strokeDasharray:Ke.budget,dot:!1,connectNulls:!0,isAnimationActive:!1},e.key)),C===null?null:J(n,{type:`linear`,dataKey:qe,stroke:`var(--ink-dim)`,strokeWidth:1.5,strokeDasharray:Ke.projection,dot:!1,connectNulls:!0,isAnimationActive:!1})]})})})]})]})}var et=[`anthropic`,`openai`,`kimi`,`kilo`,`grok`,`custom`],tt={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`,kilo:`Kilo`,grok:`Grok`,custom:`OpenAI Compatible`},nt=X(H)`
|
|
31
|
+
border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
|
|
32
|
+
`,rt=X(B)`
|
|
33
|
+
width: 100%;
|
|
34
|
+
min-width: 140px;
|
|
35
|
+
height: 26px;
|
|
36
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
37
|
+
font-size: 12.5px;
|
|
38
|
+
background: transparent;
|
|
39
|
+
border-color: transparent;
|
|
40
|
+
|
|
41
|
+
&:hover:not(:disabled),
|
|
42
|
+
&:focus {
|
|
43
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
44
|
+
border-color: ${({theme:e})=>e.color.ruleStrong};
|
|
45
|
+
}
|
|
46
|
+
`,it=X(ve)`
|
|
47
|
+
width: 62px;
|
|
48
|
+
height: 26px;
|
|
49
|
+
`,at=X.span`
|
|
50
|
+
display: block;
|
|
51
|
+
padding-left: 9px;
|
|
52
|
+
font-size: 11px;
|
|
53
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
54
|
+
`,ot=X.div`
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: 96px 1fr;
|
|
57
|
+
align-items: center;
|
|
58
|
+
min-width: 208px;
|
|
59
|
+
gap: 6px;
|
|
60
|
+
`,st=X.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: 4px;
|
|
64
|
+
`;function ct(){let e=f();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function lt(){let{cadence:e}=D(),t=g(),n=_(e(1e4)),r=E(),i=T(),{commit:a}=ct(),[o,s]=K(!1),[c,l]=K(null),[d,f]=K(new Set),m=e=>f(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),h=Date.now(),v=t.data??[],x=R(n.data?.health??[],e=>e.credentialId),C=R(n.data?.quota??[],e=>e.credentialId),O=R(n.data?.burn??[],e=>e.credentialId),te=r.data?.quotaPollIntervalMs??3e5,re=v.filter(e=>e.enabled).length,F=t.isLoading?`Reading connected accounts…`:v.length===0?`No provider credentials are connected, so every request fails at the router.`:`${re} of ${v.length} accounts are enabled and eligible for routing.`;return Y(q,{children:[J(k,{legend:`Accounts`,title:`Provider accounts`,summary:F,actions:Y(y,{type:`button`,$variant:`primary`,onClick:()=>s(!0),children:[J(ne,{}),`Connect an account`]})}),t.isError?J(H,{legend:`Accounts`,children:J(be,{error:t.error,onRetry:()=>void t.refetch()})}):t.isLoading?J(H,{legend:`Accounts`,children:J(xe,{rows:5})}):v.length===0?J(H,{legend:`Accounts`,children:J(Se,{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:J(y,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>s(!0),children:`Connect an account`})})}):J(p,{$gap:4,children:et.filter(e=>v.some(t=>t.provider===e)).map(e=>{let t=v.filter(t=>t.provider===e);return J(nt,{$provider:e,legend:tt[e],meta:`${t.length} account${t.length===1?``:`s`}`,flush:!0,children:J(S,{children:Y(we,{children:[J(`thead`,{children:Y(`tr`,{children:[J(G,{$width:`24%`,children:`Account`}),J(G,{$width:`20%`,children:`Sign-in`}),J(G,{$align:`right`,$width:`86px`,children:`Tier`}),J(G,{$align:`right`,$width:`94px`,children:`Weight`}),J(G,{$align:`center`,$width:`86px`,children:`Enabled`}),J(G,{$width:`240px`,children:`Quota`}),J(G,{$align:`right`,$width:`88px`,children:`TTFT`}),J(G,{$align:`right`,$width:`130px`,children:`Token expires`}),J(G,{$width:`76px`})]})}),J(`tbody`,{children:t.map(e=>{let t=le(x.get(e.id)??[],h,e.enabled,e.disabledReason),n=C.get(e.id)??[],r=O.get(e.id)??[],i=ie(n),o=d.has(e.id);return Y(De,{children:[Y(Ce,{children:[Y(W,{children:[Y(b,{$gap:2,children:[J(de,{state:t.state,label:t.note===``?`healthy`:t.note}),J(rt,{defaultValue:e.label,"aria-label":`Label for ${e.label}`,onBlur:t=>{let n=t.target.value.trim();if(n.length===0||n===e.label){t.target.value=e.label;return}a(e.id,{label:n})}})]}),t.note===``?null:J(at,{children:t.note})]}),J(W,{children:Y(b,{$gap:1,children:[J(_e,{children:e.authType===`oauth`?`oauth`:`api key`}),e.accountEmail===null?null:J(u,{children:e.accountEmail})]})}),J(W,{$align:`right`,children:J(it,{min:1,step:1,defaultValue:e.tier,"aria-label":`Tier for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isInteger(n)||n<1||n===e.tier){t.target.value=String(e.tier);return}a(e.id,{tier:n})}})}),J(W,{$align:`right`,children:J(it,{min:.1,step:.1,defaultValue:e.weight,"aria-label":`Weight for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isFinite(n)||n<=0||n===e.weight){t.target.value=String(e.weight);return}a(e.id,{weight:n})}})}),J(W,{$align:`center`,children:J(M,{checked:e.enabled,label:`Route to ${e.label}`,onCheckedChange:t=>a(e.id,{enabled:t})})}),J(W,{children:i.length===0?J(u,{children:`unknown`}):J(st,{children:i.map(({window:e,fraction:t})=>Y(ot,{children:[J(ye,{fraction:t,label:`${ce[e.windowType]} window, ${Math.round(t*100)}% used`}),J(u,{children:se(e,h,te,P,L(r,e.windowType))})]},e.windowType))})}),J(W,{$align:`right`,$mono:!0,children:I(t.ttftMs)}),J(W,{$align:`right`,$mono:!0,children:e.expiresAt===null?`never`:P(e.expiresAt,h)}),J(W,{$align:`right`,children:Y(b,{$gap:1,$justify:`flex-end`,children:[n.length===0?null:J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":o,"aria-label":`${o?`Hide`:`Show`} quota history for ${e.label}`,title:`${o?`Hide`:`Show`} quota history for ${e.label}`,onClick:()=>m(e.id),children:J(o?ee:A,{})}),J(w,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${e.label}`,title:`Remove ${e.label}`,onClick:()=>l(e),children:J(j,{})})]})})]}),o?J(Ce,{children:J(W,{colSpan:9,children:J(Ze,{credentialId:e.id,windows:n,burn:r,pollIntervalMs:te,now:h})})}):null]},e.id)})})]})})},e)})}),J(He,{open:o,credentials:t.data??[],onOpenChange:s,onConnected:()=>void t.refetch()}),J(N,{open:c!==null,onOpenChange:e=>{e||l(null)},title:`Remove account`,body:c===null?``:`Removing "${c.label}" deletes its stored token. Any model target pointing at ${tt[c.provider]} loses this account, and reconnecting means authorizing again.`,confirmLabel:`Remove account`,busy:i.isPending,onConfirm:()=>{c!==null&&i.mutate(c.id,{onSettled:()=>l(null)})}})]})}var ut=lt;export{ut as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as e,nt as t,t as n,tt as r}from"./queries-
|
|
1
|
+
import{d as e,nt as t,t as n,tt as r}from"./queries-BOAAI06M.js";import{a as i,t as a}from"./Rack-DhVnjAjC.js";import{S as o}from"./Lamp-BDf7-dMa.js";import{i as s}from"./Field-b0ohzqzR.js";import{a as c,n as l,r as u,t as d}from"./States-6G9NsYha.js";import{useLayoutEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"styled-components";var 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=_(t)`
|
|
2
2
|
gap: ${({theme:e})=>e.space(2)};
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
`,x=_(s)`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,H as t,I as n,K as r,M as i,N as a,Q as o,S as s,V as c,_ as l,a as u,at as d,b as f,lt as p,m,nt as h,ot as g,rt as _,st as v,w as y}from"./queries-
|
|
1
|
+
import{$ as e,H as t,I as n,K as r,M as i,N as a,Q as o,S as s,V as c,_ as l,a as u,at as d,b as f,lt as p,m,nt as h,ot as g,rt as _,st as v,w as y}from"./queries-BOAAI06M.js";import{c as b,t as x}from"./Rack-DhVnjAjC.js";import{t as S}from"./Confirm-BO1xS6uH.js";import{C as ee,E as C,T as w,b as T}from"./Lamp-BDf7-dMa.js";import{r as E,t as D}from"./Field-b0ohzqzR.js";import{t as O}from"./Meter-stpt3vQu.js";import{a as k,i as A,n as j,r as M,t as N}from"./States-6G9NsYha.js";import{i as P,n as F,r as I,t as te}from"./Table-CVDZ69Zx.js";import{t as L}from"./Readout-VYnpaTMg.js";import{n as R}from"./reasons-Cb8yF4Oy.js";import{useQueryClient as ne}from"@tanstack/react-query";import{useCallback as re,useEffect as ie,useState as z}from"react";import{Fragment as ae,jsx as B,jsxs as V}from"react/jsx-runtime";import H from"styled-components";var U=b(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),W=b(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),G=b(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),K=b(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),q={systemd:`systemd is capturing this process, so a restart asks the manager to bring the unit back rather than signalling the gateway itself.`,container:`This gateway is running in a container, so a restart is an exit and the container's restart policy decides what happens next.`,none:`Nothing is supervising this process. It was started directly, and whatever stops it leaves it stopped.`},J=H.p`
|
|
2
2
|
font-size: 12px;
|
|
3
3
|
color: ${({theme:e})=>e.color.inkDim};
|
|
4
4
|
max-width: 72ch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,D as t,G as n,O as r,Q as i,at as a,dt as o,et as s,g as c,h as l,it as u,lt as d,nt as f,ot as p,rt as m,z as h}from"./queries-
|
|
1
|
+
import{$ as e,D as t,G as n,O as r,Q as i,at as a,dt as o,et as s,g as c,h as l,it as u,lt as d,nt as f,ot as p,rt as m,z as h}from"./queries-BOAAI06M.js";import{a as g,r as _,t as v}from"./Rack-DhVnjAjC.js";import{n as y,t as b}from"./TokenBreakdown-B9RanXin.js";import{D as x,E as S,O as C,S as w,T,_ as E,a as D,d as O,f as k,g as ee,l as te,m as A,n as j,o as M,r as ne,s as N,t as P,x as F}from"./Lamp-BDf7-dMa.js";import{n as I,t as L}from"./Chip-BltJSw8A.js";import{t as re}from"./Meter-stpt3vQu.js";import{a as R,n as z,t as B}from"./States-6G9NsYha.js";import{i as V,n as H,r as U,t as W}from"./Table-CVDZ69Zx.js";import{t as G}from"./Readout-VYnpaTMg.js";import{Fragment as K,jsx as q,jsxs as J}from"react/jsx-runtime";import Y from"styled-components";var X=Y(p)`
|
|
2
2
|
font-weight: 500;
|
|
3
3
|
display: block;
|
|
4
4
|
max-width: 24ch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,C as t,O as n,P as r,R as i,at as a,et as o,lt as s,nt as c,ot as l,p as u,rt as d,ut as f}from"./queries-
|
|
1
|
+
import{$ as e,C as t,O as n,P as r,R as i,at as a,et as o,lt as s,nt as c,ot as l,p as u,rt as d,ut as f}from"./queries-BOAAI06M.js";import{o as p,t as m}from"./Rack-DhVnjAjC.js";import{n as h,r as g,t as _}from"./CopyValue-BiiqC_Z2.js";import{t as v}from"./plus-C7a0RuII.js";import{t as y}from"./Modal-OALemCh6.js";import{t as b}from"./Toggle-DMk46RX2.js";import{t as x}from"./Confirm-BO1xS6uH.js";import{C as S}from"./Lamp-BDf7-dMa.js";import{t as C}from"./Chip-BltJSw8A.js";import{n as w,r as T,t as E}from"./Field-b0ohzqzR.js";import{t as D}from"./Meter-stpt3vQu.js";import{a as O,i as k,n as A,r as j,t as M}from"./States-6G9NsYha.js";import{i as N,n as P,r as F,t as I}from"./Table-CVDZ69Zx.js";import{Fragment as L,useState as R}from"react";import{Fragment as z,jsx as B,jsxs as V}from"react/jsx-runtime";import H from"styled-components";var U=[{dimension:`requests`,window:`1m`},{dimension:`requests`,window:`5h`},{dimension:`requests`,window:`1w`},{dimension:`tokens`,window:`1m`},{dimension:`tokens`,window:`5h`},{dimension:`tokens`,window:`1w`},{dimension:`spend`,window:`5h`},{dimension:`spend`,window:`1w`},{dimension:`concurrency`,window:null}];function W(e){return e.window===null?e.dimension:`${e.dimension}:${e.window}`}var G={requests:`Requests`,tokens:`Tokens`,spend:`Spend`,concurrency:`Concurrent`},K={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function q(e){let t=G[e.dimension];return e.window===null?t:`${t} ${K[e.window]}`}function J(e,t){return e===`spend`?`$${t<1?t.toFixed(4):t.toFixed(2)}`:t.toLocaleString(`en-US`)}function Y(e){return e.used===null||e.limit<=0?null:Math.max(0,e.used/e.limit)}function X(e){let t=null,n=-1;for(let r of e){let e=Y(r);e!==null&&e>n&&(t=r,n=e)}return t}function Z(e){let t={};for(let e of U)t[W(e)]=``;if(e===null)return t;for(let n of U){let r=n.window===null?e.concurrency:n.dimension===`requests`?e.requests?.[n.window]:n.dimension===`tokens`?e.tokens?.[n.window]:n.window===`1m`?void 0:e.spend?.[n.window];r!=null&&(t[W(n)]=String(r))}return t}function Q(e){let t={},n={},r={},i;for(let a of U){let o=(e[W(a)]??``).trim();if(o.length===0)continue;let s=Number(o),c=a.dimension===`spend`;if(!Number.isFinite(s)||s<=0||!c&&!Number.isInteger(s))return{problem:c?`${q(a)} must be an amount above zero, or blank for no limit.`:`${q(a)} must be a whole number above zero, or blank for no limit.`};a.window===null?i=s:a.dimension===`requests`?t[a.window]=s:a.dimension===`tokens`?n[a.window]=s:a.window!==`1m`&&(r[a.window]=s)}return{limits:{...Object.keys(t).length>0?{requests:t}:{},...Object.keys(n).length>0?{tokens:n}:{},...Object.keys(r).length>0?{spend:r}:{},...i===void 0?{}:{concurrency:i}}}}var ee=H.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
4
4
|
gap: ${({theme:e})=>e.space(2)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,C as t,D as n,at as r,et as ee,g as te,j as i,lt as a,n as ne,nt as o,ot as s,rt as c,s as l}from"./queries-
|
|
1
|
+
import{$ as e,C as t,D as n,at as r,et as ee,g as te,j as i,lt as a,n as ne,nt as o,ot as s,rt as c,s as l}from"./queries-BOAAI06M.js";import{a as u,t as d}from"./Rack-DhVnjAjC.js";import{n as f,r as p,t as m}from"./TokenBreakdown-B9RanXin.js";import{t as h}from"./Modal-OALemCh6.js";import{C as g,O as _,S as v,T as y,c as b,d as re,f as ie,k as x,l as S,t as ae,w as oe,x as se}from"./Lamp-BDf7-dMa.js";import{n as C,t as w}from"./Chip-BltJSw8A.js";import{i as T,n as E}from"./Field-b0ohzqzR.js";import{a as D,n as O,r as k,t as ce}from"./States-6G9NsYha.js";import{i as le,n as A,r as j,t as ue}from"./Table-CVDZ69Zx.js";import{useEffect as M,useMemo as N,useState as P}from"react";import{Fragment as F,jsx as I,jsxs as L}from"react/jsx-runtime";import R from"styled-components";var z={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},B=new Intl.NumberFormat(`en-US`),V=R.p`
|
|
2
2
|
font-size: 12px;
|
|
3
3
|
color: ${({theme:e})=>e.color.inkDim};
|
|
4
4
|
max-width: 62ch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,F as t,O as n,at as r,et as i,g as a,it as o,lt as s,nt as c,ot as l,ut as u,x as d,y as f,z as p}from"./queries-
|
|
1
|
+
import{$ as e,F as t,O as n,at as r,et as i,g as a,it as o,lt as s,nt as c,ot as l,ut as u,x as d,y as f,z as p}from"./queries-BOAAI06M.js";import{r as m}from"./index-B2twwe7y.js";import{c as h,t as g}from"./Rack-DhVnjAjC.js";import{t as _}from"./plus-C7a0RuII.js";import{t as v}from"./trash-2-C7-QrCg5.js";import{t as y}from"./Toggle-DMk46RX2.js";import{t as b}from"./Confirm-BO1xS6uH.js";import{n as x,t as S}from"./Chip-BltJSw8A.js";import{i as C,n as w,r as T,t as E}from"./Field-b0ohzqzR.js";import{t as D}from"./Meter-stpt3vQu.js";import{a as O,i as k,n as A,r as j,t as M}from"./States-6G9NsYha.js";import{i as N,n as ee,r as te,t as P}from"./catalog-BBKm8Ih8.js";import{useEffect as ne,useId as re,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var ie=h(`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`}]]),ae=h(`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`}]]),B=[`tier`,`health`,`quota`,`cost`,`latency`,`load`],oe={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 of this request against the other candidates`,latency:`Observed time to first token`,load:`Requests in flight on this pair right now`},se=z.li`
|
|
2
2
|
padding: ${({theme:e})=>e.space(2)} 0;
|
|
3
3
|
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
4
4
|
|
package/public/assets/{_app.plugins._pluginId-ByMziW8p.js → _app.plugins._pluginId-BbqXEJUB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{J as e,X as t,Y as n,Z as r,at as i,k as a}from"./queries-
|
|
1
|
+
import{J as e,X as t,Y as n,Z as r,at as i,k as a}from"./queries-BOAAI06M.js";import{a as o,s}from"./index-B2twwe7y.js";import{t as c}from"./Rack-DhVnjAjC.js";import{a as l,n as u,r as d,t as f}from"./States-6G9NsYha.js";import{Component as p,Suspense as m,createContext as h,lazy as g,useContext as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";var C=/%2e/i;function w(e,t){if(t.length===0)throw TypeError(`plugin api ${e} must not be empty`);if(t.startsWith(`/`))throw TypeError(`plugin api ${e} must be relative to the plugin's own prefix, got ${JSON.stringify(t)}`);if(t.includes(`..`)||C.test(t))throw TypeError(`plugin api ${e} must not escape the plugin's own prefix, got ${JSON.stringify(t)}`)}function T(e,t){if(w(`plugin id`,e),e.includes(`/`))throw TypeError(`plugin api plugin id must be a single path segment, got ${e}`);return w(`path`,t),`/api/plugins/${e}/${t}`}var E=new Map;function D(i){let a=E.get(i);if(a!==void 0)return a;let o={get:(e,t)=>n(T(i,e),t),post:(e,n)=>t(T(i,e),n),put:(e,t)=>r(T(i,e),t),del:t=>e(T(i,t))};return E.set(i,o),o}var O=h(e=>s(()=>import(e),[]));O.Provider;function k(){return _(O)}function A(e,t){let n=e?.default;if(n==null)throw Error(`plugin ${t} has no default export from definePluginUI`);if(typeof n.mount!=`function`)throw Error(`plugin ${t} exported a default without a mount function`);return n}function j(e,t,n){return g(async()=>{let r=A(await n(t),e);return{default:()=>r.mount({pluginId:e,api:D(e)})}})}var M=S.p`
|
|
2
2
|
font-size: 13px;
|
|
3
3
|
color: ${({theme:e})=>e.color.down};
|
|
4
4
|
`,N=S.p`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,L as t,O as n,at as r,c as i,et as a,it as o,lt as s,nt as c,o as l,z as u}from"./queries-
|
|
1
|
+
import{$ as e,L as t,O as n,at as r,c as i,et as a,it as o,lt as s,nt as c,o as l,z as u}from"./queries-BOAAI06M.js";import{t as d}from"./Rack-DhVnjAjC.js";import{t as f}from"./Toggle-DMk46RX2.js";import{i as p,n as m,t as h}from"./Field-b0ohzqzR.js";import{t as g}from"./Meter-stpt3vQu.js";import{a as _,i as v,n as y,r as b}from"./States-6G9NsYha.js";import{useEffect as x,useState as S}from"react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import E from"styled-components";var D=[{id:`claude`,label:`Claude Code`,where:`settings.json under ~/.claude`},{id:`opencode`,label:`opencode`,where:`opencode.json in your project`}],O=E(a)`
|
|
2
2
|
display: block;
|
|
3
3
|
white-space: pre;
|
|
4
4
|
overflow-x: auto;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,O as b,Ot as x,P as S,Q as C,R as ee,S as w,St as te,T,Tt as E,U as D,V as ne,W as re,X as ie,Y as ae,Z as oe,_ as se,_t as ce,a as le,at as O,b as k,bt as A,c as j,ct as M,d as ue,dt as de,et as fe,f as N,ft as pe,g as me,gt as he,h as ge,ht as _e,i as ve,it as ye,j as be,jt as xe,k as Se,kt as Ce,l as we,lt as Te,m as Ee,mt as De,n as Oe,nt as ke,o as Ae,ot as je,p as Me,pt as Ne,q as Pe,r as Fe,rt as Ie,s as P,st as Le,t as Re,tt as ze,u as Be,ut as Ve,v as He,vt as Ue,w as We,wt as Ge,x as F,xt as Ke,y as qe,yt as Je,z as Ye}from"./shared-Rzhx6i7s.js";import{$ as Xe,C as Ze,G as I,O as Qe,Q as $e,at as L,et as R,g as et,nt as tt,ot as nt,rt}from"./queries-BOAAI06M.js";import{i as it,n as at,r as ot}from"./index-B2twwe7y.js";import{a as st,r as z,t as ct}from"./Rack-DhVnjAjC.js";import{E as B,O as V,S as H,T as lt}from"./Lamp-BDf7-dMa.js";import{a as ut,n as dt,r as ft,t as pt}from"./States-6G9NsYha.js";import{i as mt,n as U,r as W,t as ht}from"./Table-CVDZ69Zx.js";import{t as gt}from"./catalog-BBKm8Ih8.js";import{t as G}from"./Readout-VYnpaTMg.js";import*as K from"react";import{PureComponent as _t,forwardRef as vt,useMemo as q,useRef as yt,useState as bt}from"react";import{jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";function xt(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function St(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var Ct=(e,t,n)=>C(e,`xAxis`,xt(e,t),n),wt=(e,t,n)=>fe(e,`xAxis`,xt(e,t),n),Tt=(e,t,n)=>C(e,`yAxis`,St(e,t),n),Et=(e,t,n)=>fe(e,`yAxis`,St(e,t),n),Dt=A([M,Ct,Tt,wt,Et],(e,t,n,r,i)=>Ue(e,`xAxis`)?Ne(t,r,!1):Ne(n,i,!1)),Ot=A([ze,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),kt=e=>{var t=M(e);return Ue(t,`xAxis`)?`yAxis`:`xAxis`},At=(e,t)=>kt(e)===`yAxis`?St(e,t):xt(e,t),jt=(t,n,r)=>e(t,kt(t),At(t,n),r),Mt=A([Ot,jt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=ke(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Nt=A([Ot,jt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(E)}}),Pt=A([M,Ct,Tt,wt,Et,Mt,O,Dt,Ot,ye,Nt],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return pn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),Ft=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],It=[`id`,`baseLine`];function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(null,arguments)}function Rt(e,t){if(e==null)return{};var n,r,i=zt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.y||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.y||0),l)),s(l)?K.createElement(`rect`,{x:a<o?a:a-c,y:0,width:c,height:Math.floor(l+(i?parseInt(`${i}`,10):1))}):null}function Vt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.x||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.x||0),l)),s(l)?K.createElement(`rect`,{x:0,y:a<o?a:a-c,width:l+(i?parseInt(`${i}`,10):1),height:Math.floor(c)}):null}function Ht(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?K.createElement(Vt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):K.createElement(Bt,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Ut(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=Rt(e,Ft),f=s===`vertical`?`vertical`:`horizontal`,m=u??!1,h=p(),g=d.id,_=d.baseLine,v=Rt(d,It),y=xe(v),b=K.createElement(je,Lt({},d,{id:g,baseLine:_,connectNulls:m,stroke:`none`,className:`recharts-area-area`,layout:f})),x=l!==`none`&&K.createElement(je,Lt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:d.points})),S=l!==`none`&&c&&Array.isArray(_)&&K.createElement(je,Lt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:_}));return o&&(i||n<1)?K.createElement(Ce,null,K.createElement(`defs`,null,K.createElement(`clipPath`,{id:h},K.createElement(Ht,{alpha:n,points:d.points??[],baseLine:_,layout:f,strokeWidth:d.strokeWidth}))),K.createElement(Ce,{clipPath:`url(#${h})`},b,x,S)):K.createElement(K.Fragment,null,b,x,S)}var Wt=[`id`],Gt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kt.apply(null,arguments)}function qt(e,t){if(e==null)return{};var n,r,i=Jt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yt(Object(n),!0).forEach(function(t){Xt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xt(e,t,n){return(t=Zt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zt(e){var t=Qt(e,`string`);return typeof t==`symbol`?t:t+``}function Qt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $t={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ne,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[Z(Z({},e.next),{},{x:a(e.prev.x,e.next.x,t),y:a(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:Ut,xAxisId:0,yAxisId:0,zIndex:Ie.area};function en(e,t){return e&&e!==`none`?e:t}var tn=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:en(r,i),value:he(n,t),payload:e}]},nn=K.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:x,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:he(o,t),hide:s,type:u,color:en(r,a),unit:c,formatter:l,graphicalItemId:d}};return K.createElement(D,{tooltipEntrySettings:f})});function rn(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=xe(r);return K.createElement(y,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function an(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return K.createElement(h,{value:t?r:void 0},n)}function on(e){var t=e.points,r=e.baseLine,i=e.needClip,a=e.clipPathId,o=e.props,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=o.layout,d=o.type,f=o.stroke,p=o.connectNulls,m=o.isRange,h=o.shape,g=o.id,_=qt(o,Wt),v=Z(Z({},n(_)),{},{id:g,points:t,connectNulls:p,type:d,baseLine:r,layout:u,stroke:f,isRange:m,animationElapsedTime:s,isAnimating:c,isEntrance:l});return K.createElement(K.Fragment,null,t?.length>1&&K.createElement(Ce,{clipPath:i?`url(#clipPath-${a})`:void 0},K.createElement(re,{option:h,DefaultShape:$t.shape,shapeProps:v})),K.createElement(rn,{points:t,props:_,clipPathId:a}))}function sn(e,t,n){if(s(e)){var r=s(t)?t:void 0;return a(r,e,n)}if(l(e)||Ge(e)){var i=s(t)?t:void 0;return a(i,0,n)}return e}function cn(e){var t=e.needClip,n=e.clipPathId,i=e.props,a=e.previousPointsRef,o=e.previousBaselineRef,s=i.points,c=i.baseLine,l=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,f=i.animationEasing,p=i.animationMatchBy,m=i.animationInterpolateFn,h=q(()=>({points:s,baseLine:c}),[s,c]),_=Ye(h,o),v=Te(),y=ee(i.onAnimationStart,i.onAnimationEnd),b=y.isAnimating,x=y.handleAnimationStart,S=y.handleAnimationEnd,C=_.startValue;if(v==null)return null;var w=Array.isArray(c)&&Array.isArray(C)?r(C,c,p):Array.isArray(c)?r(null,c,p):null;return K.createElement(g,{animationInput:h,animationIdPrefix:`recharts-area-`,items:s,previousItemsRef:a,isAnimationActive:l,animationBegin:u,animationDuration:d,animationEasing:f,onAnimationStart:x,onAnimationEnd:S,animationInterpolateFn:m,animationMatchBy:p,layout:v},(e,r,a)=>{var o=r===1?c:Array.isArray(c)?m(w,r,v):a?c:sn(c,C,r);return _.syncStepValue(o,r),K.createElement(an,{showLabels:!b,points:s},i.children,K.createElement(on,{points:e,baseLine:o,needClip:t,clipPathId:n,props:i,animationElapsedTime:r,isAnimating:b||r<1,isEntrance:a}),K.createElement(Pe,{label:i.label}))})}function ln(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=yt(null),a=yt();return K.createElement(cn,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var un=class extends _t{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,s=e.left,c=e.needClip,l=e.xAxisId,u=e.yAxisId,f=e.width,p=e.height,m=e.id,h=e.baseLine,g=e.zIndex;if(t)return null;var _=v(`recharts-area`,i),y=m,x=o(n),S=x.r,C=x.strokeWidth,ee=d(n),w=S*2+C,te=c?`url(#clipPath-${ee?``:`dots-`}${y})`:void 0;return K.createElement(ie,{zIndex:g},K.createElement(Ce,{className:_},c&&K.createElement(`defs`,null,K.createElement(b,{clipPathId:y,xAxisId:l,yAxisId:u}),!ee&&K.createElement(`clipPath`,{id:`clipPath-dots-${y}`},K.createElement(`rect`,{x:s-w/2,y:a-w/2,width:f+w,height:p+w}))),K.createElement(ln,{needClip:c,clipPathId:y,props:this.props})),K.createElement(be,{points:r,mainColor:en(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:te}),this.props.isRange&&Array.isArray(h)&&K.createElement(be,{points:h,mainColor:en(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:te}))}};function dn(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=qt(e,Gt),g=Ve(),v=oe(),y=Se(p,m).needClip,b=pe(),x=Ke(t=>Pt(t,e.id,b))??{},S=x.points,C=x.isRange,ee=x.baseLine,w=_();if(g!==`horizontal`&&g!==`vertical`||w==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var te=w.height,T=w.width,E=w.x,D=w.y;return!S||!S.length?null:K.createElement(un,Kt({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:ee,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:te,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:T,left:E,top:D,xAxisId:p,yAxisId:m}))}var fn=(e,t,n,r,i)=>{var a=n??t;if(s(a))return a;var o=e===`horizontal`?i:r,c=o.scale.domain();if(o.type===`number`){var l=Math.max(c[0],c[1]),u=Math.min(c[0],c[1]);return a===`dataMin`?u:a===`dataMax`||l<0?l:Math.max(Math.min(c[0],c[1]),0)}return a===`dataMin`?c[0]:a===`dataMax`?c[1]:c[0]};function pn(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=fn(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=ce(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=ce(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>ce(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:De({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:De({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function mn(e){var t=te(e,$t),n=pe();return K.createElement(u,{id:t.id,type:`area`},e=>K.createElement(K.Fragment,null,K.createElement(f,{legendPayload:tn(t)}),K.createElement(nn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),K.createElement(S,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:_e(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),K.createElement(dn,Kt({},t,{id:e}))))}var hn=K.memo(mn,Le);hn.displayName=`Area`;var gn=[`axis`],_n=vt((e,t)=>K.createElement(i,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:gn,tooltipPayloadSearcher:ae,categoricalChartProps:e,ref:t})),vn=[`axis`],yn=vt((e,t)=>K.createElement(i,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:vn,tooltipPayloadSearcher:ae,categoricalChartProps:e,ref:t})),bn=53,Q=9,xn=2,Sn=X.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: ${xn}px;
|
|
4
|
+
`,Cn=X.div`
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-rows: repeat(7, ${Q}px);
|
|
7
|
+
gap: ${xn}px;
|
|
8
|
+
padding-top: ${11}px;
|
|
9
|
+
font-size: 9px;
|
|
10
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
11
|
+
`,wn=X.div`
|
|
12
|
+
line-height: ${Q}px;
|
|
13
|
+
padding-right: 2px;
|
|
14
|
+
text-align: right;
|
|
15
|
+
`,Tn=X.div`
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: repeat(${bn}, ${Q}px);
|
|
18
|
+
gap: ${xn}px;
|
|
19
|
+
height: ${Q}px;
|
|
20
|
+
font-size: 9px;
|
|
21
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
22
|
+
`,En=X.div`
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
line-height: ${Q}px;
|
|
25
|
+
`,Dn=X.div`
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: repeat(${bn}, ${Q}px);
|
|
28
|
+
gap: ${xn}px;
|
|
29
|
+
`,On=X.div`
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-rows: repeat(7, ${Q}px);
|
|
32
|
+
gap: ${xn}px;
|
|
33
|
+
`,kn=X.div`
|
|
34
|
+
width: ${Q}px;
|
|
35
|
+
height: ${Q}px;
|
|
36
|
+
border-radius: 2px;
|
|
37
|
+
background: ${({$level:e})=>e===0?`var(--panel-sunk)`:`color-mix(in oklch, var(--accent) ${[0,24,46,70,100][e]??100}%, var(--panel-sunk))`};
|
|
38
|
+
border: 1px solid var(--rule);
|
|
39
|
+
visibility: ${({$future:e})=>e?`hidden`:`visible`};
|
|
40
|
+
|
|
41
|
+
&:hover,
|
|
42
|
+
&:focus-visible {
|
|
43
|
+
outline: 1px solid var(--ink-dim);
|
|
44
|
+
outline-offset: 1px;
|
|
45
|
+
}
|
|
46
|
+
`,An=X(tt)`
|
|
47
|
+
gap: ${xn}px;
|
|
48
|
+
`,jn=X(R)`
|
|
49
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
50
|
+
font-size: 11px;
|
|
51
|
+
`;function Mn(e){let t=e.filter(e=>e>0).sort((e,t)=>e-t);if(t.length===0)return[0,0,0];let n=e=>t[Math.min(t.length-1,Math.floor(t.length*e))]??0;return[n(.25),n(.5),n(.75)]}function Nn(e,[t,n,r]){return e<=0?0:e<=t?1:e<=n?2:e<=r?3:4}function Pn({days:e,now:t}){let[n,r]=bt(`tokens`),[i,a]=bt(null),o=me(n),s=q(()=>{let n=new Map;for(let t of e){let e=Number(t.key);Number.isFinite(e)&&n.set(qe(e),{requests:t.requests,errors:t.errors,costUsd:t.costUsd,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheWriteTokens:t.cacheWriteTokens,rtkSavedTokens:t.rtkSavedTokens,rtkAppliedRequests:t.rtkAppliedRequests,durationMsSum:t.durationMsSum})}let r=new Date(qe(t));r.setDate(r.getDate()+(6-r.getDay())-370);let i=qe(t);return Array.from({length:bn},()=>Array.from({length:7},()=>{let e=r.getTime();return r.setDate(r.getDate()+1),{at:e,totals:n.get(e)??we,future:e>i}}))},[e,t]),c=s.flat(),l=Mn(c.map(e=>o.of({key:``,...e.totals}))),u=c.reduce((e,t)=>Be(e,N(t.totals)),we),d=c.reduce((e,t)=>e+ +(t.totals.requests>0),0),f=(e,t)=>`${e}: ${H(t.requests)} requests, ${H(ue(t))} tokens, ${V(t.costUsd)}`;return J(ut,{legend:`Activity`,meta:i===null?`${H(d)} active days`:void 0,actions:J(Oe,{children:ve.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===n,"aria-pressed":e.id===n,onClick:()=>r(e.id),children:e.label},e.id))}),children:Y(L,{$gap:2,children:[J(rt,{children:J(L,{$gap:1,style:{width:611},children:Y(Sn,{children:[J(Cn,{"aria-hidden":`true`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>J(wn,{children:e},t))}),Y(L,{$gap:1,children:[J(Tn,{"aria-hidden":`true`,children:s.map((e,t)=>{let n=e[0],r=s[t-1]?.[0],i=n!==void 0&&(r===void 0||new Date(r.at).getMonth()!==new Date(n.at).getMonth());return J(En,{children:i&&n!==void 0?new Date(n.at).toLocaleDateString(`en-GB`,{month:`short`}):``},n?.at??t)})}),J(Dn,{role:`grid`,"aria-label":`${o.label} per day over the last year`,children:s.map(e=>J(On,{role:`row`,children:e.map(e=>J(kn,{role:`gridcell`,tabIndex:-1,"aria-label":f(Ee(e.at),e.totals),title:f(Ee(e.at),e.totals),$future:e.future,$level:e.future?0:Nn(o.of({key:``,...e.totals}),l),onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e.at))},e[0]?.at))})]})]})})}),Y(tt,{$justify:`space-between`,$wrap:!0,children:[J(jn,{children:i===null?f(`Last 12 months`,u):f(Ee(i.at),i.totals)}),Y(tt,{$gap:1,children:[J(Xe,{children:`Less`}),J(An,{"aria-hidden":`true`,children:[0,1,2,3,4].map(e=>J(kn,{$level:e,$future:!1},e))}),J(Xe,{children:`More`})]})]})]})})}function Fn({buckets:e,by:t,since:n,until:r,metric:i,names:a}){let o=F(n,r,t),s=new Map,c=new Map;for(let n of e){let e=n.split??`unknown`;s.set(e,Be(s.get(e)??we,n));let r=c.get(e)??new Map,a=ge(n.key,t);r.set(a,(r.get(a)??0)+i.of(n)),c.set(e,r)}let l=[...s.entries()].sort((e,t)=>i.of(N(t[1]))-i.of(N(e[1])));return J(rt,{children:Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Key`}),J(W,{children:`Trend`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Failed`}),J(W,{$align:`right`,children:`Tokens`}),J(W,{$align:`right`,children:`Mean`}),J(W,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:l.map(([e,t])=>{let n=c.get(e)??new Map,r=e===`unknown`?`Unattributed`:a.get(e)??e;return Y(mt,{children:[J(U,{children:J(nt,{style:{display:`block`,maxWidth:`28ch`},children:r})}),J(U,{style:{width:120},children:J(z,{values:o.map(e=>n.get(e)??0),height:20,label:`${r}: ${i.format(i.of(N(t)))} over the window`})}),J(U,{$align:`right`,$mono:!0,children:H(t.requests)}),J(U,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:B(t.requests===0?0:t.errors/t.requests,0)}),J(U,{$align:`right`,$mono:!0,children:H(ue(t))}),J(U,{$align:`right`,$mono:!0,children:lt(t.requests===0?null:t.durationMsSum/t.requests)}),J(U,{$align:`right`,$mono:!0,children:V(t.costUsd)})]},e)})})]})})}var In=6,Ln=`__other__`,Rn=`unknown`;function zn(e,t){let n=t.get(e);return n===void 0?at.find(t=>gt[t].models.some(t=>t.id===e))??null:n}function Bn(e,t){return e===null?`var(--ink-faint)`:`color-mix(in oklch, ${it(e)} ${Math.max(30,100-t*22)}%, var(--panel))`}function Vn({buckets:e,by:n,since:r,until:i,metric:a,providers:o}){let s=[...Me(e,a).entries()],c=s.slice(0,In),l=s.slice(In),u=[];for(let e of[...at,null])c.filter(([t])=>zn(t,o)===e).forEach(([t,n],r)=>{u.push({name:t,label:t===Rn?`Unresolved`:t,color:Bn(e,r),totals:n})});l.length>0&&u.push({name:Ln,label:`${l.length} more`,color:`var(--ink-faint)`,totals:l.reduce((e,[,t])=>Be(e,N(t)),we)});let d=new Set(c.map(([e])=>e)),f=new Map;for(let t of e){let e=t.split??Rn,r=`${ge(t.key,n)} ${d.has(e)?e:Ln}`;f.set(r,(f.get(r)??0)+a.of(t))}let p=F(r,i,n).map(e=>{let t={at:e};for(let n of u)t[n.name]=f.get(`${e} ${n.name}`)??0;return t}),h=new Map(u.map(e=>[e.name,e.label]));return Y(L,{$gap:2,children:[J(Re,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>{if(e!==!0||t===void 0||t.length===0)return null;let i=t.filter(e=>Number(e.value??0)>0);return Y(j,{children:[J(`div`,{children:k(Number(r),n)}),i.length===0?J(`div`,{children:`No ${a.label.toLowerCase()}`}):i.map(e=>Y(`div`,{children:[h.get(String(e.dataKey))??String(e.dataKey),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}}),u.map(e=>J(hn,{type:`monotone`,dataKey:e.name,stackId:`models`,stroke:e.color,strokeWidth:2,fill:e.color,fillOpacity:.22,isAnimationActive:!1},e.name))]})})}),J(Fe,{children:u.map(e=>Y(`span`,{children:[J(P,{$color:e.color}),` `,J(nt,{title:`${e.label}: ${a.format(a.of(N(e.totals)))} ${a.label.toLowerCase()}`,style:{display:`inline-block`,maxWidth:`24ch`,verticalAlign:`bottom`},children:e.label})]},e.name))})]})}var Hn=`unknown`;function Un(e){let t=at.find(t=>t===e);return t===void 0?`var(--ink-faint)`:it(t)}function Wn(e){let t=at.find(t=>t===e);return t===void 0?`Unresolved`:ot[t]}function Gn({buckets:e,by:n,since:r,until:i,metric:a}){let o=Me(e,a),s=[...at,Hn].map(e=>({name:e,totals:o.get(e)})).filter(e=>e.totals!==void 0),c=s.map(e=>e.name),l=F(r,i,n),u=He(e,l,n,a),d=[...o.values()].reduce((e,t)=>e+t.requests,0);return Y(L,{$gap:3,children:[J(Re,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:u,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:48}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(j,{children:[J(`div`,{children:k(Number(r),n)}),t.map(e=>Y(`div`,{children:[Wn(String(e.dataKey)),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}),c.map(e=>J(hn,{type:`monotone`,dataKey:e,stackId:`providers`,stroke:Un(e),strokeWidth:2,fill:Un(e),fillOpacity:.22,isAnimationActive:!1},e))]})})}),J(Fe,{children:c.map(e=>Y(`span`,{children:[J(P,{$color:Un(e)}),` `,Wn(e)]},e))}),Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Provider`}),J(W,{$align:`right`,children:`Share`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Failed`}),J(W,{$align:`right`,children:`Tokens`}),J(W,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:s.map(({name:e,totals:t})=>Y(mt,{children:[Y(U,{children:[J(P,{$color:Un(e)}),` `,Wn(e)]}),J(U,{$align:`right`,$mono:!0,children:B(d===0?0:t.requests/d,0)}),J(U,{$align:`right`,$mono:!0,children:H(t.requests)}),J(U,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:H(t.errors)}),J(U,{$align:`right`,$mono:!0,children:H(ue(t))}),J(U,{$align:`right`,$mono:!0,children:V(t.costUsd)})]},e))})]})]})}var Kn=X.li`
|
|
52
|
+
display: grid;
|
|
53
|
+
grid-template-columns: minmax(0, 20ch) 1fr auto;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
56
|
+
`,qn=X.ol`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
60
|
+
`,Jn=X.div`
|
|
61
|
+
height: 8px;
|
|
62
|
+
border-radius: 2px;
|
|
63
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
64
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
`,Yn=X.div`
|
|
67
|
+
width: ${({$share:e})=>`${Math.max(1.5,e*100)}%`};
|
|
68
|
+
height: 100%;
|
|
69
|
+
border-radius: 0 2px 2px 0;
|
|
70
|
+
background: ${({theme:e,$fault:t})=>t?e.color.down:e.color.accent};
|
|
71
|
+
opacity: 0.85;
|
|
72
|
+
`,Xn=X(nt)`
|
|
73
|
+
display: block;
|
|
74
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
`,Zn=12;function Qn({buckets:e,metric:t,names:n,unknownLabel:r}){let i=new Map;for(let t of e)i.set(t.key,Be(i.get(t.key)??we,t));let a=e=>e===`unknown`?r??`Unattributed`:n?.get(e)??e,o=[...i.entries()].map(([e,n])=>({name:a(e),entry:n,value:t.of(N(n))})).sort((e,t)=>t.value-e.value),s=o.slice(0,Zn),c=o.slice(Zn),l=s[0]?.value??0;return Y(L,{$gap:3,children:[J(qn,{children:s.map(({name:e,entry:n,value:r})=>Y(Kn,{children:[J(Xn,{title:e,children:e}),J(Jn,{children:J(Yn,{$share:l===0?0:r/l,$fault:n.requests>0&&n.errors===n.requests})}),Y(tt,{$gap:2,children:[J(R,{$size:`12px`,children:t.format(r)}),J(R,{$size:`11px`,$dim:!0,children:V(n.costUsd)})]})]},e))}),c.length===0?null:J(R,{$size:`11px`,$dim:!0,children:`+ ${c.length} more, ${H(c.reduce((e,t)=>e+t.entry.requests,0))} requests`})]})}function $({legend:e,meta:t,actions:n,query:r,empty:i,isEmpty:a,children:o}){return J(ut,{legend:e,meta:t,actions:n,children:r.isError?J(dt,{error:r.error,onRetry:r.refetch}):r.isLoading?J(ft,{rows:4}):a?J(pt,{legend:i.legend,message:i.message}):o})}var $n=[{id:`inputTokens`,label:`Uncached input`,opacity:.95},{id:`outputTokens`,label:`Output`,opacity:.7},{id:`cacheReadTokens`,label:`Cache read`,opacity:.45},{id:`cacheWriteTokens`,label:`Cache write`,opacity:.22}];function er({buckets:e,by:n,since:r,until:i}){let a=new Map;for(let t of e)a.set(ge(t.key,n),t);let o=F(r,i,n).map(e=>{let t=a.get(e);return{at:e,inputTokens:t?.inputTokens??0,outputTokens:t?.outputTokens??0,cacheReadTokens:t?.cacheReadTokens??0,cacheWriteTokens:t?.cacheWriteTokens??0}}),s=$n.map(e=>({...e,value:o.reduce((t,n)=>t+n[e.id],0)})),c=s.reduce((e,t)=>e+t.value,0);return Y(L,{$gap:3,children:[J(Re,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:44,tickFormatter:e=>H(e)}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(j,{children:[J(`div`,{children:k(Number(r),n)}),$n.map(e=>Y(`div`,{children:[e.label,` `,H(Number(t.find(t=>t.dataKey===e.id)?.value??0))]},e.id))]})}),$n.map(e=>J(hn,{type:`monotone`,dataKey:e.id,stackId:`tokens`,stroke:`var(--accent)`,strokeOpacity:e.opacity,strokeWidth:1.5,fill:`var(--accent)`,fillOpacity:e.opacity*.5,isAnimationActive:!1},e.id))]})})}),J(Fe,{children:s.map(e=>Y(tt,{$gap:1,children:[J(P,{$color:`var(--accent)`,style:{opacity:e.opacity}}),J(`span`,{children:e.label}),J(R,{$size:`11px`,children:H(e.value)}),J(R,{$size:`11px`,$dim:!0,children:B(c===0?0:e.value/c,0)})]},e.id))})]})}function tr({buckets:e,by:n,since:r,until:i}){let a=new Map;for(let t of e)a.set(ge(t.key,n),t);let o=F(r,i,n).map(e=>{let t=a.get(e);return{at:e,label:k(e,n),requests:t?.requests??0,errors:t?.errors??0,costUsd:t?.costUsd??0,tokens:t===void 0?0:ue(t)}});return Y(L,{$gap:2,children:[J(Re,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(yn,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`label`,tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t})=>{if(e!==!0||t===void 0||t.length===0)return null;let n=t[0]?.payload;return n===void 0?null:Y(j,{children:[J(`div`,{children:n.label}),Y(`div`,{children:[H(n.requests),` requests`]}),Y(`div`,{children:[H(n.errors),` failed`]}),Y(`div`,{children:[H(n.tokens),` tokens`]}),J(`div`,{children:V(n.costUsd)})]})}}),J(hn,{type:`monotone`,dataKey:`requests`,stroke:`none`,fill:`var(--accent)`,fillOpacity:.12,isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`requests`,stroke:`var(--accent)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`errors`,stroke:`var(--down)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1})]})})}),Y(Fe,{children:[Y(`span`,{children:[J(P,{$color:`var(--accent)`}),` Requests`]}),Y(`span`,{children:[J(P,{$color:`var(--down)`}),` Failed`]})]})]})}var nr=X.div`
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(
|
|
79
|
+
auto-fit,
|
|
80
|
+
minmax(max(180px, calc((100% - 4 * ${({theme:e})=>e.space(3)}) / 5)), 1fr)
|
|
81
|
+
);
|
|
82
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
83
|
+
`,rr=864e5,ir=[{id:`requestedModel`,label:`As requested`,column:`Virtual model`},{id:`model`,label:`As served`,column:`Upstream model`}];function ar(){let{cadence:e}=st(),[t,n]=bt(`24h`),[r,i]=bt(`tokens`),[a,o]=bt(`model`),s=se(t),c=me(r),l=q(()=>s.grain===`daily`?qe(Date.now()-s.ms):Math.floor((Date.now()-s.ms)/6e4)*6e4,[s]),u=q(()=>l+s.ms,[l,s]),d=q(()=>qe(Date.now()-371*rr),[]),f={since:l,grain:s.grain},p=I({...f,groupBy:s.by},e(6e4)),m=I({...f,groupBy:s.by,splitBy:`provider`},e(6e4)),h=I({...f,groupBy:s.by,splitBy:`model`},e(6e4)),g=I({...f,groupBy:s.by,splitBy:`apiKey`},e(6e4)),_=I({...f,groupBy:a},e(6e4)),v=I({...f,groupBy:`credential`},e(6e4)),y=I({since:d,grain:`daily`,groupBy:`day`},e(3e5)),b=Ze(),x=et(),S=Qe(),C=q(()=>{let e=new Map;for(let t of S.data??[])for(let n of t.targets)e.set(n.model,n.provider);return e},[S.data]),ee=q(()=>{let e=new Map;for(let t of b.data??[])e.set(t.id,t.label);return e},[b.data]),te=q(()=>{let e=new Map;for(let t of x.data??[])e.set(t.id,t.label);return e},[x.data]),T=p.data??[],E=w(T),D=E.inputTokens+E.cacheReadTokens+E.cacheWriteTokens,ne=ue(E),re=E.requests===0?0:E.outputTokens/E.requests,ie=D===0?0:E.cacheReadTokens/D,ae=D===0?0:E.cacheWriteTokens/D,oe=E.requests===0?0:E.costUsd/E.requests,ce=F(l,u,s.by),O=new Map(T.map(e=>[ge(e.key,s.by),e])),k=e=>ce.map(e),A=e=>e>=.25?`down`:e>=.05?`warn`:`ok`,j=E.requests===0?0:E.errors/E.requests,M={legend:`Nothing recorded`,message:`No requests landed in this window. Widen the range, or send traffic through the gateway.`};return Y(L,{$gap:4,children:[J(ct,{legend:`Usage`,title:`Requests, tokens, and spend`,summary:p.isLoading?`Reading usage…`:`${H(E.requests)} requests and ${V(E.costUsd)} over the last ${s.label}.`,actions:J(Oe,{children:le.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===t,"aria-pressed":e.id===t,onClick:()=>n(e.id),children:e.id},e.id))})}),Y(nr,{"data-testid":`usage-summary-deck`,children:[J(G,{legend:`Requests`,value:H(E.requests),unit:s.label,trace:J(z,{values:k(e=>O.get(e)?.requests??0),overlay:k(e=>O.get(e)?.errors??0),label:`${E.requests} requests, ${E.errors} of them failed`})}),J(G,{legend:`Error rate`,value:B(j),unit:`${H(E.errors)} failed`,tone:E.requests===0?`ink`:A(j),trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.errors/t.requests}),color:`var(--down)`,label:`${E.errors} failed requests against ${E.requests} total`})}),J(G,{legend:`Prompt input`,value:H(D),unit:`${H(E.inputTokens)} uncached`,trace:J(z,{values:k(e=>{let t=O.get(e);return(t?.inputTokens??0)+(t?.cacheReadTokens??0)+(t?.cacheWriteTokens??0)}),label:`${D} prompt input tokens over the window`})}),J(G,{legend:`Output`,value:H(E.outputTokens),unit:`mean ${H(re)}/request`,trace:J(z,{values:k(e=>O.get(e)?.outputTokens??0),label:`${E.outputTokens} output tokens over the window`})}),J(G,{legend:`Cache reads`,value:H(E.cacheReadTokens),unit:`${B(ie,0)} of prompt`,trace:J(z,{values:k(e=>O.get(e)?.cacheReadTokens??0),label:`${E.cacheReadTokens} cache-read tokens over the window`})}),J(G,{legend:`Cache writes`,value:H(E.cacheWriteTokens),unit:`${B(ae,0)} of prompt`,trace:J(z,{values:k(e=>O.get(e)?.cacheWriteTokens??0),label:`${E.cacheWriteTokens} cache-write tokens over the window`})}),J(G,{legend:`RTK saved`,value:H(E.rtkSavedTokens),unit:`${H(E.rtkAppliedRequests)} requests`,trace:J(z,{values:k(e=>O.get(e)?.rtkSavedTokens??0),label:`${E.rtkSavedTokens} estimated tokens saved by RTK over the window`})}),J(G,{legend:`Mean duration`,value:lt(E.requests===0?null:E.durationMsSum/E.requests),unit:`per request`,trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.durationMsSum/t.requests}),color:`var(--ok)`,label:`mean request duration over the window`})}),J(G,{legend:`Spend`,value:V(E.costUsd),unit:s.label,trace:J(z,{values:k(e=>O.get(e)?.costUsd??0),color:`var(--warn)`,label:`spend over the window, ${V(E.costUsd)} total`})}),J(G,{legend:`Cost / request`,value:V(oe),unit:`mean`,trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.costUsd/t.requests}),color:`var(--warn)`,label:`${V(oe)} mean cost per request over the window`})})]}),J($,{legend:`Traffic`,meta:s.by===`hour`?`By hour`:`By day`,query:p,isEmpty:T.length===0,empty:M,children:J(tr,{buckets:T,by:s.by,since:l,until:u})}),J(Oe,{children:ve.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===r,"aria-pressed":e.id===r,onClick:()=>i(e.id),children:`Rank by ${e.label.toLowerCase()}`},e.id))}),J($,{legend:`Traffic by upstream model`,meta:`${c.label}, ${s.by===`hour`?`by hour`:`by day`}`,query:h,isEmpty:(h.data??[]).length===0,empty:M,children:J(Vn,{buckets:h.data??[],by:s.by,since:l,until:u,metric:c,providers:C})}),Y($e,{$min:`480px`,$gap:4,children:[Y(L,{$gap:4,children:[J($,{legend:`Providers`,meta:c.label,query:m,isEmpty:(m.data??[]).length===0,empty:M,children:J(Gn,{buckets:m.data??[],by:s.by,since:l,until:u,metric:c})}),J(Pn,{days:y.data??[],now:Date.now()})]}),Y(L,{$gap:4,children:[J($,{legend:`Token mix`,meta:H(ne),query:p,isEmpty:T.length===0,empty:M,children:J(er,{buckets:T,by:s.by,since:l,until:u})}),J($,{legend:`Models`,meta:ir.find(e=>e.id===a)?.column,query:_,isEmpty:(_.data??[]).length===0,empty:M,actions:J(Oe,{children:ir.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===a,"aria-pressed":e.id===a,onClick:()=>o(e.id),children:e.label},e.id))}),children:J(Qn,{buckets:_.data??[],metric:c})}),J($,{legend:`Accounts`,meta:c.label,query:v,isEmpty:(v.data??[]).length===0,empty:M,children:J(Qn,{buckets:v.data??[],metric:c,names:te,unknownLabel:`No account`})})]})]}),J($,{legend:`API keys`,meta:c.label,query:g,isEmpty:(g.data??[]).length===0,empty:M,children:J(Fn,{buckets:g.data??[],by:s.by,since:l,until:u,metric:c,names:ee})})]})}var or=ar;export{or as component};
|