1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t,r as n}from"./IconBase.es-DEPGDkbK.js";import{A as r,C as i,D as a,E as o,F as s,I as c,L as l,M as u,O as d,P as f,S as p,T as m,_ as h,b as g,c as _,d as v,f as y,g as b,h as x,j as S,l as C,n as w,o as T,p as E,r as D,t as O,u as ee,v as k,w as te,x as ne,y as re}from"./link-kKWZpcoW.js";import{r as A,t as j}from"./useRouter-DsU0ak02.js";import{a as ie,i as ae,o as M,t as N}from"./redirect-CaDPrkdo.js";function oe(){try{return sessionStorage}catch{return}}var se=`tsr-scroll-restoration-v1_3`,ce=oe();function le(){try{return JSON.parse(ce?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function ue(){try{ce?.setItem(se,JSON.stringify(P))}catch{}}var P=le(),de=`data-scroll-restoration-id`,fe=e=>e.state.__TSR_key||e.href;function pe(e){let t=e.getAttribute(de);if(t)return`[${de}="${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 F=!1,I=`window`;function me(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function he(e){let t=new Set;for(let n of e){if(n===I)continue;let e=me(n);e&&t.add(e)}return t}function ge(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||fe,a=new Set,o=e=>{let t=P[e]||={};for(let e of a)e===document?t[I]={scrollX,scrollY}:e.isConnected&&(t[pe(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,F=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{F||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=P[d];if(e){let t=P[u];for(let n in e){if(n===I){if(s)continue}else{let e=me(n);if(!e||s&&o&&(l??=he(o),l.has(e)))continue}t||=P[u]={},t[n]??=e[n]}}}F=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=he(o));let t=e&&i&&c,s=r.restoring?P[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===I){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=me(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{F=!1}}))}var _e=ye(JSON.parse),ve=be(JSON.stringify,JSON.parse);function ye(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ae(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function be(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ie(e,r);return t?`?${t}`:``}}var xe=`__root__`;function Se(e){return{input:({url:t})=>{for(let n of e)t=we(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Te(e[n],t);return t}}}function Ce(e){let t=E(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=v([`/`,t,e.pathname]),e)}}function we(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 Te(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 Ee(e){let t=e;return{get(){return t},set(e){t=r(e,t)}}}function De(e){return{get(){return e()}}}function Oe(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),m=n(e.location),h=n(e.resolvedLocation),g=n(e.statusCode),_=n(e.redirect),v=n([]),y=n([]),b=n([]),x=r
1(()=>ke(o,v.get())),S=r(()=>ke(s,y.get())),C=r(()=>ke(c,b.get())),w=r(()=>v.get()[0]),T=r(()=>v.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:m.get().href,resolvedLocationHref:h.get()?.href,status:l.get()})),D=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:x.get(),location:m.get(),resolvedLocation:h.get(),statusCode:g.get(),redirect:_.get()})),O=p(64);function ee(e){let t=O.get(e);return t||(t=r(()=>{let t=v.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),O.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:m,resolvedLocation:h,statusCode:g,redirect:_,matchesId:v,pendingIds:y,cachedIds:b,matches:x,pendingMatches:S,cachedMatches:C,firstId:w,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:D,getRouteMatchStore:ee,setMatches:te,setPending:ne,setCached:re};te(e.matches),a?.(k);function te(e){Ae(e,o,v,n,i)}function ne(e){Ae(e,s,y,n,i)}function re(e){Ae(e,c,b,n,i)}return k}function ke(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Ae(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}te(n.get(),a)||n.set(a)})}var je=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Me=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),L=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),R=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);
1i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ne=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},z=(e,t,n)=>{if(!(!N(n)&&!M(n)))throw N(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:N(n)?`redirected`:M(n)?`notFound`:r.status===`pending`?`success`:r.status,context:R(e,t.index),isFetching:!1,error:n})),M(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),N(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Pe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Fe=(e,t,n)=>{let r=R(e,n);e.updateMatch(t,e=>({...e,context:r}))},B=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,z(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,z(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!N(n)&&!M(n)&&(e.serialError??=n)},Ie=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!L(e,t)&&(n.options.loader||n.options.beforeLoad||Ke(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{je(e)},i);r._nonReactive.pendingTimeout=t}},Le=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ie(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&z(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Re=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=m(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&B(e,n,o),s&&B(e,n,s),Ie(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=m();let p={...R(e,n,!1),...i.__routeContext},{search:h,params:g,cause:_}=i,v=L(e,t),y={search:h,abortController:c,params:g,preload:v,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(N(r)||M(r))&&(u(),B(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},x;try{if(x=r.options.beforeLoad(y),f(x))return u(),x.catch(t=>{B(e,n,t)}).then(b)}catch(t){u(),B(e,n,t)}b(x)},ze=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Re(e,n,t,i),s=()=>{if(Pe(e,n))return;let t=Le(e,n,i);return f(t)?t.then(o):o()};return a()},Be=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Ve=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=R(e,r),d=L(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},He=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{V(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Ve(e,t,n,r,i)),l=!!s&&f(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;z(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:R(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>
1({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:R(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,M(t)&&await i.options.notFoundComponent?.preload?.(),z(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,z(e,e.router.getMatch(n),t)}!N(o)&&!M(o)&&await V(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:R(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),z(e,r,t)}},Ue=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Ve(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await He(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){N(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await He(e,t,i,n,d):Fe(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Pe(e,i)){if(!e.router.getMatch(i))return e.matches[n];Fe(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=L(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&z(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=m(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function We(e){let t=e,n=[];Me(t.router)&&je(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ze(t,e);f(n)&&await n}catch(e){if(N(e))throw e;if(M(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ne(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ue(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(N(e))throw e;M(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Ne(t,l);e===void 0&&A();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await V(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await V(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Be(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=je(t);if(f(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ge(e,t){let n=t.map(t=>
1e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function V(e,t=H){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===H?(()=>{if(e._componentsPromise===void 0){let t=Ge(e,H);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ge(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ke(e){for(let t of H)if(e.options[t]?.preload)return!0;return!1}var H=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],U=`__TSR_index`,qe=`popstate`,Je=`beforeunload`;function Ye(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=W(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[U];i=Xe(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[U];i=Xe(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[U]!==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 Xe(e,t){t||={};let n=$e();return{...t,key:n,__TSR_key:n,[U]:e}}function Ze(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??(()=>W(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=$e();t.history.replaceState({[U]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=W(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[U]-l.state[U],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),C.notify(u);return}}}l=c(),C.notify(u)},S=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=``},C=Ye({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,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:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Je,S,{capture:!0}),t.removeEventListener(qe,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Je,S,{capture:!0}),t.addEventListener(qe,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Qe(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function W(e,t){let n=Qe(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=$e();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||{[U]:0,key:a,__TSR_key:a}}}function $e(){return(Math.random()+1).toString(36).substring(7)}function et(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function G(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var tt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=C(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Ze()),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=p(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Oe(rt(this.latestLocation),e),ge(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=E(o);t&&t!==`/`&&e.push(Ce({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Se(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},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&&g(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>
1{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(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),s=this.options.stringifySearch(i);return{href:e+s+r,publicHref:e+s+r,pathname:o(e).path,external:!1,searchStr:s,search:c(t?.search,i),hash:o(r.slice(1)).path,state:l(t?.state,a)}}let s=new URL(i,this.origin),u=we(this.rewrite,s),d=this.options.parseSearch(u.search),f=this.options.stringifySearch(d);return u.search=f,{href:u.href.replace(u.origin,``),publicHref:i,pathname:o(u.pathname).path,external:!!this.rewrite&&u.origin!==this.origin,searchStr:f,search:c(t?.search,d),hash:o(u.hash.slice(1)).path,state:l(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)=>y({base:e,to:t.includes(`//`)?_(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=>it({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(n);t.from;let a=t.unsafeRelative===`path`?n.pathname:t.from??i.fullPath,s=t.to?`${t.to}`:void 0,u=i.search,f=Object.assign(Object.create(null),i.params),p=s?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),m=s?this.resolvePathWithBase(p,s):p,h=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?f:Object.assign(f,r(t.params,f)),g=this.routesByPath[x(m)],_;if(g)_=this.getRouteBranch(g);else if(m.includes(`$`))_=[];else{let e=this.getMatchedRoutes(m);_=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(_=[..._,this.options.notFoundRoute])}if(_.length&&S(h))for(let e of _){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(h,t(h))}catch{}}let v=e.leaveParams?m:o(ee({path:m,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=u;if(e._includeValidateSearch&&this.options.search?.strict){let e={};_.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,q(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=at({search:y,dest:t,destRoutes:_,_includeValidateSearch:e._includeValidateSearch}),y=c(u,y);let b=this.options.stringifySearch(y),C=t.hash===!0?n.hash:t.hash?r(t.hash,n.hash):void 0,w=C?`#${C}`:``,T=t.state===!0?n.state:t.state?r(t.state,n.state):{};T=l(n.state,T);let E=`${v}${b}${w}`,D,O,k=!1;if(this.rewrite){let e=new URL(E,this.origin),t=Te(this.rewrite,e);D=e.href.replace(e.origin,``),t.origin===this.origin?O=t.pathname+t.search+t.hash:(O=t.href,k=!0)}else D=d(E),O=D;return{publicHref:O,href:D,pathname:v,search:y,searchStr:b,state:T,hash:C??``,external:k,unmaskOnReload:t.unmaskOnReload}},n=(n={},i)=>{let a=t(n),o=i?t(i):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=h(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:a,params:c,...l}=s.route,u=c===!1||c===null?Object.create(null):(c??!0)===!0?n:Object.assign(n,r(c,n));i={from:e.from,...l,params:u},o=t(i)}}}return o&&(a.maskedLocation=o),a};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];
1e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=a(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},o=x(this.latestLocation.href)===x(n.href),s=this.commitLocationPromise;if(this.commitLocationPromise=m(()=>{s?.resolve(),s=void 0}),o&&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})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=W(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=we(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},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(u(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.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t&&(this._scroll.hash=t===`PUSH`||t===`REPLACE`);let n=this.latestLocation,r=G(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await We({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){N(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):M(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(G(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>
1{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,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),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}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&&u(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=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??3e5;return t.status===`error`||e-t.updatedAt>=r}})},this.loadRouteChunk=V,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await We({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(N(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});M(e)||console.error(e);return}},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);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!o||e.params&&!a(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?a(i.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ve,parseSearch:e.parseSearch??_e,protocolAllowlist:e.protocolAllowlist??i}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}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=b(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParam
1s:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:x(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?st(this.options.notFoundMode,a):void 0,u=Array(a.length),d=new Map;for(let e of this.stores.matchStores.values())e.routeId&&d.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=u[n-1],f,p,h;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=q(r.options.validateSearch,{...n})??void 0;f={...n,...e},p={...i,...e},h=void 0}catch(e){let r=e;if(e instanceof K||(r=new K(e.message,{cause:e})),t?.throwOnError)throw r;f=n,p={},h=r}}let g=r.options.loaderDeps?.({search:f})??``,_=g?JSON.stringify(g):``,{interpolatedPath:v,usedParams:y}=ee({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+v+_,x=this.getMatch(b),S=d.get(r.id),C=x?._strictParams??y,w;if(!x)try{ct(r,C)}catch(e){if(w=M(e)||N(e)?e:new nt(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(i,C);let T=S?`stay`:`enter`,E;if(x)E={...x,cause:T,params:S?.params??i,_strictParams:C,search:c(S?S.search:x.search,f),_strictSearch:p};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ke(r)?`pending`:`success`;E={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??i,_strictParams:C,pathname:v,updatedAt:Date.now(),search:S?c(S.search,f):f,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:m()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:T,loaderDeps:S?l(S.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(E.globalNotFound=s===r.id),E.searchError=h;let D=this.getParentContext(o);E.context={...D,...E.__routeContext,...E.__beforeLoadContext},u[n]=E}for(let t=0;t<u.length;t++){let n=u[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=d.get(n.routeId);if(n.params=o?c(o.params,i):i,!a){let i=u[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:u,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return u}matchRoutesLightweight(e){let t=s(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=s(r),o={...e.search};for(let e of r)try{Object.assign(o,q(e.options.validateSearch,o))}catch{}let c=t&&this.stores.matchStores.get(t)?.get(),l=c&&c.routeId===a.id&&c.pathname===e.pathname,u;if(l)u=c.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{ct(t,e)}catch{}u=e}let d={matchedRoutes:r,fullPath:a.fullPath,search:o,params:u};return this.lightweightCache.set(e,[t,d]),d}},K=class extends Error{},nt=class extends Error{};function rt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function q(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new K(`Async validation not supported`);if(n.issues)throw new K(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 it({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=x(e),a,o=k(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function at({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ot(n)(e,t,r??!1)}function ot(e){let t,n,i=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&i.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&i.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>
1t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let r=e.validateSearch;r&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(n)try{let e=q(r,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,o)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=r(t.search,n);return o&&(o.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=o||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,o)},meta:o})};return function(e,r,i){return t=r,n=i,a(0,e)}}function st(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return xe}function ct(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var J=e(n(),1),Y=t();function lt(e){let t=e.errorComponent??dt;return(0,Y.jsx)(ut,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?J.createElement(t,{error:n,reset:r}):e.children})}var ut=class extends J.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function dt({error:e}){let[t,n]=J.useState(!1);return(0,Y.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Y.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Y.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,Y.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Y.jsx)(`code`,{children:e.message}):null})}):null]})}var X=J.createContext(void 0),ft=J.createContext(void 0),pt={get(){},subscribe(){return{unsubscribe(){}}}};function mt(e,t){let n=J.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=l(n.current,i):i}}function ht(e){let t=j(),n=J.useContext(e.from?ft:X),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=mt(e,t),a=w(r??pt,e=>e?i(e):pt);if(a!==pt)return a;(e.shouldThrow??!0)&&A()}function gt(e){return ht({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 Z(e){let t=j();return J.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function _t(e){let t=j(),n=Z(),r=J.useRef(null);return T(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function vt(e){let t=j(),n=`not-found-${w(t.stores.location,e=>e.pathname)}-${w(t.stores.status,e=>e)}`;return(0,Y.jsx)(lt,{getResetKey:()=>n,onCatch:(t,n)=>{if(M(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(M(t))return e.fallback?.(t);throw t},children:e.children})}function yt(){return(0,Y.jsx)(`p`,{children:`Not Found`})}function Q(e){return(0,Y.jsx)(Y.Fragment,{children:e.children})}function bt(e,t,n){return t.options.notFoundComponent?(0,Y.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Y.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Y.jsx)(yt,{})}var xt=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,St=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ct=J.memo(function({matchId:e}){let t=j(),n=t.stores.matchStores.get(e);n||A();let r=w(t.stores.loadedAt,e=>e),i=w(n,e=>e,xt);return(0,Y.jsx)(wt,{router:t,matchId:e,resetKey:r,matchState:J.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});
1function wt({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Y.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?J.Suspense:Q,f=s?lt:Q,p=l?vt:Q;return(0,Y.jsxs)(i.isRoot?i.options.shellComponent??Q:Q,{children:[(0,Y.jsx)(X.Provider,{value:t,children:(0,Y.jsx)(d,{fallback:o,children:(0,Y.jsx)(f,{getResetKey:()=>n,errorComponent:s||dt,onCatch:(e,t)=>{if(M(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Y.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return J.createElement(l,e)},children:u||r._displayPending?(0,Y.jsx)(D,{fallback:o,children:(0,Y.jsx)(Et,{matchId:t})}):(0,Y.jsx)(Et,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Tt,{}),(e.options.scrollRestoration,null)]}):null]})}function Tt(){let e=j(),t=J.useRef();return T(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...G(e.stores.location.get(),r??n)}),t.current=n},[w(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Et=J.memo(function({matchId:e}){let t=j(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||A();let i=w(r,e=>e),a=i.routeId,o=t.routesById[a],s=J.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=J.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,Y.jsx)(e,{},s):(0,Y.jsx)($,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=m();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return M(i.error)||A(),bt(t,o,i.error);if(i.status===`redirected`)throw N(i.error)||A(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),$=J.memo(function(){let e=j(),t=J.useContext(X),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=w(a,e=>[e?.routeId,e?.globalNotFound??!1],St),i=w(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Y.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||A(),bt(e,a,void 0);if(!i)return null;let s=(0,Y.jsx)(Ct,{matchId:i});return n===`__root__`?(0,Y.jsx)(J.Suspense,{fallback:o,children:s}):s});function Dt(e){let t=j();return w(t.stores.location,mt(e,t))}function Ot(e){let[t,n]=(e??``).split(`#`),[r,i]=t.split(`?`);return{pathname:r||`.`,search:i?Object.fromEntries(new URLSearchParams(i)):void 0,hash:n||void 0}}function kt(){let e=Z(),t=j();return(0,J.useCallback)((n,r)=>{if(typeof n==`number`){t.history.go(n);return}let{pathname:i,search:a,hash:o}=Ot(n);e({to:i,search:a,hash:o,state:r?.state,replace:r?.replace})},[e,t])}function At(){let e=Dt();return(0,J.useMemo)(()=>({pathname:e.pathname,search:e.searchStr?`?${e.searchStr}`:``,hash:e.hash??``,state:e.state??null,key:e.pathname+(e.searchStr??``)}),[e.pathname,e.searchStr,e.hash,e.state])}function jt(){return gt({strict:!1})}function Mt(){let e=Dt(),t=Z(),n=j();return[(0,J.useMemo)(()=>new URLSearchParams(e.searchStr??``),[e.searchStr]),(0,J.useCallback)((e,r)=>{let i=n.state.location,a=new URLSearchParams(i.searchStr??``),o=typeof e==`function`?e(a):e instanceof URLSearchParams?e:new URLSearchParams(e),s={};o.forEach((e,t)=>{s[t]=e}),t({to:i.pathname,search:s,replace:r?.replace})},[t,n])]}var Nt=(0,J.forwardRef)(function({to:e,replace:t,state:n,children:r,...i},a){let{pathname:o,search:s,hash:c}=Ot(e);return(0,Y.jsx)(O,{ref:a,to:o,search:s,hash:c,replace:t,state:n,...i??{},children:r})});function Pt({to:e,replace:t,state:n}){let{pathname:r,search:i,hash:a}=Ot(e);return(0,Y.jsx)(_t,{to:r,search:i,hash:a,state:n,replace:t})}var Ft=$;export{xe as C,De as S,dt as _,kt as a,G as b,Ct as c,Z as d,gt as f,lt as g,X as h,At as i,$ as l,mt as m,Pt as n,jt as o,ht as p,Ft as r,Mt as s,Nt as t,Q as u,tt as v,Ee as x,et as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.