omnigateway 0.4.13 → 0.5.1
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 +52 -1
- package/bin/omni.js +6970 -6733
- package/gateway.js +9440 -8038
- package/package.json +1 -1
- package/public/assets/{CopyValue-C2DkO9Yz.js → CopyValue-DNNJGDI5.js} +5 -5
- package/public/assets/{Field-B79Yxdit.js → Field-B2rnk3JM.js} +1 -1
- package/public/assets/{Match-BWa6L0L1.js → Match-CvkEmOIG.js} +1 -1
- package/public/assets/{Panel-CoulMx6R.js → Panel-BeQOQoap.js} +2 -2
- package/public/assets/Rack-DdhpgQWD.js +316 -0
- package/public/assets/{Readout-D1XEfywe.js → Readout-CZfn5JDy.js} +1 -1
- package/public/assets/RequestTable-I1TrD689.js +11 -0
- package/public/assets/States-2kaQxx-s.js +54 -0
- package/public/assets/SummaryDeck-BisdRswW.js +15 -0
- package/public/assets/{Toggle-CRrH9nDt.js → Toggle-BvOELhpy.js} +1 -1
- package/public/assets/{TokenBreakdown-C2NsJnqO.js → TokenBreakdown-En1JT4tT.js} +1 -1
- package/public/assets/WindowChart-Bvbkz9rt.js +11 -0
- package/public/assets/_app-a3VUev6k.js +1 -0
- package/public/assets/_app.accounts-CYPB-7Xt.js +59 -0
- package/public/assets/_app.console-C4x5F3d0.js +44 -0
- package/public/assets/_app.database-B-9oB52r.js +24 -0
- package/public/assets/_app.index-NBeanmyf.js +62 -0
- package/public/assets/_app.keys-DK9jdOqT.js +82 -0
- package/public/assets/_app.logs-Dr6fApsE.js +58 -0
- package/public/assets/_app.models-CGBQ2QaS.js +148 -0
- package/public/assets/_app.plugins._pluginId-DXzhupNH.js +20 -0
- package/public/assets/_app.settings-zTFRyxhZ.js +58 -0
- package/public/assets/_app.usage-BCCimHY0.js +76 -0
- package/public/assets/chevron-right-mGs1is3r.js +1 -0
- package/public/assets/client-CQGHWD56.js +39 -0
- package/public/assets/index-C3LoGDKu.js +178 -0
- package/public/assets/login-bJoYdBqx.js +45 -0
- package/public/assets/plus-Bqi8Y2Xd.js +1 -0
- package/public/assets/queries-GAue98pY.js +145 -0
- package/public/assets/reasons-Du1OBWAM.js +1 -0
- package/public/assets/shared-DQOWYTp3.js +77 -0
- package/public/assets/stream-Bu-m1Z1Y.js +1 -0
- package/public/assets/{trash-2-DwMK-JrZ.js → trash-2-BDA1rQVQ.js} +1 -1
- package/public/index.html +3 -3
- package/public/shared/dashboard-sdk.js +1 -1
- package/public/assets/Rack-HM36SprU.js +0 -314
- package/public/assets/States-DtkkMzEu.js +0 -54
- package/public/assets/_app-DVpIsUid.js +0 -1
- package/public/assets/_app.accounts-64d_cxir.js +0 -64
- package/public/assets/_app.console-BBuBmLRI.js +0 -44
- package/public/assets/_app.database-J9Ujio8l.js +0 -24
- package/public/assets/_app.index-BX4yKEXO.js +0 -62
- package/public/assets/_app.keys-2sKwhZJc.js +0 -76
- package/public/assets/_app.logs-DuHXYrZU.js +0 -68
- package/public/assets/_app.models-B0kTfPtn.js +0 -148
- package/public/assets/_app.plugins._pluginId-BOXRBToU.js +0 -20
- package/public/assets/_app.settings-DoaOUmc1.js +0 -46
- package/public/assets/_app.usage-B5sxB40E.js +0 -83
- package/public/assets/index-iCfSaRSG.js +0 -178
- package/public/assets/login-B9CJqU--.js +0 -36
- package/public/assets/plus-DKapAGoR.js +0 -1
- package/public/assets/queries-CX9mStps.js +0 -145
- package/public/assets/reasons-Cb8yF4Oy.js +0 -1
- package/public/assets/shared-Cct_4xwp.js +0 -84
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-a3VUev6k.js","assets/Match-CvkEmOIG.js","assets/queries-GAue98pY.js","assets/matchContext-BOenO3J2.js","assets/Rack-DdhpgQWD.js","assets/States-2kaQxx-s.js","assets/stream-Bu-m1Z1Y.js","assets/client-CQGHWD56.js","assets/shared-DQOWYTp3.js","assets/chevron-right-mGs1is3r.js","assets/Field-B2rnk3JM.js","assets/Meter-stpt3vQu.js","assets/Panel-BeQOQoap.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-Bvbkz9rt.js","assets/RequestTable-I1TrD689.js","assets/TokenBreakdown-En1JT4tT.js","assets/Chip-BltJSw8A.js","assets/SummaryDeck-BisdRswW.js","assets/Readout-CZfn5JDy.js","assets/login-bJoYdBqx.js","assets/reasons-Du1OBWAM.js","assets/_app.index-NBeanmyf.js","assets/_app.accounts-CYPB-7Xt.js","assets/CopyValue-DNNJGDI5.js","assets/plus-Bqi8Y2Xd.js","assets/trash-2-BDA1rQVQ.js","assets/Toggle-BvOELhpy.js","assets/catalog-BBKm8Ih8.js","assets/_app.console-C4x5F3d0.js","assets/_app.database-B-9oB52r.js","assets/_app.keys-DK9jdOqT.js","assets/_app.logs-Dr6fApsE.js","assets/_app.models-CGBQ2QaS.js","assets/_app.settings-zTFRyxhZ.js","assets/_app.usage-BCCimHY0.js","assets/_app.plugins._pluginId-DXzhupNH.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$t as e,At as t,Bt as n,Dt as r,Ft as i,Gt as a,Ht as o,It as s,Jt as c,Kt as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Qt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Xt as S,Yt as C,Zt as w,bt as T,ct as E,en as D,i as ee,it as te,jt as ne,kt as re,mt as ie,nn as ae,nt as oe,qt as se,tn as ce,vt as le,wt as ue,xt as de,zt as fe}from"./queries-GAue98pY.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-CvkEmOIG.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ue()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{qe=!1}}))}function Qe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function j(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ot(e){return e instanceof Response&&!!e.options}function st(e){return{input:({url:t})=>{for(let n of e)t=lt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ut(e[n],t);return t}}}function ct(e){let n=d(e.basepath),r=`/${n}`,i=e.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let n=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return n===i?t.pathname=`/`:n.startsWith(a)&&(t.pathname=t.pathname.slice(r.length)),t},output:({url:e})=>(e.pathname=t([`/`,n,e.pathname]),e)}}function lt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function dt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{x(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var M=`__TSR_index`,ft=`popstate`,pt=`beforeunload`;function mt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=vt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[M];i=ht(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[M];i=ht(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[M]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function ht(e,t){t||={};let n=yt();return{...t,key:n,__TSR_key:n,[M]:e}}function gt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>vt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=yt();t.history.replaceState({[M]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=vt(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[M]-l.state[M],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=mt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pt,x,{capture:!0}),t.removeEventListener(ft,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(pt,x,{capture:!0}),t.addEventListener(ft,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function _t(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function vt(e,t){let n=_t(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=yt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[M]:0,key:a,__TSR_key:a}}}function yt(){return(Math.random()+1).toString(36).substring(7)}function bt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function xt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function St({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ct(e,t,n,r){for(let i of t){if(r?.()===!1)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r?.()===!1)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var wt=class{constructor(t,i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=p(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:gt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=b(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=dt(this.latestLocation,e),Ze(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=d(a);t&&t!==`/`&&e.push(ct({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:st(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=n(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&fe(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(t,n)=>{let r=({pathname:t,search:r,hash:i,href:o,state:s})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(t)){let o=this.options.parseSearch(r),c=this.options.stringifySearch(o);return{href:t+c+i,publicHref:t+c+i,pathname:a(t).path,external:!1,searchStr:c,search:e(n?.search,o),hash:a(i.slice(1)).path,state:D(n?.state,s)}}let c=new URL(o,this.origin),l=lt(this.rewrite,c),u=this.options.parseSearch(l.search),d=this.options.stringifySearch(u);return l.search=d,{href:l.href.replace(l.origin,``),publicHref:o,pathname:a(l.pathname).path,external:!!this.rewrite&&l.origin!==this.origin,searchStr:d,search:e(n?.search,u),hash:a(l.hash.slice(1)).path,state:D(n?.state,s)}},i=r(t),{__tempLocation:o,__tempKey:s}=i.state;if(o&&(!s||s===this.tempLocationKey)){let e=r(o);return e.state.key=i.state.key,e.state.__TSR_key=i.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:i}}return i},this.resolvePathWithBase=(e,t)=>ne({base:e,to:t.includes(`//`)?r(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=u(m(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=t=>{let n=(n={})=>{let r=n._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);n.from;let o=n.unsafeRelative===`path`?r.pathname:n.from??i[1],s=n.to?`${n.to}`:void 0,l=i[2],u=Object.assign(Object.create(null),i[3]),d=s?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(o,`.`),f=s?this.resolvePathWithBase(d,s):d,p=At(n.params,u),h=this.routesByPath[m(f)],g;if(h)g=this.getRouteBranch(h);else if(f.includes(`$`))g=[];else{let[e,t,n]=this.getMatchedRoutes(f);g=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&C(p))for(let e of g){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(p,t(p))}catch{}}let _=t.leaveParams?f:a(re({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=l;if(t._includeValidateSearch&&this.options.search?.strict){let e={};g.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Dt(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=Ot(v,n,g,t._includeValidateSearch),v=e(l,v);let y=this.options.stringifySearch(v),b=n.hash===!0?r.hash:n.hash?c(n.hash,r.hash):void 0,x=b?`#${b}`:``,S=n.state===!0?r.state:n.state?c(n.state,r.state):{};S=D(r.state,S);let w=`${_}${y}${x}`,T,E,ee=!1;if(this.rewrite){let e=new URL(w,this.origin),t=ut(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,ee=!0)}else T=se(w),E=T;return{publicHref:E,href:T,pathname:_,search:v,searchStr:y,state:S,hash:b??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=(e={},r)=>{let i=n(e),a=r?n(r):void 0;if(!a){let e=Object.create(null);if(this.options.routeMasks){let o=s(i.pathname,this.processedTree);if(o){Object.assign(e,o.rawParams);let{from:i,params:s,...c}=o.route,l=At(s,e);r={from:t.from,...c,params:l},a=n(r)}}}return a&&(i.maskedLocation=a),i};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=m(this.latestLocation.href)===m(n.href)&&l(St(n.state),St(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,_redirects:a,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=vt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=lt(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});a&&(c._redirects=a),this._pendingLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(S(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ln(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(xt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&bt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=(e.options._builtLocation??this.buildLocation(e.options)).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&S(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=N,this.preloadRoute=e=>un(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=g(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!l(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?l(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=i,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??rt,parseSearch:t.parseSearch??nt,protocolAllowlist:t.protocolAllowlist??y}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=i(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(t,n){let[r,i,a]=this.getMatchedRoutes(t.pathname),o=r,s=!1;(a?a.path!==`/`&&i[`**`]:m(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?kt(this.options.notFoundMode,o):void 0,l=Array(o.length),u=this._committed,d=(e,t)=>{let n=u[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?u.find(t=>t.routeId===e.id):void 0},f;for(let r=0;r<o.length;r++){let a=o[r],s=l[r-1],u,p,m;{let e=s?.search??t.search,r=s?._strictSearch??void 0;try{let t=Dt(a.options.validateSearch,{...e})??void 0;u={...e,...t},p={...r,...t}}catch(t){let r=t;if(t instanceof Tt||(r=new Tt(t.message,{cause:t})),n?.throwOnError)throw r;u=e,p={},m=r}}let h=``,g=``;try{h=a.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(n?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=re({path:a.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),y=a.id+_+g,b=d(a,r),x=this._cache.get(y)??(b?.id===y?b:void 0);f=x?._strictParams??Object.assign(v,f);let S;if(!x)try{jt(a,f)}catch(e){if(S=ge(e)||ot(e)?e:new Et(e.message,{cause:e}),n?.throwOnError)throw S}let C=b?`stay`:`enter`,w;if(x)w={...x,cause:C,search:e(b?b.search:x.search,u),_strictSearch:p,searchError:m};else{let t=bt(a)?`pending`:`success`;w={id:y,ssr:a.options.ssr,index:r,routeId:a.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?e(b.search,u):u,_strictSearch:p,searchError:m,status:t,isFetching:!1,error:void 0,paramsError:S,context:{},abortController:n?._controller??new AbortController,cause:C,loaderDeps:b?D(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:a.options.staticData||{},fullPath:a.fullPath}}let T=c===a.id;w._notFound&&!T&&(w.error=void 0),w._notFound=T,l[r]=w}for(let t=0;t<l.length;t++){let r=l[t];r.params=r.cause===`stay`?e(r.params,f):f,n?._controller&&(r.context={})}return l}matchRoutesLightweight(e){let t=h(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=h(a),c={...e.search};for(let e of a)try{Object.assign(c,Dt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{jt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Tt=class extends Error{},Et=class extends Error{};function Dt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Tt(`Async validation not supported`);if(n.issues)throw new Tt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ot(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;n&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(r)try{let e=Dt(n,a);if(i&&e)for(let t in e)t in a||(i.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=c(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function kt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return be}function At(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,c(e,t))}function jt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Mt(e,t){return e.options[t]?.preload?.()}function Nt(e,t){let n=Mt(e,`component`),r=Mt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function N(e,t,n){let r=()=>t===!1?void 0:t?Mt(e,t):Nt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Pt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var P=0,F=1,Ft=2,I=3,L=4;function R(e){return typeof e[0]==`number`}function z(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function B(e,t){return e.routesById[t.routeId]}function V(e,t,n){return ot(e)?[I,e]:ge(e)?(e.routeId||=n,[Ft,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[F,e]:[P,e])}function It(e,t){let n=V(t,!0,e.id);if(n[0]!==F)return n;try{e.options.onError?.(n[1])}catch(t){n=V(t,!0,e.id)}return n}function H(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[L]):It(e,t)}function Lt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function Rt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[4];for(let t=n[7]??0;t<r;t++){let r=s[t],i=B(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Lt(e,o),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:i.id},f=u;try{let e=r._ctx;!e&&i.options.context&&(e=r._ctx=i.options.context({...d,deps:r.loaderDeps,context:u})||{}),f={...u,...e},r.context=f}catch(a){return U(e,r),[t,H(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[L]];let p=r.paramsError??r.searchError;if(p!==void 0)return U(e,r),[t,H(i,p,n)];let m=i.options.beforeLoad;if(!m)continue;let h={...d,search:r.search,context:f,...e.options.additionalContext},g=r.status;g===`success`&&t>=a&&(r.status=`pending`),n[8]?.();try{Vt(e,r,`beforeLoad`,n[0]);let a=await z(m(h),c);if(!n[2]())return n[0].abort(),[t,[L]];let o=V(a,!1,i.id);if(o[0]!==P)return U(e,r),[t,o];r.context={...f,...a}}catch(a){return U(e,r),[t,H(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Vt(e,r,!1,n[0])}}i()}function zt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function U(e,t){let n=t._flight;t._flight=void 0,zt(e,t,n)?.abort()}function W(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=zt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Bt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Vt(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Lt(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[L];if(!i)return[P,void 0];let l=n._flight;Vt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>V(e,!1,r.id),e=>V(e,!0,r.id)).then(t=>(t[0]!==P&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===F&&l[2]?It(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await z(l[0],c)}catch(t){if(t!==c)throw t;return U(e,n),[L]}finally{Vt(e,n,!1,s)}}function Wt(e,t,n){t[0]===P?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==I&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&U(e,r)}function Kt(e,t){return t[0]===F||t[0]===Ft?{...e,status:t[0]===F?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=B(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[L])),!p)if(s.status!==`success`)f=!0;else{let t=a[4]||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[6]||s.cause===`enter`||a[3].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}catch(t){s.invalid=!0,U(e,s),p=H(c,t,a)}let m=c.options.loader,h=typeof m==`function`?m:m?.handler,g=(!l||c.options.preload!==!1)&&m?e._flights?.get(s.id):void 0;g===s._flight||p?g=void 0:g&&!f&&!l&&d===void 0?f=!0:f||(g=void 0);let _=!!(m&&f&&s.status===`success`&&!l&&!a[5]&&((typeof m==`function`?void 0:m?.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),v=f&&(!l||c.options.preload!==!1),y=v&&!_&&(s.status!==`success`||!!m),b=c.lazyFn&&c._lazy!==!0?a[8]:void 0;if(v&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),g&&g[2]++,y){let t=s._flight;s._flight=g,zt(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([P,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===P&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=z(Promise.resolve().then(()=>N(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,H(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===P&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>Kt(C,e))}async function Jt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=B(e,t[n]),a=N(i,!1);if(a)try{await z(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(W(e,t[2].map(e=>e[3])),void 0)}async function Yt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=I)throw[a,t];!i&&t[0]!==P&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===I)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===Ft?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=I)f=0;else if(c){f=c[2]??=await d(c);for(let e of n){if(e[0]>=f)break;let t=await e[1];if(t[0]!==P&&t[0]<I&&!(`loaderData`in s[e[0]])){c=[e[0],t],f=c[2]=await d(c);break}}}for(let e of n){if(e[0]>=f)break;let t=await e[2];if(t){c=t;break}}if((c?.[1][0]??0)>=I){let n=c[1];if(n[0]!==I||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[F,Error(`Too many redirects`)]]}let p=c?c[2]??await d(c):u;if(p>=0){let i=c?.[1],a=i?.[0],u=s[p],d=i?.[1],f=()=>{i&&(u._notFound=void 0,a===F?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};f();let m=B(e,u);try{await z(i?Promise.resolve().then(()=>N(m,a===F?`errorComponent`:`notFoundComponent`)):Promise.all([N(m),N(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[L]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),W(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=B(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await z(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Qt(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Jt(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=qt(e,i,t,l,d,r,c)},p=await Rt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===Ft?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=I&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>R(e)?0:Pt(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return R(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=B(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>$t(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){W(e,t[1]),G(e,t)}function rn(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Pt(n).length,s=new Map,c=Date.now();for(let t of[...i,...a.values()]){if(t.status!==`success`||n.some((e,n)=>e.id===t.id&&(n<o||e.status===`success`)))continue;let r=B(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,tn(e,n),W(e,[...a.values(),...i],[...n,...s.values()]),Ct(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),W(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function sn(e,t,n,r,i){let a=n.map(e=>({...e}));Bt(a);for(let t of r)U(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw W(e,a),t}if(R(s)){W(e,a),s[0]===I&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){W(e,c[1]);return}for(let t of c[1]){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),U(e,n))}tn(e,c[1]),W(e,n,c[1])}async function cn(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Qt(e,t[2],t[3],o);if(R(s)){s[0]===I&&e._tx===t?(en(e,t),W(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await z(c[4],n)}catch(e){if(e!==n)throw e}if(r&&e._pending===c&&c[0]===t){let e=c[2]-Date.now();if(e>0){try{await z(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=xt(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){G(e,s);return}d?.length&&sn(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function ln(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await K(e,n);return}let f=xt(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Bt(m)}catch(t){if(u.abort(),!ot(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){W(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Vt(e,t,!1)}n[0].abort(),W(e,n[3],_[3],!0)}if(e._tx!==_){W(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Bt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),W(e,o),a.abort()}if(!R(t))return t[1];if(s&&t[0]===I&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=be:this.parentRoute||o();let i=r?be:n?.path;i&&i!==`/`&&(i=f(i));let a=n?.id||i,s=r?be:t([this.parentRoute.id===`__root__`?``:this.parentRoute.id,a]);i===`__root__`&&(i=`/`),s!==`__root__`&&(s=t([`/`,s]));let c=s===`__root__`?`/`:t([this.parentRoute.fullPath,i]);this._path=i,this._id=s,this._fullPath=c,this._to=m(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>j({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(q||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=D(n.current,i):i}}function Y(e){let t=ue(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),s=_(i,e=>e?a(e):An);if(s!==An)return s;(e.shouldThrow??!0)&&o()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(T,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>de({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(T,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(w(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(ce)ce(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=ue(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),ae(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(m(r.publicHref)!==m(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...xt(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=ue(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=ue(),t=e._rendered,n=_(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;ae(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends wt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...n}){C(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=k(v.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:r}):r}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
min-height: 100vh;
|
|
7
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
8
|
+
text-align: center;
|
|
9
|
+
`,Qn=Ie.p`
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
12
|
+
max-width: 48ch;
|
|
13
|
+
`,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(ie,{$gap:3,style:{alignItems:`center`},children:[k(E,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(le,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})});async function er(e){return e.queryClient.ensureQueryData({queryKey:ee.status,queryFn:()=>te(`/api/status`),revalidateIfStale:!0})}function tr(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function nr(e,t){let n=tr(e);if(n===`/login`)throw j({to:`/login`,search:{next:t}});if(n!==`/`)throw j({to:n})}function rr(e,t){let n=tr(e);if(n===`/login`)throw j({to:`/login`,search:{next:t}});if(n!==`/client`)throw j({to:n})}var ir=`modulepreload`,ar=function(e){return`/`+e},or={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ar(t,n),t=s(t),t in or)return;or[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ir,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{nr(await er(e),t.href)},component:Z(()=>Q(()=>import(`./_app-a3VUev6k.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`)}),cr=X(`/client`)({beforeLoad:async({context:e,location:t})=>{rr(await er(e),t.href)},component:Z(()=>Q(()=>import(`./client-CQGHWD56.js`),__vite__mapDeps([7,8,2,5,4,9,10,11,12,13,14,6,15,16,17,18,19])),`component`)}),lr=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-bJoYdBqx.js`),__vite__mapDeps([20,2,5,10,12,21])),`component`)}),ur=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-NBeanmyf.js`),__vite__mapDeps([22,2,4,5,16,17,11,12,13,19])),`component`)}),dr=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-CYPB-7Xt.js`),__vite__mapDeps([23,2,4,5,24,9,25,26,27,17,10,11,12,13,28,14,8])),`component`)}),fr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-C4x5F3d0.js`),__vite__mapDeps([29,2,4,5,10,12,6])),`component`)}),pr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-B-9oB52r.js`),__vite__mapDeps([30,2,4,5,10,11,12,13,19,21])),`component`)}),mr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-DK9jdOqT.js`),__vite__mapDeps([31,2,4,5,24,9,25,27,17,10,11,12,13])),`component`)}),hr=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-Dr6fApsE.js`),__vite__mapDeps([32,2,4,5,17,10,12,15,16,13])),`component`)}),gr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-CGBQ2QaS.js`),__vite__mapDeps([33,2,4,5,25,26,27,17,10,11,12,28])),`component`)}),_r=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-zTFRyxhZ.js`),__vite__mapDeps([34,2,4,5,27,10,11,12,21])),`component`)}),vr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-BCCimHY0.js`),__vite__mapDeps([35,8,2,5,4,12,13,28,18,19])),`component`)}),yr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-DXzhupNH.js`),__vite__mapDeps([36,2,4,5,12])),`component`)}),$=sr.update({id:`/_app`,getParentRoute:()=>$n}),br=cr.update({id:`/client`,path:`/client`,getParentRoute:()=>$n}),xr=lr.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),Sr=ur.update({id:`/`,path:`/`,getParentRoute:()=>$}),Cr={AppAccountsRoute:dr.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:fr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:pr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:mr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:hr.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:gr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:_r.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:vr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:Sr,AppPluginsPluginIdRoute:yr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},wr={AppRoute:$._addFileChildren(Cr),ClientRoute:br,LoginRoute:xr},Tr=$n._addFileChildren(wr)._addFileTypes();function Er(e){let t=t=>{!(t instanceof oe)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var Dr=Re`
|
|
14
|
+
:root {
|
|
15
|
+
color-scheme: light;
|
|
16
|
+
|
|
17
|
+
--rack: oklch(0.962 0.004 258);
|
|
18
|
+
--panel: oklch(1 0 0);
|
|
19
|
+
--panel-sunk: oklch(0.972 0.004 258);
|
|
20
|
+
--panel-raised: oklch(0.988 0.003 258);
|
|
21
|
+
--rule: oklch(0.9 0.006 258);
|
|
22
|
+
--rule-strong: oklch(0.82 0.008 258);
|
|
23
|
+
|
|
24
|
+
--ink: oklch(0.22 0.017 258);
|
|
25
|
+
--ink-dim: oklch(0.45 0.015 258);
|
|
26
|
+
--ink-faint: oklch(0.62 0.012 258);
|
|
27
|
+
|
|
28
|
+
--accent: oklch(0.52 0.17 262);
|
|
29
|
+
--accent-ink: oklch(0.99 0 0);
|
|
30
|
+
--accent-wash: oklch(0.52 0.17 262 / 0.11);
|
|
31
|
+
|
|
32
|
+
--ok: oklch(0.52 0.13 162);
|
|
33
|
+
--warn: oklch(0.58 0.13 72);
|
|
34
|
+
--down: oklch(0.53 0.2 27);
|
|
35
|
+
--ok-wash: oklch(0.52 0.13 162 / 0.12);
|
|
36
|
+
--warn-wash: oklch(0.58 0.13 72 / 0.14);
|
|
37
|
+
--down-wash: oklch(0.53 0.2 27 / 0.11);
|
|
38
|
+
|
|
39
|
+
--p-anthropic: oklch(0.56 0.13 45);
|
|
40
|
+
--p-openai: oklch(0.5 0.09 190);
|
|
41
|
+
--p-kimi: oklch(0.53 0.17 330);
|
|
42
|
+
/* Kilo takes the arc between openai and the accent: 224 is ~34deg from
|
|
43
|
+
openai and ~38 from the accent blue, and — the point — 106 from kimi.
|
|
44
|
+
Kimi and kilo are one letter apart and sit next to each other in every
|
|
45
|
+
list the console draws, so they are the one pair that must not also be
|
|
46
|
+
neighbours in hue. The other free arc, ~296, is 34 from kimi and would
|
|
47
|
+
have done the opposite. */
|
|
48
|
+
--p-kilo: oklch(0.52 0.14 224);
|
|
49
|
+
/* xAI's own identity is achromatic, and the neutral slot is already
|
|
50
|
+
custom's, so grok takes the widest free arc of the wheel instead: 125 is
|
|
51
|
+
~70deg from both anthropic and openai and ~145 from kimi, which is what
|
|
52
|
+
keeps five series apart in the usage charts. */
|
|
53
|
+
--p-grok: oklch(0.52 0.14 125);
|
|
54
|
+
--p-custom: oklch(0.5 0.03 258);
|
|
55
|
+
|
|
56
|
+
--grid-line: oklch(0.22 0.017 258 / 0.055);
|
|
57
|
+
--shadow: 0 1px 2px oklch(0.22 0.017 258 / 0.06);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dark {
|
|
61
|
+
color-scheme: dark;
|
|
62
|
+
|
|
63
|
+
--rack: oklch(0.163 0.013 258);
|
|
64
|
+
--panel: oklch(0.204 0.013 258);
|
|
65
|
+
--panel-sunk: oklch(0.183 0.013 258);
|
|
66
|
+
--panel-raised: oklch(0.246 0.013 258);
|
|
67
|
+
--rule: oklch(0.3 0.012 258);
|
|
68
|
+
--rule-strong: oklch(0.4 0.014 258);
|
|
69
|
+
|
|
70
|
+
--ink: oklch(0.94 0.006 250);
|
|
71
|
+
--ink-dim: oklch(0.72 0.011 253);
|
|
72
|
+
--ink-faint: oklch(0.55 0.012 255);
|
|
73
|
+
|
|
74
|
+
--accent: oklch(0.74 0.13 262);
|
|
75
|
+
--accent-ink: oklch(0.17 0.02 262);
|
|
76
|
+
--accent-wash: oklch(0.74 0.13 262 / 0.18);
|
|
77
|
+
|
|
78
|
+
--ok: oklch(0.75 0.14 162);
|
|
79
|
+
--warn: oklch(0.82 0.14 80);
|
|
80
|
+
--down: oklch(0.68 0.19 25);
|
|
81
|
+
--ok-wash: oklch(0.75 0.14 162 / 0.16);
|
|
82
|
+
--warn-wash: oklch(0.82 0.14 80 / 0.16);
|
|
83
|
+
--down-wash: oklch(0.68 0.19 25 / 0.16);
|
|
84
|
+
|
|
85
|
+
--p-anthropic: oklch(0.74 0.12 48);
|
|
86
|
+
--p-openai: oklch(0.76 0.1 190);
|
|
87
|
+
--p-kimi: oklch(0.72 0.16 330);
|
|
88
|
+
--p-kilo: oklch(0.74 0.14 224);
|
|
89
|
+
--p-grok: oklch(0.74 0.14 125);
|
|
90
|
+
--p-custom: oklch(0.72 0.03 258);
|
|
91
|
+
|
|
92
|
+
--grid-line: oklch(0.94 0.006 250 / 0.045);
|
|
93
|
+
--shadow: 0 1px 2px oklch(0 0 0 / 0.3);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
*,
|
|
97
|
+
*::before,
|
|
98
|
+
*::after {
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
html,
|
|
103
|
+
body,
|
|
104
|
+
#root {
|
|
105
|
+
height: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
html {
|
|
109
|
+
background: ${({theme:e})=>e.color.rack};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
body {
|
|
113
|
+
margin: 0;
|
|
114
|
+
background: ${({theme:e})=>e.color.rack};
|
|
115
|
+
color: ${({theme:e})=>e.color.ink};
|
|
116
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
line-height: 1.45;
|
|
119
|
+
-webkit-font-smoothing: antialiased;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
h1, h2, h3, h4, p, figure, dl, dd {
|
|
123
|
+
margin: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
ul, ol {
|
|
127
|
+
margin: 0;
|
|
128
|
+
padding: 0;
|
|
129
|
+
list-style: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
button, input, select, textarea {
|
|
133
|
+
font: inherit;
|
|
134
|
+
color: inherit;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
a {
|
|
138
|
+
color: inherit;
|
|
139
|
+
text-decoration: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:focus-visible {
|
|
143
|
+
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
144
|
+
outline-offset: 1px;
|
|
145
|
+
border-radius: 2px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
::selection {
|
|
149
|
+
background: ${({theme:e})=>e.color.accentWash};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
::-webkit-scrollbar {
|
|
153
|
+
width: 10px;
|
|
154
|
+
height: 10px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
::-webkit-scrollbar-track {
|
|
158
|
+
background: transparent;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
::-webkit-scrollbar-thumb {
|
|
162
|
+
background: ${({theme:e})=>e.color.ruleStrong};
|
|
163
|
+
border: 3px solid transparent;
|
|
164
|
+
background-clip: padding-box;
|
|
165
|
+
border-radius: 6px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@media (prefers-reduced-motion: reduce) {
|
|
169
|
+
*,
|
|
170
|
+
*::before,
|
|
171
|
+
*::after {
|
|
172
|
+
animation-duration: 0.01ms !important;
|
|
173
|
+
animation-iteration-count: 1 !important;
|
|
174
|
+
transition-duration: 0.01ms !important;
|
|
175
|
+
scroll-behavior: auto !important;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`,Or={color:{rack:`var(--rack)`,panel:`var(--panel)`,panelSunk:`var(--panel-sunk)`,panelRaised:`var(--panel-raised)`,rule:`var(--rule)`,ruleStrong:`var(--rule-strong)`,ink:`var(--ink)`,inkDim:`var(--ink-dim)`,inkFaint:`var(--ink-faint)`,accent:`var(--accent)`,accentInk:`var(--accent-ink)`,accentWash:`var(--accent-wash)`,ok:`var(--ok)`,warn:`var(--warn)`,down:`var(--down)`,okWash:`var(--ok-wash)`,warnWash:`var(--warn-wash)`,downWash:`var(--down-wash)`,shadow:`var(--shadow)`},provider:{anthropic:`var(--p-anthropic)`,openai:`var(--p-openai)`,kimi:`var(--p-kimi)`,kilo:`var(--p-kilo)`,grok:`var(--p-grok)`,custom:`var(--p-custom)`},font:{sans:`"Archivo Variable", ui-sans-serif, system-ui, sans-serif`,mono:`"Spline Sans Mono Variable", ui-monospace, "SF Mono", Menlo, monospace`},radius:{panel:`4px`,control:`3px`,chip:`2px`},space:e=>`${e*4}px`,z:{rail:20,chassis:30,overlay:40,dialog:50,toast:60}},kr=[`anthropic`,`openai`,`kimi`,`kilo`,`grok`,`custom`],Ar={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`,kilo:`Kilo`,grok:`Grok`,custom:`OpenAI Compatible`};function jr(e){return Or.provider[e]}var Mr=`omni-theme`;function Nr(e){return e===`light`||e===`dark`||e===`system`}function Pr(){try{let e=localStorage.getItem(Mr);return Nr(e)?e:`system`}catch{return`system`}}function Fr(){return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches}function Ir(e){return e===`system`?Fr()?`dark`:`light`:e}function Lr(e){let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.dataset.theme=e}var Rr=Oe(null);function zr(){let e=ke(Rr);if(e===null)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}function Br({children:e}){let[t,n]=Me(Pr),[r,i]=Me(()=>Ir(Pr())),a=Ae(e=>{n(e);try{localStorage.setItem(Mr,e)}catch{}},[]);return je(()=>{let e=Ir(t);i(e),Lr(e)},[t]),je(()=>{if(t!==`system`||typeof matchMedia!=`function`)return;let e=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let e=Fr()?`dark`:`light`;i(e),Lr(e)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),k(Rr,{value:{mode:t,resolved:r,setMode:a},children:Pe(Le,{theme:Or,children:[k(Dr,{}),e]})})}var Vr,Hr=Er({isLoginRoute:()=>Vr.state.location.pathname===`/login`,onUnauthenticated:()=>void Vr.navigate({to:`/login`})});Vr=qn({routeTree:Tr,context:{queryClient:Hr}});var Ur=document.getElementById(`root`);if(Ur===null)throw Error(`#root is missing from index.html`);Fe(Ur).render(k(De,{children:k(Br,{children:k(Te,{client:Hr,children:k(Xn,{router:Vr})})})}));export{yr as a,jr as i,kr as n,lr as o,Ar as r,Q as s,zr as t};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{M as e,Q as t,Y as n,_t as r,ct as i,dt as a,mt as o,vt as s,xt as c}from"./queries-GAue98pY.js";import{o as l}from"./index-C3LoGDKu.js";import{a as u,i as d}from"./States-2kaQxx-s.js";import{n as f,t as p}from"./Field-B2rnk3JM.js";import{n as m}from"./Panel-BeQOQoap.js";import{t as h}from"./reasons-Du1OBWAM.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
min-height: 100vh;
|
|
6
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
7
|
+
`,x=y(m)`
|
|
8
|
+
width: min(380px, 100%);
|
|
9
|
+
`,S=y.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
padding: ${({theme:e})=>`${e.space(3)} ${e.space(4)}`};
|
|
14
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
15
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
16
|
+
${r}
|
|
17
|
+
font-stretch: 74%;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
letter-spacing: 0.2em;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
`,C=y.form`
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
26
|
+
padding: ${({theme:e})=>e.space(4)};
|
|
27
|
+
`,w=y.p`
|
|
28
|
+
font-size: 12.5px;
|
|
29
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
30
|
+
`,T=y.p`
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
color: ${({theme:e})=>e.color.down};
|
|
33
|
+
`,E=y.p`
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
color: ${({theme:e})=>e.color.warn};
|
|
36
|
+
`,D=y.button`
|
|
37
|
+
border: 1px solid ${({theme:e,$on:t})=>t===!0?e.color.accent:e.color.rule};
|
|
38
|
+
background: ${({theme:e,$on:t})=>t===!0?e.color.accentWash:`transparent`};
|
|
39
|
+
color: ${({theme:e,$on:t})=>t===!0?e.color.ink:e.color.inkDim};
|
|
40
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
41
|
+
padding: ${({theme:e})=>e.space(1)} ${({theme:e})=>e.space(2)};
|
|
42
|
+
font: inherit;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
`;function O(){let r=c(),{next:m,reason:y}=l.useSearch(),O=t(),k=e(),A=n(),[j,M]=g(``),[N,P]=g(``),[F,I]=g(null),[L,R]=g(`admin`),z=O.data?.configured===!1,B=[{id:`admin`,label:`Operator`,blurb:`This console is for the operator of this gateway.`},...O.data?.viewerConfigured===!0?[{id:`viewer`,label:`Read-only`,blurb:`Everything the operator can see, and nothing they can change.`}]:[],{id:`client`,label:`API key`,blurb:`Your own usage, limits and requests. Sign in with a gateway API key.`}],V=L===`client`,H=h(y),U=k.isPending||A.isPending||O.isLoading,W=()=>{if(V){r({to:`/client`});return}r({to:m?.startsWith(`/`)===!0?m:`/`})};return _(b,{children:v(x,{children:[v(S,{children:[_(u,{state:O.isError?`down`:`ok`,label:O.isError?`gateway unreachable`:`gateway reachable`}),`Omnigateway`]}),v(C,{onSubmit:e=>{if(e.preventDefault(),I(null),z){if(j!==N){I(`The two passwords do not match.`);return}A.mutate(j,{onSuccess:W,onError:e=>I(d(e))});return}k.mutate({mode:L,secret:j},{onSuccess:W,onError:()=>I(V?`That API key was not accepted. It may have been revoked.`:`That password does not match. Try again.`)})},children:[O.isError?_(T,{children:`The gateway is not answering. Check that it is running, then reload.`}):null,H===null?null:_(E,{role:`status`,children:H}),v(o,{$gap:1,children:[_(i,{children:z?`First run`:`Sign in`}),_(w,{children:z?`Set the operator password for this gateway. It is the only account, and it is stored hashed.`:B.find(e=>e.id===L)?.blurb??``})]}),z||B.length<2?null:_(a,{$gap:1,$wrap:!0,role:`tablist`,"aria-label":`Sign in as`,children:B.map(e=>_(D,{type:`button`,role:`tab`,"aria-selected":e.id===L,$on:e.id===L,onClick:()=>{R(e.id),M(``),I(null)},children:e.label},e.id))}),_(p,{label:V?`API key`:`Password`,children:e=>_(f,{...e,type:`password`,autoFocus:!0,autoComplete:z?`new-password`:V?`off`:`current-password`,value:j,onChange:e=>M(e.target.value)})}),z?_(p,{label:`Confirm password`,children:e=>_(f,{...e,type:`password`,autoComplete:`new-password`,value:N,onChange:e=>P(e.target.value)})}):null,F===null?null:_(T,{role:`alert`,children:F}),_(a,{children:_(s,{type:`submit`,$variant:`primary`,disabled:U||j.length===0,children:z?`Set password and sign in`:`Sign in`})})]})]})})}export{O as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./Rack-DdhpgQWD.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import{useMutation as e,useQuery as t,useQueryClient as n}from"@tanstack/react-query";import*as r from"react";import i,{useCallback as a,useDebugValue as o,useEffect as s,useMemo as c,useRef as l,useSyncExternalStore as u}from"react";import{jsx as d}from"react/jsx-runtime";import{flushSync as f}from"react-dom";import p,{css as m,keyframes as h}from"styled-components";var g=r.use,_=r.useLayoutEffect;function v(e,t,n={},i){r.useEffect(()=>{if(!e.current||i||typeof IntersectionObserver!=`function`)return;let r=new IntersectionObserver(([e])=>{t(e)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,i,n,e])}function y(e){let t=r.useRef(null);return r.useImperativeHandle(e,()=>t.current,[]),t}function b(e){return e[e.length-1]}function x(e){return typeof e==`function`}function ee(e,t){return x(e)?e(t):e}var S=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;function te(e){for(let t in e)if(S.call(e,t))return!0;return!1}var ne=()=>Object.create(null),re=(e,t)=>w(e,t,ne);function w(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ie(e)&&ie(i);if(!a&&!(E(e)&&E(i)))return i;let o=a?e:T(e);if(!o)return i;let s=a?i:T(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:S.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=w(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function T(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!C.call(e,r))return!1;t.push(r)}return t}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`))}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!O(e[r],t[r],n))return!1;return!0}if(E(e)&&E(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!O(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!O(e[o],t[o],n)))return!1;return i===a}return!1}function ae(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var oe=/[\x00-\x1f\x7f"<>`{}]/g;function se(e){return e.replace(oe,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ce(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return se(t)}var le=[`http:`,`https:`,`mailto:`,`tel:`];function ue(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function de(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ce(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ce(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function fe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function pe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function k(){throw Error(`Invariant failed`)}function A(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var j=4,M=5;function N(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function me(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=N(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function P(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=me(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=I(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=L(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=I(r);e.kind=M,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=I(r);e.kind=j,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)P(e,t,r,c,i,a,o,s)}function F(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function I(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function L(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function R(e,t){let n=I(`/`),r=new Uint16Array(6),i=[];for(let t of e)P(!1,r,t,1,n,0,i);for(let e of i)e.sort(F);t.masksTree=n,t.flatCache=A(1e3)}function he(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=z(e,t.masksTree);return t.flatCache.set(e,r),r}function ge(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=I(`/`),P(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),z(r,o,n)}function _e(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=z(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=V(a.route)),t.matchCache.set(r,a),a}function ve(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ye(e,t=!1,n){let r=I(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;P(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&k(),o[e.id]=e,c!==0&&e.path){let t=ve(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(F);return{processedTree:{segmentTree:r,singleCache:A(1e3),matchCache:A(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function z(e,t,n=!1){let r=e.split(`/`),i=xe(e,r,t,n);if(!i)return null;let[a]=B(e,r,i);return{route:i.node.route,rawParams:a}}function B(e,t,n){let r=be(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===j)break;if(u.kind===M){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function V(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function be(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function xe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!b(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!U(l,n))continue;if(i.parse){if(!Ce(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==j&&U(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===j||i.kind===2)&&U(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Ce(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Se(f,o))return n;U(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+H(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+H(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+H(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+H(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function H(e,t){return 2**(e-t-1)}function Se(e,t){return e===2**(t-1)-1}function Ce(e,t,n){let r,i;try{[r,i]=B(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function U(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===j)>(e.node.kind===j)||t.node.kind===j==(e.node.kind===j)&&t.node.depth>e.node.depth)))}function we(e){return Te(e.filter(e=>e!==void 0).join(`/`))}function Te(e){return e.replace(/\/{2,}/g,`/`)}function Ee(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function De(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Oe(e){return De(Ee(e))}function W(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ke(e,t,n){return W(e,n)===W(t,n)}function Ae({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&b(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(b(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Te(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function je(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Me(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Pe(e,n)).join(`/`):Pe(r,n):r}function Ne({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=me(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Me(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Me(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Me(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Pe(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var Fe=`Error preloading route! ☝️`;function Ie({children:e,fallback:t=null}){return d(i.Fragment,{children:Le()?e:t})}function Le(){return i.useSyncExternalStore(Re,()=>!0,()=>!1)}function Re(){return()=>{}}var ze=r.createContext(null);function Be(e){return r.useContext(ze)}function Ve(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var He=typeof Object.is==`function`?Object.is:Ve;function Ue(e,t,n,r,i){let a=l(null),d;a.current===null?(d={hasValue:!1,value:null},a.current=d):d=a.current;let[f,p]=c(()=>{let e=!1,a,o,s=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&d.hasValue){let e=d.value;if(i(e,n))return o=e,e}return o=n,n}let n=o;if(He(a,t))return n;let s=r(t);return i?.(n,s)?(a=t,n):(a=t,o=s,s)},c=n===void 0?null:n;return[()=>s(t()),c===null?void 0:()=>s(c())]},[t,n,r,i,d]),m=u(e,f,p);return s(()=>{d.hasValue=!0,d.value=m},[m,d]),o(m),m}function We(e,t){return e===t}function Ge(e,t,n=We){let r=a(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=a(()=>e?.get(),[e]);return Ue(r,i,i,t,n)}function Ke(e){let t=Be();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qe(e){let t=r.useRef(e);return O(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Je(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ye(e,t,n){if(e?.external)return ue(e.href,n)?void 0:e.href;if(!at(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ue(t,n)?void 0:t}catch{}}function Xe(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!ke(e.pathname,t.pathname,r))return!1}else{let n=W(e.pathname,r),i=W(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!O(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Ze(e,t){let n=Be(),i=y(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:b,target:x,disabled:S,style:C,className:te,onClick:ne,onBlur:re,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:ie,params:O,search:ae,hash:oe,state:se,mask:ce,reloadDocument:le,unsafeRelative:ue,from:de,_fromLocation:fe,...pe}=e,k=Le(),A=qe(e.search),j=qe(e.params),M=qe(s),N=r.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,A,j,e.state,e.mask,e.unsafeRelative]),me=r.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...N}),r=it(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,S),i=Ye(r,c,n.protocolAllowlist);return[r?.href,i,Xe(e,t,M,n.basepath,k,i!==void 0)]},[M,S,k,N,n,c]),[P,F,I]=Ge(n.stores.location,me,Je),L=I?ee(a,{})??$e:Qe,R=I?Qe:ee(o,{})??Qe,he=[te,L.className,R.className].filter(Boolean).join(` `),ge=(C||L.style||R.style)&&{...C,...L.style,...R.style},[_e,ve]=r.useState(!1),ye=r.useRef(!1),z=e.reloadDocument||F?!1:l??n.options.defaultPreload,B=u??n.options.defaultPreloadDelay??0,V=r.useCallback(()=>{n.preloadRoute(N).catch(e=>{console.warn(e),console.warn(Fe)})},[n,N]);v(i,r.useCallback(e=>{e?.isIntersecting&&V()},[V]),rt,!!S||z!==`viewport`),r.useEffect(()=>{ye.current||!S&&z===`render`&&(V(),ye.current=!0)},[S,V,z]);let be=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!st(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),f(()=>{ve(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ve(!1)});n.navigate({...N,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ie})}};if(F)return{...pe,ref:i,href:F,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...te&&{className:te},...ne&&{onClick:ne},...re&&{onBlur:re},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let xe=e=>{if(S||z!==`intent`)return;if(!B){V();return}let t=e.currentTarget;if(G.has(t))return;let n=setTimeout(()=>{G.delete(t),V()},B);G.set(t,n)},H=e=>{S||z!==`intent`||V()},Se=e=>{if(S||!z||!B)return;let t=e.currentTarget,n=G.get(t);n&&(clearTimeout(n),G.delete(t))};return{...pe,...L,...R,href:P,ref:i,onClick:K([ne,be]),onBlur:K([re,Se]),onFocus:K([w,xe]),onMouseEnter:K([T,xe]),onMouseLeave:K([E,Se]),onTouchStart:K([D,H]),disabled:!!S,target:x,...ge&&{style:ge},...he&&{className:he},...S&&et,...I&&tt,...k&&_e&&nt}}var Qe={},$e={className:`active`},et={role:`link`,"aria-disabled":!0},tt={"data-status":`active`,"aria-current":`page`},nt={"data-transitioning":`transitioning`},G=new WeakMap,rt={rootMargin:`100px`},K=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function it(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function at(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ot=r.forwardRef((e,t)=>{let{_asChild:n,...i}=e,{type:a,...o}=Ze(i,t),s=typeof i.children==`function`?i.children({isActive:o[`data-status`]===`active`}):i.children;if(!n){let{disabled:e,...t}=o;return r.createElement(`a`,t,s)}return r.createElement(n,o,s)});function st(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var ct={primary:m`
|
|
2
|
+
background: ${({theme:e})=>e.color.accent};
|
|
3
|
+
color: ${({theme:e})=>e.color.accentInk};
|
|
4
|
+
border-color: ${({theme:e})=>e.color.accent};
|
|
5
|
+
|
|
6
|
+
&:hover:not(:disabled) {
|
|
7
|
+
filter: brightness(1.08);
|
|
8
|
+
}
|
|
9
|
+
`,default:m`
|
|
10
|
+
background: ${({theme:e})=>e.color.panelRaised};
|
|
11
|
+
color: ${({theme:e})=>e.color.ink};
|
|
12
|
+
border-color: ${({theme:e})=>e.color.ruleStrong};
|
|
13
|
+
|
|
14
|
+
&:hover:not(:disabled) {
|
|
15
|
+
border-color: ${({theme:e})=>e.color.accent};
|
|
16
|
+
color: ${({theme:e})=>e.color.accent};
|
|
17
|
+
}
|
|
18
|
+
`,ghost:m`
|
|
19
|
+
background: transparent;
|
|
20
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
21
|
+
border-color: transparent;
|
|
22
|
+
|
|
23
|
+
&:hover:not(:disabled) {
|
|
24
|
+
background: ${({theme:e})=>e.color.panelRaised};
|
|
25
|
+
color: ${({theme:e})=>e.color.ink};
|
|
26
|
+
}
|
|
27
|
+
`,danger:m`
|
|
28
|
+
background: transparent;
|
|
29
|
+
color: ${({theme:e})=>e.color.down};
|
|
30
|
+
border-color: ${({theme:e})=>e.color.down};
|
|
31
|
+
|
|
32
|
+
&:hover:not(:disabled) {
|
|
33
|
+
background: ${({theme:e})=>e.color.downWash};
|
|
34
|
+
}
|
|
35
|
+
`},lt={sm:m`
|
|
36
|
+
height: 24px;
|
|
37
|
+
padding: 0 ${({theme:e})=>e.space(2)};
|
|
38
|
+
font-size: 11px;
|
|
39
|
+
`,md:m`
|
|
40
|
+
height: 30px;
|
|
41
|
+
padding: 0 ${({theme:e})=>e.space(3)};
|
|
42
|
+
font-size: 13px;
|
|
43
|
+
`},ut=p.button`
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
gap: ${({theme:e})=>e.space(1.5)};
|
|
48
|
+
border: 1px solid transparent;
|
|
49
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition:
|
|
54
|
+
background 120ms ease,
|
|
55
|
+
color 120ms ease,
|
|
56
|
+
border-color 120ms ease;
|
|
57
|
+
|
|
58
|
+
${({$size:e})=>lt[e??`md`]}
|
|
59
|
+
${({$variant:e})=>ct[e??`default`]}
|
|
60
|
+
|
|
61
|
+
&:disabled {
|
|
62
|
+
opacity: 0.45;
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
svg {
|
|
67
|
+
width: 14px;
|
|
68
|
+
height: 14px;
|
|
69
|
+
}
|
|
70
|
+
`,dt=p(ut)`
|
|
71
|
+
padding: 0;
|
|
72
|
+
width: ${({$size:e})=>e===`sm`?`24px`:`30px`};
|
|
73
|
+
`,ft=p.span`
|
|
74
|
+
font-size: 10px;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
font-stretch: 74%;
|
|
77
|
+
letter-spacing: 0.16em;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
`,pt=p.span`
|
|
82
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
83
|
+
font-variant-numeric: tabular-nums;
|
|
84
|
+
font-size: ${({$size:e})=>e??`12px`};
|
|
85
|
+
color: ${({theme:e,$dim:t})=>t===!0?e.color.inkDim:`inherit`};
|
|
86
|
+
`,mt=p.span`
|
|
87
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
88
|
+
`,ht=p.div`
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: ${({$align:e})=>e??`center`};
|
|
91
|
+
justify-content: ${({$justify:e})=>e??`flex-start`};
|
|
92
|
+
gap: ${({theme:e,$gap:t})=>e.space(t??2)};
|
|
93
|
+
${({$wrap:e})=>e===!0?`flex-wrap: wrap;`:``}
|
|
94
|
+
min-width: 0;
|
|
95
|
+
`,gt=p.div`
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: ${({theme:e,$gap:t})=>e.space(t??2)};
|
|
99
|
+
min-width: 0;
|
|
100
|
+
`,_t=p.div`
|
|
101
|
+
display: grid;
|
|
102
|
+
grid-template-columns: repeat(auto-fit, minmax(${({$min:e})=>e??`220px`}, 1fr));
|
|
103
|
+
gap: ${({theme:e,$gap:t})=>e.space(t??3)};
|
|
104
|
+
/* Panels size to their content; a short one does not stretch to match a tall one.
|
|
105
|
+
$stretch opts a grid out of that, for a row of tiles that read as one
|
|
106
|
+
instrument: there, one card carrying a meter leaves the rest looking cropped
|
|
107
|
+
rather than merely shorter. */
|
|
108
|
+
align-items: ${({$stretch:e})=>e===!0?`stretch`:`start`};
|
|
109
|
+
`;p.hr`
|
|
110
|
+
height: 1px;
|
|
111
|
+
border: 0;
|
|
112
|
+
margin: 0;
|
|
113
|
+
background: ${({theme:e})=>e.color.rule};
|
|
114
|
+
`;var vt=p.div`
|
|
115
|
+
flex: 1 1 auto;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
`,yt=p.div`
|
|
118
|
+
overflow-x: auto;
|
|
119
|
+
overscroll-behavior-x: contain;
|
|
120
|
+
`,bt=p.span`
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
`;p.span`
|
|
126
|
+
position: absolute;
|
|
127
|
+
width: 1px;
|
|
128
|
+
height: 1px;
|
|
129
|
+
padding: 0;
|
|
130
|
+
margin: -1px;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
clip-path: inset(50%);
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
`;var xt=h`
|
|
135
|
+
0%, 100% { opacity: 1; }
|
|
136
|
+
50% { opacity: 0.35; }
|
|
137
|
+
`,St=m`
|
|
138
|
+
animation: ${xt} 2.4s ease-in-out infinite;
|
|
139
|
+
`,Ct=m`
|
|
140
|
+
background-image: repeating-linear-gradient(
|
|
141
|
+
to bottom,
|
|
142
|
+
var(--grid-line) 0 1px,
|
|
143
|
+
transparent 1px 4px
|
|
144
|
+
);
|
|
145
|
+
`,wt=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}get isUnauthenticated(){return this.status===401||this.code===`AUTH`}};function Tt(e){if(typeof e!=`object`||!e)return!1;let t=e.error;return typeof t!=`object`||!t?!1:typeof t.message==`string`}async function q(e,t={}){let n=t.method??`GET`,r=t.body instanceof Blob?t.body:null,i={method:n,credentials:`same-origin`,headers:t.body===void 0?{}:{"content-type":r===null?`application/json`:`application/octet-stream`},...t.body===void 0?{}:{body:r===null?JSON.stringify(t.body):r},...t.signal===void 0?{}:{signal:t.signal}},a=await fetch(e,i),o=t.accept??[],s=null;if(a.status!==204){let e=await a.text();if(e.length>0)try{s=JSON.parse(e)}catch{s=null}}if(!a.ok&&!o.includes(a.status)){let e=Tt(s)?s.error.code??`INTERNAL`:`INTERNAL`,t=Tt(s)?s.error.message:`request failed with status ${a.status}`;throw new wt(a.status,String(e),t)}return{status:a.status,data:s}}async function J(e,t){return(await q(e,t===void 0?{}:{signal:t})).data}async function Y(e,t){return(await q(e,{method:`POST`,...t===void 0?{}:{body:t}})).data}async function X(e,t){return(await q(e,{method:`PUT`,body:t})).data}async function Et(e,t){return(await q(e,{method:`PATCH`,body:t})).data}async function Z(e){return(await q(e,{method:`DELETE`})).data}function Q(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r.length===0?e:`${e}?${r}`}var $={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],requestBody:e=>[`logs`,`body`,e],clientSummary:[`client`,`summary`],clientUsage:e=>[`client`,`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],clientLogs:e=>[`client`,`logs`,e],clientQuota:[`client`,`quota`],clientQuotaHistory:e=>[`client`,`quota-history`,e.since,e.until??null],console:(e,t)=>[`console`,e,t],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`]};function Dt(){return t({queryKey:$.status,queryFn:({signal:e})=>J(`/api/status`,e),staleTime:3e4})}function Ot(){return t({queryKey:$.credentials,queryFn:async({signal:e})=>(await J(`/api/credentials`,e)).credentials})}function kt(e=1e4){return t({queryKey:$.credentialHealth,queryFn:({signal:e})=>J(`/api/credentials/health`,e),refetchInterval:e})}function At(e,n=!0){return t({queryKey:$.quotaHistory(e),enabled:n,queryFn:({signal:t})=>J(Q(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function jt(){return t({queryKey:$.models,queryFn:async({signal:e})=>(await J(`/api/models`,e)).models})}function Mt(){return t({queryKey:$.keys,queryFn:async({signal:e})=>(await J(`/api/keys`,e)).keys})}var Nt={queryKey:$.settings,queryFn:({signal:e})=>J(`/api/settings`,e)};function Pt(){return t({...Nt,select:e=>e.settings})}function Ft(){return t({...Nt,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function It(){return t({...Nt,select:e=>e.bodyLoggingAllowed})}function Lt(e,n){return t({queryKey:$.agentSetup(e,n),enabled:n!==void 0,queryFn:async({signal:t})=>(await J(Q(`/api/agent-setup`,{client:e,...n??{}}),t)).files})}function Rt(e,n=6e4){return t({queryKey:$.usage(e),queryFn:async({signal:t})=>(await J(Q(`/api/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t)).rows,refetchInterval:n})}var zt=2e3;function Bt(e=100,n=zt){return t({queryKey:$.logs(e),queryFn:async({signal:t})=>(await J(Q(`/api/logs`,{limit:e}),t)).logs,refetchInterval:n})}function Vt(e){return t({queryKey:$.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>J(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Ht=5e3;function Ut(e=200,n=``,r=Ht){return t({queryKey:$.console(e,n),queryFn:async({signal:t})=>J(Q(`/api/console`,{lines:e,...n===``?{}:{level:n}}),t),refetchInterval:r})}function Wt(){return t({queryKey:$.database,queryFn:({signal:e})=>J(`/api/database`,e),refetchInterval:!1})}function Gt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Kt(){return t({queryKey:$.snapshots,queryFn:async({signal:e})=>(await J(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function qt(e){e.invalidateQueries({queryKey:$.database})}function Jt(){let t=n();return e({mutationFn:()=>Y(`/api/database/snapshots`),onSuccess:()=>qt(t)})}function Yt(){let t=n();return e({mutationFn:e=>X(`/api/database/retention`,e),onSuccess:()=>{qt(t),t.invalidateQueries({queryKey:$.settings})}})}function Xt(){let t=n();return e({mutationFn:()=>Y(`/api/database/vacuum`),onSuccess:()=>qt(t)})}function Zt(){let t=n();return e({mutationFn:e=>Z(`/api/database/snapshots/${encodeURIComponent(e)}`),onSuccess:()=>qt(t)})}function Qt(){return e({mutationFn:e=>Y(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function $t(){return e({mutationFn:e=>Y(`/api/database/import`,e)})}function en(){return t({queryKey:$.lifecycle,queryFn:({signal:e})=>J(`/api/lifecycle`,e),refetchInterval:!1})}function tn(){return e({mutationFn:()=>Y(`/api/lifecycle/restart`)})}function nn(){return e({mutationFn:()=>Y(`/api/lifecycle/shutdown`)})}function rn(){let t=n();return e({mutationFn:({mode:e,secret:t})=>e===`client`?Y(`/api/client/login`,{key:t}):Y(`/api/login`,{password:t,...e===`viewer`?{mode:`viewer`}:{}}),onSuccess:()=>t.invalidateQueries()})}function an(){let t=n();return e({mutationFn:e=>Y(`/api/setup`,{password:e}),onSuccess:()=>t.invalidateQueries()})}function on(){let t=n();return e({mutationFn:()=>Y(`/api/logout`),onSuccess:()=>{t.clear()}})}function sn(){let t=n();return e({mutationFn:()=>Y(`/api/client/logout`),onSuccess:()=>t.clear()})}function cn(){return t({queryKey:$.clientSummary,queryFn:({signal:e})=>J(`/api/client/summary`,e)})}function ln(e,n=6e4){return t({queryKey:$.clientUsage(e),queryFn:({signal:t})=>J(Q(`/api/client/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:n})}function un(e=100,n=zt){return t({queryKey:$.clientLogs(e),queryFn:async({signal:t})=>(await J(Q(`/api/client/logs`,{limit:e}),t)).logs,refetchInterval:n})}function dn(e=6e4){return t({queryKey:$.clientQuota,queryFn:async({signal:e})=>(await J(`/api/client/quota`,e)).accounts,refetchInterval:e})}function fn(e,n=!0){return t({queryKey:$.clientQuotaHistory(e),enabled:n,queryFn:({signal:t})=>J(Q(`/api/client/quota/history`,{since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:3e5})}function pn(){let t=n();return e({mutationFn:({id:e,patch:t})=>Et(`/api/credentials/${e}`,t),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function mn(){let t=n();return e({mutationFn:e=>Z(`/api/credentials/${e}`),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function hn(){let t=n();return e({mutationFn:e=>X(`/api/models/${e.id}`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function gn(){let t=n();return e({mutationFn:e=>Z(`/api/models/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function _n(){return e({mutationFn:({modelId:e,need:t})=>Y(`/api/models/${e}/dry-run`,t)})}function vn(){let t=n();return e({mutationFn:e=>Y(`/api/keys`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function yn(){let t=n();return e({mutationFn:({id:e,limits:t})=>X(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function bn(){let t=n();return e({mutationFn:({id:e,modelAllowlist:t})=>X(`/api/keys/${e}/models`,{modelAllowlist:t}),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function xn(){let t=n();return e({mutationFn:e=>Z(`/api/keys/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function Sn(){let t=n();return e({mutationFn:e=>X(`/api/settings`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.settings})})}function Cn(){return e({mutationFn:e=>X(`/api/settings/password`,e)})}function wn(){let t=n();return e({mutationFn:e=>X(`/api/settings/viewer-password`,{password:e}),onSuccess:()=>t.invalidateQueries({queryKey:$.status})})}function Tn(){return e({mutationFn:e=>Y(`/api/connect/start`,e)})}function En(){let t=n();return e({mutationFn:e=>Y(`/api/credentials`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function Dn(){let t=n();return e({mutationFn:e=>Y(`/api/connect/finish`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function On(){return t({queryKey:$.plugins,queryFn:async({signal:e})=>(await J(`/api/plugins`,e)).plugins,staleTime:3e5})}async function kn(e){let t=await q(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}export{pn as $,re as $t,Mt as A,we as At,Qt as B,ye as Bt,Ot as C,Ue as Ct,Zt as D,Te as Dt,gn as E,Ie as Et,jt as F,V as Ft,yn as G,de as Gt,hn as H,k as Ht,On as I,he as It,Pt as J,ee as Jt,bn as K,O as Kt,At as L,_e as Lt,rn as M,Oe as Mt,on as N,Ee as Nt,_n as O,je as Ot,Bt as P,De as Pt,Dt as Q,b as Qt,Vt as R,ge as Rt,kt as S,Ge as St,mn as T,ze as Tt,Yt as U,le as Ut,xn as V,A as Vt,Sn as W,pe as Wt,nn as X,ue as Xt,an as Y,te as Yt,Kt as Z,ae as Zt,Tn as _,Ct as _t,Gt as a,Y as at,vn as b,ot as bt,It as c,ft as ct,un as d,ht as dt,w as en,Rt as et,dn as f,yt as ft,Dn as g,St as gt,ln as h,bt as ht,$ as i,J as it,en as j,Ae as jt,$t as k,Ne as kt,Cn as l,pt as lt,cn as m,gt as mt,zt as n,_ as nn,wt as nt,Lt as o,X as ot,fn as p,vt as pt,wn as q,fe as qt,kn as r,Z as rt,Ft as s,_t as st,Ht as t,g as tn,Xt as tt,sn as u,mt as ut,Ut as v,ut as vt,Wt as w,Be as wt,Jt as x,Ke as xt,En as y,dt as yt,tn as z,R as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={"admin-password-changed":`The restored database carries a different admin password, so every session ended. Sign in with the password that database was saved with.`,"password-changed":`The admin password was changed, so every session ended. Sign in with the new password.`};function t(t){return t===void 0?null:Object.hasOwn(e,t)?e[t]:null}function n(e){window.location.assign(`/login?reason=${e}`)}export{n,t};
|