omnigateway 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/bin/omni.js +79 -30
- package/gateway.js +782 -64
- package/package.json +1 -1
- package/public/assets/{Chip-BWxO0uV7.js → Chip-BOyBT5TP.js} +1 -1
- package/public/assets/{CopyValue-DIR5A6PG.js → CopyValue-DRHHQlN_.js} +3 -3
- package/public/assets/{Field-DI5YTYOX.js → Field-DK5zaBVA.js} +1 -1
- package/public/assets/Lamp-ZlMzNs5N.js +25 -0
- package/public/assets/{Panel-BCpZVY4U.js → Panel-CYQvfI3L.js} +19 -19
- package/public/assets/Rack-D798XvPQ.js +466 -0
- package/public/assets/{Readout-B0TZE8aA.js → Readout-D6-aurU8.js} +1 -1
- package/public/assets/{RequestTable-D4z82uxG.js → RequestTable-CEBhwDs7.js} +2 -2
- package/public/assets/{SummaryDeck-CzozuXOu.js → SummaryDeck-DBCSHihY.js} +2 -2
- package/public/assets/{Toggle-ByxBCMfb.js → Toggle-CdCCoDEo.js} +1 -1
- package/public/assets/{TokenBreakdown-BMEiZhRX.js → TokenBreakdown-DDI9uTPW.js} +1 -1
- package/public/assets/{WindowChart-nxC4SCRC.js → WindowChart-C-Y6U3WF.js} +2 -2
- package/public/assets/_app-BWNEo1e-.js +1 -0
- package/public/assets/_app.accounts-CLLLwN77.js +59 -0
- package/public/assets/{_app.console-D6lrTxJt.js → _app.console-Dr9qxU7J.js} +3 -3
- package/public/assets/{_app.database-Y3lFDxoP.js → _app.database-D0W0pcxC.js} +4 -4
- package/public/assets/{_app.index-DUFa7RRT.js → _app.index-CyxnfhVX.js} +8 -8
- package/public/assets/{_app.keys-DRfXCzMJ.js → _app.keys-D9qmw9Tj.js} +11 -11
- package/public/assets/{_app.logs-BQT3kFZr.js → _app.logs-DtXUZETW.js} +4 -4
- package/public/assets/{_app.models-CDpbIYHW.js → _app.models-CNxwXyFl.js} +11 -11
- package/public/assets/{_app.plugins._pluginId-jaswB8Z5.js → _app.plugins._pluginId-87Ox_hkW.js} +1 -1
- package/public/assets/_app.plugins._pluginId-CZWipH1n.js +2 -0
- package/public/assets/_app.settings-DjiMSl1Y.js +88 -0
- package/public/assets/{_app.usage-BaT54Vee.js → _app.usage-CZz9raYR.js} +6 -6
- package/public/assets/{chevron-right-0adI8395.js → chevron-right-CPoaXYHw.js} +1 -1
- package/public/assets/client-CZnyYbay.js +39 -0
- package/public/assets/{index-BRrBGt1i.js → index-DNSPtYpM.js} +3 -3
- package/public/assets/{login-BSWCo_Fz.js → login-BtlMmyKj.js} +3 -3
- package/public/assets/login-dV42ZQIA.js +2 -0
- package/public/assets/plus-_zo43Lvf.js +1 -0
- package/public/assets/{preload-helper-CD37DT-E.js → preload-helper-4wSmu2-E.js} +1 -1
- package/public/assets/{shared-dShKzjig.js → shared-OJcoRCqT.js} +1 -1
- package/public/assets/{stream-BD4FhzLn.js → stream-CEb81tzM.js} +1 -1
- package/public/assets/{trash-2-DrDlpCqO.js → trash-2-BjpqTubo.js} +1 -1
- package/public/index.html +8 -8
- package/public/assets/Lamp-DN2EKL4m.js +0 -25
- package/public/assets/Rack-B03tpeW-.js +0 -466
- package/public/assets/_app-D9B6OIjd.js +0 -1
- package/public/assets/_app.accounts-BiRGhH3s.js +0 -59
- package/public/assets/_app.plugins._pluginId-CtEAGvad.js +0 -2
- package/public/assets/_app.settings-CG63splg.js +0 -58
- package/public/assets/client-_6YMm6vh.js +0 -39
- package/public/assets/login-C7v-Fr28.js +0 -2
- package/public/assets/plus-B_f8M9yB.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-
|
|
2
|
-
import{$t as e,Cn as t,Ct as n,Gt as r,Jt as i,Qt as a,V as o,W as s,Xt as c,Yt as l,Zt as u,_n as d,an as f,bn as p,cn as m,dn as h,fn as g,gn as _,hn as v,in as y,mn as b,nn as x,on as S,pn as C,qt as w,rn as T,sn as E,tn as D,un as ee,xn as te,yn as ne}from"./Lamp-DN2EKL4m.js";import{a as re,c as ie,i as ae,n as O,o as oe,r as k,s as se,t as A}from"./preload-helper-CD37DT-E.js";import{E as ce,O as j,S as le,a as ue,g as de,k as fe,l as pe,s as me,t as he}from"./Panel-BCpZVY4U.js";import{h as ge,n as _e,p as ve}from"./Rack-B03tpeW-.js";import{n as ye,t as be}from"./stream-BD4FhzLn.js";import{t as xe}from"./login-C7v-Fr28.js";import{t as Se}from"./_app.plugins._pluginId-CtEAGvad.js";import{MutationCache as Ce,QueryCache as we,QueryClient as Te,QueryClientProvider as Ee}from"@tanstack/react-query";import*as M from"react";import{StrictMode as De}from"react";import{Fragment as Oe,jsx as N,jsxs as P}from"react/jsx-runtime";import{createRoot as ke}from"react-dom/client";import Ae 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 F(e){return e?.isNotFound===!0}function je(){try{return sessionStorage}catch{return}}var Me=`tsr-scroll-restoration-v1_3`,Ne=je();function Pe(){try{return JSON.parse(Ne?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Fe(){try{Ne?.setItem(Me,JSON.stringify(I))}catch{}}var I=Pe(),Ie=`data-scroll-restoration-id`,Le=e=>e.state.__TSR_key||e.href;function Re(e){let t=e.getAttribute(Ie);if(t)return`[${Ie}="${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 ze=!1,Be=`window`;function Ve(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function He(e){let t=new Set;for(let n of e){if(n===Be)continue;let e=Ve(n);e&&t.add(e)}return t}function Ue(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Le,a=new Set,o=e=>{let t=I[e]||={};for(let e of a)e===document?t[Be]={scrollX,scrollY}:e.isConnected&&(t[Re(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ze=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{ze||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())),Fe()})),!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=I[d];if(e){let t=I[u];for(let n in e){if(n===Be){if(s)continue}else{let e=Ve(n);if(!e||s&&o&&(l??=He(o),l.has(e)))continue}t||=I[u]={},t[n]??=e[n]}}}ze=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=He(o));let t=e&&i&&c,s=r.restoring?I[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Be){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ve(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{ze=!1}}))}function We(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 Ge(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ke(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]=Ge(r):Array.isArray(t)?t.push(Ge(r)):n[e]=[t,Ge(r)]}return n}var qe=/^(?:\s|["[{\d-]|fa|nu|tr)/,Je=Xe(JSON.parse),Ye=Ze(JSON.stringify,JSON.parse);function Xe(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ke(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ze(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&&!qe.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=We(e,r);return t?`?${t}`:``}}function Qe(e){return{input:({url:t})=>{for(let n of e)t=et(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=tt(e[n],t);return t}}}function $e(t){let n=e(t.basepath),r=`/${n}`,i=t.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:e})=>{let n=t.caseSensitive?e.pathname:e.pathname.toLowerCase();return n===i?e.pathname=`/`:n.startsWith(a)&&(e.pathname=e.pathname.slice(r.length)),e},output:({url:e})=>(e.pathname=u([`/`,n,e.pathname]),e)}}function et(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 tt(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 nt(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(()=>{h(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 L=`__TSR_index`,rt=`popstate`,it=`beforeunload`;function at(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=lt(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[L];i=ot(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[L];i=ot(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[L]!==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 ot(e,t){t||={};let n=ut();return{...t,key:n,__TSR_key:n,[L]:e}}function st(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??(()=>lt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ut();t.history.replaceState({[L]: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=lt(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[L]-l.state[L],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=at({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(it,x,{capture:!0}),t.removeEventListener(rt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(it,x,{capture:!0}),t.addEventListener(rt,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 ct(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function lt(e,t){let n=ct(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ut();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||{[L]:0,key:a,__TSR_key:a}}}function ut(){return(Math.random()+1).toString(36).substring(7)}function dt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function ft(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function pt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function mt(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 ht=class{constructor(t,n){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=t=>{let n=this.options,r=this.basepath??n?.basepath??`/`,i=this.basepath===void 0,a=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=l(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:st()),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=m(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=nt(this.latestLocation,e),Ue(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||r!==o||a!==s){this.basepath=o;let t=[],n=e(o);n&&n!==`/`&&t.push($e({basepath:o})),s&&t.push(s),this.rewrite=t.length===0?void 0:t.length===1?t[0]:Qe(t),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=E(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&S(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=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:g(e).path,external:!1,searchStr:o,search:p(t?.search,i),hash:g(r.slice(1)).path,state:te(t?.state,a)}}let o=new URL(i,this.origin),s=et(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:g(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:p(t?.search,c),hash:g(s.hash.slice(1)).path,state:te(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>a({base:e,to:t.includes(`//`)?i(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=y(D(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=t.to?`${t.to}`:void 0,o=r[2],s=Object.assign(Object.create(null),r[3]),l=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),u=a?this.resolvePathWithBase(l,a):l,d=xt(t.params,s),f=this.routesByPath[D(u)],m;if(f)m=this.getRouteBranch(f);else if(u.includes(`$`))m=[];else{let[e,t,n]=this.getMatchedRoutes(u);m=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&_(d))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let h=e.leaveParams?u:g(c({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,vt(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=yt(y,t,m,e._includeValidateSearch),y=p(o,y);let x=this.options.stringifySearch(y),S=t.hash===!0?n.hash:t.hash?v(t.hash,n.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?n.state:t.state?v(t.state,n.state):{};w=te(n.state,w);let T=`${h}${x}${C}`,E,ee,ne=!1;if(this.rewrite){let e=new URL(T,this.origin),t=tt(this.rewrite,e);E=e.href.replace(e.origin,``),t.origin===this.origin?ee=t.pathname+t.search+t.hash:(ee=t.href,ne=!0)}else E=b(T),ee=E;return{publicHref:ee,href:E,pathname:h,search:y,searchStr:x,state:w,hash:S??``,external:ne,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=T(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=xt(s,n);r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=D(this.latestLocation.href)===D(n.href)&&C(pt(n.state),pt(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=lt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=et(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(d(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 tn(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(ft(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`)&&dt(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&&d(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=R,this.preloadRoute=e=>nn(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=f(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!C(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?C(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??Ye,parseSearch:t.parseSearch??Je,protocolAllowlist:t.protocolAllowlist??ee}),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=x(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:D(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?bt(this.options.notFoundMode,a):void 0,l=Array(a.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 n=0;n<a.length;n++){let i=a[n],o=l[n-1],u,m,h;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=vt(i.options.validateSearch,{...n})??void 0;u={...n,...e},m={...r,...e}}catch(e){let r=e;if(e instanceof gt||(r=new gt(e.message,{cause:e})),t?.throwOnError)throw r;u=n,m={},h=r}}let g=``,_=``;try{g=i.options.loaderDeps?.({search:u})??``,_=g&&JSON.stringify(g)||``}catch(e){if(t?.throwOnError)throw e;h??=e}let{interpolatedPath:v,usedParams:y}=c({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=i.id+v+_,x=d(i,n),S=this._cache.get(b)??(x?.id===b?x:void 0);f=S?._strictParams??Object.assign(y,f);let C;if(!S)try{St(i,f)}catch(e){if(C=F(e)||oe(e)?e:new _t(e.message,{cause:e}),t?.throwOnError)throw C}let w=x?`stay`:`enter`,T;if(S)T={...S,cause:w,search:p(x?x.search:S.search,u),_strictSearch:m,searchError:h};else{let e=dt(i)?`pending`:`success`;T={id:b,ssr:i.options.ssr,index:n,routeId:i.id,params:x?.params??f,_strictParams:f,pathname:v,updatedAt:Date.now(),search:x?p(x.search,u):u,_strictSearch:m,searchError:h,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:x?te(x.loaderDeps,g):g,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=s===i.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,l[n]=T}for(let e=0;e<l.length;e++){let n=l[e];n.params=n.cause===`stay`?p(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=ne(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=ne(a),c={...e.search};for(let e of a)try{Object.assign(c,vt(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{St(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},gt=class extends Error{},_t=class extends Error{};function vt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new gt(`Async validation not supported`);if(n.issues)throw new gt(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 yt(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=vt(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=v(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 bt(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 ie}function xt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,v(e,t))}function St(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Ct(e,t){return e.options[t]?.preload?.()}function wt(e,t){let n=Ct(e,`component`),r=Ct(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function R(e,t,n){let r=()=>t===!1?void 0:t?Ct(e,t):wt(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 Tt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var z=0,B=1,Et=2,V=3,H=4;function U(e){return typeof e[0]==`number`}function W(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 G(e,t){return e.routesById[t.routeId]}function Dt(e,t,n){return oe(e)?[V,e]:F(e)?(e.routeId||=n,[Et,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[B,e]:[z,e])}function Ot(e,t){let n=Dt(t,!0,e.id);if(n[0]!==B)return n;try{e.options.onError?.(n[1])}catch(t){n=Dt(t,!0,e.id)}return n}function kt(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[H]):Ot(e,t)}function At(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function jt(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=G(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:At(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 K(e,r),[t,kt(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[H]];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[t,kt(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{Pt(e,r,`beforeLoad`,n[0]);let a=await W(m(h),c);if(!n[2]())return n[0].abort(),[t,[H]];let o=Dt(a,!1,i.id);if(o[0]!==z)return K(e,r),[t,o];r.context={...f,...a}}catch(a){return K(e,r),[t,kt(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Pt(e,r,!1,n[0])}}i()}function Mt(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 K(e,t){let n=t._flight;t._flight=void 0,Mt(e,t,n)?.abort()}function q(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=Mt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Nt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Pt(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 Ft(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:At(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 It(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[H];if(!i)return[z,void 0];let l=n._flight;Pt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ft(e,t,n,r,s,a,o))).then(e=>Dt(e,!1,r.id),e=>Dt(e,!0,r.id)).then(t=>(t[0]!==z&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===B&&l[2]?Ot(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await W(l[0],c)}catch(t){if(t!==c)throw t;return K(e,n),[H]}finally{Pt(e,n,!1,s)}}function Lt(e,t,n){t[0]===z?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==V&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Rt(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&&K(e,r)}function zt(e,t){return t[0]===B||t[0]===Et?{...e,status:t[0]===B?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Bt(e,t,n,r,i,a,o){let s=t[1][n],c=G(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(Ft(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[H])),!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,K(e,s),p=kt(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,Mt(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?It(e,t,s,c,h,i,l,a[0]):Promise.resolve([z,s.loaderData])).then(t=>(y&&(Lt(s,t,l),t[0]===z&&(l&&m&&!a[0].signal.aborted&&Rt(e,s,u),s.status=`pending`)),t)),S=W(Promise.resolve().then(()=>R(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,kt(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===z&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>zt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=It(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Lt(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>zt(C,e))}async function Vt(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=G(e,t[n]),a=R(i,!1);if(a)try{await W(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Ht(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]>=V)throw[a,t];!i&&t[0]!==z&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===V)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Ut(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]===Et?Vt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=V)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]!==z&&t[0]<V&&!(`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)>=V){let n=c[1];if(n[0]!==V||n[1].options.reloadDocument||i<20)return J(e,t),n;l=!0,c=[0,[B,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===B?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=G(e,u);try{await W(i?Promise.resolve().then(()=>R(m,a===B?`errorComponent`:`notFoundComponent`)):Promise.all([R(m),R(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return J(e,t),[H]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,s),f()):(u.status=`success`,o?.())}return t}async function Wt(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=G(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 W(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 Gt(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 Vt(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=Bt(e,i,t,l,d,r,c)},p=await jt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===Et?(p[2]=await Vt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=V&&(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=Ut(e,i,l,r[0],r[1],Ht(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Ht(i[2],void 0,void 0,t.then(e=>U(e)?0:Tt(e[1]).length,()=>0))),m=await t}catch(t){throw J(e,i),t}return U(m)?m:Wt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function Kt(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=G(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(()=>Kt(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 qt(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function Jt(e,t){e._committed=t,e.stores.setMatches(t)}function Yt(e,t){q(e,t[1]),J(e,t)}function Xt(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=Tt(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=G(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,Jt(e,n),q(e,[...a.values(),...i],[...n,...s.values()]),mt(e,i,n,()=>e._tx===t)}async function Y(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function Zt(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function Qt(e,t){qt(e,t),t[0].abort(),q(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 $t(e,t,n,r,i){let a=n.map(e=>({...e}));Nt(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ut(e,o,r,t[0],t[1],i)}catch(t){throw q(e,a),t}if(U(s)){q(e,a),s[0]===V&&e._tx===t&&e._committed===n&&await Zt(e,t,s[1]);return}let c=await Wt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){q(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),K(e,n))}Jt(e,c[1]),q(e,n,c[1])}async function en(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 Gt(e,t[2],t[3],o);if(U(s)){s[0]===V&&e._tx===t?(qt(e,t),q(e,t[3]),t[3]=[],e._tx===t&&await Zt(e,t,s[1])):Qt(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 W(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 W(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){qt(e,t),Yt(e,s);return}let l=t[2],u=ft(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){Yt(e,s);return}let n=await e.startTransition(()=>{qt(e,t),Xt(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){J(e,s);return}d?.length&&$t(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 tn(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 Y(e,n);return}let f=ft(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await Y(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Nt(m)}catch(t){if(u.abort(),!oe(t)){await Y(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await Y(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){q(e,m),await Y(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>en(e,_,p,()=>Kt(e,_),t?.sync,g)).catch(()=>{e._tx===_&&Qt(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Pt(e,t,!1)}n[0].abort(),q(e,n[3],_[3],!0)}if(e._tx!==_){q(e,_[3]),_[3]=[],await Y(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&Kt(e,_);try{await _[5]}finally{await Y(e,_)}}async function nn(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}),Nt(o)}catch(e){a.abort(),F(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Gt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),q(e,o),a.abort()}if(!U(t))return t[1];if(s&&t[0]===V&&!t[1].options.reloadDocument)return nn(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){F(e)||console.error(e)}}function rn(e){return N(an,{...e})}var an=class extends M.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?M.createElement(this.props.errorComponent??on,{error:e,reset:this.reset}):this.props.children}};function on({error:e}){let[t,n]=M.useState(!1);return P(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[P(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[N(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),N(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),N(`div`,{style:{height:`.25rem`}}),t?N(`div`,{children:N(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?N(`code`,{children:e.message}):null})}):null]})}var X=(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))(X||{});function sn({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 cn(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 ln=[],un=0,{link:dn,unlink:fn,propagate:pn,checkDirty:mn,shallowPropagate:hn}=sn({update(e){return e._update()},notify(e){ln[_n++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,bn(e))}}),gn=0,_n=0,Z,vn=0;function yn(e){try{++vn,e()}finally{--vn||xn()}}function bn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=fn(n,e)}function xn(){if(!(vn>0)){for(;gn<_n;){let e=ln[gn];ln[gn++]=void 0,e.notify()}gn=0,_n=0}}function Sn(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?X.None:X.Mutable,get(){return Z!==void 0&&dn(i,Z,un),i._snapshot},subscribe(e){let t=cn(e),n={current:!1},r=Cn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++un,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.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{Z=a,n&&(i.flags&=~X.RecursedCheck),bn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&mn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&hn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&dn(i,Z,un),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(pn(e),hn(e),xn())}},i}function Cn(e){let t=()=>{let t=Z;Z=n,++un,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,bn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&mn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,bn(this)}};return t(),n}function wn(e){let t=j(),n=`not-found-${r(t.stores.location,e=>e.pathname)}-${r(t.stores.status,e=>e)}`;return N(rn,{getResetKey:()=>n,onCatch:(t,n)=>{if(F(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(F(t))return e.fallback?.(t);throw t},children:e.children})}function Tn(){return N(`p`,{children:`Not Found`})}function Q(e){return N(Oe,{children:e.children})}function En(e,t,n){return t.options.notFoundComponent?N(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?N(e.options.defaultNotFoundComponent,{...n}):N(Tn,{})}function Dn(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?N(n,{}):null}var On=(e,t)=>e[0]===t[0]&&e[1]===t[1],kn=M.memo(function({routeId:e}){let t=j();return N(An,{router:t,match:r(t.stores.getMatchStore(e),e=>e)})});function An({router:e,match:t}){let n=e.routesById[t.routeId],r=Dn(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)?M.Suspense:Q,l=i?rn:Q,u=o?wn:Q;return P(n.isRoot?n.options.shellComponent??Q:Q,{children:[N(re.Provider,{value:t.routeId,children:N(c,{fallback:r,children:N(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(F(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:N(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return M.createElement(o,e)},children:s?N(w,{fallback:r,children:N(jn,{match:t})}):N(jn,{match:t})})})})}),null]})}var jn=M.memo(function({match:e}){let t=j(),n=e.routeId,r=t.routesById[n],i=M.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=M.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?N(e,{},i):N(Mn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t._tx)throw t._tx[5];return Dn(t,r)}if(e.status===`notFound`)return En(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Mn=M.memo(function(){let e=j(),t=M.useContext(re),n,i,a;{let o=e.stores.getMatchStore(t);[n,i]=r(o,e=>[!!e._notFound,e.error],On),a=r(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return En(e,e.routesById[t],i);if(!a)return null;let o=N(kn,{routeId:a});return t===`__root__`?N(M.Suspense,{fallback:Dn(e),children:o}):o});function Nn(e,t){let n=e[1];e.length=0,n?.(t)}function Pn({t:e}){let n=j(),r=n._rendered??=[];return n.startTransition=(t,i)=>new Promise((a,o)=>{Nn(r,!1),r.push(i,a),e(n),M.startTransition(()=>{try{t()}catch(e){r[1]===a&&(r.length=0),o(e)}})}),t(()=>{let e=n.history.subscribe(n.load);n.updateLatestLocation();let t=n.latestLocation,i=n.buildLocation({to:t.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(D(t.publicHref)!==D(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=n.stores.resolvedLocation.get();return a?.href===t.href&&a.state.__TSR_key===t.state.__TSR_key?r.push(n.stores.matches.get(),e=>{e&&n.emit({type:`onRendered`,...ft(a,a)})}):n._tx||n.load().catch(console.error),e},[n,n.history]),null}function Fn(){let e=j(),t=e.routesById[ie],n=Dn(e,t),r=e.ssr?Q:M.Suspense,i=P(Oe,{children:[N(Pn,{t:M.useState()[1]}),N(r,{fallback:n,children:N(In,{})})]});return e.options.InnerWrap?N(e.options.InnerWrap,{children:i}):i}function In(){let e=j(),n=e._rendered,i=r(e.stores.matches,e=>n[0]??e),a=i[0],o=a?.routeId;t(()=>{n[0]===i&&Nn(n,!0)},[n,i]);let s=o?N(kn,{routeId:o}):null;return N(re.Provider,{value:o,children:e.options.disableGlobalCatchBoundary?s:N(rn,{getResetKey:()=>a,onCatch:void 0,children:s})})}var Ln=e=>({createMutableStore:Sn,createReadonlyStore:Sn,batch:yn}),Rn=e=>new zn(e),zn=class extends ht{constructor(e){super(e,Ln)}};function Bn({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=N(fe.Provider,{value:e,children:t});return e.options.Wrap?N(e.options.Wrap,{children:r}):r}function Vn({router:e,...t}){return N(Bn,{router:e,...t,children:N(Fn,{})})}var Hn=Ae.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-BWNEo1e-.js","assets/Panel-CYQvfI3L.js","assets/client-CZnyYbay.js","assets/shared-OJcoRCqT.js","assets/Lamp-ZlMzNs5N.js","assets/Rack-D798XvPQ.js","assets/chevron-right-CPoaXYHw.js","assets/stream-CEb81tzM.js","assets/Field-DK5zaBVA.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-C-Y6U3WF.js","assets/RequestTable-CEBhwDs7.js","assets/TokenBreakdown-DDI9uTPW.js","assets/Chip-BOyBT5TP.js","assets/SummaryDeck-DBCSHihY.js","assets/Readout-D6-aurU8.js","assets/_app.index-CyxnfhVX.js","assets/_app.accounts-CLLLwN77.js","assets/CopyValue-DRHHQlN_.js","assets/plus-_zo43Lvf.js","assets/trash-2-BjpqTubo.js","assets/Toggle-CdCCoDEo.js","assets/_app.console-Dr9qxU7J.js","assets/_app.database-D0W0pcxC.js","assets/reasons-Du1OBWAM.js","assets/_app.keys-D9qmw9Tj.js","assets/_app.logs-DtXUZETW.js","assets/_app.models-CNxwXyFl.js","assets/_app.settings-DjiMSl1Y.js","assets/_app.usage-CZz9raYR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$t as e,Cn as t,Ct as n,Gt as r,Jt as i,Qt as a,V as o,W as s,Xt as c,Yt as l,Zt as u,_n as d,an as f,bn as p,cn as m,dn as h,fn as g,gn as _,hn as v,in as y,mn as b,nn as x,on as S,pn as C,qt as w,rn as T,sn as E,tn as D,un as ee,xn as te,yn as ne}from"./Lamp-ZlMzNs5N.js";import{a as re,c as ie,i as ae,n as O,o as oe,r as k,s as se,t as A}from"./preload-helper-4wSmu2-E.js";import{A as ce,C as le,D as ue,_ as de,a as fe,k as j,l as pe,s as me,t as he}from"./Panel-CYQvfI3L.js";import{h as ge,n as _e,p as ve}from"./Rack-D798XvPQ.js";import{n as ye,t as be}from"./stream-CEb81tzM.js";import{t as xe}from"./login-dV42ZQIA.js";import{t as Se}from"./_app.plugins._pluginId-CZWipH1n.js";import{MutationCache as Ce,QueryCache as we,QueryClient as Te,QueryClientProvider as Ee}from"@tanstack/react-query";import*as M from"react";import{StrictMode as De}from"react";import{Fragment as Oe,jsx as N,jsxs as P}from"react/jsx-runtime";import{createRoot as ke}from"react-dom/client";import Ae 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 F(e){return e?.isNotFound===!0}function je(){try{return sessionStorage}catch{return}}var Me=`tsr-scroll-restoration-v1_3`,Ne=je();function Pe(){try{return JSON.parse(Ne?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Fe(){try{Ne?.setItem(Me,JSON.stringify(I))}catch{}}var I=Pe(),Ie=`data-scroll-restoration-id`,Le=e=>e.state.__TSR_key||e.href;function Re(e){let t=e.getAttribute(Ie);if(t)return`[${Ie}="${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 ze=!1,Be=`window`;function Ve(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function He(e){let t=new Set;for(let n of e){if(n===Be)continue;let e=Ve(n);e&&t.add(e)}return t}function Ue(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Le,a=new Set,o=e=>{let t=I[e]||={};for(let e of a)e===document?t[Be]={scrollX,scrollY}:e.isConnected&&(t[Re(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ze=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{ze||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())),Fe()})),!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=I[d];if(e){let t=I[u];for(let n in e){if(n===Be){if(s)continue}else{let e=Ve(n);if(!e||s&&o&&(l??=He(o),l.has(e)))continue}t||=I[u]={},t[n]??=e[n]}}}ze=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=He(o));let t=e&&i&&c,s=r.restoring?I[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Be){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ve(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{ze=!1}}))}function We(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 Ge(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ke(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]=Ge(r):Array.isArray(t)?t.push(Ge(r)):n[e]=[t,Ge(r)]}return n}var qe=/^(?:\s|["[{\d-]|fa|nu|tr)/,Je=Xe(JSON.parse),Ye=Ze(JSON.stringify,JSON.parse);function Xe(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ke(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ze(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&&!qe.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=We(e,r);return t?`?${t}`:``}}function Qe(e){return{input:({url:t})=>{for(let n of e)t=et(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=tt(e[n],t);return t}}}function $e(t){let n=e(t.basepath),r=`/${n}`,i=t.caseSensitive?r:r.toLowerCase(),a=`${i}/`;return{input:({url:e})=>{let n=t.caseSensitive?e.pathname:e.pathname.toLowerCase();return n===i?e.pathname=`/`:n.startsWith(a)&&(e.pathname=e.pathname.slice(r.length)),e},output:({url:e})=>(e.pathname=u([`/`,n,e.pathname]),e)}}function et(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 tt(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 nt(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(()=>{h(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 L=`__TSR_index`,rt=`popstate`,it=`beforeunload`;function at(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=lt(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[L];i=ot(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[L];i=ot(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[L]!==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 ot(e,t){t||={};let n=ut();return{...t,key:n,__TSR_key:n,[L]:e}}function st(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??(()=>lt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ut();t.history.replaceState({[L]: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=lt(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[L]-l.state[L],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=at({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(it,x,{capture:!0}),t.removeEventListener(rt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(it,x,{capture:!0}),t.addEventListener(rt,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 ct(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function lt(e,t){let n=ct(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=ut();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||{[L]:0,key:a,__TSR_key:a}}}function ut(){return(Math.random()+1).toString(36).substring(7)}function dt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function ft(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function pt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function mt(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 ht=class{constructor(t,n){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=t=>{let n=this.options,r=this.basepath??n?.basepath??`/`,i=this.basepath===void 0,a=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=l(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:st()),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=m(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=nt(this.latestLocation,e),Ue(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||r!==o||a!==s){this.basepath=o;let t=[],n=e(o);n&&n!==`/`&&t.push($e({basepath:o})),s&&t.push(s),this.rewrite=t.length===0?void 0:t.length===1?t[0]:Qe(t),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=E(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&S(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=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:g(e).path,external:!1,searchStr:o,search:p(t?.search,i),hash:g(r.slice(1)).path,state:te(t?.state,a)}}let o=new URL(i,this.origin),s=et(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:g(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:p(t?.search,c),hash:g(s.hash.slice(1)).path,state:te(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>a({base:e,to:t.includes(`//`)?i(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=y(D(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=t.to?`${t.to}`:void 0,o=r[2],s=Object.assign(Object.create(null),r[3]),l=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),u=a?this.resolvePathWithBase(l,a):l,d=xt(t.params,s),f=this.routesByPath[D(u)],m;if(f)m=this.getRouteBranch(f);else if(u.includes(`$`))m=[];else{let[e,t,n]=this.getMatchedRoutes(u);m=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&_(d))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let h=e.leaveParams?u:g(c({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,vt(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=yt(y,t,m,e._includeValidateSearch),y=p(o,y);let x=this.options.stringifySearch(y),S=t.hash===!0?n.hash:t.hash?v(t.hash,n.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?n.state:t.state?v(t.state,n.state):{};w=te(n.state,w);let T=`${h}${x}${C}`,E,ee,ne=!1;if(this.rewrite){let e=new URL(T,this.origin),t=tt(this.rewrite,e);E=e.href.replace(e.origin,``),t.origin===this.origin?ee=t.pathname+t.search+t.hash:(ee=t.href,ne=!0)}else E=b(T),ee=E;return{publicHref:ee,href:E,pathname:h,search:y,searchStr:x,state:w,hash:S??``,external:ne,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=T(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=xt(s,n);r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=D(this.latestLocation.href)===D(n.href)&&C(pt(n.state),pt(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=lt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=et(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(d(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 tn(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(ft(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`)&&dt(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&&d(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=R,this.preloadRoute=e=>nn(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=f(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!C(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?C(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??Ye,parseSearch:t.parseSearch??Je,protocolAllowlist:t.protocolAllowlist??ee}),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=x(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:D(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?bt(this.options.notFoundMode,a):void 0,l=Array(a.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 n=0;n<a.length;n++){let i=a[n],o=l[n-1],u,m,h;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=vt(i.options.validateSearch,{...n})??void 0;u={...n,...e},m={...r,...e}}catch(e){let r=e;if(e instanceof gt||(r=new gt(e.message,{cause:e})),t?.throwOnError)throw r;u=n,m={},h=r}}let g=``,_=``;try{g=i.options.loaderDeps?.({search:u})??``,_=g&&JSON.stringify(g)||``}catch(e){if(t?.throwOnError)throw e;h??=e}let{interpolatedPath:v,usedParams:y}=c({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=i.id+v+_,x=d(i,n),S=this._cache.get(b)??(x?.id===b?x:void 0);f=S?._strictParams??Object.assign(y,f);let C;if(!S)try{St(i,f)}catch(e){if(C=F(e)||oe(e)?e:new _t(e.message,{cause:e}),t?.throwOnError)throw C}let w=x?`stay`:`enter`,T;if(S)T={...S,cause:w,search:p(x?x.search:S.search,u),_strictSearch:m,searchError:h};else{let e=dt(i)?`pending`:`success`;T={id:b,ssr:i.options.ssr,index:n,routeId:i.id,params:x?.params??f,_strictParams:f,pathname:v,updatedAt:Date.now(),search:x?p(x.search,u):u,_strictSearch:m,searchError:h,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:x?te(x.loaderDeps,g):g,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=s===i.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,l[n]=T}for(let e=0;e<l.length;e++){let n=l[e];n.params=n.cause===`stay`?p(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=ne(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=ne(a),c={...e.search};for(let e of a)try{Object.assign(c,vt(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{St(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},gt=class extends Error{},_t=class extends Error{};function vt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new gt(`Async validation not supported`);if(n.issues)throw new gt(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 yt(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=vt(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=v(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 bt(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 ie}function xt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,v(e,t))}function St(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Ct(e,t){return e.options[t]?.preload?.()}function wt(e,t){let n=Ct(e,`component`),r=Ct(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function R(e,t,n){let r=()=>t===!1?void 0:t?Ct(e,t):wt(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 Tt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var z=0,B=1,Et=2,V=3,H=4;function U(e){return typeof e[0]==`number`}function W(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 G(e,t){return e.routesById[t.routeId]}function Dt(e,t,n){return oe(e)?[V,e]:F(e)?(e.routeId||=n,[Et,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[B,e]:[z,e])}function Ot(e,t){let n=Dt(t,!0,e.id);if(n[0]!==B)return n;try{e.options.onError?.(n[1])}catch(t){n=Dt(t,!0,e.id)}return n}function kt(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[H]):Ot(e,t)}function At(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function jt(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=G(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:At(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 K(e,r),[t,kt(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[H]];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[t,kt(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{Pt(e,r,`beforeLoad`,n[0]);let a=await W(m(h),c);if(!n[2]())return n[0].abort(),[t,[H]];let o=Dt(a,!1,i.id);if(o[0]!==z)return K(e,r),[t,o];r.context={...f,...a}}catch(a){return K(e,r),[t,kt(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Pt(e,r,!1,n[0])}}i()}function Mt(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 K(e,t){let n=t._flight;t._flight=void 0,Mt(e,t,n)?.abort()}function q(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=Mt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Nt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Pt(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 Ft(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:At(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 It(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[H];if(!i)return[z,void 0];let l=n._flight;Pt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ft(e,t,n,r,s,a,o))).then(e=>Dt(e,!1,r.id),e=>Dt(e,!0,r.id)).then(t=>(t[0]!==z&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===B&&l[2]?Ot(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await W(l[0],c)}catch(t){if(t!==c)throw t;return K(e,n),[H]}finally{Pt(e,n,!1,s)}}function Lt(e,t,n){t[0]===z?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==V&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Rt(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&&K(e,r)}function zt(e,t){return t[0]===B||t[0]===Et?{...e,status:t[0]===B?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Bt(e,t,n,r,i,a,o){let s=t[1][n],c=G(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(Ft(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[H])),!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,K(e,s),p=kt(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,Mt(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?It(e,t,s,c,h,i,l,a[0]):Promise.resolve([z,s.loaderData])).then(t=>(y&&(Lt(s,t,l),t[0]===z&&(l&&m&&!a[0].signal.aborted&&Rt(e,s,u),s.status=`pending`)),t)),S=W(Promise.resolve().then(()=>R(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,kt(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===z&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>zt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=It(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Lt(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>zt(C,e))}async function Vt(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=G(e,t[n]),a=R(i,!1);if(a)try{await W(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Ht(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]>=V)throw[a,t];!i&&t[0]!==z&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===V)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Ut(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]===Et?Vt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=V)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]!==z&&t[0]<V&&!(`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)>=V){let n=c[1];if(n[0]!==V||n[1].options.reloadDocument||i<20)return J(e,t),n;l=!0,c=[0,[B,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===B?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=G(e,u);try{await W(i?Promise.resolve().then(()=>R(m,a===B?`errorComponent`:`notFoundComponent`)):Promise.all([R(m),R(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return J(e,t),[H]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,s),f()):(u.status=`success`,o?.())}return t}async function Wt(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=G(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 W(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 Gt(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 Vt(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=Bt(e,i,t,l,d,r,c)},p=await jt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===Et?(p[2]=await Vt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=V&&(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=Ut(e,i,l,r[0],r[1],Ht(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Ht(i[2],void 0,void 0,t.then(e=>U(e)?0:Tt(e[1]).length,()=>0))),m=await t}catch(t){throw J(e,i),t}return U(m)?m:Wt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function Kt(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=G(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(()=>Kt(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 qt(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function Jt(e,t){e._committed=t,e.stores.setMatches(t)}function Yt(e,t){q(e,t[1]),J(e,t)}function Xt(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=Tt(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=G(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,Jt(e,n),q(e,[...a.values(),...i],[...n,...s.values()]),mt(e,i,n,()=>e._tx===t)}async function Y(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function Zt(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function Qt(e,t){qt(e,t),t[0].abort(),q(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 $t(e,t,n,r,i){let a=n.map(e=>({...e}));Nt(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ut(e,o,r,t[0],t[1],i)}catch(t){throw q(e,a),t}if(U(s)){q(e,a),s[0]===V&&e._tx===t&&e._committed===n&&await Zt(e,t,s[1]);return}let c=await Wt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){q(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),K(e,n))}Jt(e,c[1]),q(e,n,c[1])}async function en(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 Gt(e,t[2],t[3],o);if(U(s)){s[0]===V&&e._tx===t?(qt(e,t),q(e,t[3]),t[3]=[],e._tx===t&&await Zt(e,t,s[1])):Qt(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 W(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 W(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){qt(e,t),Yt(e,s);return}let l=t[2],u=ft(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){Yt(e,s);return}let n=await e.startTransition(()=>{qt(e,t),Xt(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){J(e,s);return}d?.length&&$t(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 tn(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 Y(e,n);return}let f=ft(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await Y(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Nt(m)}catch(t){if(u.abort(),!oe(t)){await Y(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await Y(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){q(e,m),await Y(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>en(e,_,p,()=>Kt(e,_),t?.sync,g)).catch(()=>{e._tx===_&&Qt(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Pt(e,t,!1)}n[0].abort(),q(e,n[3],_[3],!0)}if(e._tx!==_){q(e,_[3]),_[3]=[],await Y(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&Kt(e,_);try{await _[5]}finally{await Y(e,_)}}async function nn(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}),Nt(o)}catch(e){a.abort(),F(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Gt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),q(e,o),a.abort()}if(!U(t))return t[1];if(s&&t[0]===V&&!t[1].options.reloadDocument)return nn(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){F(e)||console.error(e)}}function rn(e){return N(an,{...e})}var an=class extends M.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?M.createElement(this.props.errorComponent??on,{error:e,reset:this.reset}):this.props.children}};function on({error:e}){let[t,n]=M.useState(!1);return P(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[P(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[N(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),N(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),N(`div`,{style:{height:`.25rem`}}),t?N(`div`,{children:N(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?N(`code`,{children:e.message}):null})}):null]})}var X=(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))(X||{});function sn({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 cn(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 ln=[],un=0,{link:dn,unlink:fn,propagate:pn,checkDirty:mn,shallowPropagate:hn}=sn({update(e){return e._update()},notify(e){ln[_n++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,bn(e))}}),gn=0,_n=0,Z,vn=0;function yn(e){try{++vn,e()}finally{--vn||xn()}}function bn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=fn(n,e)}function xn(){if(!(vn>0)){for(;gn<_n;){let e=ln[gn];ln[gn++]=void 0,e.notify()}gn=0,_n=0}}function Sn(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?X.None:X.Mutable,get(){return Z!==void 0&&dn(i,Z,un),i._snapshot},subscribe(e){let t=cn(e),n={current:!1},r=Cn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++un,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.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{Z=a,n&&(i.flags&=~X.RecursedCheck),bn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&mn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&hn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&dn(i,Z,un),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(pn(e),hn(e),xn())}},i}function Cn(e){let t=()=>{let t=Z;Z=n,++un,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,bn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&mn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,bn(this)}};return t(),n}function wn(e){let t=j(),n=`not-found-${r(t.stores.location,e=>e.pathname)}-${r(t.stores.status,e=>e)}`;return N(rn,{getResetKey:()=>n,onCatch:(t,n)=>{if(F(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(F(t))return e.fallback?.(t);throw t},children:e.children})}function Tn(){return N(`p`,{children:`Not Found`})}function Q(e){return N(Oe,{children:e.children})}function En(e,t,n){return t.options.notFoundComponent?N(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?N(e.options.defaultNotFoundComponent,{...n}):N(Tn,{})}function Dn(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?N(n,{}):null}var On=(e,t)=>e[0]===t[0]&&e[1]===t[1],kn=M.memo(function({routeId:e}){let t=j();return N(An,{router:t,match:r(t.stores.getMatchStore(e),e=>e)})});function An({router:e,match:t}){let n=e.routesById[t.routeId],r=Dn(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)?M.Suspense:Q,l=i?rn:Q,u=o?wn:Q;return P(n.isRoot?n.options.shellComponent??Q:Q,{children:[N(re.Provider,{value:t.routeId,children:N(c,{fallback:r,children:N(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(F(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:N(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return M.createElement(o,e)},children:s?N(w,{fallback:r,children:N(jn,{match:t})}):N(jn,{match:t})})})})}),null]})}var jn=M.memo(function({match:e}){let t=j(),n=e.routeId,r=t.routesById[n],i=M.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=M.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?N(e,{},i):N(Mn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t._tx)throw t._tx[5];return Dn(t,r)}if(e.status===`notFound`)return En(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Mn=M.memo(function(){let e=j(),t=M.useContext(re),n,i,a;{let o=e.stores.getMatchStore(t);[n,i]=r(o,e=>[!!e._notFound,e.error],On),a=r(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return En(e,e.routesById[t],i);if(!a)return null;let o=N(kn,{routeId:a});return t===`__root__`?N(M.Suspense,{fallback:Dn(e),children:o}):o});function Nn(e,t){let n=e[1];e.length=0,n?.(t)}function Pn({t:e}){let n=j(),r=n._rendered??=[];return n.startTransition=(t,i)=>new Promise((a,o)=>{Nn(r,!1),r.push(i,a),e(n),M.startTransition(()=>{try{t()}catch(e){r[1]===a&&(r.length=0),o(e)}})}),t(()=>{let e=n.history.subscribe(n.load);n.updateLatestLocation();let t=n.latestLocation,i=n.buildLocation({to:t.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(D(t.publicHref)!==D(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=n.stores.resolvedLocation.get();return a?.href===t.href&&a.state.__TSR_key===t.state.__TSR_key?r.push(n.stores.matches.get(),e=>{e&&n.emit({type:`onRendered`,...ft(a,a)})}):n._tx||n.load().catch(console.error),e},[n,n.history]),null}function Fn(){let e=j(),t=e.routesById[ie],n=Dn(e,t),r=e.ssr?Q:M.Suspense,i=P(Oe,{children:[N(Pn,{t:M.useState()[1]}),N(r,{fallback:n,children:N(In,{})})]});return e.options.InnerWrap?N(e.options.InnerWrap,{children:i}):i}function In(){let e=j(),n=e._rendered,i=r(e.stores.matches,e=>n[0]??e),a=i[0],o=a?.routeId;t(()=>{n[0]===i&&Nn(n,!0)},[n,i]);let s=o?N(kn,{routeId:o}):null;return N(re.Provider,{value:o,children:e.options.disableGlobalCatchBoundary?s:N(rn,{getResetKey:()=>a,onCatch:void 0,children:s})})}var Ln=e=>({createMutableStore:Sn,createReadonlyStore:Sn,batch:yn}),Rn=e=>new zn(e),zn=class extends ht{constructor(e){super(e,Ln)}};function Bn({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=N(ce.Provider,{value:e,children:t});return e.options.Wrap?N(e.options.Wrap,{children:r}):r}function Vn({router:e,...t}){return N(Bn,{router:e,...t,children:N(Fn,{})})}var Hn=Ae.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: center;
|
|
@@ -10,4 +10,4 @@ import{$t as e,Cn as t,Ct as n,Gt as r,Jt as i,Qt as a,V as o,W as s,Xt as c,Yt
|
|
|
10
10
|
font-size: 13px;
|
|
11
11
|
color: ${({theme:e})=>e.color.inkDim};
|
|
12
12
|
max-width: 48ch;
|
|
13
|
-
`,Wn=ae()({component:Mn,notFoundComponent:()=>N(Hn,{children:P(le,{$gap:3,style:{alignItems:`center`},children:[N(de,{children:`Not found`}),N(Un,{children:`This console has no screen at that address.`}),N(
|
|
13
|
+
`,Wn=ae()({component:Mn,notFoundComponent:()=>N(Hn,{children:P(le,{$gap:3,style:{alignItems:`center`},children:[N(de,{children:`Not found`}),N(Un,{children:`This console has no screen at that address.`}),N(ue,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})});async function Gn(e){return e.queryClient.ensureQueryData({queryKey:s.status,queryFn:()=>pe(`/api/status`),revalidateIfStale:!0})}function Kn(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function qn(e,t){let n=Kn(e);if(n===`/login`)throw se({to:`/login`,search:{next:t}});if(n!==`/`)throw se({to:n})}function Jn(e,t){let n=Kn(e);if(n===`/login`)throw se({to:`/login`,search:{next:t}});if(n!==`/client`)throw se({to:n})}var Yn=k(`/_app`)({beforeLoad:async({context:e,location:t})=>{qn(await Gn(e),t.href),await e.queryClient.ensureQueryData(o)},pendingComponent:Xn,pendingMs:200,errorComponent:O(()=>A(()=>import(`./_app-BWNEo1e-.js`),__vite__mapDeps([0,1])),`errorComponent`),component:Zn});function Xn(){return N(he,{legend:`Console`,children:N(fe,{rows:6})})}function Zn(){let e=n().data??[];return N(be,{children:P(ye,{children:[N(ge,{$providers:e}),N(_e,{children:N(Mn,{})})]})})}var Qn=k(`/client`)({beforeLoad:async({context:e,location:t})=>{Jn(await Gn(e),t.href)},component:O(()=>A(()=>import(`./client-CZnyYbay.js`),__vite__mapDeps([2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16])),`component`)}),$n=k(`/_app/`)({component:O(()=>A(()=>import(`./_app.index-CyxnfhVX.js`),__vite__mapDeps([17,4,1,5,13,14,9,10,16])),`component`)}),er=k(`/_app/accounts`)({component:O(()=>A(()=>import(`./_app.accounts-CLLLwN77.js`),__vite__mapDeps([18,4,1,5,19,6,20,21,22,14,8,9,10,11,3])),`component`)}),tr=k(`/_app/console`)({component:O(()=>A(()=>import(`./_app.console-Dr9qxU7J.js`),__vite__mapDeps([23,4,1,5,7,8])),`component`)}),nr=k(`/_app/database`)({component:O(()=>A(()=>import(`./_app.database-D0W0pcxC.js`),__vite__mapDeps([24,4,1,5,8,9,10,16,25])),`component`)}),rr=k(`/_app/keys`)({component:O(()=>A(()=>import(`./_app.keys-D9qmw9Tj.js`),__vite__mapDeps([26,4,1,5,19,6,20,22,14,8,9,10])),`component`)}),ir=k(`/_app/logs`)({component:O(()=>A(()=>import(`./_app.logs-DtXUZETW.js`),__vite__mapDeps([27,4,1,5,14,8,12,13,10])),`component`)}),ar=k(`/_app/models`)({component:O(()=>A(()=>import(`./_app.models-CNxwXyFl.js`),__vite__mapDeps([28,4,1,5,20,21,22,14,8,9])),`component`)}),or=k(`/_app/settings`)({component:O(()=>A(()=>import(`./_app.settings-DjiMSl1Y.js`),__vite__mapDeps([29,4,1,5,22,8,9,25])),`component`)}),sr=k(`/_app/usage`)({component:O(()=>A(()=>import(`./_app.usage-CZz9raYR.js`),__vite__mapDeps([30,3,4,1,5,10,15,16])),`component`)}),$=Yn.update({id:`/_app`,getParentRoute:()=>Wn}),cr=Qn.update({id:`/client`,path:`/client`,getParentRoute:()=>Wn}),lr=xe.update({id:`/login`,path:`/login`,getParentRoute:()=>Wn}),ur=$n.update({id:`/`,path:`/`,getParentRoute:()=>$}),dr={AppAccountsRoute:er.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:tr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:nr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:rr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ir.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:ar.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:or.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:sr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:ur,AppPluginsPluginIdRoute:Se.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},fr={AppRoute:$._addFileChildren(dr),ClientRoute:cr,LoginRoute:lr},pr=Wn._addFileChildren(fr)._addFileTypes();function mr(e){return{isLoginRoute:()=>e().state.location.pathname===`/login`,onUnauthenticated:()=>void e().navigate({to:`/login`,search:{next:e().state.location.href}})}}function hr(e){let t=t=>{!(t instanceof me)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new Te({queryCache:new we({onError:t}),mutationCache:new Ce({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof me&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var gr,_r=hr(mr(()=>gr));gr=Rn({routeTree:pr,context:{queryClient:_r}});var vr=document.getElementById(`root`);if(vr===null)throw Error(`#root is missing from index.html`);ke(vr).render(N(De,{children:N(ve,{children:N(Ee,{client:_r,children:N(Vn,{router:gr})})})}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{It as e,Wt as t,t as n,vt as r,zt as i}from"./Lamp-
|
|
1
|
+
import{It as e,Wt as t,t as n,vt as r,zt as i}from"./Lamp-ZlMzNs5N.js";import{C as a,D as o,E as s,_ as c,b as l,n as u,o as d}from"./Panel-CYQvfI3L.js";import{t as f}from"./login-dV42ZQIA.js";import{n as p,t as m}from"./Field-DK5zaBVA.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
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
min-height: 100vh;
|
|
6
6
|
padding: ${({theme:e})=>e.space(4)};
|
|
7
|
-
`,x=y(
|
|
7
|
+
`,x=y(u)`
|
|
8
8
|
width: min(380px, 100%);
|
|
9
9
|
`,S=y.div`
|
|
10
10
|
display: flex;
|
|
@@ -42,4 +42,4 @@ import{It as e,Wt as t,t as n,vt as r,zt as i}from"./Lamp-DN2EKL4m.js";import{E
|
|
|
42
42
|
font: inherit;
|
|
43
43
|
font-size: 12px;
|
|
44
44
|
cursor: pointer;
|
|
45
|
-
`;function O(){let s=t(),{next:
|
|
45
|
+
`;function O(){let s=t(),{next:u,reason:y}=f.useSearch(),O=i(),k=r(),A=e(),[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){s({to:`/client`});return}s({to:u?.startsWith(`/`)===!0?u:`/`})};return _(b,{children:v(x,{children:[v(S,{children:[_(n,{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(a,{$gap:1,children:[_(c,{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:_(l,{$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))}),_(m,{label:V?`API key`:`Password`,children:e=>_(p,{...e,type:`password`,autoFocus:!0,autoComplete:z?`new-password`:V?`off`:`current-password`,value:j,onChange:e=>M(e.target.value)})}),z?_(m,{label:`Confirm password`,children:e=>_(p,{...e,type:`password`,autoComplete:`new-password`,value:N,onChange:e=>P(e.target.value)})}):null,F===null?null:_(T,{role:`alert`,children:F}),_(l,{children:_(o,{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,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-BtlMmyKj.js","assets/Lamp-ZlMzNs5N.js","assets/Panel-CYQvfI3L.js","assets/Field-DK5zaBVA.js","assets/reasons-Du1OBWAM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./preload-helper-4wSmu2-E.js";var r=t(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:e(()=>n(()=>import(`./login-BtlMmyKj.js`),__vite__mapDeps([0,1,2,3,4])),`component`)});export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./Rack-D798XvPQ.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Gt as e,Sn as t,Ut as n,Wt as r,Zt as i,en as a,ln as o,tn as s,vn as c,xn as l}from"./Lamp-
|
|
1
|
+
import{Gt as e,Sn as t,Ut as n,Wt as r,Zt as i,en as a,ln as o,tn as s,vn as c,xn as l}from"./Lamp-ZlMzNs5N.js";import{k as u}from"./Panel-CYQvfI3L.js";import*as d from"react";import f from"react";import{jsx as p}from"react/jsx-runtime";var m=`__root__`;function h(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 g(e){return e instanceof Response&&!!e.options}var _=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 t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=m:this.parentRoute||o();let r=n?m:t?.path;r&&r!==`/`&&(r=a(r));let c=t?.id||r,l=n?m:i([this.parentRoute.id===`__root__`?``:this.parentRoute.id,c]);r===`__root__`&&(r=`/`),l!==`__root__`&&(l=i([`/`,l]));let u=l===`__root__`?`/`:i([this.parentRoute.fullPath,r]);this._path=r,this._id=l,this._fullPath=u,this._to=s(u)},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=>h({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.`)}},v=class extends _{constructor(e){super(e)}},y=d.createContext(void 0),b=d.createContext(void 0),x={};function S(e,t){let n=d.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=l(n.current,i):i}}function C(t){let n=u(),r=d.useContext(t.from?b:y),i=t.from??r,a=n.stores.getMatchStore(i),s=S(t,n),c=e(a,e=>e?s(e):x);if(c!==x)return c;(t.shouldThrow??!0)&&o()}function w(e){return C({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function T(e){let{select:t,...n}=e;return C({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function E(e){return C({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 D(e){return C({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function O(e){return C({...e,select:t=>e.select?e.select(t.context):t.context})}var k=class extends _{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>r({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>p(n,{ref:t,from:this.fullPath,...e}))}};function A(e){return new k(e)}function j(){return e=>N(e)}var M=class extends v{constructor(e){super(e),this.useMatch=e=>C({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>E({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>T({...e,from:this.id}),this.useLoaderData=e=>w({...e,from:this.id}),this.useNavigate=()=>r({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>p(n,{ref:t,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(e){return e=>{let t=A(e);return t.isRoot=!1,t}}function F(e,n){let r,i,a,o=()=>(r||=(a=void 0,e().then(e=>{r=void 0,i=e[n??`default`]}).catch(e=>{r=void 0,a=e})),r),s=function(e){if(a){if(c(a)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${a.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw a}if(!i)if(t)t(o());else throw o();return d.createElement(i,e)};return s.preload=o,s}var I=`modulepreload`,L=function(e){return`/`+e},R={},z=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=L(t,n),t=s(t),t in R)return;R[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`:I,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)})};export{y as a,m as c,j as i,F as n,g as o,P as r,h as s,z as t};
|