"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["5924"],{74856:function(e,t,r){r.d(t,{OL:()=>tU,SN:()=>e9,TH:()=>eX,UO:()=>e1,aT:()=>N,aj:()=>t_,fp:()=>E,j3:()=>tu,lr:()=>tH,pG:()=>tl,s0:()=>eZ,uX:()=>z});var n,a=r(98661);r(14425),r(34155);/** * react-router v7.6.2 * * 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 o=e=>{throw TypeError(e)},i=(e,t,r)=>t.has(e)||o("Cannot "+r),l=(e,t,r)=>(i(e,t,"read from private field"),r?r.call(e):t.get(e)),s=(e,t,r)=>t.has(e)?o("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),u="popstate";function c(e,t){if(!1===e||null==e)throw Error(t)}function d(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function h(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?m(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function p({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 m(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 y(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),c(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var v=class{constructor(e){if(s(this,n,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(l(this,n).has(e))return l(this,n).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){l(this,n).set(e,t)}};n=new WeakMap;var g=new Set(["lazy","caseSensitive","path","id","index","children"]),w=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function b(e,t,r=[],n={}){return e.map((e,a)=>{let o=[...r,String(a)],i="string"==typeof e.id?e.id:o.join("-");if(c(!0!==e.index||!e.children,"Cannot specify children on an index route"),c(!n[i],`Found a route id collision on id "${i}". Route id's must be globally unique within Data Router usages`),!0===e.index){let r={...e,...t(e),id:i};return n[i]=r,r}{let r={...e,...t(e),id:i,children:void 0};return n[i]=r,e.children&&(r.children=b(e.children,t,o,n)),r}})}function E(e,t,r="/"){return R(e,t,r,!1)}function R(e,t,r,n){let a=P(("string"==typeof t?m(t):t).pathname||"/",r);if(null==a)return null;let o=function e(t,r=[],n=[],a=""){let o=(t,o,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:o,route:t};l.relativePath.startsWith("/")&&(c(l.relativePath.startsWith(a),`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(a.length));let s=T([a,l.relativePath]),u=n.concat(l);if(t.children&&t.children.length>0&&(c(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),e(t.children,r,u,s)),null!=t.path||t.index){var d,h;let e,n;r.push({path:s,score:(d=s,h=t.index,n=(e=d.split("/")).length,e.some(C)&&(n+=-2),h&&(n+=2),e.filter(e=>!C(e)).reduce((e,t)=>e+(S.test(t)?3:""===t?1:10),n)),routesMeta:u})}};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))o(e,t,r);else o(e,t)}),r}(e);!function(e){e.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)})}(o);let i=null;for(let e=0;null==i&&edecodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return d(!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}}(a);i=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e"*"===e;function L(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){d("*"===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,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function P(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 k(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 $(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function M(e){let t=$(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function D(e,t,r,n=!1){let a,o;"string"==typeof e?a=m(e):(c(!(a={...e}).pathname||!a.pathname.includes("?"),k("?","pathname","search",a)),c(!a.pathname||!a.pathname.includes("#"),k("#","pathname","hash",a)),c(!a.search||!a.search.includes("#"),k("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t="/"){var r;let n,{pathname:a,search:o="",hash:i=""}="string"==typeof e?m(e):e;return{pathname:a?a.startsWith("/")?a:(r=a,n=t.replace(/\/+$/,"").split("/"),r.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"):t,search:j(o),hash:A(i)}}(a,o),u=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||d)&&(s.pathname+="/"),s}var T=e=>e.join("/").replace(/\/\/+/g,"/"),O=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",A=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",_=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function N(e,t){return new _(e,"number"==typeof t?{status:t}:t)}var z=(e,t=302)=>{let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},U=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 F(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var H=["POST","PUT","PATCH","DELETE"],I=new Set(H),W=new Set(["GET",...H]),B=new Set([301,302,303,307,308]),Y=new Set([307,308]),q=5288==r.j?{state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}:null,J=5288==r.j?{state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}:null,V=5288==r.j?{state:"unblocked",proceed:void 0,reset:void 0,location:void 0}:null,K=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),G="remix-router-transitions",Q=Symbol("ResetLoaderData");function Z(e,t,r,n,a,o){let i,l;if(a){for(let e of(i=[],t))if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=D(n||".",M(i),P(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=eA(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname="/"===s.pathname?r:T([r,s.pathname])),p(s)}function ee(e,t,r){var n;let a,o;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!W.has(n.toUpperCase())))return{path:t,error:eP(405,{method:r.formMethod})};let i=()=>({path:t,error:eP(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=e$(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!ej(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r} `,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!ej(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return i()}}}if(c("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=eb(r.formData),o=r.formData;else if(r.body instanceof FormData)a=eb(r.body),o=r.body;else if(r.body instanceof URLSearchParams)o=eE(a=r.body);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=eE(a)}catch(e){return i()}let u={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(ej(u.formMethod))return{path:t,submission:u};let d=m(t);return e&&d.search&&eA(d.search)&&a.append("index",""),d.search=`?${a}`,{path:p(d),submission:u}}function et(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m,y,v,g,w){let b,R=w?eM(w[1])?w[1].error:w[1].data:void 0,x=a.createURL(o.location),S=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];b=i.findIndex(t=>t.route.id===e)}else if(w&&eM(w[1])){let e=w[0];b=i.findIndex(t=>t.route.id===e)-1}let C=w?w[1].statusCode:void 0,L=C&&C>=400,P={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...l,actionResult:R,actionStatus:C},k=i.map((a,i)=>{var l,s,h,f,p;let m,y,v,{route:g}=a,w=null;if(null!=b&&i>b?w=!1:g.lazy?w=!0:null==g.loader?w=!1:c?w=er(g,o.loaderData,o.errors):(l=o.loaderData,s=o.matches[i],h=a,m=!s||h.route.id!==s.route.id,y=!l.hasOwnProperty(h.route.id),(m||y)&&(w=!0)),null!==w)return ef(r,n,e,a,u,t,w);let E=!L&&(d||x.pathname+x.search===S.pathname+S.search||x.search!==S.search||(f=o.matches[i],p=a,v=f.route.path,f.pathname!==p.pathname||null!=v&&v.endsWith("*")&&f.params["*"]!==p.params["*"])),R={...P,defaultShouldRevalidate:E},C=en(a,R);return ef(r,n,e,a,u,t,C,R)}),$=[];return p.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),p=s&&"idle"!==s.state&&void 0===s.data,w=E(y,e.path,v);if(!w){if(g&&p)return;$.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(m.has(l))return;let b=e_(w,e.path),R=new AbortController,x=ew(a,e.path,R.signal),S=null;if(h.has(l))h.delete(l),S=ep(r,n,x,w,b,u,t);else if(p)d&&(S=ep(r,n,x,w,b,u,t));else{let e={...P,defaultShouldRevalidate:!L&&d};en(b,e)&&(S=ep(r,n,x,w,b,u,t,e))}S&&$.push({key:l,routeId:e.routeId,path:e.path,matches:S,match:b,request:x,controller:R})}),{dsMatches:k,revalidatingFetchers:$}}function er(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function en(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function ea(e,t,r,n,a){let o;if(e){let t=n[e];c(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=r;let i=b(t.filter(e=>!o.some(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>r.children?.some(r=>e(t,r))))})(e,t))),a,[e||"_","patch",String(o?.length||"0")],n);o.push(...i)}var eo=new WeakMap,ei=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(c(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=eo.get(a);i||(i={},eo.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let t=g.has(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)d(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)d(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=s,s},el=new WeakMap;async function es(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function eu(e){return e.matches.some(e=>e.route.unstable_middleware)?ec(e,!1,()=>es(e),(e,t)=>({[t]:{type:"error",result:e}})):es(e)}async function ec(e,t,r,n){let{matches:a,request:o,params:i,context:l}=e,s={handlerResult:void 0};try{let e=a.flatMap(e=>e.route.unstable_middleware?e.route.unstable_middleware.map(t=>[e.route.id,t]):[]),n=await ed({request:o,params:i,context:l},e,t,s,r);return t?n:s.handlerResult}catch(r){if(!s.middlewareError)throw r;let e=await n(s.middlewareError.error,s.middlewareError.routeId);if(t||!s.handlerResult)return e;return Object.assign(s.handlerResult,e)}}async function ed(e,t,r,n,a,o=0){let i,{request:l}=e;if(l.signal.aborted){if(l.signal.reason)throw l.signal.reason;throw 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[u,c]=s,d=!1,h=async()=>{if(d)throw Error("You may only call `next()` once per middleware");d=!0;let l=await ed(e,t,r,n,a,o+1);if(r)return i=l};try{let t=await c({request:e.request,params:e.params,context:e.context},h);if(!d)return h();if(void 0===t)return i;return t}catch(e){throw n.middlewareError?n.middlewareError.error!==e&&(n.middlewareError={routeId:u,error:e}):n.middlewareError={routeId:u,error:e},e}}function eh(e,t,r,n,a){let o=ei({key:"unstable_middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o,i=r[e.id];if(c(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=el.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{c("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=w.has(e),o=void 0!==i[e]&&"hasErrorBoundary"!==e;a?d(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):o?d(!o,`Route "${i.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.`):r[e]=n}Object.assign(i,r),Object.assign(i,{...n(i),lazy:void 0})})();return el.set(i,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let l=Object.keys(e.lazy),s=[];for(let i of l){if(a&&a.includes(i))continue;let l=ei({key:i,route:e,manifest:r,mapRouteProperties:n});l&&(s.push(l),i===t&&(o=l))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),o?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:o}}(n.route,ej(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ef(e,t,r,n,a,o,i,l=null){let s=!1,u=eh(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:e=>(s=!0,l)?"boolean"==typeof e?en(n,{...l,defaultShouldRevalidate:e}):en(n,l):i,resolve:e=>s||i||e&&"GET"===r.method&&(n.route.lazy||n.route.loader)?ey({request:r,match:n,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}function ep(e,t,r,n,a,o,i,l=null){return n.map(n=>n.route.id!==a.route.id?{...n,shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:eh(e,t,r,n,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ef(e,t,r,n,o,i,!0,l))}async function em(e,t,r,n,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let i={request:t,params:r[0].params,context:a,matches:r},l=o?()=>{throw 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=>ec(i,!1,()=>e({...i,fetcherKey:n,unstable_runClientMiddleware:()=>{throw Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(e,t)=>({[t]:{type:"error",result:e}})),s=await e({...i,fetcherKey:n,unstable_runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return s}async function ey({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let i,l;let s=ej(e.method),u=s?"action":"loader",c=r=>{let n;let i=new Promise((e,t)=>n=t);l=()=>n(),e.signal.addEventListener("abort",l);let s=n=>"function"!=typeof r?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):r({request:e,params:t.params,context:o},...void 0!==n?[n]:[]);return Promise.race([(async()=>{try{let e=await (a?a(e=>s(e)):s());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),i])};try{let a=s?t.route.action:t.route.loader;if(r||n){if(a){let e;let[t]=await Promise.all([c(a).catch(t=>{e=t}),r,n]);if(void 0!==e)throw e;i=t}else{await r;let a=s?t.route.action:t.route.loader;if(a)[i]=await Promise.all([c(a),n]);else{if("action"!==u)return{type:"data",result:void 0};let r=new URL(e.url),n=r.pathname+r.search;throw eP(405,{method:e.method,pathname:n,routeId:t.route.id})}}}else if(a)i=await c(a);else{let t=new URL(e.url),r=t.pathname+t.search;throw eP(404,{pathname:r})}}catch(e){return{type:"error",result:e}}finally{l&&e.signal.removeEventListener("abort",l)}return i}async function ev(e){let{result:t,type:r}=e;if(eO(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new U(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r)return eT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new U(t.init?.status||500,void 0,t.data),statusCode:F(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:F(t)?t.status:void 0};return eT(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function eg(e,t,r){if(K.test(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e),a=null!=P(n.pathname,r);if(n.origin===t.origin&&a)return n.pathname+n.search+n.hash}return e}function ew(e,t,r,n){let a=e.createURL(e$(t)).toString(),o={signal:r};if(n&&ej(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=eb(n.formData):o.body=n.formData}return new Request(a,o)}function eb(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eE(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eR(e,t,r,n,a,o){let{loaderData:i,errors:l}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,s=!1,u={},d=r&&eM(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let h=r.route.id,f=t[h];if(c(!eD(f),"Cannot handle redirect results in processLoaderData"),eM(f)){let t=f.error;if(void 0!==d&&(t=d,d=void 0),l=l||{},a)l[h]=t;else{let r=eC(e,h);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[h]=Q),s||(s=!0,o=F(f.error)?f.error.status:500),f.headers&&(u[h]=f.headers)}else i[h]=f.data,f.statusCode&&200!==f.statusCode&&!s&&(o=f.statusCode),f.headers&&(u[h]=f.headers)}),void 0!==d&&r&&(l={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t,i=o[r];if(c(i,"Did not find corresponding fetcher result"),!a||!a.signal.aborted){if(eM(i)){let t=eC(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:i.error}),e.fetchers.delete(r)}else if(eD(i))c(!1,"Unhandled fetcher revalidation redirect");else{let t=eF(i.data);e.fetchers.set(r,t)}}}),{loaderData:i,errors:l}}function ex(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==Q).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eS(e){return e?eM(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function eC(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 eL(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 eP(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`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.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`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&&(l=`Invalid request method "${n.toUpperCase()}"`)),new U(e||500,i,Error(l),!0)}function ek(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eD(n))return{key:r,result:n}}}function e$(e){return p({..."string"==typeof e?m(e):e,hash:""})}function eM(e){return"error"===e.type}function eD(e){return"redirect"===(e&&e.type)}function eT(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eO(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function ej(e){return I.has(e.toUpperCase())}function eA(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function e_(e,t){let r="string"==typeof t?m(t).search:t.search;if(e[e.length-1].route.index&&eA(r||""))return e[e.length-1];let n=$(e);return n[n.length-1]}function eN(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function ez(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 eU(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 eF(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 eH=a.createContext(null);eH.displayName="DataRouter";var eI=a.createContext(null);eI.displayName="DataRouterState";var eW=a.createContext({isTransitioning:!1});eW.displayName="ViewTransition";var eB=a.createContext(new Map);eB.displayName="Fetchers",a.createContext(null).displayName="Await";var eY=a.createContext(null);eY.displayName="Navigation";var eq=a.createContext(null);eq.displayName="Location";var eJ=a.createContext({outlet:null,matches:[],isDataRoute:!1});eJ.displayName="Route";var eV=a.createContext(null);function eK(){return null!=a.useContext(eq)}function eX(){return c(eK(),"useLocation() may be used only in the context of a component."),a.useContext(eq).location}eV.displayName="RouteError";var eG="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function eQ(e){a.useContext(eY).static||a.useLayoutEffect(e)}function eZ(){let{isDataRoute:e}=a.useContext(eJ);return e?function(){var e;let t;let{router:r}=(e="useNavigate",c(t=a.useContext(eH),e8(e)),t),n=e7("useNavigate"),o=a.useRef(!1);return eQ(()=>{o.current=!0}),a.useCallback(async(e,t={})=>{d(o.current,eG),o.current&&("number"==typeof e?r.navigate(e):await r.navigate(e,{fromRouteId:n,...t}))},[r,n])}():function(){c(eK(),"useNavigate() may be used only in the context of a component.");let e=a.useContext(eH),{basename:t,navigator:r}=a.useContext(eY),{matches:n}=a.useContext(eJ),{pathname:o}=eX(),i=JSON.stringify(M(n)),l=a.useRef(!1);return eQ(()=>{l.current=!0}),a.useCallback((n,a={})=>{if(d(l.current,eG),!l.current)return;if("number"==typeof n){r.go(n);return}let s=D(n,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:T([t,s.pathname])),(a.replace?r.replace:r.push)(s,a.state,a)},[t,r,i,o,e])}()}var e0=a.createContext(null);function e1(){let{matches:e}=a.useContext(eJ),t=e[e.length-1];return t?t.params:{}}function e4(e,{relative:t}={}){let{matches:r}=a.useContext(eJ),{pathname:n}=eX(),o=JSON.stringify(M(r));return a.useMemo(()=>D(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}var e2=a.createElement(function(){let e,t,r;let n=(e=a.useContext(eV),t=e6("useRouteError"),r=e7("useRouteError"),void 0!==e?e:t.errors?.[r]),o=F(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"2px 4px",backgroundColor:l},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=a.createElement(a.Fragment,null,a.createElement("p",null,"\uD83D\uDCBF Hey developer \uD83D\uDC4B"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:s},"ErrorBoundary")," or"," ",a.createElement("code",{style:s},"errorElement")," prop on your route.")),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},o),i?a.createElement("pre",{style:{padding:"0.5rem",backgroundColor:l}},i):null,u)},null),e5=class extends a.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?a.createElement(eJ.Provider,{value:this.props.routeContext},a.createElement(eV.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function e3({routeContext:e,match:t,children:r}){let n=a.useContext(eH);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(eJ.Provider,{value:e},r)}function e8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e6(e){let t=a.useContext(eI);return c(t,e8(e)),t}function e7(e){let t;let r=(c(t=a.useContext(eJ),e8(e)),t),n=r.matches[r.matches.length-1];return c(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function e9(){let{matches:e,loaderData:t}=e6("useMatches");return a.useMemo(()=>e.map(e=>x(e,t)),[e,t])}var te={};function tt(e,t,r){t||te[e]||(te[e]=!0,d(!1,r))}var tr=5288==r.j?{}:null;function tn(e,t){e||tr[t]||(tr[t]=!0,console.warn(t))}function ta(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&d(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:a.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&d(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&d(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var to=5288==r.j?["HydrateFallback","hydrateFallbackElement"]:null,ti=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 tl({router:e,flushSync:t}){let[r,n]=a.useState(e.state),[o,i]=a.useState(),[l,s]=a.useState({isTransitioning:!1}),[u,c]=a.useState(),[d,h]=a.useState(),[f,p]=a.useState(),m=a.useRef(new Map),y=a.useCallback((r,{deletedFetchers:o,flushSync:l,viewTransitionOpts:f})=>{r.fetchers.forEach((e,t)=>{void 0!==e.data&&m.current.set(t,e.data)}),o.forEach(e=>m.current.delete(e)),tn(!1===l||null!=t,'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!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(tn(null==f||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."),!f||!y){t&&l?t(()=>n(r)):a.startTransition(()=>n(r));return}if(t&&l){t(()=>{d&&(u&&u.resolve(),d.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:f.currentLocation,nextLocation:f.nextLocation})});let a=e.window.document.startViewTransition(()=>{t(()=>n(r))});a.finished.finally(()=>{t(()=>{c(void 0),h(void 0),i(void 0),s({isTransitioning:!1})})}),t(()=>h(a));return}d?(u&&u.resolve(),d.skipTransition(),p({state:r,currentLocation:f.currentLocation,nextLocation:f.nextLocation})):(i(r),s({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}))},[e.window,t,d,u]);a.useLayoutEffect(()=>e.subscribe(y),[e,y]),a.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new ti)},[l]),a.useEffect(()=>{if(u&&o&&e.window){let t=u.promise,r=e.window.document.startViewTransition(async()=>{a.startTransition(()=>n(o)),await t});r.finished.finally(()=>{c(void 0),h(void 0),i(void 0),s({isTransitioning:!1})}),h(r)}},[o,u,e.window]),a.useEffect(()=>{u&&o&&r.location.key===o.location.key&&u.resolve()},[u,d,r.location,o]),a.useEffect(()=>{!l.isTransitioning&&f&&(i(f.state),s({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),p(void 0))},[l.isTransitioning,f]);let v=a.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),g=e.basename||"/",w=a.useMemo(()=>({router:e,navigator:v,static:!1,basename:g}),[e,v,g]);return a.createElement(a.Fragment,null,a.createElement(eH.Provider,{value:w},a.createElement(eI.Provider,{value:r},a.createElement(eB.Provider,{value:m.current},a.createElement(eW.Provider,{value:l},a.createElement(tc,{basename:g,location:r.location,navigationType:r.historyAction,navigator:v},a.createElement(ts,{routes:e.routes,future:e.future,state:r})))))),null)}var ts=a.memo(function({routes:e,future:t,state:r}){return function(e,t,r,n){let o;c(eK(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=a.useContext(eY),{matches:l}=a.useContext(eJ),s=l[l.length-1],u=s?s.params:{},h=s?s.pathname:"/",f=s?s.pathnameBase:"/",p=s&&s.route;{let e=p&&p.path||"";tt(h,!p||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (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=eX();if(t){let e="string"==typeof t?m(t):t;c("/"===f||e.pathname?.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 "${f}" but pathname "${e.pathname}" was given in the \`location\` prop.`),o=e}else o=y;let v=o.pathname||"/",g=v;if("/"!==f){let e=f.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=E(e,{pathname:g});d(p||null!=w,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),d(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.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 b=function(e,t=[],r=null,n=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let o=e,i=r?.errors;if(null!=i){let e=o.findIndex(e=>e.route.id&&i?.[e.route.id]!==void 0);c(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,s=-1;if(r)for(let e=0;e=0?o.slice(0,s+1):[o[0]];break}}}return o.reduceRight((e,n,u)=>{let c;let d=!1,h=null,f=null;r&&(c=i&&n.route.id?i[n.route.id]:void 0,h=n.route.errorElement||e2,l&&(s<0&&0===u?(tt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):s===u&&(d=!0,f=n.route.hydrateFallbackElement||null)));let p=t.concat(o.slice(0,u+1)),m=()=>{let t;return t=c?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(e3,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===u)?a.createElement(e5,{location:r.location,revalidation:r.revalidation,component:h,error:c,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}(w&&w.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:T([f,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:T([f,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,r,n);return t&&b?a.createElement(eq.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...o},navigationType:"POP"}},b):b}(e,void 0,r,t)});function tu(e){var t;let r;return t=e.context,(r=a.useContext(eJ).outlet)?a.createElement(e0.Provider,{value:t},r):r}function tc({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1}){c(!eK(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=a.useMemo(()=>({basename:l,navigator:o,static:i,future:{}}),[l,o,i]);"string"==typeof r&&(r=m(r));let{pathname:u="/",search:h="",hash:f="",state:p=null,key:y="default"}=r,v=a.useMemo(()=>{let e=P(u,l);return null==e?null:{location:{pathname:e,search:h,hash:f,state:p,key:y},navigationType:n}},[l,u,h,f,p,y,n]);return(d(null!=v,` is not able to match the URL "${u}${h}${f}" because it does not start with the basename, so the won't render anything.`),null==v)?null:a.createElement(eY.Provider,{value:s},a.createElement(eq.Provider,{children:t,value:v}))}a.Component;var td="get",th="application/x-www-form-urlencoded";function tf(e){return null!=e&&"string"==typeof e.tagName}function tp(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}var tm=null,ty=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tv(e){return null==e||ty.has(e)?e:(d(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${th}"`),null)}function tg(e,t){if(!1===e||null==e)throw Error(t)}async function tw(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tb(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function tE(e,t,r){var n,a;let o,i;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await tw(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(tb).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),o=new Set,i=new Set(void 0),n.reduce((e,t)=>{if(a&&(null==t||"string"!=typeof t.page)&&"script"===t.as&&t.href&&i.has(t.href))return e;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return o.has(r)||(o.add(r),e.push({key:r,link:t})),e},[])}function tR(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function tx(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis,Symbol("SingleFetchRedirect");var tS=new Set([100,101,204,205]);function tC({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:o}=t$();return o.root?.Layout&&!r?n:a.createElement("html",{lang:"en"},a.createElement("head",null,a.createElement("meta",{charSet:"utf-8"}),a.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),a.createElement("title",null,e)),a.createElement("body",null,a.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?a.createElement(tj,null):null)))}function tL(){let e=a.useContext(eH);return tg(e,"You must render this element inside a element"),e}function tP(){let e=a.useContext(eI);return tg(e,"You must render this element inside a element"),e}a.Component;var tk=a.createContext(void 0);function t$(){let e=a.useContext(tk);return tg(e,"You must render this element inside a element"),e}function tM(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function tD({page:e,...t}){let{router:r}=tL(),n=a.useMemo(()=>E(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?a.createElement(tT,{page:e,matches:n,...t}):null}function tT({page:e,matches:t,...r}){let n=eX(),{manifest:o,routeModules:i}=t$(),{basename:l}=tL(),{loaderData:s,matches:u}=tP(),c=a.useMemo(()=>tR(e,t,u,o,n,"data"),[e,t,u,o,n]),d=a.useMemo(()=>tR(e,t,u,o,n,"assets"),[e,t,u,o,n]),h=a.useMemo(()=>{let r;if(e===n.pathname+n.search+n.hash)return[];let a=new Set,u=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&i[e.route.id]?.shouldRevalidate?u=!0:t.hasClientLoader?u=!0:a.add(e.route.id))}),0===a.size)return[];let d=("/"===(r="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e).pathname?r.pathname="_root.data":l&&"/"===P(r.pathname,l)?r.pathname=`${l.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r);return u&&a.size>0&&d.searchParams.set("_routes",t.filter(e=>a.has(e.route.id)).map(e=>e.route.id).join(",")),[d.pathname+d.search]},[l,s,n,o,c,t,e,i]),f=a.useMemo(()=>tx(d,o),[d,o]),p=function(e){let{manifest:t,routeModules:r}=t$(),[n,o]=a.useState([]);return a.useEffect(()=>{let n=!1;return tE(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),n}(d);return a.createElement(a.Fragment,null,h.map(e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),f.map(e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>a.createElement("link",{key:e,...t})))}tk.displayName="FrameworkContext";var tO=!1;function tj(e){var t,r;let{manifest:n,serverHandoffString:o,isSpaMode:i,renderMeta:l,routeDiscovery:s,ssr:u}=t$(),{router:c,static:d,staticContext:h}=tL(),{matches:f}=tP(),p="lazy"===s.mode&&!0===u;l&&(l.didRenderScripts=!0);let m=(t=f,r=0,i&&!tO?[t[0]]:t);a.useEffect(()=>{tO=!0},[]);let y=a.useMemo(()=>{let t=h?`window.__reactRouterContext = ${o};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",r=d?`${n.hmr?.runtime?`import ${JSON.stringify(n.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(n.url)}`}; ${m.map((e,t)=>{let r=`route${t}`,a=n.routes[e.route.id];tg(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:o,clientLoaderModule:i,clientMiddlewareModule:l,hydrateFallbackModule:s,module:u}=a,c=[...o?[{module:o,varName:`${r}_clientAction`}]:[],...i?[{module:i,varName:`${r}_clientLoader`}]:[],...l?[{module:l,varName:`${r}_clientMiddleware`}]:[],...s?[{module:s,varName:`${r}_HydrateFallback`}]:[],{module:u,varName:`${r}_main`}];return 1===c.length?`import * as ${r} from ${JSON.stringify(u)};`:[c.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${r} = {${c.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")} ${p?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),a=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(a.pop();a.length>0;)o.push(`/${a.join("/")}`),a.pop();o.forEach(e=>{let t=E(r.routes,e,r.basename);t&&t.forEach(e=>n.add(e.route.id))});let i=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:i,sri:!!e||void 0}}(n,c),null,2)};`:""} window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}}; import(${JSON.stringify(n.entry.module)});`:" ";return a.createElement(a.Fragment,null,a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t},type:void 0}),a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r},type:"module",async:!0}))},[]),v=tO?[]:[...new Set(n.entry.imports.concat(tx(m,n,{includeHydrateFallback:!0})))],g="object"==typeof n.sri?n.sri:{};return tO?null:a.createElement(a.Fragment,null,"object"==typeof n.sri?a.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:g})}}):null,p?null:a.createElement("link",{rel:"modulepreload",href:n.url,crossOrigin:e.crossOrigin,integrity:g[n.url],suppressHydrationWarning:!0}),a.createElement("link",{rel:"modulepreload",href:n.entry.module,crossOrigin:e.crossOrigin,integrity:g[n.entry.module],suppressHydrationWarning:!0}),v.map(t=>a.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:g[t],suppressHydrationWarning:!0})),y)}var tA="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tA&&(window.__reactRouterVersion="7.6.2")}catch(e){}function t_(e,t){let r;return(function(e){let t,r,n,a,o;let i=e.window?e.window:"undefined"!=typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement;c(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],u=e.mapRouteProperties||X,h={},p=b(e.routes,u,void 0,h),m=e.basename||"/",g=e.dataStrategy||eu,w={unstable_middleware:!1,...e.future},S=null,C=new Set,L=null,k=null,$=null,M=null!=e.hydrationData,D=E(p,e.history.location,m),T=!1,O=null;if(null!=D||e.patchRoutesOnNavigation){if(D&&!e.hydrationData&&e7(D,p,e.history.location.pathname).active&&(D=null),D){if(D.some(e=>e.route.lazy))r=!1;else if(D.some(e=>e.route.loader)){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=D.findIndex(e=>void 0!==n[e.route.id]);r=D.slice(0,e+1).every(e=>!er(e.route,t,n))}else r=D.every(e=>!er(e.route,t,n))}else r=!0}else{r=!1,D=[];let t=e7(null,p,e.history.location.pathname);t.active&&t.matches&&(T=!0,D=t.matches)}}else{let t=eP(404,{pathname:e.history.location.pathname}),{matches:n,route:a}=eL(p);r=!0,D=n,O={[a.id]:t}}let j={historyAction:e.history.action,location:e.history.location,matches:D,initialized:r,navigation:q,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||O,fetchers:new Map,blockers:new Map},A="POP",_=!1,N=!1,z=new Map,U=null,H=!1,I=!1,W=new Set,Q=new Map,en=0,eo=-1,ei=new Map,el=new Set,es=new Map,ec=new Map,ed=new Set,eh=new Map,ef=null;function ey(e,t={}){j={...j,...e};let r=[],n=[];j.fetchers.forEach((e,t)=>{"idle"===e.state&&(ed.has(t)?r.push(t):n.push(t))}),ed.forEach(e=>{j.fetchers.has(e)||Q.has(e)||r.push(e)}),[...C].forEach(e=>e(j,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>eG(e)),n.forEach(e=>j.fetchers.delete(e))}function eb(r,n,{flushSync:a}={}){let o,i,l=null!=j.actionData&&null!=j.navigation.formMethod&&ej(j.navigation.formMethod)&&"loading"===j.navigation.state&&r.state?._isRedirect!==!0;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?j.actionData:null;let s=n.loaderData?ex(j.loaderData,n.loaderData,n.matches||[],n.errors):j.loaderData,u=j.blockers;u.size>0&&(u=new Map(u)).forEach((e,t)=>u.set(t,V));let c=!0===_||null!=j.navigation.formMethod&&ej(j.navigation.formMethod)&&r.state?._isRedirect!==!0;if(t&&(p=t,t=void 0),H||"POP"===A||("PUSH"===A?e.history.push(r,r.state):"REPLACE"===A&&e.history.replace(r,r.state)),"POP"===A){let e=z.get(j.location.pathname);e&&e.has(r.pathname)?i={currentLocation:j.location,nextLocation:r}:z.has(r.pathname)&&(i={currentLocation:r,nextLocation:j.location})}else if(N){let e=z.get(j.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),z.set(j.location.pathname,e)),i={currentLocation:j.location,nextLocation:r}}ey({...n,actionData:o,loaderData:s,historyAction:A,location:r,initialized:!0,navigation:q,revalidation:"idle",restoreScrollPosition:e6(r,n.matches||j.matches),preventScrollReset:c,blockers:u},{viewTransitionOpts:i,flushSync:!0===a}),A="POP",_=!1,N=!1,H=!1,I=!1,ef?.resolve(),ef=null}async function eE(t,r){if("number"==typeof t){e.history.go(t);return}let{path:n,submission:a,error:o}=ee(!1,Z(j.location,j.matches,m,t,r?.fromRouteId,r?.relative),r),i=j.location,l=f(j.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let s=r&&null!=r.replace?r.replace:void 0,u="PUSH";!0===s?u="REPLACE":!1===s||null!=a&&ej(a.formMethod)&&a.formAction===j.location.pathname+j.location.search&&(u="REPLACE");let c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,d=!0===(r&&r.flushSync),h=e5({currentLocation:i,nextLocation:l,historyAction:u});if(h){e2(h,{state:"blocked",location:l,proceed(){e2(h,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),eE(t,r)},reset(){let e=new Map(j.blockers);e.set(h,V),ey({blockers:e})}});return}await e$(u,l,{submission:a,pendingError:o,preventScrollReset:c,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:d})}async function e$(r,n,o){var i,l,s,u;let c;a&&a.abort(),a=null,A=r,H=!0===(o&&o.startUninterruptedRevalidation),i=j.location,l=j.matches,L&&$&&(L[e8(i,l)]=$()),_=!0===(o&&o.preventScrollReset),N=!0===(o&&o.enableViewTransition);let d=t||p,h=o&&o.overrideNavigation,f=o?.initialHydration&&j.matches&&j.matches.length>0&&!T?j.matches:E(d,n,m),y=!0===(o&&o.flushSync);if(f&&j.initialized&&!I&&(s=j.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash))&&!(o&&o.submission&&ej(o.submission.formMethod))){eb(n,{matches:f},{flushSync:y});return}let g=e7(f,d,n.pathname);if(g.active&&g.matches&&(f=g.matches),!f){let{error:e,notFoundMatches:t,route:r}=e3(n.pathname);eb(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:y});return}a=new AbortController;let w=ew(e.history,n,a.signal,o&&o.submission),b=new v(e.unstable_getContext?await e.unstable_getContext():void 0);if(o&&o.pendingError)c=[eC(f).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&ej(o.submission.formMethod)){let t=await eT(w,n,o.submission,f,b,g.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:y});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(eM(r)&&F(r.error)&&404===r.error.status){a=null,eb(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}f=t.matches||f,c=t.pendingActionResult,h=ez(n,o.submission),y=!1,g.active=!1,w=ew(e.history,w.url,w.signal)}let{shortCircuited:R,matches:x,loaderData:S,errors:C}=await eA(w,n,f,b,g.active,h,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,y,c);!R&&(a=null,eb(n,{matches:x||f,...eS(c),loaderData:S,errors:C}))}async function eT(e,t,r,n,a,o,i,l={}){var c;let d;if(eJ(),ey({navigation:{state:"submitting",location:t,formMethod:(c=r).formMethod,formAction:c.formAction,formEncType:c.formEncType,formData:c.formData,json:c.json,text:c.text}},{flushSync:!0===l.flushSync}),o){let r=await e9(n,t.pathname,e.signal);if("aborted"===r.type)return{shortCircuited:!0};if("error"===r.type){let e=eC(r.partialMatches).route.id;return{matches:r.partialMatches,pendingActionResult:[e,{type:"error",error:r.error}]}}if(r.matches)n=r.matches;else{let{notFoundMatches:e,error:r,route:n}=e3(t.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:r}]}}}let f=e_(n,t);if(f.route.action||f.route.lazy){let t=ep(u,h,e,n,f,i?[]:s,a),r=await eY(e,t,a,null);if(!(d=r[f.route.id])){for(let e of n)if(r[e.route.id]){d=r[e.route.id];break}}if(e.signal.aborted)return{shortCircuited:!0}}else d={type:"error",error:eP(405,{method:e.method,pathname:t.pathname,routeId:f.route.id})};if(eD(d)){let t;return t=l&&null!=l.replace?l.replace:eg(d.response.headers.get("Location"),new URL(e.url),m)===j.location.pathname+j.location.search,await eB(e,d,!0,{submission:r,replace:t}),{shortCircuited:!0}}if(eM(d)){let e=eC(n,f.route.id);return!0!==(l&&l.replace)&&(A="PUSH"),{matches:n,pendingActionResult:[e.route.id,d,f.route.id]}}return{matches:n,pendingActionResult:[f.route.id,d]}}async function eA(r,n,o,i,l,c,d,f,y,v,g,w){let b=c||ez(n,d),E=d||f||eN(b),R=!H&&!v;if(l){if(R){let e=eH(w);ey({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:g})}let e=await e9(o,n.pathname,r.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=eC(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)o=e.matches;else{let{error:e,notFoundMatches:t,route:r}=e3(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let x=t||p,{dsMatches:S,revalidatingFetchers:C}=et(r,i,u,h,e.history,j,o,E,n,v?[]:s,!0===v,I,W,ed,es,el,x,m,null!=e.patchRoutesOnNavigation,w);if(eo=++en,!e.dataStrategy&&!S.some(e=>e.shouldLoad)&&0===C.length){let e=e0();return eb(n,{matches:o,loaderData:{},errors:w&&eM(w[1])?{[w[0]]:w[1].error}:null,...eS(w),...e?{fetchers:new Map(j.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(R){let e={};if(!l){e.navigation=b;let t=eH(w);void 0!==t&&(e.actionData=t)}C.length>0&&(e.fetchers=(C.forEach(e=>{let t=j.fetchers.get(e.key),r=eU(void 0,t?t.data:void 0);j.fetchers.set(e.key,r)}),new Map(j.fetchers))),ey(e,{flushSync:g})}C.forEach(e=>{eQ(e.key),e.controller&&Q.set(e.key,e.controller)});let L=()=>C.forEach(e=>eQ(e.key));a&&a.signal.addEventListener("abort",L);let{loaderResults:P,fetcherResults:k}=await eq(S,C,r,i);if(r.signal.aborted)return{shortCircuited:!0};a&&a.signal.removeEventListener("abort",L),C.forEach(e=>Q.delete(e.key));let $=ek(P);if($)return await eB(r,$.result,!0,{replace:y}),{shortCircuited:!0};if($=ek(k))return el.add($.key),await eB(r,$.result,!0,{replace:y}),{shortCircuited:!0};let{loaderData:M,errors:D}=eR(j,o,P,w,C,k);v&&j.errors&&(D={...j.errors,...D});let T=e0(),O=e1(eo);return{matches:o,loaderData:M,errors:D,...T||O||C.length>0?{fetchers:new Map(j.fetchers)}:{}}}function eH(e){return e&&!eM(e[1])?{[e[0]]:e[1].data}:j.actionData?0===Object.keys(j.actionData).length?null:j.actionData:void 0}async function eI(r,n,o,i,l,d,f,y,v,g){var w,b;function R(e){if(!e.route.action&&!e.route.lazy){let e=eP(405,{method:g.formMethod,pathname:o,routeId:n});return eK(r,n,e,{flushSync:y}),!0}return!1}if(eJ(),es.delete(r),!f&&R(i))return;let x=j.fetchers.get(r);eV(r,(w=g,b=x,{state:"submitting",formMethod:w.formMethod,formAction:w.formAction,formEncType:w.formEncType,formData:w.formData,json:w.json,text:w.text,data:b?b.data:void 0}),{flushSync:y});let S=new AbortController,C=ew(e.history,o,S.signal,g);if(f){let e=await e9(l,o,C.signal,r);if("aborted"===e.type)return;if("error"===e.type){eK(r,n,e.error,{flushSync:y});return}if(e.matches){if(R(i=e_(l=e.matches,o)))return}else{eK(r,n,eP(404,{pathname:o}),{flushSync:y});return}}Q.set(r,S);let L=en,P=ep(u,h,C,l,i,s,d),k=(await eY(C,P,d,r))[i.route.id];if(C.signal.aborted){Q.get(r)===S&&Q.delete(r);return}if(ed.has(r)){if(eD(k)||eM(k)){eV(r,eF(void 0));return}}else{if(eD(k))return(Q.delete(r),eo>L)?(eV(r,eF(void 0)),void 0):(el.add(r),eV(r,eU(g)),eB(C,k,!1,{fetcherSubmission:g,preventScrollReset:v}));if(eM(k)){eK(r,n,k.error);return}}let $=j.navigation.location||j.location,M=ew(e.history,$,S.signal),D=t||p,T="idle"!==j.navigation.state?E(D,j.navigation.location,m):j.matches;c(T,"Didn't find any matches after fetcher action");let O=++en;ei.set(r,O);let _=eU(g,k.data);j.fetchers.set(r,_);let{dsMatches:N,revalidatingFetchers:z}=et(M,d,u,h,e.history,j,T,g,$,s,!1,I,W,ed,es,el,D,m,null!=e.patchRoutesOnNavigation,[i.route.id,k]);z.filter(e=>e.key!==r).forEach(e=>{let t=e.key,r=j.fetchers.get(t),n=eU(void 0,r?r.data:void 0);j.fetchers.set(t,n),eQ(t),e.controller&&Q.set(t,e.controller)}),ey({fetchers:new Map(j.fetchers)});let U=()=>z.forEach(e=>eQ(e.key));S.signal.addEventListener("abort",U);let{loaderResults:F,fetcherResults:H}=await eq(N,z,M,d);if(S.signal.aborted)return;if(S.signal.removeEventListener("abort",U),ei.delete(r),Q.delete(r),z.forEach(e=>Q.delete(e.key)),j.fetchers.has(r)){let e=eF(k.data);j.fetchers.set(r,e)}let B=ek(F);if(B)return eB(M,B.result,!1,{preventScrollReset:v});if(B=ek(H))return el.add(B.key),eB(M,B.result,!1,{preventScrollReset:v});let{loaderData:Y,errors:q}=eR(j,T,F,void 0,z,H);e1(O),"loading"===j.navigation.state&&O>eo?(c(A,"Expected pending action"),a&&a.abort(),eb(j.navigation.location,{matches:T,loaderData:Y,errors:q,fetchers:new Map(j.fetchers)})):(ey({errors:q,loaderData:ex(j.loaderData,Y,T,q),fetchers:new Map(j.fetchers)}),I=!1)}async function eW(t,r,n,a,o,i,l,c,d,f){let p=j.fetchers.get(t);eV(t,eU(f,p?p.data:void 0),{flushSync:c});let m=new AbortController,y=ew(e.history,n,m.signal);if(l){let e=await e9(o,n,y.signal,t);if("aborted"===e.type)return;if("error"===e.type){eK(t,r,e.error,{flushSync:c});return}if(e.matches)a=e_(o=e.matches,n);else{eK(t,r,eP(404,{pathname:n}),{flushSync:c});return}}Q.set(t,m);let v=en,g=ep(u,h,y,o,a,s,i),w=(await eY(y,g,i,t))[a.route.id];if(Q.get(t)===m&&Q.delete(t),!y.signal.aborted){if(ed.has(t)){eV(t,eF(void 0));return}if(eD(w)){if(eo>v){eV(t,eF(void 0));return}el.add(t),await eB(y,w,!1,{preventScrollReset:d});return}if(eM(w)){eK(t,r,w.error);return}eV(t,eF(w.data))}}async function eB(e,t,r,{submission:n,fetcherSubmission:o,preventScrollReset:s,replace:u}={}){t.response.headers.has("X-Remix-Revalidate")&&(I=!0);let d=t.response.headers.get("Location");c(d,"Expected a Location header on the redirect Response"),d=eg(d,new URL(e.url),m);let h=f(j.location,d,{_isRedirect:!0});if(l){let e=!1;if(t.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(K.test(d)){let t=y(d,!0);e=t.origin!==i.location.origin||null==P(t.pathname,m)}if(e){u?i.location.replace(d):i.location.assign(d);return}}a=null;let p=!0===u||t.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:v,formAction:g,formEncType:w}=j.navigation;!n&&!o&&v&&g&&w&&(n=eN(j.navigation));let b=n||o;if(Y.has(t.response.status)&&b&&ej(b.formMethod))await e$(p,h,{submission:{...b,formAction:d},preventScrollReset:s||_,enableViewTransition:r?N:void 0});else{let e=ez(h,n);await e$(p,h,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:s||_,enableViewTransition:r?N:void 0})}}async function eY(e,t,r,n){let a;let o={};try{a=await em(g,e,t,n,r,!1)}catch(e){return t.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:"error",error:e}}),o}if(e.signal.aborted)return o;for(let[r,n]of Object.entries(a)){var i;if(eO((i=n).result)&&B.has(i.result.status)){let a=n.result;o[r]={type:"redirect",response:function(e,t,r,n,a){let o=e.headers.get("Location");if(c(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!K.test(o)){let i=n.slice(0,n.findIndex(e=>e.route.id===r)+1);o=Z(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}(a,e,r,t,m)}}else o[r]=await ev(n)}return o}async function eq(e,t,r,n){let a=eY(r,e,n,null),o=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:eP(404,{pathname:e.path})}});{let t=(await eY(e.request,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function eJ(){I=!0,es.forEach((e,t)=>{Q.has(t)&&W.add(t),eQ(t)})}function eV(e,t,r={}){j.fetchers.set(e,t),ey({fetchers:new Map(j.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eK(e,t,r,n={}){let a=eC(j.matches,t);eG(e),ey({errors:{[a.route.id]:r},fetchers:new Map(j.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eX(e){return ec.set(e,(ec.get(e)||0)+1),ed.has(e)&&ed.delete(e),j.fetchers.get(e)||J}function eG(e){let t=j.fetchers.get(e);Q.has(e)&&!(t&&"loading"===t.state&&ei.has(e))&&eQ(e),es.delete(e),ei.delete(e),el.delete(e),ed.delete(e),W.delete(e),j.fetchers.delete(e)}function eQ(e){let t=Q.get(e);t&&(t.abort(),Q.delete(e))}function eZ(e){for(let t of e){let e=eF(eX(t).data);j.fetchers.set(t,e)}}function e0(){let e=[],t=!1;for(let r of el){let n=j.fetchers.get(r);c(n,`Expected fetcher: ${r}`),"loading"===n.state&&(el.delete(r),e.push(r),t=!0)}return eZ(e),t}function e1(e){let t=[];for(let[r,n]of ei)if(n0}function e4(e){j.blockers.delete(e),eh.delete(e)}function e2(e,t){let r=j.blockers.get(e)||V;c("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(j.blockers);n.set(e,t),ey({blockers:n})}function e5({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eh.size)return;eh.size>1&&d(!1,"A router only supports one blocker at a time");let n=Array.from(eh.entries()),[a,o]=n[n.length-1],i=j.blockers.get(a);if((!i||"proceeding"!==i.state)&&o({currentLocation:e,nextLocation:t,historyAction:r}))return a}function e3(e){let r=eP(404,{pathname:e}),{matches:n,route:a}=eL(t||p);return{notFoundMatches:n,route:a,error:r}}function e8(e,t){return k&&k(e,t.map(e=>x(e,j.loaderData)))||e.key}function e6(e,t){if(L){let r=L[e8(e,t)];if("number"==typeof r)return r}return null}function e7(t,r,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:R(r,n,m,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:R(r,n,m,!0)}}return{active:!1,matches:null}}async function e9(r,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:r};let i=r;for(;;){let r=null==t,l=t||p,s=h;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||ea(e,t,l,s,u)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{r&&!a.aborted&&(p=[...p])}if(a.aborted)return{type:"aborted"};let c=E(l,n,m);if(c)return{type:"success",matches:c};let d=R(l,n,m,!0);if(!d||i.length===d.length&&i.every((e,t)=>e.route.id===d[t].route.id))return{type:"success",matches:null};i=d}}return n={get basename(){return m},get future(){return w},get state(){return j},get routes(){return p},get window(){return i},initialize:function(){if(S=e.history.listen(({action:t,location:r,delta:n})=>{if(o){o(),o=void 0;return}d(0===eh.size||null!=n,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=e5({currentLocation:j.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{o=e});e.history.go(-1*n),e2(a,{state:"blocked",location:r,proceed(){e2(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(j.blockers);e.set(a,V),ey({blockers:e})}});return}return e$(t,r)}),l){!function(e,t){try{let r=e.sessionStorage.getItem(G);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(i,z);let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(G,JSON.stringify(r))}catch(e){d(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(i,z);i.addEventListener("pagehide",e),U=()=>i.removeEventListener("pagehide",e)}return j.initialized||e$("POP",j.location,{initialHydration:!0}),n},subscribe:function(e){return C.add(e),()=>C.delete(e)},enableScrollRestoration:function(e,t,r){if(L=e,$=t,k=r||null,!M&&j.navigation===q){M=!0;let e=e6(j.location,j.matches);null!=e&&ey({restoreScrollPosition:e})}return()=>{L=null,$=null,k=null}},navigate:eE,fetch:async function r(r,n,a,o){eQ(r);let i=!0===(o&&o.flushSync),l=t||p,s=Z(j.location,j.matches,m,a,n,o?.relative),u=E(l,s,m),c=e7(u,l,s);if(c.active&&c.matches&&(u=c.matches),!u){eK(r,n,eP(404,{pathname:s}),{flushSync:i});return}let{path:d,submission:h,error:f}=ee(!0,s,o);if(f){eK(r,n,f,{flushSync:i});return}let y=e_(u,d),g=new v(e.unstable_getContext?await e.unstable_getContext():void 0),w=!0===(o&&o.preventScrollReset);if(h&&ej(h.formMethod)){await eI(r,n,d,y,u,g,c.active,i,w,h);return}es.set(r,{routeId:n,path:d}),await eW(r,n,d,y,u,g,c.active,i,w,h)},revalidate:function(){let e,t,r;ef||(ef={promise:r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{a(e);try{await r}catch(e){}}}),resolve:e,reject:t}),eJ(),ey({revalidation:"loading"});let n=ef.promise;return"submitting"===j.navigation.state||("idle"===j.navigation.state?e$(j.historyAction,j.location,{startUninterruptedRevalidation:!0}):e$(A||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:!0===N})),n},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eX,deleteFetcher:function(e){let t=(ec.get(e)||0)-1;t<=0?(ec.delete(e),ed.add(e)):ec.set(e,t),ey({fetchers:new Map(j.fetchers)})},dispose:function(){S&&S(),U&&U(),C.clear(),a&&a.abort(),j.fetchers.forEach((e,t)=>eG(t)),j.blockers.forEach((e,t)=>e4(t))},getBlocker:function(e,t){let r=j.blockers.get(e)||V;return eh.get(e)!==t&&eh.set(e,t),r},deleteBlocker:e4,patchRoutes:function(e,r){let n=null==t;ea(e,r,t||p,h,u),n&&(p=[...p],ey({}))},_internalFetchControllers:Q,_internalSetRoutes:function(e){t=b(e,u,void 0,h={})}}})({basename:t?.basename,unstable_getContext:t?.unstable_getContext,future:t?.future,history:function(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,c=d();function d(){return(i.state||{idx:null}).idx}function p(){l="POP";let e=d(),t=null==e?null:e-c;c=e,s&&s({action:l,location:m.location,delta:t})}null==c&&(c=0,i.replaceState({...i.state,idx:c},""));let m={get action(){return l},get location(){return e(a,i)},listen(e){if(s)throw Error("A history only accepts one active listener");return a.addEventListener(u,p),s=e,()=>{a.removeEventListener(u,p),s=null}},createHref:e=>t(a,e),createURL:function(e){return y(e)},encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let r=f(m.location,e,t),n=h(r,c=d()+1),u=m.createHref(r);try{i.pushState(n,"",u)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(u)}o&&s&&s({action:l,location:m.location,delta:1})},replace:function(e,t){l="REPLACE";let n=f(m.location,e,t);r&&r(n,e);let a=h(n,c=d()),u=m.createHref(n);i.replaceState(a,"",u),o&&s&&s({action:l,location:m.location,delta:0})},go:e=>i.go(e)};return m}(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return f("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:p(t)},null,e)}({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new U(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:ta,hydrationRouteProperties:to,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}var tN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tz=a.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:o,replace:i,state:l,target:s,to:u,preventScrollReset:h,viewTransition:f,...m},y){let v,{basename:g}=a.useContext(eY),w="string"==typeof u&&tN.test(u),b=!1;if("string"==typeof u&&w&&(v=u,tA))try{let e=new URL(window.location.href),t=new URL(u.startsWith("//")?e.protocol+u:u),r=P(t.pathname,g);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:b=!0}catch(e){d(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=function(e,{relative:t}={}){c(eK(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=a.useContext(eY),{hash:o,pathname:i,search:l}=e4(e,{relative:t}),s=i;return"/"!==r&&(s="/"===i?r:T([r,i])),n.createHref({pathname:s,search:l,hash:o})}(u,{relative:n}),[R,x,S]=function(e,t){let r=a.useContext(tk),[n,o]=a.useState(!1),[i,l]=a.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,f=a.useRef(null);a.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),a.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{o(!0)},m=()=>{o(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:tM(s,p),onBlur:tM(u,m),onMouseEnter:tM(c,p),onMouseLeave:tM(d,m),onTouchStart:tM(h,p)}]:[!1,f,{}]}(r,m),C=function(e,{target:t,replace:r,state:n,preventScrollReset:o,relative:i,viewTransition:l}={}){let s=eZ(),u=eX(),c=e4(e,{relative:i});return a.useCallback(a=>{0===a.button&&(!t||"_self"===t)&&!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)&&(a.preventDefault(),s(e,{replace:void 0!==r?r:p(u)===p(c),state:n,preventScrollReset:o,relative:i,viewTransition:l}))},[u,s,c,r,n,t,e,o,i,l])}(u,{replace:i,state:l,target:s,preventScrollReset:h,relative:n,viewTransition:f}),L=a.createElement("a",{...m,...S,href:v||E,onClick:b||o?e:function(t){e&&e(t),t.defaultPrevented||C(t)},ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(y,x),target:s,"data-discover":w||"render"!==t?void 0:"true"});return R&&!w?a.createElement(a.Fragment,null,L,a.createElement(tD,{page:E})):L});tz.displayName="Link";var tU=a.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},d){let h,f=e4(i,{relative:u.relative}),p=eX(),m=a.useContext(eI),{navigator:y,basename:v}=a.useContext(eY),g=null!=m&&function(e,t={}){let r=a.useContext(eW);c(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=tF("useViewTransitionState"),o=e4(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=P(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=P(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=L(o.pathname,l)||null!=L(o.pathname,i)}(f)&&!0===l,w=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=P(E,v)||E);let R="/"!==w&&w.endsWith("/")?w.length-1:w.length,x=b===w||!n&&b.startsWith(w)&&"/"===b.charAt(R),S=null!=E&&(E===w||!n&&E.startsWith(w)&&"/"===E.charAt(w.length)),C={isActive:x,isPending:S,isTransitioning:g},k=x?e:void 0;h="function"==typeof r?r(C):[r,x?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let $="function"==typeof o?o(C):o;return a.createElement(tz,{...u,"aria-current":k,className:h,ref:d,style:$,to:i,viewTransition:l},"function"==typeof s?s(C):s)});tU.displayName="NavLink",a.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:l=td,action:s,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:f,...m},y)=>{let v=function(){let{router:e}=tF("useSubmit"),{basename:t}=a.useContext(eY),r=e7("useRouteId");return a.useCallback(async(n,a={})=>{let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tf(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?P(i,t):null,r=e.getAttribute("method")||td,a=tv(e.getAttribute("enctype"))||th,o=new FormData(e)}else if(tf(e)&&"button"===e.tagName.toLowerCase()||tf(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a