react-router 0.0.0-experimental-e16afd9b7 → 0.0.0-experimental-52e9b8eb3

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +10 -1
  3. package/dist/index.d.ts +16 -33
  4. package/dist/index.js +1114 -9501
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/components.d.ts +19 -189
  7. package/dist/lib/context.d.ts +4 -4
  8. package/dist/lib/hooks.d.ts +17 -46
  9. package/dist/main.js +1 -1
  10. package/dist/react-router.development.js +1152 -10370
  11. package/dist/react-router.development.js.map +1 -1
  12. package/dist/react-router.production.min.js +2 -2
  13. package/dist/react-router.production.min.js.map +1 -1
  14. package/dist/umd/react-router.development.js +1259 -10541
  15. package/dist/umd/react-router.development.js.map +1 -1
  16. package/dist/umd/react-router.production.min.js +2 -2
  17. package/dist/umd/react-router.production.min.js.map +1 -1
  18. package/package.json +4 -19
  19. package/dist/lib/dom/dom.d.ts +0 -104
  20. package/dist/lib/dom/global.d.ts +0 -38
  21. package/dist/lib/dom/lib.d.ts +0 -572
  22. package/dist/lib/dom/server.d.ts +0 -32
  23. package/dist/lib/dom/ssr/browser.d.ts +0 -3
  24. package/dist/lib/dom/ssr/components.d.ts +0 -94
  25. package/dist/lib/dom/ssr/create-remix-stub.d.ts +0 -56
  26. package/dist/lib/dom/ssr/data.d.ts +0 -7
  27. package/dist/lib/dom/ssr/errorBoundaries.d.ts +0 -33
  28. package/dist/lib/dom/ssr/errors.d.ts +0 -2
  29. package/dist/lib/dom/ssr/fallback.d.ts +0 -2
  30. package/dist/lib/dom/ssr/invariant.d.ts +0 -2
  31. package/dist/lib/dom/ssr/links.d.ts +0 -126
  32. package/dist/lib/dom/ssr/markup.d.ts +0 -5
  33. package/dist/lib/dom/ssr/routeModules.d.ts +0 -141
  34. package/dist/lib/dom/ssr/routes.d.ts +0 -32
  35. package/dist/lib/dom/ssr/server.d.ts +0 -13
  36. package/dist/lib/dom/ssr/single-fetch.d.ts +0 -37
  37. package/dist/lib/router/history.d.ts +0 -249
  38. package/dist/lib/router/index.d.ts +0 -9
  39. package/dist/lib/router/router.d.ts +0 -521
  40. package/dist/lib/router/utils.d.ts +0 -520
  41. package/dist/rsc.js +0 -1641
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v0.0.0-experimental-e16afd9b7
2
+ * React Router v0.0.0-experimental-52e9b8eb3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,5 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import*as e from"react";import*as t from"react-dom";import{decode as r}from"turbo-stream";let n=function(e){return e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e}({});function a(e={}){let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=h(null==a?t.length-1:a),s=n.Pop,l=null;function h(e){return Math.min(Math.max(e,0),t.length-1)}function f(){return t[i]}function m(e,r=null,n){return u(t?f().pathname:"/",e,r,n)}function p(e){return"string"==typeof e?e:c(e)}return{get index(){return i},get action(){return s},get location(){return f()},createHref:p,createURL:e=>new URL(p(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?d(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s=n.Push;let a=m(e,r);i+=1,t.splice(i,t.length,a),o&&l&&l({action:s,location:a,delta:1})},replace(e,r){s=n.Replace;let a=m(e,r);t[i]=a,o&&l&&l({action:s,location:a,delta:0})},go(e){s=n.Pop;let r=h(i+e),a=t[r];i=r,l&&l({action:s,location:a,delta:e})},listen:e=>(l=e,()=>{l=null})}}function o(e={}){return h((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return u("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:c(t)}),null,e)}function i(e={}){return h((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=d(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),u("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:c(t))}),(function(e,t){}),e)}function s(e,t){if(!1===e||null==e)throw new Error(t)}function l(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?d(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)}}function c({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function d(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function h(e,t,r,a={}){let{window:o=document.defaultView,v5Compat:i=!1}=a,d=o.history,h=n.Pop,f=null,m=p();function p(){return(d.state||{idx:null}).idx}function y(){h=n.Pop;let e=p(),t=null==e?null:e-m;m=e,f&&f({action:h,location:g.location,delta:t})}function v(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:c(e);return r=r.replace(/ $/,"%20"),t||s(!1),new URL(r,t)}null==m&&(m=0,d.replaceState({...d.state,idx:m},""));let g={get action(){return h},get location(){return e(o,d)},listen(e){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener("popstate",y),f=e,()=>{o.removeEventListener("popstate",y),f=null}},createHref:e=>t(o,e),createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h=n.Push;let a=u(g.location,e,t);r&&r(a,e),m=p()+1;let s=l(a,m),c=g.createHref(a);try{d.pushState(s,"",c)}catch(y){if(y instanceof DOMException&&"DataCloneError"===y.name)throw y;o.location.assign(c)}i&&f&&f({action:h,location:g.location,delta:1})},replace:function(e,t){h=n.Replace;let a=u(g.location,e,t);r&&r(a,e),m=p();let o=l(a,m),s=g.createHref(a);d.replaceState(o,"",s),i&&f&&f({action:h,location:g.location,delta:0})},go:e=>d.go(e)};return g}let f=function(e){return e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error",e}({});const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function p(e,t,r=[],n={}){return e.map(((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(!0===e.index&&e.children&&s(!1),n[i]&&s(!1),function(e){return!0===e.index}(e)){let r={...e,...t(e),id:i};return n[i]=r,r}{let r={...e,...t(e),id:i,children:void 0};return n[i]=r,e.children&&(r.children=p(e.children,t,o,n)),r}}))}function y(e,t,r="/"){let n=D(("string"==typeof t?d(t):t).pathname||"/",r);if(null==n)return null;let a=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let o=null;for(let i=0;null==o&&i<a.length;++i){let e=C(n);o=x(a[i],e)}return o}function v(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function g(e,t=[],r=[],n=""){let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(i.relativePath.startsWith(n)||s(!1),i.relativePath=i.relativePath.slice(n.length));let l=A([n,i.relativePath]),u=r.concat(i);e.children&&e.children.length>0&&(!0===e.index&&s(!1),g(e.children,t,u,l)),(null!=e.path||e.index)&&t.push({path:l,score:S(l,e.index),routesMeta:u})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of w(e.path))a(e,t,r);else a(e,t)})),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=w(n.join("/")),s=[];return s.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&s.push(...i),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const b=/^:[\w-]+$/,E=e=>"*"===e;function S(e,t){let r=e.split("/"),n=r.length;return r.some(E)&&(n+=-2),t&&(n+=2),r.filter((e=>!E(e))).reduce(((e,t)=>e+(b.test(t)?3:""===t?1:10)),n)}function x(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let i=0;i<r.length;++i){let e=r[i],s=i===r.length-1,l="/"===a?t:t.slice(a.length)||"/",u=_({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!u)return null;Object.assign(n,u.params);let c=e.route;o.push({params:n,pathname:A([a,u.pathname]),pathnameBase:T(A([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=A([a,u.pathnameBase]))}return o}function R(e,t={}){let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return a(t["*"])}const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return"?"!==r&&null==n&&s(!1),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function _(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");return[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce(((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=s[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function C(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function L(e,t="/"){let{pathname:r,search:n="",hash:a=""}="string"==typeof e?d(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:j(n),hash:U(a)}}function k(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function P(e,t){let r=k(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function M(e,t,r,n=!1){let a;"string"==typeof e?a=d(e):(a={...e},a.pathname&&a.pathname.includes("?")&&s(!1),a.pathname&&a.pathname.includes("#")&&s(!1),a.search&&a.search.includes("#")&&s(!1));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=L(a,o),c=l&&"/"!==l&&l.endsWith("/"),h=(i||"."===l)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!h||(u.pathname+="/"),u}const A=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",O=(e,t={})=>{let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),{...r,headers:n})};class F extends Error{}class N{pendingKeysSet=new Set;subscribers=new Set;deferredKeys=[];constructor(e,t){let r;(!e||"object"!=typeof e||Array.isArray(e))&&s(!1),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new F("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,[t,r])=>Object.assign(e,{[t]:this.trackPromise(t,r)})),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof F)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error(`Deferred data for key "${t}" resolved/rejected with \`undefined\`, you must resolve/reject with a value or \`null\`.`);return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return null!==this.data&&this.done||s(!1),Object.entries(this.data).reduce(((e,[t,r])=>Object.assign(e,{[t]:H(r)})),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function H(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const $=(e,t={})=>new N(e,"number"==typeof t?{status:t}:t),B=(e,t=302)=>{let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},I=(e,t)=>{let r=B(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class z{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function J(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const W=["post","put","patch","delete"],q=new Set(W),K=["get",...W],Y=new Set(K),V=new Set([301,302,303,307,308]),X=new Set([307,308]),G={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Q={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,te=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function re(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(e.routes.length>0||s(!1),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=te;let i,l,c={},d=p(e.routes,o,void 0,c),h=e.basename||"/",m=e.unstable_dataStrategy||me,g={v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1,...e.future},w=null,b=new Set,E=null,S=null,x=null,R=null!=e.hydrationData,_=y(d,e.history.location,h),C=null;if(null==_){let t=Le(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=De(d);_=r,C={[n.id]:t}}let L,k=_.some((e=>e.route.lazy)),P=_.some((e=>e.route.loader));if(k)l=!1;else if(P)if(g.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||("function"!=typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=_.findIndex((e=>void 0!==r[e.route.id]));l=_.slice(0,e+1).every(n)}else l=_.every(n)}else l=null!=e.hydrationData;else l=!0;let M,A={historyAction:e.history.action,location:e.history.location,matches:_,initialized:l,navigation:G,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||C,fetchers:new Map,blockers:new Map},T=n.Pop,j=!1,U=!1,O=new Map,F=null,N=!1,H=!1,$=[],B=[],I=new Map,z=0,J=-1,W=new Map,q=new Set,K=new Map,Y=new Map,V=new Set,re=new Map,ne=new Map,ae=!1,oe=null;function ie(e,t={}){A={...A,...e};let r=[],n=[];g.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(V.has(t)?n.push(t):r.push(t))})),[...b].forEach((e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),g.v7_fetcherPersist&&(r.forEach((e=>A.fetchers.delete(e))),n.forEach((e=>Oe(e))))}function ue(t,r,{flushSync:a}={}){let o,s=null!=A.actionData&&null!=A.navigation.formMethod&&Fe(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==t.state?._isRedirect;o=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:s?A.actionData:null;let l=r.loaderData?Re(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,u=A.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,Z))));let c,h=!0===j||null!=A.navigation.formMethod&&Fe(A.navigation.formMethod)&&!0!==t.state?._isRedirect;if(i&&(d=i,i=void 0),N||T===n.Pop||(T===n.Push?e.history.push(t,t.state):T===n.Replace&&e.history.replace(t,t.state)),T===n.Pop){let e=O.get(A.location.pathname);e&&e.has(t.pathname)?c={currentLocation:A.location,nextLocation:t}:O.has(t.pathname)&&(c={currentLocation:t,nextLocation:A.location})}else if(U){let e=O.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(A.location.pathname,e)),c={currentLocation:A.location,nextLocation:t}}ie({...r,actionData:o,loaderData:l,historyAction:T,location:t,initialized:!0,navigation:G,revalidation:"idle",restoreScrollPosition:tt(t,r.matches||A.matches),preventScrollReset:h,blockers:u},{viewTransitionOpts:c,flushSync:!0===a}),T=n.Pop,j=!1,U=!1,N=!1,H=!1,oe?.resolve(),oe=null,$=[],B=[]}async function de(t,r,a){M&&M.abort(),M=null,T=t,N=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(E&&x){let r=et(e,t);E[r]=x()}}(A.location,A.matches),j=!0===(a&&a.preventScrollReset),U=!0===(a&&a.enableViewTransition);let o=i||d,s=a&&a.overrideNavigation,l=y(o,r,h),u=!0===(a&&a.flushSync);if(!l){let e=Le(404,{pathname:r.pathname}),{matches:t,route:n}=De(o);return Ze(),void ue(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:u})}if(A.initialized&&!H&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(A.location,r)&&!(a&&a.submission&&Fe(a.submission.formMethod)))return void ue(r,{matches:l},{flushSync:u});M=new AbortController;let c,m=we(e.history,r,M.signal,a&&a.submission);if(a&&a.pendingError)c=[Ce(l).route.id,{type:f.error,error:a.pendingError}];else if(a&&a.submission&&Fe(a.submission.formMethod)){let t=await async function(e,t,r,a,o={}){let i;Ee(),ie({navigation:Je(t,r)},{flushSync:!0===o.flushSync});let s=Be(a,t);if(s.route.action||s.route.lazy){if(i=(await fe("action",e,[s],a))[0],e.signal.aborted)return{shortCircuited:!0}}else i={type:f.error,error:Le(405,{method:e.method,pathname:t.pathname,routeId:s.route.id})};if(je(i)){let t;if(o&&null!=o.replace)t=o.replace;else{t=ge(i.response.headers.get("Location"),new URL(e.url),h)===A.location.pathname+A.location.search}return await he(e,i,{submission:r,replace:t}),{shortCircuited:!0}}if(Ae(i))throw Le(400,{type:"defer-action"});if(Te(i)){let e=Ce(a,s.route.id);return!0!==(o&&o.replace)&&(T=n.Push),{pendingActionResult:[e.route.id,i]}}return{pendingActionResult:[s.route.id,i]}}(m,r,a.submission,l,{replace:a.replace,flushSync:u});if(t.shortCircuited)return;c=t.pendingActionResult,s=ze(r,a.submission),u=!1,m=we(e.history,m.url,m.signal)}let{shortCircuited:p,loaderData:v,errors:w}=await async function(t,r,n,a,o,s,l,u,c,f){let m=a||ze(r,o),p=o||s||Ie(m),y=i||d,[v,w]=ce(e.history,A,n,p,r,g.v7_partialHydration&&!0===u,g.unstable_skipActionErrorRevalidation,H,$,B,V,K,q,y,h,f);if(Ze((e=>!(n&&n.some((t=>t.route.id===e)))||v&&v.some((t=>t.route.id===e)))),J=++z,0===v.length&&0===w.length){let e=Ye();return ue(r,{matches:n,loaderData:{},errors:f&&Te(f[1])?{[f[0]]:f[1].error}:null,..._e(f),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:c}),{shortCircuited:!0}}if(!(N||g.v7_partialHydration&&u)){let e;w.forEach((e=>{let t=A.fetchers.get(e.key),r=We(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)})),f&&!Te(f[1])?e={[f[0]]:f[1].data}:A.actionData&&(e=0===Object.keys(A.actionData).length?null:A.actionData),ie({navigation:m,...void 0!==e?{actionData:e}:{},...w.length>0?{fetchers:new Map(A.fetchers)}:{}},{flushSync:c})}w.forEach((e=>{I.has(e.key)&&$e(e.key),e.controller&&I.set(e.key,e.controller)}));let b=()=>w.forEach((e=>$e(e.key)));M&&M.signal.addEventListener("abort",b);let{loaderResults:E,fetcherResults:S}=await be(A.matches,n,v,w,t);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",b);w.forEach((e=>I.delete(e.key)));let x=ke([...E,...S]);if(x){if(x.idx>=v.length){let e=w[x.idx-v.length].key;q.add(e)}return await he(t,x.result,{replace:l}),{shortCircuited:!0}}let{loaderData:R,errors:_}=xe(A,n,v,E,f,w,S,re);re.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&re.delete(t)}))})),g.v7_partialHydration&&u&&A.errors&&Object.entries(A.errors).filter((([e])=>!v.some((t=>t.route.id===e)))).forEach((([e,t])=>{_=Object.assign(_||{},{[e]:t})}));let C=Ye(),D=Ve(J),L=C||D||w.length>0;return{loaderData:R,errors:_,...L?{fetchers:new Map(A.fetchers)}:{}}}(m,r,l,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,u,c);p||(M=null,ue(r,{matches:l,..._e(c),loaderData:v,errors:w}))}async function he(a,o,{submission:i,fetcherSubmission:l,replace:c}={}){o.response.headers.has("X-Remix-Revalidate")&&(H=!0);let d=o.response.headers.get("Location");d||s(!1),d=ge(d,new URL(a.url),h);let f=u(A.location,d,{_isRedirect:!0});if(r){let r=!1;if(o.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(ee.test(d)){const n=e.history.createURL(d);r=n.origin!==t.location.origin||null==D(n.pathname,h)}if(r)return void(c?t.location.replace(d):t.location.assign(d))}M=null;let m=!0===c?n.Replace:n.Push,{formMethod:p,formAction:y,formEncType:v}=A.navigation;!i&&!l&&p&&y&&v&&(i=Ie(A.navigation));let g=i||l;if(X.has(o.response.status)&&g&&Fe(g.formMethod))await de(m,f,{submission:{...g,formAction:d},preventScrollReset:j});else{let e=ze(f,i);await de(m,f,{overrideNavigation:e,fetcherSubmission:l,preventScrollReset:j})}}async function fe(e,t,r,n){try{let a=await pe(m,e,t,r,n,c,o);return await Promise.all(a.map(((e,a)=>{if(Me(e)){let o=e.result;return{type:f.redirect,response:ve(o,t,r[a].route.id,n,h,g.v7_relativeSplatPath)}}return ye(e)})))}catch(a){return r.map((()=>({type:f.error,error:a})))}}async function be(t,r,n,a,o){let[i,...s]=await Promise.all([n.length?fe("loader",o,n,r):[],...a.map((t=>{if(t.matches&&t.match&&t.controller){return fe("loader",we(e.history,t.path,t.controller.signal),[t.match],t.matches).then((e=>e[0]))}return Promise.resolve({type:f.error,error:Le(404,{pathname:t.path})})}))]);return await Promise.all([Ne(t,n,i,i.map((()=>o.signal)),!1,A.loaderData),Ne(t,a.map((e=>e.match)),s,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:i,fetcherResults:s}}function Ee(){H=!0,$.push(...Ze()),K.forEach(((e,t)=>{I.has(t)&&(B.push(t),$e(t))}))}function Se(e,t,r={}){A.fetchers.set(e,t),ie({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Pe(e,t,r,n={}){let a=Ce(A.matches,t);Oe(e),ie({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Ue(e){return g.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),V.has(e)&&V.delete(e)),A.fetchers.get(e)||Q}function Oe(e){let t=A.fetchers.get(e);!I.has(e)||t&&"loading"===t.state&&W.has(e)||$e(e),K.delete(e),W.delete(e),q.delete(e),V.delete(e),A.fetchers.delete(e)}function $e(e){let t=I.get(e);t||s(!1),t.abort(),I.delete(e)}function Ke(e){for(let t of e){let e=qe(Ue(t).data);A.fetchers.set(t,e)}}function Ye(){let e=[],t=!1;for(let r of q){let n=A.fetchers.get(r);n||s(!1),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return Ke(e),t}function Ve(e){let t=[];for(let[r,n]of W)if(n<e){let e=A.fetchers.get(r);e||s(!1),"loading"===e.state&&($e(r),W.delete(r),t.push(r))}return Ke(t),t.length>0}function Xe(e){A.blockers.delete(e),ne.delete(e)}function Ge(e,t){let r=A.blockers.get(e)||Z;"unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state||s(!1);let n=new Map(A.blockers);n.set(e,t),ie({blockers:n})}function Qe({currentLocation:e,nextLocation:t,historyAction:r}){if(0===ne.size)return;ne.size;let n=Array.from(ne.entries()),[a,o]=n[n.length-1],i=A.blockers.get(a);return i&&"proceeding"===i.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:r})?a:void 0}function Ze(e){let t=[];return re.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),re.delete(n))})),t}function et(e,t){if(S){return S(e,t.map((e=>v(e,A.loaderData))))||e.key}return e.key}function tt(e,t){if(E){let r=et(e,t),n=E[r];if("number"==typeof n)return n}return null}return L={get basename(){return h},get future(){return g},get state(){return A},get routes(){return d},get window(){return t},initialize:function(){if(w=e.history.listen((({action:t,location:r,delta:n})=>{if(ae)return void(ae=!1);let a=Qe({currentLocation:A.location,nextLocation:r,historyAction:t});return a&&null!=n?(ae=!0,e.history.go(-1*n),void Ge(a,{state:"blocked",location:r,proceed(){Ge(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),e.history.go(n)},reset(){let e=new Map(A.blockers);e.set(a,Z),ie({blockers:e})}})):de(t,r)})),r){!function(e,t){try{let r=e.sessionStorage.getItem("remix-router-transitions");if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(r){}}(t,O);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem("remix-router-transitions",JSON.stringify(n))}catch(r){}}}(t,O);t.addEventListener("pagehide",e),F=()=>t.removeEventListener("pagehide",e)}return A.initialized||de(n.Pop,A.location,{initialHydration:!0}),L},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(E=e,x=t,S=r||null,!R&&A.navigation===G){R=!0;let e=tt(A.location,A.matches);null!=e&&ie({restoreScrollPosition:e})}return()=>{E=null,x=null,S=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=se(A.location,A.matches,h,g.v7_prependBasename,r,g.v7_relativeSplatPath,a?.fromRouteId,a?.relative),{path:i,submission:s,error:l}=le(g.v7_normalizeFormMethod,!1,o,a),c=A.location,d=u(A.location,i,a&&a.state);d={...d,...e.history.encodeLocation(d)};let f=a&&null!=a.replace?a.replace:void 0,m=n.Push;!0===f?m=n.Replace:!1===f||null!=s&&Fe(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(m=n.Replace);let p=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=!0===(a&&a.unstable_flushSync),v=Qe({currentLocation:c,nextLocation:d,historyAction:m});v?Ge(v,{state:"blocked",location:d,proceed(){Ge(v,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(v,Z),ie({blockers:e})}}):await de(m,d,{submission:s,pendingError:l,preventScrollReset:p,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:y})},fetch:async function(t,r,n,o){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(t)&&$e(t);let l=!0===(o&&o.unstable_flushSync),u=i||d,c=se(A.location,A.matches,h,g.v7_prependBasename,n,g.v7_relativeSplatPath,r,o?.relative),f=y(u,c,h);if(!f)return void Pe(t,r,Le(404,{pathname:c}),{flushSync:l});let{path:m,submission:p,error:v}=le(g.v7_normalizeFormMethod,!0,c,o);if(v)return void Pe(t,r,v,{flushSync:l});let w=Be(f,m);j=!0===(o&&o.preventScrollReset),p&&Fe(p.formMethod)?await async function(t,r,n,a,o,l,u){if(Ee(),K.delete(t),!a.route.action&&!a.route.lazy){let e=Le(405,{method:u.formMethod,pathname:n,routeId:r});return void Pe(t,r,e,{flushSync:l})}let c=A.fetchers.get(t);Se(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(u,c),{flushSync:l});let f=new AbortController,m=we(e.history,n,f.signal,u);I.set(t,f);let p=z,v=(await fe("action",m,[a],o))[0];if(m.signal.aborted)return void(I.get(t)===f&&I.delete(t));if(g.v7_fetcherPersist&&V.has(t)){if(je(v)||Te(v))return void Se(t,qe(void 0))}else{if(je(v))return I.delete(t),J>p?void Se(t,qe(void 0)):(q.add(t),Se(t,We(u)),he(m,v,{fetcherSubmission:u}));if(Te(v))return void Pe(t,r,v.error)}if(Ae(v))throw Le(400,{type:"defer-action"});let w=A.navigation.location||A.location,b=we(e.history,w,f.signal),E=i||d,S="idle"!==A.navigation.state?y(E,A.navigation.location,h):A.matches;S||s(!1);let x=++z;W.set(t,x);let R=We(u,v.data);A.fetchers.set(t,R);let[_,C]=ce(e.history,A,S,u,w,!1,g.unstable_skipActionErrorRevalidation,H,$,B,V,K,q,E,h,[a.route.id,v]);C.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=We(void 0,r?r.data:void 0);A.fetchers.set(t,n),I.has(t)&&$e(t),e.controller&&I.set(t,e.controller)})),ie({fetchers:new Map(A.fetchers)});let D=()=>C.forEach((e=>$e(e.key)));f.signal.addEventListener("abort",D);let{loaderResults:L,fetcherResults:k}=await be(A.matches,S,_,C,b);if(f.signal.aborted)return;f.signal.removeEventListener("abort",D),W.delete(t),I.delete(t),C.forEach((e=>I.delete(e.key)));let P=ke([...L,...k]);if(P){if(P.idx>=_.length){let e=C[P.idx-_.length].key;q.add(e)}return he(b,P.result)}let{loaderData:j,errors:U}=xe(A,A.matches,_,L,void 0,C,k,re);if(A.fetchers.has(t)){let e=qe(v.data);A.fetchers.set(t,e)}Ve(x),"loading"===A.navigation.state&&x>J?(T||s(!1),M&&M.abort(),ue(A.navigation.location,{matches:S,loaderData:j,errors:U,fetchers:new Map(A.fetchers)})):(ie({errors:U,loaderData:Re(A.loaderData,j,S,U),fetchers:new Map(A.fetchers)}),H=!1)}(t,r,m,w,f,l,p):(K.set(t,{routeId:r,path:m}),await async function(t,r,n,a,o,i,l){let u=A.fetchers.get(t);Se(t,We(l,u?u.data:void 0),{flushSync:i});let c=new AbortController,d=we(e.history,n,c.signal);I.set(t,c);let h=z,f=(await fe("loader",d,[a],o))[0];Ae(f)&&(f=await He(f,d.signal,!0)||f);I.get(t)===c&&I.delete(t);if(d.signal.aborted)return;if(V.has(t))return void Se(t,qe(void 0));if(je(f))return J>h?void Se(t,qe(void 0)):(q.add(t),void(await he(d,f)));if(Te(f))return void Pe(t,r,f.error);Ae(f)&&s(!1),Se(t,qe(f.data))}(t,r,m,w,f,l,p))},revalidate:function(){oe||(oe=function(){let e,t,r=new Promise(((n,a)=>{e=async e=>{n(e);try{await r}catch(t){}},t=async e=>{a(e);try{await r}catch(t){}}}));return{promise:r,resolve:e,reject:t}}()),Ee(),ie({revalidation:"loading"});let e=oe.promise;return"submitting"===A.navigation.state?e:"idle"===A.navigation.state?(de(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(de(T||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ue,deleteFetcher:function(e){if(g.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),V.add(e)):Y.set(e,t)}else Oe(e);ie({fetchers:new Map(A.fetchers)})},dispose:function(){w&&w(),F&&F(),b.clear(),M&&M.abort(),A.fetchers.forEach(((e,t)=>Oe(t))),A.blockers.forEach(((e,t)=>Xe(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||Z;return ne.get(e)!==t&&ne.set(e,t),r},deleteBlocker:Xe,_internalFetchControllers:I,_internalActiveDeferreds:re,_internalSetRoutes:function(e){c={},i=p(e,o,void 0,c)}},L}const ne=Symbol("deferred");function ae(e,t){e.length>0||s(!1);let r,n={},a=(t?t.basename:null)||"/";if(t?.mapRouteProperties)r=t.mapRouteProperties;else if(t?.detectErrorBoundary){let e=t.detectErrorBoundary;r=t=>({hasErrorBoundary:e(t)})}else r=te;let o={v7_relativeSplatPath:!1,v7_throwAbortReason:!1,...t?t.future:null},i=p(e,r,void 0,n);async function l(e,t,r,n,a,i,l){e.signal||s(!1);try{if(Fe(e.method.toLowerCase())){let s=await async function(e,t,r,n,a,i,s){let l;if(r.route.action||r.route.lazy){l=(await h("action",e,[r],t,s,n,a))[0],e.signal.aborted&&ie(e,s,o)}else{let t=Le(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:r.route.id});if(s)throw t;l={type:f.error,error:t}}if(je(l))throw new Response(null,{status:l.response.status,headers:{Location:l.response.headers.get("Location")}});if(Ae(l)){let e=Le(400,{type:"defer-action"});if(s)throw e;l={type:f.error,error:e}}if(s){if(Te(l))throw l.error;return{matches:[r],loaderData:{},actionData:{[r.route.id]:l.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let u=new Request(e.url,{headers:e.headers,redirect:e.redirect,signal:e.signal});if(Te(l)){let e=i?r:Ce(t,r.route.id);return{...await d(u,t,n,a,i,null,[e.route.id,l]),statusCode:J(l.error)?l.error.status:null!=l.statusCode?l.statusCode:500,actionData:null,actionHeaders:{...l.headers?{[r.route.id]:l.headers}:{}}}}return{...await d(u,t,n,a,i,null),actionData:{[r.route.id]:l.data},...l.statusCode?{statusCode:l.statusCode}:{},actionHeaders:l.headers?{[r.route.id]:l.headers}:{}}}(e,r,l||Be(r,t),n,a,i,null!=l);return s}let s=await d(e,r,n,a,i,l);return Ue(s)?s:{...s,actionData:null,actionHeaders:{}}}catch(u){if(function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&(e.type===f.data||e.type===f.error)}(u)&&Ue(u.result)){if(u.type===f.error)throw u.result;return u.result}if(function(e){if(!Ue(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&null!=r}(u))return u;throw u}}async function d(e,t,r,n,a,i,s){let l=null!=i;if(l&&!i?.route.loader&&!i?.route.lazy)throw Le(400,{method:e.method,pathname:new URL(e.url).pathname,routeId:i?.route.id});let u=(i?[i]:s&&Te(s[1])?ue(t,s[0]):t).filter((e=>e.route.loader||e.route.lazy));if(0===u.length)return{matches:t,loaderData:t.reduce(((e,t)=>Object.assign(e,{[t.route.id]:null})),{}),errors:s&&Te(s[1])?{[s[0]]:s[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let c=await h("loader",e,u,t,l,r,n);e.signal.aborted&&ie(e,l,o);let d=new Map,f=Se(t,u,c,s,d,a),m=new Set(u.map((e=>e.route.id)));return t.forEach((e=>{m.has(e.route.id)||(f.loaderData[e.route.id]=null)})),{...f,matches:t,activeDeferreds:d.size>0?Object.fromEntries(d.entries()):null}}async function h(e,t,i,s,l,u,c){let d=await pe(c||me,e,t,i,s,n,r,u);return await Promise.all(d.map(((e,r)=>{if(Me(e)){throw ve(e.result,t,i[r].route.id,s,a,o.v7_relativeSplatPath)}if(Ue(e.result)&&l)throw e;return ye(e)})))}return{dataRoutes:i,query:async function(e,{requestContext:t,skipLoaderErrorBubbling:r,unstable_dataStrategy:n}={}){let o=new URL(e.url),s=e.method,d=u("",c(o),null,"default"),h=y(i,d,a);if(!Oe(s)&&"HEAD"!==s){let e=Le(405,{method:s}),{matches:t,route:r}=De(i);return{basename:a,location:d,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(!h){let e=Le(404,{pathname:d.pathname}),{matches:t,route:r}=De(i);return{basename:a,location:d,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let f=await l(e,d,h,t,n||null,!0===r,null);return Ue(f)?f:{location:d,basename:a,...f}},queryRoute:async function(e,{routeId:t,requestContext:r}={}){let n=new URL(e.url),o=e.method,s=u("",c(n),null,"default"),d=y(i,s,a);if(!Oe(o)&&"HEAD"!==o&&"OPTIONS"!==o)throw Le(405,{method:o});if(!d)throw Le(404,{pathname:s.pathname});let h=t?d.find((e=>e.route.id===t)):Be(d,s);if(t&&!h)throw Le(403,{pathname:s.pathname,routeId:t});if(!h)throw Le(404,{pathname:s.pathname});let f=await l(e,s,d,r,null,!1,h);if(Ue(f))return f;let m=f.errors?Object.values(f.errors)[0]:void 0;if(void 0!==m)throw m;if(f.actionData)return Object.values(f.actionData)[0];if(f.loaderData){let e=Object.values(f.loaderData)[0];return f.activeDeferreds?.[h.route.id]&&(e[ne]=f.activeDeferreds[h.route.id]),e}}}}function oe(e,t,r){return{...t,statusCode:J(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}}}function ie(e,t,r){if(r.v7_throwAbortReason&&void 0!==e.signal.reason)throw e.signal.reason;throw new Error(`${t?"queryRoute":"query"}() call aborted: ${e.method} ${e.url}`)}function se(e,t,r,n,a,o,i,s){let l,u;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){u=e;break}}else l=t,u=t[t.length-1];let d=M(a||".",P(l,o),D(e.pathname,r)||e.pathname,"path"===s);return null==a&&(d.search=e.search,d.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||$e(d.search)||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(d.pathname="/"===d.pathname?r:A([r,d.pathname])),c(d)}function le(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!Oe(n.formMethod))return{path:r,error:Le(405,{method:n.formMethod})};let a,o,i=()=>({path:r,error:Le(400,{type:"invalid-body"})}),l=n.formMethod||"get",u=e?l.toUpperCase():l.toLowerCase(),h=Pe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Fe(u))return i();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,[t,r])=>`${e}${t}=${r}\n`),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:h,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Fe(u))return i();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:h,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(p){return i()}}}if("function"!=typeof FormData&&s(!1),n.formData)a=be(n.formData),o=n.formData;else if(n.body instanceof FormData)a=be(n.body),o=n.body;else if(n.body instanceof URLSearchParams)a=n.body,o=Ee(a);else if(null==n.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(n.body),o=Ee(a)}catch(p){return i()}let f={formMethod:u,formAction:h,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(Fe(f.formMethod))return{path:r,submission:f};let m=d(r);return t&&m.search&&$e(m.search)&&a.append("index",""),m.search=`?${a}`,{path:c(m),submission:f}}function ue(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}function ce(e,t,r,n,a,o,i,s,l,u,c,d,h,f,m,p){let v=p?Te(p[1])?p[1].error:p[1].data:void 0,g=e.createURL(t.location),w=e.createURL(a),b=p&&Te(p[1])?p[0]:void 0,E=b?ue(r,b):r,S=p?p[1].statusCode:void 0,x=i&&S&&S>=400,R=E.filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!("function"==typeof a.loader&&!a.loader.hydrate)||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||l.some((t=>t===e.route.id)))return!0;let i=t.matches[r],u=e;return he(e,{currentUrl:g,currentParams:i.params,nextUrl:w,nextParams:u.params,...n,actionResult:v,unstable_actionStatus:S,defaultShouldRevalidate:!x&&(s||g.pathname+g.search===w.pathname+w.search||g.search!==w.search||de(i,u))})})),_=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let i=y(f,e.path,m);if(!i)return void _.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(a),d=Be(i,e.path),p=!1;p=!h.has(a)&&(!!u.includes(a)||(l&&"idle"!==l.state&&void 0===l.data?s:he(d,{currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params,...n,actionResult:v,unstable_actionStatus:S,defaultShouldRevalidate:!x&&s}))),p&&_.push({key:a,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})})),[R,_]}function de(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function he(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function fe(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];a||s(!1);let o={};for(let i in n){void 0!==a[i]&&"hasErrorBoundary"!==i||m.has(i)||(o[i]=n[i])}Object.assign(a,o),Object.assign(a,{...t(a),lazy:void 0})}function me(e){return Promise.all(e.matches.map((e=>e.resolve())))}async function pe(e,t,r,n,a,o,i,l){let u=n.reduce(((e,t)=>e.add(t.route.id)),new Set),c=new Set,d=await e({matches:a.map((e=>{let n=u.has(e.route.id);return{...e,shouldLoad:n,resolve:a=>(c.add(e.route.id),n?async function(e,t,r,n,a,o,i){let l,u,c=n=>{let a,s=new Promise(((e,t)=>a=t));u=()=>a(),t.signal.addEventListener("abort",u);let l,c=a=>"function"!=typeof n?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):n({request:t,params:r.params,context:i},...void 0!==a?[a]:[]);return l=o?o((e=>c(e))):(async()=>{try{return{type:"data",result:await c()}}catch(e){return{type:"error",result:e}}})(),Promise.race([l,s])};try{let o=r.route[e];if(r.route.lazy)if(o){let e,[t]=await Promise.all([c(o).catch((t=>{e=t})),fe(r.route,a,n)]);if(void 0!==e)throw e;l=t}else{if(await fe(r.route,a,n),o=r.route[e],!o){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Le(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:f.data,result:void 0}}l=await c(o)}else{if(!o){let e=new URL(t.url);throw Le(404,{pathname:e.pathname+e.search})}l=await c(o)}void 0===l.result&&s(!1)}catch(d){return{type:f.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return l}(t,r,e,o,i,a,l):Promise.resolve({type:f.data,result:void 0}))}})),request:r,params:a[0].params,context:l});return a.forEach((e=>c.has(e.route.id)?void 0:s(!1))),d.filter(((e,t)=>u.has(a[t].route.id)))}async function ye(e){let{result:t,type:r,status:n}=e;if(Ue(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(a){return{type:f.error,error:a}}return r===f.error?{type:f.error,error:new z(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:f.data,data:e,statusCode:t.status,headers:t.headers}}return r===f.error?{type:f.error,error:t,statusCode:J(t)?t.status:n}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:f.deferred,deferredData:t,statusCode:t.init?.status,headers:t.init?.headers&&new Headers(t.init.headers)}:{type:f.data,data:t,statusCode:n}}function ve(e,t,r,n,a,o){let i=e.headers.get("Location");if(i||s(!1),!ee.test(i)){let s=n.slice(0,n.findIndex((e=>e.route.id===r))+1);i=se(new URL(t.url),s,a,!0,i,o),e.headers.set("Location",i)}return e}function ge(e,t,r){if(ee.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=null!=D(a.pathname,r);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function we(e,t,r,n){let a=e.createURL(Pe(t)).toString(),o={signal:r};if(n&&Fe(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=be(n.formData):o.body=n.formData}return new Request(a,o)}function be(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Ee(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Se(e,t,r,n,a,o){let i,l={},u=null,c=!1,d={},h=n&&Te(n[1])?n[1].error:void 0;return r.forEach(((r,n)=>{let f=t[n].route.id;if(je(r)&&s(!1),Te(r)){let t=r.error;if(void 0!==h&&(t=h,h=void 0),u=u||{},o)u[f]=t;else{let r=Ce(e,f);null==u[r.route.id]&&(u[r.route.id]=t)}l[f]=void 0,c||(c=!0,i=J(r.error)?r.error.status:500),r.headers&&(d[f]=r.headers)}else Ae(r)?(a.set(f,r.deferredData),l[f]=r.deferredData.data,null==r.statusCode||200===r.statusCode||c||(i=r.statusCode),r.headers&&(d[f]=r.headers)):(l[f]=r.data,r.statusCode&&200!==r.statusCode&&!c&&(i=r.statusCode),r.headers&&(d[f]=r.headers))})),void 0!==h&&n&&(u={[n[0]]:h},l[n[0]]=void 0),{loaderData:l,errors:u,statusCode:i||200,loaderHeaders:d}}function xe(e,t,r,n,a,o,i,l){let{loaderData:u,errors:c}=Se(t,r,n,a,l,!1);for(let d=0;d<o.length;d++){let{key:t,match:r,controller:n}=o[d];(void 0===i||void 0===i[d])&&s(!1);let a=i[d];if(!n||!n.signal.aborted)if(Te(a)){let n=Ce(e.matches,r?.route.id);c&&c[n.route.id]||(c={...c,[n.route.id]:a.error}),e.fetchers.delete(t)}else if(je(a))s(!1);else if(Ae(a))s(!1);else{let r=qe(a.data);e.fetchers.set(t,r)}}return{loaderData:u,errors:c}}function Re(e,t,r,n){let a={...t};for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function _e(e){return e?Te(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ce(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function De(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Le(e,{pathname:t,routeId:r,method:n,type:a}={}){let o="Unknown Server Error",i="Unknown @remix-run/router error";return 400===e?(o="Bad Request",n&&t&&r?i=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"defer-action"===a?i="defer() is not supported in actions":"invalid-body"===a&&(i="Unable to encode submission body")):403===e?(o="Forbidden",i=`Route "${r}" does not match URL "${t}"`):404===e?(o="Not Found",i=`No route matches URL "${t}"`):405===e&&(o="Method Not Allowed",n&&t&&r?i=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(i=`Invalid request method "${n.toUpperCase()}"`)),new z(e||500,o,new Error(i),!0)}function ke(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Pe(e){return c({..."string"==typeof e?d(e):e,hash:""})}function Me(e){return Ue(e.result)&&V.has(e.result.status)}function Ae(e){return e.type===f.deferred}function Te(e){return e.type===f.error}function je(e){return(e&&e.type)===f.redirect}function Ue(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Oe(e){return Y.has(e.toLowerCase())}function Fe(e){return q.has(e.toLowerCase())}async function Ne(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],u=t[i];if(!u)continue;let c=e.find((e=>e.route.id===u.route.id)),d=null!=c&&!de(c,u)&&void 0!==(o&&o[u.route.id]);if(Ae(l)&&(a||d)){let e=n[i];e||s(!1),await He(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function He(e,t,r=!1){if(!(await e.deferredData.resolveData(t))){if(r)try{return{type:f.data,data:e.deferredData.unwrappedData}}catch(n){return{type:f.error,error:n}}return{type:f.data,data:e.deferredData.data}}}function $e(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let r="string"==typeof t?d(t).search:t.search;if(e[e.length-1].route.index&&$e(r||""))return e[e.length-1];let n=k(e);return n[n.length-1]}function Ie(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function ze(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Je(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function We(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function qe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}const Ke=e.createContext(null);Ke.displayName="DataRouter";const Ye=e.createContext(null);Ye.displayName="DataRouterState";const Ve=e.createContext(null);Ve.displayName="Await";const Xe=e.createContext(null);Xe.displayName="Navigation";const Ge=e.createContext(null);Ge.displayName="Location";const Qe=e.createContext({outlet:null,matches:[],isDataRoute:!1});Qe.displayName="Route";const Ze=e.createContext(null);function et(t,{relative:r}={}){tt()||s(!1);let{basename:n,navigator:a}=e.useContext(Xe),{hash:o,pathname:i,search:l}=dt(t,{relative:r}),u=i;return"/"!==n&&(u="/"===i?n:A([n,i])),a.createHref({pathname:u,search:l,hash:o})}function tt(){return null!=e.useContext(Ge)}function rt(){return tt()||s(!1),e.useContext(Ge).location}function nt(){return e.useContext(Ge).navigationType}function at(t){tt()||s(!1);let{pathname:r}=rt();return e.useMemo((()=>_(t,r)),[r,t])}function ot(t){e.useContext(Xe).static||e.useLayoutEffect(t)}function it(){let{isDataRoute:t}=e.useContext(Qe);return t?function(){let{router:t}=Et(wt.UseNavigateStable),r=xt(bt.UseNavigateStable),n=e.useRef(!1);return ot((()=>{n.current=!0})),e.useCallback((async(e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):await t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){tt()||s(!1);let t=e.useContext(Ke),{basename:r,future:n,navigator:a}=e.useContext(Xe),{matches:o}=e.useContext(Qe),{pathname:i}=rt(),l=JSON.stringify(P(o,n.v7_relativeSplatPath)),u=e.useRef(!1);return ot((()=>{u.current=!0})),e.useCallback(((e,n={})=>{if(!u.current)return;if("number"==typeof e)return void a.go(e);let o=M(e,JSON.parse(l),i,"path"===n.relative);null==t&&"/"!==r&&(o.pathname="/"===o.pathname?r:A([r,o.pathname])),(n.replace?a.replace:a.push)(o,n.state,n)}),[r,a,l,i,t])}()}Ze.displayName="RouteError";const st=e.createContext(null);function lt(){return e.useContext(st)}function ut(t){let r=e.useContext(Qe).outlet;return r?e.createElement(st.Provider,{value:t},r):r}function ct(){let{matches:t}=e.useContext(Qe),r=t[t.length-1];return r?r.params:{}}function dt(t,{relative:r}={}){let{future:n}=e.useContext(Xe),{matches:a}=e.useContext(Qe),{pathname:o}=rt(),i=JSON.stringify(P(a,n.v7_relativeSplatPath));return e.useMemo((()=>M(t,JSON.parse(i),o,"path"===r)),[t,i,o,r])}function ht(e,t){return ft(e,t)}function ft(t,r,a,o){tt()||s(!1);let{navigator:i}=e.useContext(Xe),{matches:l}=e.useContext(Qe),u=l[l.length-1],c=u?u.params:{},h=u?u.pathname:"/",f=u?u.pathnameBase:"/",m=u&&u.route;{let e=m&&m.path||"";Ft(h,!m||e.endsWith("*"))}let p,v=rt();if(r){let e="string"==typeof r?d(r):r;"/"===f||e.pathname?.startsWith(f)||s(!1),p=e}else p=v;let g=p.pathname||"/",w=g;if("/"!==f){let e=f.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=y(t,{pathname:w}),E=gt(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:A([f,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:A([f,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,a,o);return r&&E?e.createElement(Ge.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:n.Pop}},E):E}function mt(){let t=Mt(),r=J(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},s=null;return console.error("Error handled by React Router default ErrorBoundary:",t),s=e.createElement(e.Fragment,null,e.createElement("p",null,"💿 Hey developer 👋"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:i},"ErrorBoundary")," or"," ",e.createElement("code",{style:i},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:o},n):null,s)}const pt=e.createElement(mt,null);class yt extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(Qe.Provider,{value:this.props.routeContext},e.createElement(Ze.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vt({routeContext:t,match:r,children:n}){let a=e.useContext(Ke);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(Qe.Provider,{value:t},n)}function gt(t,r=[],n=null,a=null){if(null==t){if(!n?.errors)return null;t=n.matches}let o=t,i=n?.errors;if(null!=i){let e=o.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));e>=0||s(!1),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,u=-1;if(n&&a&&a.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){l=!0,o=u>=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight(((t,a,s)=>{let c,d=!1,h=null,f=null;n&&(c=i&&a.route.id?i[a.route.id]:void 0,h=a.route.errorElement||pt,l&&(u<0&&0===s?(Ft("route-fallback",!1),d=!0,f=null):u===s&&(d=!0,f=a.route.hydrateFallbackElement||null)));let m=r.concat(o.slice(0,s+1)),p=()=>{let r;return r=c?h:d?f:a.route.Component?e.createElement(a.route.Component,null):a.route.element?a.route.element:t,e.createElement(vt,{match:a,routeContext:{outlet:t,matches:m,isDataRoute:null!=n},children:r})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===s)?e.createElement(yt,{location:n.location,revalidation:n.revalidation,component:h,error:c,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()}),null)}var wt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(wt||{}),bt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(bt||{});function Et(t){let r=e.useContext(Ke);return r||s(!1),r}function St(t){let r=e.useContext(Ye);return r||s(!1),r}function xt(t){let r=function(t){let r=e.useContext(Qe);return r||s(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||s(!1),n.route.id}function Rt(){return xt(bt.UseRouteId)}function _t(){return St(bt.UseNavigation).navigation}function Ct(){let t=Et(wt.UseRevalidator),r=St(bt.UseRevalidator);return e.useMemo((()=>({async revalidate(){await t.router.revalidate()},state:r.revalidation})),[t.router,r.revalidation])}function Dt(){let{matches:t,loaderData:r}=St(bt.UseMatches);return e.useMemo((()=>t.map((e=>v(e,r)))),[t,r])}function Lt(){let e=St(bt.UseLoaderData),t=xt(bt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function kt(e){return St(bt.UseRouteLoaderData).loaderData[e]}function Pt(){let e=St(bt.UseActionData),t=xt(bt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Mt(){let t=e.useContext(Ze),r=St(bt.UseRouteError),n=xt(bt.UseRouteError);return void 0!==t?t:r.errors?.[n]}function At(){return e.useContext(Ve)?._data}function Tt(){return e.useContext(Ve)?._error}let jt=0;function Ut(t){let{router:r,basename:n}=Et(wt.UseBlocker),a=St(bt.UseBlocker),[o,i]=e.useState(""),s=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:D(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:D(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++jt);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,s)}),[r,o,s]),o&&a.blockers.has(o)?a.blockers.get(o):Z}const Ot={};function Ft(e,t,r){t||Ot[e]||(Ot[e]=!0)}function Nt(t){let r={hasErrorBoundary:t.hasErrorBoundary||null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&(t.element,Object.assign(r,{element:e.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement,Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement,Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),r}function Ht(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:a({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:Nt,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}const $t=e.startTransition;function Bt({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:i}=n||{},s=e.useCallback((e=>{i&&$t?$t((()=>o(e))):o(e)}),[o,i]);e.useLayoutEffect((()=>r.subscribe(s)),[r,s]),e.useEffect((()=>{}),[]);let l=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),u=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:l,static:!1,basename:u})),[r,l,u]);return e.createElement(e.Fragment,null,e.createElement(Ke.Provider,{value:c},e.createElement(Ye.Provider,{value:a},e.createElement(Kt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:l,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(It,{routes:r.routes,future:r.future,state:a}):t))),null)}function It({routes:e,future:t,state:r}){return ft(e,void 0,r,t)}function zt({basename:t,children:r,initialEntries:n,initialIndex:o,future:i}){let s=e.useRef();null==s.current&&(s.current=a({initialEntries:n,initialIndex:o,v5Compat:!0}));let l=s.current,[u,c]=e.useState({action:l.action,location:l.location}),{v7_startTransition:d}=i||{},h=e.useCallback((e=>{d&&$t?$t((()=>c(e))):c(e)}),[c,d]);return e.useLayoutEffect((()=>l.listen(h)),[l,h]),e.createElement(Kt,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l,future:i})}function Jt({to:t,replace:r,state:n,relative:a}){tt()||s(!1);let{future:o,static:i}=e.useContext(Xe),{matches:l}=e.useContext(Qe),{pathname:u}=rt(),c=it(),d=M(t,P(l,o.v7_relativeSplatPath),u,"path"===a),h=JSON.stringify(d);return e.useEffect((()=>{c(JSON.parse(h),{replace:r,state:n,relative:a})}),[c,h,a,r,n]),null}function Wt(e){return ut(e.context)}function qt(e){s(!1)}function Kt({basename:t="/",children:r=null,location:a,navigationType:o=n.Pop,navigator:i,static:l=!1,future:u}){tt()&&s(!1);let c=t.replace(/^\/*/,"/"),h=e.useMemo((()=>({basename:c,navigator:i,static:l,future:{v7_relativeSplatPath:!1,...u}})),[c,u,i,l]);"string"==typeof a&&(a=d(a));let{pathname:f="/",search:m="",hash:p="",state:y=null,key:v="default"}=a,g=e.useMemo((()=>{let e=D(f,c);return null==e?null:{location:{pathname:e,search:m,hash:p,state:y,key:v},navigationType:o}}),[c,f,m,p,y,v,o]);return null==g?null:e.createElement(Xe.Provider,{value:h},e.createElement(Ge.Provider,{children:r,value:g}))}function Yt({children:e,location:t}){return ht(er(e),t)}function Vt({children:t,errorElement:r,resolve:n}){return e.createElement(Qt,{resolve:n,errorElement:r},e.createElement(Zt,null,t))}var Xt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Xt||{});const Gt=new Promise((()=>{}));class Qt extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=Xt.pending;if(n instanceof Promise)if(this.state.error){o=Xt.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?Xt.error:void 0!==a._data?Xt.success:Xt.pending):(o=Xt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=Xt.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===Xt.error&&a._error instanceof F)throw Gt;if(o===Xt.error&&!r)throw a._error;if(o===Xt.error)return e.createElement(Ve.Provider,{value:a,children:r});if(o===Xt.success)return e.createElement(Ve.Provider,{value:a,children:t});throw a}}function Zt({children:t}){let r=At(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function er(t,r=[]){let n=[];return e.Children.forEach(t,((t,a)=>{if(!e.isValidElement(t))return;let o=[...r,a];if(t.type===e.Fragment)return void n.push.apply(n,er(t.props.children,o));t.type!==qt&&s(!1),t.props.index&&t.props.children&&s(!1);let i={id:t.props.id||o.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=er(t.props.children,o)),n.push(i)})),n}function tr(e){return gt(e)}const rr="application/x-www-form-urlencoded";function nr(e){return null!=e&&"string"==typeof e.tagName}function ar(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}let or=null;const ir=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sr(e){return null==e||ir.has(e)?e:null}function lr(e,t){let r,n,a,o,i;if(nr(s=e)&&"form"===s.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?D(i,t):null,r=e.getAttribute("method")||"get",a=sr(e.getAttribute("enctype"))||rr,o=new FormData(e)}else if(function(e){return nr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return nr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||i.getAttribute("action");if(n=s?D(s,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||"get",a=sr(e.getAttribute("formenctype"))||sr(i.getAttribute("enctype"))||rr,o=new FormData(i,e),!function(){if(null===or)try{new FormData(document.createElement("form"),0),or=!1}catch(e){or=!0}return or}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,n)}}else{if(nr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r="get",n=null,a=rr,i=e}var s;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}function ur(e,t){if(!1===e||null==e)throw new Error(t)}async function cr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(window.__remixContext&&window.__remixContext.isSpaMode&&void 0!==import.meta.hot)throw console.error(`Error loading route module \`${e.module}\`:`,r),r;return window.location.reload(),new Promise((()=>{}))}}function dr(e,t,r){let n=e.map((e=>{let n=t[e.route.id],a=r.routes[e.route.id];return[a.css?a.css.map((e=>({rel:"stylesheet",href:e}))):[],n?.links?.()||[]]})).flat(2),a=function(e,t){return vr(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(e,r);return gr(n,a)}async function hr(e,t){if(!e.css&&!t.links||!function(){if(void 0!==wr)return wr;let e=document.createElement("link");return wr=e.relList.supports("preload"),e=null,wr}())return;let r=[];if(e.css&&r.push(...e.css.map((e=>({rel:"stylesheet",href:e})))),t.links&&r.push(...t.links()),0===r.length)return;let n=[];for(let o of r)mr(o)||"stylesheet"!==o.rel||n.push({...o,rel:"preload",as:"style"});let a=n.filter((e=>(!e.media||window.matchMedia(e.media).matches)&&!document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`)));await Promise.all(a.map(fr))}async function fr(e){return new Promise((t=>{let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)}))}function mr(e){return null!=e&&"string"==typeof e.page}function pr(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function yr(e,t,r,n,a,o){let i=function(e){let t=d(e);void 0===t.search&&(t.search="");return t}(e),s=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"data"===o&&a.search!==i.search?t.filter(((t,o)=>{if(!n.routes[t.route.id].hasLoader)return!1;if(s(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0})):t.filter(((e,t)=>{let r=n.routes[e.route.id];return("assets"===o||r.hasLoader)&&(s(e,t)||l(e,t))}))}function vr(e){return[...new Set(e)]}function gr(e,t){let r=new Set,n=new Set(t);return e.reduce(((e,a)=>{if(t&&!mr(a)&&"script"===a.as&&a.href&&n.has(a.href))return e;let o=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(a));return r.has(o)||(r.add(o),e.push({key:o,link:a})),e}),[])}let wr;const br={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Er=/[&><\u2028\u2029]/g;function Sr(e){return{__html:e}}const xr=Symbol("SingleFetchRedirect");function Rr({context:t,identifier:r,reader:n,textDecoder:a,isAction:o}){if(!t.renderMeta||!t.renderMeta.didRenderScripts)return null;t.renderMeta.streamCache||(t.renderMeta.streamCache={});let i=o?t.renderMeta.streamCacheAction:t.renderMeta.streamCache;i||(o?(t.renderMeta.streamCacheAction={},i=t.renderMeta.streamCacheAction):(t.renderMeta.streamCache={},i=t.renderMeta.streamCache));let s=i[r];if(s||(s=i[r]=n.read().then((e=>{i[r].result={done:e.done,value:a.decode(e.value,{stream:!0})}})).catch((e=>{i[r].error=e}))),s.error)throw s.error;if(void 0===s.result)throw s;let{done:l,value:u}=s.result,c=u?e.createElement("script",{dangerouslySetInnerHTML:{__html:`window.__remixContext.streamController${o?"Action":""}.enqueue(${d=JSON.stringify(u),d.replace(Er,(e=>br[e]))});`}}):null;var d;return l?e.createElement(e.Fragment,null,c,e.createElement("script",{dangerouslySetInnerHTML:{__html:`window.__remixContext.streamController${o?"Action":""}.close();`}})):e.createElement(e.Fragment,null,c,e.createElement(e.Suspense,null,e.createElement(Rr,{context:t,identifier:r+1,reader:n,textDecoder:a,isAction:o})))}function _r(e,t){return async({request:r,matches:n})=>"GET"!==r.method?function(e,t){return Promise.all(t.map((async t=>{let r,n=await t.resolve((async n=>{let a=await n((async()=>{let n=Dr(e.url),a=await async function(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}(e),{data:o,status:i}=await Lr(n,a);return r=i,Mr(o,t.route.id)}));return{type:"data",result:a,status:r}}));return{...n,status:r}})))}(r,n):function(e,t,r,n){let a;return Promise.all(n.map((async o=>o.resolve((async i=>{let s,l=function(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}(Dr(r.url));return s=e.routes[o.route.id].hasClientLoader?await i((async()=>{l.searchParams.set("_routes",o.route.id);let{data:e}=await Lr(l);return Pr(e,o.route.id)})):await i((async()=>(a||(l=Cr(e,t,n.map((e=>e.route)),n.filter((e=>e.shouldLoad)).map((e=>e.route)),l),a=Lr(l).then((({data:e})=>e))),Pr(await a,o.route.id)))),{type:"data",result:s}})))))}(e,t,r,n)}function Cr(e,t,r,n,a){let o=t=>t.filter((t=>e.routes[t].hasLoader)).join(",");if(!r.some((r=>t[r.id]?.shouldRevalidate||e.routes[r.id]?.hasClientLoader)))return a;let i=o(r.map((e=>e.id))),s=o(n.filter((t=>!e.routes[t.id]?.hasClientLoader)).map((e=>e.id)));return i!==s&&a.searchParams.set("_routes",s),a}function Dr(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname=`${"/"===t.pathname?"_root":t.pathname}.data`,t}async function Lr(e,t){let r=await fetch(e,t);if(r.body||ur(!1),r.headers.get("Content-Type")?.includes("text/x-component")){r.body||ur(!1);let e=await window.createFromReadableStream(r.body);return{status:r.status,data:e}}try{let e=await kr(r.body,window);return{status:r.status,data:e.value}}catch(n){throw new Error("Unable to decode turbo-stream response")}}function kr(e,t){return r(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,a]=r,o=Error;e&&e in t&&"function"==typeof t[e]&&(o=t[e]);let i=new o(n);return i.stack=a,{value:i}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new z(t,n,e)}}if("SingleFetchRedirect"===e)return{value:{[xr]:r[0]}}}]})}function Pr(e,t){let r=e[xr];return r?Mr(r,t):void 0!==e[t]?Mr(e[t],t):null}function Mr(e,t){if("error"in e)throw e.error;if("redirect"in e){let t={};return e.revalidate&&(t["X-Remix-Revalidate"]="yes"),e.reload&&(t["X-Remix-Reload-Document"]="yes"),B(e.redirect,{status:e.status,headers:t})}if("data"in e)return e.data;throw new Error(`No response found for routeId "${t}"`)}function Ar(){let t=e.useContext(Ke);return t||ur(!1),t}function Tr(){let t=e.useContext(Ye);return t||ur(!1),t}const jr=e.createContext(void 0);function Ur(){let t=e.useContext(jr);return t||ur(!1),t}function Or(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Fr(e,t,r){if(r&&!zr)return[e[0]];if(t){let r=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,r+1)}return e}function Nr(){let{isSpaMode:t,manifest:r,routeModules:n,criticalCss:a}=Ur(),{errors:o,matches:i}=Tr(),s=Fr(i,o,t),l=e.useMemo((()=>dr(s,n,r)),[s,n,r]);return e.createElement(e.Fragment,null,a?e.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,l.map((({key:t,link:r})=>mr(r)?e.createElement(Hr,Object.assign({key:t},r)):e.createElement("link",Object.assign({key:t},r)))))}function Hr({page:t,...r}){let{router:n}=Ar(),a=e.useMemo((()=>y(n.routes,t,n.basename)),[n.routes,t,n.basename]);return a?e.createElement(Br,Object.assign({page:t,matches:a},r)):(console.warn(`Tried to prefetch ${t} but no routes matched.`),null)}function $r(t){let{manifest:r,routeModules:n}=Ur(),[a,o]=e.useState([]);return e.useEffect((()=>{let e=!1;return async function(e,t,r){return gr((await Promise.all(e.map((async e=>{let n=await cr(t.routes[e.route.id],r);return n.links?n.links():[]})))).flat(1).filter(pr).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(t,r,n).then((t=>{e||o(t)})),()=>{e=!0}}),[t,r,n]),a}function Br({page:t,matches:r,...n}){let a=rt(),{manifest:o,routeModules:i}=Ur(),{matches:s}=Tr(),l=e.useMemo((()=>yr(t,r,s,o,a,"data")),[t,r,s,o,a]),u=e.useMemo((()=>yr(t,r,s,o,a,"assets")),[t,r,s,o,a]),c=e.useMemo((()=>function(e,t){return vr(e.map((e=>{let r=t.routes[e.route.id],n=[r.module];return r.imports&&(n=n.concat(r.imports)),n})).flat(1))}(u,o)),[u,o]),d=$r(u),h=null;if(l.length>0){let a=Cr(o,i,r.map((e=>e.route)),l.map((e=>e.route)),Dr(t));""!==a.searchParams.get("_routes")&&(h=e.createElement("link",Object.assign({key:a.pathname+a.search,rel:"prefetch",as:"fetch",href:a.pathname+a.search},n)))}return e.createElement(e.Fragment,null,h,c.map((t=>e.createElement("link",Object.assign({key:t,rel:"modulepreload",href:t},n)))),d.map((({key:t,link:r})=>e.createElement("link",Object.assign({key:t},r)))))}function Ir(){let{isSpaMode:t,routeModules:r}=Ur(),{errors:n,matches:a,loaderData:o}=Tr(),i=rt(),s=Fr(a,n,t),l=null;n&&(l=n[s[s.length-1].route.id]);let u=[],c=null,d=[];for(let e=0;e<s.length;e++){let t=s[e],n=t.route.id,a=o[n],h=t.params,f=r[n],m=[],p={id:n,data:a,meta:[],params:t.params,pathname:t.pathname,handle:t.route.handle,error:l};if(d[e]=p,f?.meta?m="function"==typeof f.meta?f.meta({data:a,params:h,location:i,matches:d,error:l}):Array.isArray(f.meta)?[...f.meta]:f.meta:c&&(m=[...c]),m=m||[],!Array.isArray(m))throw new Error("The route at "+t.route.path+" returns an invalid value. All route meta functions must return an array of meta objects.\n\nTo reference the meta function API, see https://remix.run/route/meta");p.meta=m,d[e]=p,u=[...m],c=u}return e.createElement(e.Fragment,null,u.flat().map((t=>{if(!t)return null;if("tagName"in t){let{tagName:r,...n}=t;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(r))return console.warn(`A meta object uses an invalid tagName: ${r}. Expected either 'link' or 'meta'`),null;let a=r;return e.createElement(a,Object.assign({key:JSON.stringify(n)},n))}if("title"in t)return e.createElement("title",{key:"title"},String(t.title));if("charset"in t&&(t.charSet??=t.charset,delete t.charset),"charSet"in t&&null!=t.charSet)return"string"==typeof t.charSet?e.createElement("meta",{key:"charSet",charSet:t.charSet}):null;if("script:ld+json"in t)try{let r=JSON.stringify(t["script:ld+json"]);return e.createElement("script",{key:`script:ld+json:${r}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:r}})}catch(r){return null}return e.createElement("meta",Object.assign({key:JSON.stringify(t)},t))})))}jr.displayName="Remix";let zr=!1;function Jr(t){let{manifest:r,serverHandoffString:n,isSpaMode:a,renderMeta:o,future:i}=Ur(),{router:s,static:l,staticContext:u}=Ar(),{matches:c}=Tr(),d=_t();o&&(o.didRenderScripts=!0);let h=Fr(c,null,a);e.useEffect((()=>{zr=!0}),[]);let f=e.useMemo((()=>{let a="window.__remixContext.stream = new ReadableStream({start(controller){window.__remixContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";i.unstable_serverComponents&&u?.actionData&&(a+="window.__remixContext.streamAction = new ReadableStream({start(controller){window.__remixContext.streamControllerAction = controller;}}).pipeThrough(new TextEncoderStream());");let o=u?`window.__remixContext = ${n};${a}`:" ",s=l?`${r.hmr?.runtime?`import ${JSON.stringify(r.hmr.runtime)};`:""}import ${JSON.stringify(r.url)};\n${h.map(((e,t)=>`import * as route${t} from ${JSON.stringify(r.routes[e.route.id].module)};`)).join("\n")}\nwindow.__remixRouteModules = {${h.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(r.entry.module)});`:" ";return e.createElement(e.Fragment,null,e.createElement("script",Object.assign({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Sr(o),type:void 0})),e.createElement("script",Object.assign({},t,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Sr(s),type:"module",async:!0})))}),[]),m=e.useMemo((()=>{if(d.location){let e=y(s.routes,d.location,s.basename);return e||ur(!1),e}return[]}),[d.location,s.routes,s.basename]),p=h.concat(m).map((e=>{let t=r.routes[e.route.id];return(t.imports||[]).concat([t.module])})).flat(1),v=zr?[]:r.entry.imports.concat(p);return zr?null:e.createElement(e.Fragment,null,e.createElement("link",{rel:"modulepreload",href:r.url,crossOrigin:t.crossOrigin}),e.createElement("link",{rel:"modulepreload",href:r.entry.module,crossOrigin:t.crossOrigin}),(g=v,[...new Set(g)]).map((r=>e.createElement("link",{key:r,rel:"modulepreload",href:r,crossOrigin:t.crossOrigin}))),f);var g}function Wr(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}const qr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{qr&&(window.__reactRouterVersion="0")}catch(ma){}function Kr(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:o({window:t?.window}),hydrationData:t?.hydrationData||Vr(),routes:e,mapRouteProperties:Nt,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function Yr(e,t){return re({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:i({window:t?.window}),hydrationData:t?.hydrationData||Vr(),routes:e,mapRouteProperties:Nt,unstable_dataStrategy:t?.unstable_dataStrategy,window:t?.window}).initialize()}function Vr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Xr(e.errors)}),e}function Xr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[n]=new z(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack="",r[n]=t}catch(ma){}}if(null==r[n]){let e=new Error(a.message);e.stack="",r[n]=e}}else r[n]=a;return r}const Gr=e.createContext({isTransitioning:!1});Gr.displayName="ViewTransition";const Qr=e.createContext(new Map);Qr.displayName="Fetchers";const Zr=e.startTransition,en=t.flushSync,tn=e.useId;function rn(e){en?en(e):e()}class nn{status="pending";constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function an({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),[i,s]=e.useState(),[l,u]=e.useState({isTransitioning:!1}),[c,d]=e.useState(),[h,f]=e.useState(),[m,p]=e.useState(),y=e.useRef(new Map),{v7_startTransition:v}=n||{},g=e.useCallback((e=>{v?function(e){Zr?Zr(e):e()}(e):e()}),[v]),w=e.useCallback(((e,{deletedFetchers:t,unstable_flushSync:n,unstable_viewTransitionOpts:a})=>{t.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let i=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(a&&!i){if(n){rn((()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:a.currentLocation,nextLocation:a.nextLocation})}));let t=r.window.document.startViewTransition((()=>{rn((()=>o(e)))}));return t.finished.finally((()=>{rn((()=>{d(void 0),f(void 0),s(void 0),u({isTransitioning:!1})}))})),void rn((()=>f(t)))}h?(c&&c.resolve(),h.skipTransition(),p({state:e,currentLocation:a.currentLocation,nextLocation:a.nextLocation})):(s(e),u({isTransitioning:!0,flushSync:!1,currentLocation:a.currentLocation,nextLocation:a.nextLocation}))}else n?rn((()=>o(e))):g((()=>o(e)))}),[r.window,h,c,y,g]);e.useLayoutEffect((()=>r.subscribe(w)),[r,w]),e.useEffect((()=>{l.isTransitioning&&!l.flushSync&&d(new nn)}),[l]),e.useEffect((()=>{if(c&&i&&r.window){let e=i,t=c.promise,n=r.window.document.startViewTransition((async()=>{g((()=>o(e))),await t}));n.finished.finally((()=>{d(void 0),f(void 0),s(void 0),u({isTransitioning:!1})})),f(n)}}),[g,i,c,r.window]),e.useEffect((()=>{c&&i&&a.location.key===i.location.key&&c.resolve()}),[c,h,a.location,i]),e.useEffect((()=>{!l.isTransitioning&&m&&(s(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))}),[l.isTransitioning,m]),e.useEffect((()=>{}),[]);let b=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),E=r.basename||"/",S=e.useMemo((()=>({router:r,navigator:b,static:!1,basename:E})),[r,b,E]);return e.createElement(e.Fragment,null,e.createElement(Ke.Provider,{value:S},e.createElement(Ye.Provider,{value:a},e.createElement(Qr.Provider,{value:y.current},e.createElement(Gr.Provider,{value:l},e.createElement(Kt,{basename:E,location:a.location,navigationType:a.historyAction,navigator:b,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(on,{routes:r.routes,future:r.future,state:a}):t))))),null)}function on({routes:e,future:t,state:r}){return ft(e,void 0,r,t)}function sn({basename:t,children:r,future:n,window:a}){let i=e.useRef();null==i.current&&(i.current=o({window:a,v5Compat:!0}));let s=i.current,[l,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},d=e.useCallback((e=>{c&&Zr?Zr((()=>u(e))):u(e)}),[u,c]);return e.useLayoutEffect((()=>s.listen(d)),[s,d]),e.createElement(Kt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function ln({basename:t,children:r,future:n,window:a}){let o=e.useRef();null==o.current&&(o.current=i({window:a,v5Compat:!0}));let s=o.current,[l,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},d=e.useCallback((e=>{c&&Zr?Zr((()=>u(e))):u(e)}),[u,c]);return e.useLayoutEffect((()=>s.listen(d)),[s,d]),e.createElement(Kt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}function un({basename:t,children:r,future:n,history:a}){let[o,i]=e.useState({action:a.action,location:a.location}),{v7_startTransition:s}=n||{},l=e.useCallback((e=>{s&&Zr?Zr((()=>i(e))):i(e)}),[i,s]);return e.useLayoutEffect((()=>a.listen(l)),[a,l]),e.createElement(Kt,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}un.displayName="unstable_HistoryRouter";const cn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dn=e.forwardRef((function({onClick:t,prefetch:r="none",relative:n,reloadDocument:a,replace:o,state:i,target:s,to:l,preventScrollReset:u,unstable_viewTransition:c,...d},h){let f,{basename:m}=e.useContext(Xe),p="string"==typeof l&&cn.test(l),y=!1;if("string"==typeof l&&p&&(f=l,qr))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),r=D(t.pathname,m);t.origin===e.origin&&null!=r?l=r+t.search+t.hash:y=!0}catch(ma){}let v=et(l,{relative:n}),[g,w,b]=function(t,r){let n=e.useContext(jr),[a,o]=e.useState(!1),[i,s]=e.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=r,f=e.useRef(null);e.useEffect((()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver((e=>{e.forEach((e=>{s(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[t]),e.useEffect((()=>{if(a){let e=setTimeout((()=>{s(!0)}),100);return()=>{clearTimeout(e)}}}),[a]);let m=()=>{o(!0)},p=()=>{o(!1),s(!1)};return n?"intent"!==t?[i,f,{}]:[i,f,{onFocus:Or(l,m),onBlur:Or(u,p),onMouseEnter:Or(c,m),onMouseLeave:Or(d,p),onTouchStart:Or(h,m)}]:[!1,f,{}]}(r,d),E=wn(l,{replace:o,state:i,target:s,preventScrollReset:u,relative:n,unstable_viewTransition:c});let S=e.createElement("a",Object.assign({},d,b,{href:f||v,onClick:y||a?t:function(e){t&&t(e),e.defaultPrevented||E(e)},ref:Wr(h,w),target:s}));return g&&!p?e.createElement(e.Fragment,null,S,e.createElement(Hr,{page:v})):S}));dn.displayName="Link";const hn=e.forwardRef((function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,unstable_viewTransition:s,children:l,...u},c){let d=dt(i,{relative:u.relative}),h=rt(),f=e.useContext(Ye),{navigator:m,basename:p}=e.useContext(Xe),y=null!=f&&Tn(d)&&!0===s,v=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=h.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(g=g.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&p&&(w=D(w,p)||w);const b="/"!==v&&v.endsWith("/")?v.length-1:v.length;let E,S=g===v||!a&&g.startsWith(v)&&"/"===g.charAt(b),x=null!=w&&(w===v||!a&&w.startsWith(v)&&"/"===w.charAt(v.length)),R={isActive:S,isPending:x,isTransitioning:y},_=S?t:void 0;E="function"==typeof n?n(R):[n,S?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof o?o(R):o;return e.createElement(dn,Object.assign({},u,{"aria-current":_,className:E,ref:c,style:C,to:i,unstable_viewTransition:s}),"function"==typeof l?l(R):l)}));hn.displayName="NavLink";const fn=e.forwardRef((({fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i="get",action:s,onSubmit:l,relative:u,preventScrollReset:c,unstable_viewTransition:d,...h},f)=>{let m=xn(),p=Rn(s,{relative:u}),y="get"===i.toLowerCase()?"get":"post";return e.createElement("form",Object.assign({ref:f,method:y,action:p,onSubmit:n?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,s=n?.getAttribute("formmethod")||i;m(n||e.currentTarget,{fetcherKey:t,method:s,navigate:r,replace:a,state:o,relative:u,preventScrollReset:c,unstable_viewTransition:d})}},h))}));function mn({getKey:t,storageKey:r,...n}){let a=e.useContext(jr),{basename:o}=e.useContext(Xe),i=rt(),s=Dt();Pn({getKey:t,storageKey:r});let l=e.useMemo((()=>{if(!a||!t)return null;let e=kn(i,s,o,t);return e!==i.key?e:null}),[]);if(!a||a.isSpaMode)return null;let u=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(r){console.error(r),sessionStorage.removeItem(e)}}).toString();return e.createElement("script",Object.assign({},n,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${u})(${JSON.stringify(r||Dn)}, ${JSON.stringify(l)})`}}))}fn.displayName="Form",mn.displayName="ScrollRestoration";var pn=function(e){return e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState",e}(pn||{}),yn=function(e){return e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration",e}(yn||{});function vn(t){let r=e.useContext(Ke);return r||s(!1),r}function gn(t){let r=e.useContext(Ye);return r||s(!1),r}function wn(t,{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s}={}){let l=it(),u=rt(),d=dt(t,{relative:i});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,r)){e.preventDefault();let r=void 0!==n?n:c(u)===c(d);l(t,{replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:s})}}),[u,l,d,n,a,r,t,o,i,s])}function bn(t){let r=e.useRef(ar(t)),n=e.useRef(!1),a=rt(),o=e.useMemo((()=>function(e,t){let r=ar(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(a.search,n.current?null:r.current)),[a.search]),i=it(),s=e.useCallback(((e,t)=>{const r=ar("function"==typeof e?e(o):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,s]}let En=0,Sn=()=>`__${String(++En)}__`;function xn(){let{router:t}=vn(pn.UseSubmit),{basename:r}=e.useContext(Xe),n=Rt();return e.useCallback((async(e,a={})=>{!function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:s,formData:l,body:u}=lr(e,r);if(!1===a.navigate){let e=a.fetcherKey||Sn();await t.fetch(e,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,unstable_flushSync:a.unstable_flushSync})}else await t.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||i,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[t,r,n])}function Rn(t,{relative:r}={}){let{basename:n}=e.useContext(Xe),a=e.useContext(Qe);a||s(!1);let[o]=a.matches.slice(-1),i={...dt(t||".",{relative:r})},l=rt();if(null==t){i.search=l.search;let e=new URLSearchParams(i.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),i.search=e.toString()?`?${e.toString()}`:"")}return t&&"."!==t||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:A([n,i.pathname])),c(i)}function _n({key:t}={}){let{router:r}=vn(pn.UseFetcher),n=gn(yn.UseFetcher),a=e.useContext(Qr),o=e.useContext(Qe),i=o.matches[o.matches.length-1]?.route.id;a||s(!1),o||s(!1),null==i&&s(!1);let l=tn?tn():"",[u,c]=e.useState(t||l);t&&t!==u?c(t):u||c(Sn()),e.useEffect((()=>(r.getFetcher(u),()=>{r.deleteFetcher(u)})),[r,u]);let d=e.useCallback((async(e,t)=>{i||s(!1),await r.fetch(u,i,e,t)}),[u,i,r]),h=xn(),f=e.useCallback((async(e,t)=>{await h(e,{...t,navigate:!1,fetcherKey:u})}),[u,h]),m=e.useMemo((()=>{let t=e.forwardRef(((t,r)=>e.createElement(fn,Object.assign({},t,{navigate:!1,fetcherKey:u,ref:r}))));return t.displayName="fetcher.Form",t}),[u]),p=n.fetchers.get(u)||Q,y=a.get(u);return e.useMemo((()=>({Form:m,submit:f,load:d,...p,data:y})),[m,f,d,p,y])}function Cn(){let e=gn(yn.UseFetchers);return Array.from(e.fetchers.entries()).map((([e,t])=>({...t,key:e})))}const Dn="react-router-scroll-positions";let Ln={};function kn(e,t,r,n){let a=null;return n&&(a=n("/"!==r?{...e,pathname:D(e.pathname,r)||e.pathname}:e,t)),null==a&&(a=e.key),a}function Pn({getKey:t,storageKey:r}={}){let{router:n}=vn(pn.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=gn(yn.UseScrollRestoration),{basename:i}=e.useContext(Xe),s=rt(),l=Dt(),u=_t();e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("pagehide",t,e),()=>{window.removeEventListener("pagehide",t,e)}}),[t,n])}(e.useCallback((()=>{if("idle"===u.state){let e=kn(s,l,i,t);Ln[e]=window.scrollY}try{sessionStorage.setItem(r||Dn,JSON.stringify(Ln))}catch(e){}window.history.scrollRestoration="auto"}),[u.state,t,i,s,l,r])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Dn);e&&(Ln=JSON.parse(e))}catch(ma){}}),[r]),e.useLayoutEffect((()=>{let e=n?.enableScrollRestoration(Ln,(()=>window.scrollY),t?(e,r)=>kn(e,r,i,t):void 0);return()=>e&&e()}),[n,i,t]),e.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==o&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,o]))}function Mn(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("beforeunload",t,e),()=>{window.removeEventListener("beforeunload",t,e)}}),[t,n])}function An({when:t,message:r}){let n=Ut(t);e.useEffect((()=>{if("blocked"===n.state){window.confirm(r)?setTimeout(n.proceed,0):n.reset()}}),[n,r]),e.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Tn(t,r={}){let n=e.useContext(Gr);null==n&&s(!1);let{basename:a}=vn(pn.useViewTransitionState),o=dt(t,{relative:r.relative});if(!n.isTransitioning)return!1;let i=D(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=D(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=_(o.pathname,l)||null!=_(o.pathname,i)}function jn({basename:t,children:r,location:a="/",future:o}){"string"==typeof a&&(a=d(a));let i=n.Pop,s={pathname:a.pathname||"/",search:a.search||"",hash:a.hash||"",state:a.state||null,key:a.key||"default"},l=Nn();return e.createElement(Kt,{basename:t,children:r,location:s,navigationType:i,navigator:l,future:o,static:!0})}function Un({context:t,router:r,hydrate:n=!0,nonce:a}){r&&t||s(!1);let o={router:r,navigator:Nn(),static:!0,staticContext:t,basename:t.basename||"/"},i=new Map,l="";if(!1!==n){let e={loaderData:t.loaderData,actionData:t.actionData,errors:Fn(t.errors)};l=`window.__staticRouterHydrationData = JSON.parse(${JSON.stringify(JSON.stringify(e)).replace(Wn,(e=>Jn[e]))});`}let{state:u}=o.router;return e.createElement(e.Fragment,null,e.createElement(Ke.Provider,{value:o},e.createElement(Ye.Provider,{value:u},e.createElement(Qr.Provider,{value:i},e.createElement(Gr.Provider,{value:{isTransitioning:!1}},e.createElement(Kt,{basename:o.basename,location:u.location,navigationType:u.historyAction,navigator:o.navigator,static:o.static,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},e.createElement(On,{routes:r.routes,future:r.future,state:u})))))),l?e.createElement("script",{suppressHydrationWarning:!0,nonce:a,dangerouslySetInnerHTML:{__html:l}}):null)}function On({routes:e,future:t,state:r}){return ft(e,void 0,r,t)}function Fn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)J(a)?r[n]={...a,__type:"RouteErrorResponse"}:a instanceof Error?r[n]={message:a.message,__type:"Error",..."Error"!==a.name?{__subType:a.name}:{}}:r[n]=a;return r}function Nn(){return{createHref:Bn,encodeLocation:In,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}}}function Hn(e,t){return ae(e,{...t,mapRouteProperties:Nt})}function $n(e,t,r={}){let a={},o=p(e,Nt,void 0,a),i=t.matches.map((e=>{let t=a[e.route.id]||e.route;return{...e,route:t}})),s=e=>`You cannot use router.${e}() on the server because it is a stateless environment`;return{get basename(){return t.basename},get future(){return{v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!0===r.future?.v7_partialHydration,v7_prependBasename:!1,v7_relativeSplatPath:!0===r.future?.v7_relativeSplatPath,unstable_skipActionErrorRevalidation:!1}},get state(){return{historyAction:n.Pop,location:t.location,matches:i,loaderData:t.loaderData,actionData:t.actionData,errors:t.errors,initialized:!0,navigation:G,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",fetchers:new Map,blockers:new Map}},get routes(){return o},get window(){},initialize(){throw s("initialize")},subscribe(){throw s("subscribe")},enableScrollRestoration(){throw s("enableScrollRestoration")},navigate(){throw s("navigate")},fetch(){throw s("fetch")},revalidate(){throw s("revalidate")},createHref:Bn,encodeLocation:In,getFetcher:()=>Q,deleteFetcher(){throw s("deleteFetcher")},dispose(){throw s("dispose")},getBlocker:()=>Z,deleteBlocker(){throw s("deleteBlocker")},_internalFetchControllers:new Map,_internalActiveDeferreds:new Map,_internalSetRoutes(){throw s("_internalSetRoutes")}}}function Bn(e){return"string"==typeof e?e:c(e)}function In(e){let t="string"==typeof e?e:c(e);t=t.replace(/ $/,"%20");let r=zn.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:r.pathname,search:r.search,hash:r.hash}}const zn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Wn=/[&><\u2028\u2029]/g;class qn extends e.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?e.createElement(Kn,{error:this.state.error}):this.props.children}}function Kn({error:t}){console.error(t);let r,n=e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."\n );\n '}});if(J(t))return e.createElement(Yn,{title:"Unhandled Thrown Response!"},e.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),n);if(t instanceof Error)r=t;else{let e=null==t?"Unknown Error":"object"==typeof t&&"toString"in t?t.toString():JSON.stringify(t);r=new Error(e)}return e.createElement(Yn,{title:"Application Error!"},e.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),e.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),n)}function Yn({title:t,renderScripts:r,children:n}){let{routeModules:a}=Ur();return a.root?.Layout?n:e.createElement("html",{lang:"en"},e.createElement("head",null,e.createElement("meta",{charSet:"utf-8"}),e.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),e.createElement("title",null,t)),e.createElement("body",null,e.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,r?e.createElement(Jr,null):null)))}function Vn(){return e.createElement(Yn,{title:"Loading...",renderScripts:!0},e.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this " +\n "when your app is running `clientLoader` functions on hydration. " +\n "Check out https://remix.run/route/hydrate-fallback for more information."\n );\n '}}))}function Xn(e){let t={};return Object.values(e).forEach((e=>{let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)})),t}function Gn(t,r,n){let a=aa(r),o=!r.HydrateFallback||n&&"root"!==t.id?"root"===t.id?Vn:void 0:r.HydrateFallback,i=r.ErrorBoundary?r.ErrorBoundary:"root"===t.id?()=>e.createElement(Kn,{error:Mt()}):void 0;return"root"===t.id&&r.Layout?{...a?{element:e.createElement(r.Layout,null,e.createElement(a,null))}:{Component:a},...i?{errorElement:e.createElement(r.Layout,null,e.createElement(i,null))}:{ErrorBoundary:i},...o?{hydrateFallbackElement:e.createElement(r.Layout,null,e.createElement(o,null))}:{HydrateFallback:o}}:{Component:a,ErrorBoundary:i,HydrateFallback:o}}function Qn(e,t,r,n,a="",o=Xn(e),i=Promise.resolve({Component:()=>null})){return(o[a]||[]).map((a=>{let s=t[a.id];s||ur(!1);let l={...Gn(a,s,n),caseSensitive:a.caseSensitive,id:a.id,index:a.index,path:a.path,handle:s.handle,lazy:n?()=>i:void 0,loader:!(!a.hasLoader&&!a.hasClientLoader)||void 0},u=Qn(e,t,r,n,a.id,o,i);return u.length>0&&(l.children=u),l}))}function Zn(e,t,r,n,a,o){return ra(t,r,n,a,o,"",Xn(t),e)}function ea(e,t,r){if(r){let r=`You cannot call ${"action"===e?"serverAction()":"serverLoader()"} in SPA Mode (routeId: "${t.id}")`;throw console.error(r),new z(400,"Bad Request",new Error(r),!0)}let n=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction)throw console.error(n),new z(400,"Bad Request",new Error(n),!0)}function ta(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new z(405,"Method Not Allowed",new Error(n),!0)}function ra(e,t,r,n,a,o="",i=Xn(e),s){return(i[o]||[]).map((o=>{let l=t[o.id];function u(e){return"function"!=typeof e&&ur(!1),e()}function c(e){return o.hasLoader?u(e):Promise.resolve(null)}function d(e){if(!o.hasAction)throw ta("action",o.id);return u(e)}async function h(e){let r=t[o.id],n=r?hr(o,r):Promise.resolve();try{return e()}finally{await n}}let f={id:o.id,index:o.index,path:o.path};if(l){Object.assign(f,{...f,...Gn(o,l,a),handle:l.handle,shouldRevalidate:s?na(o.id,l.shouldRevalidate,s):l.shouldRevalidate});let e=r?.loaderData?.[o.id],t=r?.errors?.[o.id],n=null==s&&(!0===l.clientLoader?.hydrate||!o.hasLoader);f.loader=async({request:r,params:i},s)=>{try{return await h((async()=>(l||ur(!1),l.clientLoader?l.clientLoader({request:r,params:i,async serverLoader(){if(ea("loader",o,a),n){if(void 0!==t)throw t;return e}return c(s)}}):a?null:c(s))))}finally{n=!1}},f.loader.hydrate=oa(o,l,a),f.action=({request:e,params:t},r)=>h((async()=>{if(l||ur(!1),!l.clientAction){if(a)throw ta("clientAction",o.id);return d(r)}return l.clientAction({request:e,params:t,serverAction:async()=>(ea("action",o,a),d(r))})}))}else o.hasClientLoader||(f.loader=({request:e},t)=>h((()=>a?Promise.resolve(null):c(t)))),o.hasClientAction||(f.action=({request:e},t)=>h((()=>{if(a)throw ta("clientAction",o.id);return d(t)}))),f.lazy=async()=>{let e=await async function(e,t){let r=await cr(e,t);return await hr(e,r),{Component:aa(r),ErrorBoundary:r.ErrorBoundary,clientAction:r.clientAction,clientLoader:r.clientLoader,handle:r.handle,links:r.links,meta:r.meta,shouldRevalidate:r.shouldRevalidate}}(o,t),r={...e};if(e.clientLoader){let t=e.clientLoader;r.loader=(e,r)=>t({...e,serverLoader:async()=>(ea("loader",o,a),c(r))})}if(e.clientAction){let t=e.clientAction;r.action=(e,r)=>t({...e,serverAction:async()=>(ea("action",o,a),d(r))})}return s&&(r.shouldRevalidate=na(o.id,e.shouldRevalidate,s)),{...r.loader?{loader:r.loader}:{},...r.action?{action:r.action}:{},hasErrorBoundary:r.hasErrorBoundary,shouldRevalidate:r.shouldRevalidate,handle:r.handle,Component:r.Component,ErrorBoundary:r.ErrorBoundary}};let m=ra(e,t,r,n,a,o.id,i,s);return m.length>0&&(f.children=m),f}))}function na(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}function aa(e){if(null==e.default)return;return"object"==typeof e.default&&0===Object.keys(e.default).length?void 0:e.default}function oa(e,t,r){return r&&"root"!==e.id||null!=t.clientLoader&&(!0===t.clientLoader.hydrate||!0!==e.hasLoader)}let ia=null,sa=null;let la=null;if(import.meta&&import.meta.hot&&window.__remixManifest){let e,t=new Promise((t=>{e=t})).catch((()=>{}));la={abortController:void 0,routerReadyResolve:e,routerReadyPromise:t},import.meta.hot.accept("remix:manifest",(async({assetsManifest:e,needsRevalidation:t})=>{let r=await la.routerReadyPromise;if(!r||!ia||!la)return void console.error("Failed to accept HMR update because the router/ssrInfo was not ready.");let n=[...new Set(r.state.matches.map((e=>e.route.id)).concat(Object.keys(ia.routeModules)))];la.abortController?.abort(),la.abortController=new AbortController;let a=la.abortController.signal,o=Object.assign({},ia.routeModules,Object.fromEntries((await Promise.all(n.map((async t=>{if(!e.routes[t])return null;let r=await import(e.routes[t].module+`?t=${e.hmr?.timestamp}`);return ia||ur(!1),[t,{...r,default:r.default&&ia.routeModules[t]?.default||r.default,ErrorBoundary:r.ErrorBoundary&&ia.routeModules[t]?.ErrorBoundary||r.ErrorBoundary,HydrateFallback:r.HydrateFallback&&ia.routeModules[t]?.HydrateFallback||r.HydrateFallback}]})))).filter(Boolean)));Object.assign(ia.routeModules,o);let i=Zn(t,e.routes,ia.routeModules,ia.context.state,ia.context.future,ia.context.isSpaMode);r._internalSetRoutes(i);let s=r.subscribe((t=>{if("idle"===t.revalidation){if(s(),a.aborted)return;setTimeout((()=>{Object.assign(ia.manifest,e),window.$RefreshRuntime$.performReactRefresh()}),1)}}));window.__remixRevalidation=(window.__remixRevalidation||0)+1,r.revalidate()}))}function ua(){if(!ia&&window.__remixContext&&window.__remixManifest&&window.__remixRouteModules&&(ia={context:window.__remixContext,manifest:window.__remixManifest,routeModules:window.__remixRouteModules,stateDecodingPromise:void 0,router:void 0,routerInitialized:!1}),!ia)throw new Error("You must be using the SSR features of React Router in order to skip passing a `router` prop to `<RouterProvider>`");let e=ia;if(!ia.stateDecodingPromise){let t=ia.context.stream,r=ia.context.streamAction;t||ur(!1),ia.context.stream=void 0,ia.context.future.unstable_serverComponents?ia.stateDecodingPromise=Promise.all([window.createFromReadableStream(t),r?window.createFromReadableStream(r):void 0]).then((([t,r])=>{let n={};for(let e of Object.keys(ia.routeModules))"error"in t[e]?(n.errors=n.errors||{},n.errors[e]=t[e].error):"data"in t[e]&&(n.loaderData=n.loaderData||{},n.loaderData[e]=t[e].data);if(r){const e=window.__remixContext.serverHandoffActionId;"error"in r?(n.errors=n.errors||{},n.errors[e]=r.error):"data"in r&&(n.actionData=n.actionData||{},n.actionData[e]=r.data)}ia.context.state=n,e.stateDecodingPromise.value=!0})).catch((t=>{e.stateDecodingPromise.error=t})):ia.stateDecodingPromise=kr(t,window).then((t=>{ia.context.state=t.value,e.stateDecodingPromise.value=!0})).catch((t=>{e.stateDecodingPromise.error=t}))}if(ia.stateDecodingPromise.error)throw ia.stateDecodingPromise.error;if(!ia.stateDecodingPromise.value)throw ia.stateDecodingPromise;let t,r=ra(ia.manifest.routes,ia.routeModules,ia.context.state,ia.context.future,ia.context.isSpaMode);if(!ia.context.isSpaMode){t={...ia.context.state,loaderData:{...ia.context.state.loaderData}};let e=y(r,window.location);if(e)for(let r of e){let e=r.route.id,n=ia.routeModules[e],a=ia.manifest.routes[e];n&&oa(a,n,ia.context.isSpaMode)&&(n.HydrateFallback||!a.hasLoader)?t.loaderData[e]=void 0:a&&!a.hasLoader&&(t.loaderData[e]=null)}t&&t.errors&&(t.errors=function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[n]=new z(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack=a.stack,r[n]=t}catch(ma){}}if(null==r[n]){let e=new Error(a.message);e.stack=a.stack,r[n]=e}}else r[n]=a;return r}(t.errors))}let n=re({routes:r,history:o(),basename:ia.context.basename,future:{v7_normalizeFormMethod:!0,v7_fetcherPersist:ia.context.future.v3_fetcherPersist,v7_partialHydration:!0,v7_prependBasename:!0,v7_relativeSplatPath:ia.context.future.v3_relativeSplatPath,unstable_skipActionErrorRevalidation:!0},hydrationData:t,mapRouteProperties:Nt,unstable_dataStrategy:_r(ia.manifest,ia.routeModules)});return ia.router=n,n.state.initialized&&(ia.routerInitialized=!0,n.initialize()),n.createRoutesForHMR=Zn,window.__remixRouter=n,la?.routerReadyResolve(n),n}function ca(){sa||(sa=ua());let[t,r]=e.useState(void 0),[n,a]=e.useState(sa.state.location);return e.useLayoutEffect((()=>{ia&&ia.router&&!ia.routerInitialized&&(ia.routerInitialized=!0,ia.router.initialize())}),[]),e.useLayoutEffect((()=>{if(ia&&ia.router)return ia.router.subscribe((e=>{e.location!==n&&a(e.location)}))}),[n]),ia||ur(!1),e.createElement(e.Fragment,null,e.createElement(jr.Provider,{value:{manifest:ia.manifest,routeModules:ia.routeModules,future:ia.context.future,criticalCss:t,isSpaMode:ia.context.isSpaMode}},e.createElement(qn,{location:n},e.createElement(an,{router:sa,fallbackElement:null,future:{v7_startTransition:!0}}))),e.createElement(e.Fragment,null))}function da({context:t,url:r,abortDelay:n}){"string"==typeof r&&(r=new URL(r));let{manifest:a,routeModules:o,criticalCss:i,serverHandoffString:s}=t,l=Qn(a.routes,o,t.future,t.isSpaMode);t.staticHandlerContext.loaderData={...t.staticHandlerContext.loaderData};for(let e of t.staticHandlerContext.matches){let r=e.route.id,n=o[r],a=t.manifest.routes[r];n&&oa(a,n,t.isSpaMode)&&(n.HydrateFallback||!a.hasLoader)&&(t.staticHandlerContext.loaderData[r]=void 0)}let u=$n(l,t.staticHandlerContext,{future:{v7_partialHydration:!0,v7_relativeSplatPath:t.future.v3_relativeSplatPath}});return e.createElement(e.Fragment,null,e.createElement(jr.Provider,{value:{manifest:a,routeModules:o,criticalCss:i,serverHandoffString:s,future:t.future,isSpaMode:t.isSpaMode,serializeError:t.serializeError,abortDelay:n,renderMeta:t.renderMeta}},e.createElement(qn,{location:u.state.location},e.createElement(Un,{router:u,context:t.staticHandlerContext,hydrate:!1}))),t.serverHandoffStreamAction?e.createElement(e.Suspense,null,e.createElement(Rr,{context:t,identifier:0,reader:t.serverHandoffStreamAction.getReader(),textDecoder:new TextDecoder,isAction:!0})):null,t.serverHandoffStream?e.createElement(e.Suspense,null,e.createElement(Rr,{context:t,identifier:0,reader:t.serverHandoffStream.getReader(),textDecoder:new TextDecoder,isAction:!1})):null)}function ha(t,r={}){return function({initialEntries:n,initialIndex:a,hydrationData:o,future:i}){let s=e.useRef(),l=e.useRef();if(null==s.current){l.current={future:{v3_fetcherPersist:!0===i?.v3_fetcherPersist,v3_relativeSplatPath:!0===i?.v3_relativeSplatPath,unstable_serverComponents:!0===i?.unstable_serverComponents},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},isSpaMode:!1};let e=fa(p(t,(e=>e)),r,l.current.manifest,l.current.routeModules);s.current=Ht(e,{initialEntries:n,initialIndex:a,hydrationData:o})}return e.createElement(jr.Provider,{value:l.current},e.createElement(an,{router:s.current}))}}function fa(e,t,r,n,a){return e.map((e=>{if(!e.id)throw new Error("Expected a route.id in @remix-run/testing processRoutes() function");let{loader:o,action:i}=e,s={id:e.id,path:e.path,index:e.index,Component:e.Component,ErrorBoundary:e.ErrorBoundary,action:i?e=>i({...e,context:t}):void 0,loader:o?e=>o({...e,context:t}):void 0,handle:e.handle,shouldRevalidate:e.shouldRevalidate},l={id:e.id,path:e.path,index:e.index,parentId:a,hasAction:null!=e.action,hasLoader:null!=e.loader,hasClientAction:!1,hasClientLoader:!1,hasErrorBoundary:null!=e.ErrorBoundary,module:"build/stub-path-to-module.js"};return r.routes[s.id]=l,n[e.id]={default:e.Component||Wt,ErrorBoundary:e.ErrorBoundary||void 0,handle:e.handle,links:e.links,meta:e.meta,shouldRevalidate:e.shouldRevalidate},e.children&&(s.children=fa(e.children,t,r,n,s.id)),s}))}export{F as AbortedDeferredError,Vt as Await,sn as BrowserRouter,fn as Form,ln as HashRouter,ca as HydratedRouter,dn as Link,Nr as Links,zt as MemoryRouter,Ir as Meta,hn as NavLink,Jt as Navigate,n as NavigationType,Wt as Outlet,Hr as PrefetchPageLinks,da as RemixServer,qt as Route,Kt as Router,Bt as RouterProvider,Yt as Routes,Jr as Scripts,mn as ScrollRestoration,jn as StaticRouter,Un as StaticRouterProvider,ne as UNSAFE_DEFERRED_SYMBOL,Ke as UNSAFE_DataRouterContext,Ye as UNSAFE_DataRouterStateContext,z as UNSAFE_ErrorResponseImpl,Qr as UNSAFE_FetchersContext,Ge as UNSAFE_LocationContext,Xe as UNSAFE_NavigationContext,jr as UNSAFE_RemixContext,Qe as UNSAFE_RouteContext,xr as UNSAFE_SingleFetchRedirectSymbol,Gr as UNSAFE_ViewTransitionContext,p as UNSAFE_convertRoutesToDataRoutes,kr as UNSAFE_decodeViaTurboStream,Nt as UNSAFE_mapRouteProperties,Rt as UNSAFE_useRouteId,ft as UNSAFE_useRoutesImpl,Pn as UNSAFE_useScrollRestoration,Kr as createBrowserRouter,Yr as createHashRouter,Ht as createMemoryRouter,c as createPath,ha as createRemixStub,er as createRoutesFromChildren,er as createRoutesFromElements,ar as createSearchParams,Hn as createStaticHandler,$n as createStaticRouter,$ as defer,R as generatePath,oe as getStaticContextFromError,J as isRouteErrorResponse,O as json,_ as matchPath,y as matchRoutes,d as parsePath,B as redirect,I as redirectDocument,tr as renderMatches,L as resolvePath,D as stripBasename,un as unstable_HistoryRouter,An as unstable_usePrompt,Tn as unstable_useViewTransitionState,Pt as useActionData,Tt as useAsyncError,At as useAsyncValue,Mn as useBeforeUnload,Ut as useBlocker,_n as useFetcher,Cn as useFetchers,Rn as useFormAction,et as useHref,tt as useInRouterContext,wn as useLinkClickHandler,Lt as useLoaderData,rt as useLocation,at as useMatch,Dt as useMatches,it as useNavigate,_t as useNavigation,nt as useNavigationType,ut as useOutlet,lt as useOutletContext,ct as useParams,dt as useResolvedPath,Ct as useRevalidator,Mt as useRouteError,kt as useRouteLoaderData,ht as useRoutes,bn as useSearchParams,xn as useSubmit};
11
+ import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as n,UNSAFE_getResolveToMatches as a,resolveTo as o,parsePath as l,matchRoutes as i,Action as u,UNSAFE_convertRouteMatchToUiMatch as s,stripBasename as c,IDLE_BLOCKER as d,isRouteErrorResponse as p,createMemoryHistory as m,AbortedDeferredError as h,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,resolvePath}from"@remix-run/router";const v=e.createContext(null),E=e.createContext(null),g=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext({outlet:null,matches:[],isDataRoute:!1}),b=e.createContext(null);function R(n,{relative:a}={}){S()||t(!1);let{basename:o,navigator:l}=e.useContext(y),{hash:i,pathname:u,search:s}=O(n,{relative:a}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),l.createHref({pathname:c,search:s,hash:i})}function S(){return null!=e.useContext(x)}function P(){return S()||t(!1),e.useContext(x).location}function U(){return e.useContext(x).navigationType}function _(r){S()||t(!1);let{pathname:a}=P();return e.useMemo((()=>n(r,a)),[a,r])}function k(t){e.useContext(y).static||e.useLayoutEffect(t)}function D(){let{isDataRoute:n}=e.useContext(C);return n?function(){let{router:t}=$(J.UseNavigateStable),r=W(z.UseNavigateStable),n=e.useRef(!1);return k((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){S()||t(!1);let n=e.useContext(v),{basename:l,future:i,navigator:u}=e.useContext(y),{matches:s}=e.useContext(C),{pathname:c}=P(),d=JSON.stringify(a(s,i.v7_relativeSplatPath)),p=e.useRef(!1);return k((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let a=o(e,JSON.parse(d),c,"path"===t.relative);null==n&&"/"!==l&&(a.pathname="/"===a.pathname?l:r([l,a.pathname])),(t.replace?u.replace:u.push)(a,t.state,t)}),[l,u,d,c,n])}()}const B=e.createContext(null);function N(){return e.useContext(B)}function F(t){let r=e.useContext(C).outlet;return r?e.createElement(B.Provider,{value:t},r):r}function L(){let{matches:t}=e.useContext(C),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:n}=e.useContext(y),{matches:l}=e.useContext(C),{pathname:i}=P(),u=JSON.stringify(a(l,n.v7_relativeSplatPath));return e.useMemo((()=>o(t,JSON.parse(u),i,"path"===r)),[t,u,i,r])}function A(e,t){return j(e,t)}function j(n,a,o,s){S()||t(!1);let{navigator:c}=e.useContext(y),{matches:d}=e.useContext(C),p=d[d.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let f,v=P();if(a){let e="string"==typeof a?l(a):a;"/"===h||e.pathname?.startsWith(h)||t(!1),f=e}else f=v;let E=f.pathname||"/",g=E;if("/"!==h){let e=h.replace(/^\//,"").split("/");g="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=i(n,{pathname:g}),R=w(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r([h,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r([h,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,s);return a&&R?e.createElement(x.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:u.Pop}},R):R}function I(){let t=ee(),r=p(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const M=e.createElement(I,null);class T extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(C.Provider,{value:this.props.routeContext},e.createElement(b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H({routeContext:t,match:r,children:n}){let a=e.useContext(v);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(C.Provider,{value:t},n)}function w(r,n=[],a=null,o=null){if(null==r){if(!a?.errors)return null;r=a.matches}let l=r,i=a?.errors;if(null!=i){let e=l.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));e>=0||t(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,s=-1;if(a&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=a,n=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||n){u=!0,l=s>=0?l.slice(0,s+1):[l[0]];break}}}return l.reduceRight(((t,r,o)=>{let c,d=!1,p=null,m=null;var h;a&&(c=i&&r.route.id?i[r.route.id]:void 0,p=r.route.errorElement||M,u&&(s<0&&0===o?(h="route-fallback",!1||oe[h]||(oe[h]=!0),d=!0,m=null):s===o&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(l.slice(0,o+1)),v=()=>{let n;return n=c?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(H,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(T,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),z=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(z||{});function $(r){let n=e.useContext(v);return n||t(!1),n}function V(r){let n=e.useContext(E);return n||t(!1),n}function W(r){let n=function(r){let n=e.useContext(C);return n||t(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||t(!1),a.route.id}function Y(){return W(z.UseRouteId)}function q(){return V(z.UseNavigation).navigation}function G(){let t=$(J.UseRevalidator),r=V(z.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function K(){let{matches:t,loaderData:r}=V(z.UseMatches);return e.useMemo((()=>t.map((e=>s(e,r)))),[t,r])}function Q(){let e=V(z.UseLoaderData),t=W(z.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function X(e){return V(z.UseRouteLoaderData).loaderData[e]}function Z(){let e=V(z.UseActionData),t=W(z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ee(){let t=e.useContext(b),r=V(z.UseRouteError),n=W(z.UseRouteError);return void 0!==t?t:r.errors?.[n]}function te(){return e.useContext(g)?._data}function re(){return e.useContext(g)?._error}let ne=0;function ae(t){let{router:r,basename:n}=$(J.UseBlocker),a=V(z.UseBlocker),[o,l]=e.useState(""),i=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:c(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:c(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++ne);return l(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,i)}),[r,o,i]),o&&a.blockers.has(o)?a.blockers.get(o):d}const oe={};const le=e.startTransition;function ie({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:l}=n||{},i=e.useCallback((e=>{l&&le?le((()=>o(e))):o(e)}),[o,l]);e.useLayoutEffect((()=>r.subscribe(i)),[r,i]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s})),[r,u,s]);return e.createElement(e.Fragment,null,e.createElement(v.Provider,{value:c},e.createElement(E.Provider,{value:a},e.createElement(me,{basename:s,location:a.location,navigationType:a.historyAction,navigator:u,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(ue,{routes:r.routes,future:r.future,state:a}):t))),null)}function ue({routes:e,future:t,state:r}){return j(e,void 0,r,t)}function se({basename:t,children:r,initialEntries:n,initialIndex:a,future:o}){let l=e.useRef();null==l.current&&(l.current=m({initialEntries:n,initialIndex:a,v5Compat:!0}));let i=l.current,[u,s]=e.useState({action:i.action,location:i.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&le?le((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>i.listen(d)),[i,d]),e.createElement(me,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:i,future:o})}function ce({to:r,replace:n,state:l,relative:i}){S()||t(!1);let{future:u,static:s}=e.useContext(y),{matches:c}=e.useContext(C),{pathname:d}=P(),p=D(),m=o(r,a(c,u.v7_relativeSplatPath),d,"path"===i),h=JSON.stringify(m);return e.useEffect((()=>p(JSON.parse(h),{replace:n,state:l,relative:i})),[p,h,i,n,l]),null}function de(e){return F(e.context)}function pe(e){t(!1)}function me({basename:r="/",children:n=null,location:a,navigationType:o=u.Pop,navigator:i,static:s=!1,future:d}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:p,navigator:i,static:s,future:{v7_relativeSplatPath:!1,...d}})),[p,d,i,s]);"string"==typeof a&&(a=l(a));let{pathname:h="/",search:f="",hash:v="",state:E=null,key:g="default"}=a,C=e.useMemo((()=>{let e=c(h,p);return null==e?null:{location:{pathname:e,search:f,hash:v,state:E,key:g},navigationType:o}}),[p,h,f,v,E,g,o]);return null==C?null:e.createElement(y.Provider,{value:m},e.createElement(x.Provider,{children:n,value:C}))}function he({children:e,location:t}){return A(xe(e),t)}function fe({children:t,errorElement:r,resolve:n}){return e.createElement(ge,{resolve:n,errorElement:r},e.createElement(ye,null,t))}var ve=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ve||{});const Ee=new Promise((()=>{}));class ge extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=ve.pending;if(n instanceof Promise)if(this.state.error){o=ve.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o="_error"in a?ve.error:"_data"in a?ve.success:ve.pending):(o=ve.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=ve.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===ve.error&&a._error instanceof h)throw Ee;if(o===ve.error&&!r)throw a._error;if(o===ve.error)return e.createElement(g.Provider,{value:a,children:r});if(o===ve.success)return e.createElement(g.Provider,{value:a,children:t});throw a}}function ye({children:t}){let r=te(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function xe(r,n=[]){let a=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let l=[...n,o];if(r.type===e.Fragment)return void a.push.apply(a,xe(r.props.children,l));r.type!==pe&&t(!1),r.props.index&&r.props.children&&t(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=xe(r.props.children,l)),a.push(i)})),a}function Ce(e){return w(e)}function be(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Re(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:be,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}export{fe as Await,se as MemoryRouter,ce as Navigate,de as Outlet,pe as Route,me as Router,ie as RouterProvider,he as Routes,v as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,x as UNSAFE_LocationContext,y as UNSAFE_NavigationContext,C as UNSAFE_RouteContext,be as UNSAFE_mapRouteProperties,Y as UNSAFE_useRouteId,j as UNSAFE_useRoutesImpl,Re as createMemoryRouter,xe as createRoutesFromChildren,xe as createRoutesFromElements,Ce as renderMatches,Z as useActionData,re as useAsyncError,te as useAsyncValue,ae as useBlocker,R as useHref,S as useInRouterContext,Q as useLoaderData,P as useLocation,_ as useMatch,K as useMatches,D as useNavigate,q as useNavigation,U as useNavigationType,F as useOutlet,N as useOutletContext,L as useParams,O as useResolvedPath,G as useRevalidator,ee as useRouteError,X as useRouteLoaderData,A as useRoutes};
12
12
  //# sourceMappingURL=react-router.production.min.js.map