Socket
Socket
Sign inDemoInstall

@tanstack/react-router

Package Overview
Dependencies
Maintainers
2
Versions
582
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-router - npm Package Compare versions

Comparing version 0.0.1-beta.163 to 0.0.1-beta.164

1

build/cjs/index.js

@@ -617,2 +617,3 @@ /**

exports.ScrollRestoration = scrollRestoration.ScrollRestoration;
exports.useScrollRestoration = scrollRestoration.useScrollRestoration;
exports.Block = Block;

@@ -619,0 +620,0 @@ exports.ErrorComponent = ErrorComponent;

124

build/cjs/scroll-restoration.js

@@ -16,2 +16,3 @@ /**

var React = require('react');
var routerCore = require('@tanstack/router-core');
var index = require('./index.js');

@@ -40,123 +41,13 @@

const useLayoutEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
const windowKey = 'window';
const delimiter = '___';
let weakScrolledElementsByRestoreKey = {};
const cache = (() => {
if (typeof window === 'undefined') {
return {
set: () => {},
get: () => {}
};
}
const storageKey = 'tsr-scroll-restoration-v1';
let cache = JSON.parse(window.sessionStorage.getItem(storageKey) || '{}');
return {
current: cache,
set: (key, value) => {
cache[key] = value;
window.sessionStorage.setItem(storageKey, JSON.stringify(cache));
}
};
})();
function ScrollRestoration() {
function useScrollRestoration(options) {
const router = index.useRouter();
const getKey = location => location.key;
const pathDidChangeRef = React__namespace.useRef(false);
const restoreScrollPositions = () => {
const restoreKey = getKey(router.state.location);
let windowRestored = false;
for (const cacheKey in cache.current) {
const entry = cache.current[cacheKey];
const [key, elementSelector] = cacheKey.split(delimiter);
if (key === restoreKey) {
if (elementSelector === windowKey) {
windowRestored = true;
window.scrollTo(entry.scrollX, entry.scrollY);
} else if (elementSelector) {
const element = document.querySelector(elementSelector);
if (element) {
element.scrollLeft = entry.scrollX;
element.scrollTop = entry.scrollY;
}
}
}
}
if (!windowRestored) {
window.scrollTo(0, 0);
}
};
useLayoutEffect(() => {
const {
history
} = window;
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}
const onScroll = event => {
const restoreKey = getKey(router.state.resolvedLocation);
if (!weakScrolledElementsByRestoreKey[restoreKey]) {
weakScrolledElementsByRestoreKey[restoreKey] = new WeakSet();
}
const set = weakScrolledElementsByRestoreKey[restoreKey];
if (set.has(event.target)) return;
set.add(event.target);
const cacheKey = [restoreKey, event.target === document || event.target === window ? windowKey : getCssSelector(event.target)].join(delimiter);
if (!cache.current[cacheKey]) {
cache.set(cacheKey, {
scrollX: NaN,
scrollY: NaN
});
}
};
const getCssSelector = el => {
let path = [],
parent;
while (parent = el.parentNode) {
path.unshift(`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`);
el = parent;
}
return `${path.join(' > ')}`.toLowerCase();
};
const onPathWillChange = from => {
const restoreKey = getKey(from);
for (const cacheKey in cache.current) {
const entry = cache.current[cacheKey];
const [key, elementSelector] = cacheKey.split(delimiter);
if (restoreKey === key) {
if (elementSelector === windowKey) {
entry.scrollX = window.scrollX || 0;
entry.scrollY = window.scrollY || 0;
} else if (elementSelector) {
const element = document.querySelector(elementSelector);
entry.scrollX = element?.scrollLeft || 0;
entry.scrollY = element?.scrollTop || 0;
}
cache.set(cacheKey, entry);
}
}
};
const onPathChange = () => {
pathDidChangeRef.current = true;
};
if (typeof document !== 'undefined') {
document.addEventListener('scroll', onScroll, true);
}
const unsubOnBeforeLoad = router.subscribe('onBeforeLoad', event => {
if (event.pathChanged) onPathWillChange(event.from);
});
const unsubOnLoad = router.subscribe('onLoad', event => {
if (event.pathChanged) onPathChange();
});
return () => {
document.removeEventListener('scroll', onScroll);
unsubOnBeforeLoad();
unsubOnLoad();
};
return routerCore.watchScrollPositions(router, options);
}, []);
useLayoutEffect(() => {
if (pathDidChangeRef.current) {
pathDidChangeRef.current = false;
restoreScrollPositions();
}
routerCore.restoreScrollPositions(router, options);
});
}
function ScrollRestoration(props) {
useScrollRestoration(props);
return null;

@@ -166,2 +57,3 @@ }

exports.ScrollRestoration = ScrollRestoration;
exports.useScrollRestoration = useScrollRestoration;
//# sourceMappingURL=scroll-restoration.js.map

@@ -16,3 +16,3 @@ /**

import warning from 'tiny-warning';
import { Route, functionalUpdate, last, pick } from '@tanstack/router-core';
import { watchScrollPositions, restoreScrollPositions, Route, functionalUpdate, last, pick } from '@tanstack/router-core';
export * from '@tanstack/router-core';

@@ -36,123 +36,13 @@

const useLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
const windowKey = 'window';
const delimiter = '___';
let weakScrolledElementsByRestoreKey = {};
const cache = (() => {
if (typeof window === 'undefined') {
return {
set: () => {},
get: () => {}
};
}
const storageKey = 'tsr-scroll-restoration-v1';
let cache = JSON.parse(window.sessionStorage.getItem(storageKey) || '{}');
return {
current: cache,
set: (key, value) => {
cache[key] = value;
window.sessionStorage.setItem(storageKey, JSON.stringify(cache));
}
};
})();
function ScrollRestoration() {
function useScrollRestoration(options) {
const router = useRouter();
const getKey = location => location.key;
const pathDidChangeRef = React.useRef(false);
const restoreScrollPositions = () => {
const restoreKey = getKey(router.state.location);
let windowRestored = false;
for (const cacheKey in cache.current) {
const entry = cache.current[cacheKey];
const [key, elementSelector] = cacheKey.split(delimiter);
if (key === restoreKey) {
if (elementSelector === windowKey) {
windowRestored = true;
window.scrollTo(entry.scrollX, entry.scrollY);
} else if (elementSelector) {
const element = document.querySelector(elementSelector);
if (element) {
element.scrollLeft = entry.scrollX;
element.scrollTop = entry.scrollY;
}
}
}
}
if (!windowRestored) {
window.scrollTo(0, 0);
}
};
useLayoutEffect(() => {
const {
history
} = window;
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}
const onScroll = event => {
const restoreKey = getKey(router.state.resolvedLocation);
if (!weakScrolledElementsByRestoreKey[restoreKey]) {
weakScrolledElementsByRestoreKey[restoreKey] = new WeakSet();
}
const set = weakScrolledElementsByRestoreKey[restoreKey];
if (set.has(event.target)) return;
set.add(event.target);
const cacheKey = [restoreKey, event.target === document || event.target === window ? windowKey : getCssSelector(event.target)].join(delimiter);
if (!cache.current[cacheKey]) {
cache.set(cacheKey, {
scrollX: NaN,
scrollY: NaN
});
}
};
const getCssSelector = el => {
let path = [],
parent;
while (parent = el.parentNode) {
path.unshift(`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`);
el = parent;
}
return `${path.join(' > ')}`.toLowerCase();
};
const onPathWillChange = from => {
const restoreKey = getKey(from);
for (const cacheKey in cache.current) {
const entry = cache.current[cacheKey];
const [key, elementSelector] = cacheKey.split(delimiter);
if (restoreKey === key) {
if (elementSelector === windowKey) {
entry.scrollX = window.scrollX || 0;
entry.scrollY = window.scrollY || 0;
} else if (elementSelector) {
const element = document.querySelector(elementSelector);
entry.scrollX = element?.scrollLeft || 0;
entry.scrollY = element?.scrollTop || 0;
}
cache.set(cacheKey, entry);
}
}
};
const onPathChange = () => {
pathDidChangeRef.current = true;
};
if (typeof document !== 'undefined') {
document.addEventListener('scroll', onScroll, true);
}
const unsubOnBeforeLoad = router.subscribe('onBeforeLoad', event => {
if (event.pathChanged) onPathWillChange(event.from);
});
const unsubOnLoad = router.subscribe('onLoad', event => {
if (event.pathChanged) onPathChange();
});
return () => {
document.removeEventListener('scroll', onScroll);
unsubOnBeforeLoad();
unsubOnLoad();
};
return watchScrollPositions(router, options);
}, []);
useLayoutEffect(() => {
if (pathDidChangeRef.current) {
pathDidChangeRef.current = false;
restoreScrollPositions();
}
restoreScrollPositions(router, options);
});
}
function ScrollRestoration(props) {
useScrollRestoration(props);
return null;

@@ -726,3 +616,3 @@ }

export { Block, ErrorComponent, Link, MatchRoute, Navigate, Outlet, RouterProvider, ScrollRestoration, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch };
export { Block, ErrorComponent, Link, MatchRoute, Navigate, Outlet, RouterProvider, ScrollRestoration, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useScrollRestoration, useSearch };
//# sourceMappingURL=index.js.map

@@ -10,3 +10,3 @@ {

{
"uid": "830a-169",
"uid": "27f2-173",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -19,11 +19,11 @@ },

"name": "store/build/esm/index.js",
"uid": "830a-171"
"uid": "27f2-175"
},
{
"name": "react-store/build/esm/index.js",
"uid": "830a-173"
"uid": "27f2-177"
},
{
"name": "router-core/build/esm/index.js",
"uid": "830a-179"
"uid": "27f2-183"
},

@@ -34,7 +34,7 @@ {

{
"uid": "830a-181",
"uid": "27f2-185",
"name": "scroll-restoration.tsx"
},
{
"uid": "830a-183",
"uid": "27f2-187",
"name": "index.tsx"

@@ -51,7 +51,7 @@ }

"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "830a-175"
"uid": "27f2-179"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "830a-177"
"uid": "27f2-181"
}

@@ -66,56 +66,56 @@ ]

"nodeParts": {
"830a-169": {
"27f2-173": {
"renderedLength": 429,
"gzipLength": 238,
"brotliLength": 0,
"mainUid": "830a-168"
"mainUid": "27f2-172"
},
"830a-171": {
"27f2-175": {
"renderedLength": 1843,
"gzipLength": 644,
"brotliLength": 0,
"mainUid": "830a-170"
"mainUid": "27f2-174"
},
"830a-173": {
"27f2-177": {
"renderedLength": 1006,
"gzipLength": 479,
"brotliLength": 0,
"mainUid": "830a-172"
"mainUid": "27f2-176"
},
"830a-175": {
"27f2-179": {
"renderedLength": 181,
"gzipLength": 129,
"brotliLength": 0,
"mainUid": "830a-174"
"mainUid": "27f2-178"
},
"830a-177": {
"27f2-181": {
"renderedLength": 44,
"gzipLength": 62,
"brotliLength": 0,
"mainUid": "830a-176"
"mainUid": "27f2-180"
},
"830a-179": {
"renderedLength": 57185,
"gzipLength": 13483,
"27f2-183": {
"renderedLength": 61314,
"gzipLength": 14436,
"brotliLength": 0,
"mainUid": "830a-178"
"mainUid": "27f2-182"
},
"830a-181": {
"renderedLength": 4385,
"gzipLength": 1261,
"27f2-185": {
"renderedLength": 466,
"gzipLength": 228,
"brotliLength": 0,
"mainUid": "830a-180"
"mainUid": "27f2-184"
},
"830a-183": {
"27f2-187": {
"renderedLength": 17058,
"gzipLength": 3802,
"brotliLength": 0,
"mainUid": "830a-182"
"mainUid": "27f2-186"
}
},
"nodeMetas": {
"830a-168": {
"27f2-172": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "830a-169"
"index.production.js": "27f2-173"
},

@@ -125,10 +125,10 @@ "imported": [],

{
"uid": "830a-182"
"uid": "27f2-186"
}
]
},
"830a-170": {
"27f2-174": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "830a-171"
"index.production.js": "27f2-175"
},

@@ -138,17 +138,17 @@ "imported": [],

{
"uid": "830a-172"
"uid": "27f2-176"
}
]
},
"830a-172": {
"27f2-176": {
"id": "/packages/react-store/build/esm/index.js",
"moduleParts": {
"index.production.js": "830a-173"
"index.production.js": "27f2-177"
},
"imported": [
{
"uid": "830a-185"
"uid": "27f2-189"
},
{
"uid": "830a-170"
"uid": "27f2-174"
}

@@ -158,13 +158,13 @@ ],

{
"uid": "830a-182"
"uid": "27f2-186"
},
{
"uid": "830a-178"
"uid": "27f2-182"
}
]
},
"830a-174": {
"27f2-178": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "830a-175"
"index.production.js": "27f2-179"
},

@@ -174,13 +174,13 @@ "imported": [],

{
"uid": "830a-182"
"uid": "27f2-186"
},
{
"uid": "830a-178"
"uid": "27f2-182"
}
]
},
"830a-176": {
"27f2-180": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "830a-177"
"index.production.js": "27f2-181"
},

@@ -190,23 +190,23 @@ "imported": [],

{
"uid": "830a-182"
"uid": "27f2-186"
},
{
"uid": "830a-178"
"uid": "27f2-182"
}
]
},
"830a-178": {
"27f2-182": {
"id": "/packages/router-core/build/esm/index.js",
"moduleParts": {
"index.production.js": "830a-179"
"index.production.js": "27f2-183"
},
"imported": [
{
"uid": "830a-174"
"uid": "27f2-178"
},
{
"uid": "830a-176"
"uid": "27f2-180"
},
{
"uid": "830a-172"
"uid": "27f2-176"
}

@@ -216,17 +216,23 @@ ],

{
"uid": "830a-182"
"uid": "27f2-186"
},
{
"uid": "27f2-184"
}
]
},
"830a-180": {
"27f2-184": {
"id": "/packages/react-router/src/scroll-restoration.tsx",
"moduleParts": {
"index.production.js": "830a-181"
"index.production.js": "27f2-185"
},
"imported": [
{
"uid": "830a-184"
"uid": "27f2-188"
},
{
"uid": "830a-182"
"uid": "27f2-182"
},
{
"uid": "27f2-186"
}

@@ -236,32 +242,32 @@ ],

{
"uid": "830a-182"
"uid": "27f2-186"
}
]
},
"830a-182": {
"27f2-186": {
"id": "/packages/react-router/src/index.tsx",
"moduleParts": {
"index.production.js": "830a-183"
"index.production.js": "27f2-187"
},
"imported": [
{
"uid": "830a-168"
"uid": "27f2-172"
},
{
"uid": "830a-184"
"uid": "27f2-188"
},
{
"uid": "830a-172"
"uid": "27f2-176"
},
{
"uid": "830a-174"
"uid": "27f2-178"
},
{
"uid": "830a-176"
"uid": "27f2-180"
},
{
"uid": "830a-178"
"uid": "27f2-182"
},
{
"uid": "830a-180"
"uid": "27f2-184"
}

@@ -271,3 +277,3 @@ ],

{
"uid": "830a-180"
"uid": "27f2-184"
}

@@ -277,3 +283,3 @@ ],

},
"830a-184": {
"27f2-188": {
"id": "react",

@@ -284,6 +290,6 @@ "moduleParts": {},

{
"uid": "830a-182"
"uid": "27f2-186"
},
{
"uid": "830a-180"
"uid": "27f2-184"
}

@@ -293,3 +299,3 @@ ],

},
"830a-185": {
"27f2-189": {
"id": "use-sync-external-store/shim/with-selector",

@@ -300,3 +306,3 @@ "moduleParts": {},

{
"uid": "830a-172"
"uid": "27f2-176"
}

@@ -303,0 +309,0 @@ ],

@@ -12,3 +12,3 @@ /**

import * as _tanstack_router_core from '@tanstack/router-core';
import { RouteConstraints, AnyRoute, ResolveFullPath, ResolveId, ResolveFullSearchSchema, ParsePathParams, MergeParamsFromParent, RouteContext, AnyContext, UseLoaderResult, AnyRouteProps, RoutePaths, RegisteredRouter, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NavigateOptions, RouterOptions, Router, RouteMatch, RouteIds, RouteById, ParseRoute, RoutesById, AllParams } from '@tanstack/router-core';
import { ScrollRestorationOptions, RouteConstraints, AnyRoute, ResolveFullPath, ResolveId, ResolveFullSearchSchema, ParsePathParams, MergeParamsFromParent, RouteContext, AnyContext, UseLoaderResult, AnyRouteProps, RoutePaths, RegisteredRouter, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NavigateOptions, RouterOptions, Router, RouteMatch, RouteIds, RouteById, ParseRoute, RoutesById, AllParams } from '@tanstack/router-core';
export * from '@tanstack/router-core';

@@ -19,3 +19,4 @@ import * as React from 'react';

declare function ScrollRestoration(): null;
declare function useScrollRestoration(options?: ScrollRestorationOptions): void;
declare function ScrollRestoration(props: ScrollRestorationOptions): null;

@@ -157,2 +158,2 @@ declare module '@tanstack/router-core' {

export { AnyRouteComponent, AsyncRouteComponent, Block, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouterProps, RouterProvider, ScrollRestoration, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch };
export { AnyRouteComponent, AsyncRouteComponent, Block, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouterProps, RouterProvider, ScrollRestoration, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useScrollRestoration, useSearch };

@@ -42,3 +42,3 @@ /**

*/
const u="pushstate",l="popstate",d="beforeunload",p=t=>(t.preventDefault(),t.returnValue=""),f=()=>{removeEventListener(d,p,{capture:!0})};function m(t){let e=t.getLocation(),r=()=>{},o=new Set,s=[],n=[];const a=()=>{if(s.length)s[0]?.(a,(()=>{s=[],f()}));else{for(;n.length;)n.shift()?.();t.subscriber||c()}},i=t=>{n.push(t),a()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},subscribe:e=>(0===o.size&&(r="function"==typeof t.subscriber?t.subscriber(c):()=>{}),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(s.push(t),1===s.length&&addEventListener(d,p,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.length||f()})}}function y(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return m({getLocation:()=>v(e(),history.state),subscriber:t=>{window.addEventListener(u,t),window.addEventListener(l,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(u,t),window.removeEventListener(l,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:w()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:w()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function g(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return m({getLocation:()=>v(e[r],o),subscriber:!1,pushState:(t,s)=>{o={...s,key:w()},e.push(t),r++},replaceState:(t,s)=>{o={...s,key:w()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function v(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function w(){return(Math.random()+1).toString(36).substring(7)}function b(t){return t[t.length-1]}function S(t,e){return"function"==typeof t?t(e):t}function R(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function E(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||x(t)&&x(r)){const e=o?t.length:Object.keys(t).length,s=o?r:Object.keys(r),n=s.length,a=o?[]:{};let i=0;for(let e=0;e<n;e++){const n=o?e:s[e];a[n]=E(t[n],r[n]),a[n]===t[n]&&i++}return e===n&&i===e?t:a}return r}function x(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!I(r)&&!!r.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function _(t,e){return t===e||typeof t==typeof e&&(x(t)&&x(e)?!Object.keys(e).some((r=>!_(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>_(t,e[r])))))}function P(t){return C(t.filter(Boolean).join("/"))}function C(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function L(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function O(t){return L(M(t))}function A(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=j(e);const s=j(r);s.forEach(((t,e)=>{if("/"===t.value)e?e===s.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===b(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return C(P([t,...o.map((t=>t.value))]))}function j(t){if(!t)return[];const e=[];if("/"===(t=C(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function k(t,e,r=!1){return P(j(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function D(t,e,r){const o=B(t,e,r);if(!r.to||o)return o??{}}function B(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,s=j(e),n=j(o);e.startsWith("/")||s.unshift({type:"pathname",value:"/"}),o.startsWith("/")||n.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(s.length,n.length);t++){const e=s[t],o=n[t],i=t>=s.length-1,c=t>=n.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=P(s.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function T(t,e){var r,o,s,n="";for(r in t)if(void 0!==(s=t[r]))if(Array.isArray(s))for(o=0;o<s.length;o++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s[o]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s);return(e||"")+n}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function H(t){for(var e,r,o={},s=t.split("&");e=s.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],$(e.shift())):o[r]=$(e.shift());return o}const N="__root__";class F{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,F.__onInit(this)}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=N:h(this.parentRoute);let o=r?N:e.path;o&&"/"!==o&&(o=O(o));const s=e?.id||o;let n=r?N:P([this.parentRoute.id===N?"":this.parentRoute.id,s]);o===N&&(o="/"),n!==N&&(n=P(["/",n]));const a=n===N?"/":P([this.parentRoute.fullPath,o]);this.path=o,this.id=n,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class U extends F{constructor(t){super(t)}}const z=Y(JSON.parse),W=J(JSON.stringify,JSON.parse);function Y(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=H(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function J(t,e){function r(r){if("object"==typeof r&&null!==r)try{return t(r)}catch(t){}else if("string"==typeof r&&"function"==typeof e)try{return e(r),t(r)}catch(t){}return r}return t=>{(t={...t})&&Object.keys(t).forEach((e=>{const o=t[e];void 0===o||void 0===o?delete t[e]:Array.isArray(o)?t[e]=o.map(r):t[e]=r(o)}));const e=T(t).toString();return e?`?${e}`:""}}const q=["component","errorComponent","pendingComponent"];const X="undefined"==typeof window||!window.document.createElement;function K(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],lastUpdated:Date.now()}}function V(t){return!!t?.isRedirect}class G extends Error{}class Q extends Error{}const Z="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,tt="window",et="___";let rt={};const ot=(()=>{if("undefined"==typeof window)return{set:()=>{},get:()=>{}};const t="tsr-scroll-restoration-v1";let e=JSON.parse(window.sessionStorage.getItem(t)||"{}");return{current:e,set:(r,o)=>{e[r]=o,window.sessionStorage.setItem(t,JSON.stringify(e))}}})();function st(t){const e=ut(),{type:r,children:o,target:n,activeProps:a=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:b,onMouseEnter:R,onMouseLeave:E,onTouchStart:x,...I}=t,_=e.buildLink(t);if("external"===_.type){const{href:t}=_;return{href:t}}const{handleClick:P,handleFocus:C,handleEnter:M,handleLeave:L,handleTouchStart:O,isActive:A,next:j}=_,k=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=A?S(a,{})??{}:{},B=A?{}:S(i,{})??{};return{...D,...B,...I,href:h?void 0:j.href,onClick:k([w,e=>{(t.startTransition??1)&&(s.startTransition||(t=>t))((()=>{P(e)}))}]),onFocus:k([b,C]),onMouseEnter:k([R,M]),onMouseLeave:k([E,L]),onTouchStart:k([x,O]),target:n,style:{...g,...D.style,...B.style},className:[v,D.className,B.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}F.__onInit=t=>{Object.assign(t,{useMatch:(e={})=>lt({...e,from:t.id}),useLoader:(e={})=>dt({...e,from:t.id}),useContext:(e={})=>lt({...e,from:t.id,select:t=>e?.select?.(t.context)??t.context}),useRouteContext:(e={})=>lt({...e,from:t.id,select:t=>e?.select?.(t.routeContext)??t.routeContext}),useSearch:(e={})=>pt({...e,from:t.id}),useParams:(e={})=>ft({...e,from:t.id})})};const nt=s.forwardRef(((t,e)=>{const r=st(t);return s.createElement("a",n({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const at=s.createContext(null),it=s.createContext(null);function ct(t){return i(ut().__store,t?.select)}function ht(){const t=ut(),e=ct({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatchIds:e.matchIds});return s.createElement(at.Provider,{value:[void 0,...e]},s.createElement(St,{errorComponent:Et,onCatch:()=>{}},s.createElement(yt,null)))}function ut(){return s.useContext(it)}function lt(t){const e=ut(),r=s.useContext(at)[0],o=e.getRouteMatch(r)?.routeId,n=ct({select:e=>{const o=e.matches;return(t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r))).routeId}});(t?.strict??1)&&h(o==n);return ct({select:e=>{const o=e.matches,s=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return h(s,t?.from&&t.from),t?.select?.(s)??s}})}function dt(t){return lt({...t,select:e=>t?.select?.(e.loaderData)??e.loaderData})}function pt(t){return lt({...t,select:e=>t?.select?.(e.search)??e.search})}function ft(t){return ct({select:e=>{const r=b(e.matches)?.params;return t?.select?.(r)??r}})}function mt(){const t=ut();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...s}=e;return t.matchRoute(s,{pending:r,caseSensitive:o})}),[])}function yt(){const t=s.useContext(at).slice(1);return t[0]?s.createElement(vt,{matchIds:t}):null}const gt=()=>null;function vt({matchIds:t}){const e=ut(),r=t[0],o=e.getRouteMatch(r).routeId,n=e.getRoute(o),a=n.options.pendingComponent??e.options.defaultPendingComponent??gt,i=n.options.errorComponent??e.options.defaultErrorComponent??Et,c=n.options.wrapInSuspense??!n.isRoot?s.Suspense:bt,h=i?St:bt;return s.createElement(at.Provider,{value:t},s.createElement(c,{fallback:s.createElement(a,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams})},s.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{}},s.createElement(wt,{matchId:r,PendingComponent:a}))))}function wt({matchId:t,PendingComponent:e}){const r=ut(),o=ct({select:e=>R(e.matchesById[t],["status","loadPromise","routeId","error"])}),n=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return s.createElement(e,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams});if("success"===o.status){let t=n.options.component??r.options.defaultComponent;return t?s.createElement(t,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams}):s.createElement(yt,null)}h(!1)}function bt(t){return s.createElement(s.Fragment,null,t.children)}class St extends s.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),this.setState({error:t,info:e})}render(){return s.createElement(Rt,n({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function Rt(t){const e=ct({select:t=>t.resolvedLocation.key}),[r,o]=s.useState(t.errorState),n=t.errorComponent??Et,a=s.useRef("");return s.useEffect((()=>{r&&e!==a.current&&o({}),a.current=e}),[r,e]),s.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?s.createElement(n,r):t.children}function Et({error:t}){const[e,r]=s.useState(!1);return s.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},s.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},s.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),s.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((t=>!t))},e?"Hide Error":"Show Error")),s.createElement("div",{style:{height:".25rem"}}),e?s.createElement("div",null,s.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?s.createElement("code",null,t.message):null)):null)}function xt(t,e=!0){const r=ut();s.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}t.Block=function({message:t,condition:e,children:r}){return xt(t,e),r??null},t.ErrorComponent=Et,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new F(t);return e.isRoot=!1,e}},t.Link=nt,t.MatchRoute=function(t){const e=mt()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=ut();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=yt,t.PathParamError=Q,t.RootRoute=U,t.Route=F,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??W,parseSearch:t?.parseSearch??z},this.__store=new a(K(),{onUpdate:()=>{const t=this.state,e=this.__store.state,r=t.matchesById!==e.matchesById;let o,s;r||(o=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,r)=>t!==e.matchIds[r])),s=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,r)=>t!==e.pendingMatchIds[r]))),(r||o)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(r||s)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},defaultPriority:"low"}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}subscribers=new Set;subscribe=(t,e)=>{const r={eventType:t,fn:e};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}};#r=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};reset=()=>{this.__store.setState((t=>Object.assign(t,K())))};mount=()=>{this.safeLoad()};update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(X?g():y());const t=this.#o();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.subscribe((()=>{this.safeLoad({next:this.#o(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${O(e??"")??""}`,r&&r!==this.routeTree&&this.#s(r),this};buildNext=t=>{const e=this.#n(t),r=this.matchRoutes(e.pathname,e.search);return this.#n({...t,__matches:r})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(r,o)=>{const s=this.state.resolvedLocation,n=!(!t?.next||s.href===t.next.href);let a;const i=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let c;this.#r({type:"onBeforeLoad",from:s,to:t?.next??this.state.location,pathChanged:n}),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),c=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:c.map((t=>t.id)),matchesById:this.#a(t.matchesById,c)})))}));try{try{await this.loadMatches(c)}catch(t){}if(a=i())return a;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),this.#r({type:"onLoad",from:s,to:this.state.location,pathChanged:n}),r()}catch(t){if(a=i())return a;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};#a=(t,e)=>{const r={...t};let o=!1;return e.forEach((t=>{r[t.id]||(o=!0,r[t.id]=t)})),o?r:t};getRoute=t=>{const e=this.routesById[t];return h(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#a(t.matchesById,r)}))),await this.loadMatches(r,{preload:!0,maxAge:t.maxAge}),r};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const r=this.getRoute(e.routeId);return!this.state.matchIds.includes(e.id)&&!this.state.pendingMatchIds.includes(e.id)&&e.preloadInvalidAt<t&&(!r.options.gcMaxAge||e.updatedAt+r.options.gcMaxAge<t)})).map((t=>t.id));e.length&&this.__store.setState((t=>{const r={...t.matchesById};return e.forEach((t=>{delete r[t]})),{...t,matchesById:r}}))};matchRoutes=(t,e,r)=>{let o={},s=this.flatRoutes.find((e=>{const r=D(this.basepath,L(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(o=r,!0)}))||this.routesById.__root__,n=[s];for(;s?.parentRoute;)s=s.parentRoute,s&&n.unshift(s);const a=n.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(o);Object.assign(o,e)}catch(t){if(e=new Q(t.message,{cause:t}),r?.throwOnError)throw e;return e}})),i=n.map(((t,r)=>{const s=k(t.path,o),n=t.options.key?t.options.key({params:o,search:e})??"":"",i=n?JSON.stringify(n):"",c=k(t.id,o,!0)+i,h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!q.some((e=>t.options[e]?.preload)));return{id:c,key:i,routeId:t.id,params:o,pathname:P([this.basepath,s]),updatedAt:Date.now(),invalidAt:1/0,preloadInvalidAt:1/0,routeSearch:{},search:{},status:u?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:a[r],searchError:void 0,loaderData:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,o)=>{const s=i[o-1],n=this.getRoute(t.routeId),a=(()=>{const o={search:s?.search??e,routeSearch:s?.routeSearch??e};try{const e=("object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch)?.(o.search)??{},r={...o.search,...e};return{routeSearch:E(t.routeSearch,e),search:E(t.search,r)}}catch(e){if(t.searchError=new G(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})();Object.assign(t,{...a});const c=(()=>{try{const e=n.options.getContext?.({parentContext:s?.routeContext??{},context:s?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...s?.context??this?.options.context,...e},routeContext:e}}catch(t){throw n.options.onError?.(t),t}})();Object.assign(t,{...c})})),i};loadMatches=async(t,e)=>{let r;this.cleanMatches(),e?.preload||t.forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params})))}));try{for(const[o,s]of t.entries()){const t=this.getRoute(s.routeId),n=(e,n)=>{if(e.routerCode=n,r=r??o,V(e))throw e;try{t.options.onError?.(e)}catch(t){if(e=t,V(t))throw t}this.setRouteMatch(s.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};s.paramsError&&n(s.paramsError,"PARSE_PARAMS"),s.searchError&&n(s.searchError,"VALIDATE_SEARCH");let a=!1;try{await(t.options.beforeLoad?.({...s,preload:!!e?.preload}))}catch(t){n(t,"BEFORE_LOAD"),a=!0}if(a)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),s=[];o.forEach(((t,r)=>{s.push((async()=>{const o=s[r-1],n=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!this.getIsInvalid({matchId:t.id,preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const a=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0},c=t=>!!V(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let r;try{const s=Promise.all(q.map((async t=>{const e=n.options[t];e?.preload&&await e.preload()}))),a=n.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:o}),[c,h]=await Promise.all([s,a]);if(r=i())return await r;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){if(r=i())return await r;if(c(e))return;try{n.options.onError?.(e)}catch(t){if(e=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let u;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:a,invalid:!1}))),u=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:u})))})),await u})())})),await Promise.all(s)};reload=()=>this.navigate({fromCurrent:!0,replace:!0,search:!0});resolvePath=(t,e)=>A(this.basepath,t,C(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:s,params:n})=>{const a=String(e),i=void 0===t?t:String(t);let c;try{new URL(`${a}`),c=!0}catch(t){}return h(!c),this.#e({from:i,to:a,search:r,hash:o,replace:s,params:n})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const o=e?.pending?this.state.location:this.state.resolvedLocation;if(!o)return!1;const s=D(this.basepath,o.pathname,{...e,to:r.pathname});return!!s&&(e?.includeSearch??1?!!_(o.search,r.search)&&s:s)};buildLink=({from:t,to:e=".",search:r,params:o,hash:s,target:n,replace:a,activeOptions:i,preload:c,preloadDelay:h,disabled:u,state:l})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const d={from:t,to:e,search:r,params:o,hash:s,replace:a,state:l},p=this.buildNext(d);c=c??this.options.defaultPreload;const f=h??this.options.defaultPreloadDelay??0,m=this.state.location.pathname.split("/"),y=p.pathname.split("/").every(((t,e)=>t===m[e])),g=i?.exact?this.state.location.pathname===p.pathname:y,v=!i?.includeHash||this.state.location.hash===p.hash,w=!(i?.includeSearch??1)||_(this.state.location.search,p.search);return{type:"internal",next:p,handleFocus:t=>{c&&this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||n&&"_self"!==n||0!==t.button||(t.preventDefault(),this.#e(d))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),f)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:g&&v&&w,disabled:u}};dehydrate=()=>({state:R(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),h(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;this.__store.setState((t=>({...t,...o,resolvedLocation:o.location}))),await this.load()};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const r="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${r}`,o="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${s=r,s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(o)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var s})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#s=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(h(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=L(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&e(o)}))};e([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const r=O(t.fullPath),o=j(r);for(;o.length>1&&"/"===o[0]?.value;)o.shift();const s=o.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:o,index:e,score:s}})).sort(((t,e)=>{let r="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==r)return r;const o=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let r=0;r<o;r++)if(t.score[r]!==e.score[r])return e.score[r]-t.score[r];for(let r=0;r<o;r++)if(t.parsed[r].value!==e.parsed[r].value)return t.parsed[r].value>e.parsed[r].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#o=t=>{let{pathname:e,search:r,hash:o,state:s}=this.history.location;const n=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:E(t?.search,n),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:s,key:s?.key||"__init__"}};#n=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=A(this.basepath??"/",e,`${t.to??""}`);const o={...b(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let s=!0===(t.params??!0)?o:S(t.params,o);s&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{s={...s,...t(s)}})),r=k(r,s??{});const n=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],a=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=n?.length?n?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?S(t.search,i)??{}:n?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=E(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:S(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:S(t.state,this.state.location.state),hash:d,href:this.history.createHref(`${r}${l}${p}`),key:t.key}};#e=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let o="replace";t.replace||(o="push");this.state.location.href===e.href&&!e.key&&(o="replace");const s=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](s,{id:r,...e.state}),this.latestLoadPromise};getRouteMatch=t=>this.state.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>(r.matchesById[t]||console.warn(`No match found with id: ${t}`),{...r,matchesById:{...r.matchesById,[t]:e(r.matchesById[t])}})))};setRouteMatchData=(t,e,r)=>{const o=this.getRouteMatch(t);if(!o)return;const s=this.getRoute(o.routeId),n=r?.updatedAt??Date.now(),a=n+(r?.maxAge??s.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3),i=n+(r?.maxAge??s.options.maxAge??this.options.defaultMaxAge??1/0);this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:S(e,t.loaderData),preloadInvalidAt:a,invalidAt:i}))),this.state.matches.find((e=>e.id===t))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),r=this.state.matches[e+1];if(r)return this.invalidate({matchId:r.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.reload()};getIsInvalid=t=>{if(!t?.matchId)return!!this.state.matches.find((e=>this.getIsInvalid({matchId:e.id,preload:t?.preload})));const e=this.getRouteMatch(t?.matchId);if(!e)return!1;const r=Date.now();return e.invalid||(t?.preload?e.preloadInvalidAt:e.invalidAt)<r}},t.RouterContext=class{constructor(){}createRootRoute=t=>new U(t)},t.RouterProvider=function({router:t,...e}){t.update(e),s.useEffect((()=>{let e;return s.startTransition((()=>{e=t.mount()})),e}),[t]);const r=t.options.Wrap||s.Fragment;return s.createElement(s.Suspense,{fallback:null},s.createElement(r,null,s.createElement(it.Provider,{value:t},s.createElement(ht,null))))},t.ScrollRestoration=function(){const t=ut(),e=t=>t.key,r=s.useRef(!1);return Z((()=>{const{history:o}=window;o.scrollRestoration&&(o.scrollRestoration="manual");const s=r=>{const o=e(t.state.resolvedLocation);rt[o]||(rt[o]=new WeakSet);const s=rt[o];if(s.has(r.target))return;s.add(r.target);const a=[o,r.target===document||r.target===window?tt:n(r.target)].join(et);ot.current[a]||ot.set(a,{scrollX:NaN,scrollY:NaN})},n=t=>{let e,r=[];for(;e=t.parentNode;)r.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${r.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",s,!0);const a=t.subscribe("onBeforeLoad",(t=>{t.pathChanged&&(t=>{const r=e(t);for(const t in ot.current){const e=ot.current[t],[o,s]=t.split(et);if(r===o){if(s===tt)e.scrollX=window.scrollX||0,e.scrollY=window.scrollY||0;else if(s){const t=document.querySelector(s);e.scrollX=t?.scrollLeft||0,e.scrollY=t?.scrollTop||0}ot.set(t,e)}}})(t.from)})),i=t.subscribe("onLoad",(t=>{t.pathChanged&&(r.current=!0)}));return()=>{document.removeEventListener("scroll",s),a(),i()}}),[]),Z((()=>{r.current&&(r.current=!1,(()=>{const r=e(t.state.location);let o=!1;for(const t in ot.current){const e=ot.current[t],[s,n]=t.split(et);if(s===r)if(n===tt)o=!0,window.scrollTo(e.scrollX,e.scrollY);else if(n){const t=document.querySelector(n);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}o||window.scrollTo(0,0)})())})),null},t.SearchParamError=G,t.cleanPath=C,t.componentTypes=q,t.createBrowserHistory=y,t.createHashHistory=function(){return y({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=g,t.decode=H,t.defaultParseSearch=z,t.defaultStringifySearch=W,t.encode=T,t.functionalUpdate=S,t.interpolatePath=k,t.invariant=h,t.isPlainObject=x,t.isRedirect=V,t.joinPaths=P,t.last=b,t.lazyFn=function(t,e){return async(...r)=>(await t())[e||"default"](...r)},t.lazyRouteComponent=function(t,e){let r;const o=()=>(r||(r=t()),r),n=s.lazy((async()=>({default:(await o())[e??"default"]})));return n.preload=o,n},t.matchByPath=B,t.matchIdsContext=at,t.matchPathname=D,t.parsePathname=j,t.parseSearchWith=Y,t.partialDeepEqual=_,t.pick=R,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=E,t.resolvePath=A,t.rootRouteId=N,t.routerContext=it,t.shallow=function(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0},t.stringifySearchWith=J,t.trimPath=O,t.trimPathLeft=M,t.trimPathRight=L,t.useBlocker=xt,t.useDehydrate=function(){const t=ut();return s.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=ut();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=ut();return s.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=st,t.useLoader=dt,t.useMatch=lt,t.useMatchRoute=mt,t.useMatches=function(t){const e=s.useContext(at);return ct({select:r=>{const o=r.matches.slice(r.matches.findIndex((t=>t.id===e[0])));return t?.select?.(o)??o}})},t.useNavigate=function(t){const e=ut();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=ft,t.useRouteContext=function(t){return lt({...t,select:e=>t?.select?.(e.routeContext)??e.routeContext})},t.useRouter=ut,t.useRouterContext=function(t){return lt({...t,select:e=>t?.select?.(e.context)??e.context})},t.useRouterState=ct,t.useSearch=pt,t.useStore=i,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})}));
const u="pushstate",l="popstate",d="beforeunload",p=t=>(t.preventDefault(),t.returnValue=""),f=()=>{removeEventListener(d,p,{capture:!0})};function m(t){let e=t.getLocation(),r=()=>{},o=new Set,s=[],n=[];const a=()=>{if(s.length)s[0]?.(a,(()=>{s=[],f()}));else{for(;n.length;)n.shift()?.();t.subscriber||c()}},i=t=>{n.push(t),a()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},subscribe:e=>(0===o.size&&(r="function"==typeof t.subscriber?t.subscriber(c):()=>{}),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(s.push(t),1===s.length&&addEventListener(d,p,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.length||f()})}}function y(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return m({getLocation:()=>v(e(),history.state),subscriber:t=>{window.addEventListener(u,t),window.addEventListener(l,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(u,t),window.removeEventListener(l,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:w()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:w()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function g(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return m({getLocation:()=>v(e[r],o),subscriber:!1,pushState:(t,s)=>{o={...s,key:w()},e.push(t),r++},replaceState:(t,s)=>{o={...s,key:w()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function v(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function w(){return(Math.random()+1).toString(36).substring(7)}function b(t){return t[t.length-1]}function S(t,e){return"function"==typeof t?t(e):t}function R(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function E(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||x(t)&&x(r)){const e=o?t.length:Object.keys(t).length,s=o?r:Object.keys(r),n=s.length,a=o?[]:{};let i=0;for(let e=0;e<n;e++){const n=o?e:s[e];a[n]=E(t[n],r[n]),a[n]===t[n]&&i++}return e===n&&i===e?t:a}return r}function x(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!I(r)&&!!r.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function _(t,e){return t===e||typeof t==typeof e&&(x(t)&&x(e)?!Object.keys(e).some((r=>!_(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>_(t,e[r])))))}function P(t){return C(t.filter(Boolean).join("/"))}function C(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function L(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function O(t){return L(M(t))}function A(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=j(e);const s=j(r);s.forEach(((t,e)=>{if("/"===t.value)e?e===s.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===b(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return C(P([t,...o.map((t=>t.value))]))}function j(t){if(!t)return[];const e=[];if("/"===(t=C(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function k(t,e,r=!1){return P(j(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function D(t,e,r){const o=B(t,e,r);if(!r.to||o)return o??{}}function B(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,s=j(e),n=j(o);e.startsWith("/")||s.unshift({type:"pathname",value:"/"}),o.startsWith("/")||n.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(s.length,n.length);t++){const e=s[t],o=n[t],i=t>=s.length-1,c=t>=n.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=P(s.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function T(t,e){var r,o,s,n="";for(r in t)if(void 0!==(s=t[r]))if(Array.isArray(s))for(o=0;o<s.length;o++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s[o]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s);return(e||"")+n}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function H(t){for(var e,r,o={},s=t.split("&");e=s.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],$(e.shift())):o[r]=$(e.shift());return o}const N="__root__";class F{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,F.__onInit(this)}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=N:h(this.parentRoute);let o=r?N:e.path;o&&"/"!==o&&(o=O(o));const s=e?.id||o;let n=r?N:P([this.parentRoute.id===N?"":this.parentRoute.id,s]);o===N&&(o="/"),n!==N&&(n=P(["/",n]));const a=n===N?"/":P([this.parentRoute.fullPath,o]);this.path=o,this.id=n,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class U extends F{constructor(t){super(t)}}const z=Y(JSON.parse),W=J(JSON.stringify,JSON.parse);function Y(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=H(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function J(t,e){function r(r){if("object"==typeof r&&null!==r)try{return t(r)}catch(t){}else if("string"==typeof r&&"function"==typeof e)try{return e(r),t(r)}catch(t){}return r}return t=>{(t={...t})&&Object.keys(t).forEach((e=>{const o=t[e];void 0===o||void 0===o?delete t[e]:Array.isArray(o)?t[e]=o.map(r):t[e]=r(o)}));const e=T(t).toString();return e?`?${e}`:""}}const q=["component","errorComponent","pendingComponent"];const K="undefined"==typeof window||!window.document.createElement;function X(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],lastUpdated:Date.now()}}function V(t){return!!t?.isRedirect}class G extends Error{}class Q extends Error{}const Z="window",tt="___";let et,rt={},ot=!1;const st="undefined"!=typeof window&&window.sessionStorage,nt=t=>t.key;function at(t,e){const r=e?.getKey||nt;st&&(et||(et=(()=>{const t="tsr-scroll-restoration-v1",e=JSON.parse(window.sessionStorage.getItem(t)||"{}");return{current:e,set:(r,o)=>{e[r]=o,window.sessionStorage.setItem(t,JSON.stringify(et))}}})()));const{history:o}=window;o.scrollRestoration&&(o.scrollRestoration="manual");const s=e=>{const o=r(t.state.resolvedLocation);rt[o]||(rt[o]=new WeakSet);const s=rt[o];if(s.has(e.target))return;s.add(e.target);const a=[o,e.target===document||e.target===window?Z:n(e.target)].join(tt);et.current[a]||et.set(a,{scrollX:NaN,scrollY:NaN})},n=t=>{let e,r=[];for(;e=t.parentNode;)r.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${r.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",s,!0);const a=t.subscribe("onBeforeLoad",(t=>{t.pathChanged&&(t=>{const e=r(t);for(const t in et.current){const r=et.current[t],[o,s]=t.split(tt);if(e===o){if(s===Z)r.scrollX=window.scrollX||0,r.scrollY=window.scrollY||0;else if(s){const t=document.querySelector(s);r.scrollX=t?.scrollLeft||0,r.scrollY=t?.scrollTop||0}et.set(t,r)}}})(t.from)})),i=t.subscribe("onLoad",(t=>{t.pathChanged&&(ot=!0)}));return()=>{document.removeEventListener("scroll",s),a(),i()}}function it(t,e){if(ot){ot=!1;const r=(e?.getKey||nt)(t.state.location);let o=!1;for(const t in et.current){const e=et.current[t],[s,n]=t.split(tt);if(s===r)if(n===Z)o=!0,window.scrollTo(e.scrollX,e.scrollY);else if(n){const t=document.querySelector(n);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}o||window.scrollTo(0,0)}}const ct="undefined"!=typeof window?s.useLayoutEffect:s.useEffect;function ht(t){const e=yt();ct((()=>at(e,t)),[]),ct((()=>{it(e,t)}))}function ut(t){const e=yt(),{type:r,children:o,target:n,activeProps:a=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:b,onMouseEnter:R,onMouseLeave:E,onTouchStart:x,...I}=t,_=e.buildLink(t);if("external"===_.type){const{href:t}=_;return{href:t}}const{handleClick:P,handleFocus:C,handleEnter:M,handleLeave:L,handleTouchStart:O,isActive:A,next:j}=_,k=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=A?S(a,{})??{}:{},B=A?{}:S(i,{})??{};return{...D,...B,...I,href:h?void 0:j.href,onClick:k([w,e=>{(t.startTransition??1)&&(s.startTransition||(t=>t))((()=>{P(e)}))}]),onFocus:k([b,C]),onMouseEnter:k([R,M]),onMouseLeave:k([E,L]),onTouchStart:k([x,O]),target:n,style:{...g,...D.style,...B.style},className:[v,D.className,B.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}F.__onInit=t=>{Object.assign(t,{useMatch:(e={})=>gt({...e,from:t.id}),useLoader:(e={})=>vt({...e,from:t.id}),useContext:(e={})=>gt({...e,from:t.id,select:t=>e?.select?.(t.context)??t.context}),useRouteContext:(e={})=>gt({...e,from:t.id,select:t=>e?.select?.(t.routeContext)??t.routeContext}),useSearch:(e={})=>wt({...e,from:t.id}),useParams:(e={})=>bt({...e,from:t.id})})};const lt=s.forwardRef(((t,e)=>{const r=ut(t);return s.createElement("a",n({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const dt=s.createContext(null),pt=s.createContext(null);function ft(t){return i(yt().__store,t?.select)}function mt(){const t=yt(),e=ft({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatchIds:e.matchIds});return s.createElement(dt.Provider,{value:[void 0,...e]},s.createElement(Pt,{errorComponent:Mt,onCatch:()=>{}},s.createElement(Rt,null)))}function yt(){return s.useContext(pt)}function gt(t){const e=yt(),r=s.useContext(dt)[0],o=e.getRouteMatch(r)?.routeId,n=ft({select:e=>{const o=e.matches;return(t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r))).routeId}});(t?.strict??1)&&h(o==n);return ft({select:e=>{const o=e.matches,s=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return h(s,t?.from&&t.from),t?.select?.(s)??s}})}function vt(t){return gt({...t,select:e=>t?.select?.(e.loaderData)??e.loaderData})}function wt(t){return gt({...t,select:e=>t?.select?.(e.search)??e.search})}function bt(t){return ft({select:e=>{const r=b(e.matches)?.params;return t?.select?.(r)??r}})}function St(){const t=yt();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...s}=e;return t.matchRoute(s,{pending:r,caseSensitive:o})}),[])}function Rt(){const t=s.useContext(dt).slice(1);return t[0]?s.createElement(xt,{matchIds:t}):null}const Et=()=>null;function xt({matchIds:t}){const e=yt(),r=t[0],o=e.getRouteMatch(r).routeId,n=e.getRoute(o),a=n.options.pendingComponent??e.options.defaultPendingComponent??Et,i=n.options.errorComponent??e.options.defaultErrorComponent??Mt,c=n.options.wrapInSuspense??!n.isRoot?s.Suspense:_t,h=i?Pt:_t;return s.createElement(dt.Provider,{value:t},s.createElement(c,{fallback:s.createElement(a,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams})},s.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{}},s.createElement(It,{matchId:r,PendingComponent:a}))))}function It({matchId:t,PendingComponent:e}){const r=yt(),o=ft({select:e=>R(e.matchesById[t],["status","loadPromise","routeId","error"])}),n=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return s.createElement(e,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams});if("success"===o.status){let t=n.options.component??r.options.defaultComponent;return t?s.createElement(t,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams}):s.createElement(Rt,null)}h(!1)}function _t(t){return s.createElement(s.Fragment,null,t.children)}class Pt extends s.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),this.setState({error:t,info:e})}render(){return s.createElement(Ct,n({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function Ct(t){const e=ft({select:t=>t.resolvedLocation.key}),[r,o]=s.useState(t.errorState),n=t.errorComponent??Mt,a=s.useRef("");return s.useEffect((()=>{r&&e!==a.current&&o({}),a.current=e}),[r,e]),s.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?s.createElement(n,r):t.children}function Mt({error:t}){const[e,r]=s.useState(!1);return s.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},s.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},s.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),s.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((t=>!t))},e?"Hide Error":"Show Error")),s.createElement("div",{style:{height:".25rem"}}),e?s.createElement("div",null,s.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?s.createElement("code",null,t.message):null)):null)}function Lt(t,e=!0){const r=yt();s.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}t.Block=function({message:t,condition:e,children:r}){return Lt(t,e),r??null},t.ErrorComponent=Mt,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new F(t);return e.isRoot=!1,e}},t.Link=lt,t.MatchRoute=function(t){const e=St()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=yt();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=Rt,t.PathParamError=Q,t.RootRoute=U,t.Route=F,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??W,parseSearch:t?.parseSearch??z},this.__store=new a(X(),{onUpdate:()=>{const t=this.state,e=this.__store.state,r=t.matchesById!==e.matchesById;let o,s;r||(o=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,r)=>t!==e.matchIds[r])),s=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,r)=>t!==e.pendingMatchIds[r]))),(r||o)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(r||s)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},defaultPriority:"low"}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}subscribers=new Set;subscribe=(t,e)=>{const r={eventType:t,fn:e};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}};#r=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};reset=()=>{this.__store.setState((t=>Object.assign(t,X())))};mount=()=>{this.safeLoad()};update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(K?g():y());const t=this.#o();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.subscribe((()=>{this.safeLoad({next:this.#o(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${O(e??"")??""}`,r&&r!==this.routeTree&&this.#s(r),this};buildNext=t=>{const e=this.#n(t),r=this.matchRoutes(e.pathname,e.search);return this.#n({...t,__matches:r})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(r,o)=>{const s=this.state.resolvedLocation,n=!(!t?.next||s.href===t.next.href);let a;const i=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let c;this.#r({type:"onBeforeLoad",from:s,to:t?.next??this.state.location,pathChanged:n}),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),c=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:c.map((t=>t.id)),matchesById:this.#a(t.matchesById,c)})))}));try{try{await this.loadMatches(c)}catch(t){}if(a=i())return a;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),this.#r({type:"onLoad",from:s,to:this.state.location,pathChanged:n}),r()}catch(t){if(a=i())return a;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};#a=(t,e)=>{const r={...t};let o=!1;return e.forEach((t=>{r[t.id]||(o=!0,r[t.id]=t)})),o?r:t};getRoute=t=>{const e=this.routesById[t];return h(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#a(t.matchesById,r)}))),await this.loadMatches(r,{preload:!0,maxAge:t.maxAge}),r};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const r=this.getRoute(e.routeId);return!this.state.matchIds.includes(e.id)&&!this.state.pendingMatchIds.includes(e.id)&&e.preloadInvalidAt<t&&(!r.options.gcMaxAge||e.updatedAt+r.options.gcMaxAge<t)})).map((t=>t.id));e.length&&this.__store.setState((t=>{const r={...t.matchesById};return e.forEach((t=>{delete r[t]})),{...t,matchesById:r}}))};matchRoutes=(t,e,r)=>{let o={},s=this.flatRoutes.find((e=>{const r=D(this.basepath,L(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(o=r,!0)}))||this.routesById.__root__,n=[s];for(;s?.parentRoute;)s=s.parentRoute,s&&n.unshift(s);const a=n.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(o);Object.assign(o,e)}catch(t){if(e=new Q(t.message,{cause:t}),r?.throwOnError)throw e;return e}})),i=n.map(((t,r)=>{const s=k(t.path,o),n=t.options.key?t.options.key({params:o,search:e})??"":"",i=n?JSON.stringify(n):"",c=k(t.id,o,!0)+i,h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!q.some((e=>t.options[e]?.preload)));return{id:c,key:i,routeId:t.id,params:o,pathname:P([this.basepath,s]),updatedAt:Date.now(),invalidAt:1/0,preloadInvalidAt:1/0,routeSearch:{},search:{},status:u?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:a[r],searchError:void 0,loaderData:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,o)=>{const s=i[o-1],n=this.getRoute(t.routeId),a=(()=>{const o={search:s?.search??e,routeSearch:s?.routeSearch??e};try{const e=("object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch)?.(o.search)??{},r={...o.search,...e};return{routeSearch:E(t.routeSearch,e),search:E(t.search,r)}}catch(e){if(t.searchError=new G(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})();Object.assign(t,{...a});const c=(()=>{try{const e=n.options.getContext?.({parentContext:s?.routeContext??{},context:s?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...s?.context??this?.options.context,...e},routeContext:e}}catch(t){throw n.options.onError?.(t),t}})();Object.assign(t,{...c})})),i};loadMatches=async(t,e)=>{let r;this.cleanMatches(),e?.preload||t.forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params})))}));try{for(const[o,s]of t.entries()){const t=this.getRoute(s.routeId),n=(e,n)=>{if(e.routerCode=n,r=r??o,V(e))throw e;try{t.options.onError?.(e)}catch(t){if(e=t,V(t))throw t}this.setRouteMatch(s.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};s.paramsError&&n(s.paramsError,"PARSE_PARAMS"),s.searchError&&n(s.searchError,"VALIDATE_SEARCH");let a=!1;try{await(t.options.beforeLoad?.({...s,preload:!!e?.preload}))}catch(t){n(t,"BEFORE_LOAD"),a=!0}if(a)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),s=[];o.forEach(((t,r)=>{s.push((async()=>{const o=s[r-1],n=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!this.getIsInvalid({matchId:t.id,preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const a=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0},c=t=>!!V(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let r;try{const s=Promise.all(q.map((async t=>{const e=n.options[t];e?.preload&&await e.preload()}))),a=n.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:o}),[c,h]=await Promise.all([s,a]);if(r=i())return await r;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){if(r=i())return await r;if(c(e))return;try{n.options.onError?.(e)}catch(t){if(e=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let u;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:a,invalid:!1}))),u=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:u})))})),await u})())})),await Promise.all(s)};reload=()=>this.navigate({fromCurrent:!0,replace:!0,search:!0});resolvePath=(t,e)=>A(this.basepath,t,C(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:s,params:n})=>{const a=String(e),i=void 0===t?t:String(t);let c;try{new URL(`${a}`),c=!0}catch(t){}return h(!c),this.#e({from:i,to:a,search:r,hash:o,replace:s,params:n})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const o=e?.pending?this.state.location:this.state.resolvedLocation;if(!o)return!1;const s=D(this.basepath,o.pathname,{...e,to:r.pathname});return!!s&&(e?.includeSearch??1?!!_(o.search,r.search)&&s:s)};buildLink=({from:t,to:e=".",search:r,params:o,hash:s,target:n,replace:a,activeOptions:i,preload:c,preloadDelay:h,disabled:u,state:l})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const d={from:t,to:e,search:r,params:o,hash:s,replace:a,state:l},p=this.buildNext(d);c=c??this.options.defaultPreload;const f=h??this.options.defaultPreloadDelay??0,m=this.state.location.pathname.split("/"),y=p.pathname.split("/").every(((t,e)=>t===m[e])),g=i?.exact?this.state.location.pathname===p.pathname:y,v=!i?.includeHash||this.state.location.hash===p.hash,w=!(i?.includeSearch??1)||_(this.state.location.search,p.search);return{type:"internal",next:p,handleFocus:t=>{c&&this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||n&&"_self"!==n||0!==t.button||(t.preventDefault(),this.#e(d))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),f)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:g&&v&&w,disabled:u}};dehydrate=()=>({state:R(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),h(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;this.__store.setState((t=>({...t,...o,resolvedLocation:o.location}))),await this.load()};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const r="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${r}`,o="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${s=r,s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(o)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var s})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#s=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(h(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=L(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&e(o)}))};e([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const r=O(t.fullPath),o=j(r);for(;o.length>1&&"/"===o[0]?.value;)o.shift();const s=o.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:o,index:e,score:s}})).sort(((t,e)=>{let r="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==r)return r;const o=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let r=0;r<o;r++)if(t.score[r]!==e.score[r])return e.score[r]-t.score[r];for(let r=0;r<o;r++)if(t.parsed[r].value!==e.parsed[r].value)return t.parsed[r].value>e.parsed[r].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#o=t=>{let{pathname:e,search:r,hash:o,state:s}=this.history.location;const n=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:E(t?.search,n),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:s,key:s?.key||"__init__"}};#n=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=A(this.basepath??"/",e,`${t.to??""}`);const o={...b(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let s=!0===(t.params??!0)?o:S(t.params,o);s&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{s={...s,...t(s)}})),r=k(r,s??{});const n=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],a=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=n?.length?n?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?S(t.search,i)??{}:n?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=E(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:S(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:S(t.state,this.state.location.state),hash:d,href:this.history.createHref(`${r}${l}${p}`),key:t.key}};#e=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let o="replace";t.replace||(o="push");this.state.location.href===e.href&&!e.key&&(o="replace");const s=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](s,{id:r,...e.state}),this.latestLoadPromise};getRouteMatch=t=>this.state.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>(r.matchesById[t]||console.warn(`No match found with id: ${t}`),{...r,matchesById:{...r.matchesById,[t]:e(r.matchesById[t])}})))};setRouteMatchData=(t,e,r)=>{const o=this.getRouteMatch(t);if(!o)return;const s=this.getRoute(o.routeId),n=r?.updatedAt??Date.now(),a=n+(r?.maxAge??s.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3),i=n+(r?.maxAge??s.options.maxAge??this.options.defaultMaxAge??1/0);this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:S(e,t.loaderData),preloadInvalidAt:a,invalidAt:i}))),this.state.matches.find((e=>e.id===t))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),r=this.state.matches[e+1];if(r)return this.invalidate({matchId:r.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.reload()};getIsInvalid=t=>{if(!t?.matchId)return!!this.state.matches.find((e=>this.getIsInvalid({matchId:e.id,preload:t?.preload})));const e=this.getRouteMatch(t?.matchId);if(!e)return!1;const r=Date.now();return e.invalid||(t?.preload?e.preloadInvalidAt:e.invalidAt)<r}},t.RouterContext=class{constructor(){}createRootRoute=t=>new U(t)},t.RouterProvider=function({router:t,...e}){t.update(e),s.useEffect((()=>{let e;return s.startTransition((()=>{e=t.mount()})),e}),[t]);const r=t.options.Wrap||s.Fragment;return s.createElement(s.Suspense,{fallback:null},s.createElement(r,null,s.createElement(pt.Provider,{value:t},s.createElement(mt,null))))},t.ScrollRestoration=function(t){return ht(t),null},t.SearchParamError=G,t.cleanPath=C,t.componentTypes=q,t.createBrowserHistory=y,t.createHashHistory=function(){return y({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=g,t.decode=H,t.defaultParseSearch=z,t.defaultStringifySearch=W,t.encode=T,t.functionalUpdate=S,t.interpolatePath=k,t.invariant=h,t.isPlainObject=x,t.isRedirect=V,t.joinPaths=P,t.last=b,t.lazyFn=function(t,e){return async(...r)=>(await t())[e||"default"](...r)},t.lazyRouteComponent=function(t,e){let r;const o=()=>(r||(r=t()),r),n=s.lazy((async()=>({default:(await o())[e??"default"]})));return n.preload=o,n},t.matchByPath=B,t.matchIdsContext=dt,t.matchPathname=D,t.parsePathname=j,t.parseSearchWith=Y,t.partialDeepEqual=_,t.pick=R,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=E,t.resolvePath=A,t.restoreScrollPositions=it,t.rootRouteId=N,t.routerContext=pt,t.shallow=function(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0},t.stringifySearchWith=J,t.trimPath=O,t.trimPathLeft=M,t.trimPathRight=L,t.useBlocker=Lt,t.useDehydrate=function(){const t=yt();return s.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=yt();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=yt();return s.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=ut,t.useLoader=vt,t.useMatch=gt,t.useMatchRoute=St,t.useMatches=function(t){const e=s.useContext(dt);return ft({select:r=>{const o=r.matches.slice(r.matches.findIndex((t=>t.id===e[0])));return t?.select?.(o)??o}})},t.useNavigate=function(t){const e=yt();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=bt,t.useRouteContext=function(t){return gt({...t,select:e=>t?.select?.(e.routeContext)??e.routeContext})},t.useRouter=yt,t.useRouterContext=function(t){return gt({...t,select:e=>t?.select?.(e.context)??e.context})},t.useRouterState=ft,t.useScrollRestoration=ht,t.useSearch=wt,t.useStore=i,t.warning=function(t,e){},t.watchScrollPositions=at,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/react-router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.163",
"version": "0.0.1-beta.164",
"license": "MIT",

@@ -46,4 +46,4 @@ "repository": "tanstack/router",

"@gisatcz/cross-package-react-context": "^0.2.0",
"@tanstack/router-core": "0.0.1-beta.163",
"@tanstack/react-store": "0.0.1-beta.163"
"@tanstack/router-core": "0.0.1-beta.164",
"@tanstack/react-store": "0.0.1-beta.164"
},

@@ -50,0 +50,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc