var vn=Object.defineProperty;var gn=(e,t,r)=>t in e?vn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var pt=(e,t,r)=>gn(e,typeof t!="symbol"?t+"":t,r);import{r as d}from"./CTjT7uj6.js";var wn=-1,En=-2,bn=-3,Rn=-4,Sn=-5,xn=-6,Ln=-7,Cn="B",Pn="D",ia="E",Mn="M",Dn="N",la="P",Tn="R",Fn="S",Nn="Y",On="U",kn="Z",sa=class{constructor(){pt(this,"promise");pt(this,"resolve");pt(this,"reject");this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}};function _n(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),o=(t+a).split(` `);t=o.pop()||"";for(const l of o)n.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ht=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function Gt(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Nr.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Nr.call(this,n)}function Nr(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case Ln:u(void 0);continue;case Sn:u(null);continue;case En:u(NaN);continue;case xn:u(1/0);continue;case bn:u(-1/0);continue;case Rn:u(-0);continue}if(t[i]){u(t[i]);continue}const c=r[i];if(!c||typeof c!="object"){t[i]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[h,y,v]=c;switch(h){case Pn:u(t[i]=new Date(y));continue;case On:u(t[i]=new URL(y));continue;case Cn:u(t[i]=BigInt(y));continue;case Tn:u(t[i]=new RegExp(y,v));continue;case Nn:u(t[i]=Symbol.for(y));continue;case Fn:const E=new Set;t[i]=E;for(let D=1;D{E.add(L)}]);u(E);continue;case Mn:const R=new Map;t[i]=R;for(let D=1;D{L[1]=m}]),l.push([c[D],m=>{L[0]=m}]),s.push(()=>{R.set(L[0],L[1])})}u(R);continue;case Dn:const w=Object.create(null);t[i]=w;for(const D of Object.keys(y).reverse()){const L=[];l.push([y[D],m=>{L[1]=m}]),l.push([Number(D.slice(1)),m=>{L[0]=m}]),s.push(()=>{w[L[0]]=L[1]})}u(w);continue;case la:if(t[y])u(t[i]=t[y]);else{const D=new sa;n[y]=D,u(t[i]=D.promise)}continue;case ia:const[,b,x]=c;let M=x&&Ht&&Ht[x]?new Ht[x](b):new Error(b);t[i]=M,u(M);continue;case kn:u(t[i]=t[y]);continue;default:if(Array.isArray(a)){const D=[],L=c.slice(1);for(let m=0;m{D[m]=U}])}s.push(()=>{for(const m of a){const T=m(c[0],...D);if(T){u(t[i]=T.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const h=[];t[i]=h;for(let y=0;y{h[y]=E}])}u(h);continue}else{const h={};t[i]=h;for(const y of Object.keys(c).reverse()){const v=[];l.push([c[y],E=>{v[1]=E}]),l.push([Number(y.slice(1)),E=>{v[0]=E}]),s.push(()=>{h[v[0]]=v[1]})}u(h);continue}}for(;s.length>0;)s.pop()();return o}async function An(e,t){const{plugins:r}=t??{},n=new sa,a=e.pipeThrough(_n()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await In.call(o,a);let s=n.promise;return l.done?n.resolve():s=$n.call(o,a).then(n.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);n.reject(i)}),{done:s.then(()=>a.closed),value:l.value}}async function In(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:Gt.call(this,r)}}async function $n(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case la:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const l=r.slice(n+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=Gt.call(this,s);o.resolve(i);break}case ia:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),o=this.deferred[a];if(!o)throw new Error(`Deferred ID ${a} not found in stream`);const l=r.slice(n+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=Gt.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}var ua={};/*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */var fl=ua.parse=Vn,hl=ua.serialize=Yn,jn=Object.prototype.toString,Un=Object.prototype.hasOwnProperty,Hn=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,zn=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Bn=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Wn=/^[\u0020-\u003A\u003D-\u007E]*$/;function Vn(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");var r={},n=e.length;if(n<2)return r;var a=t&&t.decode||Jn,o=0,l=0,s=0;do{if(l=e.indexOf("=",o),l===-1)break;if(s=e.indexOf(";",o),s===-1)s=n;else if(l>s){o=e.lastIndexOf(";",l-1)+1;continue}var i=Or(e,o,l),u=kr(e,l,i),c=e.slice(i,u);if(!Un.call(r,c)){var h=Or(e,l+1,s),y=kr(e,s,h);e.charCodeAt(h)===34&&e.charCodeAt(y-1)===34&&(h++,y--);var v=e.slice(h,y);r[c]=Gn(v,a)}o=s+1}while(or;){var n=e.charCodeAt(--t);if(n!==32&&n!==9)return t+1}return r}function Yn(e,t,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Hn.test(e))throw new TypeError("argument name is invalid");var a=n(t);if(!zn.test(a))throw new TypeError("argument val is invalid");var o=e+"="+a;if(!r)return o;if(r.maxAge!=null){var l=Math.floor(r.maxAge);if(!isFinite(l))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+l}if(r.domain){if(!Bn.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!Wn.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var s=r.expires;if(!Kn(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+s.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.partitioned&&(o+="; Partitioned"),r.priority){var i=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(i){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}function Jn(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function Kn(e){return jn.call(e)==="[object Date]"}function Gn(e,t){try{return t(e)}catch{return e}}/** * react-router v7.5.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var ca=e=>{throw TypeError(e)},Xn=(e,t,r)=>t.has(e)||ca("Cannot "+r),zt=(e,t,r)=>(Xn(e,t,"read from private field"),r?r.call(e):t.get(e)),qn=(e,t,r)=>t.has(e)?ca("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),_r="popstate";function ml(e={}){function t(n,a){let{pathname:o,search:l,hash:s}=n.location;return nt("",{pathname:o,search:l,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Ce(a)}return Zn(t,r,null,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function K(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Qn(){return Math.random().toString(36).substring(2,10)}function Ar(e,t){return{usr:e.state,key:e.key,idx:t}}function nt(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Me(t):t,state:r,key:t&&t.key||n||Qn()}}function Ce({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Me(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function Zn(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,l=a.history,s="POP",i=null,u=c();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function c(){return(l.state||{idx:null}).idx}function h(){s="POP";let w=c(),b=w==null?null:w-u;u=w,i&&i({action:s,location:R.location,delta:b})}function y(w,b){s="PUSH";let x=nt(R.location,w,b);u=c()+1;let M=Ar(x,u),D=R.createHref(x);try{l.pushState(M,"",D)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(D)}o&&i&&i({action:s,location:R.location,delta:1})}function v(w,b){s="REPLACE";let x=nt(R.location,w,b);u=c();let M=Ar(x,u),D=R.createHref(x);l.replaceState(M,"",D),o&&i&&i({action:s,location:R.location,delta:0})}function E(w){let b=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof w=="string"?w:Ce(w);return x=x.replace(/ $/,"%20"),A(b,`No window.location.(origin|href) available to create URL for href: ${x}`),new URL(x,b)}let R={get action(){return s},get location(){return e(a,l)},listen(w){if(i)throw new Error("A history only accepts one active listener");return a.addEventListener(_r,h),i=w,()=>{a.removeEventListener(_r,h),i=null}},createHref(w){return t(a,w)},createURL:E,encodeLocation(w){let b=E(w);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:y,replace:v,go(w){return l.go(w)}};return R}var rt,Ir=class{constructor(e){if(qn(this,rt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(zt(this,rt).has(e))return zt(this,rt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){zt(this,rt).set(e,t)}};rt=new WeakMap;var eo=new Set(["lazy","caseSensitive","path","id","index","children"]);function to(e){return eo.has(e)}var ro=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function ao(e){return ro.has(e)}function no(e){return e.index===!0}function Ct(e,t,r=[],n={}){return e.map((a,o)=>{let l=[...r,String(o)],s=typeof a.id=="string"?a.id:l.join("-");if(A(a.index!==!0||!a.children,"Cannot specify children on an index route"),A(!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),no(a)){let i={...a,...t(a),id:s};return n[s]=i,i}else{let i={...a,...t(a),id:s,children:void 0};return n[s]=i,a.children&&(i.children=Ct(a.children,t,l,n)),i}})}function we(e,t,r="/"){return bt(e,t,r,!1)}function bt(e,t,r,n){let a=typeof t=="string"?Me(t):t,o=se(a.pathname||"/",r);if(o==null)return null;let l=fa(e);oo(l);let s=null;for(let i=0;s==null&&i{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(A(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 u=Ee([n,i.relativePath]),c=r.concat(i);o.children&&o.children.length>0&&(A(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),fa(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:ho(u,o.index),routesMeta:c})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))a(o,l);else for(let i of ha(o.path))a(o,l,i)}),t}function ha(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let l=ha(n.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),a&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function oo(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:mo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var io=/^:[\w-]+$/,lo=3,so=2,uo=1,co=10,fo=-2,$r=e=>e==="*";function ho(e,t){let r=e.split("/"),n=r.length;return r.some($r)&&(n+=fo),t&&(n+=so),r.filter(a=>!$r(a)).reduce((a,o)=>a+(io.test(o)?lo:o===""?uo:co),n)}function mo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function po(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",l=[];for(let s=0;s{if(c==="*"){let E=s[y]||"";l=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const v=s[y];return h&&!v?u[c]=void 0:u[c]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function ma(e,t=!1,r=!0){K(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,i)=>(n.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function pa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return K(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function se(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 yo(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Me(e):e;return{pathname:r?r.startsWith("/")?r:vo(r,t):t,search:wo(n),hash:Eo(a)}}function vo(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Bt(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 and the router will parse it for you.`}function ya(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Dt(e){let t=ya(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function Tt(e,t,r,n=!1){let a;typeof e=="string"?a=Me(e):(a={...e},A(!a.pathname||!a.pathname.includes("?"),Bt("?","pathname","search",a)),A(!a.pathname||!a.pathname.includes("#"),Bt("#","pathname","hash",a)),A(!a.search||!a.search.includes("#"),Bt("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,s;if(l==null)s=r;else{let h=t.length-1;if(!n&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),h-=1;a.pathname=y.join("/")}s=h>=0?t[h]:"/"}let i=yo(a,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||c)&&(i.pathname+="/"),i}var Ee=e=>e.join("/").replace(/\/\/+/g,"/"),go=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Eo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,bo=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Ro(e,t){return new bo(e,typeof t=="number"?{status:t}:t)}var So=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},Pe=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ie(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var va=["POST","PUT","PATCH","DELETE"],xo=new Set(va),Lo=["GET",...va],Co=new Set(Lo),Po=new Set([301,302,303,307,308]),Mo=new Set([307,308]),Wt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ga={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ze={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},or=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Do=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),wa="remix-router-transitions",Ea=Symbol("ResetLoaderData");function pl(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";A(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Do,o={},l=Ct(e.routes,a,void 0,o),s,i=e.basename||"/",u=e.dataStrategy||ko,c={unstable_middleware:!1,...e.future},h=null,y=new Set,v=null,E=null,R=null,w=e.hydrationData!=null,b=we(l,e.history.location,i),x=!1,M=null;if(b==null&&!e.patchRoutesOnNavigation){let f=pe(404,{pathname:e.history.location.pathname}),{matches:p,route:g}=Xr(l);b=p,M={[g.id]:f}}b&&!e.hydrationData&&dt(b,l,e.history.location.pathname).active&&(b=null);let D;if(b)if(b.some(f=>f.route.lazy))D=!1;else if(!b.some(f=>f.route.loader))D=!0;else{let f=e.hydrationData?e.hydrationData.loaderData:null,p=e.hydrationData?e.hydrationData.errors:null;if(p){let g=b.findIndex(S=>p[S.route.id]!==void 0);D=b.slice(0,g+1).every(S=>!qt(S.route,f,p))}else D=b.every(g=>!qt(g.route,f,p))}else{D=!1,b=[];let f=dt(null,l,e.history.location.pathname);f.active&&f.matches&&(x=!0,b=f.matches)}let L,m={historyAction:e.history.action,location:e.history.location,matches:b,initialized:D,navigation:Wt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},T="POP",U=!1,I,J=!1,G=new Map,ae=null,H=!1,V=!1,q=new Set,B=new Map,fe=0,ye=-1,ne=new Map,ee=new Set,ve=new Map,Je=new Map,ge=new Set,De=new Map,ut,Te=null;function Za(){if(h=e.history.listen(({action:f,location:p,delta:g})=>{if(ut){ut(),ut=void 0;return}K(De.size===0||g!=null,"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 S=Mr({currentLocation:m.location,nextLocation:p,historyAction:f});if(S&&g!=null){let C=new Promise(F=>{ut=F});e.history.go(g*-1),ct(S,{state:"blocked",location:p,proceed(){ct(S,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),C.then(()=>e.history.go(g))},reset(){let F=new Map(m.blockers);F.set(S,Ze),te({blockers:F})}});return}return Fe(f,p)}),r){Vo(t,G);let f=()=>Yo(t,G);t.addEventListener("pagehide",f),ae=()=>t.removeEventListener("pagehide",f)}return m.initialized||Fe("POP",m.location,{initialHydration:!0}),L}function en(){h&&h(),ae&&ae(),y.clear(),I&&I.abort(),m.fetchers.forEach((f,p)=>It(p)),m.blockers.forEach((f,p)=>Pr(p))}function tn(f){return y.add(f),()=>y.delete(f)}function te(f,p={}){m={...m,...f};let g=[],S=[];m.fetchers.forEach((C,F)=>{C.state==="idle"&&(ge.has(F)?g.push(F):S.push(F))}),ge.forEach(C=>{!m.fetchers.has(C)&&!B.has(C)&&g.push(C)}),[...y].forEach(C=>C(m,{deletedFetchers:g,viewTransitionOpts:p.viewTransitionOpts,flushSync:p.flushSync===!0})),g.forEach(C=>It(C)),S.forEach(C=>m.fetchers.delete(C))}function He(f,p,{flushSync:g}={}){var k,$;let S=m.actionData!=null&&m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&m.navigation.state==="loading"&&((k=f.state)==null?void 0:k._isRedirect)!==!0,C;p.actionData?Object.keys(p.actionData).length>0?C=p.actionData:C=null:S?C=m.actionData:C=null;let F=p.loaderData?Kr(m.loaderData,p.loaderData,p.matches||[],p.errors):m.loaderData,_=m.blockers;_.size>0&&(_=new Map(_),_.forEach((O,j)=>_.set(j,Ze)));let P=U===!0||m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&(($=f.state)==null?void 0:$._isRedirect)!==!0;s&&(l=s,s=void 0),H||T==="POP"||(T==="PUSH"?e.history.push(f,f.state):T==="REPLACE"&&e.history.replace(f,f.state));let N;if(T==="POP"){let O=G.get(m.location.pathname);O&&O.has(f.pathname)?N={currentLocation:m.location,nextLocation:f}:G.has(f.pathname)&&(N={currentLocation:f,nextLocation:m.location})}else if(J){let O=G.get(m.location.pathname);O?O.add(f.pathname):(O=new Set([f.pathname]),G.set(m.location.pathname,O)),N={currentLocation:m.location,nextLocation:f}}te({...p,actionData:C,loaderData:F,historyAction:T,location:f,initialized:!0,navigation:Wt,revalidation:"idle",restoreScrollPosition:Tr(f,p.matches||m.matches),preventScrollReset:P,blockers:_},{viewTransitionOpts:N,flushSync:g===!0}),T="POP",U=!1,J=!1,H=!1,V=!1,Te==null||Te.resolve(),Te=null}async function Er(f,p){if(typeof f=="number"){e.history.go(f);return}let g=Xt(m.location,m.matches,i,f,p==null?void 0:p.fromRouteId,p==null?void 0:p.relative),{path:S,submission:C,error:F}=jr(!1,g,p),_=m.location,P=nt(m.location,S,p&&p.state);P={...P,...e.history.encodeLocation(P)};let N=p&&p.replace!=null?p.replace:void 0,k="PUSH";N===!0?k="REPLACE":N===!1||C!=null&&le(C.formMethod)&&C.formAction===m.location.pathname+m.location.search&&(k="REPLACE");let $=p&&"preventScrollReset"in p?p.preventScrollReset===!0:void 0,O=(p&&p.flushSync)===!0,j=Mr({currentLocation:_,nextLocation:P,historyAction:k});if(j){ct(j,{state:"blocked",location:P,proceed(){ct(j,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),Er(f,p)},reset(){let Y=new Map(m.blockers);Y.set(j,Ze),te({blockers:Y})}});return}await Fe(k,P,{submission:C,pendingError:F,preventScrollReset:$,replace:p&&p.replace,enableViewTransition:p&&p.viewTransition,flushSync:O})}function rn(){Te||(Te=Jo()),At(),te({revalidation:"loading"});let f=Te.promise;return m.navigation.state==="submitting"?f:m.navigation.state==="idle"?(Fe(m.historyAction,m.location,{startUninterruptedRevalidation:!0}),f):(Fe(T||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation,enableViewTransition:J===!0}),f)}async function Fe(f,p,g){I&&I.abort(),I=null,T=f,H=(g&&g.startUninterruptedRevalidation)===!0,hn(m.location,m.matches),U=(g&&g.preventScrollReset)===!0,J=(g&&g.enableViewTransition)===!0;let S=s||l,C=g&&g.overrideNavigation,F=g!=null&&g.initialHydration&&m.matches&&m.matches.length>0&&!x?m.matches:we(S,p,i),_=(g&&g.flushSync)===!0;if(F&&m.initialized&&!V&&Uo(m.location,p)&&!(g&&g.submission&&le(g.submission.formMethod))){He(p,{matches:F},{flushSync:_});return}let P=dt(F,S,p.pathname);if(P.active&&P.matches&&(F=P.matches),!F){let{error:Z,notFoundMatches:oe,route:z}=$t(p.pathname);He(p,{matches:oe,loaderData:{},errors:{[z.id]:Z}},{flushSync:_});return}I=new AbortController;let N=Be(e.history,p,I.signal,g&&g.submission),k=new Ir(e.unstable_getContext?await e.unstable_getContext():void 0),$;if(g&&g.pendingError)$=[_e(F).route.id,{type:"error",error:g.pendingError}];else if(g&&g.submission&&le(g.submission.formMethod)){let Z=await an(N,p,g.submission,F,k,P.active,g&&g.initialHydration===!0,{replace:g.replace,flushSync:_});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[oe,z]=Z.pendingActionResult;if(ie(z)&&Ie(z.error)&&z.error.status===404){I=null,He(p,{matches:Z.matches,loaderData:{},errors:{[oe]:z.error}});return}}F=Z.matches||F,$=Z.pendingActionResult,C=Vt(p,g.submission),_=!1,P.active=!1,N=Be(e.history,N.url,N.signal)}let{shortCircuited:O,matches:j,loaderData:Y,errors:Q}=await nn(N,p,F,k,P.active,C,g&&g.submission,g&&g.fetcherSubmission,g&&g.replace,g&&g.initialHydration===!0,_,$);O||(I=null,He(p,{matches:j||F,...Gr($),loaderData:Y,errors:Q}))}async function an(f,p,g,S,C,F,_,P={}){At();let N=Bo(p,g);if(te({navigation:N},{flushSync:P.flushSync===!0}),F){let O=await ft(S,p.pathname,f.signal);if(O.type==="aborted")return{shortCircuited:!0};if(O.type==="error"){let j=_e(O.partialMatches).route.id;return{matches:O.partialMatches,pendingActionResult:[j,{type:"error",error:O.error}]}}else if(O.matches)S=O.matches;else{let{notFoundMatches:j,error:Y,route:Q}=$t(p.pathname);return{matches:j,pendingActionResult:[Q.id,{type:"error",error:Y}]}}}let k,$=at(S,p);if(!$.route.action&&!$.route.lazy)k={type:"error",error:pe(405,{method:f.method,pathname:p.pathname,routeId:$.route.id})};else{let O=We(a,o,f,S,$,_?[]:n,C),j=await Ke(f,O,C,null);if(k=j[$.route.id],!k){for(let Y of S)if(j[Y.route.id]){k=j[Y.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ae(k)){let O;return P&&P.replace!=null?O=P.replace:O=Vr(k.response.headers.get("Location"),new URL(f.url),i)===m.location.pathname+m.location.search,await Ne(f,k,!0,{submission:g,replace:O}),{shortCircuited:!0}}if(ie(k)){let O=_e(S,$.route.id);return(P&&P.replace)!==!0&&(T="PUSH"),{matches:S,pendingActionResult:[O.route.id,k,$.route.id]}}return{matches:S,pendingActionResult:[$.route.id,k]}}async function nn(f,p,g,S,C,F,_,P,N,k,$,O){let j=F||Vt(p,_),Y=_||P||Qr(j),Q=!H&&!k;if(C){if(Q){let me=br(O);te({navigation:j,...me!==void 0?{actionData:me}:{}},{flushSync:$})}let W=await ft(g,p.pathname,f.signal);if(W.type==="aborted")return{shortCircuited:!0};if(W.type==="error"){let me=_e(W.partialMatches).route.id;return{matches:W.partialMatches,loaderData:{},errors:{[me]:W.error}}}else if(W.matches)g=W.matches;else{let{error:me,notFoundMatches:xe,route:mt}=$t(p.pathname);return{matches:xe,loaderData:{},errors:{[mt.id]:me}}}}let Z=s||l,{dsMatches:oe,revalidatingFetchers:z}=Ur(f,S,a,o,e.history,m,g,Y,p,k?[]:n,k===!0,V,q,ge,ve,ee,Z,i,O);if(ye=++fe,!e.dataStrategy&&!oe.some(W=>W.shouldLoad)&&z.length===0){let W=Lr();return He(p,{matches:g,loaderData:{},errors:O&&ie(O[1])?{[O[0]]:O[1].error}:null,...Gr(O),...W?{fetchers:new Map(m.fetchers)}:{}},{flushSync:$}),{shortCircuited:!0}}if(Q){let W={};if(!C){W.navigation=j;let me=br(O);me!==void 0&&(W.actionData=me)}z.length>0&&(W.fetchers=on(z)),te(W,{flushSync:$})}z.forEach(W=>{Se(W.key),W.controller&&B.set(W.key,W.controller)});let Ge=()=>z.forEach(W=>Se(W.key));I&&I.signal.addEventListener("abort",Ge);let{loaderResults:Oe,fetcherResults:Xe}=await Rr(oe,z,f,S);if(f.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Ge),z.forEach(W=>B.delete(W.key));let he=yt(Oe);if(he)return await Ne(f,he.result,!0,{replace:N}),{shortCircuited:!0};if(he=yt(Xe),he)return ee.add(he.key),await Ne(f,he.result,!0,{replace:N}),{shortCircuited:!0};let{loaderData:qe,errors:Qe}=Jr(m,g,Oe,O,z,Xe);k&&m.errors&&(Qe={...m.errors,...Qe});let jt=Lr(),ke=Cr(ye),ht=jt||ke||z.length>0;return{matches:g,loaderData:qe,errors:Qe,...ht?{fetchers:new Map(m.fetchers)}:{}}}function br(f){if(f&&!ie(f[1]))return{[f[0]]:f[1].data};if(m.actionData)return Object.keys(m.actionData).length===0?null:m.actionData}function on(f){return f.forEach(p=>{let g=m.fetchers.get(p.key),S=et(void 0,g?g.data:void 0);m.fetchers.set(p.key,S)}),new Map(m.fetchers)}async function ln(f,p,g,S){Se(f);let C=(S&&S.flushSync)===!0,F=s||l,_=Xt(m.location,m.matches,i,g,p,S==null?void 0:S.relative),P=we(F,_,i),N=dt(P,F,_);if(N.active&&N.matches&&(P=N.matches),!P){be(f,p,pe(404,{pathname:_}),{flushSync:C});return}let{path:k,submission:$,error:O}=jr(!0,_,S);if(O){be(f,p,O,{flushSync:C});return}let j=at(P,k),Y=new Ir(e.unstable_getContext?await e.unstable_getContext():void 0),Q=(S&&S.preventScrollReset)===!0;if($&&le($.formMethod)){await sn(f,p,k,j,P,Y,N.active,C,Q,$);return}ve.set(f,{routeId:p,path:k}),await un(f,p,k,j,P,Y,N.active,C,Q,$)}async function sn(f,p,g,S,C,F,_,P,N,k){At(),ve.delete(f);function $(X){if(!X.route.action&&!X.route.lazy){let ze=pe(405,{method:k.formMethod,pathname:g,routeId:p});return be(f,p,ze,{flushSync:P}),!0}return!1}if(!_&&$(S))return;let O=m.fetchers.get(f);Re(f,Wo(k,O),{flushSync:P});let j=new AbortController,Y=Be(e.history,g,j.signal,k);if(_){let X=await ft(C,g,Y.signal,f);if(X.type==="aborted")return;if(X.type==="error"){be(f,p,X.error,{flushSync:P});return}else if(X.matches){if(C=X.matches,S=at(C,g),$(S))return}else{be(f,p,pe(404,{pathname:g}),{flushSync:P});return}}B.set(f,j);let Q=fe,Z=We(a,o,Y,C,S,n,F),z=(await Ke(Y,Z,F,f))[S.route.id];if(Y.signal.aborted){B.get(f)===j&&B.delete(f);return}if(ge.has(f)){if(Ae(z)||ie(z)){Re(f,Le(void 0));return}}else{if(Ae(z))if(B.delete(f),ye>Q){Re(f,Le(void 0));return}else return ee.add(f),Re(f,et(k)),Ne(Y,z,!1,{fetcherSubmission:k,preventScrollReset:N});if(ie(z)){be(f,p,z.error);return}}let Ge=m.navigation.location||m.location,Oe=Be(e.history,Ge,j.signal),Xe=s||l,he=m.navigation.state!=="idle"?we(Xe,m.navigation.location,i):m.matches;A(he,"Didn't find any matches after fetcher action");let qe=++fe;ne.set(f,qe);let Qe=et(k,z.data);m.fetchers.set(f,Qe);let{dsMatches:jt,revalidatingFetchers:ke}=Ur(Oe,F,a,o,e.history,m,he,k,Ge,n,!1,V,q,ge,ve,ee,Xe,i,[S.route.id,z]);ke.filter(X=>X.key!==f).forEach(X=>{let ze=X.key,Fr=m.fetchers.get(ze),yn=et(void 0,Fr?Fr.data:void 0);m.fetchers.set(ze,yn),Se(ze),X.controller&&B.set(ze,X.controller)}),te({fetchers:new Map(m.fetchers)});let ht=()=>ke.forEach(X=>Se(X.key));j.signal.addEventListener("abort",ht);let{loaderResults:W,fetcherResults:me}=await Rr(jt,ke,Oe,F);if(j.signal.aborted)return;j.signal.removeEventListener("abort",ht),ne.delete(f),B.delete(f),ke.forEach(X=>B.delete(X.key));let xe=yt(W);if(xe)return Ne(Oe,xe.result,!1,{preventScrollReset:N});if(xe=yt(me),xe)return ee.add(xe.key),Ne(Oe,xe.result,!1,{preventScrollReset:N});let{loaderData:mt,errors:Ut}=Jr(m,he,W,void 0,ke,me);if(m.fetchers.has(f)){let X=Le(z.data);m.fetchers.set(f,X)}Cr(qe),m.navigation.state==="loading"&&qe>ye?(A(T,"Expected pending action"),I&&I.abort(),He(m.navigation.location,{matches:he,loaderData:mt,errors:Ut,fetchers:new Map(m.fetchers)})):(te({errors:Ut,loaderData:Kr(m.loaderData,mt,he,Ut),fetchers:new Map(m.fetchers)}),V=!1)}async function un(f,p,g,S,C,F,_,P,N,k){let $=m.fetchers.get(f);Re(f,et(k,$?$.data:void 0),{flushSync:P});let O=new AbortController,j=Be(e.history,g,O.signal);if(_){let z=await ft(C,g,j.signal,f);if(z.type==="aborted")return;if(z.type==="error"){be(f,p,z.error,{flushSync:P});return}else if(z.matches)C=z.matches,S=at(C,g);else{be(f,p,pe(404,{pathname:g}),{flushSync:P});return}}B.set(f,O);let Y=fe,Q=We(a,o,j,C,S,n,F),oe=(await Ke(j,Q,F,f))[S.route.id];if(B.get(f)===O&&B.delete(f),!j.signal.aborted){if(ge.has(f)){Re(f,Le(void 0));return}if(Ae(oe))if(ye>Y){Re(f,Le(void 0));return}else{ee.add(f),await Ne(j,oe,!1,{preventScrollReset:N});return}if(ie(oe)){be(f,p,oe.error);return}Re(f,Le(oe.data))}}async function Ne(f,p,g,{submission:S,fetcherSubmission:C,preventScrollReset:F,replace:_}={}){p.response.headers.has("X-Remix-Revalidate")&&(V=!0);let P=p.response.headers.get("Location");A(P,"Expected a Location header on the redirect Response"),P=Vr(P,new URL(f.url),i);let N=nt(m.location,P,{_isRedirect:!0});if(r){let Q=!1;if(p.response.headers.has("X-Remix-Reload-Document"))Q=!0;else if(or.test(P)){const Z=e.history.createURL(P);Q=Z.origin!==t.location.origin||se(Z.pathname,i)==null}if(Q){_?t.location.replace(P):t.location.assign(P);return}}I=null;let k=_===!0||p.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:$,formAction:O,formEncType:j}=m.navigation;!S&&!C&&$&&O&&j&&(S=Qr(m.navigation));let Y=S||C;if(Mo.has(p.response.status)&&Y&&le(Y.formMethod))await Fe(k,N,{submission:{...Y,formAction:P},preventScrollReset:F||U,enableViewTransition:g?J:void 0});else{let Q=Vt(N,S);await Fe(k,N,{overrideNavigation:Q,fetcherSubmission:C,preventScrollReset:F||U,enableViewTransition:g?J:void 0})}}async function Ke(f,p,g,S){let C,F={};try{C=await _o(u,f,p,S,g,!1)}catch(_){return p.filter(P=>P.shouldLoad).forEach(P=>{F[P.route.id]={type:"error",error:_}}),F}for(let[_,P]of Object.entries(C))if(Ho(P)){let N=P.result;F[_]={type:"redirect",response:$o(N,f,_,p,i)}}else F[_]=await Io(P);return F}async function Rr(f,p,g,S){let C=Ke(g,f,S,null),F=Promise.all(p.map(async N=>{if(N.matches&&N.match&&N.request&&N.controller){let $=(await Ke(N.request,N.matches,S,N.key))[N.match.route.id];return{[N.key]:$}}else return Promise.resolve({[N.key]:{type:"error",error:pe(404,{pathname:N.path})}})})),_=await C,P=(await F).reduce((N,k)=>Object.assign(N,k),{});return{loaderResults:_,fetcherResults:P}}function At(){V=!0,ve.forEach((f,p)=>{B.has(p)&&q.add(p),Se(p)})}function Re(f,p,g={}){m.fetchers.set(f,p),te({fetchers:new Map(m.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function be(f,p,g,S={}){let C=_e(m.matches,p);It(f),te({errors:{[C.route.id]:g},fetchers:new Map(m.fetchers)},{flushSync:(S&&S.flushSync)===!0})}function Sr(f){return Je.set(f,(Je.get(f)||0)+1),ge.has(f)&&ge.delete(f),m.fetchers.get(f)||ga}function It(f){let p=m.fetchers.get(f);B.has(f)&&!(p&&p.state==="loading"&&ne.has(f))&&Se(f),ve.delete(f),ne.delete(f),ee.delete(f),ge.delete(f),q.delete(f),m.fetchers.delete(f)}function cn(f){let p=(Je.get(f)||0)-1;p<=0?(Je.delete(f),ge.add(f)):Je.set(f,p),te({fetchers:new Map(m.fetchers)})}function Se(f){let p=B.get(f);p&&(p.abort(),B.delete(f))}function xr(f){for(let p of f){let g=Sr(p),S=Le(g.data);m.fetchers.set(p,S)}}function Lr(){let f=[],p=!1;for(let g of ee){let S=m.fetchers.get(g);A(S,`Expected fetcher: ${g}`),S.state==="loading"&&(ee.delete(g),f.push(g),p=!0)}return xr(f),p}function Cr(f){let p=[];for(let[g,S]of ne)if(S0}function dn(f,p){let g=m.blockers.get(f)||Ze;return De.get(f)!==p&&De.set(f,p),g}function Pr(f){m.blockers.delete(f),De.delete(f)}function ct(f,p){let g=m.blockers.get(f)||Ze;A(g.state==="unblocked"&&p.state==="blocked"||g.state==="blocked"&&p.state==="blocked"||g.state==="blocked"&&p.state==="proceeding"||g.state==="blocked"&&p.state==="unblocked"||g.state==="proceeding"&&p.state==="unblocked",`Invalid blocker state transition: ${g.state} -> ${p.state}`);let S=new Map(m.blockers);S.set(f,p),te({blockers:S})}function Mr({currentLocation:f,nextLocation:p,historyAction:g}){if(De.size===0)return;De.size>1&&K(!1,"A router only supports one blocker at a time");let S=Array.from(De.entries()),[C,F]=S[S.length-1],_=m.blockers.get(C);if(!(_&&_.state==="proceeding")&&F({currentLocation:f,nextLocation:p,historyAction:g}))return C}function $t(f){let p=pe(404,{pathname:f}),g=s||l,{matches:S,route:C}=Xr(g);return{notFoundMatches:S,route:C,error:p}}function fn(f,p,g){if(v=f,R=p,E=g||null,!w&&m.navigation===Wt){w=!0;let S=Tr(m.location,m.matches);S!=null&&te({restoreScrollPosition:S})}return()=>{v=null,R=null,E=null}}function Dr(f,p){return E&&E(f,p.map(S=>da(S,m.loaderData)))||f.key}function hn(f,p){if(v&&R){let g=Dr(f,p);v[g]=R()}}function Tr(f,p){if(v){let g=Dr(f,p),S=v[g];if(typeof S=="number")return S}return null}function dt(f,p,g){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:bt(p,g,i,!0)}}else return{active:!0,matches:bt(p,g,i,!0)||[]};return{active:!1,matches:null}}async function ft(f,p,g,S){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let C=f;for(;;){let F=s==null,_=s||l,P=o;try{await e.patchRoutesOnNavigation({signal:g,path:p,matches:C,fetcherKey:S,patch:($,O)=>{g.aborted||Hr($,O,_,P,a)}})}catch($){return{type:"error",error:$,partialMatches:C}}finally{F&&!g.aborted&&(l=[...l])}if(g.aborted)return{type:"aborted"};let N=we(_,p,i);if(N)return{type:"success",matches:N};let k=bt(_,p,i,!0);if(!k||C.length===k.length&&C.every(($,O)=>$.route.id===k[O].route.id))return{type:"success",matches:null};C=k}}function mn(f){o={},s=Ct(f,a,void 0,o)}function pn(f,p){let g=s==null;Hr(f,p,s||l,o,a),g&&(l=[...l],te({}))}return L={get basename(){return i},get future(){return c},get state(){return m},get routes(){return l},get window(){return t},initialize:Za,subscribe:tn,enableScrollRestoration:fn,navigate:Er,fetch:ln,revalidate:rn,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:Sr,deleteFetcher:cn,dispose:en,getBlocker:dn,deleteBlocker:Pr,patchRoutes:pn,_internalFetchControllers:B,_internalSetRoutes:mn},L}function To(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Xt(e,t,r,n,a,o){let l,s;if(a){l=[];for(let u of t)if(l.push(u),u.route.id===a){s=u;break}}else l=t,s=t[t.length-1];let i=Tt(n||".",Dt(l),se(e.pathname,r)||e.pathname,o==="path");if(n==null&&(i.search=e.search,i.hash=e.hash),(n==null||n===""||n===".")&&s){let u=lr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(i.search),h=c.getAll("index");c.delete("index"),h.filter(v=>v).forEach(v=>c.append("index",v));let y=c.toString();i.search=y?`?${y}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:Ee([r,i.pathname])),Ce(i)}function jr(e,t,r){if(!r||!To(r))return{path:t};if(r.formMethod&&!zo(r.formMethod))return{path:t,error:pe(405,{method:r.formMethod})};let n=()=>({path:t,error:pe(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Ca(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!le(o))return n();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((y,[v,E])=>`${y}${v}=${E} `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!le(o))return n();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return n()}}}A(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=Zt(r.formData),i=r.formData;else if(r.body instanceof FormData)s=Zt(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=Yr(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=Yr(s)}catch{return n()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(le(u.formMethod))return{path:t,submission:u};let c=Me(t);return e&&c.search&&lr(c.search)&&s.append("index",""),c.search=`?${s}`,{path:Ce(c),submission:u}}function Ur(e,t,r,n,a,o,l,s,i,u,c,h,y,v,E,R,w,b,x){var ae;let M=x?ie(x[1])?x[1].error:x[1].data:void 0,D=a.createURL(o.location),L=a.createURL(i),m;if(c&&o.errors){let H=Object.keys(o.errors)[0];m=l.findIndex(V=>V.route.id===H)}else if(x&&ie(x[1])){let H=x[0];m=l.findIndex(V=>V.route.id===H)-1}let T=x?x[1].statusCode:void 0,U=T&&T>=400,I={currentUrl:D,currentParams:((ae=o.matches[0])==null?void 0:ae.params)||{},nextUrl:L,nextParams:l[0].params,...s,actionResult:M,actionStatus:T},J=l.map((H,V)=>{let{route:q}=H,B=null;if(m!=null&&V>m?B=!1:q.lazy?B=!0:q.loader==null?B=!1:c?B=qt(q,o.loaderData,o.errors):Fo(o.loaderData,o.matches[V],H)&&(B=!0),B!==null)return Qt(r,n,e,H,u,t,B);let fe=U?!1:h||D.pathname+D.search===L.pathname+L.search||D.search!==L.search||No(o.matches[V],H),ye={...I,defaultShouldRevalidate:fe},ne=Pt(H,ye);return Qt(r,n,e,H,u,t,ne,ye)}),G=[];return E.forEach((H,V)=>{if(c||!l.some(ve=>ve.route.id===H.routeId)||v.has(V))return;let q=we(w,H.path,b);if(!q){G.push({key:V,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(R.has(V))return;let B=o.fetchers.get(V),fe=at(q,H.path),ye=new AbortController,ne=Be(a,H.path,ye.signal),ee=null;if(y.has(V))y.delete(V),ee=We(r,n,ne,q,fe,u,t);else if(B&&B.state!=="idle"&&B.data===void 0)h&&(ee=We(r,n,ne,q,fe,u,t));else{let ve={...I,defaultShouldRevalidate:U?!1:h};Pt(fe,ve)&&(ee=We(r,n,ne,q,fe,u,t,ve))}ee&&G.push({key:V,routeId:H.routeId,path:H.path,matches:ee,match:fe,request:ne,controller:ye})}),{dsMatches:J,revalidatingFetchers:G}}function qt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Fo(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function No(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Pt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Hr(e,t,r,n,a){let o;if(e){let i=n[e];A(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>ba(i,u))),s=Ct(l,a,[e||"_","patch",String((o==null?void 0:o.length)||"0")],n);o.push(...s)}function ba(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>ba(r,o))}):!1}var zr=new WeakMap,Ra=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(A(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=zr.get(a);l||(l={},zr.set(a,l));let s=l[e];if(s)return s;let i=(async()=>{let u=to(e),h=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)K(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)K(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[e]=i,i},Br=new WeakMap;function Oo(e,t,r,n,a){let o=r[e.id];if(A(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=Br.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let h=(async()=>{A(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),v={};for(let E in y){let R=y[E];if(R===void 0)continue;let w=ao(E),x=o[E]!==void 0&&E!=="hasErrorBoundary";w?K(!w,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):x?K(!x,`Route "${o.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.`):v[E]=R}Object.assign(o,v),Object.assign(o,{...n(o),lazy:void 0})})();return Br.set(o,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let l=Object.keys(e.lazy),s=[],i;for(let c of l){if(a&&a.includes(c))continue;let h=Ra({key:c,route:e,manifest:r,mapRouteProperties:n});h&&(s.push(h),c===t&&(i=h))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u==null||u.catch(()=>{}),i==null||i.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}async function Wr(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function ko(e){return e.matches.some(t=>t.route.unstable_middleware)?Sa(e,!1,()=>Wr(e),(t,r)=>({[r]:{type:"error",result:t}})):Wr(e)}async function Sa(e,t,r,n){let{matches:a,request:o,params:l,context:s}=e,i={handlerResult:void 0};try{let u=a.flatMap(h=>h.route.unstable_middleware?h.route.unstable_middleware.map(y=>[h.route.id,y]):[]),c=await xa({request:o,params:l,context:s},u,t,i,r);return t?c:i.handlerResult}catch(u){if(!i.middlewareError)throw u;let c=await n(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,c):c}}async function xa(e,t,r,n,a,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let s=t[o];if(!s)return n.handlerResult=await a(),n.handlerResult;let[i,u]=s,c=!1,h,y=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");c=!0,await xa(e,t,r,n,a,o+1)};try{let v=await u({request:e.request,params:e.params,context:e.context},y);return c?v===void 0?h:v:y()}catch(v){throw n.middlewareError?n.middlewareError.error!==v&&(n.middlewareError={routeId:i,error:v}):n.middlewareError={routeId:i,error:v},v}}function La(e,t,r,n,a){let o=Ra({key:"unstable_middleware",route:n.route,manifest:t,mapRouteProperties:e}),l=Oo(n.route,le(r.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Qt(e,t,r,n,a,o,l,s=null){let i=!1,u=La(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:l,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(c){return i=!0,s?typeof c=="boolean"?Pt(n,{...s,defaultShouldRevalidate:c}):Pt(n,s):l},resolve(c){return i||l||c&&r.method==="GET"&&(n.route.lazy||n.route.loader)?Ao({request:r,match:n,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function We(e,t,r,n,a,o,l,s=null){return n.map(i=>i.route.id!==a.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:La(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qt(e,t,r,i,o,l,!0,s))}async function _o(e,t,r,n,a,o){r.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(r.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let l={request:t,params:r[0].params,context:a,matches:r},i=await e({...l,fetcherKey:n,unstable_runClientMiddleware:u=>{let c=l;return Sa(c,!1,()=>u({...c,fetcherKey:n,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(h,y)=>({[y]:{type:"error",result:h}}))}});try{await Promise.all(r.flatMap(u=>{var c,h;return[(c=u._lazyPromises)==null?void 0:c.handler,(h=u._lazyPromises)==null?void 0:h.route]}))}catch{}return i}async function Ao({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let l,s,i=le(e.method),u=i?"action":"loader",c=h=>{let y,v=new Promise((w,b)=>y=b);s=()=>y(),e.signal.addEventListener("abort",s);let E=w=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):h({request:e,params:t.params,context:o},...w!==void 0?[w]:[]),R=(async()=>{try{return{type:"data",result:await(a?a(b=>E(b)):E())}}catch(w){return{type:"error",result:w}}})();return Promise.race([R,v])};try{let h=i?t.route.action:t.route.loader;if(r||n)if(h){let y,[v]=await Promise.all([c(h).catch(E=>{y=E}),r,n]);if(y!==void 0)throw y;l=v}else{await r;let y=i?t.route.action:t.route.loader;if(y)[l]=await Promise.all([c(y),n]);else if(u==="action"){let v=new URL(e.url),E=v.pathname+v.search;throw pe(405,{method:e.method,pathname:E,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(h)l=await c(h);else{let y=new URL(e.url),v=y.pathname+y.search;throw pe(404,{pathname:v})}}catch(h){return{type:"error",result:h}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function Io(e){var n,a,o,l,s,i;let{result:t,type:r}=e;if(ir(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new Pe(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?qr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Pe(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:Ie(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ie(t)?t.status:void 0}:qr(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function $o(e,t,r,n,a){let o=e.headers.get("Location");if(A(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!or.test(o)){let l=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=Xt(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function Vr(e,t,r){if(or.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=se(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Be(e,t,r,n){let a=e.createURL(Ca(t)).toString(),o={signal:r};if(n&&le(n.formMethod)){let{formMethod:l,formEncType:s}=n;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=Zt(n.formData):o.body=n.formData}return new Request(a,o)}function Zt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Yr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function jo(e,t,r,n=!1,a=!1){let o={},l=null,s,i=!1,u={},c=r&&ie(r[1])?r[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let y=h.route.id,v=t[y];if(A(!Ae(v),"Cannot handle redirect results in processLoaderData"),ie(v)){let E=v.error;if(c!==void 0&&(E=c,c=void 0),l=l||{},a)l[y]=E;else{let R=_e(e,y);l[R.route.id]==null&&(l[R.route.id]=E)}n||(o[y]=Ea),i||(i=!0,s=Ie(v.error)?v.error.status:500),v.headers&&(u[y]=v.headers)}else o[y]=v.data,v.statusCode&&v.statusCode!==200&&!i&&(s=v.statusCode),v.headers&&(u[y]=v.headers)}),c!==void 0&&r&&(l={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function Jr(e,t,r,n,a,o){let{loaderData:l,errors:s}=jo(t,r,n);return a.filter(i=>!i.matches||i.matches.some(u=>u.shouldLoad)).forEach(i=>{let{key:u,match:c,controller:h}=i,y=o[u];if(A(y,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(ie(y)){let v=_e(e.matches,c==null?void 0:c.route.id);s&&s[v.route.id]||(s={...s,[v.route.id]:y.error}),e.fetchers.delete(u)}else if(Ae(y))A(!1,"Unhandled fetcher revalidation redirect");else{let v=Le(y.data);e.fetchers.set(u,v)}}),{loaderData:l,errors:s}}function Kr(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==Ea).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),n&&n.hasOwnProperty(l))break}return a}function Gr(e){return e?ie(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _e(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Xr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function pe(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new Pe(e||500,l,new Error(s),!0)}function yt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ae(a))return{key:n,result:a}}}function Ca(e){let t=typeof e=="string"?Me(e):e;return Ce({...t,hash:""})}function Uo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ho(e){return ir(e.result)&&Po.has(e.result.status)}function ie(e){return e.type==="error"}function Ae(e){return(e&&e.type)==="redirect"}function qr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ir(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function zo(e){return Co.has(e.toUpperCase())}function le(e){return xo.has(e.toUpperCase())}function lr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function at(e,t){let r=typeof t=="string"?Me(t).search:t.search;if(e[e.length-1].route.index&&lr(r||""))return e[e.length-1];let n=ya(e);return n[n.length-1]}function Qr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:l}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:l,text:void 0}}}function Vt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Bo(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function et(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Wo(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Le(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Vo(e,t){try{let r=e.sessionStorage.getItem(wa);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function Yo(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(wa,JSON.stringify(r))}catch(n){K(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function Jo(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var $e=d.createContext(null);$e.displayName="DataRouter";var Ve=d.createContext(null);Ve.displayName="DataRouterState";var sr=d.createContext({isTransitioning:!1});sr.displayName="ViewTransition";var ur=d.createContext(new Map);ur.displayName="Fetchers";var Ko=d.createContext(null);Ko.displayName="Await";var ue=d.createContext(null);ue.displayName="Navigation";var Ft=d.createContext(null);Ft.displayName="Location";var ce=d.createContext({outlet:null,matches:[],isDataRoute:!1});ce.displayName="Route";var cr=d.createContext(null);cr.displayName="RouteError";function Go(e,{relative:t}={}){A(je(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=d.useContext(ue),{hash:a,pathname:o,search:l}=lt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Ee([r,o])),n.createHref({pathname:s,search:l,hash:a})}function je(){return d.useContext(Ft)!=null}function de(){return A(je(),"useLocation() may be used only in the context of a component."),d.useContext(Ft).location}function yl(e){A(je(),"useMatch() may be used only in the context of a component.");let{pathname:t}=de();return d.useMemo(()=>ot(e,pa(t)),[t,e])}var Pa="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ma(e){d.useContext(ue).static||d.useLayoutEffect(e)}function dr(){let{isDataRoute:e}=d.useContext(ce);return e?li():Xo()}function Xo(){A(je(),"useNavigate() may be used only in the context of a component.");let e=d.useContext($e),{basename:t,navigator:r}=d.useContext(ue),{matches:n}=d.useContext(ce),{pathname:a}=de(),o=JSON.stringify(Dt(n)),l=d.useRef(!1);return Ma(()=>{l.current=!0}),d.useCallback((i,u={})=>{if(K(l.current,Pa),!l.current)return;if(typeof i=="number"){r.go(i);return}let c=Tt(i,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Ee([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,a,e])}var Da=d.createContext(null);function vl(){return d.useContext(Da)}function qo(e){let t=d.useContext(ce).outlet;return t&&d.createElement(Da.Provider,{value:e},t)}function gl(){let{matches:e}=d.useContext(ce),t=e[e.length-1];return t?t.params:{}}function lt(e,{relative:t}={}){let{matches:r}=d.useContext(ce),{pathname:n}=de(),a=JSON.stringify(Dt(r));return d.useMemo(()=>Tt(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Qo(e,t,r,n){A(je(),"useRoutes() may be used only in the context of a component.");let{navigator:a,static:o}=d.useContext(ue),{matches:l}=d.useContext(ce),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",h=s&&s.route;{let x=h&&h.path||"";Oa(u,!h||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (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. Please change the parent to .`)}let y=de(),v;v=y;let E=v.pathname||"/",R=E;if(c!=="/"){let x=c.replace(/^\//,"").split("/");R="/"+E.replace(/^\//,"").split("/").slice(x.length).join("/")}let w=!o&&r&&r.matches&&r.matches.length>0?r.matches:we(e,{pathname:R});return K(h||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),K(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),ai(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},i,x.params),pathname:Ee([c,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ee([c,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),l,r,n)}function Zo(){let e=Na(),t=Ie(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:a},r):null,l)}var ei=d.createElement(Zo,null),ti=class extends d.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||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?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!==void 0?d.createElement(ce.Provider,{value:this.props.routeContext},d.createElement(cr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ri({routeContext:e,match:t,children:r}){let n=d.useContext($e);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(ce.Provider,{value:e},r)}function ai(e,t=[],r=null,n=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=r==null?void 0:r.errors;if(o!=null){let i=a.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);A(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i=0?a=a.slice(0,s+1):a=[a[0]];break}}}return a.reduceRight((i,u,c)=>{let h,y=!1,v=null,E=null;r&&(h=o&&u.route.id?o[u.route.id]:void 0,v=u.route.errorElement||ei,l&&(s<0&&c===0?(Oa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,E=null):s===c&&(y=!0,E=u.route.hydrateFallbackElement||null)));let R=t.concat(a.slice(0,c+1)),w=()=>{let b;return h?b=v:y?b=E:u.route.Component?b=d.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=i,d.createElement(ri,{match:u,routeContext:{outlet:i,matches:R,isDataRoute:r!=null},children:b})};return r&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?d.createElement(ti,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:w(),routeContext:{outlet:null,matches:R,isDataRoute:!0}}):w()},null)}function fr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ta(e){let t=d.useContext($e);return A(t,fr(e)),t}function Ue(e){let t=d.useContext(Ve);return A(t,fr(e)),t}function ni(e){let t=d.useContext(ce);return A(t,fr(e)),t}function st(e){let t=ni(e),r=t.matches[t.matches.length-1];return A(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function oi(){return st("useRouteId")}function ii(){return Ue("useNavigation").navigation}function wl(){let e=Ta("useRevalidator"),t=Ue("useRevalidator");return d.useMemo(()=>({async revalidate(){await e.router.revalidate()},state:t.revalidation}),[e.router,t.revalidation])}function Fa(){let{matches:e,loaderData:t}=Ue("useMatches");return d.useMemo(()=>e.map(r=>da(r,t)),[e,t])}function El(){let e=Ue("useLoaderData"),t=st("useLoaderData");return e.loaderData[t]}function bl(e){return Ue("useRouteLoaderData").loaderData[e]}function Rl(){let e=Ue("useActionData"),t=st("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Na(){var n;let e=d.useContext(cr),t=Ue("useRouteError"),r=st("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function li(){let{router:e}=Ta("useNavigate"),t=st("useNavigate"),r=d.useRef(!1);return Ma(()=>{r.current=!0}),d.useCallback(async(a,o={})=>{K(r.current,Pa),r.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var Zr={};function Oa(e,t,r){!t&&!Zr[e]&&(Zr[e]=!0,K(!1,r))}var ea={};function ta(e,t){!e&&!ea[t]&&(ea[t]=!0,console.warn(t))}function Sl(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&K(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&K(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&K(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var xl=["HydrateFallback","hydrateFallbackElement"],si=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function Ll({router:e,flushSync:t}){let[r,n]=d.useState(e.state),[a,o]=d.useState(),[l,s]=d.useState({isTransitioning:!1}),[i,u]=d.useState(),[c,h]=d.useState(),[y,v]=d.useState(),E=d.useRef(new Map),R=d.useCallback((M,{deletedFetchers:D,flushSync:L,viewTransitionOpts:m})=>{M.fetchers.forEach((U,I)=>{U.data!==void 0&&E.current.set(I,U.data)}),D.forEach(U=>E.current.delete(U)),ta(L===!1||t!=null,'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 T=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(ta(m==null||T,"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."),!m||!T){t&&L?t(()=>n(M)):d.startTransition(()=>n(M));return}if(t&&L){t(()=>{c&&(i&&i.resolve(),c.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:m.currentLocation,nextLocation:m.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>n(M))});U.finished.finally(()=>{t(()=>{u(void 0),h(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>h(U));return}c?(i&&i.resolve(),c.skipTransition(),v({state:M,currentLocation:m.currentLocation,nextLocation:m.nextLocation})):(o(M),s({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}))},[e.window,t,c,i]);d.useLayoutEffect(()=>e.subscribe(R),[e,R]),d.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new si)},[l]),d.useEffect(()=>{if(i&&a&&e.window){let M=a,D=i.promise,L=e.window.document.startViewTransition(async()=>{d.startTransition(()=>n(M)),await D});L.finished.finally(()=>{u(void 0),h(void 0),o(void 0),s({isTransitioning:!1})}),h(L)}},[a,i,e.window]),d.useEffect(()=>{i&&a&&r.location.key===a.location.key&&i.resolve()},[i,c,r.location,a]),d.useEffect(()=>{!l.isTransitioning&&y&&(o(y.state),s({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),v(void 0))},[l.isTransitioning,y]);let w=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,D,L)=>e.navigate(M,{state:D,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(M,D,L)=>e.navigate(M,{replace:!0,state:D,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[e]),b=e.basename||"/",x=d.useMemo(()=>({router:e,navigator:w,static:!1,basename:b}),[e,w,b]);return d.createElement(d.Fragment,null,d.createElement($e.Provider,{value:x},d.createElement(Ve.Provider,{value:r},d.createElement(ur.Provider,{value:E.current},d.createElement(sr.Provider,{value:l},d.createElement(di,{basename:b,location:r.location,navigationType:r.historyAction,navigator:w},d.createElement(ui,{routes:e.routes,future:e.future,state:r})))))),null)}var ui=d.memo(ci);function ci({routes:e,future:t,state:r}){return Qo(e,void 0,r,t)}function Cl({to:e,replace:t,state:r,relative:n}){A(je()," may be used only in the context of a component.");let{static:a}=d.useContext(ue);K(!a," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:o}=d.useContext(ce),{pathname:l}=de(),s=dr(),i=Tt(e,Dt(o),l,n==="path"),u=JSON.stringify(i);return d.useEffect(()=>{s(JSON.parse(u),{replace:t,state:r,relative:n})},[s,u,n,t,r]),null}function Pl(e){return qo(e.context)}function di({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1}){A(!je(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:l,navigator:a,static:o,future:{}}),[l,a,o]);typeof r=="string"&&(r=Me(r));let{pathname:i="/",search:u="",hash:c="",state:h=null,key:y="default"}=r,v=d.useMemo(()=>{let E=se(i,l);return E==null?null:{location:{pathname:E,search:u,hash:c,state:h,key:y},navigationType:n}},[l,i,u,c,h,y,n]);return K(v!=null,` is not able to match the URL "${i}${u}${c}" because it does not start with the basename, so the won't render anything.`),v==null?null:d.createElement(ue.Provider,{value:s},d.createElement(Ft.Provider,{children:t,value:v}))}var Rt="get",St="application/x-www-form-urlencoded";function Nt(e){return e!=null&&typeof e.tagName=="string"}function fi(e){return Nt(e)&&e.tagName.toLowerCase()==="button"}function hi(e){return Nt(e)&&e.tagName.toLowerCase()==="form"}function mi(e){return Nt(e)&&e.tagName.toLowerCase()==="input"}function pi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yi(e,t){return e.button===0&&(!t||t==="_self")&&!pi(e)}function er(e=""){return new URLSearchParams(typeof e=="string"||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(a=>[r,a]):[[r,n]])},[]))}function vi(e,t){let r=er(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var vt=null;function gi(){if(vt===null)try{new FormData(document.createElement("form"),0),vt=!1}catch{vt=!0}return vt}var wi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yt(e){return e!=null&&!wi.has(e)?(K(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${St}"`),null):e}function Ei(e,t){let r,n,a,o,l;if(hi(e)){let s=e.getAttribute("action");n=s?se(s,t):null,r=e.getAttribute("method")||Rt,a=Yt(e.getAttribute("enctype"))||St,o=new FormData(e)}else if(fi(e)||mi(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a