@hitachivantara/app-shell-vite-plugin 0.14.0 → 0.15.0

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.
@@ -1,7 +1,7 @@
1
- /* @preserve react-router-dom@6.14.2 esm bundle generated by Hitachi Vantara - Boba Fett team */
1
+ /* @preserve react-router-dom@6.15.0 esm bundle generated by Hitachi Vantara - Boba Fett team */
2
2
  import*as e from"react";
3
3
  /**
4
- * @remix-run/router v1.7.2
4
+ * @remix-run/router v1.8.0
5
5
  *
6
6
  * Copyright (c) Remix Software Inc.
7
7
  *
@@ -9,9 +9,9 @@ import*as e from"react";
9
9
  * LICENSE.md file in the root directory of this source tree.
10
10
  *
11
11
  * @license MIT
12
- */function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}var r;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(r||(r={}));const n="popstate";function o(e){void 0===e&&(e={});let t,{initialEntries:n=["/"],initialIndex:o,v5Compat:a=!1}=e;t=n.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=f(null==o?t.length-1:o),l=r.Pop,c=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function p(){return t[i]}function m(e,r,n){void 0===r&&(r=null);let o=u(t?p().pathname:"/",e,r,n);return s("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function v(e){return"string"==typeof e?e:d(e)}return{get index(){return i},get action(){return l},get location(){return p()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?h(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){l=r.Push;let o=m(e,n);i+=1,t.splice(i,t.length,o),a&&c&&c({action:l,location:o,delta:1})},replace(e,n){l=r.Replace;let o=m(e,n);t[i]=o,a&&c&&c({action:l,location:o,delta:0})},go(e){l=r.Pop;let n=f(i+e),o=t[n];i=n,c&&c({action:l,location:o,delta:e})},listen:e=>(c=e,()=>{c=null})}}function a(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return u("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:d(t)}),null,e)}function i(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=h(e.location.hash.substr(1));return u("",{pathname:r,search:n,hash:o},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:d(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function l(e,t){if(!1===e||null==e)throw new Error(t)}function s(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,r,n,o){return void 0===n&&(n=null),t({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof r?h(r):r,{state:n,key:r&&r.key||o||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function h(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 f(e,o,a,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:h=!1}=i,f=s.history,p=r.Pop,m=null,v=y();function y(){return(f.state||{idx:null}).idx}function g(){p=r.Pop;let e=y(),t=null==e?null:e-v;v=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(t({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(n,g),m=e,()=>{s.removeEventListener(n,g),m=null}},createHref:e=>o(s,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let n=u(w.location,e,t);a&&a(n,e),v=y()+1;let o=c(n,v),i=w.createHref(n);try{f.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(i)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=r.Replace;let n=u(w.location,e,t);a&&a(n,e),v=y();let o=c(n,v),i=w.createHref(n);f.replaceState(o,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function v(e,r,n,o){return void 0===n&&(n=[]),void 0===o&&(o={}),e.map(((e,a)=>{let i=[...n,a],s="string"==typeof e.id?e.id:i.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!o[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=t({},e,r(e),{id:s});return o[s]=n,n}{let n=t({},e,r(e),{id:s,children:void 0});return o[s]=n,e.children&&(n.children=v(e.children,r,i,o)),n}}))}function y(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let o=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e)a=P(o[e],U(n));return a}function g(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=B([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),g(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:k(s,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of b(e.path))o(e,t,r);else o(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=b(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const w=/^:\w+$/,E=3,R=2,x=1,S=10,D=-2,C=e=>"*"===e;function k(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=D),t&&(n+=R),r.filter((e=>!C(e))).reduce(((e,t)=>e+(w.test(t)?E:""===t?x:S)),n)}function P(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(n,c.params);let u=i.route;a.push({params:n,pathname:B([o,c.pathname]),pathnameBase:F(B([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=B([o,c.pathnameBase]))}return a}function L(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(s(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return o(t["*"])}const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return l("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);s("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=l[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return s(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function U(e){try{return decodeURI(e)}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function M(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 j(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"==typeof e?h(e):e,a=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:a,search:N(n),hash:I(o)}}function T(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function _(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function O(e,r,n,o){let a;void 0===o&&(o=!1),"string"==typeof e?a=h(e):(a=t({},e),l(!a.pathname||!a.pathname.includes("?"),T("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),T("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),T("#","search","hash",a)));let i,s=""===e||""===a.pathname,c=s?"/":a.pathname;if(o||null==c)i=n;else{let e=r.length-1;if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?r[e]:"/"}let u=j(a,i),d=c&&"/"!==c&&c.endsWith("/"),f=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",z=function(e,r){void 0===r&&(r={});let n="number"==typeof r?{status:r}:r,o=new Headers(n.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),t({},n,{headers:o}))};class W extends Error{}class ${constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],l(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new W("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)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),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 W)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 l(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:K(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function K(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const H=function(e,t){return void 0===t&&(t={}),new $(e,"number"==typeof t?{status:t}:t)},q=function(e,r){void 0===r&&(r=302);let n=r;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let o=new Headers(n.headers);return o.set("Location",e),new Response(null,t({},n,{headers:o}))};class J{constructor(e,t,r,n){void 0===n&&(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 Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const V=["post","put","patch","delete"],X=new Set(V),G=["get",...V],Q=new Set(G),Z=new Set([301,302,303,307,308]),ee=new Set([307,308]),te={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},oe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ae=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function ie(e){const n=e.window?e.window:"undefined"!=typeof window?window:void 0,o=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,a=!o;let i;if(l(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ae;let c,d={},h=v(e.routes,i,void 0,d),f=e.basename||"/",m=t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),g=null,b=new Set,w=null,E=null,R=null,x=null!=e.hydrationData,S=y(h,e.history.location,f),D=null;if(null==S){let t=Ee(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=we(h);S=r,D={[n.id]:t}}let C,k,P=!(S.some((e=>e.route.lazy))||S.some((e=>e.route.loader))&&null==e.hydrationData),L={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:te,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||D,fetchers:new Map,blockers:new Map},A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[],B=new Map,F=0,N=-1,I=new Map,z=new Set,W=new Map,$=new Map,K=new Map,H=!1;function q(e){L=t({},L,e),b.forEach((e=>e(L)))}function J(n,o){var a,i;let l,s=null!=L.actionData&&null!=L.navigation.formMethod&&ke(L.navigation.formMethod)&&"loading"===L.navigation.state&&!0!==(null==(a=n.state)?void 0:a._isRedirect);l=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:s?L.actionData:null;let u=o.loaderData?ge(L.loaderData,o.loaderData,o.matches||[],o.errors):L.loaderData,d=L.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,ne))));let f=!0===U||null!=L.navigation.formMethod&&ke(L.navigation.formMethod)&&!0!==(null==(i=n.state)?void 0:i._isRedirect);c&&(h=c,c=void 0),j||A===r.Pop||(A===r.Push?e.history.push(n,n.state):A===r.Replace&&e.history.replace(n,n.state)),q(t({},o,{actionData:l,loaderData:u,historyAction:A,location:n,initialized:!0,navigation:te,revalidation:"idle",restoreScrollPosition:Fe(n,o.matches||L.matches),preventScrollReset:f,blockers:d})),A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[]}async function Y(n,o,a){k&&k.abort(),k=null,A=n,j=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(w&&R){let r=Be(e,t);w[r]=R()}}(L.location,L.matches),U=!0===(a&&a.preventScrollReset);let l=c||h,s=a&&a.overrideNavigation,u=y(l,o,f);if(!u){let e=Ee(404,{pathname:o.pathname}),{matches:t,route:r}=we(l);return Oe(),void J(o,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(L.initialized&&!T&&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}(L.location,o)&&!(a&&a.submission&&ke(a.submission.formMethod)))return void J(o,{matches:u});k=new AbortController;let m,v,g=pe(e.history,o,k.signal,a&&a.submission);if(a&&a.pendingError)v={[be(u).route.id]:a.pendingError};else if(a&&a.submission&&ke(a.submission.formMethod)){let e=await async function(e,t,n,o,a){void 0===a&&(a={});Q();let l,s=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,n);q({navigation:s});let c=Ue(o,t);if(c.route.action||c.route.lazy){if(l=await fe("action",e,c,o,d,i,f),e.signal.aborted)return{shortCircuited:!0}}else l={type:p.error,error:Ee(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Ce(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===L.location.pathname+L.location.search,await X(L,l,{submission:n,replace:e}),{shortCircuited:!0}}if(De(l)){let e=be(o,c.route.id);return!0!==(a&&a.replace)&&(A=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Se(l))throw Ee(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(g,o,a.submission,u,{replace:a.replace});if(e.shortCircuited)return;m=e.pendingActionData,v=e.pendingActionError,s=je(o,a.submission),g=new Request(g.url,{signal:g.signal})}let{shortCircuited:b,loaderData:E,errors:x}=await async function(r,n,o,a,i,l,s,u,d){let p=a||je(n,i),m=i||l||Me(p),v=c||h,[y,g]=ce(e.history,L,o,m,n,T,_,O,W,z,v,f,u,d);if(Oe((e=>!(o&&o.some((t=>t.route.id===e)))||y&&y.some((t=>t.route.id===e)))),N=++F,0===y.length&&0===g.length){let e=he();return J(n,t({matches:o,loaderData:{},errors:d||null},u?{actionData:u}:{},e?{fetchers:new Map(L.fetchers)}:{})),{shortCircuited:!0}}if(!j){g.forEach((e=>{let t=L.fetchers.get(e.key),r=Te(void 0,t?t.data:void 0);L.fetchers.set(e.key,r)}));let e=u||L.actionData;q(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},g.length>0?{fetchers:new Map(L.fetchers)}:{}))}g.forEach((e=>{B.has(e.key)&&ue(e.key),e.controller&&B.set(e.key,e.controller)}));let b=()=>g.forEach((e=>ue(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await G(L.matches,o,y,g,r);if(r.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b);g.forEach((e=>B.delete(e.key)));let x=Re(w);if(x){if(x.idx>=y.length){let e=g[x.idx-y.length].key;z.add(e)}return await X(L,x.result,{replace:s}),{shortCircuited:!0}}let{loaderData:S,errors:D}=ye(L,o,y,E,d,g,R,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))}));let C=he(),P=me(N),A=C||P||g.length>0;return t({loaderData:S,errors:D},A?{fetchers:new Map(L.fetchers)}:{})}(g,o,u,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,m,v);b||(k=null,J(o,t({matches:u},m?{actionData:m}:{},{loaderData:E,errors:x})))}function V(e){return L.fetchers.get(e)||re}async function X(a,i,s){let{submission:c,replace:d,isFetchActionRedirect:h}=void 0===s?{}:s;i.revalidate&&(T=!0);let p=u(a.location,i.location,t({_isRedirect:!0},h?{_isFetchActionRedirect:!0}:{}));if(l(p,"Expected a location on the redirect navigation"),oe.test(i.location)&&o){let t=e.history.createURL(i.location),r=null==M(t.pathname,f);if(n.location.origin!==t.origin||r)return void(d?n.location.replace(i.location):n.location.assign(i.location))}k=null;let m=!0===d?r.Replace:r.Push,v=c||Me(a.navigation);if(ee.has(i.status)&&v&&ke(v.formMethod))await Y(m,p,{submission:t({},v,{formAction:i.location}),preventScrollReset:U});else if(h)await Y(m,p,{overrideNavigation:je(p),fetcherSubmission:v,preventScrollReset:U});else{let e=je(p,v);await Y(m,p,{overrideNavigation:e,preventScrollReset:U})}}async function G(t,r,n,o,a){let l=await Promise.all([...n.map((e=>fe("loader",a,e,r,d,i,f))),...o.map((t=>{if(t.matches&&t.match&&t.controller)return fe("loader",pe(e.history,t.path,t.controller.signal),t.match,t.matches,d,i,f);return{type:p.error,error:Ee(404,{pathname:t.path})}}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Pe(t,n,s,s.map((()=>a.signal)),!1,L.loaderData),Pe(t,o.map((e=>e.match)),c,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function Q(){T=!0,_.push(...Oe()),W.forEach(((e,t)=>{B.has(t)&&(O.push(t),ue(t))}))}function Z(e,t,r){let n=be(L.matches,t);ie(e),q({errors:{[n.route.id]:r},fetchers:new Map(L.fetchers)})}function ie(e){let t=L.fetchers.get(e);!B.has(e)||t&&"loading"===t.state&&I.has(e)||ue(e),W.delete(e),I.delete(e),z.delete(e),L.fetchers.delete(e)}function ue(e){let t=B.get(e);l(t,"Expected fetch controller: "+e),t.abort(),B.delete(e)}function de(e){for(let t of e){let e=_e(V(t).data);L.fetchers.set(t,e)}}function he(){let e=[],t=!1;for(let r of z){let n=L.fetchers.get(r);l(n,"Expected fetcher: "+r),"loading"===n.state&&(z.delete(r),e.push(r),t=!0)}return de(e),t}function me(e){let t=[];for(let[r,n]of I)if(n<e){let e=L.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(ue(r),I.delete(r),t.push(r))}return de(t),t.length>0}function ve(e){L.blockers.delete(e),K.delete(e)}function xe(e,t){let r=L.blockers.get(e)||ne;l("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,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(L.blockers);n.set(e,t),q({blockers:n})}function Ae(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===K.size)return;K.size>1&&s(!1,"A router only supports one blocker at a time");let o=Array.from(K.entries()),[a,i]=o[o.length-1],l=L.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function Oe(e){let t=[];return $.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),$.delete(n))})),t}function Be(e,t){if(E){return E(e,t.map((e=>function(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,L.loaderData))))||e.key}return e.key}function Fe(e,t){if(w){let r=Be(e,t),n=w[r];if("number"==typeof n)return n}return null}return C={get basename(){return f},get state(){return L},get routes(){return h},initialize:function(){return g=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(H)return void(H=!1);s(0===K.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=Ae({currentLocation:L.location,nextLocation:n,historyAction:r});return a&&null!=o?(H=!0,e.history.go(-1*o),void xe(a,{state:"blocked",location:n,proceed(){xe(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(L.blockers);e.set(a,ne),q({blockers:e})}})):Y(r,n)})),L.initialized||Y(r.Pop,L.location),C},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(w=e,R=t,E=r||null,!x&&L.navigation===te){x=!0;let e=Fe(L.location,L.matches);null!=e&&q({restoreScrollPosition:e})}return()=>{w=null,R=null,E=null}},navigate:async function n(o,a){if("number"==typeof o)return void e.history.go(o);let i=le(L.location,L.matches,f,m.v7_prependBasename,o,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:c}=se(m.v7_normalizeFormMethod,!1,i,a),d=L.location,h=u(L.location,l,a&&a.state);h=t({},h,e.history.encodeLocation(h));let p=a&&null!=a.replace?a.replace:void 0,v=r.Push;!0===p?v=r.Replace:!1===p||null!=s&&ke(s.formMethod)&&s.formAction===L.location.pathname+L.location.search&&(v=r.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=Ae({currentLocation:d,nextLocation:h,historyAction:v});if(!g)return await Y(v,h,{submission:s,pendingError:c,preventScrollReset:y,replace:a&&a.replace});xe(g,{state:"blocked",location:h,proceed(){xe(g,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),n(o,a)},reset(){let e=new Map(L.blockers);e.set(g,ne),q({blockers:e})}})},fetch:function(r,n,o,s){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.");B.has(r)&&ue(r);let u=c||h,p=le(L.location,L.matches,f,m.v7_prependBasename,o,n,null==s?void 0:s.relative),v=y(u,p,f);if(!v)return void Z(r,n,Ee(404,{pathname:p}));let{path:g,submission:b,error:w}=se(m.v7_normalizeFormMethod,!0,p,s);if(w)return void Z(r,n,w);let E=Ue(v,g);U=!0===(s&&s.preventScrollReset),b&&ke(b.formMethod)?async function(r,n,o,a,s,u){if(Q(),W.delete(r),!a.route.action&&!a.route.lazy){let e=Ee(405,{method:u.formMethod,pathname:o,routeId:n});return void Z(r,n,e)}let p=L.fetchers.get(r),m=function(e,t){let r={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," _hasFetcherDoneAnything ":!0};return r}(u,p);L.fetchers.set(r,m),q({fetchers:new Map(L.fetchers)});let v=new AbortController,g=pe(e.history,o,v.signal,u);B.set(r,v);let b=F,w=await fe("action",g,a,s,d,i,f);if(g.signal.aborted)return void(B.get(r)===v&&B.delete(r));if(Ce(w)){if(B.delete(r),N>b){let e=_e(void 0);return L.fetchers.set(r,e),void q({fetchers:new Map(L.fetchers)})}{z.add(r);let e=Te(u);return L.fetchers.set(r,e),q({fetchers:new Map(L.fetchers)}),X(L,w,{submission:u,isFetchActionRedirect:!0})}}if(De(w))return void Z(r,n,w.error);if(Se(w))throw Ee(400,{type:"defer-action"});let E=L.navigation.location||L.location,R=pe(e.history,E,v.signal),x=c||h,S="idle"!==L.navigation.state?y(x,L.navigation.location,f):L.matches;l(S,"Didn't find any matches after fetcher action");let D=++F;I.set(r,D);let C=Te(u,w.data);L.fetchers.set(r,C);let[P,U]=ce(e.history,L,S,u,E,T,_,O,W,z,x,f,{[a.route.id]:w.data},void 0);U.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=L.fetchers.get(t),n=Te(void 0,r?r.data:void 0);L.fetchers.set(t,n),B.has(t)&&ue(t),e.controller&&B.set(t,e.controller)})),q({fetchers:new Map(L.fetchers)});let M=()=>U.forEach((e=>ue(e.key)));v.signal.addEventListener("abort",M);let{results:j,loaderResults:K,fetcherResults:H}=await G(L.matches,S,P,U,R);if(v.signal.aborted)return;v.signal.removeEventListener("abort",M),I.delete(r),B.delete(r),U.forEach((e=>B.delete(e.key)));let Y=Re(j);if(Y){if(Y.idx>=P.length){let e=U[Y.idx-P.length].key;z.add(e)}return X(L,Y.result)}let{loaderData:V,errors:ee}=ye(L,L.matches,P,K,void 0,U,H,$);if(L.fetchers.has(r)){let e=_e(w.data);L.fetchers.set(r,e)}let te=me(D);"loading"===L.navigation.state&&D>N?(l(A,"Expected pending action"),k&&k.abort(),J(L.navigation.location,{matches:S,loaderData:V,errors:ee,fetchers:new Map(L.fetchers)})):(q(t({errors:ee,loaderData:ge(L.loaderData,V,S,ee)},te||U.length>0?{fetchers:new Map(L.fetchers)}:{})),T=!1)}(r,n,g,E,v,b):(W.set(r,{routeId:n,path:g}),async function(t,r,n,o,a,s){let c=L.fetchers.get(t),u=Te(s,c?c.data:void 0);L.fetchers.set(t,u),q({fetchers:new Map(L.fetchers)});let h=new AbortController,p=pe(e.history,n,h.signal);B.set(t,h);let m=F,v=await fe("loader",p,o,a,d,i,f);Se(v)&&(v=await Le(v,p.signal,!0)||v);B.get(t)===h&&B.delete(t);if(p.signal.aborted)return;if(Ce(v)){if(N>m){let e=_e(void 0);return L.fetchers.set(t,e),void q({fetchers:new Map(L.fetchers)})}return z.add(t),void await X(L,v)}if(De(v)){let e=be(L.matches,r);return L.fetchers.delete(t),void q({fetchers:new Map(L.fetchers),errors:{[e.route.id]:v.error}})}l(!Se(v),"Unhandled fetcher deferred data");let y=_e(v.data);L.fetchers.set(t,y),q({fetchers:new Map(L.fetchers)})}(r,n,g,E,v,b))},revalidate:function(){Q(),q({revalidation:"loading"}),"submitting"!==L.navigation.state&&("idle"!==L.navigation.state?Y(A||L.historyAction,L.navigation.location,{overrideNavigation:L.navigation}):Y(L.historyAction,L.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:V,deleteFetcher:ie,dispose:function(){g&&g(),b.clear(),k&&k.abort(),L.fetchers.forEach(((e,t)=>ie(t))),L.blockers.forEach(((e,t)=>ve(t)))},getBlocker:function(e,t){let r=L.blockers.get(e)||ne;return K.get(e)!==t&&K.set(e,t),r},deleteBlocker:ve,_internalFetchControllers:B,_internalActiveDeferreds:$,_internalSetRoutes:function(e){d={},c=v(e,i,void 0,d)}},C}function le(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let c=O(o||".",_(l).map((e=>e.pathnameBase)),M(e.pathname,r)||e.pathname,"path"===i);return null==o&&(c.search=e.search,c.hash=e.hash),null!=o&&""!==o&&"."!==o||!s||!s.route.index||Ae(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:B([r,c.pathname])),d(c)}function se(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&&(o=n.formMethod,!Q.has(o.toLowerCase())))return{path:r,error:Ee(405,{method:n.formMethod})};var o;let a,i,s=()=>({path:r,error:Ee(400,{type:"invalid-body"})}),c=n.formMethod||"get",u=e?c.toUpperCase():c.toLowerCase(),f=xe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!ke(u))return s();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!ke(u))return s();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(l("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=me(n.formData),i=n.formData;else if(n.body instanceof FormData)a=me(n.body),i=n.body;else if(n.body instanceof URLSearchParams)a=n.body,i=ve(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=ve(a)}catch(e){return s()}let p={formMethod:u,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ke(p.formMethod))return{path:r,submission:p};let m=h(r);return t&&m.search&&Ae(m.search)&&a.append("index",""),m.search="?"+a,{path:d(m),submission:p}}function ce(e,r,n,o,a,i,l,s,c,u,d,h,f,p){let m=p?Object.values(p)[0]:f?Object.values(f)[0]:void 0,v=e.createURL(r.location),g=e.createURL(a),b=p?Object.keys(p)[0]:void 0,w=function(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}(n,b),E=w.filter(((e,n)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(r.loaderData,r.matches[n],e)||l.some((t=>t===e.route.id)))return!0;let a=r.matches[n],s=e;return de(e,t({currentUrl:v,currentParams:a.params,nextUrl:g,nextParams:s.params},o,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||ue(a,s)}))})),R=[];return c.forEach(((e,a)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let l=y(d,e.path,h);if(!l)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=r.fetchers.get(a),f=Ue(l,e.path),p=!1;p=!u.has(a)&&(!!s.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:de(f,t({currentUrl:v,currentParams:r.matches[r.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},o,{actionResult:m,defaultShouldRevalidate:i})))),p&&R.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[E,R]}function ue(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function de(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function he(e,r,n){if(!e.lazy)return;let o=await e.lazy();if(!e.lazy)return;let a=n[e.id];l(a,"No route found in manifest");let i={};for(let e in o){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;s(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||m.has(e)||(i[e]=o[e])}Object.assign(a,i),Object.assign(a,t({},r(a),{lazy:void 0}))}async function fe(e,t,r,n,o,a,i,s){let c,u,d;void 0===s&&(s={});let h=e=>{let n,o=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){u=(await Promise.all([h(n),he(r.route,a,o)]))[0]}else{if(await he(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Ee(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:p.data,data:void 0}}u=await h(n)}else{if(!n){let e=new URL(t.url);throw Ee(404,{pathname:e.pathname+e.search})}u=await h(n)}l(void 0!==u,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){c=p.error,u=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(f=u)&&"number"==typeof f.status&&"string"==typeof f.statusText&&"object"==typeof f.headers&&void 0!==f.body){let e,o=u.status;if(Z.has(o)){let e=u.headers.get("Location");if(l(e,"Redirects returned/thrown from loaders/actions must have a Location header"),oe.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=M(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=le(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s.isStaticRequest)throw u.headers.set("Location",e),u;return{type:p.redirect,status:o,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate")}}if(s.isRouteRequest)throw{type:c||p.data,response:u};let a=u.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await u.json():await u.text(),c===p.error?{type:c,error:new J(o,u.statusText,e),headers:u.headers}:{type:p.data,data:e,statusCode:u.status,headers:u.headers}}var f,m,v;return c===p.error?{type:c,error:u}: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}(u)?{type:p.deferred,deferredData:u,statusCode:null==(m=u.init)?void 0:m.status,headers:(null==(v=u.init)?void 0:v.headers)&&new Headers(u.init.headers)}:{type:p.data,data:u}}function pe(e,t,r,n){let o=e.createURL(xe(t)).toString(),a={signal:r};if(n&&ke(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=me(n.formData):a.body=n.formData}return new Request(o,a)}function me(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function ve(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ye(e,r,n,o,a,i,s,c){let{loaderData:u,errors:d}=function(e,t,r,n,o){let a,i={},s=null,c=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(l(!Ce(r),"Cannot handle redirect results in processLoaderData"),De(r)){let t=be(e,h),o=r.error;n&&(o=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=o),i[h]=void 0,c||(c=!0,a=Y(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else Se(r)?(o.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||c||(a=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}(r,n,o,a,c);for(let r=0;r<i.length;r++){let{key:n,match:o,controller:a}=i[r];l(void 0!==s&&void 0!==s[r],"Did not find corresponding fetcher result");let c=s[r];if(!a||!a.signal.aborted)if(De(c)){let r=be(e.matches,null==o?void 0:o.route.id);d&&d[r.route.id]||(d=t({},d,{[r.route.id]:c.error})),e.fetchers.delete(n)}else if(Ce(c))l(!1,"Unhandled fetcher revalidation redirect");else if(Se(c))l(!1,"Unhandled fetcher deferred data");else{let t=_e(c.data);e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function ge(e,r,n,o){let a=t({},r);for(let t of n){let n=t.route.id;if(r.hasOwnProperty(n)?void 0!==r[n]&&(a[n]=r[n]):void 0!==e[n]&&t.route.loader&&(a[n]=e[n]),o&&o.hasOwnProperty(n))break}return a}function be(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 we(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ee(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new J(e||500,i,new Error(l),!0)}function Re(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ce(r))return{result:r,idx:t}}}function xe(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function Se(e){return e.type===p.deferred}function De(e){return e.type===p.error}function Ce(e){return(e&&e.type)===p.redirect}function ke(e){return X.has(e.toLowerCase())}async function Pe(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let s=r[i],c=t[i];if(!c)continue;let u=e.find((e=>e.route.id===c.route.id)),d=null!=u&&!ue(u,c)&&void 0!==(a&&a[c.route.id]);if(Se(s)&&(o||d)){let e=n[i];l(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Le(s,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Le(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:p.data,data:e.deferredData.unwrappedData}}catch(e){return{type:p.error,error:e}}return{type:p.data,data:e.deferredData.data}}}function Ae(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ue(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Ae(r||""))return e[e.length-1];let n=_(e);return n[n.length-1]}function Me(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,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 je(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 Te(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," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function _e(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}
12
+ */function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}var r;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(r||(r={}));const n="popstate";function o(e){void 0===e&&(e={});let t,{initialEntries:n=["/"],initialIndex:o,v5Compat:a=!1}=e;t=n.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=f(null==o?t.length-1:o),l=r.Pop,c=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function p(){return t[i]}function m(e,r,n){void 0===r&&(r=null);let o=u(t?p().pathname:"/",e,r,n);return s("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function v(e){return"string"==typeof e?e:d(e)}return{get index(){return i},get action(){return l},get location(){return p()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?h(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){l=r.Push;let o=m(e,n);i+=1,t.splice(i,t.length,o),a&&c&&c({action:l,location:o,delta:1})},replace(e,n){l=r.Replace;let o=m(e,n);t[i]=o,a&&c&&c({action:l,location:o,delta:0})},go(e){l=r.Pop;let n=f(i+e),o=t[n];i=n,c&&c({action:l,location:o,delta:e})},listen:e=>(c=e,()=>{c=null})}}function a(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return u("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:d(t)}),null,e)}function i(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=h(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),u("",{pathname:r,search:n,hash:o},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:d(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function l(e,t){if(!1===e||null==e)throw new Error(t)}function s(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,r,n,o){return void 0===n&&(n=null),t({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof r?h(r):r,{state:n,key:r&&r.key||o||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function h(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 f(e,o,a,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:h=!1}=i,f=s.history,p=r.Pop,m=null,v=y();function y(){return(f.state||{idx:null}).idx}function g(){p=r.Pop;let e=y(),t=null==e?null:e-v;v=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(t({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(n,g),m=e,()=>{s.removeEventListener(n,g),m=null}},createHref:e=>o(s,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let n=u(w.location,e,t);a&&a(n,e),v=y()+1;let o=c(n,v),i=w.createHref(n);try{f.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(i)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=r.Replace;let n=u(w.location,e,t);a&&a(n,e),v=y();let o=c(n,v),i=w.createHref(n);f.replaceState(o,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function v(e,r,n,o){return void 0===n&&(n=[]),void 0===o&&(o={}),e.map(((e,a)=>{let i=[...n,a],s="string"==typeof e.id?e.id:i.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!o[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=t({},e,r(e),{id:s});return o[s]=n,n}{let n=t({},e,r(e),{id:s,children:void 0});return o[s]=n,e.children&&(n.children=v(e.children,r,i,o)),n}}))}function y(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let o=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e)a=P(o[e],U(n));return a}function g(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=B([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),g(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:k(s,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of b(e.path))o(e,t,r);else o(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=b(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const w=/^:\w+$/,E=3,R=2,x=1,S=10,D=-2,C=e=>"*"===e;function k(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=D),t&&(n+=R),r.filter((e=>!C(e))).reduce(((e,t)=>e+(w.test(t)?E:""===t?x:S)),n)}function P(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(n,c.params);let u=i.route;a.push({params:n,pathname:B([o,c.pathname]),pathnameBase:F(B([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=B([o,c.pathnameBase]))}return a}function L(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(s(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return o(t["*"])}const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return l("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);s("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=l[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return s(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function U(e){try{return decodeURI(e)}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function M(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 j(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"==typeof e?h(e):e,a=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:a,search:N(n),hash:I(o)}}function T(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function _(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function O(e,r,n,o){let a;void 0===o&&(o=!1),"string"==typeof e?a=h(e):(a=t({},e),l(!a.pathname||!a.pathname.includes("?"),T("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),T("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),T("#","search","hash",a)));let i,s=""===e||""===a.pathname,c=s?"/":a.pathname;if(o||null==c)i=n;else{let e=r.length-1;if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?r[e]:"/"}let u=j(a,i),d=c&&"/"!==c&&c.endsWith("/"),f=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",z=function(e,r){void 0===r&&(r={});let n="number"==typeof r?{status:r}:r,o=new Headers(n.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),t({},n,{headers:o}))};class W extends Error{}class ${constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],l(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new W("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)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),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 W)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 l(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:K(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function K(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const H=function(e,t){return void 0===t&&(t={}),new $(e,"number"==typeof t?{status:t}:t)},q=function(e,r){void 0===r&&(r=302);let n=r;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let o=new Headers(n.headers);return o.set("Location",e),new Response(null,t({},n,{headers:o}))},J=(e,t)=>{let r=q(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Y{constructor(e,t,r,n){void 0===n&&(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 V(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const X=["post","put","patch","delete"],G=new Set(X),Q=["get",...X],Z=new Set(Q),ee=new Set([301,302,303,307,308]),te=new Set([307,308]),re={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ne={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oe={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ae=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ie=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function le(e){const n=e.window?e.window:"undefined"!=typeof window?window:void 0,o=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,a=!o;let i;if(l(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ie;let c,d={},h=v(e.routes,i,void 0,d),f=e.basename||"/",m=t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),g=null,b=new Set,w=null,E=null,R=null,x=null!=e.hydrationData,S=y(h,e.history.location,f),D=null;if(null==S){let t=Re(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Ee(h);S=r,D={[n.id]:t}}let C,k,P=!(S.some((e=>e.route.lazy))||S.some((e=>e.route.loader))&&null==e.hydrationData),L={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:re,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||D,fetchers:new Map,blockers:new Map},A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[],B=new Map,F=0,N=-1,I=new Map,z=new Set,W=new Map,$=new Map,K=new Map,H=!1;function q(e){L=t({},L,e),b.forEach((e=>e(L)))}function J(n,o){var a,i;let l,s=null!=L.actionData&&null!=L.navigation.formMethod&&Pe(L.navigation.formMethod)&&"loading"===L.navigation.state&&!0!==(null==(a=n.state)?void 0:a._isRedirect);l=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:s?L.actionData:null;let u=o.loaderData?be(L.loaderData,o.loaderData,o.matches||[],o.errors):L.loaderData,d=L.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,oe))));let f=!0===U||null!=L.navigation.formMethod&&Pe(L.navigation.formMethod)&&!0!==(null==(i=n.state)?void 0:i._isRedirect);c&&(h=c,c=void 0),j||A===r.Pop||(A===r.Push?e.history.push(n,n.state):A===r.Replace&&e.history.replace(n,n.state)),q(t({},o,{actionData:l,loaderData:u,historyAction:A,location:n,initialized:!0,navigation:re,revalidation:"idle",restoreScrollPosition:Fe(n,o.matches||L.matches),preventScrollReset:f,blockers:d})),A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[]}async function Y(n,o,a){k&&k.abort(),k=null,A=n,j=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(w&&R){let r=Be(e,t);w[r]=R()}}(L.location,L.matches),U=!0===(a&&a.preventScrollReset);let l=c||h,s=a&&a.overrideNavigation,u=y(l,o,f);if(!u){let e=Re(404,{pathname:o.pathname}),{matches:t,route:r}=Ee(l);return Ue(),void J(o,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(L.initialized&&!T&&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}(L.location,o)&&!(a&&a.submission&&Pe(a.submission.formMethod)))return void J(o,{matches:u});k=new AbortController;let m,v,g=me(e.history,o,k.signal,a&&a.submission);if(a&&a.pendingError)v={[we(u).route.id]:a.pendingError};else if(a&&a.submission&&Pe(a.submission.formMethod)){let e=await async function(e,t,n,o,a){void 0===a&&(a={});Q();let l,s=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,n);q({navigation:s});let c=Me(o,t);if(c.route.action||c.route.lazy){if(l=await pe("action",e,c,o,d,i,f),e.signal.aborted)return{shortCircuited:!0}}else l={type:p.error,error:Re(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(ke(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===L.location.pathname+L.location.search,await X(L,l,{submission:n,replace:e}),{shortCircuited:!0}}if(Ce(l)){let e=we(o,c.route.id);return!0!==(a&&a.replace)&&(A=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(De(l))throw Re(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(g,o,a.submission,u,{replace:a.replace});if(e.shortCircuited)return;m=e.pendingActionData,v=e.pendingActionError,s=Te(o,a.submission),g=new Request(g.url,{signal:g.signal})}let{shortCircuited:b,loaderData:E,errors:x}=await async function(r,n,o,a,i,l,s,u,d){let p=a||Te(n,i),m=i||l||je(p),v=c||h,[y,g]=ue(e.history,L,o,m,n,T,_,O,W,z,v,f,u,d);if(Ue((e=>!(o&&o.some((t=>t.route.id===e)))||y&&y.some((t=>t.route.id===e)))),N=++F,0===y.length&&0===g.length){let e=he();return J(n,t({matches:o,loaderData:{},errors:d||null},u?{actionData:u}:{},e?{fetchers:new Map(L.fetchers)}:{})),{shortCircuited:!0}}if(!j){g.forEach((e=>{let t=L.fetchers.get(e.key),r=_e(void 0,t?t.data:void 0);L.fetchers.set(e.key,r)}));let e=u||L.actionData;q(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},g.length>0?{fetchers:new Map(L.fetchers)}:{}))}g.forEach((e=>{B.has(e.key)&&le(e.key),e.controller&&B.set(e.key,e.controller)}));let b=()=>g.forEach((e=>le(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await G(L.matches,o,y,g,r);if(r.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b);g.forEach((e=>B.delete(e.key)));let x=xe(w);if(x){if(x.idx>=y.length){let e=g[x.idx-y.length].key;z.add(e)}return await X(L,x.result,{replace:s}),{shortCircuited:!0}}let{loaderData:S,errors:D}=ge(L,o,y,E,d,g,R,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))}));let C=he(),P=fe(N),A=C||P||g.length>0;return t({loaderData:S,errors:D},A?{fetchers:new Map(L.fetchers)}:{})}(g,o,u,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,m,v);b||(k=null,J(o,t({matches:u},m?{actionData:m}:{},{loaderData:E,errors:x})))}function V(e){return L.fetchers.get(e)||ne}async function X(a,i,s){let{submission:c,replace:d,isFetchActionRedirect:h}=void 0===s?{}:s;i.revalidate&&(T=!0);let p=u(a.location,i.location,t({_isRedirect:!0},h?{_isFetchActionRedirect:!0}:{}));if(l(p,"Expected a location on the redirect navigation"),o){let t=!1;if(i.reloadDocument)t=!0;else if(ae.test(i.location)){const r=e.history.createURL(i.location);t=r.origin!==n.location.origin||null==M(r.pathname,f)}if(t)return void(d?n.location.replace(i.location):n.location.assign(i.location))}k=null;let m=!0===d?r.Replace:r.Push,v=c||je(a.navigation);if(te.has(i.status)&&v&&Pe(v.formMethod))await Y(m,p,{submission:t({},v,{formAction:i.location}),preventScrollReset:U});else if(h)await Y(m,p,{overrideNavigation:Te(p),fetcherSubmission:v,preventScrollReset:U});else{let e=Te(p,v);await Y(m,p,{overrideNavigation:e,preventScrollReset:U})}}async function G(t,r,n,o,a){let l=await Promise.all([...n.map((e=>pe("loader",a,e,r,d,i,f))),...o.map((t=>{if(t.matches&&t.match&&t.controller)return pe("loader",me(e.history,t.path,t.controller.signal),t.match,t.matches,d,i,f);return{type:p.error,error:Re(404,{pathname:t.path})}}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Le(t,n,s,s.map((()=>a.signal)),!1,L.loaderData),Le(t,o.map((e=>e.match)),c,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function Q(){T=!0,_.push(...Ue()),W.forEach(((e,t)=>{B.has(t)&&(O.push(t),le(t))}))}function Z(e,t,r){let n=we(L.matches,t);ee(e),q({errors:{[n.route.id]:r},fetchers:new Map(L.fetchers)})}function ee(e){let t=L.fetchers.get(e);!B.has(e)||t&&"loading"===t.state&&I.has(e)||le(e),W.delete(e),I.delete(e),z.delete(e),L.fetchers.delete(e)}function le(e){let t=B.get(e);l(t,"Expected fetch controller: "+e),t.abort(),B.delete(e)}function de(e){for(let t of e){let e=Oe(V(t).data);L.fetchers.set(t,e)}}function he(){let e=[],t=!1;for(let r of z){let n=L.fetchers.get(r);l(n,"Expected fetcher: "+r),"loading"===n.state&&(z.delete(r),e.push(r),t=!0)}return de(e),t}function fe(e){let t=[];for(let[r,n]of I)if(n<e){let e=L.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(le(r),I.delete(r),t.push(r))}return de(t),t.length>0}function ve(e){L.blockers.delete(e),K.delete(e)}function ye(e,t){let r=L.blockers.get(e)||oe;l("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,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(L.blockers);n.set(e,t),q({blockers:n})}function Se(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===K.size)return;K.size>1&&s(!1,"A router only supports one blocker at a time");let o=Array.from(K.entries()),[a,i]=o[o.length-1],l=L.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function Ue(e){let t=[];return $.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),$.delete(n))})),t}function Be(e,t){if(E){return E(e,t.map((e=>function(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,L.loaderData))))||e.key}return e.key}function Fe(e,t){if(w){let r=Be(e,t),n=w[r];if("number"==typeof n)return n}return null}return C={get basename(){return f},get state(){return L},get routes(){return h},initialize:function(){return g=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(H)return void(H=!1);s(0===K.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=Se({currentLocation:L.location,nextLocation:n,historyAction:r});return a&&null!=o?(H=!0,e.history.go(-1*o),void ye(a,{state:"blocked",location:n,proceed(){ye(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(L.blockers);e.set(a,oe),q({blockers:e})}})):Y(r,n)})),L.initialized||Y(r.Pop,L.location),C},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(w=e,R=t,E=r||null,!x&&L.navigation===re){x=!0;let e=Fe(L.location,L.matches);null!=e&&q({restoreScrollPosition:e})}return()=>{w=null,R=null,E=null}},navigate:async function n(o,a){if("number"==typeof o)return void e.history.go(o);let i=se(L.location,L.matches,f,m.v7_prependBasename,o,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:c}=ce(m.v7_normalizeFormMethod,!1,i,a),d=L.location,h=u(L.location,l,a&&a.state);h=t({},h,e.history.encodeLocation(h));let p=a&&null!=a.replace?a.replace:void 0,v=r.Push;!0===p?v=r.Replace:!1===p||null!=s&&Pe(s.formMethod)&&s.formAction===L.location.pathname+L.location.search&&(v=r.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=Se({currentLocation:d,nextLocation:h,historyAction:v});if(!g)return await Y(v,h,{submission:s,pendingError:c,preventScrollReset:y,replace:a&&a.replace});ye(g,{state:"blocked",location:h,proceed(){ye(g,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),n(o,a)},reset(){let e=new Map(L.blockers);e.set(g,oe),q({blockers:e})}})},fetch:function(r,n,o,s){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.");B.has(r)&&le(r);let u=c||h,p=se(L.location,L.matches,f,m.v7_prependBasename,o,n,null==s?void 0:s.relative),v=y(u,p,f);if(!v)return void Z(r,n,Re(404,{pathname:p}));let{path:g,submission:b,error:w}=ce(m.v7_normalizeFormMethod,!0,p,s);if(w)return void Z(r,n,w);let E=Me(v,g);U=!0===(s&&s.preventScrollReset),b&&Pe(b.formMethod)?async function(r,n,o,a,s,u){if(Q(),W.delete(r),!a.route.action&&!a.route.lazy){let e=Re(405,{method:u.formMethod,pathname:o,routeId:n});return void Z(r,n,e)}let p=L.fetchers.get(r),m=function(e,t){let r={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," _hasFetcherDoneAnything ":!0};return r}(u,p);L.fetchers.set(r,m),q({fetchers:new Map(L.fetchers)});let v=new AbortController,g=me(e.history,o,v.signal,u);B.set(r,v);let b=F,w=await pe("action",g,a,s,d,i,f);if(g.signal.aborted)return void(B.get(r)===v&&B.delete(r));if(ke(w)){if(B.delete(r),N>b){let e=Oe(void 0);return L.fetchers.set(r,e),void q({fetchers:new Map(L.fetchers)})}{z.add(r);let e=_e(u);return L.fetchers.set(r,e),q({fetchers:new Map(L.fetchers)}),X(L,w,{submission:u,isFetchActionRedirect:!0})}}if(Ce(w))return void Z(r,n,w.error);if(De(w))throw Re(400,{type:"defer-action"});let E=L.navigation.location||L.location,R=me(e.history,E,v.signal),x=c||h,S="idle"!==L.navigation.state?y(x,L.navigation.location,f):L.matches;l(S,"Didn't find any matches after fetcher action");let D=++F;I.set(r,D);let C=_e(u,w.data);L.fetchers.set(r,C);let[P,U]=ue(e.history,L,S,u,E,T,_,O,W,z,x,f,{[a.route.id]:w.data},void 0);U.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=L.fetchers.get(t),n=_e(void 0,r?r.data:void 0);L.fetchers.set(t,n),B.has(t)&&le(t),e.controller&&B.set(t,e.controller)})),q({fetchers:new Map(L.fetchers)});let M=()=>U.forEach((e=>le(e.key)));v.signal.addEventListener("abort",M);let{results:j,loaderResults:K,fetcherResults:H}=await G(L.matches,S,P,U,R);if(v.signal.aborted)return;v.signal.removeEventListener("abort",M),I.delete(r),B.delete(r),U.forEach((e=>B.delete(e.key)));let Y=xe(j);if(Y){if(Y.idx>=P.length){let e=U[Y.idx-P.length].key;z.add(e)}return X(L,Y.result)}let{loaderData:V,errors:ee}=ge(L,L.matches,P,K,void 0,U,H,$);if(L.fetchers.has(r)){let e=Oe(w.data);L.fetchers.set(r,e)}let te=fe(D);"loading"===L.navigation.state&&D>N?(l(A,"Expected pending action"),k&&k.abort(),J(L.navigation.location,{matches:S,loaderData:V,errors:ee,fetchers:new Map(L.fetchers)})):(q(t({errors:ee,loaderData:be(L.loaderData,V,S,ee)},te||U.length>0?{fetchers:new Map(L.fetchers)}:{})),T=!1)}(r,n,g,E,v,b):(W.set(r,{routeId:n,path:g}),async function(t,r,n,o,a,s){let c=L.fetchers.get(t),u=_e(s,c?c.data:void 0);L.fetchers.set(t,u),q({fetchers:new Map(L.fetchers)});let h=new AbortController,p=me(e.history,n,h.signal);B.set(t,h);let m=F,v=await pe("loader",p,o,a,d,i,f);De(v)&&(v=await Ae(v,p.signal,!0)||v);B.get(t)===h&&B.delete(t);if(p.signal.aborted)return;if(ke(v)){if(N>m){let e=Oe(void 0);return L.fetchers.set(t,e),void q({fetchers:new Map(L.fetchers)})}return z.add(t),void await X(L,v)}if(Ce(v)){let e=we(L.matches,r);return L.fetchers.delete(t),void q({fetchers:new Map(L.fetchers),errors:{[e.route.id]:v.error}})}l(!De(v),"Unhandled fetcher deferred data");let y=Oe(v.data);L.fetchers.set(t,y),q({fetchers:new Map(L.fetchers)})}(r,n,g,E,v,b))},revalidate:function(){Q(),q({revalidation:"loading"}),"submitting"!==L.navigation.state&&("idle"!==L.navigation.state?Y(A||L.historyAction,L.navigation.location,{overrideNavigation:L.navigation}):Y(L.historyAction,L.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:V,deleteFetcher:ee,dispose:function(){g&&g(),b.clear(),k&&k.abort(),L.fetchers.forEach(((e,t)=>ee(t))),L.blockers.forEach(((e,t)=>ve(t)))},getBlocker:function(e,t){let r=L.blockers.get(e)||oe;return K.get(e)!==t&&K.set(e,t),r},deleteBlocker:ve,_internalFetchControllers:B,_internalActiveDeferreds:$,_internalSetRoutes:function(e){d={},c=v(e,i,void 0,d)}},C}function se(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let c=O(o||".",_(l).map((e=>e.pathnameBase)),M(e.pathname,r)||e.pathname,"path"===i);return null==o&&(c.search=e.search,c.hash=e.hash),null!=o&&""!==o&&"."!==o||!s||!s.route.index||Ue(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:B([r,c.pathname])),d(c)}function ce(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&&(o=n.formMethod,!Z.has(o.toLowerCase())))return{path:r,error:Re(405,{method:n.formMethod})};var o;let a,i,s=()=>({path:r,error:Re(400,{type:"invalid-body"})}),c=n.formMethod||"get",u=e?c.toUpperCase():c.toLowerCase(),f=Se(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Pe(u))return s();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Pe(u))return s();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(l("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=ve(n.formData),i=n.formData;else if(n.body instanceof FormData)a=ve(n.body),i=n.body;else if(n.body instanceof URLSearchParams)a=n.body,i=ye(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=ye(a)}catch(e){return s()}let p={formMethod:u,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Pe(p.formMethod))return{path:r,submission:p};let m=h(r);return t&&m.search&&Ue(m.search)&&a.append("index",""),m.search="?"+a,{path:d(m),submission:p}}function ue(e,r,n,o,a,i,l,s,c,u,d,h,f,p){let m=p?Object.values(p)[0]:f?Object.values(f)[0]:void 0,v=e.createURL(r.location),g=e.createURL(a),b=p?Object.keys(p)[0]:void 0,w=function(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}(n,b),E=w.filter(((e,n)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(r.loaderData,r.matches[n],e)||l.some((t=>t===e.route.id)))return!0;let a=r.matches[n],s=e;return he(e,t({currentUrl:v,currentParams:a.params,nextUrl:g,nextParams:s.params},o,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||de(a,s)}))})),R=[];return c.forEach(((e,a)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let l=y(d,e.path,h);if(!l)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=r.fetchers.get(a),f=Me(l,e.path),p=!1;p=!u.has(a)&&(!!s.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:he(f,t({currentUrl:v,currentParams:r.matches[r.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},o,{actionResult:m,defaultShouldRevalidate:i})))),p&&R.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[E,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,r,n){if(!e.lazy)return;let o=await e.lazy();if(!e.lazy)return;let a=n[e.id];l(a,"No route found in manifest");let i={};for(let e in o){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;s(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||m.has(e)||(i[e]=o[e])}Object.assign(a,i),Object.assign(a,t({},r(a),{lazy:void 0}))}async function pe(e,t,r,n,o,a,i,s){let c,u,d;void 0===s&&(s={});let h=e=>{let n,o=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){u=(await Promise.all([h(n),fe(r.route,a,o)]))[0]}else{if(await fe(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Re(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:p.data,data:void 0}}u=await h(n)}else{if(!n){let e=new URL(t.url);throw Re(404,{pathname:e.pathname+e.search})}u=await h(n)}l(void 0!==u,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){c=p.error,u=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(f=u)&&"number"==typeof f.status&&"string"==typeof f.statusText&&"object"==typeof f.headers&&void 0!==f.body){let e,o=u.status;if(ee.has(o)){let e=u.headers.get("Location");if(l(e,"Redirects returned/thrown from loaders/actions must have a Location header"),ae.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=M(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=se(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s.isStaticRequest)throw u.headers.set("Location",e),u;return{type:p.redirect,status:o,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate"),reloadDocument:null!==u.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest){throw{type:c===p.error?p.error:p.data,response:u}}let a=u.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await u.json():await u.text(),c===p.error?{type:c,error:new Y(o,u.statusText,e),headers:u.headers}:{type:p.data,data:e,statusCode:u.status,headers:u.headers}}var f,m,v;return c===p.error?{type:c,error:u}: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}(u)?{type:p.deferred,deferredData:u,statusCode:null==(m=u.init)?void 0:m.status,headers:(null==(v=u.init)?void 0:v.headers)&&new Headers(u.init.headers)}:{type:p.data,data:u}}function me(e,t,r,n){let o=e.createURL(Se(t)).toString(),a={signal:r};if(n&&Pe(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=ve(n.formData):a.body=n.formData}return new Request(o,a)}function ve(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function ye(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ge(e,r,n,o,a,i,s,c){let{loaderData:u,errors:d}=function(e,t,r,n,o){let a,i={},s=null,c=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(l(!ke(r),"Cannot handle redirect results in processLoaderData"),Ce(r)){let t=we(e,h),o=r.error;n&&(o=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=o),i[h]=void 0,c||(c=!0,a=V(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else De(r)?(o.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||c||(a=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}(r,n,o,a,c);for(let r=0;r<i.length;r++){let{key:n,match:o,controller:a}=i[r];l(void 0!==s&&void 0!==s[r],"Did not find corresponding fetcher result");let c=s[r];if(!a||!a.signal.aborted)if(Ce(c)){let r=we(e.matches,null==o?void 0:o.route.id);d&&d[r.route.id]||(d=t({},d,{[r.route.id]:c.error})),e.fetchers.delete(n)}else if(ke(c))l(!1,"Unhandled fetcher revalidation redirect");else if(De(c))l(!1,"Unhandled fetcher deferred data");else{let t=Oe(c.data);e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function be(e,r,n,o){let a=t({},r);for(let t of n){let n=t.route.id;if(r.hasOwnProperty(n)?void 0!==r[n]&&(a[n]=r[n]):void 0!==e[n]&&t.route.loader&&(a[n]=e[n]),o&&o.hasOwnProperty(n))break}return a}function we(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 Ee(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Re(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Y(e||500,i,new Error(l),!0)}function xe(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ke(r))return{result:r,idx:t}}}function Se(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function De(e){return e.type===p.deferred}function Ce(e){return e.type===p.error}function ke(e){return(e&&e.type)===p.redirect}function Pe(e){return G.has(e.toLowerCase())}async function Le(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let s=r[i],c=t[i];if(!c)continue;let u=e.find((e=>e.route.id===c.route.id)),d=null!=u&&!de(u,c)&&void 0!==(a&&a[c.route.id]);if(De(s)&&(o||d)){let e=n[i];l(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ae(s,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Ae(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:p.data,data:e.deferredData.unwrappedData}}catch(e){return{type:p.error,error:e}}return{type:p.data,data:e.deferredData.data}}}function Ue(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Me(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Ue(r||""))return e[e.length-1];let n=_(e);return n[n.length-1]}function je(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,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 Te(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 _e(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," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Oe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}
13
13
  /**
14
- * React Router v6.14.2
14
+ * React Router v6.15.0
15
15
  *
16
16
  * Copyright (c) Remix Software Inc.
17
17
  *
@@ -19,9 +19,9 @@ import*as e from"react";
19
19
  * LICENSE.md file in the root directory of this source tree.
20
20
  *
21
21
  * @license MIT
22
- */function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oe.apply(this,arguments)}const Be=e.createContext(null),Fe=e.createContext(null),Ne=e.createContext(null),Ie=e.createContext(null),ze=e.createContext(null),We=e.createContext({outlet:null,matches:[],isDataRoute:!1}),$e=e.createContext(null);function Ke(t,r){let{relative:n}=void 0===r?{}:r;He()||l(!1);let{basename:o,navigator:a}=e.useContext(Ie),{hash:i,pathname:s,search:c}=tt(t,{relative:n}),u=s;return"/"!==o&&(u="/"===s?o:B([o,s])),a.createHref({pathname:u,search:c,hash:i})}function He(){return null!=e.useContext(ze)}function qe(){return He()||l(!1),e.useContext(ze).location}function Je(){return e.useContext(ze).navigationType}function Ye(t){He()||l(!1);let{pathname:r}=qe();return e.useMemo((()=>A(t,r)),[r,t])}function Ve(t){e.useContext(Ie).static||e.useLayoutEffect(t)}function Xe(){let{isDataRoute:t}=e.useContext(We);return t?function(){let{router:t}=dt(ct.UseNavigateStable),r=ft(ut.UseNavigateStable),n=e.useRef(!1);return Ve((()=>{n.current=!0})),e.useCallback((function(e,o){void 0===o&&(o={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,Oe({fromRouteId:r},o)))}),[t,r])}():function(){He()||l(!1);let t=e.useContext(Be),{basename:r,navigator:n}=e.useContext(Ie),{matches:o}=e.useContext(We),{pathname:a}=qe(),i=JSON.stringify(_(o).map((e=>e.pathnameBase))),s=e.useRef(!1);return Ve((()=>{s.current=!0})),e.useCallback((function(e,o){if(void 0===o&&(o={}),!s.current)return;if("number"==typeof e)return void n.go(e);let l=O(e,JSON.parse(i),a,"path"===o.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:B([r,l.pathname])),(o.replace?n.replace:n.push)(l,o.state,o)}),[r,n,i,a,t])}()}const Ge=e.createContext(null);function Qe(){return e.useContext(Ge)}function Ze(t){let r=e.useContext(We).outlet;return r?e.createElement(Ge.Provider,{value:t},r):r}function et(){let{matches:t}=e.useContext(We),r=t[t.length-1];return r?r.params:{}}function tt(t,r){let{relative:n}=void 0===r?{}:r,{matches:o}=e.useContext(We),{pathname:a}=qe(),i=JSON.stringify(_(o).map((e=>e.pathnameBase)));return e.useMemo((()=>O(t,JSON.parse(i),a,"path"===n)),[t,i,a,n])}function rt(e,t){return nt(e,t)}function nt(t,n,o){He()||l(!1);let{navigator:a}=e.useContext(Ie),{matches:i}=e.useContext(We),s=i[i.length-1],c=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let d,f=qe();if(n){var p;let e="string"==typeof n?h(n):n;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||l(!1),d=e}else d=f;let m=d.pathname||"/",v=y(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),g=st(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:B([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:B([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,o);return n&&g?e.createElement(ze.Provider,{value:{location:Oe({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},g):g}function ot(){let t=Et(),r=Y(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={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:o},n):null,null)}const at=e.createElement(ot,null);class it 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: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 this.state.error?e.createElement(We.Provider,{value:this.props.routeContext},e.createElement($e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lt(t){let{routeContext:r,match:n,children:o}=t,a=e.useContext(Be);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(We.Provider,{value:r},o)}function st(t,r,n){var o;if(void 0===r&&(r=[]),void 0===n&&(n=null),null==t){var a;if(null==(a=n)||!a.errors)return null;t=n.matches}let i=t,s=null==(o=n)?void 0:o.errors;if(null!=s){let e=i.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||l(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((t,o,a)=>{let l=o.route.id?null==s?void 0:s[o.route.id]:null,c=null;n&&(c=o.route.errorElement||at);let u=r.concat(i.slice(0,a+1)),d=()=>{let r;return r=l?c:o.route.Component?e.createElement(o.route.Component,null):o.route.element?o.route.element:t,e.createElement(lt,{match:o,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?e.createElement(it,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var ct,ut;function dt(t){let r=e.useContext(Be);return r||l(!1),r}function ht(t){let r=e.useContext(Fe);return r||l(!1),r}function ft(t){let r=function(t){let r=e.useContext(We);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function pt(){return ft(ut.UseRouteId)}function mt(){return ht(ut.UseNavigation).navigation}function vt(){let e=dt(ct.UseRevalidator),t=ht(ut.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}}function yt(){let{matches:t,loaderData:r}=ht(ut.UseMatches);return e.useMemo((()=>t.map((e=>{let{pathname:t,params:n}=e;return{id:e.route.id,pathname:t,params:n,data:r[e.route.id],handle:e.route.handle}}))),[t,r])}function gt(){let e=ht(ut.UseLoaderData),t=ft(ut.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function bt(e){return ht(ut.UseRouteLoaderData).loaderData[e]}function wt(){let t=ht(ut.UseActionData);return e.useContext(We)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function Et(){var t;let r=e.useContext($e),n=ht(ut.UseRouteError),o=ft(ut.UseRouteError);return r||(null==(t=n.errors)?void 0:t[o])}function Rt(){let t=e.useContext(Ne);return null==t?void 0:t._data}function xt(){let t=e.useContext(Ne);return null==t?void 0:t._error}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(ct||(ct={})),function(e){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"}(ut||(ut={}));let St=0;function Dt(t){let{router:r,basename:n}=dt(ct.UseBlocker),o=ht(ut.UseBlocker),[a,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:o,historyAction:a}=e;return t({currentLocation:Oe({},r,{pathname:M(r.pathname,n)||r.pathname}),nextLocation:Oe({},o,{pathname:M(o.pathname,n)||o.pathname}),historyAction:a})}),[n,t]);return e.useEffect((()=>{let e=String(++St);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==a&&r.getBlocker(a,l)}),[r,a,l]),a&&o.blockers.has(a)?o.blockers.get(a):ne}const Ct=e.startTransition;function kt(t){let{fallbackElement:r,router:n,future:o}=t,[a,i]=e.useState(n.state),{v7_startTransition:l}=o||{},s=e.useCallback((e=>{l&&Ct?Ct((()=>i(e))):i(e)}),[i,l]);e.useLayoutEffect((()=>n.subscribe(s)),[n,s]);let c=e.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),u=n.basename||"/",d=e.useMemo((()=>({router:n,navigator:c,static:!1,basename:u})),[n,c,u]);return e.createElement(e.Fragment,null,e.createElement(Be.Provider,{value:d},e.createElement(Fe.Provider,{value:a},e.createElement(jt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:c},a.initialized?e.createElement(Pt,{routes:n.routes,state:a}):r))),null)}function Pt(e){let{routes:t,state:r}=e;return nt(t,void 0,r)}function Lt(t){let{basename:r,children:n,initialEntries:a,initialIndex:i,future:l}=t,s=e.useRef();null==s.current&&(s.current=o({initialEntries:a,initialIndex:i,v5Compat:!0}));let c=s.current,[u,d]=e.useState({action:c.action,location:c.location}),{v7_startTransition:h}=l||{},f=e.useCallback((e=>{h&&Ct?Ct((()=>d(e))):d(e)}),[d,h]);return e.useLayoutEffect((()=>c.listen(f)),[c,f]),e.createElement(jt,{basename:r,children:n,location:u.location,navigationType:u.action,navigator:c})}function At(t){let{to:r,replace:n,state:o,relative:a}=t;He()||l(!1);let{matches:i}=e.useContext(We),{pathname:s}=qe(),c=Xe(),u=O(r,_(i).map((e=>e.pathnameBase)),s,"path"===a),d=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(d),{replace:n,state:o,relative:a})),[c,d,a,n,o]),null}function Ut(e){return Ze(e.context)}function Mt(e){l(!1)}function jt(t){let{basename:n="/",children:o=null,location:a,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;He()&&l(!1);let u=n.replace(/^\/*/,"/"),d=e.useMemo((()=>({basename:u,navigator:s,static:c})),[u,s,c]);"string"==typeof a&&(a=h(a));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:y="default"}=a,g=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:y},navigationType:i}}),[u,f,p,m,v,y,i]);return null==g?null:e.createElement(Ie.Provider,{value:d},e.createElement(ze.Provider,{children:o,value:g}))}function Tt(e){let{children:t,location:r}=e;return rt(It(t),r)}function _t(t){let{children:r,errorElement:n,resolve:o}=t;return e.createElement(Ft,{resolve:o,errorElement:n},e.createElement(Nt,null,r))}var Ot;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Ot||(Ot={}));const Bt=new Promise((()=>{}));class Ft 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,o=null,a=Ot.pending;if(n instanceof Promise)if(this.state.error){a=Ot.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,a=void 0!==o._error?Ot.error:void 0!==o._data?Ot.success:Ot.pending):(a=Ot.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else a=Ot.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(a===Ot.error&&o._error instanceof W)throw Bt;if(a===Ot.error&&!r)throw o._error;if(a===Ot.error)return e.createElement(Ne.Provider,{value:o,children:r});if(a===Ot.success)return e.createElement(Ne.Provider,{value:o,children:t});throw o}}function Nt(t){let{children:r}=t,n=Rt(),o="function"==typeof r?r(n):r;return e.createElement(e.Fragment,null,o)}function It(t,r){void 0===r&&(r=[]);let n=[];return e.Children.forEach(t,((t,o)=>{if(!e.isValidElement(t))return;let a=[...r,o];if(t.type===e.Fragment)return void n.push.apply(n,It(t.props.children,a));t.type!==Mt&&l(!1),t.props.index&&t.props.children&&l(!1);let i={id:t.props.id||a.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: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=It(t.props.children,a)),n.push(i)})),n}function zt(e){return st(e)}function Wt(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.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function $t(e,t){return ie({basename:null==t?void 0:t.basename,future:Oe({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:o({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Wt}).initialize()}
22
+ */function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Be.apply(this,arguments)}const Fe=e.createContext(null),Ne=e.createContext(null),Ie=e.createContext(null),ze=e.createContext(null),We=e.createContext(null),$e=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Ke=e.createContext(null);function He(t,r){let{relative:n}=void 0===r?{}:r;qe()||l(!1);let{basename:o,navigator:a}=e.useContext(ze),{hash:i,pathname:s,search:c}=rt(t,{relative:n}),u=s;return"/"!==o&&(u="/"===s?o:B([o,s])),a.createHref({pathname:u,search:c,hash:i})}function qe(){return null!=e.useContext(We)}function Je(){return qe()||l(!1),e.useContext(We).location}function Ye(){return e.useContext(We).navigationType}function Ve(t){qe()||l(!1);let{pathname:r}=Je();return e.useMemo((()=>A(t,r)),[r,t])}function Xe(t){e.useContext(ze).static||e.useLayoutEffect(t)}function Ge(){let{isDataRoute:t}=e.useContext($e);return t?function(){let{router:t}=ht(ut.UseNavigateStable),r=pt(dt.UseNavigateStable),n=e.useRef(!1);return Xe((()=>{n.current=!0})),e.useCallback((function(e,o){void 0===o&&(o={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,Be({fromRouteId:r},o)))}),[t,r])}():function(){qe()||l(!1);let t=e.useContext(Fe),{basename:r,navigator:n}=e.useContext(ze),{matches:o}=e.useContext($e),{pathname:a}=Je(),i=JSON.stringify(_(o).map((e=>e.pathnameBase))),s=e.useRef(!1);return Xe((()=>{s.current=!0})),e.useCallback((function(e,o){if(void 0===o&&(o={}),!s.current)return;if("number"==typeof e)return void n.go(e);let l=O(e,JSON.parse(i),a,"path"===o.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:B([r,l.pathname])),(o.replace?n.replace:n.push)(l,o.state,o)}),[r,n,i,a,t])}()}const Qe=e.createContext(null);function Ze(){return e.useContext(Qe)}function et(t){let r=e.useContext($e).outlet;return r?e.createElement(Qe.Provider,{value:t},r):r}function tt(){let{matches:t}=e.useContext($e),r=t[t.length-1];return r?r.params:{}}function rt(t,r){let{relative:n}=void 0===r?{}:r,{matches:o}=e.useContext($e),{pathname:a}=Je(),i=JSON.stringify(_(o).map((e=>e.pathnameBase)));return e.useMemo((()=>O(t,JSON.parse(i),a,"path"===n)),[t,i,a,n])}function nt(e,t){return ot(e,t)}function ot(t,n,o){qe()||l(!1);let{navigator:a}=e.useContext(ze),{matches:i}=e.useContext($e),s=i[i.length-1],c=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let d,f=Je();if(n){var p;let e="string"==typeof n?h(n):n;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||l(!1),d=e}else d=f;let m=d.pathname||"/",v=y(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),g=ct(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:B([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:B([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,o);return n&&g?e.createElement(We.Provider,{value:{location:Be({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},g):g}function at(){let t=Rt(),r=V(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={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:o},n):null,null)}const it=e.createElement(at,null);class lt 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: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 this.state.error?e.createElement($e.Provider,{value:this.props.routeContext},e.createElement(Ke.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function st(t){let{routeContext:r,match:n,children:o}=t,a=e.useContext(Fe);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement($e.Provider,{value:r},o)}function ct(t,r,n){var o;if(void 0===r&&(r=[]),void 0===n&&(n=null),null==t){var a;if(null==(a=n)||!a.errors)return null;t=n.matches}let i=t,s=null==(o=n)?void 0:o.errors;if(null!=s){let e=i.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||l(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((t,o,a)=>{let l=o.route.id?null==s?void 0:s[o.route.id]:null,c=null;n&&(c=o.route.errorElement||it);let u=r.concat(i.slice(0,a+1)),d=()=>{let r;return r=l?c:o.route.Component?e.createElement(o.route.Component,null):o.route.element?o.route.element:t,e.createElement(st,{match:o,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?e.createElement(lt,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var ut=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ut||{}),dt=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}(dt||{});function ht(t){let r=e.useContext(Fe);return r||l(!1),r}function ft(t){let r=e.useContext(Ne);return r||l(!1),r}function pt(t){let r=function(t){let r=e.useContext($e);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function mt(){return pt(dt.UseRouteId)}function vt(){return ft(dt.UseNavigation).navigation}function yt(){let t=ht(ut.UseRevalidator),r=ft(dt.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function gt(){let{matches:t,loaderData:r}=ft(dt.UseMatches);return e.useMemo((()=>t.map((e=>{let{pathname:t,params:n}=e;return{id:e.route.id,pathname:t,params:n,data:r[e.route.id],handle:e.route.handle}}))),[t,r])}function bt(){let e=ft(dt.UseLoaderData),t=pt(dt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function wt(e){return ft(dt.UseRouteLoaderData).loaderData[e]}function Et(){let t=ft(dt.UseActionData);return e.useContext($e)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function Rt(){var t;let r=e.useContext(Ke),n=ft(dt.UseRouteError),o=pt(dt.UseRouteError);return r||(null==(t=n.errors)?void 0:t[o])}function xt(){let t=e.useContext(Ie);return null==t?void 0:t._data}function St(){let t=e.useContext(Ie);return null==t?void 0:t._error}let Dt=0;function Ct(t){let{router:r,basename:n}=ht(ut.UseBlocker),o=ft(dt.UseBlocker),[a,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:o,historyAction:a}=e;return t({currentLocation:Be({},r,{pathname:M(r.pathname,n)||r.pathname}),nextLocation:Be({},o,{pathname:M(o.pathname,n)||o.pathname}),historyAction:a})}),[n,t]);return e.useEffect((()=>{let e=String(++Dt);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==a&&r.getBlocker(a,l)}),[r,a,l]),a&&o.blockers.has(a)?o.blockers.get(a):oe}const kt=e.startTransition;function Pt(t){let{fallbackElement:r,router:n,future:o}=t,[a,i]=e.useState(n.state),{v7_startTransition:l}=o||{},s=e.useCallback((e=>{l&&kt?kt((()=>i(e))):i(e)}),[i,l]);e.useLayoutEffect((()=>n.subscribe(s)),[n,s]);let c=e.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),u=n.basename||"/",d=e.useMemo((()=>({router:n,navigator:c,static:!1,basename:u})),[n,c,u]);return e.createElement(e.Fragment,null,e.createElement(Fe.Provider,{value:d},e.createElement(Ne.Provider,{value:a},e.createElement(Tt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:c},a.initialized?e.createElement(Lt,{routes:n.routes,state:a}):r))),null)}function Lt(e){let{routes:t,state:r}=e;return ot(t,void 0,r)}function At(t){let{basename:r,children:n,initialEntries:a,initialIndex:i,future:l}=t,s=e.useRef();null==s.current&&(s.current=o({initialEntries:a,initialIndex:i,v5Compat:!0}));let c=s.current,[u,d]=e.useState({action:c.action,location:c.location}),{v7_startTransition:h}=l||{},f=e.useCallback((e=>{h&&kt?kt((()=>d(e))):d(e)}),[d,h]);return e.useLayoutEffect((()=>c.listen(f)),[c,f]),e.createElement(Tt,{basename:r,children:n,location:u.location,navigationType:u.action,navigator:c})}function Ut(t){let{to:r,replace:n,state:o,relative:a}=t;qe()||l(!1);let{matches:i}=e.useContext($e),{pathname:s}=Je(),c=Ge(),u=O(r,_(i).map((e=>e.pathnameBase)),s,"path"===a),d=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(d),{replace:n,state:o,relative:a})),[c,d,a,n,o]),null}function Mt(e){return et(e.context)}function jt(e){l(!1)}function Tt(t){let{basename:n="/",children:o=null,location:a,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;qe()&&l(!1);let u=n.replace(/^\/*/,"/"),d=e.useMemo((()=>({basename:u,navigator:s,static:c})),[u,s,c]);"string"==typeof a&&(a=h(a));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:y="default"}=a,g=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:y},navigationType:i}}),[u,f,p,m,v,y,i]);return null==g?null:e.createElement(ze.Provider,{value:d},e.createElement(We.Provider,{children:o,value:g}))}function _t(e){let{children:t,location:r}=e;return nt(zt(t),r)}function Ot(t){let{children:r,errorElement:n,resolve:o}=t;return e.createElement(Nt,{resolve:o,errorElement:n},e.createElement(It,null,r))}var Bt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Bt||{});const Ft=new Promise((()=>{}));class Nt 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,o=null,a=Bt.pending;if(n instanceof Promise)if(this.state.error){a=Bt.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,a=void 0!==o._error?Bt.error:void 0!==o._data?Bt.success:Bt.pending):(a=Bt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else a=Bt.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(a===Bt.error&&o._error instanceof W)throw Ft;if(a===Bt.error&&!r)throw o._error;if(a===Bt.error)return e.createElement(Ie.Provider,{value:o,children:r});if(a===Bt.success)return e.createElement(Ie.Provider,{value:o,children:t});throw o}}function It(t){let{children:r}=t,n=xt(),o="function"==typeof r?r(n):r;return e.createElement(e.Fragment,null,o)}function zt(t,r){void 0===r&&(r=[]);let n=[];return e.Children.forEach(t,((t,o)=>{if(!e.isValidElement(t))return;let a=[...r,o];if(t.type===e.Fragment)return void n.push.apply(n,zt(t.props.children,a));t.type!==jt&&l(!1),t.props.index&&t.props.children&&l(!1);let i={id:t.props.id||a.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: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=zt(t.props.children,a)),n.push(i)})),n}function Wt(e){return ct(e)}function $t(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.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Kt(e,t){return le({basename:null==t?void 0:t.basename,future:Be({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:o({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:$t}).initialize()}
23
23
  /**
24
- * React Router DOM v6.14.2
24
+ * React Router DOM v6.15.0
25
25
  *
26
26
  * Copyright (c) Remix Software Inc.
27
27
  *
@@ -29,5 +29,5 @@ import*as e from"react";
29
29
  * LICENSE.md file in the root directory of this source tree.
30
30
  *
31
31
  * @license MIT
32
- */function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kt.apply(this,arguments)}function Ht(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const qt="get",Jt="application/x-www-form-urlencoded";function Yt(e){return null!=e&&"string"==typeof e.tagName}function Vt(e){return void 0===e&&(e=""),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 Xt=null;const Gt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qt(e){return null==e||Gt.has(e)?e:null}function Zt(e,t){let r,n,o,a,i;if(Yt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?M(i,t):null,r=e.getAttribute("method")||qt,o=Qt(e.getAttribute("enctype"))||Jt,a=new FormData(e)}else if(function(e){return Yt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Yt(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 l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?M(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||qt,o=Qt(e.getAttribute("formenctype"))||Qt(i.getAttribute("enctype"))||Jt,a=new FormData(i,e),!function(){if(null===Xt)try{new FormData(document.createElement("form"),0),Xt=!1}catch(e){Xt=!0}return Xt}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";a.append(e+"x","0"),a.append(e+"y","0")}else t&&a.append(t,n)}}else{if(Yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=qt,n=null,o=Jt,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}const er=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],tr=["aria-current","caseSensitive","className","end","style","to","children"],rr=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset"];function nr(e,t){return ie({basename:null==t?void 0:t.basename,future:Kt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:a({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ar(),routes:e,mapRouteProperties:Wt}).initialize()}function or(e,t){return ie({basename:null==t?void 0:t.basename,future:Kt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:i({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ar(),routes:e,mapRouteProperties:Wt}).initialize()}function ar(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Kt({},t,{errors:ir(t.errors)})),t}function ir(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new J(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let o=new t(n.message);o.stack="",r[e]=o}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const lr=e.startTransition;function sr(t){let{basename:r,children:n,future:o,window:i}=t,l=e.useRef();null==l.current&&(l.current=a({window:i,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&lr?lr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function cr(t){let{basename:r,children:n,future:o,window:a}=t,l=e.useRef();null==l.current&&(l.current=i({window:a,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&lr?lr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function ur(t){let{basename:r,children:n,future:o,history:a}=t,[i,l]=e.useState({action:a.action,location:a.location}),{v7_startTransition:s}=o||{},c=e.useCallback((e=>{s&&lr?lr((()=>l(e))):l(e)}),[l,s]);return e.useLayoutEffect((()=>a.listen(c)),[a,c]),e.createElement(jt,{basename:r,children:n,location:i.location,navigationType:i.action,navigator:a})}const dr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,hr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fr=e.forwardRef((function(t,r){let n,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d}=t,h=Ht(t,er),{basename:f}=e.useContext(Ie),p=!1;if("string"==typeof u&&hr.test(u)&&(n=u,dr))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=M(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}catch(e){}let m=Ke(u,{relative:a}),v=Rr(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:a});return e.createElement("a",Kt({},h,{href:n||m,onClick:p||i?o:function(e){o&&o(e),e.defaultPrevented||v(e)},ref:r,target:c}))})),pr=e.forwardRef((function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,children:c}=t,u=Ht(t,tr),d=tt(s,{relative:u.relative}),h=qe(),f=e.useContext(Fe),{navigator:p}=e.useContext(Ie),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;o||(v=v.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase());let g,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=y&&(y===m||!i&&y.startsWith(m)&&"/"===y.charAt(m.length)),E=b?n:void 0;g="function"==typeof a?a({isActive:b,isPending:w}):[a,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return e.createElement(fr,Kt({},u,{"aria-current":E,className:g,ref:r,style:R,to:s}),"function"==typeof c?c({isActive:b,isPending:w}):c)})),mr=e.forwardRef(((t,r)=>{let n=Dr();return e.createElement(vr,Kt({},t,{submit:n,ref:r}))})),vr=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:o,state:a,method:i=qt,action:l,onSubmit:s,submit:c,relative:u,preventScrollReset:d}=t,h=Ht(t,rr),f="get"===i.toLowerCase()?"get":"post",p=kr(l,{relative:u});return e.createElement("form",Kt({ref:r,method:f,action:p,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||i;c(t||e.currentTarget,{method:r,replace:o,state:a,relative:u,preventScrollReset:d})}},h))}));function yr(e){let{getKey:t,storageKey:r}=e;return jr({getKey:t,storageKey:r}),null}var gr,br;function wr(t){let r=e.useContext(Be);return r||l(!1),r}function Er(t){let r=e.useContext(Fe);return r||l(!1),r}function Rr(t,r){let{target:n,replace:o,state:a,preventScrollReset:i,relative:l}=void 0===r?{}:r,s=Xe(),c=qe(),u=tt(t,{relative:l});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,n)){e.preventDefault();let r=void 0!==o?o:d(c)===d(u);s(t,{replace:r,state:a,preventScrollReset:i,relative:l})}}),[c,s,u,o,a,n,t,i,l])}function xr(t){let r=e.useRef(Vt(t)),n=e.useRef(!1),o=qe(),a=e.useMemo((()=>function(e,t){let r=Vt(e);if(t)for(let e of t.keys())r.has(e)||t.getAll(e).forEach((t=>{r.append(e,t)}));return r}(o.search,n.current?null:r.current)),[o.search]),i=Xe(),l=e.useCallback(((e,t)=>{const r=Vt("function"==typeof e?e(a):e);n.current=!0,i("?"+r,t)}),[i,a]);return[a,l]}function Sr(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Dr(){let{router:t}=wr(gr.UseSubmit),{basename:r}=e.useContext(Ie),n=pt();return e.useCallback((function(e,o){void 0===o&&(o={}),Sr();let{action:a,method:i,encType:l,formData:s,body:c}=Zt(e,r);t.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n})}),[t,r,n])}function Cr(t,r){let{router:n}=wr(gr.UseSubmitFetcher),{basename:o}=e.useContext(Ie);return e.useCallback((function(e,a){void 0===a&&(a={}),Sr();let{action:i,method:s,encType:c,formData:u,body:d}=Zt(e,o);null==r&&l(!1),n.fetch(t,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||s,formEncType:a.encType||c})}),[n,o,t,r])}function kr(t,r){let{relative:n}=void 0===r?{}:r,{basename:o}=e.useContext(Ie),a=e.useContext(We);a||l(!1);let[i]=a.matches.slice(-1),s=Kt({},tt(t||".",{relative:n})),c=qe();if(null==t&&(s.search=c.search,s.hash=c.hash,i.route.index)){let e=new URLSearchParams(s.search);e.delete("index"),s.search=e.toString()?"?"+e.toString():""}return t&&"."!==t||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==o&&(s.pathname="/"===s.pathname?o:B([o,s.pathname])),d(s)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"}(gr||(gr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(br||(br={}));let Pr=0;function Lr(){var t;let{router:r}=wr(gr.UseFetcher),n=e.useContext(We);n||l(!1);let o=null==(t=n.matches[n.matches.length-1])?void 0:t.route.id;null==o&&l(!1);let[a]=e.useState((()=>String(++Pr))),[i]=e.useState((()=>(o||l(!1),function(t,r){return e.forwardRef(((n,o)=>{let a=Cr(t,r);return e.createElement(vr,Kt({},n,{ref:o,submit:a}))}))}(a,o)))),[s]=e.useState((()=>e=>{r||l(!1),o||l(!1),r.fetch(a,o,e)})),c=Cr(a,o),u=r.getFetcher(a),d=e.useMemo((()=>Kt({Form:i,submit:c,load:s},u)),[u,i,c,s]);return e.useEffect((()=>()=>{r?r.deleteFetcher(a):console.warn("No router available to clean up from useFetcher()")}),[r,a]),d}function Ar(){return[...Er(br.UseFetchers).fetchers.values()]}const Ur="react-router-scroll-positions";let Mr={};function jr(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:o}=wr(gr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Er(br.UseScrollRestoration),{basename:l}=e.useContext(Ie),s=qe(),c=yt(),u=mt();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=(r?r(s,c):null)||s.key;Mr[e]=window.scrollY}sessionStorage.setItem(n||Ur,JSON.stringify(Mr)),window.history.scrollRestoration="auto"}),[n,r,u.state,s,c])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||Ur);e&&(Mr=JSON.parse(e))}catch(e){}}),[n]),e.useLayoutEffect((()=>{let e=r&&"/"!==l?(e,t)=>r(Kt({},e,{pathname:M(e.pathname,l)||e.pathname}),t):r,t=null==o?void 0:o.enableScrollRestoration(Mr,(()=>window.scrollY),e);return()=>t&&t()}),[o,l,r]),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!==i&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,i]))}function Tr(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 _r(t){let{when:r,message:n}=t,o=Dt(r);e.useEffect((()=>{"blocked"!==o.state||r||o.reset()}),[o,r]),e.useEffect((()=>{if("blocked"===o.state){window.confirm(n)?setTimeout(o.proceed,0):o.reset()}}),[o,n])}export{W as AbortedDeferredError,_t as Await,sr as BrowserRouter,mr as Form,cr as HashRouter,fr as Link,Lt as MemoryRouter,pr as NavLink,At as Navigate,r as NavigationType,Ut as Outlet,Mt as Route,jt as Router,kt as RouterProvider,Tt as Routes,yr as ScrollRestoration,Be as UNSAFE_DataRouterContext,Fe as UNSAFE_DataRouterStateContext,ze as UNSAFE_LocationContext,Ie as UNSAFE_NavigationContext,We as UNSAFE_RouteContext,pt as UNSAFE_useRouteId,jr as UNSAFE_useScrollRestoration,nr as createBrowserRouter,or as createHashRouter,$t as createMemoryRouter,d as createPath,It as createRoutesFromChildren,It as createRoutesFromElements,Vt as createSearchParams,H as defer,L as generatePath,Y as isRouteErrorResponse,z as json,A as matchPath,y as matchRoutes,h as parsePath,q as redirect,zt as renderMatches,j as resolvePath,ur as unstable_HistoryRouter,Dt as unstable_useBlocker,_r as unstable_usePrompt,wt as useActionData,xt as useAsyncError,Rt as useAsyncValue,Tr as useBeforeUnload,Lr as useFetcher,Ar as useFetchers,kr as useFormAction,Ke as useHref,He as useInRouterContext,Rr as useLinkClickHandler,gt as useLoaderData,qe as useLocation,Ye as useMatch,yt as useMatches,Xe as useNavigate,mt as useNavigation,Je as useNavigationType,Ze as useOutlet,Qe as useOutletContext,et as useParams,tt as useResolvedPath,vt as useRevalidator,Et as useRouteError,bt as useRouteLoaderData,rt as useRoutes,xr as useSearchParams,Dr as useSubmit};
32
+ */function Ht(){return Ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ht.apply(this,arguments)}function qt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const Jt="get",Yt="application/x-www-form-urlencoded";function Vt(e){return null!=e&&"string"==typeof e.tagName}function Xt(e){return void 0===e&&(e=""),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 Gt=null;const Qt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zt(e){return null==e||Qt.has(e)?e:null}function er(e,t){let r,n,o,a,i;if(Vt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?M(i,t):null,r=e.getAttribute("method")||Jt,o=Zt(e.getAttribute("enctype"))||Yt,a=new FormData(e)}else if(function(e){return Vt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Vt(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 l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?M(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Jt,o=Zt(e.getAttribute("formenctype"))||Zt(i.getAttribute("enctype"))||Yt,a=new FormData(i,e),!function(){if(null===Gt)try{new FormData(document.createElement("form"),0),Gt=!1}catch(e){Gt=!0}return Gt}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";a.append(e+"x","0"),a.append(e+"y","0")}else t&&a.append(t,n)}}else{if(Vt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Jt,n=null,o=Yt,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}const tr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],rr=["aria-current","caseSensitive","className","end","style","to","children"],nr=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset"];function or(e,t){return le({basename:null==t?void 0:t.basename,future:Ht({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:a({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ir(),routes:e,mapRouteProperties:$t}).initialize()}function ar(e,t){return le({basename:null==t?void 0:t.basename,future:Ht({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:i({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ir(),routes:e,mapRouteProperties:$t}).initialize()}function ir(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ht({},t,{errors:lr(t.errors)})),t}function lr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new Y(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let o=new t(n.message);o.stack="",r[e]=o}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const sr=e.startTransition;function cr(t){let{basename:r,children:n,future:o,window:i}=t,l=e.useRef();null==l.current&&(l.current=a({window:i,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&sr?sr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(Tt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function ur(t){let{basename:r,children:n,future:o,window:a}=t,l=e.useRef();null==l.current&&(l.current=i({window:a,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&sr?sr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(Tt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function dr(t){let{basename:r,children:n,future:o,history:a}=t,[i,l]=e.useState({action:a.action,location:a.location}),{v7_startTransition:s}=o||{},c=e.useCallback((e=>{s&&sr?sr((()=>l(e))):l(e)}),[l,s]);return e.useLayoutEffect((()=>a.listen(c)),[a,c]),e.createElement(Tt,{basename:r,children:n,location:i.location,navigationType:i.action,navigator:a})}const hr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pr=e.forwardRef((function(t,r){let n,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d}=t,h=qt(t,tr),{basename:f}=e.useContext(ze),p=!1;if("string"==typeof u&&fr.test(u)&&(n=u,hr))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=M(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}catch(e){}let m=He(u,{relative:a}),v=xr(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:a});return e.createElement("a",Ht({},h,{href:n||m,onClick:p||i?o:function(e){o&&o(e),e.defaultPrevented||v(e)},ref:r,target:c}))})),mr=e.forwardRef((function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,children:c}=t,u=qt(t,rr),d=rt(s,{relative:u.relative}),h=Je(),f=e.useContext(Ne),{navigator:p}=e.useContext(ze),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;o||(v=v.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase());let g,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=y&&(y===m||!i&&y.startsWith(m)&&"/"===y.charAt(m.length)),E=b?n:void 0;g="function"==typeof a?a({isActive:b,isPending:w}):[a,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return e.createElement(pr,Ht({},u,{"aria-current":E,className:g,ref:r,style:R,to:s}),"function"==typeof c?c({isActive:b,isPending:w}):c)})),vr=e.forwardRef(((t,r)=>{let n=Cr();return e.createElement(yr,Ht({},t,{submit:n,ref:r}))})),yr=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:o,state:a,method:i=Jt,action:l,onSubmit:s,submit:c,relative:u,preventScrollReset:d}=t,h=qt(t,nr),f="get"===i.toLowerCase()?"get":"post",p=Pr(l,{relative:u});return e.createElement("form",Ht({ref:r,method:f,action:p,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||i;c(t||e.currentTarget,{method:r,replace:o,state:a,relative:u,preventScrollReset:d})}},h))}));function gr(e){let{getKey:t,storageKey:r}=e;return Tr({getKey:t,storageKey:r}),null}var br,wr;function Er(t){let r=e.useContext(Fe);return r||l(!1),r}function Rr(t){let r=e.useContext(Ne);return r||l(!1),r}function xr(t,r){let{target:n,replace:o,state:a,preventScrollReset:i,relative:l}=void 0===r?{}:r,s=Ge(),c=Je(),u=rt(t,{relative:l});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,n)){e.preventDefault();let r=void 0!==o?o:d(c)===d(u);s(t,{replace:r,state:a,preventScrollReset:i,relative:l})}}),[c,s,u,o,a,n,t,i,l])}function Sr(t){let r=e.useRef(Xt(t)),n=e.useRef(!1),o=Je(),a=e.useMemo((()=>function(e,t){let r=Xt(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(o.search,n.current?null:r.current)),[o.search]),i=Ge(),l=e.useCallback(((e,t)=>{const r=Xt("function"==typeof e?e(a):e);n.current=!0,i("?"+r,t)}),[i,a]);return[a,l]}function Dr(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Cr(){let{router:t}=Er(br.UseSubmit),{basename:r}=e.useContext(ze),n=mt();return e.useCallback((function(e,o){void 0===o&&(o={}),Dr();let{action:a,method:i,encType:l,formData:s,body:c}=er(e,r);t.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n})}),[t,r,n])}function kr(t,r){let{router:n}=Er(br.UseSubmitFetcher),{basename:o}=e.useContext(ze);return e.useCallback((function(e,a){void 0===a&&(a={}),Dr();let{action:i,method:s,encType:c,formData:u,body:d}=er(e,o);null==r&&l(!1),n.fetch(t,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||s,formEncType:a.encType||c})}),[n,o,t,r])}function Pr(t,r){let{relative:n}=void 0===r?{}:r,{basename:o}=e.useContext(ze),a=e.useContext($e);a||l(!1);let[i]=a.matches.slice(-1),s=Ht({},rt(t||".",{relative:n})),c=Je();if(null==t&&(s.search=c.search,i.route.index)){let e=new URLSearchParams(s.search);e.delete("index"),s.search=e.toString()?"?"+e.toString():""}return t&&"."!==t||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==o&&(s.pathname="/"===s.pathname?o:B([o,s.pathname])),d(s)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"}(br||(br={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(wr||(wr={}));let Lr=0;function Ar(){var t;let{router:r}=Er(br.UseFetcher),n=e.useContext($e);n||l(!1);let o=null==(t=n.matches[n.matches.length-1])?void 0:t.route.id;null==o&&l(!1);let[a]=e.useState((()=>String(++Lr))),[i]=e.useState((()=>(o||l(!1),function(t,r){return e.forwardRef(((n,o)=>{let a=kr(t,r);return e.createElement(yr,Ht({},n,{ref:o,submit:a}))}))}(a,o)))),[s]=e.useState((()=>e=>{r||l(!1),o||l(!1),r.fetch(a,o,e)})),c=kr(a,o),u=r.getFetcher(a),d=e.useMemo((()=>Ht({Form:i,submit:c,load:s},u)),[u,i,c,s]);return e.useEffect((()=>()=>{r?r.deleteFetcher(a):console.warn("No router available to clean up from useFetcher()")}),[r,a]),d}function Ur(){return[...Rr(wr.UseFetchers).fetchers.values()]}const Mr="react-router-scroll-positions";let jr={};function Tr(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:o}=Er(br.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Rr(wr.UseScrollRestoration),{basename:l}=e.useContext(ze),s=Je(),c=gt(),u=vt();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=(r?r(s,c):null)||s.key;jr[e]=window.scrollY}sessionStorage.setItem(n||Mr,JSON.stringify(jr)),window.history.scrollRestoration="auto"}),[n,r,u.state,s,c])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||Mr);e&&(jr=JSON.parse(e))}catch(e){}}),[n]),e.useLayoutEffect((()=>{let e=r&&"/"!==l?(e,t)=>r(Ht({},e,{pathname:M(e.pathname,l)||e.pathname}),t):r,t=null==o?void 0:o.enableScrollRestoration(jr,(()=>window.scrollY),e);return()=>t&&t()}),[o,l,r]),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!==i&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,i]))}function _r(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 Or(t){let{when:r,message:n}=t,o=Ct(r);e.useEffect((()=>{if("blocked"===o.state){window.confirm(n)?setTimeout(o.proceed,0):o.reset()}}),[o,n]),e.useEffect((()=>{"blocked"!==o.state||r||o.reset()}),[o,r])}export{W as AbortedDeferredError,Ot as Await,cr as BrowserRouter,vr as Form,ur as HashRouter,pr as Link,At as MemoryRouter,mr as NavLink,Ut as Navigate,r as NavigationType,Mt as Outlet,jt as Route,Tt as Router,Pt as RouterProvider,_t as Routes,gr as ScrollRestoration,Fe as UNSAFE_DataRouterContext,Ne as UNSAFE_DataRouterStateContext,We as UNSAFE_LocationContext,ze as UNSAFE_NavigationContext,$e as UNSAFE_RouteContext,mt as UNSAFE_useRouteId,Tr as UNSAFE_useScrollRestoration,or as createBrowserRouter,ar as createHashRouter,Kt as createMemoryRouter,d as createPath,zt as createRoutesFromChildren,zt as createRoutesFromElements,Xt as createSearchParams,H as defer,L as generatePath,V as isRouteErrorResponse,z as json,A as matchPath,y as matchRoutes,h as parsePath,q as redirect,J as redirectDocument,Wt as renderMatches,j as resolvePath,dr as unstable_HistoryRouter,Ct as unstable_useBlocker,Or as unstable_usePrompt,Et as useActionData,St as useAsyncError,xt as useAsyncValue,_r as useBeforeUnload,Ar as useFetcher,Ur as useFetchers,Pr as useFormAction,He as useHref,qe as useInRouterContext,xr as useLinkClickHandler,bt as useLoaderData,Je as useLocation,Ve as useMatch,gt as useMatches,Ge as useNavigate,vt as useNavigation,Ye as useNavigationType,et as useOutlet,Ze as useOutletContext,tt as useParams,rt as useResolvedPath,yt as useRevalidator,Rt as useRouteError,wt as useRouteLoaderData,nt as useRoutes,Sr as useSearchParams,Cr as useSubmit};
33
33
  //# sourceMappingURL=react-router-dom.production.min.js.map