omnigateway 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/public/assets/{Confirm-gd8Y6snu.js → Confirm-BO1xS6uH.js} +1 -1
  4. package/public/assets/{CopyValue-Dds-Ow9a.js → CopyValue-BiiqC_Z2.js} +1 -1
  5. package/public/assets/{Field-D-14HF0x.js → Field-b0ohzqzR.js} +1 -1
  6. package/public/assets/{Match-CgNxphvS.js → Match-B2ZxNor3.js} +1 -1
  7. package/public/assets/{Modal-Dj3LvMS9.js → Modal-OALemCh6.js} +1 -1
  8. package/public/assets/{Rack-B4c0dbIb.js → Rack-DhVnjAjC.js} +1 -1
  9. package/public/assets/{Readout-Du15WYx0.js → Readout-VYnpaTMg.js} +1 -1
  10. package/public/assets/{States-CxLDlCaw.js → States-6G9NsYha.js} +1 -1
  11. package/public/assets/{TokenBreakdown-BySwFK6Q.js → TokenBreakdown-B9RanXin.js} +1 -1
  12. package/public/assets/_app-ChlUa_Ov.js +1 -0
  13. package/public/assets/_app.accounts-CJ6lFXIx.js +64 -0
  14. package/public/assets/{_app.console-CoaRdkB1.js → _app.console-eFiUh-OA.js} +1 -1
  15. package/public/assets/{_app.database-CES5ec5g.js → _app.database-BHaMpXld.js} +1 -1
  16. package/public/assets/{_app.index-DwOZe1A-.js → _app.index-C1vtrxnM.js} +1 -1
  17. package/public/assets/{_app.keys-B5HrAu2U.js → _app.keys-Bz6-VVJi.js} +1 -1
  18. package/public/assets/{_app.logs-NbfIexz0.js → _app.logs-DV7O6ZUp.js} +1 -1
  19. package/public/assets/{_app.models-B1MdFRtQ.js → _app.models-KIctkivt.js} +1 -1
  20. package/public/assets/{_app.plugins._pluginId-ByMziW8p.js → _app.plugins._pluginId-BbqXEJUB.js} +1 -1
  21. package/public/assets/{_app.settings-BkDkGkKF.js → _app.settings-B8zjCira.js} +1 -1
  22. package/public/assets/_app.usage-C4GR06sI.js +83 -0
  23. package/public/assets/{index-gMv8Qs7m.js → index-B2twwe7y.js} +3 -3
  24. package/public/assets/{login-cCXnl34r.js → login-CJz2YA-O.js} +1 -1
  25. package/public/assets/plus-C7a0RuII.js +1 -0
  26. package/public/assets/queries-BOAAI06M.js +142 -0
  27. package/public/assets/shared-Rzhx6i7s.js +84 -0
  28. package/public/assets/{trash-2-ZPh3619D.js → trash-2-C7-QrCg5.js} +1 -1
  29. package/public/index.html +3 -3
  30. package/public/assets/_app-Dx_xnlud.js +0 -1
  31. package/public/assets/_app.accounts-DvBYnbfS.js +0 -64
  32. package/public/assets/_app.usage-DNpM8Nub.js +0 -83
  33. package/public/assets/plus-fXfUTt6_.js +0 -1
  34. package/public/assets/queries-CIOPbRcE.js +0 -142
  35. package/public/assets/shared-B4o-2quR.js +0 -84
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-Dx_xnlud.js","assets/Match-CgNxphvS.js","assets/queries-CIOPbRcE.js","assets/matchContext-BOenO3J2.js","assets/Rack-B4c0dbIb.js","assets/Lamp-BDf7-dMa.js","assets/login-cCXnl34r.js","assets/Field-D-14HF0x.js","assets/States-CxLDlCaw.js","assets/reasons-Cb8yF4Oy.js","assets/_app.index-DwOZe1A-.js","assets/TokenBreakdown-BySwFK6Q.js","assets/Chip-BltJSw8A.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/Readout-Du15WYx0.js","assets/_app.accounts-DvBYnbfS.js","assets/CopyValue-Dds-Ow9a.js","assets/plus-fXfUTt6_.js","assets/trash-2-ZPh3619D.js","assets/Modal-Dj3LvMS9.js","assets/dist-9ps0Qd15.js","assets/Toggle-DMk46RX2.js","assets/Confirm-gd8Y6snu.js","assets/catalog-BBKm8Ih8.js","assets/shared-B4o-2quR.js","assets/_app.console-CoaRdkB1.js","assets/_app.database-CES5ec5g.js","assets/_app.keys-B5HrAu2U.js","assets/_app.logs-NbfIexz0.js","assets/_app.models-B1MdFRtQ.js","assets/_app.settings-BkDkGkKF.js","assets/_app.usage-DNpM8Nub.js","assets/_app.plugins._pluginId-ByMziW8p.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It as l,Kt as u,Lt as d,Mt as f,Nt as p,Ot as m,Pt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Y as S,at as C,bt as ee,dt as w,ft as T,gt as E,ht as D,i as te,jt as ne,kt as re,lt as ie,pt as ae,q as oe,qt as se,vt as ce,wt as le,xt as ue,yt as de,zt as fe}from"./queries-CIOPbRcE.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-CgNxphvS.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ue()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{qe=!1}}))}function Qe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function ot(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 st(e){return e instanceof Response&&!!e.options}function ct(e){return{input:({url:t})=>{for(let n of e)t=ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=dt(e[n],t);return t}}}function lt(e){let t=r(e.basepath),n=`/${t}`,i=e.caseSensitive?n:n.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=ue([`/`,t,e.pathname]),e)}}function ut(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 dt(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 ft(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,s=n(`idle`),c=n(e),l=n(void 0),u=n([]),d=r(()=>u.get().map(e=>a.get(e).get())),f=r(()=>({status:s.get(),isLoading:s.get()===`pending`,matches:d.get(),location:c.get(),resolvedLocation:l.get()}));function p(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let m={status:s,location:c,resolvedLocation:l,ids:u,matches:d,byRoute:a,__store:f,getMatchStore:p,setMatches:h};function h(e){let t=u.get(),n=e.map(e=>e.routeId);i(()=>{o(t,n)||u.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=p(t.routeId);e.get()!==t&&e.set(t)}})}return m}var j=`__TSR_index`,pt=`popstate`,mt=`beforeunload`;function ht(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=yt(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[j];i=gt(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[j];i=gt(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[j]!==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 gt(e,t){t||={};let n=bt();return{...t,key:n,__TSR_key:n,[j]:e}}function _t(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??(()=>yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bt();t.history.replaceState({[j]: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=yt(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[j]-l.state[j],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=ht({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(mt,x,{capture:!0}),t.removeEventListener(pt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(mt,x,{capture:!0}),t.addEventListener(pt,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 vt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function yt(e,t){let n=vt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=bt();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||{[j]:0,key:a,__TSR_key:a}}}function bt(){return(Math.random()+1).toString(36).substring(7)}function xt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function St(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ct({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function wt(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 Tt=class{constructor(e,a){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,i=this.basepath===void 0,a=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=de(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_t()),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=f(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ft(this.latestLocation,e),Ze(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||n!==o||a!==s){this.basepath=o;let e=[],t=r(o);t&&t!==`/`&&e.push(lt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ct(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ne(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&t(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:l(e).path,external:!1,searchStr:o,search:x(t?.search,i),hash:l(r.slice(1)).path,state:s(t?.state,a)}}let o=new URL(i,this.origin),c=ut(this.rewrite,o),u=this.options.parseSearch(c.search),d=this.options.stringifySearch(u);return c.search=d,{href:c.href.replace(c.origin,``),publicHref:i,pathname:l(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:d,search:x(t?.search,u),hash:l(c.hash.slice(1)).path,state:s(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)=>_({base:e,to:t.includes(`//`)?ce(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=m(v(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 r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=t.to?`${t.to}`:void 0,c=i[2],u=Object.assign(Object.create(null),i[3]),d=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),f=o?this.resolvePathWithBase(d,o):d,p=jt(t.params,u),m=this.routesByPath[v(f)],h;if(m)h=this.getRouteBranch(m);else if(f.includes(`$`))h=[];else{let[e,t,n]=this.getMatchedRoutes(f);h=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&n(p))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(p,t(p))}catch{}}let _=e.leaveParams?f:l(ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ot(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=kt(y,t,h,e._includeValidateSearch),y=x(c,y);let b=this.options.stringifySearch(y),S=t.hash===!0?r.hash:t.hash?fe(t.hash,r.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?r.state:t.state?fe(t.state,r.state):{};w=s(r.state,w);let T=`${_}${b}${C}`,E,D,te=!1;if(this.rewrite){let e=new URL(T,this.origin),t=dt(this.rewrite,e);E=e.href.replace(e.origin,``),t.origin===this.origin?D=t.pathname+t.search+t.hash:(D=t.href,te=!0)}else E=g(T),D=E;return{publicHref:D,href:E,pathname:_,search:y,searchStr:b,state:w,hash:S??``,external:te,unmaskOnReload:t.unmaskOnReload}},r=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=i(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:a,...c}=s.route,l=jt(a,n);r={from:e.from,...c,params:l},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=v(this.latestLocation.href)===v(n.href)&&d(Ct(n.state),Ct(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=yt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=ut(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(b(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ln(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(St(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`)&&xt(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&&b(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=M,this.preloadRoute=e=>un(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!d(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?d(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=a,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??rt,parseSearch:e.parseSearch??nt,protocolAllowlist:e.protocolAllowlist??h}),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=a(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[`**`]:v(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?At(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,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Ot(i.options.validateSearch,{...n})??void 0;u={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Et||(r=new Et(e.message,{cause:e})),t?.throwOnError)throw r;u=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=ee({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=d(i,n),S=this._cache.get(y)??(b?.id===y?b:void 0);f=S?._strictParams??Object.assign(v,f);let C;if(!S)try{Mt(i,f)}catch(e){if(C=ge(e)||st(e)?e:new Dt(e.message,{cause:e}),t?.throwOnError)throw C}let w=b?`stay`:`enter`,T;if(S)T={...S,cause:w,search:x(b?b.search:S.search,u),_strictSearch:p,searchError:m};else{let e=xt(i)?`pending`:`success`;T={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?x(b.search,u):u,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:b?s(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=c===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`?x(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=y(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=y(a),c={...e.search};for(let e of a)try{Object.assign(c,Ot(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{Mt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Et=class extends Error{},Dt=class extends Error{};function Ot(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Et(`Async validation not supported`);if(n.issues)throw new Et(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 kt(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=Ot(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=fe(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 At(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return be}function jt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,fe(e,t))}function Mt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Nt(e,t){return e.options[t]?.preload?.()}function Pt(e,t){let n=Nt(e,`component`),r=Nt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function M(e,t,n){let r=()=>t===!1?void 0:t?Nt(e,t):Pt(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 Ft(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var N=0,P=1,It=2,F=3,I=4;function L(e){return typeof e[0]==`number`}function R(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 z(e,t){return e.routesById[t.routeId]}function B(e,t,n){return st(e)?[F,e]:ge(e)?(e.routeId||=n,[It,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[P,e]:[N,e])}function Lt(e,t){let n=B(t,!0,e.id);if(n[0]!==P)return n;try{e.options.onError?.(n[1])}catch(t){n=B(t,!0,e.id)}return n}function V(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[I]):Lt(e,t)}function Rt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function zt(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=z(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Rt(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 H(e,r),[t,V(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[I]];let p=r.paramsError??r.searchError;if(p!==void 0)return H(e,r),[t,V(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{W(e,r,`beforeLoad`,n[0]);let a=await R(m(h),c);if(!n[2]())return n[0].abort(),[t,[I]];let o=B(a,!1,i.id);if(o[0]!==N)return H(e,r),[t,o];r.context={...f,...a}}catch(a){return H(e,r),[t,V(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),W(e,r,!1,n[0])}}i()}function Bt(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 H(e,t){let n=t._flight;t._flight=void 0,Bt(e,t,n)?.abort()}function U(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=Bt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Vt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function W(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Rt(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[I];if(!i)return[N,void 0];let l=n._flight;W(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>B(e,!1,r.id),e=>B(e,!0,r.id)).then(t=>(t[0]!==N&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===P&&l[2]?Lt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await R(l[0],c)}catch(t){if(t!==c)throw t;return H(e,n),[I]}finally{W(e,n,!1,s)}}function Wt(e,t,n){t[0]===N?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==F&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&H(e,r)}function Kt(e,t){return t[0]===P||t[0]===It?{...e,status:t[0]===P?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=z(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[I])),!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,H(e,s),p=V(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,Bt(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([N,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===N&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=R(Promise.resolve().then(()=>M(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,V(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===N&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let ee=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,ee,S,C]),ee.then(e=>Kt(C,e))}async function Jt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=z(e,t[n]),a=M(i,!1);if(a)try{await R(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(U(e,t[2].map(e=>e[3])),void 0)}async function Yt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=F)throw[a,t];!i&&t[0]!==N&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===F)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===It?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=F)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]!==N&&t[0]<F&&!(`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)>=F){let n=c[1];if(n[0]!==F||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[P,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===P?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=z(e,u);try{await R(i?Promise.resolve().then(()=>M(m,a===P?`errorComponent`:`notFoundComponent`)):Promise.all([M(m),M(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[I]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),U(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=z(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 R(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Qt(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Jt(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=qt(e,i,t,l,d,r,c)},p=await zt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===It?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=F&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>L(e)?0:Ft(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return L(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=z(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>$t(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){U(e,t[1]),G(e,t)}function rn(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Ft(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=z(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,tn(e,n),U(e,[...a.values(),...i],[...n,...s.values()]),wt(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),U(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function sn(e,t,n,r,i){let a=n.map(e=>({...e}));Vt(a);for(let t of r)H(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw U(e,a),t}if(L(s)){U(e,a),s[0]===F&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){U(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),H(e,n))}tn(e,c[1]),U(e,n,c[1])}async function cn(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Qt(e,t[2],t[3],o);if(L(s)){s[0]===F&&e._tx===t?(en(e,t),U(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await R(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 R(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=St(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){G(e,s);return}d?.length&&sn(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function ln(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await K(e,n);return}let f=St(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Vt(m)}catch(t){if(u.abort(),!st(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){U(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&W(e,t,!1)}n[0].abort(),U(e,n[3],_[3],!0)}if(e._tx!==_){U(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Vt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),U(e,o),a.abort()}if(!L(t))return t[1];if(s&&t[0]===F&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=be:this.parentRoute||p();let r=n?be:t?.path;r&&r!==`/`&&(r=le(r));let i=t?.id||r,a=n?be:ue([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ue([`/`,a]));let o=a===`__root__`?`/`:ue([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},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=>ot({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(q||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=s(n.current,i):i}}function Y(e){let t=D(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),o=ae(i,e=>e?a(e):An);if(o!==An)return o;(e.shouldThrow??!0)&&p()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(c(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(u)u(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=D(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),se(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(v(r.publicHref)!==v(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...St(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=D(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=D(),t=e._rendered,n=ae(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;se(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends Tt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...r}){n(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=k(E.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:i}):i}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-ChlUa_Ov.js","assets/Match-B2ZxNor3.js","assets/queries-BOAAI06M.js","assets/matchContext-BOenO3J2.js","assets/Rack-DhVnjAjC.js","assets/Lamp-BDf7-dMa.js","assets/login-CJz2YA-O.js","assets/Field-b0ohzqzR.js","assets/States-6G9NsYha.js","assets/reasons-Cb8yF4Oy.js","assets/_app.index-C1vtrxnM.js","assets/TokenBreakdown-B9RanXin.js","assets/Chip-BltJSw8A.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/Readout-VYnpaTMg.js","assets/_app.accounts-CJ6lFXIx.js","assets/shared-Rzhx6i7s.js","assets/CopyValue-BiiqC_Z2.js","assets/plus-C7a0RuII.js","assets/trash-2-C7-QrCg5.js","assets/Modal-OALemCh6.js","assets/dist-9ps0Qd15.js","assets/Toggle-DMk46RX2.js","assets/Confirm-BO1xS6uH.js","assets/catalog-BBKm8Ih8.js","assets/_app.console-eFiUh-OA.js","assets/_app.database-BHaMpXld.js","assets/_app.keys-Bz6-VVJi.js","assets/_app.logs-DV7O6ZUp.js","assets/_app.models-KIctkivt.js","assets/_app.settings-B8zjCira.js","assets/_app.usage-C4GR06sI.js","assets/_app.plugins._pluginId-BbqXEJUB.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It as l,Kt as u,Lt as d,Mt as f,Nt as p,Ot as m,Pt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Y as S,at as C,bt as ee,dt as w,ft as T,gt as E,ht as D,i as te,jt as ne,kt as re,lt as ie,pt as ae,q as oe,qt as se,vt as ce,wt as le,xt as ue,yt as de,zt as fe}from"./queries-BOAAI06M.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-B2ZxNor3.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ue()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{qe=!1}}))}function Qe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function ot(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 st(e){return e instanceof Response&&!!e.options}function ct(e){return{input:({url:t})=>{for(let n of e)t=ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=dt(e[n],t);return t}}}function lt(e){let t=r(e.basepath),n=`/${t}`,i=e.caseSensitive?n:n.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=ue([`/`,t,e.pathname]),e)}}function ut(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 dt(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 ft(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,s=n(`idle`),c=n(e),l=n(void 0),u=n([]),d=r(()=>u.get().map(e=>a.get(e).get())),f=r(()=>({status:s.get(),isLoading:s.get()===`pending`,matches:d.get(),location:c.get(),resolvedLocation:l.get()}));function p(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let m={status:s,location:c,resolvedLocation:l,ids:u,matches:d,byRoute:a,__store:f,getMatchStore:p,setMatches:h};function h(e){let t=u.get(),n=e.map(e=>e.routeId);i(()=>{o(t,n)||u.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=p(t.routeId);e.get()!==t&&e.set(t)}})}return m}var j=`__TSR_index`,pt=`popstate`,mt=`beforeunload`;function ht(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=yt(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[j];i=gt(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[j];i=gt(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[j]!==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 gt(e,t){t||={};let n=bt();return{...t,key:n,__TSR_key:n,[j]:e}}function _t(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??(()=>yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bt();t.history.replaceState({[j]: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=yt(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[j]-l.state[j],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=ht({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(mt,x,{capture:!0}),t.removeEventListener(pt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(mt,x,{capture:!0}),t.addEventListener(pt,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 vt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function yt(e,t){let n=vt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=bt();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||{[j]:0,key:a,__TSR_key:a}}}function bt(){return(Math.random()+1).toString(36).substring(7)}function xt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function St(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ct({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function wt(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 Tt=class{constructor(e,a){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,i=this.basepath===void 0,a=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=de(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_t()),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=f(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ft(this.latestLocation,e),Ze(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||n!==o||a!==s){this.basepath=o;let e=[],t=r(o);t&&t!==`/`&&e.push(lt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ct(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ne(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&t(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:l(e).path,external:!1,searchStr:o,search:x(t?.search,i),hash:l(r.slice(1)).path,state:s(t?.state,a)}}let o=new URL(i,this.origin),c=ut(this.rewrite,o),u=this.options.parseSearch(c.search),d=this.options.stringifySearch(u);return c.search=d,{href:c.href.replace(c.origin,``),publicHref:i,pathname:l(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:d,search:x(t?.search,u),hash:l(c.hash.slice(1)).path,state:s(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)=>_({base:e,to:t.includes(`//`)?ce(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=m(v(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 r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=t.to?`${t.to}`:void 0,c=i[2],u=Object.assign(Object.create(null),i[3]),d=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),f=o?this.resolvePathWithBase(d,o):d,p=jt(t.params,u),m=this.routesByPath[v(f)],h;if(m)h=this.getRouteBranch(m);else if(f.includes(`$`))h=[];else{let[e,t,n]=this.getMatchedRoutes(f);h=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&n(p))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(p,t(p))}catch{}}let _=e.leaveParams?f:l(ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ot(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=kt(y,t,h,e._includeValidateSearch),y=x(c,y);let b=this.options.stringifySearch(y),S=t.hash===!0?r.hash:t.hash?fe(t.hash,r.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?r.state:t.state?fe(t.state,r.state):{};w=s(r.state,w);let T=`${_}${b}${C}`,E,D,te=!1;if(this.rewrite){let e=new URL(T,this.origin),t=dt(this.rewrite,e);E=e.href.replace(e.origin,``),t.origin===this.origin?D=t.pathname+t.search+t.hash:(D=t.href,te=!0)}else E=g(T),D=E;return{publicHref:D,href:E,pathname:_,search:y,searchStr:b,state:w,hash:S??``,external:te,unmaskOnReload:t.unmaskOnReload}},r=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=i(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:a,...c}=s.route,l=jt(a,n);r={from:e.from,...c,params:l},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=v(this.latestLocation.href)===v(n.href)&&d(Ct(n.state),Ct(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=yt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=ut(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(b(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await ln(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(St(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`)&&xt(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&&b(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=M,this.preloadRoute=e=>un(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!d(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?d(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=a,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??rt,parseSearch:e.parseSearch??nt,protocolAllowlist:e.protocolAllowlist??h}),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=a(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[`**`]:v(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?At(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,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Ot(i.options.validateSearch,{...n})??void 0;u={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Et||(r=new Et(e.message,{cause:e})),t?.throwOnError)throw r;u=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=ee({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=d(i,n),S=this._cache.get(y)??(b?.id===y?b:void 0);f=S?._strictParams??Object.assign(v,f);let C;if(!S)try{Mt(i,f)}catch(e){if(C=ge(e)||st(e)?e:new Dt(e.message,{cause:e}),t?.throwOnError)throw C}let w=b?`stay`:`enter`,T;if(S)T={...S,cause:w,search:x(b?b.search:S.search,u),_strictSearch:p,searchError:m};else{let e=xt(i)?`pending`:`success`;T={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?x(b.search,u):u,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:b?s(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=c===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`?x(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=y(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=y(a),c={...e.search};for(let e of a)try{Object.assign(c,Ot(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{Mt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Et=class extends Error{},Dt=class extends Error{};function Ot(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Et(`Async validation not supported`);if(n.issues)throw new Et(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 kt(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=Ot(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=fe(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 At(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return be}function jt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,fe(e,t))}function Mt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Nt(e,t){return e.options[t]?.preload?.()}function Pt(e,t){let n=Nt(e,`component`),r=Nt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function M(e,t,n){let r=()=>t===!1?void 0:t?Nt(e,t):Pt(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 Ft(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var N=0,P=1,It=2,F=3,I=4;function L(e){return typeof e[0]==`number`}function R(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 z(e,t){return e.routesById[t.routeId]}function B(e,t,n){return st(e)?[F,e]:ge(e)?(e.routeId||=n,[It,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[P,e]:[N,e])}function Lt(e,t){let n=B(t,!0,e.id);if(n[0]!==P)return n;try{e.options.onError?.(n[1])}catch(t){n=B(t,!0,e.id)}return n}function V(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[I]):Lt(e,t)}function Rt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function zt(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=z(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Rt(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 H(e,r),[t,V(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[I]];let p=r.paramsError??r.searchError;if(p!==void 0)return H(e,r),[t,V(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{W(e,r,`beforeLoad`,n[0]);let a=await R(m(h),c);if(!n[2]())return n[0].abort(),[t,[I]];let o=B(a,!1,i.id);if(o[0]!==N)return H(e,r),[t,o];r.context={...f,...a}}catch(a){return H(e,r),[t,V(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),W(e,r,!1,n[0])}}i()}function Bt(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 H(e,t){let n=t._flight;t._flight=void 0,Bt(e,t,n)?.abort()}function U(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=Bt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Vt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function W(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Rt(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[I];if(!i)return[N,void 0];let l=n._flight;W(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>B(e,!1,r.id),e=>B(e,!0,r.id)).then(t=>(t[0]!==N&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===P&&l[2]?Lt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await R(l[0],c)}catch(t){if(t!==c)throw t;return H(e,n),[I]}finally{W(e,n,!1,s)}}function Wt(e,t,n){t[0]===N?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==F&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&H(e,r)}function Kt(e,t){return t[0]===P||t[0]===It?{...e,status:t[0]===P?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=z(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[I])),!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,H(e,s),p=V(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,Bt(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([N,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===N&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=R(Promise.resolve().then(()=>M(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,V(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===N&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let ee=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,ee,S,C]),ee.then(e=>Kt(C,e))}async function Jt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=z(e,t[n]),a=M(i,!1);if(a)try{await R(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(U(e,t[2].map(e=>e[3])),void 0)}async function Yt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=F)throw[a,t];!i&&t[0]!==N&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===F)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===It?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=F)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]!==N&&t[0]<F&&!(`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)>=F){let n=c[1];if(n[0]!==F||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[P,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===P?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=z(e,u);try{await R(i?Promise.resolve().then(()=>M(m,a===P?`errorComponent`:`notFoundComponent`)):Promise.all([M(m),M(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[I]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),U(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=z(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 R(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Qt(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Jt(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=qt(e,i,t,l,d,r,c)},p=await zt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===It?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=F&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>L(e)?0:Ft(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return L(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=z(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>$t(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){U(e,t[1]),G(e,t)}function rn(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Ft(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=z(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,tn(e,n),U(e,[...a.values(),...i],[...n,...s.values()]),wt(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),U(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function sn(e,t,n,r,i){let a=n.map(e=>({...e}));Vt(a);for(let t of r)H(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw U(e,a),t}if(L(s)){U(e,a),s[0]===F&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){U(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),H(e,n))}tn(e,c[1]),U(e,n,c[1])}async function cn(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Qt(e,t[2],t[3],o);if(L(s)){s[0]===F&&e._tx===t?(en(e,t),U(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await R(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 R(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=St(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){G(e,s);return}d?.length&&sn(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function ln(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await K(e,n);return}let f=St(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Vt(m)}catch(t){if(u.abort(),!st(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){U(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&W(e,t,!1)}n[0].abort(),U(e,n[3],_[3],!0)}if(e._tx!==_){U(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Vt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),U(e,o),a.abort()}if(!L(t))return t[1];if(s&&t[0]===F&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=be:this.parentRoute||p();let r=n?be:t?.path;r&&r!==`/`&&(r=le(r));let i=t?.id||r,a=n?be:ue([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ue([`/`,a]));let o=a===`__root__`?`/`:ue([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},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=>ot({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(q||{});function pn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function mn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=s(n.current,i):i}}function Y(e){let t=D(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),o=ae(i,e=>e?a(e):An);if(o!==An)return o;(e.shouldThrow??!0)&&p()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(c(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(u)u(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=D(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),se(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(v(r.publicHref)!==v(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...St(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=D(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=D(),t=e._rendered,n=ae(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;se(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends Tt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...r}){n(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=k(E.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:i}):i}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
  justify-content: center;
@@ -10,7 +10,7 @@ import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It
10
10
  font-size: 13px;
11
11
  color: ${({theme:e})=>e.color.inkDim};
12
12
  max-width: 48ch;
13
- `,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(C,{$gap:3,style:{alignItems:`center`},children:[k(e,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(ie,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),er=`modulepreload`,tr=function(e){return`/`+e},nr={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=tr(t,n),t=s(t),t in nr)return;nr[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`:er,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)})},rr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{if(!(await e.queryClient.ensureQueryData({queryKey:te.status,queryFn:()=>S(`/api/status`),revalidateIfStale:!0})).authenticated)throw ot({to:`/login`,search:{next:t.href}})},component:Z(()=>Q(()=>import(`./_app-Dx_xnlud.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`)}),ir=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-cCXnl34r.js`),__vite__mapDeps([6,2,5,7,8,9])),`component`)}),ar=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-DwOZe1A-.js`),__vite__mapDeps([10,2,4,5,11,12,13,8,14,15])),`component`)}),or=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-DvBYnbfS.js`),__vite__mapDeps([16,2,4,5,17,18,19,20,21,22,23,12,7,13,8,14,24,25])),`component`)}),sr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-CoaRdkB1.js`),__vite__mapDeps([26,2,4,5,7,8])),`component`)}),cr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-CES5ec5g.js`),__vite__mapDeps([27,2,4,5,23,20,21,7,13,8,14,15,9])),`component`)}),lr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-B5HrAu2U.js`),__vite__mapDeps([28,2,4,5,17,18,20,21,22,23,12,7,13,8,14])),`component`)}),ur=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-NbfIexz0.js`),__vite__mapDeps([29,2,4,5,11,20,21,12,7,8,14])),`component`)}),dr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-B1MdFRtQ.js`),__vite__mapDeps([30,2,4,5,18,19,22,21,23,20,12,7,13,8,24])),`component`)}),fr=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-BkDkGkKF.js`),__vite__mapDeps([31,2,4,5,22,21,7,13,8])),`component`)}),pr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-DNpM8Nub.js`),__vite__mapDeps([32,2,4,5,8,14,24,25,15])),`component`)}),mr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-ByMziW8p.js`),__vite__mapDeps([33,2,4,5,8])),`component`)}),$=rr.update({id:`/_app`,getParentRoute:()=>$n}),hr=ir.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),gr=ar.update({id:`/`,path:`/`,getParentRoute:()=>$}),_r={AppAccountsRoute:or.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:sr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:cr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:lr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ur.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:dr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:fr.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:pr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:gr,AppPluginsPluginIdRoute:mr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},vr={AppRoute:$._addFileChildren(_r),LoginRoute:hr},yr=$n._addFileChildren(vr)._addFileTypes();function br(e){let t=t=>{!(t instanceof oe)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var xr=Re`
13
+ `,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(C,{$gap:3,style:{alignItems:`center`},children:[k(e,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(ie,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),er=`modulepreload`,tr=function(e){return`/`+e},nr={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=tr(t,n),t=s(t),t in nr)return;nr[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`:er,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)})},rr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{if(!(await e.queryClient.ensureQueryData({queryKey:te.status,queryFn:()=>S(`/api/status`),revalidateIfStale:!0})).authenticated)throw ot({to:`/login`,search:{next:t.href}})},component:Z(()=>Q(()=>import(`./_app-ChlUa_Ov.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`)}),ir=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-CJz2YA-O.js`),__vite__mapDeps([6,2,5,7,8,9])),`component`)}),ar=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-C1vtrxnM.js`),__vite__mapDeps([10,2,4,5,11,12,13,8,14,15])),`component`)}),or=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-CJ6lFXIx.js`),__vite__mapDeps([16,17,2,5,4,18,19,20,21,22,23,24,12,7,13,8,14,25])),`component`)}),sr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-eFiUh-OA.js`),__vite__mapDeps([26,2,4,5,7,8])),`component`)}),cr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-BHaMpXld.js`),__vite__mapDeps([27,2,4,5,24,21,22,7,13,8,14,15,9])),`component`)}),lr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-Bz6-VVJi.js`),__vite__mapDeps([28,2,4,5,18,19,21,22,23,24,12,7,13,8,14])),`component`)}),ur=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-DV7O6ZUp.js`),__vite__mapDeps([29,2,4,5,11,21,22,12,7,8,14])),`component`)}),dr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-KIctkivt.js`),__vite__mapDeps([30,2,4,5,19,20,23,22,24,21,12,7,13,8,25])),`component`)}),fr=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-B8zjCira.js`),__vite__mapDeps([31,2,4,5,23,22,7,13,8])),`component`)}),pr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-C4GR06sI.js`),__vite__mapDeps([32,17,2,5,4,8,14,25,15])),`component`)}),mr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-BbqXEJUB.js`),__vite__mapDeps([33,2,4,5,8])),`component`)}),$=rr.update({id:`/_app`,getParentRoute:()=>$n}),hr=ir.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),gr=ar.update({id:`/`,path:`/`,getParentRoute:()=>$}),_r={AppAccountsRoute:or.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:sr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:cr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:lr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ur.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:dr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:fr.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:pr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:gr,AppPluginsPluginIdRoute:mr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},vr={AppRoute:$._addFileChildren(_r),LoginRoute:hr},yr=$n._addFileChildren(vr)._addFileTypes();function br(e){let t=t=>{!(t instanceof oe)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var xr=Re`
14
14
  :root {
15
15
  color-scheme: light;
16
16
 
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,T as n,U as r,at as i,ct as a,ft as o,lt as s,nt as c}from"./queries-CIOPbRcE.js";import{o as l}from"./index-gMv8Qs7m.js";import{t as u}from"./Lamp-BDf7-dMa.js";import{n as d,t as f}from"./Field-D-14HF0x.js";import{i as p,o as m}from"./States-CxLDlCaw.js";import{t as h}from"./reasons-Cb8yF4Oy.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`
1
+ import{$ as e,B as t,T as n,U as r,at as i,ct as a,ft as o,lt as s,nt as c}from"./queries-BOAAI06M.js";import{o as l}from"./index-B2twwe7y.js";import{t as u}from"./Lamp-BDf7-dMa.js";import{n as d,t as f}from"./Field-b0ohzqzR.js";import{i as p,o as m}from"./States-6G9NsYha.js";import{t as h}from"./reasons-Cb8yF4Oy.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;
@@ -0,0 +1 @@
1
+ import{c as e}from"./Rack-DhVnjAjC.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -0,0 +1,142 @@
1
+ import{useMutation as e,useQuery as t,useQueryClient as n}from"@tanstack/react-query";import*as r from"react";import i,{useCallback as a,useDebugValue as o,useEffect as s,useMemo as c,useRef as l,useSyncExternalStore as u}from"react";import{jsx as d}from"react/jsx-runtime";import{flushSync as f}from"react-dom";import p,{css as m,keyframes as h}from"styled-components";var g=r.use,_=r.useLayoutEffect;function v(e,t,n={},i){r.useEffect(()=>{if(!e.current||i||typeof IntersectionObserver!=`function`)return;let r=new IntersectionObserver(([e])=>{t(e)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,i,n,e])}function y(e){let t=r.useRef(null);return r.useImperativeHandle(e,()=>t.current,[]),t}function b(e){return e[e.length-1]}function x(e){return typeof e==`function`}function ee(e,t){return x(e)?e(t):e}var S=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;function w(e){for(let t in e)if(S.call(e,t))return!0;return!1}var te=()=>Object.create(null),T=(e,t)=>E(e,t,te);function E(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ne(e)&&ne(i);if(!a&&!(O(e)&&O(i)))return i;let o=a?e:D(e);if(!o)return i;let s=a?i:D(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:S.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=E(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function D(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!C.call(e,r))return!1;t.push(r)}return t}function O(e){if(!k(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!k(n)||!n.hasOwnProperty(`isPrototypeOf`))}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function A(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!A(e[r],t[r],n))return!1;return!0}if(O(e)&&O(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!A(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!A(e[o],t[o],n)))return!1;return i===a}return!1}function re(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var ie=/[\x00-\x1f\x7f"<>`{}]/g;function ae(e){return e.replace(ie,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function oe(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ae(t)}var se=[`http:`,`https:`,`mailto:`,`tel:`];function ce(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function le(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=oe(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=oe(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ue(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function de(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function j(){throw Error(`Invariant failed`)}function M(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var N=4,fe=5;function P(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function pe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=P(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function F(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=pe(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=L(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=R(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=L(r);e.kind=fe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=L(r);e.kind=N,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)F(e,t,r,c,i,a,o,s)}function I(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function L(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function R(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function z(e,t){let n=L(`/`),r=new Uint16Array(6),i=[];for(let t of e)F(!1,r,t,1,n,0,i);for(let e of i)e.sort(I);t.masksTree=n,t.flatCache=M(1e3)}function me(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=B(e,t.masksTree);return t.flatCache.set(e,r),r}function he(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=L(`/`),F(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),B(r,o,n)}function ge(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=B(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=H(a.route)),t.matchCache.set(r,a),a}function _e(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ve(e,t=!1,n){let r=L(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;F(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&j(),o[e.id]=e,c!==0&&e.path){let t=_e(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(I);return{processedTree:{segmentTree:r,singleCache:M(1e3),matchCache:M(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function B(e,t,n=!1){let r=e.split(`/`),i=be(e,r,t,n);if(!i)return null;let[a]=V(e,r,i);return{route:i.node.route,rawParams:a}}function V(e,t,n){let r=ye(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===N)break;if(u.kind===fe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function H(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ye(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function be(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!b(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!W(l,n))continue;if(i.parse){if(!Se(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==N&&W(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===N||i.kind===2)&&W(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Se(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&xe(f,o))return n;W(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+U(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+U(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+U(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function U(e,t){return 2**(e-t-1)}function xe(e,t){return e===2**(t-1)-1}function Se(e,t,n){let r,i;try{[r,i]=V(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function W(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===N)>(e.node.kind===N)||t.node.kind===N==(e.node.kind===N)&&t.node.depth>e.node.depth)))}function Ce(e){return we(e.filter(e=>e!==void 0).join(`/`))}function we(e){return e.replace(/\/{2,}/g,`/`)}function Te(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ee(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function De(e){return Ee(Te(e))}function Oe(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ke(e,t,n){return Oe(e,n)===Oe(t,n)}function Ae({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&b(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(b(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=we(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function je(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Me(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Pe(e,n)).join(`/`):Pe(r,n):r}function Ne({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=pe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Me(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Me(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Me(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Pe(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var Fe=`Error preloading route! ☝️`;function Ie({children:e,fallback:t=null}){return d(i.Fragment,{children:Le()?e:t})}function Le(){return i.useSyncExternalStore(Re,()=>!0,()=>!1)}function Re(){return()=>{}}var ze=r.createContext(null);function Be(e){return r.useContext(ze)}function Ve(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var He=typeof Object.is==`function`?Object.is:Ve;function Ue(e,t,n,r,i){let a=l(null),d;a.current===null?(d={hasValue:!1,value:null},a.current=d):d=a.current;let[f,p]=c(()=>{let e=!1,a,o,s=t=>{if(!e){e=!0,a=t;let n=r(t);if(i!==void 0&&d.hasValue){let e=d.value;if(i(e,n))return o=e,e}return o=n,n}let n=o;if(He(a,t))return n;let s=r(t);return i?.(n,s)?(a=t,n):(a=t,o=s,s)},c=n===void 0?null:n;return[()=>s(t()),c===null?void 0:()=>s(c())]},[t,n,r,i,d]),m=u(e,f,p);return s(()=>{d.hasValue=!0,d.value=m},[m,d]),o(m),m}function We(e,t){return e===t}function Ge(e,t,n=We){let r=a(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=a(()=>e?.get(),[e]);return Ue(r,i,i,t,n)}function Ke(e){let t=Be();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qe(e){let t=r.useRef(e);return A(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Je(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ye(e,t,n){if(e?.external)return ce(e.href,n)?void 0:e.href;if(!at(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ce(t,n)?void 0:t}catch{}}function Xe(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!ke(e.pathname,t.pathname,r))return!1}else{let n=Oe(e.pathname,r),i=Oe(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!A(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Ze(e,t){let n=Be(),i=y(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:l,preloadDelay:u,preloadIntentProximity:d,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:b,target:x,disabled:S,style:C,className:w,onClick:te,onBlur:T,onFocus:E,onMouseEnter:D,onMouseLeave:O,onTouchStart:k,ignoreBlocker:ne,params:A,search:re,hash:ie,state:ae,mask:oe,reloadDocument:se,unsafeRelative:ce,from:le,_fromLocation:ue,...de}=e,j=Le(),M=qe(e.search),N=qe(e.params),fe=qe(s),P=r.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,M,N,e.state,e.mask,e.unsafeRelative]),pe=r.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...P}),r=it(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,S),i=Ye(r,c,n.protocolAllowlist);return[r?.href,i,Xe(e,t,fe,n.basepath,j,i!==void 0)]},[fe,S,j,P,n,c]),[F,I,L]=Ge(n.stores.location,pe,Je),R=L?ee(a,{})??$e:Qe,z=L?Qe:ee(o,{})??Qe,me=[w,R.className,z.className].filter(Boolean).join(` `),he=(C||R.style||z.style)&&{...C,...R.style,...z.style},[ge,_e]=r.useState(!1),ve=r.useRef(!1),B=e.reloadDocument||I?!1:l??n.options.defaultPreload,V=u??n.options.defaultPreloadDelay??0,H=r.useCallback(()=>{n.preloadRoute(P).catch(e=>{console.warn(e),console.warn(Fe)})},[n,P]);v(i,r.useCallback(e=>{e?.isIntersecting&&H()},[H]),rt,!!S||B!==`viewport`),r.useEffect(()=>{ve.current||!S&&B===`render`&&(H(),ve.current=!0)},[S,H,B]);let ye=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!st(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),f(()=>{_e(!0)});let t=n.subscribe(`onResolved`,()=>{t(),_e(!1)});n.navigate({...P,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:ne})}};if(I)return{...de,ref:i,href:I,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...C&&{style:C},...w&&{className:w},...te&&{onClick:te},...T&&{onBlur:T},...E&&{onFocus:E},...D&&{onMouseEnter:D},...O&&{onMouseLeave:O},...k&&{onTouchStart:k}};let be=e=>{if(S||B!==`intent`)return;if(!V){H();return}let t=e.currentTarget;if(G.has(t))return;let n=setTimeout(()=>{G.delete(t),H()},V);G.set(t,n)},U=e=>{S||B!==`intent`||H()},xe=e=>{if(S||!B||!V)return;let t=e.currentTarget,n=G.get(t);n&&(clearTimeout(n),G.delete(t))};return{...de,...R,...z,href:F,ref:i,onClick:K([te,ye]),onBlur:K([T,xe]),onFocus:K([E,be]),onMouseEnter:K([D,be]),onMouseLeave:K([O,xe]),onTouchStart:K([k,U]),disabled:!!S,target:x,...he&&{style:he},...me&&{className:me},...S&&et,...L&&tt,...j&&ge&&nt}}var Qe={},$e={className:`active`},et={role:`link`,"aria-disabled":!0},tt={"data-status":`active`,"aria-current":`page`},nt={"data-transitioning":`transitioning`},G=new WeakMap,rt={rootMargin:`100px`},K=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function it(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function at(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ot=r.forwardRef((e,t)=>{let{_asChild:n,...i}=e,{type:a,...o}=Ze(i,t),s=typeof i.children==`function`?i.children({isActive:o[`data-status`]===`active`}):i.children;if(!n){let{disabled:e,...t}=o;return r.createElement(`a`,t,s)}return r.createElement(n,o,s)});function st(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var ct={primary:m`
2
+ background: ${({theme:e})=>e.color.accent};
3
+ color: ${({theme:e})=>e.color.accentInk};
4
+ border-color: ${({theme:e})=>e.color.accent};
5
+
6
+ &:hover:not(:disabled) {
7
+ filter: brightness(1.08);
8
+ }
9
+ `,default:m`
10
+ background: ${({theme:e})=>e.color.panelRaised};
11
+ color: ${({theme:e})=>e.color.ink};
12
+ border-color: ${({theme:e})=>e.color.ruleStrong};
13
+
14
+ &:hover:not(:disabled) {
15
+ border-color: ${({theme:e})=>e.color.accent};
16
+ color: ${({theme:e})=>e.color.accent};
17
+ }
18
+ `,ghost:m`
19
+ background: transparent;
20
+ color: ${({theme:e})=>e.color.inkDim};
21
+ border-color: transparent;
22
+
23
+ &:hover:not(:disabled) {
24
+ background: ${({theme:e})=>e.color.panelRaised};
25
+ color: ${({theme:e})=>e.color.ink};
26
+ }
27
+ `,danger:m`
28
+ background: transparent;
29
+ color: ${({theme:e})=>e.color.down};
30
+ border-color: ${({theme:e})=>e.color.down};
31
+
32
+ &:hover:not(:disabled) {
33
+ background: ${({theme:e})=>e.color.downWash};
34
+ }
35
+ `},lt={sm:m`
36
+ height: 24px;
37
+ padding: 0 ${({theme:e})=>e.space(2)};
38
+ font-size: 11px;
39
+ `,md:m`
40
+ height: 30px;
41
+ padding: 0 ${({theme:e})=>e.space(3)};
42
+ font-size: 13px;
43
+ `},ut=p.button`
44
+ display: inline-flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ gap: ${({theme:e})=>e.space(1.5)};
48
+ border: 1px solid transparent;
49
+ border-radius: ${({theme:e})=>e.radius.control};
50
+ font-weight: 500;
51
+ white-space: nowrap;
52
+ cursor: pointer;
53
+ transition:
54
+ background 120ms ease,
55
+ color 120ms ease,
56
+ border-color 120ms ease;
57
+
58
+ ${({$size:e})=>lt[e??`md`]}
59
+ ${({$variant:e})=>ct[e??`default`]}
60
+
61
+ &:disabled {
62
+ opacity: 0.45;
63
+ cursor: not-allowed;
64
+ }
65
+
66
+ svg {
67
+ width: 14px;
68
+ height: 14px;
69
+ }
70
+ `,dt=p(ut)`
71
+ padding: 0;
72
+ width: ${({$size:e})=>e===`sm`?`24px`:`30px`};
73
+ `,ft=p.span`
74
+ font-size: 10px;
75
+ font-weight: 600;
76
+ font-stretch: 74%;
77
+ letter-spacing: 0.16em;
78
+ text-transform: uppercase;
79
+ color: ${({theme:e})=>e.color.inkFaint};
80
+ white-space: nowrap;
81
+ `,pt=p.span`
82
+ font-family: ${({theme:e})=>e.font.mono};
83
+ font-variant-numeric: tabular-nums;
84
+ font-size: ${({$size:e})=>e??`12px`};
85
+ color: ${({theme:e,$dim:t})=>t===!0?e.color.inkDim:`inherit`};
86
+ `,mt=p.span`
87
+ color: ${({theme:e})=>e.color.inkDim};
88
+ `,ht=p.div`
89
+ display: flex;
90
+ align-items: ${({$align:e})=>e??`center`};
91
+ justify-content: ${({$justify:e})=>e??`flex-start`};
92
+ gap: ${({theme:e,$gap:t})=>e.space(t??2)};
93
+ ${({$wrap:e})=>e===!0?`flex-wrap: wrap;`:``}
94
+ min-width: 0;
95
+ `,gt=p.div`
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: ${({theme:e,$gap:t})=>e.space(t??2)};
99
+ min-width: 0;
100
+ `,_t=p.div`
101
+ display: grid;
102
+ grid-template-columns: repeat(auto-fit, minmax(${({$min:e})=>e??`220px`}, 1fr));
103
+ gap: ${({theme:e,$gap:t})=>e.space(t??3)};
104
+ /* Panels size to their content; a short one does not stretch to match a tall one. */
105
+ align-items: start;
106
+ `;p.hr`
107
+ height: 1px;
108
+ border: 0;
109
+ margin: 0;
110
+ background: ${({theme:e})=>e.color.rule};
111
+ `;var vt=p.div`
112
+ flex: 1 1 auto;
113
+ min-width: 0;
114
+ `,yt=p.div`
115
+ overflow-x: auto;
116
+ overscroll-behavior-x: contain;
117
+ `,bt=p.span`
118
+ overflow: hidden;
119
+ text-overflow: ellipsis;
120
+ white-space: nowrap;
121
+ min-width: 0;
122
+ `;p.span`
123
+ position: absolute;
124
+ width: 1px;
125
+ height: 1px;
126
+ padding: 0;
127
+ margin: -1px;
128
+ overflow: hidden;
129
+ clip-path: inset(50%);
130
+ white-space: nowrap;
131
+ `;var xt=h`
132
+ 0%, 100% { opacity: 1; }
133
+ 50% { opacity: 0.35; }
134
+ `,St=m`
135
+ animation: ${xt} 2.4s ease-in-out infinite;
136
+ `,Ct=m`
137
+ background-image: repeating-linear-gradient(
138
+ to bottom,
139
+ var(--grid-line) 0 1px,
140
+ transparent 1px 4px
141
+ );
142
+ `,wt=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}get isUnauthenticated(){return this.status===401||this.code===`AUTH`}};function Tt(e){if(typeof e!=`object`||!e)return!1;let t=e.error;return typeof t!=`object`||!t?!1:typeof t.message==`string`}async function q(e,t={}){let n=t.method??`GET`,r=t.body instanceof Blob?t.body:null,i={method:n,credentials:`same-origin`,headers:t.body===void 0?{}:{"content-type":r===null?`application/json`:`application/octet-stream`},...t.body===void 0?{}:{body:r===null?JSON.stringify(t.body):r},...t.signal===void 0?{}:{signal:t.signal}},a=await fetch(e,i),o=t.accept??[],s=null;if(a.status!==204){let e=await a.text();if(e.length>0)try{s=JSON.parse(e)}catch{s=null}}if(!a.ok&&!o.includes(a.status)){let e=Tt(s)?s.error.code??`INTERNAL`:`INTERNAL`,t=Tt(s)?s.error.message:`request failed with status ${a.status}`;throw new wt(a.status,String(e),t)}return{status:a.status,data:s}}async function J(e,t){return(await q(e,t===void 0?{}:{signal:t})).data}async function Y(e,t){return(await q(e,{method:`POST`,...t===void 0?{}:{body:t}})).data}async function X(e,t){return(await q(e,{method:`PUT`,body:t})).data}async function Et(e,t){return(await q(e,{method:`PATCH`,body:t})).data}async function Z(e){return(await q(e,{method:`DELETE`})).data}function Q(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r.length===0?e:`${e}?${r}`}var $={status:[`status`],credentials:[`credentials`],credentialHealth:[`credentials`,`health`],models:[`models`],keys:[`keys`],settings:[`settings`],agentSetup:(e,t)=>[`agent-setup`,e,t??null],usage:e=>[`usage`,e.grain??`raw`,e.groupBy,e.splitBy??null,e.since,e.until??null],quotaHistory:e=>[`quota-history`,e.credentialId,e.since,e.until??null],logs:e=>[`logs`,e],requestBody:e=>[`logs`,`body`,e],console:(e,t)=>[`console`,e,t],database:[`database`],snapshots:[`database`,`snapshots`],lifecycle:[`lifecycle`],plugins:[`plugins`]};function Dt(){return t({queryKey:$.status,queryFn:({signal:e})=>J(`/api/status`,e),staleTime:3e4})}function Ot(){return t({queryKey:$.credentials,queryFn:async({signal:e})=>(await J(`/api/credentials`,e)).credentials})}function kt(e=1e4){return t({queryKey:$.credentialHealth,queryFn:({signal:e})=>J(`/api/credentials/health`,e),refetchInterval:e})}function At(e,n=!0){return t({queryKey:$.quotaHistory(e),enabled:n,queryFn:({signal:t})=>J(Q(`/api/credentials/quota/history`,{credentialId:e.credentialId,since:e.since,...e.until===void 0?{}:{until:e.until}}),t),refetchInterval:!1})}function jt(){return t({queryKey:$.models,queryFn:async({signal:e})=>(await J(`/api/models`,e)).models})}function Mt(){return t({queryKey:$.keys,queryFn:async({signal:e})=>(await J(`/api/keys`,e)).keys})}var Nt={queryKey:$.settings,queryFn:({signal:e})=>J(`/api/settings`,e)};function Pt(){return t({...Nt,select:e=>e.settings})}function Ft(){return t({...Nt,select:e=>e.bodyLoggingAllowed&&e.settings.bodyLoggingEnabled})}function It(){return t({...Nt,select:e=>e.bodyLoggingAllowed})}function Lt(e,n){return t({queryKey:$.agentSetup(e,n),enabled:n!==void 0,queryFn:async({signal:t})=>(await J(Q(`/api/agent-setup`,{client:e,...n??{}}),t)).files})}function Rt(e,n=6e4){return t({queryKey:$.usage(e),queryFn:async({signal:t})=>(await J(Q(`/api/usage`,{groupBy:e.groupBy,since:e.since,...e.grain===void 0?{}:{grain:e.grain},...e.splitBy===void 0?{}:{splitBy:e.splitBy},...e.until===void 0?{}:{until:e.until}}),t)).rows,refetchInterval:n})}var zt=2e3;function Bt(e=100,n=zt){return t({queryKey:$.logs(e),queryFn:async({signal:t})=>(await J(Q(`/api/logs`,{limit:e}),t)).logs,refetchInterval:n})}function Vt(e){return t({queryKey:$.requestBody(e??``),enabled:e!==null,queryFn:({signal:t})=>J(`/api/requests/${encodeURIComponent(e??``)}/body`,t),refetchInterval:!1})}var Ht=5e3;function Ut(e=200,n=``,r=Ht){return t({queryKey:$.console(e,n),queryFn:async({signal:t})=>J(Q(`/api/console`,{lines:e,...n===``?{}:{level:n}}),t),refetchInterval:r})}function Wt(){return t({queryKey:$.database,queryFn:({signal:e})=>J(`/api/database`,e),refetchInterval:!1})}function Gt(e){return`/api/database/snapshots/${encodeURIComponent(e)}/download`}function Kt(){return t({queryKey:$.snapshots,queryFn:async({signal:e})=>(await J(`/api/database/snapshots`,e)).snapshots,refetchInterval:!1})}function qt(e){e.invalidateQueries({queryKey:$.database})}function Jt(){let t=n();return e({mutationFn:()=>Y(`/api/database/snapshots`),onSuccess:()=>qt(t)})}function Yt(){let t=n();return e({mutationFn:e=>X(`/api/database/retention`,e),onSuccess:()=>{qt(t),t.invalidateQueries({queryKey:$.settings})}})}function Xt(){let t=n();return e({mutationFn:()=>Y(`/api/database/vacuum`),onSuccess:()=>qt(t)})}function Zt(){let t=n();return e({mutationFn:e=>Z(`/api/database/snapshots/${encodeURIComponent(e)}`),onSuccess:()=>qt(t)})}function Qt(){return e({mutationFn:e=>Y(`/api/database/snapshots/${encodeURIComponent(e)}/restore`)})}function $t(){return e({mutationFn:e=>Y(`/api/database/import`,e)})}function en(){return t({queryKey:$.lifecycle,queryFn:({signal:e})=>J(`/api/lifecycle`,e),refetchInterval:!1})}function tn(){return e({mutationFn:()=>Y(`/api/lifecycle/restart`)})}function nn(){return e({mutationFn:()=>Y(`/api/lifecycle/shutdown`)})}function rn(){let t=n();return e({mutationFn:e=>Y(`/api/login`,{password:e}),onSuccess:()=>t.invalidateQueries()})}function an(){let t=n();return e({mutationFn:e=>Y(`/api/setup`,{password:e}),onSuccess:()=>t.invalidateQueries()})}function on(){let t=n();return e({mutationFn:()=>Y(`/api/logout`),onSuccess:()=>{t.clear()}})}function sn(){let t=n();return e({mutationFn:({id:e,patch:t})=>Et(`/api/credentials/${e}`,t),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function cn(){let t=n();return e({mutationFn:e=>Z(`/api/credentials/${e}`),onSuccess:()=>{t.invalidateQueries({queryKey:$.credentials}),t.invalidateQueries({queryKey:$.credentialHealth})}})}function ln(){let t=n();return e({mutationFn:e=>X(`/api/models/${e.id}`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function un(){let t=n();return e({mutationFn:e=>Z(`/api/models/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.models})})}function dn(){return e({mutationFn:({modelId:e,need:t})=>Y(`/api/models/${e}/dry-run`,t)})}function fn(){let t=n();return e({mutationFn:e=>Y(`/api/keys`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function pn(){let t=n();return e({mutationFn:({id:e,limits:t})=>X(`/api/keys/${e}/limits`,{limits:t}),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function mn(){let t=n();return e({mutationFn:e=>Z(`/api/keys/${e}`),onSuccess:()=>t.invalidateQueries({queryKey:$.keys})})}function hn(){let t=n();return e({mutationFn:e=>X(`/api/settings`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.settings})})}function gn(){return e({mutationFn:e=>Y(`/api/connect/start`,e)})}function _n(){let t=n();return e({mutationFn:e=>Y(`/api/credentials`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function vn(){let t=n();return e({mutationFn:e=>Y(`/api/connect/finish`,e),onSuccess:()=>t.invalidateQueries({queryKey:$.credentials})})}function yn(){return t({queryKey:$.plugins,queryFn:async({signal:e})=>(await J(`/api/plugins`,e)).plugins,staleTime:3e5})}async function bn(e){let t=await q(`/api/connect/poll`,{method:`POST`,body:{flowId:e},accept:[202]});return t.status===202?{status:`pending`}:t.data}export{ft as $,At as A,z as At,an as B,w as Bt,Mt as C,De as Ct,Bt as D,me as Dt,on as E,H as Et,ln as F,de as Ft,Rt as G,E as Gt,Kt as H,re as Ht,Yt as I,le as It,Z as J,Xt as K,g as Kt,hn as L,A as Lt,tn as M,M as Mt,Qt as N,j as Nt,jt as O,ge as Ot,mn as P,se as Pt,_t as Q,pn as R,ue as Rt,$t as S,Ae as St,rn as T,Ee as Tt,Dt as U,b as Ut,nn as V,ce as Vt,sn as W,T as Wt,Y as X,J as Y,X as Z,Wt as _,Ie as _t,Gt as a,gt as at,Zt as b,Ne as bt,It as c,Ct as ct,Ut as d,ot as dt,pt as et,_n as f,Ke as ft,Ot as g,ze as gt,kt as h,Be as ht,$ as i,vt as it,Vt as j,ve as jt,yn as k,he as kt,vn as l,ut as lt,Jt as m,Ue as mt,zt as n,ht as nt,Lt as o,bt as ot,fn as p,Ge as pt,wt as q,_ as qt,bn as r,yt as rt,Ft as s,St as st,Ht as t,mt as tt,gn as u,dt as ut,cn as v,we as vt,en as w,Te as wt,dn as x,Ce as xt,un as y,je as yt,Pt as z,ee as zt};