import{r as Ha,a as p,R as Ba}from"./vendor-query-B2UbickB.js";var kt={exports:{}},ie={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yr;function Wa(){if(yr)return ie;yr=1;var e=Ha();function t(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},n=Symbol.for("react.portal");function o(s,l,f){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:n,key:h==null?null:""+h,children:s,containerInfo:l,implementation:f}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(s,l){if(s==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return ie.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,ie.createPortal=function(s,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(s,l,null,f)},ie.flushSync=function(s){var l=i.T,f=a.p;try{if(i.T=null,a.p=2,s)return s()}finally{i.T=l,a.p=f,a.d.f()}},ie.preconnect=function(s,l){typeof s=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,a.d.C(s,l))},ie.prefetchDNS=function(s){typeof s=="string"&&a.d.D(s)},ie.preinit=function(s,l){if(typeof s=="string"&&l&&typeof l.as=="string"){var f=l.as,h=u(f,l.crossOrigin),v=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;f==="style"?a.d.S(s,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:g}):f==="script"&&a.d.X(s,{crossOrigin:h,integrity:v,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},ie.preinitModule=function(s,l){if(typeof s=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var f=u(l.as,l.crossOrigin);a.d.M(s,{crossOrigin:f,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&a.d.M(s)},ie.preload=function(s,l){if(typeof s=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var f=l.as,h=u(f,l.crossOrigin);a.d.L(s,f,{crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},ie.preloadModule=function(s,l){if(typeof s=="string")if(l){var f=u(l.as,l.crossOrigin);a.d.m(s,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:f,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else a.d.m(s)},ie.requestFormReset=function(s){a.d.r(s)},ie.unstable_batchedUpdates=function(s,l){return s(l)},ie.useFormState=function(s,l,f){return i.H.useFormState(s,l,f)},ie.useFormStatus=function(){return i.H.useHostTransitionStatus()},ie.version="19.2.4",ie}var pr;function Va(){if(pr)return kt.exports;pr=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),kt.exports=Wa(),kt.exports}/**
 * react-router v7.13.1
 *
 * 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 Kr=e=>{throw TypeError(e)},Ka=(e,t,r)=>t.has(e)||Kr("Cannot "+r),Ut=(e,t,r)=>(Ka(e,t,"read from private field"),r?r.call(e):t.get(e)),Ya=(e,t,r)=>t.has(e)?Kr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),vr="popstate";function gr(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ja(e={}){function t(a,n){var l;let o=(l=n.state)==null?void 0:l.masked,{pathname:i,search:u,hash:s}=o||a.location;return ot("",{pathname:i,search:u,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:xe(n)}return qa(t,r,null,e)}function U(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function X(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ga(){return Math.random().toString(36).substring(2,10)}function wr(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ot(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Te(t):t,state:r,key:t&&t.key||a||Ga(),unstable_mask:n}}function xe({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 Te(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function qa(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,u="POP",s=null,l=f();l==null&&(l=0,i.replaceState({...i.state,idx:l},""));function f(){return(i.state||{idx:null}).idx}function h(){u="POP";let b=f(),C=b==null?null:b-l;l=b,s&&s({action:u,location:S.location,delta:C})}function v(b,C){u="PUSH";let P=gr(b)?b:ot(S.location,b,C);l=f()+1;let _=wr(P,l),V=S.createHref(P.unstable_mask||P);try{i.pushState(_,"",V)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;n.location.assign(V)}o&&s&&s({action:u,location:S.location,delta:1})}function g(b,C){u="REPLACE";let P=gr(b)?b:ot(S.location,b,C);l=f();let _=wr(P,l),V=S.createHref(P.unstable_mask||P);i.replaceState(_,"",V),o&&s&&s({action:u,location:S.location,delta:0})}function E(b){return Yr(b)}let S={get action(){return u},get location(){return e(n,i)},listen(b){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(vr,h),s=b,()=>{n.removeEventListener(vr,h),s=null}},createHref(b){return t(n,b)},createURL:E,encodeLocation(b){let C=E(b);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:v,replace:g,go(b){return i.go(b)}};return S}function Yr(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),U(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:xe(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var rt,Rr=class{constructor(e){if(Ya(this,rt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Ut(this,rt).has(e))return Ut(this,rt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ut(this,rt).set(e,t)}};rt=new WeakMap;var Xa=new Set(["lazy","caseSensitive","path","id","index","children"]);function Qa(e){return Xa.has(e)}var Za=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function en(e){return Za.has(e)}function tn(e){return e.index===!0}function it(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let u=[...r,String(i)],s=typeof o.id=="string"?o.id:u.join("-");if(U(o.index!==!0||!o.children,"Cannot specify children on an index route"),U(n||!a[s],`Found a route id collision on id "${s}".  Route id's must be globally unique within Data Router usages`),tn(o)){let l={...o,id:s};return a[s]=br(l,t(l)),l}else{let l={...o,id:s,children:void 0};return a[s]=br(l,t(l)),o.children&&(l.children=it(o.children,t,u,a,n)),l}})}function br(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function _e(e,t,r="/"){return at(e,t,r,!1)}function at(e,t,r,a){let n=typeof t=="string"?Te(t):t,o=we(n.pathname||"/",r);if(o==null)return null;let i=Jr(e);an(i);let u=null;for(let s=0;u==null&&s<i.length;++s){let l=yn(o);u=hn(i[s],l,a)}return u}function rn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Jr(e,t=[],r=[],a="",n=!1){let o=(i,u,s=n,l)=>{let f={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(a)&&s)return;U(f.relativePath.startsWith(a),`Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(a.length)}let h=Ee([a,f.relativePath]),v=r.concat(f);i.children&&i.children.length>0&&(U(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Jr(i.children,t,v,h,s)),!(i.path==null&&!i.index)&&t.push({path:h,score:dn(h,i.index),routesMeta:v})};return e.forEach((i,u)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,u);else for(let l of Gr(i.path))o(i,u,!0,l)}),t}function Gr(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Gr(a.join("/")),u=[];return u.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&u.push(...i),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function an(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var nn=/^:[\w-]+$/,on=3,ln=2,sn=1,un=10,cn=-2,Er=e=>e==="*";function dn(e,t){let r=e.split("/"),a=r.length;return r.some(Er)&&(a+=cn),t&&(a+=ln),r.filter(n=>!Er(n)).reduce((n,o)=>n+(nn.test(o)?on:o===""?sn:un),a)}function fn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function hn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let u=0;u<a.length;++u){let s=a[u],l=u===a.length-1,f=o==="/"?t:t.slice(o.length)||"/",h=Pt({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},f),v=s.route;if(!h&&l&&r&&!a[a.length-1].route.index&&(h=Pt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!h)return null;Object.assign(n,h.params),i.push({params:n,pathname:Ee([o,h.pathname]),pathnameBase:gn(Ee([o,h.pathnameBase])),route:v}),h.pathnameBase!=="/"&&(o=Ee([o,h.pathnameBase]))}return i}function Pt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=mn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),u=n.slice(1);return{params:a.reduce((l,{paramName:f,isOptional:h},v)=>{if(f==="*"){let E=u[v]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const g=u[v];return h&&!g?l[f]=void 0:l[f]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:i,pattern:e}}function mn(e,t=!1,r=!0){X(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 a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,s,l,f)=>{if(a.push({paramName:u,isOptional:s!=null}),s){let h=f.charAt(l+i.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function yn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return X(!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 we(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function pn({basename:e,pathname:t}){return t==="/"?e:Ee([e,t])}var qr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=e=>qr.test(e);function vn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Te(e):e,o;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?o=Sr(r.substring(1),"/"):o=Sr(r,t)):o=t,{pathname:o,search:wn(a),hash:Rn(n)}}function Sr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Nt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Xr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ct(e){let t=Xr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function st(e,t,r,a=!1){let n;typeof e=="string"?n=Te(e):(n={...e},U(!n.pathname||!n.pathname.includes("?"),Nt("?","pathname","search",n)),U(!n.pathname||!n.pathname.includes("#"),Nt("#","pathname","hash",n)),U(!n.search||!n.search.includes("#"),Nt("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,u;if(i==null)u=r;else{let h=t.length-1;if(!a&&i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),h-=1;n.pathname=v.join("/")}u=h>=0?t[h]:"/"}let s=vn(n,u),l=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(l||f)&&(s.pathname+="/"),s}var Ee=e=>e.join("/").replace(/\/\/+/g,"/"),gn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ut=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function lt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ct(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Qr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zr(e,t){let r=e;if(typeof r!="string"||!qr.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qr)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),u=we(i.pathname,t);i.origin===o.origin&&u!=null?r=u+i.search+i.hash:n=!0}catch{X(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var ke=Symbol("Uninstrumented");function bn(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let u of i)o[u]&&r[u].push(o[u])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=Ye(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],u=r[`lazy.${o}`];if(typeof i=="function"&&u.length>0){let s=Ye(u,i,()=>{});s&&(a.lazy=Object.assign(a.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[ke]??o,u=Ye(r[n],i,(...s)=>xr(s[0]));u&&(n==="loader"&&i.hydrate===!0&&(u.hydrate=!0),u[ke]=i,a[n]=u)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[ke]??n,i=Ye(r.middleware,o,(...u)=>xr(u[0]));return i?(i[ke]=o,i):n})),a}function En(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[ke]??e.navigate,n=Ye(r.navigate,a,(...o)=>{let[i,u]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?xe(i):".",...Lr(e,u??{})}});n&&(n[ke]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[ke]??e.fetch,n=Ye(r.fetch,a,(...o)=>{let[i,,u,s]=o;return{href:u??".",fetcherKey:i,...Lr(e,s??{})}});n&&(n[ke]=a,e.fetch=n)}return e}function Ye(e,t,r){return e.length===0?null:async(...a)=>{let n=await ea(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function ea(e,t,r,a){let n=e[a],o;if(n){let i,u=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=ea(e,t,r,a-1),o=await i,U(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(u,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await u(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function xr(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:Sn(t),params:{...a},unstable_pattern:n,context:xn(r)}}function Lr(e,t){return{currentUrl:xe(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Sn(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function xn(e){if(Pn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Ln=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Pn(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Ln}var ta=["POST","PUT","PATCH","DELETE"],Cn=new Set(ta),Dn=["GET",...ta],Mn=new Set(Dn),ra=new Set([301,302,303,307,308]),Tn=new Set([307,308]),$t={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},On={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},_n=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),aa="remix-router-transitions",na=Symbol("ResetLoaderData");function Fn(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";U(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||_n,o=n;if(e.unstable_instrumentations){let c=e.unstable_instrumentations;o=d=>({...n(d),...bn(c.map(y=>y.route).filter(Boolean),d)})}let i={},u=it(e.routes,o,void 0,i),s,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let f=e.dataStrategy||An,h={...e.future},v=null,g=new Set,E=null,S=null,b=null,C=e.hydrationData!=null,P=_e(u,e.history.location,l),_=!1,V=null,$,H;if(P==null&&!e.patchRoutesOnNavigation){let c=ge(404,{pathname:e.history.location.pathname}),{matches:d,route:y}=Rt(u);$=!0,H=!$,P=d,V={[y.id]:c}}else if(P&&!e.hydrationData&&yt(P,u,e.history.location.pathname).active&&(P=null),P)if(P.some(c=>c.route.lazy))$=!1,H=!$;else if(!P.some(c=>Kt(c.route)))$=!0,H=!$;else{let c=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null,y=P;if(d){let w=P.findIndex(R=>d[R.route.id]!==void 0);y=y.slice(0,w+1)}H=!1,$=y.every(w=>{let R=oa(w.route,c,d);return H=H||R.renderFallback,!R.shouldLoad})}else{$=!1,H=!$,P=[];let c=yt(null,u,e.history.location.pathname);c.active&&c.matches&&(_=!0,P=c.matches)}let Q,m={historyAction:e.history.action,location:e.history.location,matches:P,initialized:$,renderFallback:H,navigation:$t,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||V,fetchers:new Map,blockers:new Map},B="POP",k=null,re=!1,I,ue=!1,K=new Map,Z=null,Y=!1,J=!1,me=new Set,j=new Map,ee=0,ce=-1,be=new Map,ae=new Set,ye=new Map,pe=new Map,de=new Set,Ue=new Map,ht,Ne=null;function xa(){if(v=e.history.listen(({action:c,location:d,delta:y})=>{if(ht){ht(),ht=void 0;return}X(Ue.size===0||y!=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 w=cr({currentLocation:m.location,nextLocation:d,historyAction:c});if(w&&y!=null){let R=new Promise(D=>{ht=D});e.history.go(y*-1),mt(w,{state:"blocked",location:d,proceed(){mt(w,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),R.then(()=>e.history.go(y))},reset(){let D=new Map(m.blockers);D.set(w,Ze),ne({blockers:D})}}),k==null||k.resolve(),k=null;return}return $e(c,d)}),r){ro(t,K);let c=()=>ao(t,K);t.addEventListener("pagehide",c),Z=()=>t.removeEventListener("pagehide",c)}return m.initialized||$e("POP",m.location,{initialHydration:!0}),Q}function La(){v&&v(),Z&&Z(),g.clear(),I&&I.abort(),m.fetchers.forEach((c,d)=>Ot(d)),m.blockers.forEach((c,d)=>ur(d))}function Pa(c){return g.add(c),()=>g.delete(c)}function ne(c,d={}){c.matches&&(c.matches=c.matches.map(R=>{let D=i[R.route.id],T=R.route;return T.element!==D.element||T.errorElement!==D.errorElement||T.hydrateFallbackElement!==D.hydrateFallbackElement?{...R,route:D}:R})),m={...m,...c};let y=[],w=[];m.fetchers.forEach((R,D)=>{R.state==="idle"&&(de.has(D)?y.push(D):w.push(D))}),de.forEach(R=>{!m.fetchers.has(R)&&!j.has(R)&&y.push(R)}),[...g].forEach(R=>R(m,{deletedFetchers:y,newErrors:c.errors??null,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),y.forEach(R=>Ot(R)),w.forEach(R=>m.fetchers.delete(R))}function We(c,d,{flushSync:y}={}){var F,M;let w=m.actionData!=null&&m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&m.navigation.state==="loading"&&((F=c.state)==null?void 0:F._isRedirect)!==!0,R;d.actionData?Object.keys(d.actionData).length>0?R=d.actionData:R=null:w?R=m.actionData:R=null;let D=d.loaderData?Ur(m.loaderData,d.loaderData,d.matches||[],d.errors):m.loaderData,T=m.blockers;T.size>0&&(T=new Map(T),T.forEach((N,A)=>T.set(A,Ze)));let L=Y?!1:fr(c,d.matches||m.matches),x=re===!0||m.navigation.formMethod!=null&&le(m.navigation.formMethod)&&((M=c.state)==null?void 0:M._isRedirect)!==!0;s&&(u=s,s=void 0),Y||B==="POP"||(B==="PUSH"?e.history.push(c,c.state):B==="REPLACE"&&e.history.replace(c,c.state));let O;if(B==="POP"){let N=K.get(m.location.pathname);N&&N.has(c.pathname)?O={currentLocation:m.location,nextLocation:c}:K.has(c.pathname)&&(O={currentLocation:c,nextLocation:m.location})}else if(ue){let N=K.get(m.location.pathname);N?N.add(c.pathname):(N=new Set([c.pathname]),K.set(m.location.pathname,N)),O={currentLocation:m.location,nextLocation:c}}ne({...d,actionData:R,loaderData:D,historyAction:B,location:c,initialized:!0,renderFallback:!1,navigation:$t,revalidation:"idle",restoreScrollPosition:L,preventScrollReset:x,blockers:T},{viewTransitionOpts:O,flushSync:y===!0}),B="POP",re=!1,ue=!1,Y=!1,J=!1,k==null||k.resolve(),k=null,Ne==null||Ne.resolve(),Ne=null}async function rr(c,d){if(k==null||k.resolve(),k=null,typeof c=="number"){k||(k=zr());let G=k.promise;return e.history.go(c),G}let y=jt(m.location,m.matches,l,c,d==null?void 0:d.fromRouteId,d==null?void 0:d.relative),{path:w,submission:R,error:D}=Pr(!1,y,d),T;d!=null&&d.unstable_mask&&(T={pathname:"",search:"",hash:"",...typeof d.unstable_mask=="string"?Te(d.unstable_mask):{...m.location.unstable_mask,...d.unstable_mask}});let L=m.location,x=ot(L,w,d&&d.state,void 0,T);x={...x,...e.history.encodeLocation(x)};let O=d&&d.replace!=null?d.replace:void 0,F="PUSH";O===!0?F="REPLACE":O===!1||R!=null&&le(R.formMethod)&&R.formAction===m.location.pathname+m.location.search&&(F="REPLACE");let M=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,N=(d&&d.flushSync)===!0,A=cr({currentLocation:L,nextLocation:x,historyAction:F});if(A){mt(A,{state:"blocked",location:x,proceed(){mt(A,{state:"proceeding",proceed:void 0,reset:void 0,location:x}),rr(c,d)},reset(){let G=new Map(m.blockers);G.set(A,Ze),ne({blockers:G})}});return}await $e(F,x,{submission:R,pendingError:D,preventScrollReset:M,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:N,callSiteDefaultShouldRevalidate:d&&d.unstable_defaultShouldRevalidate})}function Ca(){Ne||(Ne=zr()),Tt(),ne({revalidation:"loading"});let c=Ne.promise;return m.navigation.state==="submitting"?c:m.navigation.state==="idle"?($e(m.historyAction,m.location,{startUninterruptedRevalidation:!0}),c):($e(B||m.historyAction,m.navigation.location,{overrideNavigation:m.navigation,enableViewTransition:ue===!0}),c)}async function $e(c,d,y){I&&I.abort(),I=null,B=c,Y=(y&&y.startUninterruptedRevalidation)===!0,Aa(m.location,m.matches),re=(y&&y.preventScrollReset)===!0,ue=(y&&y.enableViewTransition)===!0;let w=s||u,R=y&&y.overrideNavigation,D=y!=null&&y.initialHydration&&m.matches&&m.matches.length>0&&!_?m.matches:_e(w,d,l),T=(y&&y.flushSync)===!0;if(D&&m.initialized&&!J&&Kn(m.location,d)&&!(y&&y.submission&&le(y.submission.formMethod))){We(d,{matches:D},{flushSync:T});return}let L=yt(D,w,d.pathname);if(L.active&&L.matches&&(D=L.matches),!D){let{error:te,notFoundMatches:se,route:W}=_t(d.pathname);We(d,{matches:se,loaderData:{},errors:{[W.id]:te}},{flushSync:T});return}I=new AbortController;let x=Ke(e.history,d,I.signal,y&&y.submission),O=e.getContext?await e.getContext():new Rr,F;if(y&&y.pendingError)F=[Fe(D).route.id,{type:"error",error:y.pendingError}];else if(y&&y.submission&&le(y.submission.formMethod)){let te=await Da(x,d,y.submission,D,O,L.active,y&&y.initialHydration===!0,{replace:y.replace,flushSync:T});if(te.shortCircuited)return;if(te.pendingActionResult){let[se,W]=te.pendingActionResult;if(fe(W)&&lt(W.error)&&W.error.status===404){I=null,We(d,{matches:te.matches,loaderData:{},errors:{[se]:W.error}});return}}D=te.matches||D,F=te.pendingActionResult,R=At(d,y.submission),T=!1,L.active=!1,x=Ke(e.history,x.url,x.signal)}let{shortCircuited:M,matches:N,loaderData:A,errors:G}=await Ma(x,d,D,O,L.active,R,y&&y.submission,y&&y.fetcherSubmission,y&&y.replace,y&&y.initialHydration===!0,T,F,y&&y.callSiteDefaultShouldRevalidate);M||(I=null,We(d,{matches:N||D,...Nr(F),loaderData:A,errors:G}))}async function Da(c,d,y,w,R,D,T,L={}){Tt();let x=eo(d,y);if(ne({navigation:x},{flushSync:L.flushSync===!0}),D){let M=await pt(w,d.pathname,c.signal);if(M.type==="aborted")return{shortCircuited:!0};if(M.type==="error"){if(M.partialMatches.length===0){let{matches:A,route:G}=Rt(u);return{matches:A,pendingActionResult:[G.id,{type:"error",error:M.error}]}}let N=Fe(M.partialMatches).route.id;return{matches:M.partialMatches,pendingActionResult:[N,{type:"error",error:M.error}]}}else if(M.matches)w=M.matches;else{let{notFoundMatches:N,error:A,route:G}=_t(d.pathname);return{matches:N,pendingActionResult:[G.id,{type:"error",error:A}]}}}let O,F=St(w,d);if(!F.route.action&&!F.route.lazy)O={type:"error",error:ge(405,{method:c.method,pathname:d.pathname,routeId:F.route.id})};else{let M=Je(o,i,c,w,F,T?[]:a,R),N=await qe(c,M,R,null);if(O=N[F.route.id],!O){for(let A of w)if(N[A.route.id]){O=N[A.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(He(O)){let M;return L&&L.replace!=null?M=L.replace:M=_r(O.response.headers.get("Location"),new URL(c.url),l,e.history)===m.location.pathname+m.location.search,await Ae(c,O,!0,{submission:y,replace:M}),{shortCircuited:!0}}if(fe(O)){let M=Fe(w,F.route.id);return(L&&L.replace)!==!0&&(B="PUSH"),{matches:w,pendingActionResult:[M.route.id,O,F.route.id]}}return{matches:w,pendingActionResult:[F.route.id,O]}}async function Ma(c,d,y,w,R,D,T,L,x,O,F,M,N){let A=D||At(d,T),G=T||L||Ar(A),te=!Y&&!O;if(R){if(te){let oe=ar(M);ne({navigation:A,...oe!==void 0?{actionData:oe}:{}},{flushSync:F})}let z=await pt(y,d.pathname,c.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){if(z.partialMatches.length===0){let{matches:Ve,route:je}=Rt(u);return{matches:Ve,loaderData:{},errors:{[je.id]:z.error}}}let oe=Fe(z.partialMatches).route.id;return{matches:z.partialMatches,loaderData:{},errors:{[oe]:z.error}}}else if(z.matches)y=z.matches;else{let{error:oe,notFoundMatches:Ve,route:je}=_t(d.pathname);return{matches:Ve,loaderData:{},errors:{[je.id]:oe}}}}let se=s||u,{dsMatches:W,revalidatingFetchers:ve}=Cr(c,w,o,i,e.history,m,y,G,d,O?[]:a,O===!0,J,me,de,ye,ae,se,l,e.patchRoutesOnNavigation!=null,M,N);if(ce=++ee,!e.dataStrategy&&!W.some(z=>z.shouldLoad)&&!W.some(z=>z.route.middleware&&z.route.middleware.length>0)&&ve.length===0){let z=lr();return We(d,{matches:y,loaderData:{},errors:M&&fe(M[1])?{[M[0]]:M[1].error}:null,...Nr(M),...z?{fetchers:new Map(m.fetchers)}:{}},{flushSync:F}),{shortCircuited:!0}}if(te){let z={};if(!R){z.navigation=A;let oe=ar(M);oe!==void 0&&(z.actionData=oe)}ve.length>0&&(z.fetchers=Ta(ve)),ne(z,{flushSync:F})}ve.forEach(z=>{De(z.key),z.controller&&j.set(z.key,z.controller)});let ze=()=>ve.forEach(z=>De(z.key));I&&I.signal.addEventListener("abort",ze);let{loaderResults:Xe,fetcherResults:Oe}=await nr(W,ve,c,w);if(c.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",ze),ve.forEach(z=>j.delete(z.key));let Se=bt(Xe);if(Se)return await Ae(c,Se.result,!0,{replace:x}),{shortCircuited:!0};if(Se=bt(Oe),Se)return ae.add(Se.key),await Ae(c,Se.result,!0,{replace:x}),{shortCircuited:!0};let{loaderData:Ft,errors:Qe}=kr(m,y,Xe,M,ve,Oe);O&&m.errors&&(Qe={...m.errors,...Qe});let Ie=lr(),vt=sr(ce),gt=Ie||vt||ve.length>0;return{matches:y,loaderData:Ft,errors:Qe,...gt?{fetchers:new Map(m.fetchers)}:{}}}function ar(c){if(c&&!fe(c[1]))return{[c[0]]:c[1].data};if(m.actionData)return Object.keys(m.actionData).length===0?null:m.actionData}function Ta(c){return c.forEach(d=>{let y=m.fetchers.get(d.key),w=et(void 0,y?y.data:void 0);m.fetchers.set(d.key,w)}),new Map(m.fetchers)}async function Oa(c,d,y,w){De(c);let R=(w&&w.flushSync)===!0,D=s||u,T=jt(m.location,m.matches,l,y,d,w==null?void 0:w.relative),L=_e(D,T,l),x=yt(L,D,T);if(x.active&&x.matches&&(L=x.matches),!L){Ce(c,d,ge(404,{pathname:T}),{flushSync:R});return}let{path:O,submission:F,error:M}=Pr(!0,T,w);if(M){Ce(c,d,M,{flushSync:R});return}let N=e.getContext?await e.getContext():new Rr,A=(w&&w.preventScrollReset)===!0;if(F&&le(F.formMethod)){await _a(c,d,O,L,N,x.active,R,A,F,w&&w.unstable_defaultShouldRevalidate);return}ye.set(c,{routeId:d,path:O}),await Fa(c,d,O,L,N,x.active,R,A,F)}async function _a(c,d,y,w,R,D,T,L,x,O){Tt(),ye.delete(c);let F=m.fetchers.get(c);Pe(c,to(x,F),{flushSync:T});let M=new AbortController,N=Ke(e.history,y,M.signal,x);if(D){let q=await pt(w,new URL(N.url).pathname,N.signal,c);if(q.type==="aborted")return;if(q.type==="error"){Ce(c,d,q.error,{flushSync:T});return}else if(q.matches)w=q.matches;else{Ce(c,d,ge(404,{pathname:y}),{flushSync:T});return}}let A=St(w,y);if(!A.route.action&&!A.route.lazy){let q=ge(405,{method:x.formMethod,pathname:y,routeId:d});Ce(c,d,q,{flushSync:T});return}j.set(c,M);let G=ee,te=Je(o,i,N,w,A,a,R),se=await qe(N,te,R,c),W=se[A.route.id];if(!W){for(let q of te)if(se[q.route.id]){W=se[q.route.id];break}}if(N.signal.aborted){j.get(c)===M&&j.delete(c);return}if(de.has(c)){if(He(W)||fe(W)){Pe(c,Me(void 0));return}}else{if(He(W))if(j.delete(c),ce>G){Pe(c,Me(void 0));return}else return ae.add(c),Pe(c,et(x)),Ae(N,W,!1,{fetcherSubmission:x,preventScrollReset:L});if(fe(W)){Ce(c,d,W.error);return}}let ve=m.navigation.location||m.location,ze=Ke(e.history,ve,M.signal),Xe=s||u,Oe=m.navigation.state!=="idle"?_e(Xe,m.navigation.location,l):m.matches;U(Oe,"Didn't find any matches after fetcher action");let Se=++ee;be.set(c,Se);let Ft=et(x,W.data);m.fetchers.set(c,Ft);let{dsMatches:Qe,revalidatingFetchers:Ie}=Cr(ze,R,o,i,e.history,m,Oe,x,ve,a,!1,J,me,de,ye,ae,Xe,l,e.patchRoutesOnNavigation!=null,[A.route.id,W],O);Ie.filter(q=>q.key!==c).forEach(q=>{let wt=q.key,mr=m.fetchers.get(wt),ja=et(void 0,mr?mr.data:void 0);m.fetchers.set(wt,ja),De(wt),q.controller&&j.set(wt,q.controller)}),ne({fetchers:new Map(m.fetchers)});let vt=()=>Ie.forEach(q=>De(q.key));M.signal.addEventListener("abort",vt);let{loaderResults:gt,fetcherResults:z}=await nr(Qe,Ie,ze,R);if(M.signal.aborted)return;if(M.signal.removeEventListener("abort",vt),be.delete(c),j.delete(c),Ie.forEach(q=>j.delete(q.key)),m.fetchers.has(c)){let q=Me(W.data);m.fetchers.set(c,q)}let oe=bt(gt);if(oe)return Ae(ze,oe.result,!1,{preventScrollReset:L});if(oe=bt(z),oe)return ae.add(oe.key),Ae(ze,oe.result,!1,{preventScrollReset:L});let{loaderData:Ve,errors:je}=kr(m,Oe,gt,void 0,Ie,z);sr(Se),m.navigation.state==="loading"&&Se>ce?(U(B,"Expected pending action"),I&&I.abort(),We(m.navigation.location,{matches:Oe,loaderData:Ve,errors:je,fetchers:new Map(m.fetchers)})):(ne({errors:je,loaderData:Ur(m.loaderData,Ve,Oe,je),fetchers:new Map(m.fetchers)}),J=!1)}async function Fa(c,d,y,w,R,D,T,L,x){let O=m.fetchers.get(c);Pe(c,et(x,O?O.data:void 0),{flushSync:T});let F=new AbortController,M=Ke(e.history,y,F.signal);if(D){let W=await pt(w,new URL(M.url).pathname,M.signal,c);if(W.type==="aborted")return;if(W.type==="error"){Ce(c,d,W.error,{flushSync:T});return}else if(W.matches)w=W.matches;else{Ce(c,d,ge(404,{pathname:y}),{flushSync:T});return}}let N=St(w,y);j.set(c,F);let A=ee,G=Je(o,i,M,w,N,a,R),se=(await qe(M,G,R,c))[N.route.id];if(j.get(c)===F&&j.delete(c),!M.signal.aborted){if(de.has(c)){Pe(c,Me(void 0));return}if(He(se))if(ce>A){Pe(c,Me(void 0));return}else{ae.add(c),await Ae(M,se,!1,{preventScrollReset:L});return}if(fe(se)){Ce(c,d,se.error);return}Pe(c,Me(se.data))}}async function Ae(c,d,y,{submission:w,fetcherSubmission:R,preventScrollReset:D,replace:T}={}){y||(k==null||k.resolve(),k=null),d.response.headers.has("X-Remix-Revalidate")&&(J=!0);let L=d.response.headers.get("Location");U(L,"Expected a Location header on the redirect Response"),L=_r(L,new URL(c.url),l,e.history);let x=ot(m.location,L,{_isRedirect:!0});if(r){let G=!1;if(d.response.headers.has("X-Remix-Reload-Document"))G=!0;else if(Vt(L)){const te=Yr(L,!0);G=te.origin!==t.location.origin||we(te.pathname,l)==null}if(G){T?t.location.replace(L):t.location.assign(L);return}}I=null;let O=T===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:F,formAction:M,formEncType:N}=m.navigation;!w&&!R&&F&&M&&N&&(w=Ar(m.navigation));let A=w||R;if(Tn.has(d.response.status)&&A&&le(A.formMethod))await $e(O,x,{submission:{...A,formAction:L},preventScrollReset:D||re,enableViewTransition:y?ue:void 0});else{let G=At(x,w);await $e(O,x,{overrideNavigation:G,fetcherSubmission:R,preventScrollReset:D||re,enableViewTransition:y?ue:void 0})}}async function qe(c,d,y,w){var T;let R,D={};try{R=await In(f,c,d,w,y,!1)}catch(L){return d.filter(x=>x.shouldLoad).forEach(x=>{D[x.route.id]={type:"error",error:L}}),D}if(c.signal.aborted)return D;if(!le(c.method))for(let L of d){if(((T=R[L.route.id])==null?void 0:T.type)==="error")break;!R.hasOwnProperty(L.route.id)&&!m.loaderData.hasOwnProperty(L.route.id)&&(!m.errors||!m.errors.hasOwnProperty(L.route.id))&&L.shouldCallHandler()&&(R[L.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${L.route.id}`)})}for(let[L,x]of Object.entries(R))if(qn(x)){let O=x.result;D[L]={type:"redirect",response:Wn(O,c,L,d,l)}}else D[L]=await Bn(x);return D}async function nr(c,d,y,w){let R=qe(y,c,w,null),D=Promise.all(d.map(async x=>{if(x.matches&&x.match&&x.request&&x.controller){let F=(await qe(x.request,x.matches,w,x.key))[x.match.route.id];return{[x.key]:F}}else return Promise.resolve({[x.key]:{type:"error",error:ge(404,{pathname:x.path})}})})),T=await R,L=(await D).reduce((x,O)=>Object.assign(x,O),{});return{loaderResults:T,fetcherResults:L}}function Tt(){J=!0,ye.forEach((c,d)=>{j.has(d)&&me.add(d),De(d)})}function Pe(c,d,y={}){m.fetchers.set(c,d),ne({fetchers:new Map(m.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function Ce(c,d,y,w={}){let R=Fe(m.matches,d);Ot(c),ne({errors:{[R.route.id]:y},fetchers:new Map(m.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function or(c){return pe.set(c,(pe.get(c)||0)+1),de.has(c)&&de.delete(c),m.fetchers.get(c)||On}function ka(c,d){De(c,d==null?void 0:d.reason),Pe(c,Me(null))}function Ot(c){let d=m.fetchers.get(c);j.has(c)&&!(d&&d.state==="loading"&&be.has(c))&&De(c),ye.delete(c),be.delete(c),ae.delete(c),de.delete(c),me.delete(c),m.fetchers.delete(c)}function Ua(c){let d=(pe.get(c)||0)-1;d<=0?(pe.delete(c),de.add(c)):pe.set(c,d),ne({fetchers:new Map(m.fetchers)})}function De(c,d){let y=j.get(c);y&&(y.abort(d),j.delete(c))}function ir(c){for(let d of c){let y=or(d),w=Me(y.data);m.fetchers.set(d,w)}}function lr(){let c=[],d=!1;for(let y of ae){let w=m.fetchers.get(y);U(w,`Expected fetcher: ${y}`),w.state==="loading"&&(ae.delete(y),c.push(y),d=!0)}return ir(c),d}function sr(c){let d=[];for(let[y,w]of be)if(w<c){let R=m.fetchers.get(y);U(R,`Expected fetcher: ${y}`),R.state==="loading"&&(De(y),be.delete(y),d.push(y))}return ir(d),d.length>0}function Na(c,d){let y=m.blockers.get(c)||Ze;return Ue.get(c)!==d&&Ue.set(c,d),y}function ur(c){m.blockers.delete(c),Ue.delete(c)}function mt(c,d){let y=m.blockers.get(c)||Ze;U(y.state==="unblocked"&&d.state==="blocked"||y.state==="blocked"&&d.state==="blocked"||y.state==="blocked"&&d.state==="proceeding"||y.state==="blocked"&&d.state==="unblocked"||y.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${y.state} -> ${d.state}`);let w=new Map(m.blockers);w.set(c,d),ne({blockers:w})}function cr({currentLocation:c,nextLocation:d,historyAction:y}){if(Ue.size===0)return;Ue.size>1&&X(!1,"A router only supports one blocker at a time");let w=Array.from(Ue.entries()),[R,D]=w[w.length-1],T=m.blockers.get(R);if(!(T&&T.state==="proceeding")&&D({currentLocation:c,nextLocation:d,historyAction:y}))return R}function _t(c){let d=ge(404,{pathname:c}),y=s||u,{matches:w,route:R}=Rt(y);return{notFoundMatches:w,route:R,error:d}}function $a(c,d,y){if(E=c,b=d,S=y||null,!C&&m.navigation===$t){C=!0;let w=fr(m.location,m.matches);w!=null&&ne({restoreScrollPosition:w})}return()=>{E=null,b=null,S=null}}function dr(c,d){return S&&S(c,d.map(w=>rn(w,m.loaderData)))||c.key}function Aa(c,d){if(E&&b){let y=dr(c,d);E[y]=b()}}function fr(c,d){if(E){let y=dr(c,d),w=E[y];if(typeof w=="number")return w}return null}function yt(c,d,y){if(e.patchRoutesOnNavigation)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:at(d,y,l,!0)}}else return{active:!0,matches:at(d,y,l,!0)||[]};return{active:!1,matches:null}}async function pt(c,d,y,w){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let R=c;for(;;){let D=s==null,T=s||u,L=i;try{await e.patchRoutesOnNavigation({signal:y,path:d,matches:R,fetcherKey:w,patch:(F,M)=>{y.aborted||Dr(F,M,T,L,o,!1)}})}catch(F){return{type:"error",error:F,partialMatches:R}}finally{D&&!y.aborted&&(u=[...u])}if(y.aborted)return{type:"aborted"};let x=_e(T,d,l),O=null;if(x){if(Object.keys(x[0].params).length===0)return{type:"success",matches:x};if(O=at(T,d,l,!0),!(O&&R.length<O.length&&hr(R,O.slice(0,R.length))))return{type:"success",matches:x}}if(O||(O=at(T,d,l,!0)),!O||hr(R,O))return{type:"success",matches:null};R=O}}function hr(c,d){return c.length===d.length&&c.every((y,w)=>y.route.id===d[w].route.id)}function za(c){i={},s=it(c,o,void 0,i)}function Ia(c,d,y=!1){let w=s==null;Dr(c,d,s||u,i,o,y),w&&(u=[...u],ne({}))}return Q={get basename(){return l},get future(){return h},get state(){return m},get routes(){return u},get window(){return t},initialize:xa,subscribe:Pa,enableScrollRestoration:$a,navigate:rr,fetch:Oa,revalidate:Ca,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:or,resetFetcher:ka,deleteFetcher:Ua,dispose:La,getBlocker:Na,deleteBlocker:ur,patchRoutes:Ia,_internalFetchControllers:j,_internalSetRoutes:za,_internalSetStateDoNotUseOrYouWillBreakYourApp(c){ne(c)}},e.unstable_instrumentations&&(Q=En(Q,e.unstable_instrumentations.map(c=>c.router).filter(Boolean))),Q}function kn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function jt(e,t,r,a,n,o){let i,u;if(n){i=[];for(let l of t)if(i.push(l),l.route.id===n){u=l;break}}else i=t,u=t[t.length-1];let s=st(a||".",Ct(i),we(e.pathname,r)||e.pathname,o==="path");if(a==null&&(s.search=e.search,s.hash=e.hash),(a==null||a===""||a===".")&&u){let l=Jt(s.search);if(u.route.index&&!l)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let f=new URLSearchParams(s.search),h=f.getAll("index");f.delete("index"),h.filter(g=>g).forEach(g=>f.append("index",g));let v=f.toString();s.search=v?`?${v}`:""}}return r!=="/"&&(s.pathname=pn({basename:r,pathname:s.pathname})),xe(s)}function Pr(e,t,r){if(!r||!kn(r))return{path:t};if(r.formMethod&&!Zn(r.formMethod))return{path:t,error:ge(405,{method:r.formMethod})};let a=()=>({path:t,error:ge(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=da(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!le(o))return a();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((v,[g,E])=>`${v}${g}=${E}
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!le(o))return a();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return a()}}}U(typeof FormData=="function","FormData is not available in this environment");let u,s;if(r.formData)u=Bt(r.formData),s=r.formData;else if(r.body instanceof FormData)u=Bt(r.body),s=r.body;else if(r.body instanceof URLSearchParams)u=r.body,s=Fr(u);else if(r.body==null)u=new URLSearchParams,s=new FormData;else try{u=new URLSearchParams(r.body),s=Fr(u)}catch{return a()}let l={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(le(l.formMethod))return{path:t,submission:l};let f=Te(t);return e&&f.search&&Jt(f.search)&&u.append("index",""),f.search=`?${u}`,{path:xe(f),submission:l}}function Cr(e,t,r,a,n,o,i,u,s,l,f,h,v,g,E,S,b,C,P,_,V){var Z;let $=_?fe(_[1])?_[1].error:_[1].data:void 0,H=n.createURL(o.location),Q=n.createURL(s),m;if(f&&o.errors){let Y=Object.keys(o.errors)[0];m=i.findIndex(J=>J.route.id===Y)}else if(_&&fe(_[1])){let Y=_[0];m=i.findIndex(J=>J.route.id===Y)-1}let B=_?_[1].statusCode:void 0,k=B&&B>=400,re={currentUrl:H,currentParams:((Z=o.matches[0])==null?void 0:Z.params)||{},nextUrl:Q,nextParams:i[0].params,...u,actionResult:$,actionStatus:B},I=ct(i),ue=i.map((Y,J)=>{let{route:me}=Y,j=null;if(m!=null&&J>m)j=!1;else if(me.lazy)j=!0;else if(!Kt(me))j=!1;else if(f){let{shouldLoad:ae}=oa(me,o.loaderData,o.errors);j=ae}else Un(o.loaderData,o.matches[J],Y)&&(j=!0);if(j!==null)return Ht(r,a,e,I,Y,l,t,j);let ee=!1;typeof V=="boolean"?ee=V:k?ee=!1:(h||H.pathname+H.search===Q.pathname+Q.search||H.search!==Q.search||Nn(o.matches[J],Y))&&(ee=!0);let ce={...re,defaultShouldRevalidate:ee},be=nt(Y,ce);return Ht(r,a,e,I,Y,l,t,be,ce,V)}),K=[];return E.forEach((Y,J)=>{if(f||!i.some(pe=>pe.route.id===Y.routeId)||g.has(J))return;let me=o.fetchers.get(J),j=me&&me.state!=="idle"&&me.data===void 0,ee=_e(b,Y.path,C);if(!ee){if(P&&j)return;K.push({key:J,routeId:Y.routeId,path:Y.path,matches:null,match:null,request:null,controller:null});return}if(S.has(J))return;let ce=St(ee,Y.path),be=new AbortController,ae=Ke(n,Y.path,be.signal),ye=null;if(v.has(J))v.delete(J),ye=Je(r,a,ae,ee,ce,l,t);else if(j)h&&(ye=Je(r,a,ae,ee,ce,l,t));else{let pe;typeof V=="boolean"?pe=V:k?pe=!1:pe=h;let de={...re,defaultShouldRevalidate:pe};nt(ce,de)&&(ye=Je(r,a,ae,ee,ce,l,t,de))}ye&&K.push({key:J,routeId:Y.routeId,path:Y.path,matches:ye,match:ce,request:ae,controller:be})}),{dsMatches:ue,revalidatingFetchers:K}}function Kt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function oa(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Kt(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function Un(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function Nn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function nt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Dr(e,t,r,a,n,o){let i;if(e){let l=a[e];U(l,`No route found to patch children into: routeId = ${e}`),l.children||(l.children=[]),i=l.children}else i=r;let u=[],s=[];if(t.forEach(l=>{let f=i.find(h=>ia(l,h));f?s.push({existingRoute:f,newRoute:l}):u.push(l)}),u.length>0){let l=it(u,n,[e||"_","patch",String((i==null?void 0:i.length)||"0")],a);i.push(...l)}if(o&&s.length>0)for(let l=0;l<s.length;l++){let{existingRoute:f,newRoute:h}=s[l],v=f,[g]=it([h],n,[],{},!0);Object.assign(v,{element:g.element?g.element:v.element,errorElement:g.errorElement?g.errorElement:v.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:v.hydrateFallbackElement})}}function ia(e,t){var r;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:((r=e.children)==null?void 0:r.every((a,n)=>{var o;return(o=t.children)==null?void 0:o.some(i=>ia(a,i))}))??!1:!1}var Mr=new WeakMap,la=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(U(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=Mr.get(n);i||(i={},Mr.set(n,i));let u=i[e];if(u)return u;let s=(async()=>{let l=Qa(e),h=n[e]!==void 0&&e!=="hasErrorBoundary";if(l)X(!l,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(h)X(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(n,{[e]:v}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(v=>v===void 0)&&(n.lazy=void 0))})();return i[e]=s,s},Tr=new WeakMap;function $n(e,t,r,a,n){let o=r[e.id];if(U(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=Tr.get(o);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let h=(async()=>{U(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),g={};for(let E in v){let S=v[E];if(S===void 0)continue;let b=en(E),P=o[E]!==void 0&&E!=="hasErrorBoundary";b?X(!b,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):P?X(!P,`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.`):g[E]=S}Object.assign(o,g),Object.assign(o,{...a(o),lazy:void 0})})();return Tr.set(o,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let i=Object.keys(e.lazy),u=[],s;for(let f of i){if(n&&n.includes(f))continue;let h=la({key:f,route:e,manifest:r,mapRouteProperties:a});h&&(u.push(h),f===t&&(s=h))}let l=u.length>0?Promise.all(u).then(()=>{}):void 0;return l==null||l.catch(()=>{}),s==null||s.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:s}}async function Or(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function An(e){return e.matches.some(t=>t.route.middleware)?sa(e,()=>Or(e)):Or(e)}function sa(e,t){return zn(e,t,a=>{if(Qn(a))throw a;return a},Jn,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,u=Math.min(Math.max(i.findIndex(l=>l.route.id===n),0),Math.max(i.findIndex(l=>l.shouldCallHandler()),0)),s=Fe(i,i[u].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:a}})}}}async function zn(e,t,r,a,n){let{matches:o,request:i,params:u,context:s,unstable_pattern:l}=e,f=o.flatMap(v=>v.route.middleware?v.route.middleware.map(g=>[v.route.id,g]):[]);return await ua({request:i,params:u,context:s,unstable_pattern:l},f,t,r,a,n)}async function ua(e,t,r,a,n,o,i=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let s=t[i];if(!s)return await r();let[l,f]=s,h,v=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await ua(e,t,r,a,n,o,i+1)},h.value}catch(g){return h={value:await o(g,l,h)},h.value}};try{let g=await f(e,v),E=g!=null?a(g):void 0;return n(E)?E:h?E??h.value:(h={value:await v()},h.value)}catch(g){return await o(g,l,h)}}function ca(e,t,r,a,n){let o=la({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=$n(a.route,le(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Ht(e,t,r,a,n,o,i,u,s=null,l){let f=!1,h=ca(e,t,r,n,o);return{...n,_lazyPromises:h,shouldLoad:u,shouldRevalidateArgs:s,shouldCallHandler(v){return f=!0,s?typeof l=="boolean"?nt(n,{...s,defaultShouldRevalidate:l}):typeof v=="boolean"?nt(n,{...s,defaultShouldRevalidate:v}):nt(n,s):u},resolve(v){let{lazy:g,loader:E,middleware:S}=n.route,b=f||u||v&&!le(r.method)&&(g||E),C=S&&S.length>0&&!E&&!g;return b&&(le(r.method)||!C)?jn({request:r,unstable_pattern:a,match:n,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:v,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Je(e,t,r,a,n,o,i,u=null){return a.map(s=>s.route.id!==n.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:ca(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ht(e,t,r,ct(a),s,o,i,!0,u))}async function In(e,t,r,a,n,o){r.some(l=>{var f;return(f=l._lazyPromises)==null?void 0:f.middleware})&&await Promise.all(r.map(l=>{var f;return(f=l._lazyPromises)==null?void 0:f.middleware}));let i={request:t,unstable_pattern:ct(r),params:r[0].params,context:n,matches:r},s=await e({...i,fetcherKey:a,runClientMiddleware:l=>{let f=i;return sa(f,()=>l({...f,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(l=>{var f,h;return[(f=l._lazyPromises)==null?void 0:f.handler,(h=l._lazyPromises)==null?void 0:h.route]}))}catch{}return s}async function jn({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:i}){let u,s,l=le(e.method),f=l?"action":"loader",h=v=>{let g,E=new Promise((C,P)=>g=P);s=()=>g(),e.signal.addEventListener("abort",s);let S=C=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${r.route.id}]`)):v({request:e,unstable_pattern:t,params:r.params,context:i},...C!==void 0?[C]:[]),b=(async()=>{try{return{type:"data",result:await(o?o(P=>S(P)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([b,E])};try{let v=l?r.route.action:r.route.loader;if(a||n)if(v){let g,[E]=await Promise.all([h(v).catch(S=>{g=S}),a,n]);if(g!==void 0)throw g;u=E}else{await a;let g=l?r.route.action:r.route.loader;if(g)[u]=await Promise.all([h(g),n]);else if(f==="action"){let E=new URL(e.url),S=E.pathname+E.search;throw ge(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(v)u=await h(v);else{let g=new URL(e.url),E=g.pathname+g.search;throw ge(404,{pathname:E})}}catch(v){return{type:"error",result:v}}finally{s&&e.signal.removeEventListener("abort",s)}return u}async function Hn(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Bn(e){var a,n,o,i,u;let{result:t,type:r}=e;if(Yt(t)){let s;try{s=await Hn(t)}catch(l){return{type:"error",error:l}}return r==="error"?{type:"error",error:new ut(t.status,t.statusText,s),statusCode:t.status,headers:t.headers}:{type:"data",data:s,statusCode:t.status,headers:t.headers}}return r==="error"?$r(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(n=t.init)!=null&&n.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Yn(t),statusCode:lt(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:lt(t)?t.status:void 0}:$r(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Wn(e,t,r,a,n){let o=e.headers.get("Location");if(U(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Vt(o)){let i=a.slice(0,a.findIndex(u=>u.route.id===r)+1);o=jt(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}function _r(e,t,r,a){let n=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Vt(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(n.includes(i.protocol))throw new Error("Invalid redirect location");let u=we(i.pathname,r)!=null;if(i.origin===t.origin&&u)return i.pathname+i.search+i.hash}try{let o=a.createURL(e);if(n.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ke(e,t,r,a){let n=e.createURL(da(t)).toString(),o={signal:r};if(a&&le(a.formMethod)){let{formMethod:i,formEncType:u}=a;o.method=i.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(a.json)):u==="text/plain"?o.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?o.body=Bt(a.formData):o.body=a.formData}return new Request(n,o)}function Bt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Fr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Vn(e,t,r,a=!1,n=!1){let o={},i=null,u,s=!1,l={},f=r&&fe(r[1])?r[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let v=h.route.id,g=t[v];if(U(!He(g),"Cannot handle redirect results in processLoaderData"),fe(g)){let E=g.error;if(f!==void 0&&(E=f,f=void 0),i=i||{},n)i[v]=E;else{let S=Fe(e,v);i[S.route.id]==null&&(i[S.route.id]=E)}a||(o[v]=na),s||(s=!0,u=lt(g.error)?g.error.status:500),g.headers&&(l[v]=g.headers)}else o[v]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(u=g.statusCode),g.headers&&(l[v]=g.headers)}),f!==void 0&&r&&(i={[r[0]]:f},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:u||200,loaderHeaders:l}}function kr(e,t,r,a,n,o){let{loaderData:i,errors:u}=Vn(t,r,a);return n.filter(s=>!s.matches||s.matches.some(l=>l.shouldLoad)).forEach(s=>{let{key:l,match:f,controller:h}=s;if(h&&h.signal.aborted)return;let v=o[l];if(U(v,"Did not find corresponding fetcher result"),fe(v)){let g=Fe(e.matches,f==null?void 0:f.route.id);u&&u[g.route.id]||(u={...u,[g.route.id]:v.error}),e.fetchers.delete(l)}else if(He(v))U(!1,"Unhandled fetcher revalidation redirect");else{let g=Me(v.data);e.fetchers.set(l,g)}}),{loaderData:i,errors:u}}function Ur(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==na).reduce((o,[i,u])=>(o[i]=u,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function Nr(e){return e?fe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fe(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Rt(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 ge(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?u=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(u="Unable to encode submission body")):e===403?(i="Forbidden",u=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",u=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?u=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(u=`Invalid request method "${a.toUpperCase()}"`)),new ut(e||500,i,new Error(u),!0)}function bt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(He(n))return{key:a,result:n}}}function da(e){let t=typeof e=="string"?Te(e):e;return xe({...t,hash:""})}function Kn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Yn(e){var t,r;return new ut(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function Jn(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Gn(r))}function Gn(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function qn(e){return Yt(e.result)&&ra.has(e.result.status)}function fe(e){return e.type==="error"}function He(e){return(e&&e.type)==="redirect"}function $r(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Yt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Xn(e){return ra.has(e)}function Qn(e){return Yt(e)&&Xn(e.status)&&e.headers.has("Location")}function Zn(e){return Mn.has(e.toUpperCase())}function le(e){return Cn.has(e.toUpperCase())}function Jt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function St(e,t){let r=typeof t=="string"?Te(t).search:t.search;if(e[e.length-1].route.index&&Jt(r||""))return e[e.length-1];let a=Xr(e);return a[a.length-1]}function Ar(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}}}function At(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 eo(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 to(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 Me(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 ro(e,t){try{let r=e.sessionStorage.getItem(aa);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function ao(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(aa,JSON.stringify(r))}catch(a){X(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function zr(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Be=p.createContext(null);Be.displayName="DataRouter";var dt=p.createContext(null);dt.displayName="DataRouterState";var fa=p.createContext(!1);function no(){return p.useContext(fa)}var Gt=p.createContext({isTransitioning:!1});Gt.displayName="ViewTransition";var ha=p.createContext(new Map);ha.displayName="Fetchers";var oo=p.createContext(null);oo.displayName="Await";var he=p.createContext(null);he.displayName="Navigation";var Dt=p.createContext(null);Dt.displayName="Location";var Re=p.createContext({outlet:null,matches:[],isDataRoute:!1});Re.displayName="Route";var qt=p.createContext(null);qt.displayName="RouteError";var ma="REACT_ROUTER_ERROR",io="REDIRECT",lo="ROUTE_ERROR_RESPONSE";function so(e){if(e.startsWith(`${ma}:${io}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function uo(e){if(e.startsWith(`${ma}:${lo}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ut(t.status,t.statusText,t.data)}catch{}}function co(e,{relative:t}={}){U(Ge(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=p.useContext(he),{hash:n,pathname:o,search:i}=ft(e,{relative:t}),u=o;return r!=="/"&&(u=o==="/"?r:Ee([r,o])),a.createHref({pathname:u,search:i,hash:n})}function Ge(){return p.useContext(Dt)!=null}function Le(){return U(Ge(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Dt).location}var ya="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pa(e){p.useContext(he).static||p.useLayoutEffect(e)}function Xt(){let{isDataRoute:e}=p.useContext(Re);return e?Po():fo()}function fo(){U(Ge(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Be),{basename:t,navigator:r}=p.useContext(he),{matches:a}=p.useContext(Re),{pathname:n}=Le(),o=JSON.stringify(Ct(a)),i=p.useRef(!1);return pa(()=>{i.current=!0}),p.useCallback((s,l={})=>{if(X(i.current,ya),!i.current)return;if(typeof s=="number"){r.go(s);return}let f=st(s,JSON.parse(o),n,l.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ee([t,f.pathname])),(l.replace?r.replace:r.push)(f,l.state,l)},[t,r,o,n,e])}var ho=p.createContext(null);function mo(e){let t=p.useContext(Re).outlet;return p.useMemo(()=>t&&p.createElement(ho.Provider,{value:e},t),[t,e])}function Ri(){let{matches:e}=p.useContext(Re),t=e[e.length-1];return t?t.params:{}}function ft(e,{relative:t}={}){let{matches:r}=p.useContext(Re),{pathname:a}=Le(),n=JSON.stringify(Ct(r));return p.useMemo(()=>st(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function yo(e,t,r){U(Ge(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=p.useContext(he),{matches:n}=p.useContext(Re),o=n[n.length-1],i=o?o.params:{},u=o?o.pathname:"/",s=o?o.pathnameBase:"/",l=o&&o.route;{let b=l&&l.path||"";ga(u,!l||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) 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 <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let f=Le(),h;h=f;let v=h.pathname||"/",g=v;if(s!=="/"){let b=s.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(b.length).join("/")}let E=_e(e,{pathname:g});return X(l||E!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),X(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Ro(E&&E.map(b=>Object.assign({},b,{params:Object.assign({},i,b.params),pathname:Ee([s,a.encodeLocation?a.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?s:Ee([s,a.encodeLocation?a.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),n,r)}function po(){let e=Lo(),t=lt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:o},"ErrorBoundary")," or"," ",p.createElement("code",{style:o},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:n},r):null,i)}var vo=p.createElement(po,null),va=class extends p.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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=uo(e.digest);r&&(e=r)}let t=e!==void 0?p.createElement(Re.Provider,{value:this.props.routeContext},p.createElement(qt.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?p.createElement(go,{error:e},t):t}};va.contextType=fa;var zt=new WeakMap;function go({children:e,error:t}){let{basename:r}=p.useContext(he);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=so(t.digest);if(a){let n=zt.get(t);if(n)throw n;let o=Zr(a.location,r);if(Qr&&!zt.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw zt.set(t,i),i}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function wo({routeContext:e,match:t,children:r}){let a=p.useContext(Be);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Re.Provider,{value:e},r)}function Ro(e,t=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a==null?void 0:a.errors;if(o!=null){let f=n.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);U(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,f+1))}let i=!1,u=-1;if(r&&a){i=a.renderFallback;for(let f=0;f<n.length;f++){let h=n[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:v,errors:g}=a,E=h.route.loader&&!v.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||E){r.isStatic&&(i=!0),u>=0?n=n.slice(0,u+1):n=[n[0]];break}}}}let s=r==null?void 0:r.onError,l=a&&s?(f,h)=>{var v,g;s(f,{location:a.location,params:((g=(v=a.matches)==null?void 0:v[0])==null?void 0:g.params)??{},unstable_pattern:ct(a.matches),errorInfo:h})}:void 0;return n.reduceRight((f,h,v)=>{let g,E=!1,S=null,b=null;a&&(g=o&&h.route.id?o[h.route.id]:void 0,S=h.route.errorElement||vo,i&&(u<0&&v===0?(ga("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,b=null):u===v&&(E=!0,b=h.route.hydrateFallbackElement||null)));let C=t.concat(n.slice(0,v+1)),P=()=>{let _;return g?_=S:E?_=b:h.route.Component?_=p.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=f,p.createElement(wo,{match:h,routeContext:{outlet:f,matches:C,isDataRoute:a!=null},children:_})};return a&&(h.route.ErrorBoundary||h.route.errorElement||v===0)?p.createElement(va,{location:a.location,revalidation:a.revalidation,component:S,error:g,children:P(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:l}):P()},null)}function Qt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function bo(e){let t=p.useContext(Be);return U(t,Qt(e)),t}function Eo(e){let t=p.useContext(dt);return U(t,Qt(e)),t}function So(e){let t=p.useContext(Re);return U(t,Qt(e)),t}function Zt(e){let t=So(e),r=t.matches[t.matches.length-1];return U(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function xo(){return Zt("useRouteId")}function Lo(){var a;let e=p.useContext(qt),t=Eo("useRouteError"),r=Zt("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Po(){let{router:e}=bo("useNavigate"),t=Zt("useNavigate"),r=p.useRef(!1);return pa(()=>{r.current=!0}),p.useCallback(async(n,o={})=>{X(r.current,ya),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Ir={};function ga(e,t,r){!t&&!Ir[e]&&(Ir[e]=!0,X(!1,r))}var jr={};function Hr(e,t){!e&&!jr[t]&&(jr[t]=!0,console.warn(t))}var Co="useOptimistic",Br=Ba[Co],Do=()=>{};function Mo(e){return Br?Br(e):[e,Do]}function To(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&X(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&X(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&X(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Oo=["HydrateFallback","hydrateFallbackElement"],_o=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 Fo({router:e,flushSync:t,onError:r,unstable_useTransitions:a}){a=no()||a;let[o,i]=p.useState(e.state),[u,s]=Mo(o),[l,f]=p.useState(),[h,v]=p.useState({isTransitioning:!1}),[g,E]=p.useState(),[S,b]=p.useState(),[C,P]=p.useState(),_=p.useRef(new Map),V=p.useCallback((m,{deletedFetchers:B,newErrors:k,flushSync:re,viewTransitionOpts:I})=>{k&&r&&Object.values(k).forEach(K=>{var Z;return r(K,{location:m.location,params:((Z=m.matches[0])==null?void 0:Z.params)??{},unstable_pattern:ct(m.matches)})}),m.fetchers.forEach((K,Z)=>{K.data!==void 0&&_.current.set(Z,K.data)}),B.forEach(K=>_.current.delete(K)),Hr(re===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` 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 ue=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Hr(I==null||ue,"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."),!I||!ue){t&&re?t(()=>i(m)):a===!1?i(m):p.startTransition(()=>{a===!0&&s(K=>Wr(K,m)),i(m)});return}if(t&&re){t(()=>{S&&(g==null||g.resolve(),S.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let K=e.window.document.startViewTransition(()=>{t(()=>i(m))});K.finished.finally(()=>{t(()=>{E(void 0),b(void 0),f(void 0),v({isTransitioning:!1})})}),t(()=>b(K));return}S?(g==null||g.resolve(),S.skipTransition(),P({state:m,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(f(m),v({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,S,g,a,s,r]);p.useLayoutEffect(()=>e.subscribe(V),[e,V]),p.useEffect(()=>{h.isTransitioning&&!h.flushSync&&E(new _o)},[h]),p.useEffect(()=>{if(g&&l&&e.window){let m=l,B=g.promise,k=e.window.document.startViewTransition(async()=>{a===!1?i(m):p.startTransition(()=>{a===!0&&s(re=>Wr(re,m)),i(m)}),await B});k.finished.finally(()=>{E(void 0),b(void 0),f(void 0),v({isTransitioning:!1})}),b(k)}},[l,g,e.window,a,s]),p.useEffect(()=>{g&&l&&u.location.key===l.location.key&&g.resolve()},[g,S,u.location,l]),p.useEffect(()=>{!h.isTransitioning&&C&&(f(C.state),v({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}),P(void 0))},[h.isTransitioning,C]);let $=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:m=>e.navigate(m),push:(m,B,k)=>e.navigate(m,{state:B,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(m,B,k)=>e.navigate(m,{replace:!0,state:B,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[e]),H=e.basename||"/",Q=p.useMemo(()=>({router:e,navigator:$,static:!1,basename:H,onError:r}),[e,$,H,r]);return p.createElement(p.Fragment,null,p.createElement(Be.Provider,{value:Q},p.createElement(dt.Provider,{value:u},p.createElement(ha.Provider,{value:_.current},p.createElement(Gt.Provider,{value:h},p.createElement(No,{basename:H,location:u.location,navigationType:u.historyAction,navigator:$,unstable_useTransitions:a},p.createElement(ko,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:r})))))),null)}function Wr(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var ko=p.memo(Uo);function Uo({routes:e,future:t,state:r,isStatic:a,onError:n}){return yo(e,void 0,{state:r,isStatic:a,onError:n})}function bi({to:e,replace:t,state:r,relative:a}){U(Ge(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=p.useContext(he);X(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=p.useContext(Re),{pathname:i}=Le(),u=Xt(),s=st(e,Ct(o),i,a==="path"),l=JSON.stringify(s);return p.useEffect(()=>{u(JSON.parse(l),{replace:t,state:r,relative:a})},[u,l,a,t,r]),null}function Ei(e){return mo(e.context)}function No({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,unstable_useTransitions:i}){U(!Ge(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),s=p.useMemo(()=>({basename:u,navigator:n,static:o,unstable_useTransitions:i,future:{}}),[u,n,o,i]);typeof r=="string"&&(r=Te(r));let{pathname:l="/",search:f="",hash:h="",state:v=null,key:g="default",unstable_mask:E}=r,S=p.useMemo(()=>{let b=we(l,u);return b==null?null:{location:{pathname:b,search:f,hash:h,state:v,key:g,unstable_mask:E},navigationType:a}},[u,l,f,h,v,g,a,E]);return X(S!=null,`<Router basename="${u}"> is not able to match the URL "${l}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:p.createElement(he.Provider,{value:s},p.createElement(Dt.Provider,{children:t,value:S}))}var xt="get",Lt="application/x-www-form-urlencoded";function Mt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $o(e){return Mt(e)&&e.tagName.toLowerCase()==="button"}function Ao(e){return Mt(e)&&e.tagName.toLowerCase()==="form"}function zo(e){return Mt(e)&&e.tagName.toLowerCase()==="input"}function Io(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jo(e,t){return e.button===0&&(!t||t==="_self")&&!Io(e)}function Wt(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Ho(e,t){let r=Wt(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var Et=null;function Bo(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var Wo=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function It(e){return e!=null&&!Wo.has(e)?(X(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lt}"`),null):e}function Vo(e,t){let r,a,n,o,i;if(Ao(e)){let u=e.getAttribute("action");a=u?we(u,t):null,r=e.getAttribute("method")||xt,n=It(e.getAttribute("enctype"))||Lt,o=new FormData(e)}else if($o(e)||zo(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||u.getAttribute("action");if(a=s?we(s,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||xt,n=It(e.getAttribute("formenctype"))||It(u.getAttribute("enctype"))||Lt,o=new FormData(u,e),!Bo()){let{name:l,type:f,value:h}=e;if(f==="image"){let v=l?`${l}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else l&&o.append(l,h)}}else{if(Mt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=xt,a=null,n=Lt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function er(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ko(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&we(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${a}`,n}async function Yo(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Jo(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Go(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Yo(o,r);return i.links?i.links():[]}return[]}));return Zo(a.flat(1).filter(Jo).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Vr(e,t,r,a,n,o){let i=(s,l)=>r[l]?s.route.id!==r[l].route.id:!0,u=(s,l)=>{var f;return r[l].pathname!==s.pathname||((f=r[l].route.path)==null?void 0:f.endsWith("*"))&&r[l].params["*"]!==s.params["*"]};return o==="assets"?t.filter((s,l)=>i(s,l)||u(s,l)):o==="data"?t.filter((s,l)=>{var h;let f=a.routes[s.route.id];if(!f||!f.hasLoader)return!1;if(i(s,l)||u(s,l))return!0;if(s.route.shouldRevalidate){let v=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((h=r[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function qo(e,t,{includeHydrateFallback:r}={}){return Xo(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Xo(e){return[...new Set(e)]}function Qo(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Zo(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(Qo(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}function wa(){let e=p.useContext(Be);return er(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ei(){let e=p.useContext(dt);return er(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var tr=p.createContext(void 0);tr.displayName="FrameworkContext";function Ra(){let e=p.useContext(tr);return er(e,"You must render this element inside a <HydratedRouter> element"),e}function ti(e,t){let r=p.useContext(tr),[a,n]=p.useState(!1),[o,i]=p.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:l,onMouseLeave:f,onTouchStart:h}=t,v=p.useRef(null);p.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let S=C=>{C.forEach(P=>{i(P.isIntersecting)})},b=new IntersectionObserver(S,{threshold:.5});return v.current&&b.observe(v.current),()=>{b.disconnect()}}},[e]),p.useEffect(()=>{if(a){let S=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(S)}}},[a]);let g=()=>{n(!0)},E=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,v,{}]:[o,v,{onFocus:tt(u,g),onBlur:tt(s,E),onMouseEnter:tt(l,g),onMouseLeave:tt(f,E),onTouchStart:tt(h,g)}]:[!1,v,{}]}function tt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ri({page:e,...t}){let{router:r}=wa(),a=p.useMemo(()=>_e(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?p.createElement(ni,{page:e,matches:a,...t}):null}function ai(e){let{manifest:t,routeModules:r}=Ra(),[a,n]=p.useState([]);return p.useEffect(()=>{let o=!1;return Go(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function ni({page:e,matches:t,...r}){let a=Le(),{future:n,manifest:o,routeModules:i}=Ra(),{basename:u}=wa(),{loaderData:s,matches:l}=ei(),f=p.useMemo(()=>Vr(e,t,l,o,a,"data"),[e,t,l,o,a]),h=p.useMemo(()=>Vr(e,t,l,o,a,"assets"),[e,t,l,o,a]),v=p.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,b=!1;if(t.forEach(P=>{var V;let _=o.routes[P.route.id];!_||!_.hasLoader||(!f.some($=>$.route.id===P.route.id)&&P.route.id in s&&((V=i[P.route.id])!=null&&V.shouldRevalidate)||_.hasClientLoader?b=!0:S.add(P.route.id))}),S.size===0)return[];let C=Ko(e,u,n.unstable_trailingSlashAwareDataRequests,"data");return b&&S.size>0&&C.searchParams.set("_routes",t.filter(P=>S.has(P.route.id)).map(P=>P.route.id).join(",")),[C.pathname+C.search]},[u,n.unstable_trailingSlashAwareDataRequests,s,a,o,f,t,e,i]),g=p.useMemo(()=>qo(h,o),[h,o]),E=ai(h);return p.createElement(p.Fragment,null,v.map(S=>p.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),g.map(S=>p.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),E.map(({key:S,link:b})=>p.createElement("link",{key:S,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function oi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ii=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ii&&(window.__reactRouterVersion="7.13.1")}catch{}function Si(e,t){return Fn({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Ja({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||li(),routes:e,mapRouteProperties:To,hydrationRouteProperties:Oo,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function li(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:si(e.errors)}),e}function si(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new ut(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let i=new o(n.message);i.stack="",r[a]=i}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}var ba=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ea=p.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,unstable_mask:u,state:s,target:l,to:f,preventScrollReset:h,viewTransition:v,unstable_defaultShouldRevalidate:g,...E},S){let{basename:b,navigator:C,unstable_useTransitions:P}=p.useContext(he),_=typeof f=="string"&&ba.test(f),V=Zr(f,b);f=V.to;let $=co(f,{relative:n}),H=Le(),Q=null;if(u){let Z=st(u,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);b!=="/"&&(Z.pathname=Z.pathname==="/"?b:Ee([b,Z.pathname])),Q=C.createHref(Z)}let[m,B,k]=ti(a,E),re=fi(f,{replace:i,unstable_mask:u,state:s,target:l,preventScrollReset:h,relative:n,viewTransition:v,unstable_defaultShouldRevalidate:g,unstable_useTransitions:P});function I(Z){t&&t(Z),Z.defaultPrevented||re(Z)}let ue=!(V.isExternal||o),K=p.createElement("a",{...E,...k,href:(ue?Q:void 0)||V.absoluteURL||$,onClick:ue?I:t,ref:oi(S,B),target:l,"data-discover":!_&&r==="render"?"true":void 0});return m&&!_?p.createElement(p.Fragment,null,K,p.createElement(ri,{page:$})):K});Ea.displayName="Link";var ui=p.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:u,children:s,...l},f){let h=ft(i,{relative:l.relative}),v=Le(),g=p.useContext(dt),{navigator:E,basename:S}=p.useContext(he),b=g!=null&&vi(h)&&u===!0,C=E.encodeLocation?E.encodeLocation(h).pathname:h.pathname,P=v.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(P=P.toLowerCase(),_=_?_.toLowerCase():null,C=C.toLowerCase()),_&&S&&(_=we(_,S)||_);const V=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let $=P===C||!n&&P.startsWith(C)&&P.charAt(V)==="/",H=_!=null&&(_===C||!n&&_.startsWith(C)&&_.charAt(C.length)==="/"),Q={isActive:$,isPending:H,isTransitioning:b},m=$?t:void 0,B;typeof a=="function"?B=a(Q):B=[a,$?"active":null,H?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(Q):o;return p.createElement(Ea,{...l,"aria-current":m,className:B,ref:f,style:k,to:i,viewTransition:u},typeof s=="function"?s(Q):s)});ui.displayName="NavLink";var ci=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=xt,action:u,onSubmit:s,relative:l,preventScrollReset:f,viewTransition:h,unstable_defaultShouldRevalidate:v,...g},E)=>{let{unstable_useTransitions:S}=p.useContext(he),b=yi(),C=pi(u,{relative:l}),P=i.toLowerCase()==="get"?"get":"post",_=typeof u=="string"&&ba.test(u),V=$=>{if(s&&s($),$.defaultPrevented)return;$.preventDefault();let H=$.nativeEvent.submitter,Q=(H==null?void 0:H.getAttribute("formmethod"))||i,m=()=>b(H||$.currentTarget,{fetcherKey:t,method:Q,navigate:r,replace:n,state:o,relative:l,preventScrollReset:f,viewTransition:h,unstable_defaultShouldRevalidate:v});S&&r!==!1?p.startTransition(()=>m()):m()};return p.createElement("form",{ref:E,method:P,action:C,onSubmit:a?s:V,...g,"data-discover":!_&&e==="render"?"true":void 0})});ci.displayName="Form";function di(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sa(e){let t=p.useContext(Be);return U(t,di(e)),t}function fi(e,{target:t,replace:r,unstable_mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let f=Xt(),h=Le(),v=ft(e,{relative:i});return p.useCallback(g=>{if(jo(g,t)){g.preventDefault();let E=r!==void 0?r:xe(h)===xe(v),S=()=>f(e,{replace:E,unstable_mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:s});l?p.startTransition(()=>S()):S()}},[h,f,v,r,a,n,t,e,o,i,u,s,l])}function xi(e){X(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(Wt(e)),r=p.useRef(!1),a=Le(),n=p.useMemo(()=>Ho(a.search,r.current?null:t.current),[a.search]),o=Xt(),i=p.useCallback((u,s)=>{const l=Wt(typeof u=="function"?u(new URLSearchParams(n)):u);r.current=!0,o("?"+l,s)},[o,n]);return[n,i]}var hi=0,mi=()=>`__${String(++hi)}__`;function yi(){let{router:e}=Sa("useSubmit"),{basename:t}=p.useContext(he),r=xo(),a=e.fetch,n=e.navigate;return p.useCallback(async(o,i={})=>{let{action:u,method:s,encType:l,formData:f,body:h}=Vo(o,t);if(i.navigate===!1){let v=i.fetcherKey||mi();await a(v,r,i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||s,formEncType:i.encType||l,flushSync:i.flushSync})}else await n(i.action||u,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||s,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function pi(e,{relative:t}={}){let{basename:r}=p.useContext(he),a=p.useContext(Re);U(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ft(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let u=new URLSearchParams(o.search),s=u.getAll("index");if(s.some(f=>f==="")){u.delete("index"),s.filter(h=>h).forEach(h=>u.append("index",h));let f=u.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ee([r,o.pathname])),xe(o)}function vi(e,{relative:t}={}){let r=p.useContext(Gt);U(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Sa("useViewTransitionState"),n=ft(e,{relative:t});if(!r.isTransitioning)return!1;let o=we(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=we(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Pt(n.pathname,i)!=null||Pt(n.pathname,o)!=null}var gi=Va();function Li(e){return p.createElement(Fo,{flushSync:gi.flushSync,...e})}export{Ea as L,ui as N,Ei as O,Li as R,gi as a,bi as b,Xt as c,Si as d,Ri as e,xi as f,Va as r,Le as u};
//# sourceMappingURL=vendor-react-CXumBFUA.js.map
