@deslop/deploy 0.1.1359 → 0.1.1365
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/(home)-DfN3X_U4.js +64 -0
- package/dist/client/assets/{dropdown-menu-Bq__Xba5.js → dropdown-menu-GVf0uCqd.js} +1 -1
- package/dist/client/assets/effect-B7YZ9Uvm.js +17 -0
- package/dist/client/assets/fleet-DzWovqhh.js +2 -0
- package/dist/client/assets/index-BVDjvqu1.css +2 -0
- package/dist/client/assets/index-CZpfiToH.js +2 -0
- package/dist/client/assets/{result-error-Y-B0irzX.js → result-error-C9bR_Bz9.js} +1 -1
- package/dist/client/assets/route-CblLuHRj.js +1 -0
- package/dist/client/index.html +4 -4
- package/dist/server.js +6325 -17115
- package/package.json +43 -43
- package/dist/client/assets/(home)-BhkOefJ6.js +0 -64
- package/dist/client/assets/effect-2Kl3lmQH.js +0 -17
- package/dist/client/assets/fleet-C6v5oKqs.js +0 -2
- package/dist/client/assets/index-m7p4JAOh.css +0 -2
- package/dist/client/assets/index-qjacScV-.js +0 -2
- package/dist/client/assets/route-BB9Veasm.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,i as n,o as r,r as i}from"./react-DLGSahv8.js";import{$n as a,Aa as o,Ai as s,Ar as c,B as l,Bn as u,Bt as d,C as f,Ca as p,Ci as m,Cn as h,Ct as g,D as _,Dn as v,Dr as y,Dt as b,E as x,En as S,Er as C,Et as w,F as ee,Fa as te,Fn as ne,Fr as re,Ft as ie,G as ae,Ga as oe,Gn as se,Gt as ce,H as le,Ha as T,Hr as ue,I as de,Ia as fe,In as pe,It as me,J as he,Jt as E,Ka as ge,Ki as _e,Kn as ve,Kt as ye,L as be,La as xe,Ln as Se,Lt as Ce,Ma as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Nn as ke,Nt as Ae,O as je,Oa as Me,Oi as Ne,On as Pe,Or as Fe,Ot as D,P as Ie,Pa as Le,Pi as Re,Pn as ze,Pt as Be,R as Ve,Ra as He,Rn as Ue,Rr as We,Rt as Ge,S as Ke,Sn as qe,Sr as Je,St as O,T as Ye,Ta as Xe,Tr as Ze,Tt as Qe,U as $e,Ua as et,Un as tt,Ut as nt,Va as rt,Vt as it,W as at,Wa as ot,Wn as st,Wt as k,Xn as ct,Xt as lt,Y as ut,Yn as dt,Yt as ft,Z as pt,Zn as mt,Zr as ht,_ as gt,_n as _t,_r as A,_t as vt,a as yt,ai as bt,ao as xt,ar as St,at as Ct,b as wt,bi as Tt,br as Et,bt as Dt,c as Ot,ci as kt,cn as At,co as j,cr as jt,ct as Mt,d as Nt,di as Pt,dt as M,ei as Ft,er as It,f as Lt,fi as Rt,fr as zt,ft as Bt,g as Vt,gi as Ht,gn as Ut,gr as Wt,gt as Gt,h as Kt,hi as qt,ht as Jt,i as Yt,ii as Xt,ir as Zt,it as Qt,ja as $t,jn as en,jr as tn,ka as nn,ki as rn,kn as an,kr as on,kt as sn,l as cn,la as ln,li as un,lt as N,m as dn,mi as fn,mt as P,n as pn,ni as mn,nr as hn,nt as F,o as gn,oi as _n,oo as vn,or as yn,ot as bn,p as xn,pi as Sn,pr as Cn,pt as wn,qt as Tn,r as En,ri as Dn,rr as On,rt as I,s as kn,si as An,so as jn,sr as Mn,st as Nn,t as Pn,ti as Fn,tr as In,u as Ln,ui as Rn,un as zn,ur as Bn,ut as L,v as R,vi as Vn,vr as Hn,vt as Un,w as Wn,wa as Gn,wi as Kn,wn as qn,wr as Jn,wt as Yn,x as Xn,xi as Zn,xn as Qn,xr as $n,xt as z,y as er,yr as B,yt as V,z as tr,zi as nr,zn as rr,zt as ir}from"./effect-B7YZ9Uvm.js";import{l as ar,r as or,t as sr,z as cr}from"./dist-BdaiJgHG.js";var H=e(r(),1),lr=e(n(),1);function ur(e){let t=lr.unstable_scheduleCallback(4,e);return()=>lr.unstable_cancelCallback(t)}var dr=H.createContext(ae({scheduleTask:ur,defaultIdleTTL:400})),fr=new WeakMap,pr=0,mr=new Set;function hr(e){pr++;try{return e()}finally{pr--}}function gr(e){if(pr===0)return e();mr.size===0&&queueMicrotask(_r),mr.add(e)}function _r(){for(let e of mr)mr.delete(e),e()}function vr(e,t){let n=fr.get(e);n===void 0&&(n=new WeakMap,fr.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>gr(n));return()=>{i--,mr.delete(n),r()}},snapshot(){return hr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:hr(()=>Ve(t,e))}),a.value}};return n.set(t,o),o}function yr(e,t){let n=vr(e,t);return H.useEffect(_r),H.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function br(e,t,n){let r=vr(e,t),i=H.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return H.useEffect(_r),H.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var xr=(e,t)=>{let n=H.useContext(dr);return t?br(n,e,t):yr(n,e)};function Sr(e,t){H.useEffect(()=>e.mount(t),[t,e])}function Cr(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?H.useCallback(r=>{e.set(t,r);let i=zt(at(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(wr):i},[e,t,n.mode]):H.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var wr=e=>{if(Pt(e))return e.value;throw Ht(e.cause)},Tr=e=>{Sr(H.useContext(dr),e)},Er=(e,t)=>{let n=H.useContext(dr);return Sr(n,e),Cr(n,e,t)},Dr=e=>{let t=H.useContext(dr);return Sr(t,e),H.useCallback(()=>{t.refresh(e)},[t,e])},Or=(e,t)=>{let n=H.useContext(dr);return[yr(n,e),Cr(n,e,t)]},kr={suspendOnWaiting:new WeakMap,default:new WeakMap};function Ar(e,t,n){let r=n?kr.suspendOnWaiting:kr.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function jr(e,t,n){let r=yr(e,t);if(r._tag===`Initial`||n&&r.waiting)throw Ar(e,t,n);return r}var Mr=(e,t)=>{let n=jr(H.useContext(dr),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw Ht(n.cause);return n},U=i(),Nr=class extends H.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?H.createElement(this.props.errorComponent??Pr,{error:e[0],reset:this.reset}):this.props.children}};function Pr({error:e}){let[t,n]=H.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}function W(e){return e[e.length-1]}function Fr(e,t){return typeof e==`function`?e(t):e}var Ir=Object.prototype.hasOwnProperty;function Lr(e){for(let t in e)if(Ir.call(e,t))return!0;return!1}var Rr=()=>Object.create(null),zr=(e,t)=>G(e,t,!0);function G(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(Br(e)&&Br(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&W(a)!==`${o-1}`||c&&W(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?G(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?G(d,o,n,r):o,i&&=u===d&&(a[l]===f||Ir.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?Rr():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?G(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function Br(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function Vr(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!Vr(a,o,n,r))return!1}return!0}if(Br(e)&&Br(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!Vr(e[i],t[i],n,r))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++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!Vr(e[a],t[a],n,r)))return!1;return i===0}return!1}function Hr(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 Ur=/[\x00-\x1f\x7f"<>`{}]/g;function Wr(e){return e.replace(Ur,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Gr(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 Wr(t)}var Kr=[`http:`,`https:`,`mailto:`,`tel:`];function qr(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var Jr=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function Yr(e,t){if(!e)return!1;if(Jr.test(e))return!0;let n=qr(e);return n?!t.has(n):!1}function Xr(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=Gr(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=Gr(r?e.slice(r):e)}return t}function Zr(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Qr(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 $r(){throw Error(`Invariant failed`)}function ei(e){return e.replace(/\/{2,}/g,`/`)}function ti(e){return e===`/`?e:e.replace(/^\/+/,``)}function ni(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function ri(e){return ni(ti(e))}function ii(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ai(e,t,n=`never`,r){if(t.includes(`//`)&&(t=ei(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=ei(e)),o=e.split(`/`);o.length>1&&W(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(W(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?ei(s):s)||`/`;return a&&r&&r.set(a,c),c}function oi(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function si(e){return e==null||e===``}function ci(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function li(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&si(f)){if(c===`/`&&!d)continue;f=``}o+=c+ci(s,f,r)+(d||``)}}return o+a||`/`}function ui(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function di(e){return e?.isNotFound===!0}function fi(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function pi(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function mi(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]=pi(r):Array.isArray(t)?t.push(pi(r)):n[e]=[t,pi(r)]}return n}var hi=/^(?:\s|["[{\d-]|fa|nu|tr)/,gi=vi(JSON.parse),_i=yi(JSON.stringify,JSON.parse);function vi(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=mi(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!hi.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function yi(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&&!hi.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=fi(e,r);return t?`?${t}`:``}}var bi=`__root__`;function xi(e){e.statusCode=e.statusCode||e.code||307;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 Si(e){return e instanceof Response&&!!e.options}function Ci(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var wi=4,Ti=5;function Ei(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Di(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function Oi(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=W(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Di(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Ai(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=Ai(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Ai(r,Ti);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=Ai(r,wi);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function ki(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 Ai(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ji(e,t){let n=Ai(),r=[];function i(e,t,n,a){let[o,s,c]=Oi(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(ki);t.masksTree=n,t.flatCache=Ci(1e3)}function Mi(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Ii(e,t.masksTree);return t.flatCache.set(e,r),r}function Ni(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ai(),Oi(t,{from:e},1,o),i.singleCache.set(a,o)),Ii(r,o,n)}function Pi(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=Ii(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ri(a.route)),t.matchCache.set(r,a),a}function Fi(e,t=!1){let n=Ai(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&$r(),i[e.id]=e,o!==0&&e.path){let t=ni(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Oi(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(ki);return{processedTree:{segmentTree:n,singleCache:Ci(1e3),matchCache:Ci(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Ii(e,t,n=!1){let r=e.split(`/`),i=Bi(e,r,t,n);if(!i)return null;let[a]=Li(e,r,i);return{route:i.node.route,rawParams:a}}function Li(e,t,n){let r=zi(n.node),i=n.node.data&&Ei(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===wi)break;if(u.kind===Ti){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Ri(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function zi(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Bi(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!W(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&&!Wi(l,n))continue;if(i.parse){if(!Ui(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==wi&&Wi(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===wi||i.kind===2)&&Wi(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&&(Ui(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Hi(f,o))return n;Wi(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(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)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.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Vi(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.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Vi(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+Vi(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+Vi(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 Vi(e,t){return 2**(e-t-1)}function Hi(e,t){return e===2**(t-1)-1}function Ui(e,t,n){let r,i;try{[r,i]=Li(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 Wi(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===wi)>(e.node.kind===wi)||t.node.kind===wi==(e.node.kind===wi)&&t.node.depth>e.node.depth)))}function Gi(){try{return sessionStorage}catch{return}}var Ki=`tsr-scroll-restoration-v1_3`,qi=Gi();function Ji(){try{return JSON.parse(qi?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Yi=Ji(),Xi=`data-scroll-restoration-id`,Zi=e=>e.state.__TSR_key||e.href;function Qi(e){let t=e.getAttribute(Xi);if(t)return`[${Xi}="${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 $i=!1,ea=`window`;function ta(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function na(e){let t=new Set;for(let n of e){if(n===ea)continue;let e=ta(n);e&&t.add(e)}return t}function ra(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Zi,a=new Set,o=e=>{let t=Yi[e]||={};for(let e of a)e===document?t[ea]={scrollX,scrollY}:e.isConnected&&(t[Qi(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,$i=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{$i||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{qi?.setItem(Ki,JSON.stringify(Yi))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),r.r||(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!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.e&&d&&d!==u){let e=Yi[d];if(e){let t=Yi[u];for(let n in e){if(n===ea){if(s)continue}else{let e=ta(n);if(!e||s&&o&&(l??=na(o),l.has(e)))continue}t||=Yi[u]={},t[n]??=e[n]}}}$i=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=na(o));let t=e&&i&&c,s=r.e?Yi[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===ea){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=ta(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{$i=!1}}))}function ia(e,t,n){let r=ri(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=ei(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>aa(n,s.input({url:e})),output:({url:e})=>s.output({url:oa(n,e)})}:s}function aa(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 oa(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 sa(e){let t=e;return{get(){return t},set(e){t=Fr(e,t)}}}function ca(e){return{get(){return e()}}}function la(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{Qr(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var ua=`__TSR_index`,da=`popstate`,fa=`beforeunload`,pa=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function ma(e){let t=pa.exec(e);return t?`/`+e.slice(t[0].length):e}function ha(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
+
\r`.includes(e)?``:encodeURIComponent(e))),ma(e)}function ga(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 n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=ya(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};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[ua];i=_a(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[ua];i=_a(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,n?.ignoreBlocker??!1),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[ua]!==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,_getBlockers:()=>e.getBlockers?.()??[]}}function _a(e,t){let n=ba();return{...t,key:n,__TSR_key:n,[ua]:e}}function va(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=t=>ha(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>ya(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=ba();t.history.replaceState({[ua]: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=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=ya(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[ua]-l.state[ua],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 r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),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||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=ga({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,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(fa,x,{capture:!0}),t.removeEventListener(da,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(fa,x,{capture:!0}),t.addEventListener(da,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 ya(e,t){let n=ha(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=ba();t={[ua]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function ba(){return(Math.random()+1).toString(36).slice(7)}function xa(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Sa(e){return e.pathname+e.search+e.hash}function Ca(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function wa(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ta({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ea(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Da(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Oa=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:va()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&ri(n)?ia(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=la(this.latestLocation,e),ra(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Fi(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&ji(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:Ci(1e3)}},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},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:Xr(e),external:!1,searchStr:o,search:zr(t?.search,i),hash:Xr(r.slice(1)),state:G(t?.state,a)}}let o=aa(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Xr(ma(o.pathname)),external:!!this.rewrite&&xa(o,this.origin),searchStr:c,search:zr(t?.search,s),hash:Xr(o.hash.slice(1)),state:G(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},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=Pi(ni(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=ya(n.href,{});n={...n,to:aa(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=ai(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ni(c)],u=c.includes(`$`),d;if(l)d=l._branch??=Ri(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Oi(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Na(n.params,e),!Lr(p))break;p===e&&(p=Object.assign(Rr(),p));try{Object.assign(p,t(p))}catch{}}}p??=Na(n.params,Pa(n.params,f)?o()[3]:Fa);let m=e.leaveParams?c:ma(Xr(f?li(c,f,p,this.pathParamsDecoder):c)),h=Ia(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Ma(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?La(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Fa,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Fa,S=`${m}${v}${b}`,C,w,ee=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=oa(this.rewrite,e);C=Sa(e),xa(n,t)?(w=n.href,ee=!0):w=ma(Sa(n))}else C=Zr(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:ee,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Mi(r.pathname,this.processedTree);if(t){let i=Object.assign(Rr(),t.rawParams),{from:a,params:o,...s}=t.route,c=Na(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return ka(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ni(this.latestLocation.href)===ni(n.href)&&Vr(Ta(n.state),Ta(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.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={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?qr(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return ka(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Eo(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(wa(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,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Ca(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(Jr.test(n)||(r=qr(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:xa(e,this.origin)||(n=Sa(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),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=Ha,this.preloadRoute=e=>Do(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?ai(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):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=Ni(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Vr(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Vr(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=oi(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??_i,parseSearch:e.parseSearch??gi,protocolAllowlist:e.protocolAllowlist??Kr}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Oi(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:ni(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Ra(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Ma(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof Aa||(r=new Aa(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=Rr(),_=i._interpolation?li(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{za(i,d)}catch(e){if(x=di(e)||Si(e)?e:new ja(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:zr(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Ca(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?zr(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?G(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?zr(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=W(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=W(a),c={...e.search};for(let e of a)try{Object.assign(c,Ma(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=o;for(let t of a)try{za(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function ka(e,t,{replace:n,ignoreBlocker:r}){if(!Yr(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var Aa=class extends Error{},ja=class extends Error{};function Ma(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Aa(`Async validation not supported`);if(n.issues)throw new Aa(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 Na(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Pa(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!Ir.call(e,t[1]))}var Fa=Object.freeze({});function Ia(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Ma(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function La(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Fr(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function Ra(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 bi}function za(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Ba(e,t){return e.options[t]?.preload?.()}function Va(e,t){let n=Ba(e,`component`),r=Ba(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ha(e,t,n){let r=()=>t===!1?void 0:t?Ba(e,t):Va(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 Ua(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Wa(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var K=0,q=1,Ga=2,J=3,Ka=[4];function qa(e){return typeof e[0]==`number`}function Ja(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).then(()=>t.removeEventListener(`abort`,i))})}function Ya(e,t){return e.routesById[t.routeId]}function Xa(e,t,n){return Si(e)?[J,e]:di(e)?(e.routeId||=n,[Ga,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[q,e]):[K,e]}function Za(e,t){let n=Xa(t,!0,e.id);if(n[0]!==q)return n;try{e.options.onError?.(n[1])}catch(t){n=Xa(t,!0,e.id)}return n}function Qa(e,t,n,r,i){return i[0].signal.aborted?Ka:po(e,t,n,Za(n,r),i)}async function $a(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Ya(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Y(e,r),[i,Qa(e,t,u,a,n)]}if(c.aborted)return[i,Ka];let p=r.paramsError??r.searchError;if(p!==void 0)return Y(e,r),[i,Qa(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{no(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Ja(a,c):a);if(c.aborted)return[i,Ka];let s=po(e,t,u,Xa(o,!1,u.id),n);if(s[0]!==K)return Y(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Y(e,r),[i,Qa(e,t,u,a,n)]}finally{r.status=h,no(e,r,!1,n[0])}}i()}function eo(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 Y(e,t){let n=t._flight;t._flight=void 0,eo(e,t,n)?.abort()}function X(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=eo(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function to(e){for(let t of e){let e=t._flight;e&&e[2]++}}function no(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 ro(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation: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 io(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Ka;if(!i)return[K,void 0];let l=n._flight;no(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(ro(e,t,n,r,s,a,!!o[3]))).then(e=>Xa(e,!1,r.id),e=>Xa(e,!0,r.id)).then(t=>(t[0]!==K&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===q&&l[2]?Za(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],po(e,t,r,await Ja(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Y(e,n),Ka}finally{no(e,n,!1,s)}}function ao(e,t,n){t[0]!==J&&(e.status=`success`,e.error=void 0,t[0]===K?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function oo(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&&Y(e,r)}function so(e,t){return t[0]===q||t[0]===Ga?{...e,status:t[0]===q?`error`:`notFound`,error:t[1],_flight:void 0}:e}function co(e,t,n,r,i,a,o){let s=t[1][n],c=Ya(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(ro(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Ka)),!p){if(s.status!==`success`)f=!0;else{let t=l||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[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Y(e,s),p=Qa(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,eo(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?io(e,t,s,c,g,i,a).then(t=>(ao(s,t,l),t[0]===K&&(m&&!a[0].signal.aborted&&oo(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[K,s.loaderData]),ee=(async()=>{try{let e=Ha(c,void 0,C);e&&await Ja(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,Qa(e,t,c,r,a)]}let r=await w;x&&r[0]===K&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,ee]),!y)return w.then(e=>so(s,e));let te={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ne=io(e,t,te,c,g,i,a).then(e=>(s.isFetching=!1,ao(te,e,!1),e));return(t[2]??=[]).push([n,ne,ee,te]),ne.then(e=>so(te,e))}async function lo(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=Ya(e,t[n]);try{let e=Ha(i,!1);e&&await Ja(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function uo(e,t){t[2]&&=(X(e,t[2].map(e=>e[3])),void 0)}async function fo(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]>=J)throw[a,t];!i&&t[0]!==K&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===J)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function po(e,t,n,r,i,a){for(;r[0]===J;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[J,t]:[J,t,a]}return[J,o,n]}catch(e){r=a?[q,e]:Za(n,e),a=!0}}return r}async function mo(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ga?lo(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=J)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==K&&t[0]<J&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=J){let n=s[1];if(n[0]!==J||n[1].options.reloadDocument||n[2])return uo(e,t),n;c=!0,s=[0,[q,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===q?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)};p(),i||a?.();let m=Ya(e,u);try{await Ja(i?Promise.resolve().then(()=>Ha(m,l===q?`errorComponent`:`notFoundComponent`)):Promise.all([Ha(m),Ha(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return uo(e,t),Ka}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),uo(e,t),X(e,o),p()):u.status=`success`}return t}async function ho(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=Ya(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 Ja(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&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function go(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await lo(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=co(e,i,t,u,f,r,l)},m=await $a(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ga){let t=await lo(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=J&&(c=0);p()}if(!a.aborted&&!r[3]){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 h=mo(e,i,u,r[0],fo(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=fo(i[2],void 0,void 0,h.then(e=>qa(e)?0:Ua(n).length,()=>0))),o=await h}catch(t){if(uo(e,i),t===a&&a.aborted)return Ka;throw t}return qa(o)?o:ho(e,o,a,r[6]===n.length?r[6]:0)}function _o(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Ya(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>_o(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function vo(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function yo(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Ua(t[3]).some(e=>e.id===n[1]))return;let i;try{await Ja(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function bo(e,t){e._committed=t,e.stores.setMatches(t)}function xo(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Ua(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=Ya(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Ea(n);bo(e,n),X(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Da(e,i,n,a,l,t)}async function So(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Co(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function wo(e,t,n,r,i){let a=n.map(e=>({...e}));to(a);for(let t of r)Y(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await mo(e,o,r,t[0],i)}catch(t){throw X(e,a),t}if(qa(s))X(e,a),s[0]===J&&e._tx===t&&e._committed===n&&await Co(e,t,s);else if(await ho(e,s,t[0].signal),e._tx!==t||e._committed!==n)X(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Y(e,n))}bo(e,a),X(e,n,a)}}async function To(e,t,n,r,i,a){let o=await go(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(qa(o)){let n=o[0]===J&&e._tx===t;if((!n||o[1].options.reloadDocument)&&vo(e,t),X(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){vo(e,t);return}await Co(e,t,o);return}let s=o[1];if(e._tx===t&&await yo(e,t),e._tx!==t){vo(e,t),X(e,s),uo(e,o);return}let c=t[2],l=wa(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await yo(e,t),e._tx!==t){vo(e,t),X(e,s),uo(e,o);return}let n=await e.startTransition(()=>{vo(e,t),xo(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&wo(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):uo(e,o)})}async function Eo(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){let t=wa(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await So(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});to(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){X(e,m),await So(e,n);return}e._preflight=void 0;let g,_=()=>To(e,y,f,()=>_o(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>So(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&no(e,t,!1)}n[0].abort(),X(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&_o(e,y),g?.(_()),await y[5]):(X(e,y[3]),y[3]=[],g?.(),await So(e,y))}async function Do(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),to(a),o=(e._preloads??=new Map).set(i,a),s=await go(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),X(e,a)),i.abort()}if(!qa(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){di(e)||console.error(e);return}}}function Oo(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Wa(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var ko=H.createContext(void 0),Ao=H.createContext(void 0),jo=H.createContext(null);function Mo(e){return H.useContext(jo)}var No=cr();function Po(e,t){return e===t}function Fo(e,t=e=>e,n){let r=n?.compare??Po,i=(0,H.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,H.useCallback)(()=>e.get(),[e]);return(0,No.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Io=t(),Z=class extends g()(`AuthError`,{cause:ir(bn()),error:d(P([`access_denied`,`temporarily_unavailable`])),message:z}){get name(){return this.error===`temporarily_unavailable`?`AuthUnavailable`:`AuthError`}},Lo=j(Jt,b(`UserId`));function Ro(e){return rt(We(/^github:([1-9]\d*)$/u)(e),()=>`https://avatars.githubusercontent.com/u/${ue(7)(e)}?s=96`)}var zo=j(M,b(`GitHubId`));j(L,D(zo));var Bo=O({admin:I,id:Lo,name:Jt});Gn()(`@deslop/runtime/shared/auth/CurrentAdmin`);var Vo=class extends Yt()(`@deslop/runtime/shared/auth/RpcAdmin`,{error:Z}){};O({address:V(Jt),onBehalfOf:V(Lo),session:V(Jt)}),Lo.make(`github:0`);function Ho(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}ct(function*(e){let t=new URL(e).searchParams,n=t.get(`error`);return n===null?yield*sn(Jt)(t.get(`session`)):yield*Z.make({message:n})});function Uo(e){return Ae(Z)(e)&&e.error===void 0}function Wo(e){return Ae(Z)(e)&&e.error!==`temporarily_unavailable`}function Go(e){return t=>j(t,Je(`10 seconds`),yn(t=>Ae(Z)(t)?t:Z.make({cause:t,error:`temporarily_unavailable`,message:e})))}m(5),m(15),Gn()(`@deslop/runtime/shared/auth/CurrentUser`);var Ko=class extends Yt()(`@deslop/runtime/shared/auth/RpcAuth`,{error:Z}){},qo=z.check(Ge(e=>Me(p(je(e)),e=>s([`http:`,`https:`],e.protocol)&&e.username===``&&e.password===``&&e.hash===``),{expected:`an HTTP(S) URL without credentials or a fragment`})).check(Ge(e=>Me(p(je(e)),e=>e.pathname===`/`&&e.search===``),{expected:`an HTTP(S) origin without a path or query`}));qo.check(Ge(e=>Me(p(je(e)),e=>e.protocol===`https:`||s([`localhost`,`127.0.0.1`,`[::1]`],e.hostname)),{expected:`HTTPS outside loopback`})),z.check(Ce(/^\d{1,5}$/u),Ge(e=>Me(ht(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var Jo=z.check(Ce(/^0\.1\.\d+$/u)),Yo=`/api/runtime`,Xo=`/api/account`,Zo=O({auth:V(qo),name:z,traces:V(qo),version:Jo}),Qo=`/api/rpc`,$o=O({...Bo.fields,signOut:I});O({config:O({port:M}),name:z,version:Jo}),P([`web`,`mobile`,`server`]);function es(e,t,n,r){return Fn(Rn(It(function*(){let i=`${yield*Ft}`,a=yield*lt,o={attributes:{"scope.run.started_unix_nano":i,"scope.runtime":n,"service.instance.id":i},serviceName:e,serviceVersion:te(He(r,e=>e!==`0.1.0`))};return _n(bt(kn({resource:o,url:new URL(`/v1/traces`,t).href}),Ot({resource:o,url:new URL(`/v1/logs`,t).href}),kt(lt,[...a,`code`,`state`,`request`,`access_token`,`refresh_token`,`id_token`,`client_secret`,`client_assertion`,`code_verifier`,`session`,`token`,`api_key`,`key`])),[cn,Nt])})),e=>fn(e)?Dn(hn):Dn(Zt(`Telemetry is unavailable`)))}function ts(e){return Rn(It(function*(){let t=yield*j((yield*Wn).get(Yo),dt(x),dt(_(Zo)),Je(`3 seconds`),$n(e=>Zt(`Telemetry is off: the runtime config did not load`,e)),jt);return T(t,{onNone:()=>Xt,onSome:t=>T(t.traces,{onNone:()=>Xt,onSome:n=>es(`${e}-client`,n,`web`,t.version)})})}))}function ns(e,t){return j(Ye(`${e}${Xo}`,{headers:t}),dt(ct(function*(e){return e.status===401?yield*Z.make({message:`Sign in first`}):e.status===403?yield*Z.make({error:`access_denied`,message:`This account is refused`}):yield*j(e,x,dt(_($o)))})),Go(`The server could not be reached`))}var rs=class extends Yt()(`@deslop/runtime/shared/rpc/RpcStream`){};kt(rs,rs.of((e,t)=>er(t.rpc.successSchema)?rr(u(`rpc.stream`,!0),e):e));var is=yt(rs,e=>It(function*(){return er(e.rpc.successSchema)&&(yield*u(`rpc.stream`,!0)),yield*e.next(e.request)})),as=m(1),os=mn(xn,It(function*(){let e=yield*xn,t=yield*Cn,n=C(),r=C();function i(e){let t=y(r,e);return on(r,e),t}function o(t,r){return Hn(()=>T(i(r),{onNone:()=>Jn,onSome:i=>{let a=gt.make({reason:Ie(i.sent,{onFalse:()=>wt.make({cause:`The socket did not open`,kind:`Timeout`}),onTrue:()=>Xn.make({cause:`No answer within ${Tt(as)}`})})}),o=j(n,y(t),T({onNone:()=>Jn,onSome:e=>e({_tag:`ClientProtocolError`,error:a,requestIds:[r]})}));return i.sent?rr(o,In(e.send(t,{_tag:`Interrupt`,requestId:r}),{log:`Warn`,message:`The server was not told to stop an unanswered request`})):o}}))}function s(e){return mt(e,e=>T(i(e),{onNone:()=>Jn,onSome:e=>Se(e.deadline)}),{concurrency:1,discard:!0})}function l(e){return j(Fe(r),nr,Re(t=>j(r,y(t),Me(t=>t.clientId===e))))}return xn.of({...e,run:(t,r)=>Hn(()=>(c(n,t,r),se(e.run(t,e=>j(e,Oe({Chunk:e=>s([e.requestId]),ClientProtocolError:e=>s(e.requestIds??l(t)),Defect:()=>s(l(t)),Exit:e=>s([e.requestId]),Pong:()=>Jn,Request:()=>Jn}),rr(r(e)))),B(()=>on(n,t))))),send:(n,i,l)=>Oe(i,{Ack:()=>e.send(n,i,l),Eof:()=>e.send(n,i,l),Interrupt:t=>rr(s([t.requestId]),e.send(n,i)),Ping:()=>e.send(n,i,l),Request:i=>It(function*(){let u={clientId:n,deadline:yield*j(o(n,i.id),tt(as),a(t)),sent:!1};c(r,i.id,u),yield*Mn(e.send(n,i,l),()=>s([i.id])),u.sent=!0})})})}));function ss(e){return j(os,_n(dn({pingTimeout:`15 seconds`})),_n(e),An(Kt()),An(is))}g()(`WriteError`,{cause:bn(),message:z});var cs=ze(et());P([`route`,`caught`,`uncaught`]);var ls=be(e=>{let t=On(`Web error`,Rt(e.error),...ge(we(e.stack)));return T(Te(cs),{onNone:()=>t,onSome:n=>Bn(j(t,rr(st(e.error)),Ze(`Web.error`,{attributes:{"web.error.source":e.source,"web.route.id":e.route},root:!0}),ve),n)})}),us=le(Nt).atom(ns(``)),ds=ss(_n(Ke(B(()=>`${location.origin}${Qo}`)),f));function fs(e){le.addGlobalLayer(j(ts(e),_n(Nt),un(e=>fe(Xe(e,Ln))?Jn:Ue(B(()=>ne(cs,oe(e))),()=>B(()=>pe(cs,nn(t=>t!==e)))))))}function ps(e){return ln(e.reasons,e=>qt(e)&&Wo(e.error))}function ms(e){return!pt(e)||!ps(e.cause)&&xe(e.previousSuccess)?et():oe(e.cause)}function hs(e,t,n=jn){function r(e){let t=Re(e.reasons,e=>qt(e)&&Wo(e.error));return _e(t)?et():oe(Sn(t))}let i=ze(j(e.self(),nn(pt),o(e=>r(e.cause))));function a(e){return T(Te(i),{onNone:()=>e,onSome:t=>Sn([...t.reasons,...Re(e.reasons,e=>!qt(e)||!Wo(e.error))])})}let s=ze(0),c=an(t,t=>B(()=>{pe(i,e=>ot(r(t),()=>e));let n=a(t);xe(Te(i))?e.setSelf(he(n)):ke(s)<2||e.setSelf(ut(n,{previous:e.self()}))}));return j(n(c),Pe(()=>B(()=>{ne(i,et()),ne(s,0)})),Qn(e=>qn(a(e))),qe(v(()=>T(Te(i),{onNone:()=>h,onSome:qn}))))}function gs(e){return Ae(Z)(e)?e.error===`temporarily_unavailable`:Ae(gt)(e)&&!Ae(Vt)(e.reason)}function _s(e){return S(e,e=>Ee(e(tn(`1 second`)),e=>gs(e.input)))}function vs(e,t,n){return en(St(e,e=>e(t,n)))}function ys(e,t,n){return e.runtime.atom(r=>hs(r,en(St(e,e=>e(t,n))),_s))}var bs=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=ar({disabled:i,focusableWhenDisabled:a,native:o});return or(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function xs(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xs(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ss(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xs(e))&&(r&&(r+=` `),r+=t);return r}var Cs=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ws=Ss,Ts=(e,t)=>n=>{if(t?.variants==null)return ws(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Cs(t)||Cs(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ws(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Es=Ts(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Ds(e){let t=(0,Io.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?`default`:a,c;t[5]!==n||t[6]!==s||t[7]!==o?(c=sr(Es({variant:o,size:s,className:n})),t[5]=n,t[6]=s,t[7]=o,t[8]=c):c=t[8];let l;return t[9]!==r||t[10]!==c?(l=(0,U.jsx)(bs,{"data-slot":`button`,className:c,...r}),t[9]=r,t[10]=c,t[11]=l):l=t[11],l}var Os=P([`10m`,`1h`,`24h`,`7d`,`30d`]),ks={"1h":Zn(1),"7d":Vn(7),"10m":m(10),"24h":Vn(1),"30d":Vn(30)};function As(e){return ks[e]}var js=j(N.check(Be({maximum:864e13,minimum:-864e13})),D(Qt,{decode:E(e=>zn(At(0),()=>e)),encode:E(Ut)})),Ms=j(N,D(Mt));j(N.check(Be({maximum:864e10,minimum:-864e10})),D(Qt,{decode:E(e=>zn(At(0),()=>e*1e3)),encode:E(e=>Ut(e)/1e3)})),j(M.check(Be({maximum:864e10,minimum:-864e10})),D(Qt,{decode:E(e=>At(e*1e3)),encode:E(_t)}));var Ns=j(N,D(Nn,{decode:E(Kn),encode:E(rn)})),Q=b(`DeployWorkerId`)(z),Ps=b(`DeployItemId`)(z),Fs=b(`DeployAppId`)(z),Is=b(`DeployUnitId`)(z),Ls=b(`DeployProcessId`)(M),Rs=b(`DeployContainerId`)(z),zs=b(`DeployJobName`)(z),Bs=b(`DeployExposureName`)(z);j(L,D(Ls)),F(L),j(L,D(N,{decode:E(e=>e*1024),encode:E(e=>e/1024)})),O({1:Un(L),2:L,3:L});var Vs=j(z,D(Gt(z),{decode:E(e=>He(e,re)),encode:E(e=>Le(e,vn(``)))})),Hs=j(V(z),D(Gt(z),{decode:E(e=>nn(e,re)),encode:E(jn)})),$=class extends g()(`DeployError`,{cause:ir(bn()),message:z}){},Us=O({detail:z,name:z}),Ws=O({cpu:V(N),label:Us,memory:N,name:z,parent:Ls,pid:Ls}),Gs=P([`user`,`system`]),Ks=O({active:j(I,k(Wt(!1))),address:j(V(z),k(A)),bindings:j(V(F(O({address:z,port:M,protocol:P([`tcp`,`udp`])}))),k(A)),detail:z,failure:j(V(O({at:V(js),reason:z})),k(A)),health:j(P([`quiet`,`warning`,`error`]),k(Wt(`quiet`))),hostname:j(V(z),k(A)),http:j(V(I),k(A)),id:Ps,kind:P([`service`,`container`,`port`,`exposure`,`peer`]),links:j(V(F(z)),k(A)),name:z,next:j(V(js),k(A)),owned:j(V(I),k(A)),port:j(V(M),k(A)),process:j(Hs,k(A)),processes:j(V(F(Ws)),k(A)),protocol:j(V(P([`tcp`,`udp`])),k(A)),publicAccess:j(V(I),k(A)),running:j(I,k(Wt(!1))),scheduled:j(V(I),k(A)),scope:j(V(Gs),k(A)),self:j(V(I),k(A)),state:z,ui:j(V(I),k(A)),unit:j(Hs,D(Gt(Is)),k(A)),url:Vs,worker:Q}),qs=w([Ks.mapFields(e=>({...e,kind:wn(`service`),name:Is})),Ks.mapFields(e=>({...e,kind:wn(`exposure`),name:Bs})),Ks.mapFields(e=>({...e,kind:P([`container`,`peer`])}))]),Js=Ks.mapFields(e=>({...e,kind:wn(`port`),process:j(V(Vs),D(Gt(z),{decode:E($t),encode:E(oe)}),k(A))}));w([...qs.members,Js]),O({address:z,port:N,protocol:P([`tcp`,`udp`])}),O(ye(Ks.fields,[`address`,`port`,`protocol`]));var Ys=O({items:F(w([...qs.members,Js.mapFields(e=>({...e,unit:j(V(j(Vs,D(Gt(Is)))),D(Gt(nt(Is)),{decode:E($t),encode:E(oe)}),k(A))}))])),sources:F(O({error:Vs,name:z})),time:js,workers:F(Q)});z.check(Ce(/^[a-z\d](?:[a-z\d-]*[a-z\d])?(?:,[a-z\d](?:[a-z\d-]*[a-z\d])?)*$/u));var Xs=O({DNSName:z,HostName:z,OS:z,Online:I,TailscaleIPs:F(z)});O({Peer:V(Dt(z,Xs)),Self:V(Xs)}),O({AllowFunnel:V(Dt(z,I)),TCP:V(Dt(z,Bt)),Web:V(Dt(z,O({Handlers:Dt(z,O({Proxy:V(z)}))})))});var Zs=O({name:Is,scope:P([`system`,`user`]),worker:Q});O({job:zs.annotate({description:`A scheduled job name as list_apps shows it.`}),worker:V(Q.annotate({description:`The worker running the job, when several do.`}))}),De(Yn([Q,P([`apps`,`exposures`,`jobs`]),Ps])),O({app:V(z.annotate({description:`A substring of an app or unit name; returns that app's process tree.`})),failing:V(I.annotate({description:`Only failed or warning items.`})),worker:V(Q.annotate({description:`A configured worker name.`}))});var Qs=O({children:V(F(it(()=>Qs))),cpu:V(N),detail:V(z),mib:M,name:z}),$s=O({failure:V(z),id:Ps,name:z,ports:V(F(M)),processes:V(F(Qs)),since:V(Ct),state:z,url:V(z)}),ec=O({failure:V(z),id:Ps,name:zs,next:V(Ct),running:I,since:V(Ct)}),tc=O({access:P([`tailnet`,`public`]),failure:V(z),id:Ps,name:Bs,port:V(M),url:z}),nc=O({apps:F($s),errors:V(F(z)),exposures:V(F(tc)),jobs:V(F(ec)),worker:Q});F(nc),O({activates:vt(Is),next:vt(j(N,D(Qt,{decode:E(e=>zn(At(0),()=>e/1e3)),encode:E(e=>Ut(e)*1e3)})))}),O({active:z,description:z,sub:z,unit:Is}),O({ID:Rs,Labels:V(z),Names:z,Ports:z,State:z,Status:z});var rc=w([Fs,P([`other`,`system`])]);P([`idle`,`irq`,`nice`,`sys`,`user`]),Qe(Yn([L,L,L,L,L]),[L]),F(L),b(`DeployCgroupPath`)(z);var ic=P([10,60,1440,10080,43200]),ac=O({minutes:j(ic,D(Nn,{decode:E(m),encode:ft(e=>j(e,Ne,Tn(ic)))}))});O({...ac.fields,worker:V(Q.annotate({description:`A configured worker name.`}))});var oc=O({...ac.fields,worker:V(Q)}),sc=F(vt(N)),cc=O({cpu:V(N),mib:M,name:z}),lc=O({cpuPct:V(N),diskGiB:V(N),diskTotalGiB:V(N),load:V(F(N)),memoryGiB:N,memoryTotalGiB:N}),uc=O({apps:F(cc),cpuPct:sc,diskPct:sc,error:V(z),from:Ct,memoryPct:sc,now:V(lc),stale:V(wn(!0)),stepSeconds:Ns,worker:Q});F(uc),O({cpuIdle:Ms,cpuTotal:Ms,time:js,uptime:Ns});var dc=j(M,D(Ms)),fc=O({cpu:V(N),id:Fs,memory:N}),pc=O({...fc.fields,cpuCoverage:dc}),mc=class extends Pn(`MachineSample`)({appsCoverage:dc,cpu:pn(N),cpuCoverage:dc,memoryCoverage:dc,memoryTotal:N,memoryUsed:N,since:j(M,D(js)),step:j(M,D(Ms)),storageCoverage:dc,storageUsed:pn(N),time:j(M,D(js))}){static table=`samples`};Pn(`AppHistory`)({app:Fs,cpu:pn(N),memory:N,since:mc.fields.since,step:mc.fields.step});var hc=class extends Pn(`Sample`)({...mc.fields,apps:pn(En(F(pc)))}){};O({...ce(hc.fields,[`apps`,`since`,`step`]),apps:Gt(F(fc))});var gc=O({mount:z,total:N,used:N}),_c=P([`linux`,`darwin`]),vc=O({disks:F(gc),error:Vs,load:F(N),platform:V(_c),samples:F(hc.json),stale:I,time:js,worker:Q});P([`apps`,`disks`,`sample`,`save`]),O({"Anonymous pages":L,"Pages occupied by compressor":L,"Pages purgeable":L,"Pages wired down":L});var yc=class extends Pn(`Exposure`)({hostname:z.check(ie(253),Ce(/^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u)),kind:P([`tailnet`,`public`]),name:Bs.check(me(),ie(260)),owner:pn(z),port:M.check(Be({maximum:65535,minimum:1024})),state:P([`active`,`removing`])}){static table=`exposures`},bc=O({...ye(yc.fields,[`hostname`,`kind`,`name`,`port`]),publicAccess:I}),xc=O({...bc.fields,worker:Q}),Sc=O({name:Bs,worker:Q}),Cc=class extends gn(R(`metrics.watch`,{error:w([Z,$]),payload:oc,stream:!0,success:F(vc)}),R(`metrics.history`,{error:w([Z,$]),payload:ac,success:vc}),R(`inventory.watch`,{error:w([Z,$]),stream:!0,success:Ys}),R(`inventory.snapshot`,{error:w([Z,$]),success:Ys}),R(`exposures.expose`,{error:w([Z,$]),payload:xc,success:z}).middleware(Vo),R(`exposures.hide`,{error:w([Z,$]),payload:Sc}).middleware(Vo),R(`inventory.run`,{error:w([Z,$]),payload:Zs}).middleware(Vo),R(`exposures.apply`,{error:$,payload:bc,success:z}).middleware(Vo),R(`exposures.remove`,{error:$,payload:O({name:Bs})}).middleware(Vo),R(`inventory.start`,{error:$,payload:Zs.mapFields(e=>ce(e,[`worker`]))}).middleware(Vo)).middleware(Ko){};fs(`@deslop/deploy`);var wc=class extends Lt()(`@deslop/deploy/lib/fleet/RpcClient`,{group:Cc.middleware(rs),protocol:ds}){},Tc=l(et()),Ec=tr(wc.runtime.atom(e=>hs(e,an(vs(wc,`inventory.watch`),t=>B(()=>{ps(t)&&e.set(Tc,et())})),_s))),Dc=wc.runtime.fn((e,t)=>j(wc,dt(t=>t(`exposures.expose`,e)),Et(()=>B(()=>t.set(Tc,et()))))),Oc=$e(xt,(e,t)=>{e.set(Dc,ee),e.set(Tc,oe(t))}),kc=de(e=>wc.runtime.fn(e=>dt(wc,t=>t(`inventory.run`,e)))),Ac=de(e=>ys(wc,`metrics.watch`,e));export{Hr as $,jo as A,_i as B,$o as C,Ho as D,Uo as E,wa as F,ti as G,ui as H,sa as I,Vr as J,ni as K,ca as L,Ao as M,ko as N,Fo as O,Oa as P,Yr as Q,xi as R,ls as S,Wo as T,ei as U,di as V,ii as W,qr as X,Fr as Y,Lr as Z,Ds as _,Oc as a,Dr as at,ms as b,ac as c,xr as ct,Bs as d,G as et,Ps as f,As as g,Os as h,Ac as i,Tr as it,Oo as j,Mo as k,Fs as l,dr as lt,Q as m,Tc as n,Pr as nt,kc as o,Er as ot,Is as p,$r as q,Ec as r,Or as rt,rc as s,Mr as st,Dc as t,Nr as tt,$ as u,ur as ut,Ts as v,Ro as w,us as x,Ss as y,bi as z};
|