import{r as t,j as e,R as o,w as s,a as n}from"./vendor-react-RSDKEZ60.js";const r=new WeakMap,i=new WeakMap,a={current:[]};let c=!1,l=0;const u=new Set,h=new Map;function d(t){const e=Array.from(t).sort((t,e)=>t instanceof y&&t.options.deps.includes(e)?1:e instanceof y&&e.options.deps.includes(t)?-1:0);for(const o of e){if(a.current.includes(o))continue;a.current.push(o),o.recompute();const t=i.get(o);if(t)for(const e of t){const t=r.get(e);t&&d(t)}}}function p(t){const e={prevVal:t.prevState,currentVal:t.state};for(const o of t.listeners)o(e)}function f(t){const e={prevVal:t.prevState,currentVal:t.state};for(const o of t.listeners)o(e)}function m(t){if(l>0&&!h.has(t)&&h.set(t,t.prevState),u.add(t),!(l>0||c))try{for(c=!0;u.size>0;){const t=Array.from(u);u.clear();for(const e of t){const t=h.get(e)??e.prevState;e.prevState=t,p(e)}for(const e of t){const t=r.get(e);t&&(a.current.push(e),d(t))}for(const e of t){const t=r.get(e);if(t)for(const e of t)f(e)}}}finally{c=!1,a.current=[],h.clear()}}class g{constructor(t,e){this.listeners=new Set,this.subscribe=t=>{var e,o;this.listeners.add(t);const s=null==(o=null==(e=this.options)?void 0:e.onSubscribe)?void 0:o.call(e,t,this);return()=>{this.listeners.delete(t),null==s||s()}},this.prevState=t,this.state=t,this.options=e}setState(t){var e,o,s;this.prevState=this.state,(null==(e=this.options)?void 0:e.updateFn)?this.state=this.options.updateFn(this.prevState)(t):!function(t){return"function"==typeof t}(t)?this.state=t:this.state=t(this.prevState),null==(s=null==(o=this.options)?void 0:o.onUpdate)||s.call(o),m(this)}}class y{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const t=this.options.deps.length,e=new Array(t),o=new Array(t);for(let s=0;s<t;s++){const t=this.options.deps[s];e[s]=t.prevState,o[s]=t.state}return this.lastSeenDepValues=o,{prevDepVals:e,currDepVals:o,prevVal:this.prevState??void 0}},this.recompute=()=>{var t,e;this.prevState=this.state;const o=this.getDepVals();this.state=this.options.fn(o),null==(e=(t=this.options).onUpdate)||e.call(t)},this.checkIfRecalculationNeededDeeply=()=>{for(const s of this.options.deps)s instanceof y&&s.checkIfRecalculationNeededDeeply();let t=!1;const e=this.lastSeenDepValues,{currDepVals:o}=this.getDepVals();for(let s=0;s<o.length;s++)if(o[s]!==e[s]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const t of this._subscriptions)t()}),this.subscribe=t=>{var e,o;this.listeners.add(t);const s=null==(o=(e=this.options).onSubscribe)?void 0:o.call(e,t,this);return()=>{this.listeners.delete(t),null==s||s()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const e of t)if(e instanceof y)e.registerOnGraph(),this.registerOnGraph(e.options.deps);else if(e instanceof g){let t=r.get(e);t||(t=new Set,r.set(e,t)),t.add(this);let o=i.get(this);o||(o=new Set,i.set(this,o)),o.add(e)}}unregisterFromGraph(t=this.options.deps){for(const e of t)if(e instanceof y)this.unregisterFromGraph(e.options.deps);else if(e instanceof g){const t=r.get(e);t&&t.delete(this);const o=i.get(this);o&&o.delete(e)}}}const v="__TSR_index",w="popstate",S="beforeunload";function _(t,e){e||(e={});const o=b();return{...e,key:o,__TSR_key:o,[v]:t}}function P(t){const e="undefined"!=typeof document?window:void 0,o=e.history.pushState,s=e.history.replaceState;let n=[];const r=()=>n,i=()=>x(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state);if(!e.history.state?.__TSR_key&&!e.history.state?.key){const t=b();e.history.replaceState({[v]:0,key:t,__TSR_key:t},"")}let a,c=i(),l=!1,u=!1,h=!1,d=!1;let p,f;const m=()=>{p&&(L._ignoreSubscribers=!0,(p.isPush?e.history.pushState:e.history.replaceState)(p.state,"",p.href),L._ignoreSubscribers=!1,p=void 0,f=void 0,a=void 0)},g=(t,e,o)=>{const s=e;f||(a=c),c=x(e,o),p={href:s,state:o,isPush:p?.isPush||"push"===t},f||(f=Promise.resolve().then(()=>m()))},y=t=>{c=i(),L.notify({type:t})},P=async()=>{if(u)return void(u=!1);const t=i(),o=t.state[v]-c.state[v],s=-1===o,n=!(1===o)&&!s||l;l=!1;const a=n?"GO":s?"BACK":"FORWARD",d=n?{type:"GO",index:o}:{type:s?"BACK":"FORWARD"};if(h)h=!1;else{const o=r();if("undefined"!=typeof document&&o.length)for(const s of o){if(await s.blockerFn({currentLocation:c,nextLocation:t,action:a}))return u=!0,e.history.go(1),void L.notify(d)}}c=i(),L.notify(d)},R=t=>{if(d)return void(d=!1);let e=!1;const o=r();if("undefined"!=typeof document&&o.length)for(const s of o){const t=s.enableBeforeUnload??!0;if(!0===t){e=!0;break}if("function"==typeof t&&!0===t()){e=!0;break}}return e?(t.preventDefault(),t.returnValue=""):void 0},L=function(t){let e=t.getLocation();const o=new Set,s=s=>{e=t.getLocation(),o.forEach(t=>t({location:e,action:s}))},n=o=>{t.notifyOnIndexChange??1?s(o):e=t.getLocation()},r=async({task:o,navigateOpts:s,...n})=>{if(s?.ignoreBlocker)return void o();const r=t.getBlockers?.()??[],i="PUSH"===n.type||"REPLACE"===n.type;if("undefined"!=typeof document&&r.length&&i)for(const a of r){const o=x(n.path,n.state);if(await a.blockerFn({currentLocation:e,nextLocation:o,action:n.type}))return void t.onBlocked?.()}o()};return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(o,n,i)=>{const a=e.state[v];n=_(a+1,n),r({task:()=>{t.pushState(o,n),s({type:"PUSH"})},navigateOpts:i,type:"PUSH",path:o,state:n})},replace:(o,n,i)=>{const a=e.state[v];n=_(a,n),r({task:()=>{t.replaceState(o,n),s({type:"REPLACE"})},navigateOpts:i,type:"REPLACE",path:o,state:n})},go:(e,o)=>{r({task:()=>{t.go(e),n({type:"GO",index:e})},navigateOpts:o,type:"GO"})},back:e=>{r({task:()=>{t.back(e?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:e,type:"BACK"})},forward:e=>{r({task:()=>{t.forward(e?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:e,type:"FORWARD"})},canGoBack:()=>0!==e.state[v],createHref:e=>t.createHref(e),block:e=>{if(!t.setBlockers)return()=>{};const o=t.getBlockers?.()??[];return t.setBlockers([...o,e]),()=>{const o=t.getBlockers?.()??[];t.setBlockers?.(o.filter(t=>t!==e))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}({getLocation:()=>c,getLength:()=>e.history.length,pushState:(t,e)=>g("push",t,e),replaceState:(t,e)=>g("replace",t,e),back:t=>(t&&(h=!0),d=!0,e.history.back()),forward:t=>{t&&(h=!0),d=!0,e.history.forward()},go:t=>{l=!0,e.history.go(t)},createHref:t=>t,flush:m,destroy:()=>{e.history.pushState=o,e.history.replaceState=s,e.removeEventListener(S,R,{capture:!0}),e.removeEventListener(w,P)},onBlocked:()=>{a&&c!==a&&(c=a)},getBlockers:r,setBlockers:t=>n=t,notifyOnIndexChange:!1});return e.addEventListener(S,R,{capture:!0}),e.addEventListener(w,P),e.history.pushState=function(...t){const s=o.apply(e.history,t);return L._ignoreSubscribers||y("PUSH"),s},e.history.replaceState=function(...t){const o=s.apply(e.history,t);return L._ignoreSubscribers||y("REPLACE"),o},L}function x(t,e){const o=function(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}(t),s=o.indexOf("#"),n=o.indexOf("?"),r=b();return{href:o,pathname:o.substring(0,s>0?n>0?Math.min(s,n):s:n>0?n:o.length),hash:s>-1?o.substring(s):"",search:n>-1?o.slice(n,-1===s?void 0:s):"",state:e||{[v]:0,key:r,__TSR_key:r}}}function b(){return(Math.random()+1).toString(36).substring(7)}function R(t){let e;return function(t){l++;try{t()}finally{if(l--,0===l){const t=u.values().next().value;t&&m(t)}}}(()=>{e=t()}),e}function L(t){return t[t.length-1]}function C(t,e){return"function"==typeof t?t(e):t}const k=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;function I(t,e,o=0){if(t===e)return t;if(o>500)return e;const s=e,n=E(t)&&E(s);if(!(n||O(t)&&O(s)))return s;const r=n?t:T(t);if(!r)return s;const i=n?s:T(s);if(!i)return s;const a=r.length,c=i.length,l=n?new Array(c):{};let u=0;for(let h=0;h<c;h++){const e=n?h:i[h],r=t[e],c=s[e];if(r===c){l[e]=r,(n?h<a:k.call(t,e))&&u++;continue}if(null===r||null===c||"object"!=typeof r||"object"!=typeof c){l[e]=c;continue}const d=I(r,c,o+1);l[e]=d,d===r&&u++}return a===c&&u===a?t:l}function T(t){const e=Object.getOwnPropertyNames(t);for(const n of e)if(!M.call(t,n))return!1;const o=Object.getOwnPropertySymbols(t);if(0===o.length)return e;const s=e;for(const n of o){if(!M.call(t,n))return!1;s.push(n)}return s}function O(t){if(!j(t))return!1;const e=t.constructor;if(void 0===e)return!0;const o=e.prototype;return!!j(o)&&!!o.hasOwnProperty("isPrototypeOf")}function j(t){return"[object Object]"===Object.prototype.toString.call(t)}function E(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function F(t,e,o){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let s=0,n=t.length;s<n;s++)if(!F(t[s],e[s],o))return!1;return!0}if(O(t)&&O(e)){const s=o?.ignoreUndefined??!0;if(o?.partial){for(const n in e)if(!(s&&void 0===e[n]||F(t[n],e[n],o)))return!1;return!0}let n=0;if(s)for(const e in t)void 0!==t[e]&&n++;else n=Object.keys(t).length;let r=0;for(const i in e)if((!s||void 0!==e[i])&&(r++,r>n||!F(t[i],e[i],o)))return!1;return n===r}return!1}function A(t){let e,o;const s=new Promise((t,s)=>{e=t,o=s});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,e(o),t?.(o)},s.reject=t=>{s.status="rejected",o(t)},s}function B(t){return Boolean(t&&"object"==typeof t&&"function"==typeof t.then)}function D(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return function(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}(e)}const V=["http:","https:","mailto:","tel:"];function $(t,e){if(!t)return!1;try{const o=new URL(t);return!e.has(o.protocol)}catch{return!1}}const N={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},U=/[&><\u2028\u2029]/g;function W(t){return t.replace(U,t=>N[t])}function H(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let o,s=0,n="";for(;null!==(o=e.exec(t));)n+=D(t.slice(s,o.index))+o[0],s=e.lastIndex;n+=D(s?t.slice(s):t);let r=!1;return n.startsWith("//")&&(r=!0,n="/"+n.replace(/^\/+/,"")),{path:n,handledProtocolRelativeURL:r}}function z(t,e){if(!t)throw new Error("Invariant failed")}function K(t){const e=new Map;let o,s;const n=t=>{t.next&&(t.prev?(t.prev.next=t.next,t.next.prev=t.prev,t.next=void 0,s&&(s.next=t,t.prev=s)):(t.next.prev=void 0,o=t.next,t.next=void 0,s&&(t.prev=s,s.next=t)),s=t)};return{get(t){const o=e.get(t);if(o)return n(o),o.value},set(r,i){if(e.size>=t&&o){const t=o;e.delete(t.key),t.next&&(o=t.next,t.next.prev=void 0),t===s&&(s=void 0)}const a=e.get(r);if(a)a.value=i,n(a);else{const t={key:r,value:i,prev:s};s&&(s.next=t),s=t,o||(o=t),e.set(r,t)}},clear(){e.clear(),o=void 0,s=void 0}}}function G(t,e,o=new Uint16Array(6)){const s=t.indexOf("/",e),n=-1===s?t.length:s,r=t.substring(e,n);if(!r||!r.includes("$"))return o[0]=0,o[1]=e,o[2]=e,o[3]=n,o[4]=n,o[5]=n,o;if("$"===r){const s=t.length;return o[0]=2,o[1]=e,o[2]=e,o[3]=s,o[4]=s,o[5]=s,o}if(36===r.charCodeAt(0))return o[0]=1,o[1]=e,o[2]=e+1,o[3]=n,o[4]=n,o[5]=n,o;const i=function(t){const e=t.indexOf("{");if(-1===e)return null;const o=t.indexOf("}",e);return-1===o||e+1>=t.length?null:[e,o]}(r);if(i){const[s,a]=i,c=r.charCodeAt(s+1);if(45===c){if(s+2<r.length&&36===r.charCodeAt(s+2)){const t=s+3,r=a;if(t<r)return o[0]=3,o[1]=e+s,o[2]=e+t,o[3]=e+r,o[4]=e+a+1,o[5]=n,o}}else if(36===c){const r=s+1,i=s+2;return i===a?(o[0]=2,o[1]=e+s,o[2]=e+r,o[3]=e+i,o[4]=e+a+1,o[5]=t.length,o):(o[0]=1,o[1]=e+s,o[2]=e+i,o[3]=e+a,o[4]=e+a+1,o[5]=n,o)}}return o[0]=0,o[1]=e,o[2]=e,o[3]=n,o[4]=n,o[5]=n,o}function J(t,e,o,s,n,r,i){i?.(o);let a=s;{const s=o.fullPath??o.from,i=s.length,c=o.options?.caseSensitive??t,l=!(!o.options?.params?.parse||!o.options?.skipRouteOnParseError?.params);for(;a<i;){const t=G(s,a,e);let i;const u=a,h=t[5];a=h+1,r++;switch(t[0]){case 0:{const e=s.substring(t[2],t[3]);if(c){const t=n.static?.get(e);if(t)i=t;else{n.static??=new Map;const t=Y(o.fullPath??o.from);t.parent=n,t.depth=r,i=t,n.static.set(e,t)}}else{const t=e.toLowerCase(),s=n.staticInsensitive?.get(t);if(s)i=s;else{n.staticInsensitive??=new Map;const e=Y(o.fullPath??o.from);e.parent=n,e.depth=r,i=e,n.staticInsensitive.set(t,e)}}break}case 1:{const e=s.substring(u,t[1]),a=s.substring(t[4],h),d=c&&!(!e&&!a),p=e?d?e:e.toLowerCase():void 0,f=a?d?a:a.toLowerCase():void 0,m=!l&&n.dynamic?.find(t=>!t.skipOnParamError&&t.caseSensitive===d&&t.prefix===p&&t.suffix===f);if(m)i=m;else{const t=Z(1,o.fullPath??o.from,d,p,f);i=t,t.depth=r,t.parent=n,n.dynamic??=[],n.dynamic.push(t)}break}case 3:{const e=s.substring(u,t[1]),a=s.substring(t[4],h),d=c&&!(!e&&!a),p=e?d?e:e.toLowerCase():void 0,f=a?d?a:a.toLowerCase():void 0,m=!l&&n.optional?.find(t=>!t.skipOnParamError&&t.caseSensitive===d&&t.prefix===p&&t.suffix===f);if(m)i=m;else{const t=Z(3,o.fullPath??o.from,d,p,f);i=t,t.parent=n,t.depth=r,n.optional??=[],n.optional.push(t)}break}case 2:{const e=s.substring(u,t[1]),a=s.substring(t[4],h),l=c&&!(!e&&!a),d=e?l?e:e.toLowerCase():void 0,p=a?l?a:a.toLowerCase():void 0,f=Z(2,o.fullPath??o.from,l,d,p);i=f,f.parent=n,f.depth=r,n.wildcard??=[],n.wildcard.push(f)}}n=i}if(l&&o.children&&!o.isRoot&&o.id&&95===o.id.charCodeAt(o.id.lastIndexOf("/")+1)){const t=Y(o.fullPath??o.from);t.kind=5,t.parent=n,r++,t.depth=r,n.pathless??=[],n.pathless.push(t),n=t}const u=(o.path||!o.children)&&!o.isRoot;if(u&&s.endsWith("/")){const t=Y(o.fullPath??o.from);t.kind=4,t.parent=n,r++,t.depth=r,n.index=t,n=t}n.parse=o.options?.params?.parse??null,n.skipOnParamError=l,n.parsingPriority=o.options?.skipRouteOnParseError?.priority??0,u&&!n.route&&(n.route=o,n.fullPath=o.fullPath??o.from)}if(o.children)for(const c of o.children)J(t,e,c,a,n,r,i)}function X(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function q(t){if(t.pathless)for(const e of t.pathless)q(e);if(t.static)for(const e of t.static.values())q(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())q(e);if(t.dynamic?.length){t.dynamic.sort(X);for(const e of t.dynamic)q(e)}if(t.optional?.length){t.optional.sort(X);for(const e of t.optional)q(e)}if(t.wildcard?.length){t.wildcard.sort(X);for(const e of t.wildcard)q(e)}}function Y(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Z(t,e,o,s,n){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:o,prefix:s,suffix:n}}function Q(t,e,o=!1){const s=t.split("/"),n=function(t,e,o,s){if("/"===t&&o.index)return{node:o.index,skipped:0};const n=!L(e),r=n&&"/"!==t,i=e.length-(n?1:0),a=[{node:o,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,u=null;for(;a.length;){const o=a.pop(),{node:n,index:h,skipped:d,depth:p,statics:f,dynamics:m,optionals:g}=o;let{extract:y,rawParams:v,parsedParams:w}=o;if(n.skipOnParamError){if(!et(t,e,o))continue;v=o.rawParams,y=o.extract,w=o.parsedParams}s&&n.route&&4!==n.kind&&ot(l,o)&&(l=o);const S=h===i;if(S&&(n.route&&!r&&ot(u,o)&&(u=o),!(n.optional||n.wildcard||n.index||n.pathless)))continue;const _=S?void 0:e[h];let P;if(S&&n.index){const o={node:n.index,index:h,skipped:d,depth:p+1,statics:f,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w};let s=!0;if(n.index.skipOnParamError){et(t,e,o)||(s=!1)}if(s){if(f===i&&!m&&!g&&!d)return o;ot(u,o)&&(u=o)}}if(n.wildcard&&ot(c,o))for(const s of n.wildcard){const{prefix:o,suffix:n}=s;if(o){if(S)continue;if(!(s.caseSensitive?_:P??=_.toLowerCase()).startsWith(o))continue}if(n){if(S)continue;const t=e.slice(h).join("/").slice(-n.length);if((s.caseSensitive?t:t.toLowerCase())!==n)continue}const r={node:s,index:i,skipped:d,depth:p,statics:f,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w};if(s.skipOnParamError){if(!et(t,e,r))continue}c=r;break}if(n.optional){const t=d|1<<p,e=p+1;for(let o=n.optional.length-1;o>=0;o--){const s=n.optional[o];a.push({node:s,index:h,skipped:t,depth:e,statics:f,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w})}if(!S)for(let o=n.optional.length-1;o>=0;o--){const t=n.optional[o],{prefix:s,suffix:r}=t;if(s||r){const e=t.caseSensitive?_:P??=_.toLowerCase();if(s&&!e.startsWith(s))continue;if(r&&!e.endsWith(r))continue}a.push({node:t,index:h+1,skipped:d,depth:e,statics:f,dynamics:m,optionals:g+1,extract:y,rawParams:v,parsedParams:w})}}if(!S&&n.dynamic&&_)for(let t=n.dynamic.length-1;t>=0;t--){const e=n.dynamic[t],{prefix:o,suffix:s}=e;if(o||s){const t=e.caseSensitive?_:P??=_.toLowerCase();if(o&&!t.startsWith(o))continue;if(s&&!t.endsWith(s))continue}a.push({node:e,index:h+1,skipped:d,depth:p+1,statics:f,dynamics:m+1,optionals:g,extract:y,rawParams:v,parsedParams:w})}if(!S&&n.staticInsensitive){const t=n.staticInsensitive.get(P??=_.toLowerCase());t&&a.push({node:t,index:h+1,skipped:d,depth:p+1,statics:f+1,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w})}if(!S&&n.static){const t=n.static.get(_);t&&a.push({node:t,index:h+1,skipped:d,depth:p+1,statics:f+1,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w})}if(n.pathless){const t=p+1;for(let e=n.pathless.length-1;e>=0;e--){const o=n.pathless[e];a.push({node:o,index:h,skipped:d,depth:t,statics:f,dynamics:m,optionals:g,extract:y,rawParams:v,parsedParams:w})}}}if(u&&c)return ot(c,u)?u:c;if(u)return u;if(c)return c;if(s&&l){let o=l.index;for(let t=0;t<l.index;t++)o+=e[t].length;const s=o===t.length?"/":t.slice(o);return l.rawParams??={},l.rawParams["**"]=decodeURIComponent(s),l}return null}(t,s,e,o);if(!n)return null;const[r]=tt(t,s,n);return{route:n.node.route,rawParams:r,parsedParams:n.parsedParams}}function tt(t,e,o){const s=function(t){const e=Array(t.depth+1);do{e[t.depth]=t,t=t.parent}while(t);return e}(o.node);let n=null;const r={};let i=o.extract?.part??0,a=o.extract?.node??0,c=o.extract?.path??0,l=o.extract?.segment??0;for(;a<s.length;i++,a++,c++,l++){const u=s[a];if(4===u.kind)break;if(5===u.kind){l--,i--,c--;continue}const h=e[i],d=c;if(h&&(c+=h.length),1===u.kind){n??=o.node.fullPath.split("/");const t=n[l],e=u.prefix?.length??0;if(123===t.charCodeAt(e)){const o=u.suffix?.length??0,s=t.substring(e+2,t.length-o-1),n=h.substring(e,h.length-o);r[s]=decodeURIComponent(n)}else{r[t.substring(1)]=decodeURIComponent(h)}}else if(3===u.kind){if(o.skipped&1<<a){i--,c=d-1;continue}n??=o.node.fullPath.split("/");const t=n[l],e=u.prefix?.length??0,s=u.suffix?.length??0,p=t.substring(e+3,t.length-s-1),f=u.suffix||u.prefix?h.substring(e,h.length-s):h;f&&(r[p]=decodeURIComponent(f))}else if(2===u.kind){const e=u,o=t.substring(d+(e.prefix?.length??0),t.length-(e.suffix?.length??0)),s=decodeURIComponent(o);r["*"]=s,r._splat=s;break}}return o.rawParams&&Object.assign(r,o.rawParams),[r,{part:i,node:a,path:c,segment:l}]}function et(t,e,o){try{const[s,n]=tt(t,e,o);o.rawParams=s,o.extract=n;const r=o.node.parse(s);return o.parsedParams=Object.assign({},o.parsedParams,r),!0}catch{return null}}function ot(t,e){return!t||(e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((4===e.node.kind)>(4===t.node.kind)||4===e.node.kind==(4===t.node.kind)&&e.depth>t.depth))))}function st(t){return nt(t.filter(t=>void 0!==t).join("/"))}function nt(t){return t.replace(/\/{2,}/g,"/")}function rt(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function it(t){const e=t.length;return e>1&&"/"===t[e-1]?t.replace(/\/{1,}$/,""):t}function at(t){return it(rt(t))}function ct(t,e){return t?.endsWith("/")&&"/"!==t&&t!==`${e}/`?t.slice(0,-1):t}function lt(t,e,o){const s=e[t];return"string"!=typeof s?s:"_splat"===t?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(t=>ht(t,o)).join("/"):ht(s,o)}function ut({path:t,params:e,decoder:o,...s}){let n=!1;const r={};if(!t||"/"===t)return{interpolatedPath:"/",usedParams:r,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:r,isMissingParams:n};const i=t.length;let a,c=0,l="";for(;c<i;){const s=c;a=G(t,s,a);const i=a[5];if(c=i+1,s===i)continue;const u=a[0];if(0!==u){if(2===u){const c=e._splat;r._splat=c,r["*"]=c;const u=t.substring(s,a[1]),h=t.substring(a[4],i);if(!c){n=!0,(u||h)&&(l+="/"+u+h);continue}l+="/"+u+lt("_splat",e,o)+h;continue}if(1===u){const c=t.substring(a[2],a[3]);n||c in e||(n=!0),r[c]=e[c];const u=t.substring(s,a[1]),h=t.substring(a[4],i);l+="/"+u+(lt(c,e,o)??"undefined")+h;continue}if(3===u){const n=t.substring(a[2],a[3]),c=e[n];if(null==c)continue;r[n]=c;const u=t.substring(s,a[1]),h=t.substring(a[4],i);l+="/"+u+(lt(n,e,o)??"")+h;continue}}else l+="/"+t.substring(s,i)}t.endsWith("/")&&(l+="/");return{usedParams:r,interpolatedPath:l||"/",isMissingParams:n}}function ht(t,e){const o=encodeURIComponent(t);return e?.(o)??o}function dt(t){return!!t?.isNotFound}const pt="tsr-scroll-restoration-v1_3";const ft=function(){const t=function(){try{if("undefined"!=typeof window&&"object"==typeof window.sessionStorage)return window.sessionStorage}catch{}}();if(!t)return null;const e=t.getItem(pt);let o=e?JSON.parse(e):{};return{state:o,set:e=>{o=C(e,o)||o;try{t.setItem(pt,JSON.stringify(o))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}(),mt=t=>t.state.__TSR_key||t.href;let gt=!1;function yt(t,e){if(!ft)return;if((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!ft)return;t.isScrollRestorationSetup=!0,gt=!1;const o=t.options.getScrollRestorationKey||mt;window.history.scrollRestoration="manual";const s=e=>{if(gt||!t.isScrollRestoring)return;let s="";if(e.target===document||e.target===window)s="window";else{const t=e.target.getAttribute("data-scroll-restoration-id");s=t?`[data-scroll-restoration-id="${t}"]`:function(t){const e=[];let o;for(;o=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(o.children,t)+1})`),t=o;return`${e.reverse().join(" > ")}`.toLowerCase()}(e.target)}const n=o(t.state.location);ft.set(t=>{const e=t[n]||={},o=e[s]||={};if("window"===s)o.scrollX=window.scrollX||0,o.scrollY=window.scrollY||0;else if(s){const t=document.querySelector(s);t&&(o.scrollX=t.scrollLeft||0,o.scrollY=t.scrollTop||0)}return t})};"undefined"!=typeof document&&document.addEventListener("scroll",((t,e)=>{let o;return(...s)=>{o||(o=setTimeout(()=>{t(...s),o=null},e))}})(s,100),!0),t.subscribe("onRendered",e=>{const s=o(e.toLocation);if(t.resetNextScroll){if("function"==typeof t.options.scrollRestoration){if(!t.options.scrollRestoration({location:t.latestLocation}))return}!function({storageKey:t,key:e,behavior:o,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(c){return void console.error(c)}const a=i[e||window.history.state?.__TSR_key];gt=!0;t:{if(s&&a&&Object.keys(a).length>0){for(const t in a){const e=a[t];if("window"===t)window.scrollTo({top:e.scrollY,left:e.scrollX,behavior:o});else if(t){const o=document.querySelector(t);o&&(o.scrollLeft=e.scrollX,o.scrollTop=e.scrollY)}}break t}const t=(r??window.location).hash.split("#",2)[1];if(t){const e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){const o=document.getElementById(t);o&&o.scrollIntoView(e)}break t}const e={top:0,left:0,behavior:o};if(window.scrollTo(e),n)for(const o of n){if("window"===o)continue;const t="function"==typeof o?o():document.querySelector(o);t&&t.scrollTo(e)}}gt=!1}({storageKey:pt,key:s,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&ft.set(t=>(t[s]||={},t))}else t.resetNextScroll=!0})}function vt(t){return t?"false"!==t&&("true"===t||(0*+t==0&&+t+""===t?+t:t)):""}const wt=(St=JSON.parse,t=>{"?"===t[0]&&(t=t.substring(1));const e=function(t){const e=new URLSearchParams(t),o={};for(const[s,n]of e.entries()){const t=o[s];null==t?o[s]=vt(n):Array.isArray(t)?t.push(vt(n)):o[s]=[t,vt(n)]}return o}(t);for(const s in e){const t=e[s];if("string"==typeof t)try{e[s]=St(t)}catch(o){}}return e});var St;const _t=function(t,e){const o="function"==typeof e;function s(s){if("object"==typeof s&&null!==s)try{return t(s)}catch(n){}else if(o&&"string"==typeof s)try{return e(s),t(s)}catch(n){}return s}return t=>{const e=function(t,e=String){const o=new URLSearchParams;for(const s in t){const n=t[s];void 0!==n&&o.set(s,e(n))}return o.toString()}(t,s);return e?`?${e}`:""}}(JSON.stringify,JSON.parse);const Pt="__root__";function xt(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&"string"==typeof t.href)try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&null===e.get("Location")&&e.set("Location",t.href);const o=new Response(null,{status:t.statusCode,headers:e});if(o.options=t,t.throw)throw o;return o}function bt(t){return t instanceof Response&&!!t.options}const Rt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Lt=(t,e)=>!(!t.preload||t.router.state.matches.some(t=>t.id===e)),Ct=(t,e,o=!0)=>{const s={...t.router.options.context??{}},n=o?e:e-1;for(let r=0;r<=n;r++){const e=t.matches[r];if(!e)continue;const o=t.router.getMatch(e.id);o&&Object.assign(s,o.__routeContext,o.__beforeLoadContext)}return s},kt=(t,e,o)=>{const s=t.router.routesById[e.routeId??""]??t.router.routeTree;!s.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=t.router.options.defaultNotFoundComponent);const n="BEFORE_LOAD"===o&&s.parentRoute;n||z(s.options.notFoundComponent);const r=t.matches.find(t=>t.routeId===s.id);z(r,s.id),t.updateMatch(r.id,t=>({...t,status:"notFound",error:e,isFetching:!1})),n&&(e.routeId=s.parentRoute.id,kt(t,e,o))},Mt=(t,e,o,s)=>{if(bt(o)||dt(o)){if(bt(o)&&o.redirectHandled&&!o.options.reloadDocument)throw o;if(e){e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const s=bt(o)?"redirected":"notFound";e._nonReactive.error=o,t.updateMatch(e.id,n=>({...n,status:s,context:Ct(t,e.index),isFetching:!1,error:o})),dt(o)&&!o.routeId&&(o.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()}throw bt(o)?(t.rendered=!0,o.options._fromLocation=t.location,o.redirectHandled=!0,o=t.router.resolveRedirect(o)):(kt(t,o,s),o)}},It=(t,e)=>!!t.router.getMatch(e)._nonReactive.dehydrated,Tt=(t,e,o,s)=>{const{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];if(o instanceof Promise)throw o;o.routerCode=s,t.firstBadMatchIndex??=e,Mt(t,t.router.getMatch(n),o,s);try{i.options.onError?.(o)}catch(a){o=a,Mt(t,t.router.getMatch(n),o,s)}t.updateMatch(n,t=>(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loadPromise?.resolve(),{...t,error:o,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Ot=(t,e,o,s)=>{if(void 0!==s._nonReactive.pendingTimeout)return;const n=o.options.pendingMs??t.router.options.defaultPendingMs;if(!(!t.onReady||Lt(t,e)||!(o.options.loader||o.options.beforeLoad||$t(o))||"number"!=typeof n||n===1/0||!(o.options.pendingComponent??t.router.options?.defaultPendingComponent))){const e=setTimeout(()=>{Rt(t)},n);s._nonReactive.pendingTimeout=e}},jt=(t,e)=>{const{id:o,routeId:s}=t.matches[e],n=t.router.looseRoutesById[s],r=()=>((t,e,o,s)=>{const n=t.router.getMatch(e),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=A(()=>{r?.resolve()});const{paramsError:i,searchError:a}=n;i&&Tt(t,o,i,"PARSE_PARAMS"),a&&Tt(t,o,a,"VALIDATE_SEARCH"),Ot(t,e,s,n);const c=new AbortController;let l=!1;const u=()=>{l||(l=!0,t.updateMatch(e,t=>({...t,isFetching:"beforeLoad",fetchCount:t.fetchCount+1,abortController:c})))},h=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,t=>({...t,isFetching:!1}))};if(!s.options.beforeLoad)return void R(()=>{u(),h()});n._nonReactive.beforeLoadPromise=A();const d={...Ct(t,o,!1),...n.__routeContext},{search:p,params:f,cause:m}=n,g=Lt(t,e),y={search:p,abortController:c,params:f,preload:g,context:d,location:t.location,navigate:e=>t.router.navigate({...e,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:g?"preload":m,matches:t.matches,routeId:s.id,...t.router.options.additionalContext},v=s=>{void 0!==s?((bt(s)||dt(s))&&(u(),Tt(t,o,s,"BEFORE_LOAD")),R(()=>{u(),t.updateMatch(e,t=>({...t,__beforeLoadContext:s})),h()})):R(()=>{u(),h()})};let w;try{if(w=s.options.beforeLoad(y),B(w))return u(),w.catch(e=>{Tt(t,o,e,"BEFORE_LOAD")}).then(v)}catch(S){u(),Tt(t,o,S,"BEFORE_LOAD")}v(w)})(t,o,e,n),i=()=>{if(It(t,o))return;const e=((t,e,o)=>{const s=t.router.getMatch(e);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Ot(t,e,o,s);const n=()=>{const o=t.router.getMatch(e);!o.preload||"redirected"!==o.status&&"notFound"!==o.status||Mt(t,o,o.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()})(t,o,n);return B(e)?e.then(r):r()};return i()},Et=(t,e,o)=>{const s=t.router.getMatch(e);if(!s)return;if(!o.options.head&&!o.options.scripts&&!o.options.headers)return;const n={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([o.options.head?.(n),o.options.scripts?.(n),o.options.headers?.(n)]).then(([t,e,o])=>{const s=t?.meta,n=t?.links,r=t?.scripts,i=t?.styles;return{meta:s,links:n,headScripts:r,headers:o,scripts:e,styles:i}})},Ft=(t,e,o,s)=>{const n=t.matchPromises[o-1],{params:r,loaderDeps:i,abortController:a,cause:c}=t.router.getMatch(e),l=Ct(t,o),u=Lt(t,e);return{params:r,deps:i,preload:!!u,parentMatchPromise:n,abortController:a,context:l,location:t.location,navigate:e=>t.router.navigate({...e,_fromLocation:t.location}),cause:u?"preload":c,route:s,...t.router.options.additionalContext}},At=async(t,e,o,s)=>{try{const i=t.router.getMatch(e);try{Vt(s);const n=s.options.loader?.(Ft(t,e,o,s)),r=s.options.loader&&B(n);if(!!(r||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&t.updateMatch(e,t=>({...t,isFetching:"loader"})),s.options.loader){const o=r?await n:n;Mt(t,t.router.getMatch(e),o),void 0!==o&&t.updateMatch(e,t=>({...t,loaderData:o}))}s._lazyPromise&&await s._lazyPromise;const a=i._nonReactive.minPendingPromise;a&&await a,s._componentsPromise&&await s._componentsPromise,t.updateMatch(e,e=>({...e,error:void 0,context:Ct(t,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(n){let a=n;if("AbortError"===a?.name)return i.abortController.signal.aborted?(i._nonReactive.loaderPromise?.resolve(),void(i._nonReactive.loaderPromise=void 0)):void t.updateMatch(e,e=>({...e,status:"pending"===e.status?"success":e.status,isFetching:!1,context:Ct(t,o)}));const c=i._nonReactive.minPendingPromise;c&&await c,dt(n)&&await(s.options.notFoundComponent?.preload?.()),Mt(t,t.router.getMatch(e),n);try{s.options.onError?.(n)}catch(r){a=r,Mt(t,t.router.getMatch(e),r)}t.updateMatch(e,e=>({...e,error:a,context:Ct(t,o),status:"error",isFetching:!1}))}}catch(i){const o=t.router.getMatch(e);o&&(o._nonReactive.loaderPromise=void 0),Mt(t,o,i)}},Bt=async(t,e)=>{async function o(o,n,a,c){const l=Date.now()-n.updatedAt,u=o?c.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??t.router.options.defaultStaleTime??0,h=c.options.shouldReload,d="function"==typeof h?h(Ft(t,s,e,c)):h,{status:p,invalid:f}=a;r="success"===p&&(f||(d??l>u)),o&&!1===c.options.preload||(r&&!t.sync?(i=!0,(async()=>{try{await At(t,s,e,c);const o=t.router.getMatch(s);o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loadPromise?.resolve(),o._nonReactive.loaderPromise=void 0}catch(o){bt(o)&&await t.router.navigate(o.options)}})()):("success"!==p||r&&t.sync)&&await At(t,s,e,c))}const{id:s,routeId:n}=t.matches[e];let r=!1,i=!1;const a=t.router.looseRoutesById[n];if(It(t,s));else{const e=t.router.getMatch(s),n=Lt(t,s);if(e._nonReactive.loaderPromise){if("success"===e.status&&!t.sync&&!e.preload)return e;await e._nonReactive.loaderPromise;const r=t.router.getMatch(s),i=r._nonReactive.error||r.error;i&&Mt(t,r,i),"pending"===r.status&&await o(n,e,r,a)}else{const r=n&&!t.router.state.matches.some(t=>t.id===s),i=t.router.getMatch(s);i._nonReactive.loaderPromise=A(),r!==i.preload&&t.updateMatch(s,t=>({...t,preload:r})),await o(n,e,i,a)}}const c=t.router.getMatch(s);i||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const l=!!i&&c.isFetching;return l!==c.isFetching||!1!==c.invalid?(t.updateMatch(s,t=>({...t,isFetching:l,invalid:!1})),t.router.getMatch(s)):c};async function Dt(t){const e=Object.assign(t,{matchPromises:[]});e.router.state.matches.some(t=>t._forcePending)&&Rt(e);try{for(let o=0;o<e.matches.length;o++){const t=jt(e,o);B(t)&&await t}const t=e.firstBadMatchIndex??e.matches.length;for(let o=0;o<t;o++)e.matchPromises.push(Bt(e,o));const s=(await Promise.allSettled(e.matchPromises)).filter(t=>"rejected"===t.status).map(t=>t.reason);let n;for(const e of s){if(bt(e))throw e;!n&&dt(e)&&(n=e)}for(const i of e.matches){const{id:t,routeId:s}=i,n=e.router.looseRoutesById[s];try{const o=Et(e,t,n);if(o){const s=await o;e.updateMatch(t,t=>({...t,...s}))}}catch(o){console.error(`Error executing head for route ${s}:`,o)}}if(n)throw n;const r=Rt(e);B(r)&&await r}catch(o){if(dt(o)&&!e.preload){const t=Rt(e);throw B(t)&&await t,o}if(bt(o))throw o}return e.matches}async function Vt(t){if(t._lazyLoaded||void 0!==t._lazyPromise||(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:o,...s}=e.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&void 0===t._componentsPromise){const e=()=>{const e=[];for(const o of Nt){const s=t.options[o]?.preload;s&&e.push(s())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function $t(t){for(const e of Nt)if(t.options[e]?.preload)return!0;return!1}const Nt=["component","errorComponent","pendingComponent","notFoundComponent"];function Ut(t,e){const o=t?.input?.({url:e});if(o){if("string"==typeof o)return new URL(o);if(o instanceof URL)return o}return e}function Wt(t,e){const o=t?.output?.({url:e});if(o){if("string"==typeof o)return new URL(o);if(o instanceof URL)return o}return e}function Ht(t){const e=t.resolvedLocation,o=t.location;return{fromLocation:e,toLocation:o,pathChanged:e?.pathname!==o.pathname,hrefChanged:e?.href!==o.href,hashChanged:e?.hash!==o.hash}}class zt{constructor(t){this.tempLocationKey=`${Math.round(1e7*Math.random())}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{t.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const e=this.options,o=this.basepath??e?.basepath??"/",s=void 0===this.basepath,n=e?.rewrite;if(this.options={...e,...t},this.isServer=this.options.isServer??"undefined"==typeof document,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=function(t){const e=new Map(t.map(t=>[encodeURIComponent(t),t])),o=Array.from(e.keys()).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(o,"g");return t=>t.replace(s,t=>e.get(t)??t)}(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=P()),this.origin=this.options.origin,this.origin||(window?.origin&&"null"!==window.origin?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){let t;this.routeTree=this.options.routeTree,this.resolvePathCache=K(1e3),t=this.buildRouteTree(),this.setRoutes(t)}!this.__store&&this.latestLocation&&(this.__store=new g({loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:this.latestLocation,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200},{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(t=>!["redirected"].includes(t.status))}}}),yt(this));let r=!1;const i=this.options.basepath??"/",a=this.options.rewrite;if(s||o!==i||n!==a){this.basepath=i;const t=[],e=at(i);e&&"/"!==e&&t.push(function(t){const e=at(t.basepath),o=`/${e}`,s=`${o}/`,n=t.caseSensitive?o:o.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:e})=>{const s=t.caseSensitive?e.pathname:e.pathname.toLowerCase();return s===n?e.pathname="/":s.startsWith(r)&&(e.pathname=e.pathname.slice(o.length)),e},output:({url:t})=>(t.pathname=st(["/",e,t.pathname]),t)}}({basepath:i})),a&&t.push(a),this.rewrite=0===t.length?void 0:1===t.length?t[0]:function(t){return{input:({url:e})=>{for(const o of t)e=Ut(o,e);return e},output:({url:e})=>{for(let o=t.length-1;o>=0;o--)e=Wt(t[o],e);return e}}}(t),this.history&&this.updateLatestLocation(),r=!0}r&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),"undefined"!=typeof window&&"CSS"in window&&"function"==typeof window.CSS?.supports&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=function(t,e=!1,o){const s=Y(t.fullPath),n=new Uint16Array(6),r={},i={};let a=0;return J(e,n,t,1,s,0,t=>{if(o?.(t,a),z(!(t.id in r),String(t.id)),r[t.id]=t,0!==a&&t.path){const o="/"===(e=t.fullPath)?e:e.replace(/\/{1,}$/,"");i[o]&&!t.fullPath.endsWith("/")||(i[o]=t)}var e;a++}),q(s),{processedTree:{segmentTree:s,singleCache:K(1e3),matchCache:K(1e3),flatCache:null,masksTree:null},routesById:r,routesByPath:i}}(this.routeTree,this.options.caseSensitive,(t,e)=>{t.init({originalIndex:e})});return this.options.routeMasks&&function(t,e){const o=Y("/"),s=new Uint16Array(6);for(const n of t)J(!1,s,n,1,o,0);q(o),e.masksTree=o,e.flatCache=K(1e3)}(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,e)=>{const o={eventType:t,fn:e};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=t=>{this.subscribers.forEach(e=>{e.eventType===t.type&&e.fn(t)})},this.parseLocation=(t,e)=>{const o=({pathname:t,search:o,hash:s,href:n,state:r})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(t)){const i=this.options.parseSearch(o),a=this.options.stringifySearch(i);return{href:t+a+s,publicHref:n,pathname:H(t).path,external:!1,searchStr:a,search:I(e?.search,i),hash:H(s.slice(1)).path,state:I(e?.state,r)}}const i=new URL(n,this.origin),a=Ut(this.rewrite,i),c=this.options.parseSearch(a.search),l=this.options.stringifySearch(c);a.search=l;return{href:a.href.replace(a.origin,""),publicHref:n,pathname:H(a.pathname).path,external:!!this.rewrite&&a.origin!==this.origin,searchStr:l,search:I(e?.search,c),hash:H(a.hash.slice(1)).path,state:I(e?.state,r)}},s=o(t),{__tempLocation:n,__tempKey:r}=s.state;if(n&&(!r||r===this.tempLocationKey)){const t=o(n);return t.state.key=s.state.key,t.state.__TSR_key=s.state.__TSR_key,delete t.state.__tempLocation,{...t,maskedLocation:s}}return s},this.resolvePathWithBase=(t,e)=>function({base:t,to:e,trailingSlash:o="never",cache:s}){const n=e.startsWith("/"),r=!n&&"."===e;let i,a,c;if(s){i=n?e:r?t:t+"\0"+e;const o=s.get(i);if(o)return o}if(r)a=t.split("/");else if(n)a=e.split("/");else{for(a=t.split("/");a.length>1&&""===L(a);)a.pop();const o=e.split("/");for(let t=0,e=o.length;t<e;t++){const s=o[t];""===s?t?t===e-1&&a.push(s):a=[s]:".."===s?a.pop():"."===s||a.push(s)}}a.length>1&&(""===L(a)?"never"===o&&a.pop():"always"===o&&a.push(""));let l="";for(let h=0;h<a.length;h++){h>0&&(l+="/");const t=a[h];if(!t)continue;c=G(t,0,c);const e=c[0];if(0===e){l+=t;continue}const o=c[5],s=t.substring(0,c[1]),n=t.substring(c[4],o),r=t.substring(c[2],c[3]);l+=1===e?s||n?`${s}{$${r}}${n}`:`$${r}`:2===e?s||n?`${s}{$}${n}`:"$":`${s}{-$${r}}${n}`}l=nt(l);const u=l||"/";return i&&s&&s.set(i,u),u}({base:t,to:nt(e),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,e,o)=>"string"==typeof t?this.matchRoutesInternal({pathname:t,search:e},o):this.matchRoutesInternal(t,e),this.getMatchedRoutes=t=>function({pathname:t,routesById:e,processedTree:o}){const s={},n=it(t);let r,i;const a=function(t,e,o=!1){const s=o?t:`nofuzz\0${t}`,n=e.matchCache.get(s);if(void 0!==n)return n;let r;t||="/";try{r=Q(t,e.segmentTree,o)}catch(i){if(!(i instanceof URIError))throw i;r=null}return r&&(r.branch=function(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}(r.route)),e.matchCache.set(s,r),r}(n,o,!0);a&&(r=a.route,Object.assign(s,a.rawParams),i=Object.assign({},a.parsedParams));return{matchedRoutes:a?.branch||[e[Pt]],routeParams:s,foundRoute:r,parsedParams:i}}({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const e=this.getMatch(t);e&&(e.abortController.abort(),clearTimeout(e._nonReactive.pendingTimeout),e._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(t=>"pending"===t.status),e=this.state.matches.filter(t=>"loader"===t.isFetching);new Set([...this.state.pendingMatches??[],...t,...e]).forEach(t=>{this.cancelMatch(t.id)})},this.buildLocation=t=>{const e=(e={})=>{const o=e._fromLocation||this.pendingBuiltLocation||this.latestLocation,s=this.matchRoutesLightweight(o);e.from;const n="path"===e.unsafeRelative?o.pathname:e.from??s.fullPath,r=this.resolvePathWithBase(n,"."),i=s.search,a={...s.params},c=e.to?this.resolvePathWithBase(r,`${e.to}`):this.resolvePathWithBase(r,"."),l=!1===e.params||null===e.params?{}:!0===(e.params??!0)?a:Object.assign(a,C(e.params,a)),u=ut({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,h=this.getMatchedRoutes(u);let d=h.matchedRoutes;(h.foundRoute?"/"!==h.foundRoute.path&&h.routeParams["**"]:it(u))&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]);let p=!1;if(Object.keys(l).length>0)for(const t of d){const e=t.options.params?.stringify??t.options.stringifyParams;e&&(p=!0,Object.assign(l,e(l)))}const f=t.leaveParams?c:H(p?ut({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:u).path;let m=i;if(t._includeValidateSearch&&this.options.search?.strict){const t={};d.forEach(e=>{if(e.options.validateSearch)try{Object.assign(t,Jt(e.options.validateSearch,{...t,...m}))}catch{}}),m=t}m=function({search:t,dest:e,destRoutes:o,_includeValidateSearch:s}){const n=function(t){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const n of t){if("search"in n.options)n.options.search?.middlewares&&e.middlewares.push(...n.options.search.middlewares);else if(n.options.preSearchFilters||n.options.postSearchFilters){const t=({search:t,next:e})=>{let o=t;"preSearchFilters"in n.options&&n.options.preSearchFilters&&(o=n.options.preSearchFilters.reduce((t,e)=>e(t),t));const s=e(o);return"postSearchFilters"in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((t,e)=>e(t),s):s};e.middlewares.push(t)}if(n.options.validateSearch){const t=({search:t,next:o})=>{const s=o(t);if(!e._includeValidateSearch)return s;try{return{...s,...Jt(n.options.validateSearch,s)??void 0}}catch{return s}};e.middlewares.push(t)}}const o=({search:t})=>{const o=e.dest;return o.search?!0===o.search?t:C(o.search,t):{}};e.middlewares.push(o);const s=(t,e,o)=>{if(t>=o.length)return e;return(0,o[t])({search:e,next:e=>s(t+1,e,o)})};return function(t,o,n){return e.dest=o,e._includeValidateSearch=n,s(0,t,e.middlewares)}}(o);return n(t,e,s??!1)}({search:m,dest:e,destRoutes:d,_includeValidateSearch:t._includeValidateSearch}),m=I(i,m);const g=this.options.stringifySearch(m),y=!0===e.hash?o.hash:e.hash?C(e.hash,o.hash):void 0,v=y?`#${y}`:"";let w=!0===e.state?o.state:e.state?C(e.state,o.state):{};w=I(o.state,w);const S=`${f}${g}${v}`;let _,P,x=!1;if(this.rewrite){const t=new URL(S,this.origin),e=Wt(this.rewrite,t);_=t.href.replace(t.origin,""),e.origin!==this.origin?(P=e.href,x=!0):P=e.pathname+e.search+e.hash}else _=/\s|[^\u0000-\u007F]/.test(b=S)?b.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):b,P=_;var b;return{publicHref:P,href:_,pathname:f,search:m,searchStr:g,state:w,hash:y??"",external:x,unmaskOnReload:e.unmaskOnReload}},o=(o={},s)=>{const n=e(o);let r=s?e(s):void 0;if(!r){const o={};if(this.options.routeMasks){const i=function(t,e){t||="/";const o=e.flatCache.get(t);if(o)return o;const s=Q(t,e.masksTree);return e.flatCache.set(t,s),s}(n.pathname,this.processedTree);if(i){Object.assign(o,i.rawParams);const{from:n,params:a,...c}=i.route,l=!1===a||null===a?{}:!0===(a??!0)?o:Object.assign(o,C(a,o));s={from:t.from,...c,params:l},r=e(s)}}}return r&&(n.maskedLocation=r),n};return t.mask?o(t,{from:t.from,...t.mask}):o(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:e,...o})=>{const s=it(this.latestLocation.href)===it(o.href),n=this.commitLocationPromise;if(this.commitLocationPromise=A(()=>{n?.resolve()}),s&&(()=>{const t=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];t.forEach(t=>{o.state[t]=this.latestLocation.state[t]});const e=F(o.state,this.latestLocation.state);return t.forEach(t=>{delete o.state[t]}),e})())this.load();else{let{maskedLocation:s,hashScrollIntoView:n,...r}=o;s&&(r={...s,state:{...s.state,__tempKey:void 0,__tempLocation:{...r,search:r.searchStr,state:{...r.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(r.unmaskOnReload??this.options.unmaskOnReload)&&(r.state.__tempKey=this.tempLocationKey)),r.state.__hashScrollIntoViewOptions=n??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[o.replace?"replace":"push"](r.publicHref,r.state,{ignoreBlocker:e})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:e,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:n,href:r,...i}={})=>{if(r){const e=this.history.location.state.__TSR_index,o=x(r,{__TSR_index:t?e:e+1}),s=new URL(o.pathname,this.origin),n=Ut(this.rewrite,s);i.to=n.pathname,i.search=this.options.parseSearch(o.search),i.hash=o.hash.slice(1)}const a=this.buildLocation({...i,_includeValidateSearch:!0});this.pendingBuiltLocation=a;const c=this.commitLocation({...a,viewTransition:s,replace:t,resetScroll:e,hashScrollIntoView:o,ignoreBlocker:n});return Promise.resolve().then(()=>{this.pendingBuiltLocation===a&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:t,reloadDocument:e,href:o,publicHref:s,...n})=>{let r=!1;if(o)try{new URL(`${o}`),r=!0}catch{}if(r&&!e&&(e=!0),e){if(void 0!==t||!o){const e=this.buildLocation({to:t,...n});o=o??e.publicHref,s=s??e.publicHref}const e=!r&&s?s:o;if($(e,this.protocolAllowlist))return Promise.resolve();if(!n.ignoreBlocker){const t=this.history,e=t.getBlockers?.()??[];for(const o of e)if(o?.blockerFn){if(await o.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}}return n.replace?window.location.replace(e):window.location.href=e,Promise.resolve()}return this.buildAndCommitLocation({...n,href:o,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(e=>({...e,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:e.cachedMatches.filter(e=>!t.some(t=>t.id===e.id))}))},this.load=async t=>{let e,o,s,n;for(s=new Promise(n=>{this.startTransition(async()=>{try{this.beforeLoad();const e=this.latestLocation,o=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ht({resolvedLocation:o,location:e})}),this.emit({type:"onBeforeLoad",...Ht({resolvedLocation:o,location:e})}),await Dt({router:this,sync:t?.sync,matches:this.state.pendingMatches,location:e,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let t=[],e=[],o=[];R(()=>{this.__store.setState(s=>{const n=s.matches,r=s.pendingMatches||s.matches;return t=n.filter(t=>!r.some(e=>e.id===t.id)),e=r.filter(t=>!n.some(e=>e.id===t.id)),o=r.filter(t=>n.some(e=>e.id===t.id)),{...s,isLoading:!1,loadedAt:Date.now(),matches:r,pendingMatches:void 0,cachedMatches:[...s.cachedMatches,...t.filter(t=>"error"!==t.status&&"notFound"!==t.status)]}}),this.clearExpiredCache()}),[[t,"onLeave"],[e,"onEnter"],[o,"onStay"]].forEach(([t,e])=>{t.forEach(t=>{this.looseRoutesById[t.routeId].options[e]?.(t)})})})})}})}catch(r){bt(r)?(e=r,this.navigate({...e.options,replace:!0,ignoreBlocker:!0})):dt(r)&&(o=r),this.__store.setState(t=>({...t,statusCode:e?e.status:o?404:t.matches.some(t=>"error"===t.status)?500:200,redirect:e}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),n()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;this.hasNotFoundMatch()?n=404:this.__store.state.matches.some(t=>"error"===t.status)&&(n=500),void 0!==n&&this.__store.setState(t=>({...t,statusCode:n}))},this.startViewTransition=t=>{const e=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,e&&"undefined"!=typeof document&&"startViewTransition"in document&&"function"==typeof document.startViewTransition){let o;if("object"==typeof e&&this.isViewTransitionTypesSupported){const s=this.latestLocation,n=this.state.resolvedLocation,r="function"==typeof e.types?e.types(Ht({resolvedLocation:n,location:s})):e.types;if(!1===r)return void t();o={update:t,types:r}}else o=t;document.startViewTransition(o)}else t()},this.updateMatch=(t,e)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(e=>e.id===t)?"pendingMatches":this.state.matches.some(e=>e.id===t)?"matches":this.state.cachedMatches.some(e=>e.id===t)?"cachedMatches":"";o&&this.__store.setState(s=>({...s,[o]:s[o]?.map(o=>o.id===t?e(o):o)}))})},this.getMatch=t=>{const e=e=>e.id===t;return this.state.cachedMatches.find(e)??this.state.pendingMatches?.find(e)??this.state.matches.find(e)},this.invalidate=t=>{const e=e=>t?.filter?.(e)??1?{...e,invalid:!0,...t?.forcePending||"error"===e.status||"notFound"===e.status?{status:"pending",error:void 0}:void 0}:e;return this.__store.setState(t=>({...t,matches:t.matches.map(e),cachedMatches:t.cachedMatches.map(e),pendingMatches:t.pendingMatches?.map(e)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const e=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const e=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(e);t.options.href=o,t.headers.set("Location",o)}else if(e)try{const o=new URL(e);if(this.origin&&o.origin===this.origin){const e=o.pathname+o.search+o.hash;t.options.href=e,t.headers.set("Location",e)}}catch{}if(t.options.href&&!t.options._builtLocation&&$(t.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${t.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const e=t?.filter;void 0!==e?this.__store.setState(t=>({...t,cachedMatches:t.cachedMatches.filter(t=>!e(t))})):this.__store.setState(t=>({...t,cachedMatches:[]}))},this.clearExpiredCache=()=>{this.clearCache({filter:t=>{const e=this.looseRoutesById[t.routeId];if(!e.options.loader)return!0;const o=(t.preload?e.options.preloadGcTime??this.options.defaultPreloadGcTime:e.options.gcTime??this.options.defaultGcTime)??3e5;if("error"===t.status)return!0;return Date.now()-t.updatedAt>=o}})},this.loadRouteChunk=Vt,this.preloadRoute=async t=>{const e=this.buildLocation(t);let o=this.matchRoutes(e,{throwOnError:!0,preload:!0,dest:t});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(t=>t.id)),n=new Set([...s,...this.state.cachedMatches.map(t=>t.id)]);R(()=>{o.forEach(t=>{n.has(t.id)||this.__store.setState(e=>({...e,cachedMatches:[...e.cachedMatches,t]}))})});try{return o=await Dt({router:this,matches:o,location:e,preload:!0,updateMatch:(t,e)=>{s.has(t)?o=o.map(o=>o.id===t?e(o):o):this.updateMatch(t,e)}}),o}catch(r){if(bt(r)){if(r.options.reloadDocument)return;return await this.preloadRoute({...r.options,_fromLocation:e})}return void(dt(r)||console.error(r))}},this.matchRoute=(t,e)=>{const o={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},s=this.buildLocation(o);if(e?.pending&&"pending"!==this.state.status)return!1;const n=(void 0===e?.pending?!this.state.isLoading:e.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,r=function(t,e,o,s,n){t||="/",s||="/";const r=e?`case\0${t}`:t;let i=n.singleCache.get(r);i||(i=Y("/"),J(e,new Uint16Array(6),{from:t},1,i,0),n.singleCache.set(r,i));return Q(s,i,o)}(s.pathname,e?.caseSensitive??!1,e?.fuzzy??!1,n.pathname,this.processedTree);return!!r&&(!(t.params&&!F(r.rawParams,t.params,{partial:!0}))&&(e?.includeSearch??1?!!F(n.search,s.search,{partial:!0})&&r.rawParams:r.rawParams))},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>"notFound"===t.status||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??_t,parseSearch:t.parseSearch??wt,protocolAllowlist:t.protocolAllowlist??V}),"undefined"!=typeof document&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:e,processedTree:o}){this.routesById=t,this.routesByPath=e,this.processedTree=o;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}get looseRoutesById(){return this.routesById}getParentContext(t){const e=t?.id;return e?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const o=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:n,parsedParams:r}=o;let{matchedRoutes:i}=o,a=!1;(s?"/"!==s.path&&n["**"]:it(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const c=a?function(t,e){if("root"!==t)for(let o=e.length-1;o>=0;o--){const t=e[o];if(t.children)return t.id}return Pt}(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=new Map(this.state.matches.map(t=>[t.routeId,t]));for(let d=0;d<i.length;d++){const o=i[d],s=l[d-1];let a,p,f;{const n=s?.search??t.search,r=s?._strictSearch??void 0;try{const t=Jt(o.options.validateSearch,{...n})??void 0;a={...n,...t},p={...r,...t},f=void 0}catch(h){let t=h;if(h instanceof Kt||(t=new Kt(h.message,{cause:h})),e?.throwOnError)throw t;a=n,p={},f=t}}const m=o.options.loaderDeps?.({search:a})??"",g=m?JSON.stringify(m):"",{interpolatedPath:y,usedParams:v}=ut({path:o.fullPath,params:n,decoder:this.pathParamsDecoder,server:this.isServer}),w=o.id+y+g,S=this.getMatch(w),_=u.get(o.id),P=S?._strictParams??v;let x;if(!S)try{Xt(o,v,r,P)}catch(h){if(x=dt(h)||bt(h)?h:new Gt(h.message,{cause:h}),e?.throwOnError)throw x}Object.assign(n,P);const b=_?"stay":"enter";let R;if(S)R={...S,cause:b,params:_?.params??n,_strictParams:P,search:I(_?_.search:S.search,a),_strictSearch:p};else{const t=o.options.loader||o.options.beforeLoad||o.lazyFn||$t(o)?"pending":"success";R={id:w,ssr:o.options.ssr,index:d,routeId:o.id,params:_?.params??n,_strictParams:P,pathname:y,updatedAt:Date.now(),search:_?I(_.search,a):a,_strictSearch:p,searchError:void 0,status:t,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:A()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:b,loaderDeps:_?I(_.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:o.options.staticData||{},fullPath:o.fullPath}}e?.preload||(R.globalNotFound=c===o.id),R.searchError=f;const L=this.getParentContext(s);R.context={...L,...R.__routeContext,...R.__beforeLoadContext},l[d]=R}for(let d=0;d<l.length;d++){const e=l[d],o=this.looseRoutesById[e.routeId],s=this.getMatch(e.id),r=u.get(e.routeId);if(e.params=r?I(r.params,n):n,!s){const s=l[d-1],n=this.getParentContext(s);if(o.options.context){const s={deps:e.loaderDeps,params:e.params,context:n??{},location:t,navigate:e=>this.navigate({...e,_fromLocation:t}),buildLocation:this.buildLocation,cause:e.cause,abortController:e.abortController,preload:!!e.preload,matches:l,routeId:o.id};e.__routeContext=o.options.context(s)??void 0}e.context={...n,...e.__routeContext,...e.__beforeLoadContext}}}return l}matchRoutesLightweight(t){const{matchedRoutes:e,routeParams:o,parsedParams:s}=this.getMatchedRoutes(t.pathname),n=L(e),r={...t.search};for(const c of e)try{Object.assign(r,Jt(c.options.validateSearch,r))}catch{}const i=L(this.state.matches);let a;if(i&&i.routeId===n.id&&t.pathname===this.state.location.pathname)a=i.params;else{const t={...o};for(const n of e)try{Xt(n,o,s??{},t)}catch{}a=t}return{matchedRoutes:e,fullPath:n.fullPath,search:r,params:a}}}class Kt extends Error{}class Gt extends Error{}function Jt(t,e){if(null==t)return{};if("~standard"in t){const o=t["~standard"].validate(e);if(o instanceof Promise)throw new Kt("Async validation not supported");if(o.issues)throw new Kt(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):"function"==typeof t?t(e):{}}function Xt(t,e,o,s){const n=t.options.params?.parse??t.options.parseParams;if(n)if(t.options.skipRouteOnParseError)for(const r in e)r in o&&(s[r]=o[r]);else{const t=n(s);Object.assign(s,t)}}class qt{constructor(t){if(this.init=t=>{this.originalIndex=t.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Pt:this.parentRoute||z(!1);let s=o?Pt:e?.path;s&&"/"!==s&&(s=rt(s));const n=e?.id||s;let r=o?Pt:st([this.parentRoute.id===Pt?"":this.parentRoute.id,n]);s===Pt&&(s="/"),r!==Pt&&(r=st(["/",r]));const i=r===Pt?"/":st([this.parentRoute.fullPath,s]);this._path=s,this._id=r,this._fullPath=i,this._to=it(i)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),"object"==typeof t&&null!==t&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>xt({from:this.fullPath,...t}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Yt extends qt{constructor(t){super(t)}}const Zt="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function Qt(e){const o=t.useRef({value:e,prev:null}),s=o.current.value;return e!==s&&(o.current={value:e,prev:s}),o.current.prev}function te(o){const s=o.errorComponent??oe;return e.jsx(ee,{getResetKey:o.getResetKey,onCatch:o.onCatch,children:({error:e,reset:n})=>e?t.createElement(s,{error:e,reset:n}):o.children})}class ee extends t.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function oe({error:o}){const[s,n]=t.useState(!1);return e.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[e.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),e.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(t=>!t),children:s?"Hide Error":"Show Error"})]}),e.jsx("div",{style:{height:".25rem"}}),s?e.jsx("div",{children:e.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:o.message?e.jsx("code",{children:o.message}):null})}):null]})}function se({children:t,fallback:s=null}){return ne()?e.jsx(o.Fragment,{children:t}):e.jsx(o.Fragment,{children:s})}function ne(){return o.useSyncExternalStore(re,()=>!0,()=>!1)}function re(){return()=>{}}function ie(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,s]of t)if(!e.has(o)||!Object.is(s,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const o=ae(t);if(o.length!==ae(e).length)return!1;for(let s=0;s<o.length;s++)if(!Object.prototype.hasOwnProperty.call(e,o[s])||!Object.is(t[o[s]],e[o[s]]))return!1;return!0}function ae(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const ce=t.createContext(null);function le(){return"undefined"==typeof document?ce:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ce,ce)}function ue(e){const o=t.useContext(le());return o}function he(e){const o=ue(),n=e?.router||o,r=t.useRef(void 0);return function(t,e=t=>t,o={}){const n=o.equal??ie;return s.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=I(r.current,e.select(t));return r.current=o,o}return e.select(t)}return t})}const de=t.createContext(void 0),pe=t.createContext(void 0);function fe(e){const o=t.useContext(e.from?pe:de);return he({select:t=>{const s=t.matches.find(t=>e.from?e.from===t.routeId:t.id===o);if(z(!((e.shouldThrow??1)&&!s),e.from&&e.from),void 0!==s)return e.select?e.select(s):s},structuralSharing:e.structuralSharing})}function me(t){return fe({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function ge(t){const{select:e,...o}=t;return fe({...o,select:t=>e?e(t.loaderDeps):t.loaderDeps})}function ye(t){return fe({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const o=!1===t.strict?e.params:e._strictParams;return t.select?t.select(o):o}})}function ve(t){return fe({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function we(e){const o=ue();return t.useCallback(t=>o.navigate({...t,from:t.from??e?.from}),[e?.from,o])}function Se(e,o){const s=ue(),r=function(e){const o=t.useRef(null);return t.useImperativeHandle(e,()=>o.current,[]),o}(o),{activeProps:i,inactiveProps:a,activeOptions:c,to:l,preload:u,preloadDelay:h,hashScrollIntoView:d,replace:p,startTransition:f,resetScroll:m,viewTransition:g,children:y,target:v,disabled:w,style:S,className:_,onClick:P,onFocus:x,onMouseEnter:b,onMouseLeave:R,onTouchStart:L,ignoreBlocker:k,params:M,search:I,hash:T,state:O,mask:j,reloadDocument:E,unsafeRelative:A,from:B,_fromLocation:D,...V}=e,N=ne(),U=he({select:t=>t.location.search,structuralSharing:!0}),W=e.from,H=t.useMemo(()=>({...e,from:W}),[s,U,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),z=t.useMemo(()=>s.buildLocation({...H}),[s,H]),K=z.maskedLocation?z.maskedLocation.publicHref:z.publicHref,G=z.maskedLocation?z.maskedLocation.external:z.external,J=t.useMemo(()=>function(t,e,o,s){if(s)return;if(e)return{href:t,external:!0};return{href:o.createHref(t)||"/",external:!1}}(K,G,s.history,w),[w,G,K,s.history]),X=t.useMemo(()=>{if(J?.external){if($(J.href,s.protocolAllowlist))return;return J.href}const t=function(t){if("string"!=typeof t)return!1;const e=t.charCodeAt(0);return 47===e?47!==t.charCodeAt(1):46===e}(l);if(!t&&"string"==typeof l&&-1!==l.indexOf(":"))try{return new URL(l),$(l,s.protocolAllowlist)?void 0:l}catch{}},[l,J,s.protocolAllowlist]),q=he({select:t=>{if(X)return!1;if(c?.exact){if(!(e=t.location.pathname,o=z.pathname,n=s.basepath,ct(e,n)===ct(o,n)))return!1}else{const e=ct(t.location.pathname,s.basepath),o=ct(z.pathname,s.basepath);if(!(e.startsWith(o)&&(e.length===o.length||"/"===e[o.length])))return!1}var e,o,n;if(c?.includeSearch??1){if(!F(t.location.search,z.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash||N&&t.location.hash===z.hash}}),Y=q?C(i,{})??Pe:_e,Z=q?_e:C(a,{})??_e,Q=[_,Y.className,Z.className].filter(Boolean).join(" "),tt=(S||Y.style||Z.style)&&{...S,...Y.style,...Z.style},[et,ot]=t.useState(!1),st=t.useRef(!1),nt=!e.reloadDocument&&!X&&(u??s.options.defaultPreload),rt=h??s.options.defaultPreloadDelay??0,it=t.useCallback(()=>{s.preloadRoute({...H}).catch(t=>{console.warn(t),console.warn("Error preloading route! \u261d\ufe0f")})},[s,H]);!function(e,o,s={},n={}){t.useEffect(()=>{if(!e.current||n.disabled||"function"!=typeof IntersectionObserver)return;const t=new IntersectionObserver(([t])=>{o(t)},s);return t.observe(e.current),()=>{t.disconnect()}},[o,s,n.disabled,e])}(r,t.useCallback(t=>{t?.isIntersecting&&it()},[it]),Ce,{disabled:!(!w&&"viewport"===nt)}),t.useEffect(()=>{st.current||w||"render"!==nt||(it(),st.current=!0)},[w,it,nt]);if(X)return{...V,ref:r,href:X,...y&&{children:y},...v&&{target:v},...w&&{disabled:w},...S&&{style:S},..._&&{className:_},...P&&{onClick:P},...x&&{onFocus:x},...b&&{onMouseEnter:b},...R&&{onMouseLeave:R},...L&&{onTouchStart:L}};const at=t=>{w||nt&&it()},lt=at;return{...V,...Y,...Z,href:J?.href,ref:r,onClick:ke([P,t=>{const e=t.currentTarget.getAttribute("target"),o=void 0!==v?v:e;if(!(w||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||o&&"_self"!==o||0!==t.button)){t.preventDefault(),n.flushSync(()=>{ot(!0)});const e=s.subscribe("onResolved",()=>{e(),ot(!1)});s.navigate({...H,replace:p,resetScroll:m,hashScrollIntoView:d,startTransition:f,viewTransition:g,ignoreBlocker:k})}}]),onFocus:ke([x,at]),onMouseEnter:ke([b,t=>{if(!w&&nt)if(rt){const e=t.target;if(Le.has(e))return;const o=setTimeout(()=>{Le.delete(e),it()},rt);Le.set(e,o)}else it()}]),onMouseLeave:ke([R,t=>{if(w||!nt||!rt)return;const e=t.target,o=Le.get(e);o&&(clearTimeout(o),Le.delete(e))}]),onTouchStart:ke([L,lt]),disabled:!!w,target:v,...tt&&{style:tt},...Q&&{className:Q},...w&&xe,...q&&be,...N&&et&&Re}}const _e={},Pe={className:"active"},xe={role:"link","aria-disabled":!0},be={"data-status":"active","aria-current":"page"},Re={"data-transitioning":"transitioning"},Le=new WeakMap,Ce={rootMargin:"100px"},ke=t=>e=>{for(const o of t)if(o){if(e.defaultPrevented)return;o(e)}};const Me=t.forwardRef((e,o)=>{const{_asChild:s,...n}=e,{type:r,...i}=Se(n,o),a="function"==typeof n.children?n.children({isActive:"active"===i["data-status"]}):n.children;if(!s){const{disabled:e,...o}=i;return t.createElement("a",o,a)}return t.createElement(s,i,a)});class Ie extends qt{constructor(t){super(t),this.useMatch=t=>fe({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>fe({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context}),this.useSearch=t=>ve({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ye({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ge({...t,from:this.id}),this.useLoaderData=t=>me({...t,from:this.id}),this.useNavigate=()=>we({from:this.fullPath}),this.Link=o.forwardRef((t,o)=>e.jsx(Me,{ref:o,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function Te(t){return new Ie(t)}class Oe extends Yt{constructor(t){super(t),this.useMatch=t=>fe({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>fe({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context}),this.useSearch=t=>ve({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ye({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ge({...t,from:this.id}),this.useLoaderData=t=>me({...t,from:this.id}),this.useNavigate=()=>we({from:this.fullPath}),this.Link=o.forwardRef((t,o)=>e.jsx(Me,{ref:o,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function je(t){return new Oe(t)}function Ee(t){return"object"==typeof t?new Fe(t,{silent:!0}).createRoute(t):new Fe(t,{silent:!0}).createRoute}class Fe{constructor(t,e){this.path=t,this.createRoute=t=>{this.silent;const e=Te(t);return e.isRoot=!1,e},this.silent=e?.silent}}class Ae{constructor(t){this.useMatch=t=>fe({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>fe({from:this.options.id,select:e=>t?.select?t.select(e.context):e.context}),this.useSearch=t=>ve({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>ye({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ge({...t,from:this.options.id}),this.useLoaderData=t=>me({...t,from:this.options.id}),this.useNavigate=()=>we({from:ue().routesById[this.options.id].fullPath}),this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Be(t){return"object"==typeof t?new Ae(t):e=>new Ae({id:t,...e})}function De(){const e=ue(),o=t.useRef({router:e,mounted:!1}),[s,n]=t.useState(!1),{hasPendingMatches:r,isLoading:i}=he({select:t=>({isLoading:t.isLoading,hasPendingMatches:t.matches.some(t=>"pending"===t.status)}),structuralSharing:!0}),a=Qt(i),c=i||s||r,l=Qt(c),u=i||r,h=Qt(u);return e.startTransition=e=>{n(!0),t.startTransition(()=>{e(),n(!1)})},t.useEffect(()=>{const t=e.history.subscribe(e.load),o=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return it(e.latestLocation.publicHref)!==it(o.publicHref)&&e.commitLocation({...o,replace:!0}),()=>{t()}},[e,e.history]),Zt(()=>{if("undefined"!=typeof window&&e.ssr||o.current.router===e&&o.current.mounted)return;o.current={router:e,mounted:!0};(async()=>{try{await e.load()}catch(t){console.error(t)}})()},[e]),Zt(()=>{a&&!i&&e.emit({type:"onLoad",...Ht(e.state)})},[a,e,i]),Zt(()=>{h&&!u&&e.emit({type:"onBeforeRouteMount",...Ht(e.state)})},[u,h,e]),Zt(()=>{if(l&&!c){const t=Ht(e.state);e.emit({type:"onResolved",...t}),e.__store.setState(t=>({...t,status:"idle",resolvedLocation:t.location})),t.hrefChanged&&function(t){if("undefined"!=typeof document&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&""!==t.state.location.hash){const o=document.getElementById(t.state.location.hash);o&&o.scrollIntoView(e)}}}(e)}},[c,l,e]),null}function Ve(t){const o=he({select:t=>`not-found-${t.location.pathname}-${t.status}`});return e.jsx(te,{getResetKey:()=>o,onCatch:(e,o)=>{if(!dt(e))throw e;t.onCatch?.(e,o)},errorComponent:({error:e})=>{if(dt(e))return t.fallback?.(e);throw e},children:t.children})}function $e(){return e.jsx("p",{children:"Not Found"})}function Ne(t){return e.jsx(e.Fragment,{children:t.children})}function Ue(t,o,s){return o.options.notFoundComponent?e.jsx(o.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?e.jsx(t.options.defaultNotFoundComponent,{...s}):e.jsx($e,{})}function We(){return ue().isScrollRestoring,null}const He=t.memo(function({matchId:o}){const s=ue(),n=he({select:t=>{const e=t.matches.findIndex(t=>t.id===o),s=t.matches[e];return z(s),{routeId:s.routeId,ssr:s.ssr,_displayPending:s._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[e-1]?.routeId}},structuralSharing:!0}),r=s.routesById[n.routeId],i=r.options.pendingComponent??s.options.defaultPendingComponent,a=i?e.jsx(i,{}):null,c=r.options.errorComponent??s.options.defaultErrorComponent,l=r.options.onCatch??s.options.defaultOnCatch,u=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,h=!1===n.ssr||"data-only"===n.ssr,d=(!r.isRoot||r.options.wrapInSuspense||h)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||h))?t.Suspense:Ne,p=c?te:Ne,f=u?Ve:Ne,m=r.isRoot?r.options.shellComponent??Ne:Ne;return e.jsxs(m,{children:[e.jsx(de.Provider,{value:o,children:e.jsx(d,{fallback:a,children:e.jsx(p,{getResetKey:()=>n.resetKey,errorComponent:c||oe,onCatch:(t,e)=>{if(dt(t))throw t;l?.(t,e)},children:e.jsx(f,{fallback:e=>{if(!u||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return t.createElement(u,e)},children:h||n._displayPending?e.jsx(se,{fallback:a,children:e.jsx(Ke,{matchId:o})}):e.jsx(Ke,{matchId:o})})})})}),n.parentRouteId===Pt&&s.options.scrollRestoration?e.jsxs(e.Fragment,{children:[e.jsx(ze,{}),e.jsx(We,{})]}):null]})});function ze(){const o=ue(),s=t.useRef(void 0);return e.jsx("script",{suppressHydrationWarning:!0,ref:t=>{!t||void 0!==s.current&&s.current.href===o.latestLocation.href||(o.emit({type:"onRendered",...Ht(o.state)}),s.current=o.latestLocation)}},o.latestLocation.state.__TSR_key)}const Ke=t.memo(function({matchId:o}){const s=ue(),{match:n,key:r,routeId:i}=he({select:t=>{const e=t.matches.find(t=>t.id===o),n=e.routeId,r=s.routesById[n].options.remountDeps??s.options.defaultRemountDeps,i=r?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return{key:i?JSON.stringify(i):void 0,routeId:n,match:{id:e.id,status:e.status,error:e.error,invalid:e.invalid,_forcePending:e._forcePending,_displayPending:e._displayPending}}},structuralSharing:!0}),a=s.routesById[i],c=t.useMemo(()=>{const t=a.options.component??s.options.defaultComponent;return t?e.jsx(t,{},r):e.jsx(Ge,{})},[r,a.options.component,s.options.defaultComponent]);if(n._displayPending)throw s.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw s.getMatch(n.id)?._nonReactive.minPendingPromise;if("pending"===n.status){const t=a.options.pendingMinMs??s.options.defaultPendingMinMs;if(t){const e=s.getMatch(n.id);if(e&&!e._nonReactive.minPendingPromise){const o=A();e._nonReactive.minPendingPromise=o,setTimeout(()=>{o.resolve(),e._nonReactive.minPendingPromise=void 0},t)}}throw s.getMatch(n.id)?._nonReactive.loadPromise}if("notFound"===n.status)return z(dt(n.error)),Ue(s,a,n.error);if("redirected"===n.status)throw z(bt(n.error)),s.getMatch(n.id)?._nonReactive.loadPromise;if("error"===n.status)throw n.error;return c}),Ge=t.memo(function(){const o=ue(),s=t.useContext(de),n=he({select:t=>t.matches.find(t=>t.id===s)?.routeId}),r=o.routesById[n],i=he({select:t=>{const e=t.matches.find(t=>t.id===s);return z(e),e.globalNotFound}}),a=he({select:t=>{const e=t.matches,o=e.findIndex(t=>t.id===s);return e[o+1]?.id}}),c=o.options.defaultPendingComponent?e.jsx(o.options.defaultPendingComponent,{}):null;if(i)return Ue(o,r,void 0);if(!a)return null;const l=e.jsx(He,{matchId:a});return n===Pt?e.jsx(t.Suspense,{fallback:c,children:l}):l});function Je(){const o=ue(),s=o.routesById[Pt].options.pendingComponent??o.options.defaultPendingComponent,n=s?e.jsx(s,{}):null,r="undefined"!=typeof document&&o.ssr?Ne:t.Suspense,i=e.jsxs(r,{fallback:n,children:[e.jsx(De,{}),e.jsx(Xe,{})]});return o.options.InnerWrap?e.jsx(o.options.InnerWrap,{children:i}):i}function Xe(){const t=ue(),o=he({select:t=>t.matches[0]?.id}),s=he({select:t=>t.loadedAt}),n=o?e.jsx(He,{matchId:o}):null;return e.jsx(de.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?n:e.jsx(te,{getResetKey:()=>s,errorComponent:oe,onCatch:t=>{t.message||t.toString()},children:n})})}const qe=t=>new Ye(t);class Ye extends zt{constructor(t){super(t)}}function Ze({router:t,children:o,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const n=le(),r=e.jsx(n.Provider,{value:t,children:o});return t.options.Wrap?e.jsx(t.options.Wrap,{children:r}):r}function Qe({router:t,...o}){return e.jsx(Ze,{router:t,...o,children:e.jsx(Je,{})})}function to({tag:t,attrs:o,children:s,nonce:n}){switch(t){case"title":return e.jsx("title",{...o,suppressHydrationWarning:!0,children:s});case"meta":return e.jsx("meta",{...o,suppressHydrationWarning:!0});case"link":return e.jsx("link",{...o,nonce:n,suppressHydrationWarning:!0});case"style":return e.jsx("style",{...o,dangerouslySetInnerHTML:{__html:s},nonce:n});case"script":return e.jsx(eo,{attrs:o,children:s});default:return null}}function eo({attrs:o,children:s}){ue();const n="string"==typeof o?.type&&""!==o.type&&"text/javascript"!==o.type&&"module"!==o.type;t.useEffect(()=>{if(!n){if(o?.src){const t=(()=>{try{const t=document.baseURI||window.location.href;return new URL(o.src,t).href}catch{return o.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(e=>e.src===t))return;const e=document.createElement("script");for(const[s,n]of Object.entries(o))"suppressHydrationWarning"!==s&&void 0!==n&&!1!==n&&e.setAttribute(s,"boolean"==typeof n?"":String(n));return document.head.appendChild(e),()=>{e.parentNode&&e.parentNode.removeChild(e)}}if("string"==typeof s){const t="string"==typeof o?.type?o.type:"text/javascript",e="string"==typeof o?.nonce?o.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(o=>{if(!(o instanceof HTMLScriptElement))return!1;const n=o.getAttribute("type")??"text/javascript",r=o.getAttribute("nonce")??void 0;return o.textContent===s&&n===t&&r===e}))return;const n=document.createElement("script");if(n.textContent=s,o)for(const[s,r]of Object.entries(o))"suppressHydrationWarning"!==s&&void 0!==r&&!1!==r&&n.setAttribute(s,"boolean"==typeof r?"":String(r));return document.head.appendChild(n),()=>{n.parentNode&&n.parentNode.removeChild(n)}}}},[o,s,n]);{if(n&&"string"==typeof s)return e.jsx("script",{...o,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:s}});const{src:t,async:r,defer:i,...a}=o||{};return e.jsx("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:""},...a})}}"undefined"!=typeof globalThis?(globalThis.createFileRoute=Ee,globalThis.createLazyFileRoute=Be):"undefined"!=typeof window&&(window.createFileRoute=Ee,window.createLazyFileRoute=Be);const oo=()=>{const e=ue(),o=e.options.ssr?.nonce,s=he({select:t=>t.matches.map(t=>t.meta).filter(Boolean)}),n=t.useMemo(()=>{const t=[],e={};let n;for(let r=s.length-1;r>=0;r--){const i=s[r];for(let s=i.length-1;s>=0;s--){const r=i[s];if(r)if(r.title)n||(n={tag:"title",children:r.title});else if("script:ld+json"in r)try{const e=JSON.stringify(r["script:ld+json"]);t.push({tag:"script",attrs:{type:"application/ld+json"},children:W(e)})}catch{}else{const s=r.name??r.property;if(s){if(e[s])continue;e[s]=!0}t.push({tag:"meta",attrs:{...r,nonce:o}})}}}return n&&t.push(n),o&&t.push({tag:"meta",attrs:{property:"csp-nonce",content:o}}),t.reverse(),t},[s,o]),r=he({select:t=>{const s=t.matches.map(t=>t.links).filter(Boolean).flat(1).map(t=>({tag:"link",attrs:{...t,nonce:o}})),n=e.ssr?.manifest;return[...s,...t.matches.map(t=>n?.routes[t.routeId]?.assets??[]).filter(Boolean).flat(1).filter(t=>"link"===t.tag).map(t=>({tag:"link",attrs:{...t.attrs,suppressHydrationWarning:!0,nonce:o}}))]},structuralSharing:!0});return function(t,e){const o=new Set;return t.filter(t=>{const s=e(t);return!o.has(s)&&(o.add(s),!0)})}([...n,...he({select:t=>{const s=[];return t.matches.map(t=>e.looseRoutesById[t.routeId]).forEach(t=>e.ssr?.manifest?.routes[t.id]?.preloads?.filter(Boolean).forEach(t=>{s.push({tag:"link",attrs:{rel:"modulepreload",href:t,nonce:o}})})),s},structuralSharing:!0}),...r,...he({select:t=>t.matches.map(t=>t.styles).flat(1).filter(Boolean).map(({children:t,...e})=>({tag:"style",attrs:{...e,nonce:o},children:t})),structuralSharing:!0}),...he({select:t=>t.matches.map(t=>t.headScripts).flat(1).filter(Boolean).map(({children:t,...e})=>({tag:"script",attrs:{...e,nonce:o},children:t})),structuralSharing:!0})],t=>JSON.stringify(t))};function so(){const o=oo(),s=ue(),n=s.options.ssr?.nonce;return e.jsx(e.Fragment,{children:o.map(e=>t.createElement(to,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}export{so as H,Ge as O,Qe as R,ue as a,we as b,ve as c,wt as d,je as e,Te as f,qe as g,z as i,xt as r,he as u};
