@tanstack/react-router 0.0.1-beta.213 → 0.0.1-beta.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/CatchBoundary.js +1 -0
- package/build/cjs/CatchBoundary.js.map +1 -1
- package/build/cjs/Matches.js +14 -4
- package/build/cjs/Matches.js.map +1 -1
- package/build/cjs/RouterProvider.js +80 -69
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/fileRoute.js.map +1 -1
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/route.js +6 -0
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +101 -74
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +267 -267
- package/build/types/Matches.d.ts +4 -1
- package/build/types/RouterProvider.d.ts +2 -1
- package/build/types/fileRoute.d.ts +3 -3
- package/build/types/route.d.ts +28 -20
- package/build/types/router.d.ts +1 -1
- package/build/umd/index.development.js +101 -73
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/CatchBoundary.tsx +1 -0
- package/src/Matches.tsx +31 -9
- package/src/RouterProvider.tsx +97 -89
- package/src/fileRoute.ts +10 -2
- package/src/route.ts +58 -17
- package/src/router.ts +1 -1
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* LICENSE.md file in the root directory of this source tree.
|
|
19
19
|
*
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/const o="pushstate",a="popstate",s="beforeunload",c=e=>(e.preventDefault(),e.returnValue=""),i=()=>{removeEventListener(s,c,{capture:!0})};function u(e){let t=e.getLocation(),r=new Set,n=[],o=[];const a=()=>{t=e.getLocation(),r.forEach((e=>e()))},u=()=>{if(n.length)n[0]?.(u,(()=>{n=[],i()}));else for(;o.length;)o.shift()?.()},h=e=>{o.push(e),u()};return{get location(){return t},subscribe:e=>(r.add(e),()=>{r.delete(e)}),push:(t,r)=>{r=l(r),h((()=>{e.pushState(t,r,a)}))},replace:(t,r)=>{r=l(r),h((()=>{e.replaceState(t,r,a)}))},go:t=>{h((()=>{e.go(t)}))},back:()=>{h((()=>{e.back()}))},forward:()=>{h((()=>{e.forward()}))},createHref:t=>e.createHref(t),block:e=>(n.push(e),1===n.length&&addEventListener(s,c,{capture:!0}),()=>{n=n.filter((t=>t!==e)),n.length||i()}),flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function l(e){return e||(e={}),{...e,key:f()}}function h(e){const t=e?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=e?.createHref??(e=>e);let n=d(t(),window.history.state);let s,c,i=!0;const l=()=>{i=!1,(()=>{s&&(window.history[s.isPush?"pushState":"replaceState"](s.state,"",s.href),s=void 0,c=void 0)})(),i=!0},h=(e,t,o,a)=>{const i=r(t);n=d(i,o),s={href:i,state:o,isPush:s?.isPush||"push"===e},a(),c||(c=Promise.resolve().then((()=>l())))},f=()=>{n=d(t(),window.history.state),y.notify()};var p=window.history.pushState,m=window.history.replaceState;const y=u({getLocation:()=>n,pushState:(e,t,r)=>h("push",e,t,r),replaceState:(e,t,r)=>h("replace",e,t,r),back:()=>window.history.back(),forward:()=>window.history.forward(),go:e=>window.history.go(e),createHref:e=>r(e),flush:l,destroy:()=>{window.history.pushState=p,window.history.replaceState=m,window.removeEventListener(o,f),window.removeEventListener(a,f)}});return window.addEventListener(o,f),window.addEventListener(a,f),window.history.pushState=function(){let e=p.apply(window.history,arguments);return i&&y.notify(),e},window.history.replaceState=function(){let e=m.apply(window.history,arguments);return i&&y.notify(),e},y}function d(e,t){let r=e.indexOf("#"),n=e.indexOf("?");return{href:e,pathname:e.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:e.length),hash:r>-1?e.substring(r):"",search:n>-1?e.slice(n,-1===r?void 0:r):"",state:t||{}}}function f(){return(Math.random()+1).toString(36).substring(7)}function p(e,t){if(!e)throw new Error("Invariant failed")}function m(e,t){}function y(e){const t=e.errorComponent??v;return n.createElement(g,{resetKey:e.resetKey,onCatch:e.onCatch,children:({error:r})=>r?n.createElement(t,{error:r}):e.children})}class g extends n.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e,t){t.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}componentDidCatch(e){this.props.onCatch?.(e)}render(){return this.props.children(this.state)}}function v({error:e}){const[t,r]=n.useState(!1);return n.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},n.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),n.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((e=>!e))},t?"Hide Error":"Show Error")),n.createElement("div",{style:{height:".25rem"}}),t?n.createElement("div",null,n.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},e.message?n.createElement("code",null,e.message):null)):null)}const w="undefined"==typeof document;function S(e){return e[e.length-1]}function b(e,t){return"function"==typeof e?e(t):e}function E(e,t){return t.reduce(((t,r)=>(t[r]=e[r],t)),{})}function R(e,t){if(e===t)return e;const r=t,n=Array.isArray(e)&&Array.isArray(r);if(n||C(e)&&C(r)){const t=n?e.length:Object.keys(e).length,o=n?r:Object.keys(r),a=o.length,s=n?[]:{};let c=0;for(let t=0;t<a;t++){const a=n?t:o[t];s[a]=R(e[a],r[a]),s[a]===e[a]&&c++}return t===a&&c===t?e:s}return r}function C(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!x(r)&&!!r.hasOwnProperty("isPrototypeOf")}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function P(e,t){return e===t||typeof e==typeof t&&(C(e)&&C(t)?!Object.keys(t).some((r=>!P(e[r],t[r]))):!(!Array.isArray(e)||!Array.isArray(t))&&!(e.length!==t.length||e.some(((e,r)=>!P(e,t[r])))))}function L(e){const t=n.useRef(e);t.current=e;return n.useRef(((...e)=>t.current(...e))).current}const k="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function O(e){return _(e.filter(Boolean).join("/"))}function _(e){return e.replace(/\/{2,}/g,"/")}function T(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function M(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function I(e){return M(T(e))}function j(e,t,r){t=t.replace(new RegExp(`^${e}`),"/"),r=r.replace(new RegExp(`^${e}`),"/");let n=$(t);const o=$(r);o.forEach(((e,t)=>{if("/"===e.value)t?t===o.length-1&&n.push(e):n=[e];else if(".."===e.value)n.length>1&&"/"===S(n)?.value&&n.pop(),n.pop();else{if("."===e.value)return;n.push(e)}}));return _(O([e,...n.map((e=>e.value))]))}function $(e){if(!e)return[];const t=[];if("/"===(e=_(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const r=e.split("/").filter(Boolean);return t.push(...r.map((e=>"$"===e||"*"===e?{type:"wildcard",value:e}:"$"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function A(e,t,r=!1){return O($(e).map((e=>{if("wildcard"===e.type){const n=t[e.value];return r?`${e.value}${n??""}`:n}return"param"===e.type?t[e.value.substring(1)]??"":e.value})))}function N(e,t,r){const n=D(e,t,r);if(!r.to||n)return n??{}}function D(e,t,r){t="/"!=e?t.substring(e.length):t;const n=`${r.to??"$"}`,o=$(t),a=$(n);t.startsWith("/")||o.unshift({type:"pathname",value:"/"}),n.startsWith("/")||a.unshift({type:"pathname",value:"/"});const s={};return(()=>{for(let e=0;e<Math.max(o.length,a.length);e++){const t=o[e],n=a[e],c=e>=o.length-1,i=e>=a.length-1;if(n){if("wildcard"===n.type)return!!t?.value&&(s["*"]=O(o.slice(e).map((e=>e.value))),!0);if("pathname"===n.type){if("/"===n.value&&!t?.value)return!0;if(t)if(r.caseSensitive){if(n.value!==t.value)return!1}else if(n.value.toLowerCase()!==t.value.toLowerCase())return!1}if(!t)return!1;if("param"===n.type){if("/"===t?.value)return!1;"$"!==t.value.charAt(0)&&(s[n.value.substring(1)]=t.value)}}if(!c&&i)return!!r.fuzzy}return!0})()?s:void 0}function B(e){return!!e?.isRedirect}function H(e,t){var r,n,o,a="";for(r in e)if(void 0!==(o=e[r]))if(Array.isArray(o))for(n=0;n<o.length;n++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o[n]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(t||"")+a}function K(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||(0*+t==0&&+t+""===t?+t:t))}function F(e){for(var t,r,n={},o=e.split("&");t=o.shift();)void 0!==n[r=(t=t.split("=")).shift()]?n[r]=[].concat(n[r],K(t.shift())):n[r]=K(t.shift());return n}const z=W(JSON.parse),U=X(JSON.stringify,JSON.parse);function W(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let r=F(t);for(let t in r){const n=r[t];if("string"==typeof n)try{r[t]=e(n)}catch(e){}}return r}}function X(e,t){return r=>{(r={...r})&&Object.keys(r).forEach((n=>{const o=r[n];void 0===o||void 0===o?delete r[n]:r[n]=function(r){if("object"==typeof r&&null!==r)try{return e(r)}catch(e){}else if("string"==typeof r&&"function"==typeof t)try{return t(r),e(r)}catch(e){}return r}(o)}));const n=H(r).toString();return n?`?${n}`:""}}const Y=["component","errorComponent","pendingComponent"];const q=n.createContext(null);"undefined"!=typeof document&&(window.__TSR_ROUTER_CONTEXT__=q);const J="Error preloading route! ☝️";class V extends Error{}class G extends Error{}function Q(e){return{status:"idle",resolvedLocation:e,location:e,matches:[],pendingMatches:[],lastUpdated:Date.now()}}function Z(e,t){return[...e.pendingMatches,...e.matches].find((e=>e.id===t))}function ee(e){const{state:t}=te();return e?.select?e.select(t):t}function te(){const e=window.__TSR_ROUTER_CONTEXT__||q;return n.useContext(e)}function re(){const{routesById:e,state:t}=te(),{matches:r}=t,o=ee().location.state.key,a=e[de],s=n.useCallback((e=>n.createElement(v,{...e,useMatch:a.useMatch,useRouteContext:a.useRouteContext,useSearch:a.useSearch,useParams:a.useParams})),[a]);return n.createElement(ue.Provider,{value:r},n.createElement(y,{resetKey:o,errorComponent:s,onCatch:()=>{}},r.length?n.createElement(oe,{matches:r}):null))}const ne=()=>null;function oe({matches:e}){const{options:t,routesById:r}=te(),o=e[0],a=o?.routeId,s=r[a],c=ee().location.state?.key,i=s.options.pendingComponent??t.defaultPendingComponent??ne,u=s.options.errorComponent??t.defaultErrorComponent??v,l=s.options.wrapInSuspense??n.Suspense,h=n.useCallback((e=>n.createElement(u,{...e,useMatch:s.useMatch,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams})),[s]);return n.createElement(ue.Provider,{value:e},n.createElement(l,{fallback:n.createElement(i,{useMatch:s.useMatch,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams})},n.createElement(y,{resetKey:c,errorComponent:h,onCatch:()=>{o.id}},n.createElement(ae,{match:o}))))}function ae({match:e}){const{options:t,routesById:r}=te(),o=r[e.routeId];if("error"===e.status)throw e.error;if("pending"===e.status)throw e.loadPromise;if("success"===e.status){let e=o.options.component??t.defaultComponent;return e?n.createElement(e,{useMatch:o.useMatch,useRouteContext:o.useRouteContext,useSearch:o.useSearch,useParams:o.useParams}):n.createElement(se,null)}p(!1)}function se(){const e=n.useContext(ue).slice(1);return e[0]?n.createElement(oe,{matches:e}):null}function ce(){const{matchRoute:e}=te();return n.useCallback((t=>{const{pending:r,caseSensitive:n,...o}=t;return e(o,{pending:r,caseSensitive:n})}),[])}function ie(e){const t=n.useContext(ue)[0],r=t?.routeId,o=ee({select:r=>(e?.from?r.matches.find((t=>t.routeId===e?.from)):r.matches.find((e=>e.id===t.id))).routeId});(e?.strict??1)&&p(r==o);return ee({select:r=>{const n=e?.from?r.matches.find((t=>t.routeId===e?.from)):r.matches.find((e=>e.id===t.id));return p(n,e?.from&&e.from),e?.select?e.select(n):n}})}const ue=n.createContext(null);function le(e){return ee({select:t=>{const r=S(t.matches)?.params;return e?.select?e.select(r):r}})}function he(e){return ie({...e,select:t=>e?.select?e.select(t.search):t.search})}const de="__root__";class fe{constructor(e){this.options=e||{},this.isRoot=!e?.getParentRoute,fe.__onInit(this)}init=e=>{this.originalIndex=e.originalIndex;const t=this.options,r=!t?.path&&!t?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=de:p(this.parentRoute);let n=r?de:t.path;n&&"/"!==n&&(n=I(n));const o=t?.id||n;let a=r?de:O([this.parentRoute.id===de?"":this.parentRoute.id,o]);n===de&&(n="/"),a!==de&&(a=O(["/",a]));const s=a===de?"/":O([this.parentRoute.fullPath,n]);this.path=n,this.id=a,this.fullPath=s,this.to=s};addChildren=e=>(this.children=e,this);update=e=>(Object.assign(this.options,e),this);static __onInit=e=>{};useMatch=e=>ie({...e,from:this.id});useRouteContext=e=>ie({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context});useSearch=e=>he({...e,from:this.id});useParams=e=>le({...e,from:this.id})}class pe extends fe{constructor(e){super(e)}}function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},me.apply(this,arguments)}function ye(e){const{buildLink:t}=te(),r=ie({strict:!1}),{type:n,children:o,target:a,activeProps:s=(()=>({className:"active"})),inactiveProps:c=(()=>({})),activeOptions:i,disabled:u,hash:l,search:h,params:d,to:f,state:p,mask:m,preload:y,preloadDelay:g,replace:v,startTransition:w,resetScroll:S,style:E,className:R,onClick:C,onFocus:x,onMouseEnter:P,onMouseLeave:L,onTouchStart:k,...O}=e,_=t({from:e.to?r.pathname:void 0,...e});if("external"===_.type){const{href:e}=_;return{href:e}}const{handleClick:T,handleFocus:M,handleEnter:I,handleLeave:j,handleTouchStart:$,isActive:A,next:N}=_,D=e=>t=>{t.persist&&t.persist(),e.filter(Boolean).forEach((e=>{t.defaultPrevented||e(t)}))},B=A?b(s,{})??{}:{},H=A?{}:b(c,{})??{};return{...B,...H,...O,href:u?void 0:N.maskedLocation?N.maskedLocation.href:N.href,onClick:D([C,T]),onFocus:D([x,M]),onMouseEnter:D([P,I]),onMouseLeave:D([L,j]),onTouchStart:D([k,$]),target:a,style:{...E,...B.style,...H.style},className:[R,B.className,H.className].filter(Boolean).join(" ")||void 0,...u?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}const ge=n.forwardRef(((e,t)=>{const r=ye(e);return n.createElement("a",me({ref:t},r,{children:"function"==typeof e.children?e.children({isActive:"active"===r["data-status"]}):e.children}))})),ve="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,we="window";let Se,be=new WeakSet;const Ee="undefined"!=typeof window&&window.sessionStorage,Re=e=>e.state.key;function Ce(e){const{state:t,subscribe:r,resetNextScrollRef:n}=te();ve((()=>{const t=e?.getKey||Re;Ee&&(Se||(Se=(()=>{const e="tsr-scroll-restoration-v2";return{state:JSON.parse(window.sessionStorage.getItem(e)||"null")||{cached:{},next:{}},set:t=>{Se.state=b(t,Se.state),window.sessionStorage.setItem(e,JSON.stringify(Se.state))}}})()));const{history:o}=window;o.scrollRestoration&&(o.scrollRestoration="manual");const a=e=>{if(be.has(e.target))return;be.add(e.target);const t=e.target===document||e.target===window?we:s(e.target);Se.state.next[t]||Se.set((e=>({...e,next:{...e.next,[t]:{scrollX:NaN,scrollY:NaN}}})))},s=e=>{let t,r=[];for(;t=e.parentNode;)r.unshift(`${e.tagName}:nth-child(${[].indexOf.call(t.children,e)+1})`),e=t;return`${r.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",a,!0);const c=r("onBeforeLoad",(e=>{if(e.pathChanged){const r=t(e.fromLocation);for(const e in Se.state.next){const t=Se.state.next[e];if(e===we)t.scrollX=window.scrollX||0,t.scrollY=window.scrollY||0;else if(e){const r=document.querySelector(e);t.scrollX=r?.scrollLeft||0,t.scrollY=r?.scrollTop||0}Se.set((n=>{const o={...n.next};return delete o[e],{...n,next:o,cached:{...n.cached,[[r,e].join("___")]:t}}}))}}})),i=r("onResolved",(t=>{if(t.pathChanged){if(!n.current)return;n.current=!0;const r=(e?.getKey||Re)(t.toLocation);let o=!1;for(const e in Se.state.cached){const t=Se.state.cached[e],[n,a]=e.split("___");if(n===r)if(a===we)o=!0,window.scrollTo(t.scrollX,t.scrollY);else if(a){const e=document.querySelector(a);e&&(e.scrollLeft=t.scrollX,e.scrollTop=t.scrollY)}}o||window.scrollTo(0,0),Se.set((e=>({...e,next:{}}))),be=new WeakSet}}));return()=>{document.removeEventListener("scroll",a),c(),i()}}),[])}function xe(e,t=!0){const{history:r}=te();n.useEffect((()=>{if(!t)return;let n=r.block(((t,r)=>{window.confirm(e)&&(n(),t())}));return n}))}e.Block=function({message:e,condition:t,children:r}){return xe(e,t),r??null},e.CatchBoundary=y,e.CatchBoundaryImpl=g,e.ErrorComponent=v,e.FileRoute=class{constructor(e){this.path=e}createRoute=e=>{const t=new fe(e);return t.isRoot=!1,t}},e.Link=ge,e.Match=oe,e.MatchRoute=function(e){const t=ce()(e);return"function"==typeof e.children?e.children(t):t?e.children:null},e.Matches=re,e.Navigate=function(e){const{navigate:t}=te(),r=ie({strict:!1});return k((()=>{t({from:e.to?r.pathname:void 0,...e})}),[]),null},e.Outlet=se,e.PathParamError=G,e.RootRoute=pe,e.Route=fe,e.Router=class{constructor(e){this.options={defaultPreloadDelay:50,context:void 0,...e,stringifySearch:e?.stringifySearch??U,parseSearch:e?.parseSearch??z},this.routeTree=this.options.routeTree}subscribers=new Set;subscribe=(e,t)=>{const r={eventType:e,fn:t};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}};emit=e=>{this.subscribers.forEach((t=>{t.eventType===e.type&&t.fn(e)}))}},e.RouterProvider=function({router:e,...t}){const r={...e.options,...t,context:{...e.options.context,...t?.context}},o=n.useState((()=>r.history??h()))[0],a=n.useRef(`${Math.round(1e7*Math.random())}`),s=n.useRef(!0),c=n.useRef(null),i=n.useRef(Promise.resolve()),u=e=>i.current!==e?i.current:void 0,l=L((e=>{const t=({pathname:t,search:n,hash:o,state:a})=>{const s=r.parseSearch(n);return{pathname:t,searchStr:n,search:R(e?.search,s),hash:o.split("#").reverse()[0]??"",href:`${t}${n}${o}`,state:R(e?.state,a)}},n=t(o.location);let{__tempLocation:s,__tempKey:c}=n.state;if(s&&(!c||c===a.current)){const e=t(s);return e.state.key=n.state.key,delete e.state.__tempLocation,{...e,maskedLocation:n}}return n})),d=n.useRef(l()),[f,m]=n.useState((()=>Q(d.current))),[y,g]=n.useTransition(),v=n.useMemo((()=>({...f,status:y?"pending":"idle",location:y?d.current:f.location})),[f,y]);n.useLayoutEffect((()=>{y||v.resolvedLocation===v.location||(e.emit({type:"onResolved",fromLocation:v.resolvedLocation,toLocation:v.location,pathChanged:v.location.href!==v.resolvedLocation?.href}),m((e=>({...e,resolvedLocation:e.location}))))}));const w=`/${I(r.basepath??"")??""}`,C=L(((e,t)=>j(w,e,_(t)))),[x,k]=n.useMemo((()=>{const t={},r={},n=e=>{e.forEach(((e,o)=>{e.init({originalIndex:o});if(p(!t[e.id],String(e.id)),t[e.id]=e,!e.isRoot&&e.path){const t=M(e.fullPath);r[t]&&!e.fullPath.endsWith("/")||(r[t]=e)}const a=e.children;a?.length&&n(a)}))};return n([e.routeTree]),[t,r]}),[]),T=x,D=n.useMemo((()=>Object.values(k).map(((e,t)=>{const r=I(e.fullPath),n=$(r);for(;n.length>1&&"/"===n[0]?.value;)n.shift();const o=n.map((e=>"param"===e.type?.5:"wildcard"===e.type?.25:1));return{child:e,trimmed:r,parsed:n,index:t,score:o}})).sort(((e,t)=>{let r="/"===e.trimmed?1:"/"===t.trimmed?-1:0;if(0!==r)return r;const n=Math.min(e.score.length,t.score.length);if(e.score.length!==t.score.length)return t.score.length-e.score.length;for(let r=0;r<n;r++)if(e.score[r]!==t.score[r])return t.score[r]-e.score[r];for(let r=0;r<n;r++)if(e.parsed[r].value!==t.parsed[r].value)return e.parsed[r].value>t.parsed[r].value?1:-1;return e.trimmed!==t.trimmed?e.trimmed>t.trimmed?1:-1:e.index-t.index})).map(((e,t)=>(e.child.rank=t,e.child)))),[k]),H=L(((e,t,n)=>{let o={},a=D.find((t=>{const n=N(w,M(e),{to:t.fullPath,caseSensitive:t.options.caseSensitive??r.caseSensitive,fuzzy:!1});return!!n&&(o=n,!0)}))||x.__root__,s=[a];for(;a?.parentRoute;)a=a.parentRoute,a&&s.unshift(a);const c=s.map((e=>{let t;if(e.options.parseParams)try{const t=e.options.parseParams(o);Object.assign(o,t)}catch(e){if(t=new G(e.message,{cause:e}),n?.throwOnError)throw t;return t}})),i=s.map(((e,t)=>{const r=A(e.path,o),n=A(e.id,o,!0),a=Z(v,n);if(a)return{...a};const s=!(!e.options.load&&!Y.some((t=>e.options[t]?.preload)));return{id:n,routeId:e.id,params:o,pathname:O([w,r]),updatedAt:Date.now(),routeSearch:{},search:{},status:s?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:c[t],searchError:void 0,loadPromise:Promise.resolve(),context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((e,r)=>{const o=i[r-1],a=T[e.routeId],s=(()=>{const r={search:o?.search??t,routeSearch:o?.routeSearch??t};try{let t=("object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch)?.(r.search)??{},n={...r.search,...t};return t=R(e.routeSearch,t),n=R(e.search,n),{routeSearch:t,search:n,searchDidChange:e.routeSearch!==t}}catch(t){if(e.searchError=new V(t.message,{cause:t}),n?.throwOnError)throw e.searchError;return r}})();Object.assign(e,s)})),i})),K=L((e=>{Z(v,e)?.abortController?.abort()})),F=L((e=>{e.matches.forEach((e=>{K(e.id)}))})),z=L((e=>{const t=(e={},t)=>{const n=d.current,a=e.from??n.pathname;let s=C(a,`${e.to??""}`);const c=H(a,n.search),i=t?.filter((e=>c?.find((t=>t.routeId===e.routeId)))),u={...S(c)?.params};let l=!0===(e.params??!0)?u:b(e.params,u);l&&t?.map((e=>T[e.routeId].options.stringifyParams)).filter(Boolean).forEach((e=>{l={...l,...e(l)}})),s=A(s,l??{});const h=i?.map((e=>T[e.routeId].options.preSearchFilters??[])).flat().filter(Boolean)??[],f=i?.map((e=>T[e.routeId].options.postSearchFilters??[])).flat().filter(Boolean)??[],p=h?.length?h?.reduce(((e,t)=>t(e)),n.search):n.search,m=!0===e.search?p:e.search?b(e.search,p)??{}:h?.length?p:{},y=f?.length?f.reduce(((e,t)=>t(e)),m):m,g=R(n.search,y),v=r.stringifySearch(g),w=!0===e.hash?n.hash:e.hash?b(e.hash,n.hash):n.hash,E=w?`#${w}`:"";let x=!0===e.state?n.state:e.state?b(e.state,n.state):n.state;return x=R(n.state,x),{pathname:s,search:g,searchStr:v,state:x,hash:w,href:o.createHref(`${s}${v}${E}`),unmaskOnReload:e.unmaskOnReload}},n=(e={},n)=>{let o=t(e),a=n?t(n):void 0;if(!a){let e={},s=r.routeMasks?.find((t=>{const r=N(w,o.pathname,{to:t.from,caseSensitive:!1,fuzzy:!1});return!!r&&(e=r,!0)}));s&&(s={...s,from:A(s.from,e)},a=t(n=s))}const s=H(o.pathname,o.search),c=a?H(a.pathname,a.search):void 0,i=a?t(n,c):void 0,u=t(e,s);return i&&(u.maskedLocation=i),u};return e.mask?n(e,{...E(e,["from"]),...e.mask}):n(e)})),U=L((async({startTransition:e,...t})=>{c.current&&clearTimeout(c.current);if(!(d.current.href===t.href)||!t.replace){let{maskedLocation:n,...s}=t;n&&(s={...n,state:{...n.state,__tempKey:void 0,__tempLocation:{...s,search:s.searchStr,state:{...s.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(s.unmaskOnReload??r.unmaskOnReload)&&(s.state.__tempKey=a.current));const c=()=>{o[t.replace?"replace":"push"](s.href,s.state)};e??1?g(c):c()}return s.current=t.resetScroll??!0,i.current})),W=L((({replace:e,resetScroll:t,startTransition:r,...n}={})=>{const o=z(n);return U({...o,startTransition:r,replace:e,resetScroll:t})})),X=L((({from:e,to:t="",...r})=>{const n=String(t),o=void 0===e?e:String(e);let a;try{new URL(`${n}`),a=!0}catch(e){}return p(!a),W({...r,from:o,to:n})})),ee=L((async({checkLatest:e,matches:t,preload:n})=>{let o,a;try{for(let[e,o]of t.entries()){const s=t[e-1],c=T[o.routeId],i=(r,n)=>{if(r.routerCode=n,a=a??e,B(r))throw r;try{c.options.onError?.(r)}catch(e){if(r=e,B(e))throw e}t[e]=o={...o,error:r,status:"error",updatedAt:Date.now()}};try{o.paramsError&&i(o.paramsError,"PARSE_PARAMS"),o.searchError&&i(o.searchError,"VALIDATE_SEARCH");const a=s?.context??r.context??{},u=await(c.options.beforeLoad?.({search:o.search,abortController:o.abortController,params:o.params,preload:!!n,context:a,location:v.location,navigate:e=>X({...e,from:o.pathname}),buildLocation:z}))??{},l={...a,...u};t[e]=o={...o,context:R(o.context,l)}}catch(e){i(e,"BEFORE_LOAD");break}}}catch(e){if(B(e))return n||X(e),t;throw e}const s=t.slice(0,a),c=[];return s.forEach(((r,a)=>{c.push((async()=>{const s=c[a-1],i=T[r.routeId];if(r.isFetching)return Z(v,r.id)?.loadPromise;const u=e=>!!B(e)&&(n||X(e),!0);let l;t[a]=r={...r,isFetching:!0,fetchedAt:Date.now(),invalid:!1},l=(async()=>{try{const c=Promise.all(Y.map((async e=>{const t=i.options[e];t?.preload&&await t.preload()}))),u=i.options.load?.({params:r.params,search:r.search,preload:!!n,parentMatchPromise:s,abortController:r.abortController,context:r.context,location:v.location,navigate:e=>X({...e,from:r.pathname})}),[l,h]=await Promise.all([c,u]);if(o=e())return await o;t[a]=r={...r,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}}catch(n){if(o=e())return await o;if(u(n))return;try{i.options.onError?.(n)}catch(e){if(n=e,u(e))return}t[a]=r={...r,error:n,status:"error",isFetching:!1,updatedAt:Date.now()}}n||m((e=>({...e,matches:e.matches.map((e=>e.id===r.id?r:e))})))})(),t[a]=r={...r,loadPromise:l},await l})())})),await Promise.all(c),t})),te=L((async()=>{const t=new Promise((async(r,n)=>{const o=d.current,a=v.resolvedLocation,s=a.href!==o.href;let c;F(v),e.emit({type:"onBeforeLoad",fromLocation:a,toLocation:o,pathChanged:s});let i=H(o.pathname,o.search,{debug:!0});const l=v.matches;m((e=>({...e,status:"pending",location:o,matches:i})));try{try{await ee({matches:i,checkLatest:()=>u(t)})}catch(e){}if(c=u(t))return c;const n=l.filter((e=>!v.pendingMatches.includes(e))),h=v.pendingMatches.filter((e=>!l.includes(e)));[[n,"onLeave"],[h,"onEnter"],[l.filter((e=>v.pendingMatches.includes(e))),"onTransition"]].forEach((([e,t])=>{e.forEach((e=>{T[e.routeId].options[t]?.(e)}))})),e.emit({type:"onLoad",fromLocation:a,toLocation:o,pathChanged:s}),r()}catch(e){if(c=u(t))return c;n(e)}}));return i.current=t,i.current})),ne=L((async(e=v.location)=>{let t=z(e),r=H(t.pathname,t.search,{throwOnError:!0});return await ee({matches:r,preload:!0,checkLatest:()=>{}}),[S(r),r]})),oe=L((e=>{const{to:t,preload:n,preloadDelay:o,activeOptions:a,disabled:s,target:c,replace:i,resetScroll:u,startTransition:l}=e;try{return new URL(`${t}`),{type:"external",href:t}}catch(e){}const h=e,f=z(h),p=n??r.defaultPreload,m=o??r.defaultPreloadDelay??0,y=d.current.pathname.split("/"),g=f.pathname.split("/").every(((e,t)=>e===y[t])),v=a?.exact?d.current.pathname===f.pathname:g,w=!a?.includeHash||d.current.hash===f.hash,S=!(a?.includeSearch??1)||P(d.current.search,f.search);return{type:"internal",next:f,handleFocus:e=>{p&&ne(h).catch((e=>{console.warn(e),console.warn(J)}))},handleClick:e=>{s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),U({...f,replace:i,resetScroll:u,startTransition:l}))},handleEnter:e=>{const t=e.target||{};if(p){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,ne(h).catch((e=>{console.warn(e),console.warn(J)}))}),m)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},handleTouchStart:e=>{ne(h).catch((e=>{console.warn(e),console.warn(J)}))},isActive:v&&w&&S,disabled:s}}));n.useLayoutEffect((()=>{const e=o.subscribe((()=>{d.current=l(d.current),v.location!==d.current&&g((()=>{try{te()}catch(e){console.error(e)}}))})),t=z({search:!0,params:!0,hash:!0,state:!0});return v.location.href!==t.href&&U({...t,replace:!0}),()=>{e()}}),[o]);const ae=n.useRef(!0);ae.current&&(ae.current=!1,g((()=>{try{te()}catch(e){console.error(e)}})));const se=L(((e,t)=>{e={...e,to:e.to?C(e.from||"",e.to):void 0};const r=z(e);if(t?.pending&&"pending"!==v.status)return!1;const n=t?.pending?d.current:v.resolvedLocation;if(!n)return!1;const o=N(w,n.pathname,{...t,to:r.pathname});return!!o&&(o&&(t?.includeSearch??1)?!!P(n.search,r.search)&&o:o)})),ce={routeTree:e.routeTree,navigate:X,buildLink:oe,state:v,matchRoute:se,routesById:x,options:r,history:o,load:te,buildLocation:z,subscribe:e.subscribe,resetNextScrollRef:s};return n.createElement(q.Provider,{value:ce},n.createElement(re,null))},e.ScrollRestoration=function(e){return Ce(e),null},e.SearchParamError=V,e.cleanPath=_,e.componentTypes=Y,e.createBrowserHistory=h,e.createHashHistory=function(){return h({getHref:()=>window.location.hash.substring(1),createHref:e=>`#${e}`})},e.createMemoryHistory=function(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex??t.length-1,n={key:f()};return u({getLocation:()=>d(t[r],n),pushState:(e,o)=>{n=o,t.push(e),r++},replaceState:(e,o)=>{n=o,t[r]=e},back:()=>{r--},forward:()=>{r=Math.min(r+1,t.length-1)},go:e=>window.history.go(e),createHref:e=>e})},e.createRouteMask=function(e){return e},e.decode=F,e.defaultParseSearch=z,e.defaultStringifySearch=U,e.encode=H,e.functionalUpdate=b,e.getInitialRouterState=Q,e.getRouteMatch=Z,e.interpolatePath=A,e.invariant=p,e.isPlainObject=C,e.isRedirect=B,e.isServer=w,e.joinPaths=O,e.last=S,e.lazyFn=function(e,t){return async(...r)=>(await e())[t||"default"](...r)},e.lazyRouteComponent=function(e,t){let r;const o=()=>(r||(r=e()),r),a=n.lazy((async()=>({default:(await o())[t??"default"]})));return a.preload=o,a},e.matchByPath=D,e.matchPathname=N,e.matchesContext=ue,e.parsePathname=$,e.parseSearchWith=W,e.partialDeepEqual=P,e.pick=E,e.redirect=function(e){return e.isRedirect=!0,e},e.replaceEqualDeep=R,e.resolvePath=j,e.rootRouteId=de,e.rootRouteWithContext=function(){return e=>new pe(e)},e.routerContext=q,e.shallow=function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0},e.stringifySearchWith=X,e.trimPath=I,e.trimPathLeft=T,e.trimPathRight=M,e.typedNavigate=function(e){return e},e.useBlocker=xe,e.useLayoutEffect=k,e.useLinkProps=ye,e.useMatch=ie,e.useMatchRoute=ce,e.useMatches=function(e){const t=n.useContext(ue);return ee({select:r=>{const n=r.matches.slice(r.matches.findIndex((e=>e.id===t[0]?.id)));return e?.select?e.select(n):n}})},e.useNavigate=function(e){const{navigate:t}=te(),r=ie({strict:!1});return n.useCallback((n=>t({from:n?.to?r.pathname:void 0,...e,...n})),[])},e.useParams=le,e.useRouteContext=function(e){return ie({...e,select:t=>e?.select?e.select(t.context):t.context})},e.useRouter=te,e.useRouterState=ee,e.useScrollRestoration=Ce,e.useSearch=he,e.useStableCallback=L,e.warning=m,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
21
|
+
*/const o="pushstate",a="popstate",s="beforeunload",c=e=>(e.preventDefault(),e.returnValue=""),i=()=>{removeEventListener(s,c,{capture:!0})};function u(e){let t=e.getLocation(),r=new Set,n=[],o=[];const a=()=>{t=e.getLocation(),r.forEach((e=>e()))},u=()=>{if(n.length)n[0]?.(u,(()=>{n=[],i()}));else for(;o.length;)o.shift()?.()},h=e=>{o.push(e),u()};return{get location(){return t},subscribe:e=>(r.add(e),()=>{r.delete(e)}),push:(t,r)=>{r=l(r),h((()=>{e.pushState(t,r,a)}))},replace:(t,r)=>{r=l(r),h((()=>{e.replaceState(t,r,a)}))},go:t=>{h((()=>{e.go(t)}))},back:()=>{h((()=>{e.back()}))},forward:()=>{h((()=>{e.forward()}))},createHref:t=>e.createHref(t),block:e=>(n.push(e),1===n.length&&addEventListener(s,c,{capture:!0}),()=>{n=n.filter((t=>t!==e)),n.length||i()}),flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function l(e){return e||(e={}),{...e,key:f()}}function h(e){const t=e?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=e?.createHref??(e=>e);let n=d(t(),window.history.state);let s,c,i=!0;const l=()=>{i=!1,(()=>{s&&(window.history[s.isPush?"pushState":"replaceState"](s.state,"",s.href),s=void 0,c=void 0)})(),i=!0},h=(e,t,o,a)=>{const i=r(t);n=d(i,o),s={href:i,state:o,isPush:s?.isPush||"push"===e},a(),c||(c=Promise.resolve().then((()=>l())))},f=()=>{n=d(t(),window.history.state),y.notify()};var p=window.history.pushState,m=window.history.replaceState;const y=u({getLocation:()=>n,pushState:(e,t,r)=>h("push",e,t,r),replaceState:(e,t,r)=>h("replace",e,t,r),back:()=>window.history.back(),forward:()=>window.history.forward(),go:e=>window.history.go(e),createHref:e=>r(e),flush:l,destroy:()=>{window.history.pushState=p,window.history.replaceState=m,window.removeEventListener(o,f),window.removeEventListener(a,f)}});return window.addEventListener(o,f),window.addEventListener(a,f),window.history.pushState=function(){let e=p.apply(window.history,arguments);return i&&y.notify(),e},window.history.replaceState=function(){let e=m.apply(window.history,arguments);return i&&y.notify(),e},y}function d(e,t){let r=e.indexOf("#"),n=e.indexOf("?");return{href:e,pathname:e.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:e.length),hash:r>-1?e.substring(r):"",search:n>-1?e.slice(n,-1===r?void 0:r):"",state:t||{}}}function f(){return(Math.random()+1).toString(36).substring(7)}function p(e,t){if(!e)throw new Error("Invariant failed")}function m(e,t){}function y(e){const t=e.errorComponent??v;return n.createElement(g,{resetKey:e.resetKey,onCatch:e.onCatch,children:({error:r})=>r?n.createElement(t,{error:r}):e.children})}class g extends n.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e,t){t.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}componentDidCatch(e){console.error(e),this.props.onCatch?.(e)}render(){return this.props.children(this.state)}}function v({error:e}){const[t,r]=n.useState(!1);return n.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},n.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),n.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((e=>!e))},t?"Hide Error":"Show Error")),n.createElement("div",{style:{height:".25rem"}}),t?n.createElement("div",null,n.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},e.message?n.createElement("code",null,e.message):null)):null)}const w="undefined"==typeof document;function S(e){return e[e.length-1]}function b(e,t){return"function"==typeof e?e(t):e}function E(e,t){return t.reduce(((t,r)=>(t[r]=e[r],t)),{})}function R(e,t){if(e===t)return e;const r=t,n=Array.isArray(e)&&Array.isArray(r);if(n||C(e)&&C(r)){const t=n?e.length:Object.keys(e).length,o=n?r:Object.keys(r),a=o.length,s=n?[]:{};let c=0;for(let t=0;t<a;t++){const a=n?t:o[t];s[a]=R(e[a],r[a]),s[a]===e[a]&&c++}return t===a&&c===t?e:s}return r}function C(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!x(r)&&!!r.hasOwnProperty("isPrototypeOf")}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function L(e,t){return e===t||typeof e==typeof t&&(C(e)&&C(t)?!Object.keys(t).some((r=>!L(e[r],t[r]))):!(!Array.isArray(e)||!Array.isArray(t))&&!(e.length!==t.length||e.some(((e,r)=>!L(e,t[r])))))}function P(e){const t=n.useRef(e);t.current=e;return n.useRef(((...e)=>t.current(...e))).current}const k="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function O(e){return _(e.filter(Boolean).join("/"))}function _(e){return e.replace(/\/{2,}/g,"/")}function T(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function I(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function M(e){return I(T(e))}function j(e,t,r){t=t.replace(new RegExp(`^${e}`),"/"),r=r.replace(new RegExp(`^${e}`),"/");let n=$(t);const o=$(r);o.forEach(((e,t)=>{if("/"===e.value)t?t===o.length-1&&n.push(e):n=[e];else if(".."===e.value)n.length>1&&"/"===S(n)?.value&&n.pop(),n.pop();else{if("."===e.value)return;n.push(e)}}));return _(O([e,...n.map((e=>e.value))]))}function $(e){if(!e)return[];const t=[];if("/"===(e=_(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const r=e.split("/").filter(Boolean);return t.push(...r.map((e=>"$"===e||"*"===e?{type:"wildcard",value:e}:"$"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function A(e,t,r=!1){return O($(e).map((e=>{if("wildcard"===e.type){const n=t[e.value];return r?`${e.value}${n??""}`:n}return"param"===e.type?t[e.value.substring(1)]??"":e.value})))}function D(e,t,r){const n=N(e,t,r);if(!r.to||n)return n??{}}function N(e,t,r){t="/"!=e?t.substring(e.length):t;const n=`${r.to??"$"}`,o=$(t),a=$(n);t.startsWith("/")||o.unshift({type:"pathname",value:"/"}),n.startsWith("/")||a.unshift({type:"pathname",value:"/"});const s={};return(()=>{for(let e=0;e<Math.max(o.length,a.length);e++){const t=o[e],n=a[e],c=e>=o.length-1,i=e>=a.length-1;if(n){if("wildcard"===n.type)return!!t?.value&&(s["*"]=O(o.slice(e).map((e=>e.value))),!0);if("pathname"===n.type){if("/"===n.value&&!t?.value)return!0;if(t)if(r.caseSensitive){if(n.value!==t.value)return!1}else if(n.value.toLowerCase()!==t.value.toLowerCase())return!1}if(!t)return!1;if("param"===n.type){if("/"===t?.value)return!1;"$"!==t.value.charAt(0)&&(s[n.value.substring(1)]=t.value)}}if(!c&&i)return!!r.fuzzy}return!0})()?s:void 0}function B(e){return!!e?.isRedirect}function F(e,t){var r,n,o,a="";for(r in e)if(void 0!==(o=e[r]))if(Array.isArray(o))for(n=0;n<o.length;n++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o[n]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(t||"")+a}function H(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||(0*+t==0&&+t+""===t?+t:t))}function K(e){for(var t,r,n={},o=e.split("&");t=o.shift();)void 0!==n[r=(t=t.split("=")).shift()]?n[r]=[].concat(n[r],H(t.shift())):n[r]=H(t.shift());return n}const z=W(JSON.parse),U=X(JSON.stringify,JSON.parse);function W(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let r=K(t);for(let t in r){const n=r[t];if("string"==typeof n)try{r[t]=e(n)}catch(e){}}return r}}function X(e,t){return r=>{(r={...r})&&Object.keys(r).forEach((n=>{const o=r[n];void 0===o||void 0===o?delete r[n]:r[n]=function(r){if("object"==typeof r&&null!==r)try{return e(r)}catch(e){}else if("string"==typeof r&&"function"==typeof t)try{return t(r),e(r)}catch(e){}return r}(o)}));const n=F(r).toString();return n?`?${n}`:""}}const Y=["component","errorComponent","pendingComponent"];const q=n.createContext(null);"undefined"!=typeof document&&(window.__TSR_ROUTER_CONTEXT__=q);const J="Error preloading route! ☝️";class V extends Error{}class G extends Error{}function Q(e){return{status:"idle",resolvedLocation:e,location:e,matches:[],pendingMatches:[],lastUpdated:Date.now()}}function Z(e,t){return[...e.pendingMatches,...e.matches].find((e=>e.id===t))}function ee(e){const{state:t}=te();return e?.select?e.select(t):t}function te(){const e=window.__TSR_ROUTER_CONTEXT__||q;return n.useContext(e)}function re(){const{routesById:e,state:t}=te(),{matches:r}=t,o=ee().location.state.key,a=e[pe],s=n.useCallback((e=>n.createElement(v,{...e,useMatch:a.useMatch,useRouteContext:a.useRouteContext,useSearch:a.useSearch,useParams:a.useParams})),[a]);return n.createElement(le.Provider,{value:r},n.createElement(y,{resetKey:o,errorComponent:s,onCatch:()=>{}},r.length?n.createElement(ae,{matches:r}):null))}const ne=()=>null;function oe(e){return n.createElement(n.Fragment,null,e.children)}function ae({matches:e}){const{options:t,routesById:r}=te(),o=e[0],a=o?.routeId,s=r[a],c=ee().location.state?.key,i=s.options.pendingComponent??t.defaultPendingComponent??ne,u=s.options.errorComponent??t.defaultErrorComponent??v,l=s.options.wrapInSuspense?n.Suspense:oe,h=n.useCallback((e=>n.createElement(u,{...e,useMatch:s.useMatch,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams})),[s]);return n.createElement(le.Provider,{value:e},n.createElement(l,{fallback:n.createElement(i,{useMatch:s.useMatch,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams})},n.createElement(y,{resetKey:c,errorComponent:h,onCatch:()=>{o.id}},n.createElement(se,{match:o}))))}function se({match:e}){const{options:t,routesById:r}=te(),o=r[e.routeId];if("error"===e.status)throw e.error;if("pending"===e.status)throw e.loadPromise;if("success"===e.status){let e=o.options.component??t.defaultComponent;return e?n.createElement(e,{useMatch:o.useMatch,useRouteContext:o.useRouteContext,useSearch:o.useSearch,useParams:o.useParams,useLoaderData:o.useLoaderData}):n.createElement(ce,null)}p(!1)}function ce(){const e=n.useContext(le).slice(1);return e[0]?n.createElement(ae,{matches:e}):null}function ie(){const{matchRoute:e}=te();return n.useCallback((t=>{const{pending:r,caseSensitive:n,...o}=t;return e(o,{pending:r,caseSensitive:n})}),[])}function ue(e){const t=n.useContext(le)[0],r=t?.routeId,o=ee({select:r=>(e?.from?r.matches.find((t=>t.routeId===e?.from)):r.matches.find((e=>e.id===t.id))).routeId});(e?.strict??1)&&p(r==o);return ee({select:r=>{const n=e?.from?r.matches.find((t=>t.routeId===e?.from)):r.matches.find((e=>e.id===t.id));return p(n,e?.from&&e.from),e?.select?e.select(n):n}})}const le=n.createContext(null);function he(e){const t=ue({...e,select:void 0});return"function"==typeof e.select?e.select(t?.loaderData):t?.loaderData}function de(e){return ee({select:t=>{const r=S(t.matches)?.params;return e?.select?e.select(r):r}})}function fe(e){return ue({...e,select:t=>e?.select?e.select(t.search):t.search})}const pe="__root__";class me{constructor(e){this.options=e||{},this.isRoot=!e?.getParentRoute,me.__onInit(this)}init=e=>{this.originalIndex=e.originalIndex;const t=this.options,r=!t?.path&&!t?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=pe:p(this.parentRoute);let n=r?pe:t.path;n&&"/"!==n&&(n=M(n));const o=t?.id||n;let a=r?pe:O([this.parentRoute.id===pe?"":this.parentRoute.id,o]);n===pe&&(n="/"),a!==pe&&(a=O(["/",a]));const s=a===pe?"/":O([this.parentRoute.fullPath,n]);this.path=n,this.id=a,this.fullPath=s,this.to=s};addChildren=e=>(this.children=e,this);update=e=>(Object.assign(this.options,e),this);static __onInit=e=>{};useMatch=e=>ue({...e,from:this.id});useRouteContext=e=>ue({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context});useSearch=e=>fe({...e,from:this.id});useParams=e=>de({...e,from:this.id});useLoaderData=e=>he({...e,from:this.id})}class ye extends me{constructor(e){super(e)}}function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ge.apply(this,arguments)}function ve(e){const{buildLink:t}=te(),r=ue({strict:!1}),{type:n,children:o,target:a,activeProps:s=(()=>({className:"active"})),inactiveProps:c=(()=>({})),activeOptions:i,disabled:u,hash:l,search:h,params:d,to:f,state:p,mask:m,preload:y,preloadDelay:g,replace:v,startTransition:w,resetScroll:S,style:E,className:R,onClick:C,onFocus:x,onMouseEnter:L,onMouseLeave:P,onTouchStart:k,...O}=e,_=t({from:e.to?r.pathname:void 0,...e});if("external"===_.type){const{href:e}=_;return{href:e}}const{handleClick:T,handleFocus:I,handleEnter:M,handleLeave:j,handleTouchStart:$,isActive:A,next:D}=_,N=e=>t=>{t.persist&&t.persist(),e.filter(Boolean).forEach((e=>{t.defaultPrevented||e(t)}))},B=A?b(s,{})??{}:{},F=A?{}:b(c,{})??{};return{...B,...F,...O,href:u?void 0:D.maskedLocation?D.maskedLocation.href:D.href,onClick:N([C,T]),onFocus:N([x,I]),onMouseEnter:N([L,M]),onMouseLeave:N([P,j]),onTouchStart:N([k,$]),target:a,style:{...E,...B.style,...F.style},className:[R,B.className,F.className].filter(Boolean).join(" ")||void 0,...u?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}const we=n.forwardRef(((e,t)=>{const r=ve(e);return n.createElement("a",ge({ref:t},r,{children:"function"==typeof e.children?e.children({isActive:"active"===r["data-status"]}):e.children}))})),Se="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,be="window";let Ee,Re=new WeakSet;const Ce="undefined"!=typeof window&&window.sessionStorage,xe=e=>e.state.key;function Le(e){const{state:t,subscribe:r,resetNextScrollRef:n}=te();Se((()=>{const t=e?.getKey||xe;Ce&&(Ee||(Ee=(()=>{const e="tsr-scroll-restoration-v2";return{state:JSON.parse(window.sessionStorage.getItem(e)||"null")||{cached:{},next:{}},set:t=>{Ee.state=b(t,Ee.state),window.sessionStorage.setItem(e,JSON.stringify(Ee.state))}}})()));const{history:o}=window;o.scrollRestoration&&(o.scrollRestoration="manual");const a=e=>{if(Re.has(e.target))return;Re.add(e.target);const t=e.target===document||e.target===window?be:s(e.target);Ee.state.next[t]||Ee.set((e=>({...e,next:{...e.next,[t]:{scrollX:NaN,scrollY:NaN}}})))},s=e=>{let t,r=[];for(;t=e.parentNode;)r.unshift(`${e.tagName}:nth-child(${[].indexOf.call(t.children,e)+1})`),e=t;return`${r.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",a,!0);const c=r("onBeforeLoad",(e=>{if(e.pathChanged){const r=t(e.fromLocation);for(const e in Ee.state.next){const t=Ee.state.next[e];if(e===be)t.scrollX=window.scrollX||0,t.scrollY=window.scrollY||0;else if(e){const r=document.querySelector(e);t.scrollX=r?.scrollLeft||0,t.scrollY=r?.scrollTop||0}Ee.set((n=>{const o={...n.next};return delete o[e],{...n,next:o,cached:{...n.cached,[[r,e].join("___")]:t}}}))}}})),i=r("onResolved",(t=>{if(t.pathChanged){if(!n.current)return;n.current=!0;const r=(e?.getKey||xe)(t.toLocation);let o=!1;for(const e in Ee.state.cached){const t=Ee.state.cached[e],[n,a]=e.split("___");if(n===r)if(a===be)o=!0,window.scrollTo(t.scrollX,t.scrollY);else if(a){const e=document.querySelector(a);e&&(e.scrollLeft=t.scrollX,e.scrollTop=t.scrollY)}}o||window.scrollTo(0,0),Ee.set((e=>({...e,next:{}}))),Re=new WeakSet}}));return()=>{document.removeEventListener("scroll",a),c(),i()}}),[])}function Pe(e,t=!0){const{history:r}=te();n.useEffect((()=>{if(!t)return;let n=r.block(((t,r)=>{window.confirm(e)&&(n(),t())}));return n}))}e.Block=function({message:e,condition:t,children:r}){return Pe(e,t),r??null},e.CatchBoundary=y,e.CatchBoundaryImpl=g,e.ErrorComponent=v,e.FileRoute=class{constructor(e){this.path=e}createRoute=e=>{const t=new me(e);return t.isRoot=!1,t}},e.Link=we,e.Match=ae,e.MatchRoute=function(e){const t=ie()(e);return"function"==typeof e.children?e.children(t):t?e.children:null},e.Matches=re,e.Navigate=function(e){const{navigate:t}=te(),r=ue({strict:!1});return k((()=>{t({from:e.to?r.pathname:void 0,...e})}),[]),null},e.Outlet=ce,e.PathParamError=G,e.RootRoute=ye,e.Route=me,e.Router=class{constructor(e){this.options={defaultPreloadDelay:50,context:void 0,...e,stringifySearch:e?.stringifySearch??U,parseSearch:e?.parseSearch??z},this.routeTree=this.options.routeTree}subscribers=new Set;subscribe=(e,t)=>{const r={eventType:e,fn:t};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}};emit=e=>{this.subscribers.forEach((t=>{t.eventType===e.type&&t.fn(e)}))}},e.RouterProvider=function({router:e,...t}){const r={...e.options,...t,context:{...e.options.context,...t?.context}},o=n.useState((()=>r.history??h()))[0],a=n.useRef(`${Math.round(1e7*Math.random())}`),s=n.useRef(!0),c=n.useRef(null),i=n.useRef(Promise.resolve()),u=e=>i.current!==e?i.current:void 0,l=P((e=>{const t=({pathname:t,search:n,hash:o,state:a})=>{const s=r.parseSearch(n);return{pathname:t,searchStr:n,search:R(e?.search,s),hash:o.split("#").reverse()[0]??"",href:`${t}${n}${o}`,state:R(e?.state,a)}},n=t(o.location);let{__tempLocation:s,__tempKey:c}=n.state;if(s&&(!c||c===a.current)){const e=t(s);return e.state.key=n.state.key,delete e.state.__tempLocation,{...e,maskedLocation:n}}return n})),d=n.useRef(l()),[f,m]=n.useState((()=>Q(d.current))),[y,g]=n.useTransition(),v=n.useRef([]),w=n.useMemo((()=>({...f,status:y?"pending":"idle",location:y?d.current:f.location,pendingMatches:v.current})),[f,y]);n.useLayoutEffect((()=>{y||w.resolvedLocation===w.location||(e.emit({type:"onResolved",fromLocation:w.resolvedLocation,toLocation:w.location,pathChanged:w.location.href!==w.resolvedLocation?.href}),v.current=[],m((e=>({...e,resolvedLocation:e.location}))))}));const C=`/${M(r.basepath??"")??""}`,x=P(((e,t)=>j(C,e,_(t)))),[k,T]=n.useMemo((()=>{const t={},r={},n=e=>{e.forEach(((e,o)=>{e.init({originalIndex:o});if(p(!t[e.id],String(e.id)),t[e.id]=e,!e.isRoot&&e.path){const t=I(e.fullPath);r[t]&&!e.fullPath.endsWith("/")||(r[t]=e)}const a=e.children;a?.length&&n(a)}))};return n([e.routeTree]),[t,r]}),[]),N=k,F=n.useMemo((()=>Object.values(T).map(((e,t)=>{const r=M(e.fullPath),n=$(r);for(;n.length>1&&"/"===n[0]?.value;)n.shift();const o=n.map((e=>"param"===e.type?.5:"wildcard"===e.type?.25:1));return{child:e,trimmed:r,parsed:n,index:t,score:o}})).sort(((e,t)=>{let r="/"===e.trimmed?1:"/"===t.trimmed?-1:0;if(0!==r)return r;const n=Math.min(e.score.length,t.score.length);if(e.score.length!==t.score.length)return t.score.length-e.score.length;for(let r=0;r<n;r++)if(e.score[r]!==t.score[r])return t.score[r]-e.score[r];for(let r=0;r<n;r++)if(e.parsed[r].value!==t.parsed[r].value)return e.parsed[r].value>t.parsed[r].value?1:-1;return e.trimmed!==t.trimmed?e.trimmed>t.trimmed?1:-1:e.index-t.index})).map(((e,t)=>(e.child.rank=t,e.child)))),[T]),H=P(((e,t,n)=>{let o={},a=F.find((t=>{const n=D(C,I(e),{to:t.fullPath,caseSensitive:t.options.caseSensitive??r.caseSensitive,fuzzy:!1});return!!n&&(o=n,!0)}))||k.__root__,s=[a];for(;a?.parentRoute;)a=a.parentRoute,a&&s.unshift(a);const c=s.map((e=>{let t;if(e.options.parseParams)try{const t=e.options.parseParams(o);Object.assign(o,t)}catch(e){if(t=new G(e.message,{cause:e}),n?.throwOnError)throw t;return t}})),i=s.map(((e,t)=>{const r=A(e.path,o),n=A(e.id,o,!0),a=Z(w,n);if(a)return{...a};const s=!(!e.options.loader&&!Y.some((t=>e.options[t]?.preload)));return{id:n,routeId:e.id,params:o,pathname:O([C,r]),updatedAt:Date.now(),routeSearch:{},search:{},status:s?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:c[t],searchError:void 0,loadPromise:Promise.resolve(),context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((e,r)=>{const o=i[r-1],a=N[e.routeId],s=(()=>{const r={search:o?.search??t,routeSearch:o?.routeSearch??t};try{let t=("object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch)?.(r.search)??{},n={...r.search,...t};return t=R(e.routeSearch,t),n=R(e.search,n),{routeSearch:t,search:n,searchDidChange:e.routeSearch!==t}}catch(t){if(e.searchError=new V(t.message,{cause:t}),n?.throwOnError)throw e.searchError;return r}})();Object.assign(e,s)})),i})),K=P((e=>{Z(w,e)?.abortController?.abort()})),z=P((e=>{e.matches.forEach((e=>{K(e.id)}))})),U=P((e=>{const t=(e={},t)=>{const n=d.current,a=e.from??n.pathname;let s=x(a,`${e.to??""}`);const c=H(a,n.search),i=t?.filter((e=>c?.find((t=>t.routeId===e.routeId)))),u={...S(c)?.params};let l=!0===(e.params??!0)?u:b(e.params,u);l&&t?.map((e=>N[e.routeId].options.stringifyParams)).filter(Boolean).forEach((e=>{l={...l,...e(l)}})),s=A(s,l??{});const h=i?.map((e=>N[e.routeId].options.preSearchFilters??[])).flat().filter(Boolean)??[],f=i?.map((e=>N[e.routeId].options.postSearchFilters??[])).flat().filter(Boolean)??[],p=h?.length?h?.reduce(((e,t)=>t(e)),n.search):n.search,m=!0===e.search?p:e.search?b(e.search,p)??{}:h?.length?p:{},y=f?.length?f.reduce(((e,t)=>t(e)),m):m,g=R(n.search,y),v=r.stringifySearch(g),w=!0===e.hash?n.hash:e.hash?b(e.hash,n.hash):n.hash,E=w?`#${w}`:"";let C=!0===e.state?n.state:e.state?b(e.state,n.state):n.state;return C=R(n.state,C),{pathname:s,search:g,searchStr:v,state:C,hash:w,href:o.createHref(`${s}${v}${E}`),unmaskOnReload:e.unmaskOnReload}},n=(e={},n)=>{let o=t(e),a=n?t(n):void 0;if(!a){let e={},s=r.routeMasks?.find((t=>{const r=D(C,o.pathname,{to:t.from,caseSensitive:!1,fuzzy:!1});return!!r&&(e=r,!0)}));s&&(s={...s,from:A(s.from,e)},a=t(n=s))}const s=H(o.pathname,o.search),c=a?H(a.pathname,a.search):void 0,i=a?t(n,c):void 0,u=t(e,s);return i&&(u.maskedLocation=i),u};return e.mask?n(e,{...E(e,["from"]),...e.mask}):n(e)})),W=P((async({startTransition:e,...t})=>{c.current&&clearTimeout(c.current);if(!(d.current.href===t.href)||!t.replace){let{maskedLocation:n,...s}=t;n&&(s={...n,state:{...n.state,__tempKey:void 0,__tempLocation:{...s,search:s.searchStr,state:{...s.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(s.unmaskOnReload??r.unmaskOnReload)&&(s.state.__tempKey=a.current));const c=()=>{o[t.replace?"replace":"push"](s.href,s.state)};e??1?g(c):c()}return s.current=t.resetScroll??!0,i.current})),X=P((({replace:e,resetScroll:t,startTransition:r,...n}={})=>{const o=U(n);return W({...o,startTransition:r,replace:e,resetScroll:t})})),ee=P((({from:e,to:t="",...r})=>{const n=String(t),o=void 0===e?e:String(e);let a;try{new URL(`${n}`),a=!0}catch(e){}return p(!a),X({...r,from:o,to:n})})),te=P((async({checkLatest:e,matches:t,preload:n})=>{let o,a;try{for(let[e,o]of t.entries()){const s=t[e-1],c=N[o.routeId],i=(r,n)=>{if(r.routerCode=n,a=a??e,B(r))throw r;try{c.options.onError?.(r)}catch(e){if(r=e,B(e))throw e}t[e]=o={...o,error:r,status:"error",updatedAt:Date.now()}};try{o.paramsError&&i(o.paramsError,"PARSE_PARAMS"),o.searchError&&i(o.searchError,"VALIDATE_SEARCH");const a=s?.context??r.context??{},u=await(c.options.beforeLoad?.({search:o.search,abortController:o.abortController,params:o.params,preload:!!n,context:a,location:w.location,navigate:e=>ee({...e,from:o.pathname}),buildLocation:U}))??{},l={...a,...u};t[e]=o={...o,context:R(o.context,l)}}catch(e){i(e,"BEFORE_LOAD");break}}}catch(e){if(B(e))return n||ee(e),t;throw e}const s=t.slice(0,a),c=[];return s.forEach(((r,a)=>{c.push((async()=>{const s=c[a-1],i=N[r.routeId],u=e=>!!B(e)&&(n||ee(e),!0);let l;if(t[a]=r={...r,fetchedAt:Date.now(),invalid:!1},r.isFetching)l=Z(w,r.id)?.loadPromise;else{t[a]=r={...r,isFetching:!0};const e=Promise.all(Y.map((async e=>{const t=i.options[e];t?.preload&&await t.preload()}))),o=i.options.loader?.({params:r.params,search:r.search,preload:!!n,parentMatchPromise:s,abortController:r.abortController,context:r.context,location:w.location,navigate:e=>ee({...e,from:r.pathname})});l=Promise.all([e,o]).then((e=>e[1]))}t[a]=r={...r,loadPromise:l},n||m((e=>({...e,matches:e.matches.map((e=>e.id===r.id?r:e))})));try{const n=await l;if(o=e())return await o;t[a]=r={...r,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:n,loadPromise:void 0}}catch(n){if(o=e())return await o;if(u(n))return;try{i.options.onError?.(n)}catch(e){if(n=e,u(e))return}t[a]=r={...r,error:n,status:"error",isFetching:!1,updatedAt:Date.now()}}n||m((e=>({...e,matches:e.matches.map((e=>e.id===r.id?r:e))})))})())})),await Promise.all(c),t})),ne=P((async()=>{const t=new Promise((async(r,n)=>{const o=d.current,a=w.resolvedLocation,s=a.href!==o.href;let c;z(w),e.emit({type:"onBeforeLoad",fromLocation:a,toLocation:o,pathChanged:s});let i=H(o.pathname,o.search,{debug:!0});v.current=i;const l=w.matches;m((e=>({...e,status:"pending",location:o,matches:i})));try{try{await te({matches:i,checkLatest:()=>u(t)})}catch(e){}if(c=u(t))return c;const n=l.filter((e=>!v.current.includes(e))),h=v.current.filter((e=>!l.includes(e)));[[n,"onLeave"],[h,"onEnter"],[l.filter((e=>v.current.includes(e))),"onTransition"]].forEach((([e,t])=>{e.forEach((e=>{N[e.routeId].options[t]?.(e)}))})),e.emit({type:"onLoad",fromLocation:a,toLocation:o,pathChanged:s}),r()}catch(e){if(c=u(t))return c;n(e)}}));return i.current=t,i.current})),oe=P((async(e=w.location)=>{let t=U(e),r=H(t.pathname,t.search,{throwOnError:!0});return await te({matches:r,preload:!0,checkLatest:()=>{}}),[S(r),r]})),ae=P((e=>{const{to:t,preload:n,preloadDelay:o,activeOptions:a,disabled:s,target:c,replace:i,resetScroll:u,startTransition:l}=e;try{return new URL(`${t}`),{type:"external",href:t}}catch(e){}const h=e,f=U(h),p=n??r.defaultPreload,m=o??r.defaultPreloadDelay??0,y=d.current.pathname.split("/"),g=f.pathname.split("/").every(((e,t)=>e===y[t])),v=a?.exact?d.current.pathname===f.pathname:g,w=!a?.includeHash||d.current.hash===f.hash,S=!(a?.includeSearch??1)||L(d.current.search,f.search);return{type:"internal",next:f,handleFocus:e=>{p&&oe(h).catch((e=>{console.warn(e),console.warn(J)}))},handleClick:e=>{s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),W({...f,replace:i,resetScroll:u,startTransition:l}))},handleEnter:e=>{const t=e.target||{};if(p){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,oe(h).catch((e=>{console.warn(e),console.warn(J)}))}),m)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},handleTouchStart:e=>{oe(h).catch((e=>{console.warn(e),console.warn(J)}))},isActive:v&&w&&S,disabled:s}}));n.useLayoutEffect((()=>{const e=o.subscribe((()=>{d.current=l(d.current),w.location!==d.current&&g((()=>{try{ne()}catch(e){console.error(e)}}))})),t=U({search:!0,params:!0,hash:!0,state:!0});return w.location.href!==t.href&&W({...t,replace:!0}),()=>{e()}}),[o]),n.useLayoutEffect((()=>{g((()=>{try{ne()}catch(e){console.error(e)}}))}),[]);const se=P(((e,t)=>{e={...e,to:e.to?x(e.from||"",e.to):void 0};const r=U(e);if(t?.pending&&"pending"!==w.status)return!1;const n=t?.pending?d.current:w.resolvedLocation;if(!n)return!1;const o=D(C,n.pathname,{...t,to:r.pathname});return!!o&&(o&&(t?.includeSearch??1)?!!L(n.search,r.search)&&o:o)})),ce={routeTree:e.routeTree,navigate:ee,buildLink:ae,state:w,matchRoute:se,routesById:k,options:r,history:o,load:ne,buildLocation:U,subscribe:e.subscribe,resetNextScrollRef:s};return n.createElement(q.Provider,{value:ce},n.createElement(re,null))},e.ScrollRestoration=function(e){return Le(e),null},e.SearchParamError=V,e.cleanPath=_,e.componentTypes=Y,e.createBrowserHistory=h,e.createHashHistory=function(){return h({getHref:()=>window.location.hash.substring(1),createHref:e=>`#${e}`})},e.createMemoryHistory=function(e={initialEntries:["/"]}){const t=e.initialEntries;let r=e.initialIndex??t.length-1,n={key:f()};return u({getLocation:()=>d(t[r],n),pushState:(e,o)=>{n=o,t.push(e),r++},replaceState:(e,o)=>{n=o,t[r]=e},back:()=>{r--},forward:()=>{r=Math.min(r+1,t.length-1)},go:e=>window.history.go(e),createHref:e=>e})},e.createRouteMask=function(e){return e},e.decode=K,e.defaultParseSearch=z,e.defaultStringifySearch=U,e.encode=F,e.functionalUpdate=b,e.getInitialRouterState=Q,e.getRouteMatch=Z,e.interpolatePath=A,e.invariant=p,e.isPlainObject=C,e.isRedirect=B,e.isServer=w,e.joinPaths=O,e.last=S,e.lazyFn=function(e,t){return async(...r)=>(await e())[t||"default"](...r)},e.lazyRouteComponent=function(e,t){let r;const o=()=>(r||(r=e()),r),a=n.lazy((async()=>({default:(await o())[t??"default"]})));return a.preload=o,a},e.matchByPath=N,e.matchPathname=D,e.matchesContext=le,e.parsePathname=$,e.parseSearchWith=W,e.partialDeepEqual=L,e.pick=E,e.redirect=function(e){return e.isRedirect=!0,e},e.replaceEqualDeep=R,e.resolvePath=j,e.rootRouteId=pe,e.rootRouteWithContext=function(){return e=>new ye(e)},e.routerContext=q,e.shallow=function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0},e.stringifySearchWith=X,e.trimPath=M,e.trimPathLeft=T,e.trimPathRight=I,e.typedNavigate=function(e){return e},e.useBlocker=Pe,e.useLayoutEffect=k,e.useLinkProps=ve,e.useLoaderData=he,e.useMatch=ue,e.useMatchRoute=ie,e.useMatches=function(e){const t=n.useContext(le);return ee({select:r=>{const n=r.matches.slice(r.matches.findIndex((e=>e.id===t[0]?.id)));return e?.select?e.select(n):n}})},e.useNavigate=function(e){const{navigate:t}=te(),r=ue({strict:!1});return n.useCallback((n=>t({from:n?.to?r.pathname:void 0,...e,...n})),[])},e.useParams=de,e.useRouteContext=function(e){return ue({...e,select:t=>e?.select?e.select(t.context):t.context})},e.useRouter=te,e.useRouterState=ee,e.useScrollRestoration=Le,e.useSearch=fe,e.useStableCallback=P,e.warning=m,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
22
22
|
//# sourceMappingURL=index.production.js.map
|