o(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var s=[],c=[],d=1,f=null,h=3,p=!1,m=!1,v=!1,y="function"===typeof setTimeout?setTimeout:null,g="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)a(c);else{if(!(t.startTime<=e))break;a(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function S(e){if(v=!1,w(e),!m)if(null!==r(s))m=!0,N(k);else{var t=r(c);null!==t&&M(S,t.startTime-e)}}function k(e,n){m=!1,v&&(v=!1,g(R),R=-1),p=!0;var o=h;try{for(w(n),f=r(s);null!==f&&(!(f.expirationTime>n)||e&&!O());){var i=f.callback;if("function"===typeof i){f.callback=null,h=f.priorityLevel;var l=i(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof l?f.callback=l:f===r(s)&&a(s),w(n)}else a(s);f=r(s)}if(null!==f)var u=!0;else{var d=r(c);null!==d&&M(S,d.startTime-n),u=!1}return u}finally{f=null,h=o,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,C=null,R=-1,P=5,_=-1;function O(){return!(t.unstable_now()-_e||125i?(e.sortIndex=o,n(c,e),null===r(s)&&e===r(c)&&(v?(g(R),R=-1):v=!0,M(S,o-i))):(e.sortIndex=l,n(s,e),m||p||(m=!0,N(k))),e},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},853:(e,t,n)=>{e.exports=n(234)},956:(e,t,n)=>{var r=n(43);var a="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},o=r.useState,i=r.useEffect,l=r.useLayoutEffect,u=r.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(r){return!0}}var c="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),a=r[0].inst,c=r[1];return l((function(){a.value=n,a.getSnapshot=t,s(a)&&c({inst:a})}),[e,n,t]),i((function(){return s(a)&&c({inst:a}),e((function(){s(a)&&c({inst:a})}))}),[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},461:(e,t,n)=>{e.exports=n(956)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.m=e,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+".cfa91f5e.chunk.js",n.miniCssF=e=>{},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="scorecard-visualizer:";n.l=(r,a,o,i)=>{if(e[r])e[r].push(a);else{var l,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),c=0;c{l.onerror=l.onload=null,clearTimeout(h);var a=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),t)return t(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),u&&document.head.appendChild(l)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/scorecard-visualizer/",(()=>{var e={792:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var o=new Promise(((n,r)=>a=e[t]=[n,r]));r.push(a[2]=o);var i=n.p+n.u(t),l=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,a[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var a,o,i=r[0],l=r[1],u=r[2],s=0;if(i.some((t=>0!==e[t]))){for(a in l)n.o(l,a)&&(n.m[a]=l[a]);if(u)u(n)}for(t&&t(r);s{throw TypeError(e)},b=(e,t,n)=>(((e,t,n)=>{t.has(e)||g("Cannot "+n)})(e,t,"read from private field"),n?n.call(e):t.get(e)),w="popstate";function S(){return _((function(e,t){let{pathname:n="/",search:r="",hash:a=""}=P(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),C("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"===typeof t?t:R(t))}),(function(e,t){x("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push(".concat(JSON.stringify(t),")"))}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function k(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function x(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function E(e,t){return{usr:e.state,key:e.key,idx:t}}function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return c(c({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?P(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)})}function R(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function P(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:a=document.defaultView,v5Compat:o=!1}=r,i=a.history,l="POP",u=null,s=d();function d(){return(i.state||{idx:null}).idx}function f(){l="POP";let e=d(),t=null==e?null:e-s;s=e,u&&u({action:l,location:p.location,delta:t})}function h(e){return O(e)}null==s&&(s=0,i.replaceState(c(c({},i.state),{},{idx:s}),""));let p={get action(){return l},get location(){return e(a,i)},listen(e){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(w,f),u=e,()=>{a.removeEventListener(w,f),u=null}},createHref:e=>t(a,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let r=C(p.location,e,t);n&&n(r,e),s=d()+1;let c=E(r,s),f=p.createHref(r);try{i.pushState(c,"",f)}catch(h){if(h instanceof DOMException&&"DataCloneError"===h.name)throw h;a.location.assign(f)}o&&u&&u({action:l,location:p.location,delta:1})},replace:function(e,t){l="REPLACE";let r=C(p.location,e,t);n&&n(r,e),s=d();let a=E(r,s),c=p.createHref(r);i.replaceState(a,"",c),o&&u&&u({action:l,location:p.location,delta:0})},go:e=>i.go(e)};return p}function O(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="http://localhost";"undefined"!==typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),k(n,"No window.location.(origin|href) available to create URL");let r="string"===typeof e?e:R(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var T=class{constructor(e){var t,n,r;if(t=this,n=y,r=new Map,n.has(t)?g("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),e)for(let[a,o]of e)this.set(a,o)}get(e){if(b(this,y).has(e))return b(this,y).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){b(this,y).set(e,t)}};y=new WeakMap;var L=new Set(["lazy","caseSensitive","path","id","index","children"]);var D=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function N(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.map(((e,a)=>{let o=[...n,String(a)],i="string"===typeof e.id?e.id:o.join("-");if(k(!0!==e.index||!e.children,"Cannot specify children on an index route"),k(!r[i],'Found a route id collision on id "'.concat(i,"\". Route id's must be globally unique within Data Router usages")),function(e){return!0===e.index}(e)){let n=c(c(c({},e),t(e)),{},{id:i});return r[i]=n,n}{let n=c(c(c({},e),t(e)),{},{id:i,children:void 0});return r[i]=n,e.children&&(n.children=N(e.children,t,o,r)),n}}))}function M(e,t){return j(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function j(e,t,n,r){let a=G(("string"===typeof t?P(t):t).pathname||"/",n);if(null==a)return null;let o=F(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let l=0;null==i&&l1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(k(i.relativePath.startsWith(r),'Absolute route path "'.concat(i.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),i.relativePath=i.relativePath.slice(r.length));let l=ne([r,i.relativePath]),u=n.concat(i);e.children&&e.children.length>0&&(k(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(l,'".')),F(e.children,t,u,l)),(null!=e.path||e.index)&&t.push({path:l,score:$(l,e.index),routesMeta:u})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of A(e.path))a(e,t,r);else a(e,t)})),t}function A(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let i=A(r.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}var I=/^:[\w-]+$/,U=3,q=2,H=1,Q=10,B=-2,W=e=>"*"===e;function $(e,t){let n=e.split("/"),r=n.length;return n.some(W)&&(r+=B),t&&(r+=q),n.filter((e=>!W(e))).reduce(((e,t)=>e+(I.test(t)?U:""===t?H:Q)),r)}function V(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,a={},o="/",i=[];for(let l=0;l{let{paramName:r,isOptional:a}=t;if("*"===r){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const u=l[n];return e[r]=a&&!u?void 0:(u||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function Y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];x("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function J(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return x(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function G(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function X(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.')}function Z(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function ee(e){let t=Z(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function te(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=P(e):(r=c({},e),k(!r.pathname||!r.pathname.includes("?"),X("?","pathname","search",r)),k(!r.pathname||!r.pathname.includes("#"),X("#","pathname","hash",r)),k(!r.search||!r.search.includes("#"),X("#","search","hash",r)));let o,i=""===e||""===r.pathname,l=i?"/":r.pathname;if(null==l)o=n;else{let e=t.length-1;if(!a&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:a=""}="string"===typeof e?P(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:ae(r),hash:oe(a)}}(r,o),s=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&n.endsWith("/");return u.pathname.endsWith("/")||!s&&!d||(u.pathname+="/"),u}var ne=e=>e.join("/").replace(/\/\/+/g,"/"),re=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ae=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",oe=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var ie=class{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function le(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var ue=["POST","PUT","PATCH","DELETE"],se=new Set(ue),ce=["GET",...ue],de=new Set(ce),fe=new Set([301,302,303,307,308]),he=new Set([307,308]),pe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ve={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ge=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),be="remix-router-transitions",we=Symbol("ResetLoaderData");function Se(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,n="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement;k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,a,o,i=e.hydrationRouteProperties||[],l=e.mapRouteProperties||ge,u={},s=N(e.routes,l,void 0,u),d=e.basename||"/",f=e.dataStrategy||Ne,h=c({unstable_middleware:!1},e.future),p=null,m=new Set,v=null,y=null,g=null,b=null!=e.hydrationData,w=M(s,e.history.location,d),S=!1,E=null;if(null!=w||e.patchRoutesOnNavigation){if(w&&!e.hydrationData){ze(w,s,e.history.location.pathname).active&&(w=null)}if(w)if(w.some((e=>e.route.lazy)))a=!1;else if(w.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=w.findIndex((e=>void 0!==n[e.route.id]));a=w.slice(0,e+1).every((e=>!Ce(e.route,t,n)))}else a=w.every((e=>!Ce(e.route,t,n)))}else a=!0;else{a=!1,w=[];let t=ze(null,s,e.history.location.pathname);t.active&&t.matches&&(S=!0,w=t.matches)}}else{let t=Xe(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Ge(s);a=!0,w=n,E={[r.id]:t}}let R,P,_={historyAction:e.history.action,location:e.history.location,matches:w,initialized:a,navigation:pe,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||E,fetchers:new Map,blockers:new Map},L="POP",D=!1,F=!1,A=new Map,I=null,U=!1,q=!1,H=new Set,Q=new Map,B=0,W=-1,$=new Map,V=new Set,K=new Map,Y=new Map,J=new Set,X=new Map,Z=null;function ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_=c(c({},_),e);let n=[],r=[];_.fetchers.forEach(((e,t)=>{"idle"===e.state&&(J.has(t)?n.push(t):r.push(t))})),J.forEach((e=>{_.fetchers.has(e)||Q.has(e)||n.push(e)})),[...m].forEach((e=>e(_,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>fe(e))),r.forEach((e=>_.fetchers.delete(e)))}function te(t,n){var a,o,i;let l,{flushSync:u}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=null!=_.actionData&&null!=_.navigation.formMethod&<(_.navigation.formMethod)&&"loading"===_.navigation.state&&!0!==(null===(a=t.state)||void 0===a?void 0:a._isRedirect);l=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?_.actionData:null;let f=n.loaderData?Ke(_.loaderData,n.loaderData,n.matches||[],n.errors):_.loaderData,h=_.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,ve))));let p,m=!0===D||null!=_.navigation.formMethod&<(_.navigation.formMethod)&&!0!==(null===(o=t.state)||void 0===o?void 0:o._isRedirect);if(r&&(s=r,r=void 0),U||"POP"===L||("PUSH"===L?e.history.push(t,t.state):"REPLACE"===L&&e.history.replace(t,t.state)),"POP"===L){let e=A.get(_.location.pathname);e&&e.has(t.pathname)?p={currentLocation:_.location,nextLocation:t}:A.has(t.pathname)&&(p={currentLocation:t,nextLocation:_.location})}else if(F){let e=A.get(_.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(_.location.pathname,e)),p={currentLocation:_.location,nextLocation:t}}ee(c(c({},n),{},{actionData:l,loaderData:f,historyAction:L,location:t,initialized:!0,navigation:pe,revalidation:"idle",restoreScrollPosition:je(t,n.matches||_.matches),preventScrollReset:m,blockers:h}),{viewTransitionOpts:p,flushSync:!0===u}),L="POP",D=!1,F=!1,U=!1,q=!1,null===(i=Z)||void 0===i||i.resolve(),Z=null}async function ne(t,n,a){R&&R.abort(),R=null,L=t,U=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(v&&g){let n=Me(e,t);v[n]=g()}}(_.location,_.matches),D=!0===(a&&a.preventScrollReset),F=!0===(a&&a.enableViewTransition);let o=r||s,f=a&&a.overrideNavigation,h=null!==a&&void 0!==a&&a.initialHydration&&_.matches&&_.matches.length>0&&!S?_.matches:M(o,n,d),p=!0===(a&&a.flushSync);if(h&&_.initialized&&!q&&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}(_.location,n)&&!(a&&a.submission&<(a.submission.formMethod)))return void te(n,{matches:h},{flushSync:p});let m=ze(h,o,n.pathname);if(m.active&&m.matches&&(h=m.matches),!h){let{error:e,notFoundMatches:t,route:r}=De(n.pathname);return void te(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:p})}R=new AbortController;let y,b=Qe(e.history,n,R.signal,a&&a.submission),w=new T(e.unstable_getContext?await e.unstable_getContext():void 0);if(a&&a.pendingError)y=[Je(h).route.id,{type:"error",error:a.pendingError}];else if(a&&a.submission&<(a.submission.formMethod)){let t=await async function(e,t,n,r,a,o,s){let c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};ue();let f,h=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(t,n);if(ee({navigation:h},{flushSync:!0===c.flushSync}),o){let n=await Fe(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let e=Je(n.partialMatches).route.id;return{matches:n.partialMatches,pendingActionResult:[e,{type:"error",error:n.error}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=De(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:n}]}}r=n.matches}let p=st(r,t);if(p.route.action||p.route.lazy){let t=Ae(l,u,e,r,p,s?[]:i,a),n=await oe(e,t,a,null);if(f=n[p.route.id],!f)for(let e of r)if(n[e.route.id]){f=n[e.route.id];break}if(e.signal.aborted)return{shortCircuited:!0}}else f={type:"error",error:Xe(405,{method:e.method,pathname:t.pathname,routeId:p.route.id})};if(rt(f)){let t;if(c&&null!=c.replace)t=c.replace;else{t=He(f.response.headers.get("Location"),new URL(e.url),d)===_.location.pathname+_.location.search}return await ae(e,f,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(nt(f)){let e=Je(r,p.route.id);return!0!==(c&&c.replace)&&(L="PUSH"),{matches:r,pendingActionResult:[e.route.id,f,p.route.id]}}return{matches:r,pendingActionResult:[p.route.id,f]}}(b,n,a.submission,h,w,m.active,a&&!0===a.initialHydration,{replace:a.replace,flushSync:p});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(nt(r)&&le(r.error)&&404===r.error.status)return R=null,void te(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}h=t.matches||h,y=t.pendingActionResult,f=dt(n,a.submission),p=!1,m.active=!1,b=Qe(e.history,b.url,b.signal)}let{shortCircuited:k,matches:x,loaderData:E,errors:C}=await async function(t,n,a,o,f,h,p,m,v,y,g,b){let w=h||dt(n,p),S=p||m||ct(w),k=!U&&!y;if(f){if(k){let e=re(b);ee(c({navigation:w},void 0!==e?{actionData:e}:{}),{flushSync:g})}let e=await Fe(a,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=Je(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=De(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}a=e.matches}let x=r||s,{dsMatches:E,revalidatingFetchers:C}=Ee(t,o,l,u,e.history,_,a,S,n,y?[]:i,!0===y,q,H,J,K,V,x,d,b);if(W=++B,!e.dataStrategy&&!E.some((e=>e.shouldLoad))&&0===C.length){let e=Re();return te(n,c(c({matches:a,loaderData:{},errors:b&&nt(b[1])?{[b[0]]:b[1].error}:null},Ye(b)),e?{fetchers:new Map(_.fetchers)}:{}),{flushSync:g}),{shortCircuited:!0}}if(k){let e={};if(!f){e.navigation=w;let t=re(b);void 0!==t&&(e.actionData=t)}C.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=_.fetchers.get(e.key),n=ft(void 0,t?t.data:void 0);_.fetchers.set(e.key,n)})),new Map(_.fetchers)}(C)),ee(e,{flushSync:g})}C.forEach((e=>{we(e.key),e.controller&&Q.set(e.key,e.controller)}));let P=()=>C.forEach((e=>we(e.key)));R&&R.signal.addEventListener("abort",P);let{loaderResults:O,fetcherResults:T}=await ie(E,C,t,o);if(t.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",P);C.forEach((e=>Q.delete(e.key)));let L=Ze(O);if(L)return await ae(t,L.result,!0,{replace:v}),{shortCircuited:!0};if(L=Ze(T),L)return V.add(L.key),await ae(t,L.result,!0,{replace:v}),{shortCircuited:!0};let{loaderData:D,errors:N}=Ve(_,a,O,b,C,T);y&&_.errors&&(N=c(c({},_.errors),N));let M=Re(),j=_e(W),z=M||j||C.length>0;return c({matches:a,loaderData:D,errors:N},z?{fetchers:new Map(_.fetchers)}:{})}(b,n,h,w,m.active,f,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,p,y);k||(R=null,te(n,c(c({matches:x||h},Ye(y)),{},{loaderData:E,errors:C})))}function re(e){return e&&!nt(e[1])?{[e[0]]:e[1].data}:_.actionData?0===Object.keys(_.actionData).length?null:_.actionData:void 0}async function ae(e,r,a){let{submission:o,fetcherSubmission:i,preventScrollReset:l,replace:u}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r.response.headers.has("X-Remix-Revalidate")&&(q=!0);let s=r.response.headers.get("Location");k(s,"Expected a Location header on the redirect Response"),s=He(s,new URL(e.url),d);let f=C(_.location,s,{_isRedirect:!0});if(n){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(ye.test(s)){const n=O(s,!0);e=n.origin!==t.location.origin||null==G(n.pathname,d)}if(e)return void(u?t.location.replace(s):t.location.assign(s))}R=null;let h=!0===u||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:p,formAction:m,formEncType:v}=_.navigation;!o&&!i&&p&&m&&v&&(o=ct(_.navigation));let y=o||i;if(he.has(r.response.status)&&y&<(y.formMethod))await ne(h,f,{submission:c(c({},y),{},{formAction:s}),preventScrollReset:l||D,enableViewTransition:a?F:void 0});else{let e=dt(f,o);await ne(h,f,{overrideNavigation:e,fetcherSubmission:i,preventScrollReset:l||D,enableViewTransition:a?F:void 0})}}async function oe(e,t,n,r){let a,o={};try{a=await Ie(f,e,t,r,n,!1)}catch(i){return t.filter((e=>e.shouldLoad)).forEach((e=>{o[e.route.id]={type:"error",error:i}})),o}if(e.signal.aborted)return o;for(let[l,u]of Object.entries(a))if(tt(u)){let n=u.result;o[l]={type:"redirect",response:qe(n,e,l,t,d)}}else o[l]=await Ue(u);return o}async function ie(e,t,n,r){let a=oe(n,e,r,null),o=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await oe(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:Xe(404,{pathname:e.path})}})})));return{loaderResults:await a,fetcherResults:(await o).reduce(((e,t)=>Object.assign(e,t)),{})}}function ue(){q=!0,K.forEach(((e,t)=>{Q.has(t)&&H.add(t),we(t)}))}function se(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_.fetchers.set(e,t),ee({fetchers:new Map(_.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ce(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=Je(_.matches,t);fe(e),ee({errors:{[a.route.id]:n},fetchers:new Map(_.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function de(e){return Y.set(e,(Y.get(e)||0)+1),J.has(e)&&J.delete(e),_.fetchers.get(e)||me}function fe(e){let t=_.fetchers.get(e);!Q.has(e)||t&&"loading"===t.state&&$.has(e)||we(e),K.delete(e),$.delete(e),V.delete(e),J.delete(e),H.delete(e),_.fetchers.delete(e)}function we(e){let t=Q.get(e);t&&(t.abort(),Q.delete(e))}function Se(e){for(let t of e){let e=ht(de(t).data);_.fetchers.set(t,e)}}function Re(){let e=[],t=!1;for(let n of V){let r=_.fetchers.get(n);k(r,"Expected fetcher: ".concat(n)),"loading"===r.state&&(V.delete(n),e.push(n),t=!0)}return Se(e),t}function _e(e){let t=[];for(let[n,r]of $)if(r0}function Oe(e){_.blockers.delete(e),X.delete(e)}function Te(e,t){let n=_.blockers.get(e)||ve;k("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: ".concat(n.state," -> ").concat(t.state));let r=new Map(_.blockers);r.set(e,t),ee({blockers:r})}function Le(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===X.size)return;X.size>1&&x(!1,"A router only supports one blocker at a time");let a=Array.from(X.entries()),[o,i]=a[a.length-1],l=_.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:n,historyAction:r})?o:void 0}function De(e){let t=Xe(404,{pathname:e}),n=r||s,{matches:a,route:o}=Ge(n);return{notFoundMatches:a,route:o,error:t}}function Me(e,t){if(y){return y(e,t.map((e=>z(e,_.loaderData))))||e.key}return e.key}function je(e,t){if(v){let n=Me(e,t),r=v[n];if("number"===typeof r)return r}return null}function ze(t,n,r){if(e.patchRoutesOnNavigation){if(!t){return{active:!0,matches:j(n,r,d,!0)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:j(n,r,d,!0)}}}return{active:!1,matches:null}}async function Fe(t,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let i=t;for(;;){let t=null==r,f=r||s,h=u;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||Pe(e,t,f,h,l)}})}catch(c){return{type:"error",error:c,partialMatches:i}}finally{t&&!a.aborted&&(s=[...s])}if(a.aborted)return{type:"aborted"};let p=M(f,n,d);if(p)return{type:"success",matches:p};let m=j(f,n,d,!0);if(!m||i.length===m.length&&i.every(((e,t)=>e.route.id===m[t].route.id)))return{type:"success",matches:null};i=m}}return o={get basename(){return d},get future(){return h},get state(){return _},get routes(){return s},get window(){return t},initialize:function(){if(p=e.history.listen((t=>{let{action:n,location:r,delta:a}=t;if(P)return P(),void(P=void 0);x(0===X.size||null!=a,"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 o=Le({currentLocation:_.location,nextLocation:r,historyAction:n});if(o&&null!=a){let t=new Promise((e=>{P=e}));return e.history.go(-1*a),void Te(o,{state:"blocked",location:r,proceed(){Te(o,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then((()=>e.history.go(a)))},reset(){let e=new Map(_.blockers);e.set(o,ve),ee({blockers:e})}})}return ne(n,r)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(be);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(n){}}(t,A);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(be,JSON.stringify(r))}catch(n){x(!1,"Failed to save applied view transitions in sessionStorage (".concat(n,")."))}}}(t,A);t.addEventListener("pagehide",e),I=()=>t.removeEventListener("pagehide",e)}return _.initialized||ne("POP",_.location,{initialHydration:!0}),o},subscribe:function(e){return m.add(e),()=>m.delete(e)},enableScrollRestoration:function(e,t,n){if(v=e,g=t,y=n||null,!b&&_.navigation===pe){b=!0;let e=je(_.location,_.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{v=null,g=null,y=null}},navigate:async function t(n,r){if("number"===typeof n)return void e.history.go(n);let a=ke(_.location,_.matches,d,n,null===r||void 0===r?void 0:r.fromRouteId,null===r||void 0===r?void 0:r.relative),{path:o,submission:i,error:l}=xe(!1,a,r),u=_.location,s=C(_.location,o,r&&r.state);s=c(c({},s),e.history.encodeLocation(s));let f=r&&null!=r.replace?r.replace:void 0,h="PUSH";!0===f?h="REPLACE":!1===f||null!=i&<(i.formMethod)&&i.formAction===_.location.pathname+_.location.search&&(h="REPLACE");let p=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.flushSync),v=Le({currentLocation:u,nextLocation:s,historyAction:h});v?Te(v,{state:"blocked",location:s,proceed(){Te(v,{state:"proceeding",proceed:void 0,reset:void 0,location:s}),t(n,r)},reset(){let e=new Map(_.blockers);e.set(v,ve),ee({blockers:e})}}):await ne(h,s,{submission:i,pendingError:l,preventScrollReset:p,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:m})},fetch:async function(t,n,a,o){we(t);let c=!0===(o&&o.flushSync),f=r||s,h=ke(_.location,_.matches,d,a,n,null===o||void 0===o?void 0:o.relative),p=M(f,h,d),m=ze(p,f,h);if(m.active&&m.matches&&(p=m.matches),!p)return void ce(t,n,Xe(404,{pathname:h}),{flushSync:c});let{path:v,submission:y,error:g}=xe(!0,h,o);if(g)return void ce(t,n,g,{flushSync:c});let b=st(p,v),w=new T(e.unstable_getContext?await e.unstable_getContext():void 0),S=!0===(o&&o.preventScrollReset);y&<(y.formMethod)?await async function(t,n,a,o,c,f,h,p,m,v){function y(e){if(!e.route.action&&!e.route.lazy){let e=Xe(405,{method:v.formMethod,pathname:a,routeId:n});return ce(t,n,e,{flushSync:p}),!0}return!1}if(ue(),K.delete(t),!h&&y(o))return;let g=_.fetchers.get(t);se(t,function(e,t){let n={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};return n}(v,g),{flushSync:p});let b=new AbortController,w=Qe(e.history,a,b.signal,v);if(h){let e=await Fe(c,a,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ce(t,n,e.error,{flushSync:p});if(!e.matches)return void ce(t,n,Xe(404,{pathname:a}),{flushSync:p});if(y(o=st(c=e.matches,a)))return}Q.set(t,b);let S=B,x=Ae(l,u,w,c,o,i,f),E=await oe(w,x,f,t),C=E[o.route.id];if(w.signal.aborted)return void(Q.get(t)===b&&Q.delete(t));if(J.has(t)){if(rt(C)||nt(C))return void se(t,ht(void 0))}else{if(rt(C))return Q.delete(t),W>S?void se(t,ht(void 0)):(V.add(t),se(t,ft(v)),ae(w,C,!1,{fetcherSubmission:v,preventScrollReset:m}));if(nt(C))return void ce(t,n,C.error)}let P=_.navigation.location||_.location,O=Qe(e.history,P,b.signal),T=r||s,D="idle"!==_.navigation.state?M(T,_.navigation.location,d):_.matches;k(D,"Didn't find any matches after fetcher action");let N=++B;$.set(t,N);let j=ft(v,C.data);_.fetchers.set(t,j);let{dsMatches:z,revalidatingFetchers:F}=Ee(O,f,l,u,e.history,_,D,v,P,i,!1,q,H,J,K,V,T,d,[o.route.id,C]);F.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=_.fetchers.get(t),r=ft(void 0,n?n.data:void 0);_.fetchers.set(t,r),we(t),e.controller&&Q.set(t,e.controller)})),ee({fetchers:new Map(_.fetchers)});let A=()=>F.forEach((e=>we(e.key)));b.signal.addEventListener("abort",A);let{loaderResults:I,fetcherResults:U}=await ie(z,F,O,f);if(b.signal.aborted)return;if(b.signal.removeEventListener("abort",A),$.delete(t),Q.delete(t),F.forEach((e=>Q.delete(e.key))),_.fetchers.has(t)){let e=ht(C.data);_.fetchers.set(t,e)}let Y=Ze(I);if(Y)return ae(O,Y.result,!1,{preventScrollReset:m});if(Y=Ze(U),Y)return V.add(Y.key),ae(O,Y.result,!1,{preventScrollReset:m});let{loaderData:G,errors:X}=Ve(_,D,I,void 0,F,U);_e(N),"loading"===_.navigation.state&&N>W?(k(L,"Expected pending action"),R&&R.abort(),te(_.navigation.location,{matches:D,loaderData:G,errors:X,fetchers:new Map(_.fetchers)})):(ee({errors:X,loaderData:Ke(_.loaderData,G,D,X),fetchers:new Map(_.fetchers)}),q=!1)}(t,n,v,b,p,w,m.active,c,S,y):(K.set(t,{routeId:n,path:v}),await async function(t,n,r,a,o,s,c,d,f,h){let p=_.fetchers.get(t);se(t,ft(h,p?p.data:void 0),{flushSync:d});let m=new AbortController,v=Qe(e.history,r,m.signal);if(c){let e=await Fe(o,r,v.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ce(t,n,e.error,{flushSync:d});if(!e.matches)return void ce(t,n,Xe(404,{pathname:r}),{flushSync:d});a=st(o=e.matches,r)}Q.set(t,m);let y=B,g=Ae(l,u,v,o,a,i,s),b=await oe(v,g,s,t),w=b[a.route.id];Q.get(t)===m&&Q.delete(t);if(v.signal.aborted)return;if(J.has(t))return void se(t,ht(void 0));if(rt(w))return W>y?void se(t,ht(void 0)):(V.add(t),void await ae(v,w,!1,{preventScrollReset:f}));if(nt(w))return void ce(t,n,w.error);se(t,ht(w.data))}(t,n,v,b,p,w,m.active,c,S,y))},revalidate:function(){Z||(Z=function(){let e,t,n=new Promise(((r,a)=>{e=async e=>{r(e);try{await n}catch(t){}},t=async e=>{a(e);try{await n}catch(t){}}}));return{promise:n,resolve:e,reject:t}}()),ue(),ee({revalidation:"loading"});let e=Z.promise;return"submitting"===_.navigation.state?e:"idle"===_.navigation.state?(ne(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),e):(ne(L||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:!0===F}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:de,deleteFetcher:function(e){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),J.add(e)):Y.set(e,t),ee({fetchers:new Map(_.fetchers)})},dispose:function(){p&&p(),I&&I(),m.clear(),R&&R.abort(),_.fetchers.forEach(((e,t)=>fe(t))),_.blockers.forEach(((e,t)=>Oe(t)))},getBlocker:function(e,t){let n=_.blockers.get(e)||ve;return X.get(e)!==t&&X.set(e,t),n},deleteBlocker:Oe,patchRoutes:function(e,t){let n=null==r;Pe(e,t,r||s,u,l),n&&(s=[...s],ee({}))},_internalFetchControllers:Q,_internalSetRoutes:function(e){u={},r=N(e,l,void 0,u)}},o}function ke(e,t,n,r,a,o){let i,l;if(a){i=[];for(let e of t)if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let u=te(r||".",ee(i),G(e.pathname,n)||e.pathname,"path"===o);if(null==r&&(u.search=e.search,u.hash=e.hash),(null==r||""===r||"."===r)&&l){let e=ut(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();u.search=n?"?".concat(n):""}}return"/"!==n&&(u.pathname="/"===u.pathname?n:ne([n,u.pathname])),R(u)}function xe(e,t,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:t};if(n.formMethod&&!it(n.formMethod))return{path:t,error:Xe(405,{method:n.formMethod})};let r,a,o=()=>({path:t,error:Xe(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=et(t);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!lt(i))return o();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[n,r]=t;return"".concat(e).concat(n,"=").concat(r,"\n")}),""):String(n.body);return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!lt(i))return o();try{let e="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(c){return o()}}}if(k("function"===typeof FormData,"FormData is not available in this environment"),n.formData)r=Be(n.formData),a=n.formData;else if(n.body instanceof FormData)r=Be(n.body),a=n.body;else if(n.body instanceof URLSearchParams)r=n.body,a=We(r);else if(null==n.body)r=new URLSearchParams,a=new FormData;else try{r=new URLSearchParams(n.body),a=We(r)}catch(c){return o()}let u={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:a,json:void 0,text:void 0};if(lt(u.formMethod))return{path:t,submission:u};let s=P(t);return e&&s.search&&ut(s.search)&&r.append("index",""),s.search="?".concat(r),{path:R(s),submission:u}}function Ee(e,t,n,r,a,o,i,l,u,s,d,f,h,p,m,v,y,g,b){var w;let S,k=b?nt(b[1])?b[1].error:b[1].data:void 0,x=a.createURL(o.location),E=a.createURL(u);if(d&&o.errors){let e=Object.keys(o.errors)[0];S=i.findIndex((t=>t.route.id===e))}else if(b&&nt(b[1])){let e=b[0];S=i.findIndex((t=>t.route.id===e))-1}let C=b?b[1].statusCode:void 0,R=C&&C>=400,P=c(c({currentUrl:x,currentParams:(null===(w=o.matches[0])||void 0===w?void 0:w.params)||{},nextUrl:E,nextParams:i[0].params},l),{},{actionResult:k,actionStatus:C}),_=i.map(((a,i)=>{let{route:l}=a,u=null;if(null!=S&&i>S?u=!1:l.lazy?u=!0:null==l.loader?u=!1:d?u=Ce(l,o.loaderData,o.errors):function(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}(o.loaderData,o.matches[i],a)&&(u=!0),null!==u)return Fe(n,r,e,a,s,t,u);let h=!R&&(f||x.pathname+x.search===E.pathname+E.search||x.search!==E.search||function(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[i],a)),p=c(c({},P),{},{defaultShouldRevalidate:h}),m=Re(a,p);return Fe(n,r,e,a,s,t,m,p)})),O=[];return m.forEach(((e,l)=>{if(d||!i.some((t=>t.route.id===e.routeId))||p.has(l))return;let u=M(y,e.path,g);if(!u)return void O.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});if(v.has(l))return;let m=o.fetchers.get(l),b=st(u,e.path),w=new AbortController,S=Qe(a,e.path,w.signal),k=null;if(h.has(l))h.delete(l),k=Ae(n,r,S,u,b,s,t);else if(m&&"idle"!==m.state&&void 0===m.data)f&&(k=Ae(n,r,S,u,b,s,t));else{let e=c(c({},P),{},{defaultShouldRevalidate:!R&&f});Re(b,e)&&(k=Ae(n,r,S,u,b,s,t,e))}k&&O.push({key:l,routeId:e.routeId,path:e.path,matches:k,match:b,request:S,controller:w})})),{dsMatches:_,revalidatingFetchers:O}}function Ce(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=null!=t&&e.id in t,a=null!=n&&void 0!==n[e.id];return!(!r&&a)&&("function"===typeof e.loader&&!0===e.loader.hydrate||!r&&!a)}function Re(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"===typeof n)return n}return t.defaultShouldRevalidate}function Pe(e,t,n,r,a){var o;let i;if(e){let t=r[e];k(t,"No route found to patch children into: routeId = ".concat(e)),t.children||(t.children=[]),i=t.children}else i=n;let l=N(t.filter((e=>!i.some((t=>_e(e,t))))),a,[e||"_","patch",String((null===(o=i)||void 0===o?void 0:o.length)||"0")],r);i.push(...l)}function _e(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every(((e,n)=>{var r;return null===(r=t.children)||void 0===r?void 0:r.some((t=>_e(e,t)))})))}var Oe=new WeakMap,Te=e=>{let{key:t,route:n,manifest:r,mapRouteProperties:a}=e,o=r[n.id];if(k(o,"No route found in manifest"),!o.lazy||"object"!==typeof o.lazy)return;let i=o.lazy[t];if(!i)return;let l=Oe.get(o);l||(l={},Oe.set(o,l));let u=l[t];if(u)return u;let s=(async()=>{let e=function(e){return L.has(e)}(t),n=void 0!==o[t]&&"hasErrorBoundary"!==t;if(e)x(!e,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),l[t]=Promise.resolve();else if(n)x(!1,'Route "'.concat(o.id,'" has a static property "').concat(t,'" defined. The lazy property will be ignored.'));else{let e=await i();null!=e&&(Object.assign(o,{[t]:e}),Object.assign(o,a(o)))}"object"===typeof o.lazy&&(o.lazy[t]=void 0,Object.values(o.lazy).every((e=>void 0===e))&&(o.lazy=void 0))})();return l[t]=s,s},Le=new WeakMap;async function De(e){let t=e.matches.filter((e=>e.shouldLoad)),n={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{n[t[r].route.id]=e})),n}async function Ne(e){return e.matches.some((e=>e.route.unstable_middleware))?Me(e,!1,(()=>De(e)),((e,t)=>({[t]:{type:"error",result:e}}))):De(e)}async function Me(e,t,n,r){let{matches:a,request:o,params:i,context:l}=e,u={handlerResult:void 0};try{let e=a.flatMap((e=>e.route.unstable_middleware?e.route.unstable_middleware.map((t=>[e.route.id,t])):[])),r=await je({request:o,params:i,context:l},e,t,u,n);return t?r:u.handlerResult}catch(s){if(!u.middlewareError)throw s;let e=await r(u.middlewareError.error,u.middlewareError.routeId);return t||!u.handlerResult?e:Object.assign(u.handlerResult,e)}}async function je(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,{request:i}=e;if(i.signal.aborted){if(i.signal.reason)throw i.signal.reason;throw new Error("Request aborted without an `AbortSignal.reason`: ".concat(i.method," ").concat(i.url))}let l=t[o];if(!l)return r.handlerResult=await a(),r.handlerResult;let u,[s,c]=l,d=!1,f=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");d=!0;let i=await je(e,t,n,r,a,o+1);if(n)return u=i,u};try{let t=await c({request:e.request,params:e.params,context:e.context},f);return d?void 0===t?u:t:f()}catch(h){throw r.middlewareError?r.middlewareError.error!==h&&(r.middlewareError={routeId:s,error:h}):r.middlewareError={routeId:s,error:h},h}}function ze(e,t,n,r,a){let o=Te({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=function(e,t,n,r,a){var o;let i=n[e.id];if(k(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"===typeof e.lazy){let t=Le.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{k("function"===typeof e.lazy,"No lazy route function found");let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(void 0===r)continue;let o=(a=e,D.has(a)),l=void 0!==i[e]&&"hasErrorBoundary"!==e;o?x(!o,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):l?x(!l,'Route "'.concat(i.id,'" has a static property "').concat(e,'" defined but its lazy function is also returning a value for this property. The lazy route property "').concat(e,'" will be ignored.')):n[e]=r}var a;Object.assign(i,n),Object.assign(i,c(c({},r(i)),{},{lazy:void 0}))})();return Le.set(i,n),n.catch((()=>{})),{lazyRoutePromise:n,lazyHandlerPromise:n}}let l,u=Object.keys(e.lazy),s=[];for(let c of u){if(a&&a.includes(c))continue;let o=Te({key:c,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),c===t&&(l=o))}let d=s.length>0?Promise.all(s).then((()=>{})):void 0;return null===d||void 0===d||d.catch((()=>{})),null===(o=l)||void 0===o||o.catch((()=>{})),{lazyRoutePromise:d,lazyHandlerPromise:l}}(r.route,lt(n.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Fe(e,t,n,r,a,o,i){let l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,u=!1,s=ze(e,t,n,r,a);return c(c({},r),{},{_lazyPromises:s,shouldLoad:i,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:e=>(u=!0,l?Re(r,"boolean"===typeof e?c(c({},l),{},{defaultShouldRevalidate:e}):l):i),resolve:e=>u||i||e&&"GET"===n.method&&(r.route.lazy||r.route.loader)?async function(e){let t,n,{request:r,match:a,lazyHandlerPromise:o,lazyRoutePromise:i,handlerOverride:l,scopedContext:u}=e,s=lt(r.method),c=s?"action":"loader",d=e=>{let t,o=new Promise(((e,n)=>t=n));n=()=>t(),r.signal.addEventListener("abort",n);let i=t=>"function"!==typeof e?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'.concat(c,'" [routeId: ').concat(a.route.id,"]"))):e({request:r,params:a.params,context:u},...void 0!==t?[t]:[]),s=(async()=>{try{return{type:"data",result:await(l?l((e=>i(e))):i())}}catch(e){return{type:"error",result:e}}})();return Promise.race([s,o])};try{let e=s?a.route.action:a.route.loader;if(o||i)if(e){let n,[r]=await Promise.all([d(e).catch((e=>{n=e})),o,i]);if(void 0!==n)throw n;t=r}else{await o;let e=s?a.route.action:a.route.loader;if(!e){if("action"===c){let e=new URL(r.url),t=e.pathname+e.search;throw Xe(405,{method:r.method,pathname:t,routeId:a.route.id})}return{type:"data",result:void 0}}[t]=await Promise.all([d(e),i])}else{if(!e){let e=new URL(r.url);throw Xe(404,{pathname:e.pathname+e.search})}t=await d(e)}}catch(f){return{type:"error",result:f}}finally{n&&r.signal.removeEventListener("abort",n)}return t}({request:n,match:r,lazyHandlerPromise:null===s||void 0===s?void 0:s.handler,lazyRoutePromise:null===s||void 0===s?void 0:s.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:"data",result:void 0})})}function Ae(e,t,n,r,a,o,i){let l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;return r.map((r=>r.route.id!==a.route.id?c(c({},r),{},{shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:ze(e,t,n,r,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}):Fe(e,t,n,r,o,i,!0,l)))}async function Ie(e,t,n,r,a,o){n.some((e=>{var t;return null===(t=e._lazyPromises)||void 0===t?void 0:t.middleware}))&&await Promise.all(n.map((e=>{var t;return null===(t=e._lazyPromises)||void 0===t?void 0:t.middleware})));let i={request:t,params:n[0].params,context:a,matches:n},l=o?()=>{throw new Error("You cannot call `unstable_runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=i;return Me(t,!1,(()=>e(c(c({},t),{},{fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}))),((e,t)=>({[t]:{type:"error",result:e}})))},u=await e(c(c({},i),{},{fetcherKey:r,unstable_runClientMiddleware:l}));try{await Promise.all(n.flatMap((e=>{var t,n;return[null===(t=e._lazyPromises)||void 0===t?void 0:t.handler,null===(n=e._lazyPromises)||void 0===n?void 0:n.route]})))}catch(s){}return u}async function Ue(e){let{result:t,type:n}=e;if(ot(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(s){return{type:"error",error:s}}return"error"===n?{type:"error",error:new ie(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}var r,a,o,i,l,u;return"error"===n?at(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:null===(o=t.init)||void 0===o?void 0:o.status,headers:null!==(i=t.init)&&void 0!==i&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ie((null===(r=t.init)||void 0===r?void 0:r.status)||500,void 0,t.data),statusCode:le(t)?t.status:void 0,headers:null!==(a=t.init)&&void 0!==a&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:le(t)?t.status:void 0}:at(t)?{type:"data",data:t.data,statusCode:null===(l=t.init)||void 0===l?void 0:l.status,headers:null!==(u=t.init)&&void 0!==u&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function qe(e,t,n,r,a){let o=e.headers.get("Location");if(k(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ye.test(o)){let i=r.slice(0,r.findIndex((e=>e.route.id===n))+1);o=ke(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function He(e,t,n){if(ye.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=null!=G(a.pathname,n);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Qe(e,t,n,r){let a=e.createURL(et(t)).toString(),o={signal:n};if(r&<(r.formMethod)){let{formMethod:e,formEncType:t}=r;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(r.json)):"text/plain"===t?o.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?o.body=Be(r.formData):o.body=r.formData}return new Request(a,o)}function Be(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"===typeof r?r:r.name);return t}function We(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function $e(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={},l=null,u=!1,s={},c=n&&nt(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(k(!rt(f),"Cannot handle redirect results in processLoaderData"),nt(f)){let t=f.error;if(void 0!==c&&(t=c,c=void 0),l=l||{},o)l[d]=t;else{let n=Je(e,d);null==l[n.route.id]&&(l[n.route.id]=t)}a||(i[d]=we),u||(u=!0,r=le(f.error)?f.error.status:500),f.headers&&(s[d]=f.headers)}else i[d]=f.data,f.statusCode&&200!==f.statusCode&&!u&&(r=f.statusCode),f.headers&&(s[d]=f.headers)})),void 0!==c&&n&&(l={[n[0]]:c},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:l,statusCode:r||200,loaderHeaders:s}}function Ve(e,t,n,r,a,o){let{loaderData:i,errors:l}=$e(t,n,r);return a.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:n,match:r,controller:a}=t,i=o[n];if(k(i,"Did not find corresponding fetcher result"),!a||!a.signal.aborted)if(nt(i)){let t=Je(e.matches,null===r||void 0===r?void 0:r.route.id);l&&l[t.route.id]||(l=c(c({},l),{},{[t.route.id]:i.error})),e.fetchers.delete(n)}else if(rt(i))k(!1,"Unhandled fetcher revalidation redirect");else{let t=ht(i.data);e.fetchers.set(n,t)}})),{loaderData:i,errors:l}}function Ke(e,t,n,r){let a=Object.entries(t).filter((e=>{let[,t]=e;return t!==we})).reduce(((e,t)=>{let[n,r]=t;return e[n]=r,e}),{});for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(a[n]=e[n]),r&&r.hasOwnProperty(n))break}return a}function Ye(e){return e?nt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Je(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 Ge(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Xe(e){let{pathname:t,routeId:n,method:r,type:a,message:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",r&&t&&n?l="You made a ".concat(r,' request to "').concat(t,'" but did not provide a `loader` for route "').concat(n,'", so there is no way to handle the request.'):"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'.concat(n,'" does not match URL "').concat(t,'"')):404===e?(i="Not Found",l='No route matches URL "'.concat(t,'"')):405===e&&(i="Method Not Allowed",r&&t&&n?l="You made a ".concat(r.toUpperCase(),' request to "').concat(t,'" but did not provide an `action` for route "').concat(n,'", so there is no way to handle the request.'):r&&(l='Invalid request method "'.concat(r.toUpperCase(),'"'))),new ie(e||500,i,new Error(l),!0)}function Ze(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[e,r]=t[n];if(rt(r))return{key:e,result:r}}}function et(e){return R(c(c({},"string"===typeof e?P(e):e),{},{hash:""}))}function tt(e){return ot(e.result)&&fe.has(e.result.status)}function nt(e){return"error"===e.type}function rt(e){return"redirect"===(e&&e.type)}function at(e){return"object"===typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function ot(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function it(e){return de.has(e.toUpperCase())}function lt(e){return se.has(e.toUpperCase())}function ut(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function st(e,t){let n="string"===typeof t?P(t).search:t.search;if(e[e.length-1].route.index&&ut(n||""))return e[e.length-1];let r=Z(e);return r[r.length-1]}function ct(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:i}=e;if(t&&n&&r)return null!=a?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}:void 0}function dt(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 ft(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ht(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var pt=r.createContext(null);pt.displayName="DataRouter";var mt=r.createContext(null);mt.displayName="DataRouterState";var vt=r.createContext({isTransitioning:!1});vt.displayName="ViewTransition";var yt=r.createContext(new Map);yt.displayName="Fetchers";var gt=r.createContext(null);gt.displayName="Await";var bt=r.createContext(null);bt.displayName="Navigation";var wt=r.createContext(null);wt.displayName="Location";var St=r.createContext({outlet:null,matches:[],isDataRoute:!1});St.displayName="Route";var kt=r.createContext(null);kt.displayName="RouteError";function xt(){return null!=r.useContext(wt)}function Et(){return k(xt(),"useLocation() may be used only in the context of a component."),r.useContext(wt).location}var Ct="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rt(e){r.useContext(bt).static||r.useLayoutEffect(e)}function Pt(){let{isDataRoute:e}=r.useContext(St);return e?function(){let{router:e}=Ft("useNavigate"),t=It("useNavigate"),n=r.useRef(!1);Rt((()=>{n.current=!0}));let a=r.useCallback((async function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(n.current,Ct),n.current&&("number"===typeof r?e.navigate(r):await e.navigate(r,c({fromRouteId:t},a)))}),[e,t]);return a}():function(){k(xt(),"useNavigate() may be used only in the context of a component.");let e=r.useContext(pt),{basename:t,navigator:n}=r.useContext(bt),{matches:a}=r.useContext(St),{pathname:o}=Et(),i=JSON.stringify(ee(a)),l=r.useRef(!1);Rt((()=>{l.current=!0}));let u=r.useCallback((function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(x(l.current,Ct),!l.current)return;if("number"===typeof r)return void n.go(r);let u=te(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:ne([t,u.pathname])),(a.replace?n.replace:n.push)(u,a.state,a)}),[t,n,i,o,e]);return u}()}r.createContext(null);function _t(){let{matches:e}=r.useContext(St),t=e[e.length-1];return t?t.params:{}}function Ot(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:n}=r.useContext(St),{pathname:a}=Et(),o=JSON.stringify(ee(n));return r.useMemo((()=>te(e,JSON.parse(o),a,"path"===t)),[e,o,a,t])}function Tt(e,t,n,a){k(xt(),"useRoutes() may be used only in the context of a component.");let{navigator:o,static:i}=r.useContext(bt),{matches:l}=r.useContext(St),u=l[l.length-1],s=u?u.params:{},d=u?u.pathname:"/",f=u?u.pathnameBase:"/",h=u&&u.route;{let e=h&&h.path||"";Ht(d,!h||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant (or called `useRoutes()`) at "'.concat(d,'" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent to .'))}let p,m=Et();if(t){var v;let e="string"===typeof t?P(t):t;k("/"===f||(null===(v=e.pathname)||void 0===v?void 0:v.startsWith(f)),'When overriding the location using `` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(f,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),p=e}else p=m;let y=p.pathname||"/",g=y;if("/"!==f){let e=f.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=!i&&n&&n.matches&&n.matches.length>0?n.matches:M(e,{pathname:g});x(h||null!=b,'No routes matched location "'.concat(p.pathname).concat(p.search).concat(p.hash,'" ')),x(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,'Matched leaf route at location "'.concat(p.pathname).concat(p.search).concat(p.hash,'" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.'));let w=jt(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:ne([f,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:ne([f,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,a);return t&&w?r.createElement(wt.Provider,{value:{location:c({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:"POP"}},w):w}function Lt(){let e=Ut(),t=le(e)?"".concat(e.status," ").concat(e.statusText):e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=r.createElement(r.Fragment,null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",r.createElement("code",{style:i},"ErrorBoundary")," or"," ",r.createElement("code",{style:i},"errorElement")," prop on your route.")),r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:o},n):null,l)}var Dt=r.createElement(Lt,null),Nt=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(St.Provider,{value:this.props.routeContext},r.createElement(kt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Mt(e){let{routeContext:t,match:n,children:a}=e,o=r.useContext(pt);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(St.Provider,{value:t},a)}function jt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let a=e,o=null===n||void 0===n?void 0:n.errors;if(null!=o){let e=a.findIndex((e=>e.route.id&&void 0!==(null===o||void 0===o?void 0:o[e.route.id])));k(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(o).join(","))),a=a.slice(0,Math.min(a.length,e+1))}let i=!1,l=-1;if(n)for(let r=0;r=0?a.slice(0,l+1):[a[0]];break}}}return a.reduceRight(((e,u,s)=>{let c,d=!1,f=null,h=null;n&&(c=o&&u.route.id?o[u.route.id]:void 0,f=u.route.errorElement||Dt,i&&(l<0&&0===s?(Ht("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,h=null):l===s&&(d=!0,h=u.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,s+1)),m=()=>{let t;return t=c?f:d?h:u.route.Component?r.createElement(u.route.Component,null):u.route.element?u.route.element:e,r.createElement(Mt,{match:u,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(u.route.ErrorBoundary||u.route.errorElement||0===s)?r.createElement(Nt,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}function zt(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function Ft(e){let t=r.useContext(pt);return k(t,zt(e)),t}function At(e){let t=r.useContext(mt);return k(t,zt(e)),t}function It(e){let t=function(e){let t=r.useContext(St);return k(t,zt(e)),t}(e),n=t.matches[t.matches.length-1];return k(n.route.id,"".concat(e,' can only be used on routes that contain a unique "id"')),n.route.id}function Ut(){var e;let t=r.useContext(kt),n=At("useRouteError"),a=It("useRouteError");return void 0!==t?t:null===(e=n.errors)||void 0===e?void 0:e[a]}var qt={};function Ht(e,t,n){t||qt[e]||(qt[e]=!0,x(!1,n))}var Qt={};function Bt(e,t){e||Qt[t]||(Qt[t]=!0,console.warn(t))}function Wt(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&x(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&x(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:r.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&x(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var $t=["HydrateFallback","hydrateFallbackElement"];var Vt=class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}};function Kt(e){let{router:t,flushSync:n}=e,[a,o]=r.useState(t.state),[i,l]=r.useState(),[u,s]=r.useState({isTransitioning:!1}),[c,d]=r.useState(),[f,h]=r.useState(),[p,m]=r.useState(),v=r.useRef(new Map),y=r.useCallback(((e,a)=>{let{deletedFetchers:i,flushSync:u,viewTransitionOpts:p}=a;e.fetchers.forEach(((e,t)=>{void 0!==e.data&&v.current.set(t,e.data)})),i.forEach((e=>v.current.delete(e))),Bt(!1===u||null!=n,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=null!=t.window&&null!=t.window.document&&"function"===typeof t.window.document.startViewTransition;if(Bt(null==p||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),p&&y){if(n&&u){n((()=>{f&&(c&&c.resolve(),f.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:p.currentLocation,nextLocation:p.nextLocation})}));let r=t.window.document.startViewTransition((()=>{n((()=>o(e)))}));return r.finished.finally((()=>{n((()=>{d(void 0),h(void 0),l(void 0),s({isTransitioning:!1})}))})),void n((()=>h(r)))}f?(c&&c.resolve(),f.skipTransition(),m({state:e,currentLocation:p.currentLocation,nextLocation:p.nextLocation})):(l(e),s({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}))}else n&&u?n((()=>o(e))):r.startTransition((()=>o(e)))}),[t.window,n,f,c]);r.useLayoutEffect((()=>t.subscribe(y)),[t,y]),r.useEffect((()=>{u.isTransitioning&&!u.flushSync&&d(new Vt)}),[u]),r.useEffect((()=>{if(c&&i&&t.window){let e=i,n=c.promise,a=t.window.document.startViewTransition((async()=>{r.startTransition((()=>o(e))),await n}));a.finished.finally((()=>{d(void 0),h(void 0),l(void 0),s({isTransitioning:!1})})),h(a)}}),[i,c,t.window]),r.useEffect((()=>{c&&i&&a.location.key===i.location.key&&c.resolve()}),[c,f,a.location,i]),r.useEffect((()=>{!u.isTransitioning&&p&&(l(p.state),s({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),m(void 0))}),[u.isTransitioning,p]);let g=r.useMemo((()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:e=>t.navigate(e),push:(e,n,r)=>t.navigate(e,{state:n,preventScrollReset:null===r||void 0===r?void 0:r.preventScrollReset}),replace:(e,n,r)=>t.navigate(e,{replace:!0,state:n,preventScrollReset:null===r||void 0===r?void 0:r.preventScrollReset})})),[t]),b=t.basename||"/",w=r.useMemo((()=>({router:t,navigator:g,static:!1,basename:b})),[t,g,b]);return r.createElement(r.Fragment,null,r.createElement(pt.Provider,{value:w},r.createElement(mt.Provider,{value:a},r.createElement(yt.Provider,{value:v.current},r.createElement(vt.Provider,{value:u},r.createElement(Jt,{basename:b,location:a.location,navigationType:a.historyAction,navigator:g},r.createElement(Yt,{routes:t.routes,future:t.future,state:a})))))),null)}var Yt=r.memo((function(e){let{routes:t,future:n,state:r}=e;return Tt(t,void 0,r,n)}));function Jt(e){let{basename:t="/",children:n=null,location:a,navigationType:o="POP",navigator:i,static:l=!1}=e;k(!xt(),"You cannot render a inside another . You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),s=r.useMemo((()=>({basename:u,navigator:i,static:l,future:{}})),[u,i,l]);"string"===typeof a&&(a=P(a));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:p="default"}=a,m=r.useMemo((()=>{let e=G(c,u);return null==e?null:{location:{pathname:e,search:d,hash:f,state:h,key:p},navigationType:o}}),[u,c,d,f,h,p,o]);return x(null!=m,' is not able to match the URL "').concat(c).concat(d).concat(f,"\" because it does not start with the basename, so the won't render anything.")),null==m?null:r.createElement(bt.Provider,{value:s},r.createElement(wt.Provider,{children:n,value:m}))}r.Component;var Gt="get",Xt="application/x-www-form-urlencoded";function Zt(e){return null!=e&&"string"===typeof e.tagName}var en=null;var tn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nn(e){return null==e||tn.has(e)?e:(x(!1,'"'.concat(e,'" is not a valid `encType` for `