import{r as d,R as qt,a as Qn}from"./vendor-ui-DZJzNhfO.js";/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},V.apply(this,arguments)}var K;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(K||(K={}));const xr="popstate";function $r(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((g,w)=>h(g,typeof g=="string"?null:g.state,w===0?"default":void 0));let o=s(r??a.length-1),i=K.Pop,l=null;function s(g){return Math.min(Math.max(g,0),a.length-1)}function c(){return a[o]}function h(g,w,E){w===void 0&&(w=null);let S=Be(a?c().pathname:"/",g,w,E);return be(S.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),S}function m(g){return typeof g=="string"?g:pe(g)}return{get index(){return o},get action(){return i},get location(){return c()},createHref:m,createURL(g){return new URL(m(g),"http://localhost")},encodeLocation(g){let w=typeof g=="string"?de(g):g;return{pathname:w.pathname||"",search:w.search||"",hash:w.hash||""}},push(g,w){i=K.Push;let E=h(g,w);o+=1,a.splice(o,a.length,E),n&&l&&l({action:i,location:E,delta:1})},replace(g,w){i=K.Replace;let E=h(g,w);a[o]=E,n&&l&&l({action:i,location:E,delta:0})},go(g){i=K.Pop;let w=s(o+g),E=a[w];o=w,l&&l({action:i,location:E,delta:g})},listen(g){return l=g,()=>{l=null}}}}function Jr(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return Be("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:pe(a)}return Gr(t,r,null,e)}function Yr(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:l="",hash:s=""}=de(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Be("",{pathname:i,search:l,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(a,o){let i=a.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let s=a.location.href,c=s.indexOf("#");l=c===-1?s:s.slice(0,c)}return l+"#"+(typeof o=="string"?o:pe(o))}function n(a,o){be(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Gr(t,r,n,e)}function M(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function be(e,t){if(!e)try{throw new Error(t)}catch{}}function Zn(){return Math.random().toString(36).substr(2,8)}function Pr(e,t){return{usr:e.state,key:e.key,idx:t}}function Be(e,t,r,n){return r===void 0&&(r=null),V({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?de(t):t,{state:r,key:t&&t.key||n||Zn()})}function pe(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function de(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Gr(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l=K.Pop,s=null,c=h();c==null&&(c=0,i.replaceState(V({},i.state,{idx:c}),""));function h(){return(i.state||{idx:null}).idx}function m(){l=K.Pop;let S=h(),N=S==null?null:S-c;c=S,s&&s({action:l,location:E.location,delta:N})}function y(S,N){l=K.Push;let x=Be(E.location,S,N);r&&r(x,S),c=h()+1;let F=Pr(x,c),A=E.createHref(x);try{i.pushState(F,"",A)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;a.location.assign(A)}o&&s&&s({action:l,location:E.location,delta:1})}function g(S,N){l=K.Replace;let x=Be(E.location,S,N);r&&r(x,S),c=h();let F=Pr(x,c),A=E.createHref(x);i.replaceState(F,"",A),o&&s&&s({action:l,location:E.location,delta:0})}function w(S){let N=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof S=="string"?S:pe(S);return x=x.replace(/ $/,"%20"),M(N,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,N)}let E={get action(){return l},get location(){return e(a,i)},listen(S){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(xr,m),s=S,()=>{a.removeEventListener(xr,m),s=null}},createHref(S){return t(a,S)},createURL:w,encodeLocation(S){let N=w(S);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:y,replace:g,go(S){return i.go(S)}};return E}var z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(z||(z={}));const qn=new Set(["lazy","caseSensitive","path","id","index","children"]);function ea(e){return e.index===!0}function Ut(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,o)=>{let i=[...r,String(o)],l=typeof a.id=="string"?a.id:i.join("-");if(M(a.index!==!0||!a.children,"Cannot specify children on an index route"),M(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),ea(a)){let s=V({},a,t(a),{id:l});return n[l]=s,s}else{let s=V({},a,t(a),{id:l,children:void 0});return n[l]=s,a.children&&(s.children=Ut(a.children,t,i,n)),s}})}function Le(e,t,r){return r===void 0&&(r="/"),Mt(e,t,r,!1)}function Mt(e,t,r,n){let a=typeof t=="string"?de(t):t,o=ae(a.pathname||"/",r);if(o==null)return null;let i=Qr(e);ta(i);let l=null;for(let s=0;l==null&&s<i.length;++s){let c=qr(o);l=ca(i[s],c,n)}return l}function Xr(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Qr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,l)=>{let s={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};s.relativePath.startsWith("/")&&(M(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(n.length));let c=ye([n,s.relativePath]),h=r.concat(s);o.children&&o.children.length>0&&(M(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Qr(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:sa(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))a(o,i);else for(let s of Zr(o.path))a(o,i,s)}),t}function Zr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Zr(n.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function ta(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ua(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const ra=/^:[\w-]+$/,na=3,aa=2,ia=1,oa=10,la=-2,Cr=e=>e==="*";function sa(e,t){let r=e.split("/"),n=r.length;return r.some(Cr)&&(n+=la),t&&(n+=aa),r.filter(a=>!Cr(a)).reduce((a,o)=>a+(ra.test(o)?na:o===""?ia:oa),n)}function ua(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ca(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let s=n[l],c=l===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",m=Ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},h),y=s.route;if(!m&&c&&r&&!n[n.length-1].route.index&&(m=Ge({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!m)return null;Object.assign(a,m.params),i.push({params:a,pathname:ye([o,m.pathname]),pathnameBase:pa(ye([o,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(o=ye([o,m.pathnameBase]))}return i}function da(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(be(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=i=>i==null?"":typeof i=="string"?i:String(i),o=r.split(/\/+/).map((i,l,s)=>{if(l===s.length-1&&i==="*")return a(t["*"]);const h=i.match(/^:([\w-]+)(\??)$/);if(h){const[,m,y]=h;let g=t[m];return M(y==="?"||g!=null,'Missing ":'+m+'" param'),a(g)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+o.join("/")}function Ge(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=fa(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((c,h,m)=>{let{paramName:y,isOptional:g}=h;if(y==="*"){let E=l[m]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const w=l[m];return g&&!w?c[y]=void 0:c[y]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function fa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),be(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function qr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return be(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ae(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const ha=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ma=e=>ha.test(e);function en(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?de(e):e,o;if(r)if(ma(r))o=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),be(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?o=Lr(r.substring(1),"/"):o=Lr(r,t)}else o=t;return{pathname:o,search:va(n),hash:ga(a)}}function Lr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Vt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function tn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Nt(e,t){let r=tn(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function At(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=de(e):(a=V({},e),M(!a.pathname||!a.pathname.includes("?"),Vt("?","pathname","search",a)),M(!a.pathname||!a.pathname.includes("#"),Vt("#","pathname","hash",a)),M(!a.search||!a.search.includes("#"),Vt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(i==null)l=r;else{let m=t.length-1;if(!n&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}l=m>=0?t[m]:"/"}let s=en(a,l),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(c||h)&&(s.pathname+="/"),s}const ye=e=>e.join("/").replace(/\/\/+/g,"/"),pa=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),va=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ga=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ya=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),V({},n,{headers:a}))};class Ft extends Error{}class ba{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],M(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((o,i)=>n=i),this.controller=new AbortController;let a=()=>n(new Ft("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((o,i)=>{let[l,s]=i;return Object.assign(o,{[l]:this.trackPromise(l,s)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,void 0,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){if(this.controller.signal.aborted&&n instanceof Ft)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let o=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>o}),this.emit(!1,r),Promise.reject(o)}return a===void 0?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(o=>{t.removeEventListener("abort",n),(o||this.done)&&a(o)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return M(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,r)=>{let[n,a]=r;return Object.assign(t,{[n]:Ea(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function wa(e){return e instanceof Promise&&e._tracked===!0}function Ea(e){if(!wa(e))return e;if(e._error)throw e._error;return e._data}const Ra=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new ba(t,n)},er=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status>"u"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,V({},n,{headers:a}))},Sa=(e,t)=>{let r=er(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},xa=(e,t)=>{let r=er(e,t);return r.headers.set("X-Remix-Replace","true"),r};class dt{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Xe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rn=["post","put","patch","delete"],Pa=new Set(rn),Ca=["get",...rn],La=new Set(Ca),Da=new Set([301,302,303,307,308]),Ta=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},nn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ye={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},tr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ma=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),an="remix-router-transitions";function rr(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",n=!r;M(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let u=e.detectErrorBoundary;a=f=>({hasErrorBoundary:u(f)})}else a=Ma;let o={},i=Ut(e.routes,a,void 0,o),l,s=e.basename||"/",c=e.dataStrategy||Ia,h=e.patchRoutesOnNavigation,m=V({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),y=null,g=new Set,w=null,E=null,S=null,N=e.hydrationData!=null,x=Le(i,e.history.location,s),F=!1,A=null;if(x==null&&!h){let u=re(404,{pathname:e.history.location.pathname}),{matches:f,route:p}=jr(i);x=f,A={[p.id]:u}}x&&!e.hydrationData&&St(x,i,e.history.location.pathname).active&&(x=null);let $;if(x)if(x.some(u=>u.route.lazy))$=!1;else if(!x.some(u=>u.route.loader))$=!0;else if(m.v7_partialHydration){let u=e.hydrationData?e.hydrationData.loaderData:null,f=e.hydrationData?e.hydrationData.errors:null;if(f){let p=x.findIndex(b=>f[b.route.id]!==void 0);$=x.slice(0,p+1).every(b=>!Qt(b.route,u,f))}else $=x.every(p=>!Qt(p.route,u,f))}else $=e.hydrationData!=null;else if($=!1,x=[],m.v7_partialHydration){let u=St(null,i,e.history.location.pathname);u.active&&u.matches&&(F=!0,x=u.matches)}let fe,v={historyAction:e.history.action,location:e.history.location,matches:x,initialized:$,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||A,fetchers:new Map,blockers:new Map},_=K.Pop,H=!1,O,Q=!1,G=new Map,oe=null,te=!1,we=!1,gt=[],yt=new Set,Z=new Map,bt=0,rt=-1,ze=new Map,Ee=new Set,He=new Map,nt=new Map,he=new Set,Fe=new Map,Ie=new Map,wt;function In(){if(y=e.history.listen(u=>{let{action:f,location:p,delta:b}=u;if(wt){wt(),wt=void 0;return}be(Ie.size===0||b!=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 R=wr({currentLocation:v.location,nextLocation:p,historyAction:f});if(R&&b!=null){let T=new Promise(U=>{wt=U});e.history.go(b*-1),Rt(R,{state:"blocked",location:p,proceed(){Rt(R,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),T.then(()=>e.history.go(b))},reset(){let U=new Map(v.blockers);U.set(R,Ye),ee({blockers:U})}});return}return Oe(f,p)}),r){Ya(t,G);let u=()=>Ga(t,G);t.addEventListener("pagehide",u),oe=()=>t.removeEventListener("pagehide",u)}return v.initialized||Oe(K.Pop,v.location,{initialHydration:!0}),fe}function On(){y&&y(),oe&&oe(),g.clear(),O&&O.abort(),v.fetchers.forEach((u,f)=>Et(f)),v.blockers.forEach((u,f)=>br(f))}function Nn(u){return g.add(u),()=>g.delete(u)}function ee(u,f){f===void 0&&(f={}),v=V({},v,u);let p=[],b=[];m.v7_fetcherPersist&&v.fetchers.forEach((R,T)=>{R.state==="idle"&&(he.has(T)?b.push(T):p.push(T))}),he.forEach(R=>{!v.fetchers.has(R)&&!Z.has(R)&&b.push(R)}),[...g].forEach(R=>R(v,{deletedFetchers:b,viewTransitionOpts:f.viewTransitionOpts,flushSync:f.flushSync===!0})),m.v7_fetcherPersist?(p.forEach(R=>v.fetchers.delete(R)),b.forEach(R=>Et(R))):b.forEach(R=>he.delete(R))}function We(u,f,p){var b,R;let{flushSync:T}=p===void 0?{}:p,U=v.actionData!=null&&v.navigation.formMethod!=null&&me(v.navigation.formMethod)&&v.navigation.state==="loading"&&((b=u.state)==null?void 0:b._isRedirect)!==!0,C;f.actionData?Object.keys(f.actionData).length>0?C=f.actionData:C=null:U?C=v.actionData:C=null;let L=f.loaderData?Nr(v.loaderData,f.loaderData,f.matches||[],f.errors):v.loaderData,P=v.blockers;P.size>0&&(P=new Map(P),P.forEach((j,q)=>P.set(q,Ye)));let D=H===!0||v.navigation.formMethod!=null&&me(v.navigation.formMethod)&&((R=u.state)==null?void 0:R._isRedirect)!==!0;l&&(i=l,l=void 0),te||_===K.Pop||(_===K.Push?e.history.push(u,u.state):_===K.Replace&&e.history.replace(u,u.state));let I;if(_===K.Pop){let j=G.get(v.location.pathname);j&&j.has(u.pathname)?I={currentLocation:v.location,nextLocation:u}:G.has(u.pathname)&&(I={currentLocation:u,nextLocation:v.location})}else if(Q){let j=G.get(v.location.pathname);j?j.add(u.pathname):(j=new Set([u.pathname]),G.set(v.location.pathname,j)),I={currentLocation:v.location,nextLocation:u}}ee(V({},f,{actionData:C,loaderData:L,historyAction:_,location:u,initialized:!0,navigation:$t,revalidation:"idle",restoreScrollPosition:Rr(u,f.matches||v.matches),preventScrollReset:D,blockers:P}),{viewTransitionOpts:I,flushSync:T===!0}),_=K.Pop,H=!1,Q=!1,te=!1,we=!1,gt=[]}async function fr(u,f){if(typeof u=="number"){e.history.go(u);return}let p=Xt(v.location,v.matches,s,m.v7_prependBasename,u,m.v7_relativeSplatPath,f==null?void 0:f.fromRouteId,f==null?void 0:f.relative),{path:b,submission:R,error:T}=Dr(m.v7_normalizeFormMethod,!1,p,f),U=v.location,C=Be(v.location,b,f&&f.state);C=V({},C,e.history.encodeLocation(C));let L=f&&f.replace!=null?f.replace:void 0,P=K.Push;L===!0?P=K.Replace:L===!1||R!=null&&me(R.formMethod)&&R.formAction===v.location.pathname+v.location.search&&(P=K.Replace);let D=f&&"preventScrollReset"in f?f.preventScrollReset===!0:void 0,I=(f&&f.flushSync)===!0,j=wr({currentLocation:U,nextLocation:C,historyAction:P});if(j){Rt(j,{state:"blocked",location:C,proceed(){Rt(j,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),fr(u,f)},reset(){let q=new Map(v.blockers);q.set(j,Ye),ee({blockers:q})}});return}return await Oe(P,C,{submission:R,pendingError:T,preventScrollReset:D,replace:f&&f.replace,enableViewTransition:f&&f.viewTransition,flushSync:I})}function An(){if(zt(),ee({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){Oe(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}Oe(_||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:Q===!0})}}async function Oe(u,f,p){O&&O.abort(),O=null,_=u,te=(p&&p.startUninterruptedRevalidation)===!0,Jn(v.location,v.matches),H=(p&&p.preventScrollReset)===!0,Q=(p&&p.enableViewTransition)===!0;let b=l||i,R=p&&p.overrideNavigation,T=p!=null&&p.initialHydration&&v.matches&&v.matches.length>0&&!F?v.matches:Le(b,f,s),U=(p&&p.flushSync)===!0;if(T&&v.initialized&&!we&&Ba(v.location,f)&&!(p&&p.submission&&me(p.submission.formMethod))){We(f,{matches:T},{flushSync:U});return}let C=St(T,b,f.pathname);if(C.active&&C.matches&&(T=C.matches),!T){let{error:W,notFoundMatches:B,route:J}=Ht(f.pathname);We(f,{matches:B,loaderData:{},errors:{[J.id]:W}},{flushSync:U});return}O=new AbortController;let L=Je(e.history,f,O.signal,p&&p.submission),P;if(p&&p.pendingError)P=[je(T).route.id,{type:z.error,error:p.pendingError}];else if(p&&p.submission&&me(p.submission.formMethod)){let W=await jn(L,f,p.submission,T,C.active,{replace:p.replace,flushSync:U});if(W.shortCircuited)return;if(W.pendingActionResult){let[B,J]=W.pendingActionResult;if(le(J)&&Xe(J.error)&&J.error.status===404){O=null,We(f,{matches:W.matches,loaderData:{},errors:{[B]:J.error}});return}}T=W.matches||T,P=W.pendingActionResult,R=Jt(f,p.submission),U=!1,C.active=!1,L=Je(e.history,L.url,L.signal)}let{shortCircuited:D,matches:I,loaderData:j,errors:q}=await kn(L,f,T,C.active,R,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,p&&p.initialHydration===!0,U,P);D||(O=null,We(f,V({matches:I||T},Ar(P),{loaderData:j,errors:q})))}async function jn(u,f,p,b,R,T){T===void 0&&(T={}),zt();let U=$a(f,p);if(ee({navigation:U},{flushSync:T.flushSync===!0}),R){let P=await xt(b,f.pathname,u.signal);if(P.type==="aborted")return{shortCircuited:!0};if(P.type==="error"){let D=je(P.partialMatches).route.id;return{matches:P.partialMatches,pendingActionResult:[D,{type:z.error,error:P.error}]}}else if(P.matches)b=P.matches;else{let{notFoundMatches:D,error:I,route:j}=Ht(f.pathname);return{matches:D,pendingActionResult:[j.id,{type:z.error,error:I}]}}}let C,L=ct(b,f);if(!L.route.action&&!L.route.lazy)C={type:z.error,error:re(405,{method:u.method,pathname:f.pathname,routeId:L.route.id})};else if(C=(await at("action",v,u,[L],b,null))[L.route.id],u.signal.aborted)return{shortCircuited:!0};if(ke(C)){let P;return T&&T.replace!=null?P=T.replace:P=Fr(C.response.headers.get("Location"),new URL(u.url),s,e.history)===v.location.pathname+v.location.search,await Ne(u,C,!0,{submission:p,replace:P}),{shortCircuited:!0}}if(De(C))throw re(400,{type:"defer-action"});if(le(C)){let P=je(b,L.route.id);return(T&&T.replace)!==!0&&(_=K.Push),{matches:b,pendingActionResult:[P.route.id,C]}}return{matches:b,pendingActionResult:[L.route.id,C]}}async function kn(u,f,p,b,R,T,U,C,L,P,D){let I=R||Jt(f,T),j=T||U||Br(I),q=!te&&(!m.v7_partialHydration||!L);if(b){if(q){let Y=hr(D);ee(V({navigation:I},Y!==void 0?{actionData:Y}:{}),{flushSync:P})}let k=await xt(p,f.pathname,u.signal);if(k.type==="aborted")return{shortCircuited:!0};if(k.type==="error"){let Y=je(k.partialMatches).route.id;return{matches:k.partialMatches,loaderData:{},errors:{[Y]:k.error}}}else if(k.matches)p=k.matches;else{let{error:Y,notFoundMatches:Ve,route:lt}=Ht(f.pathname);return{matches:Ve,loaderData:{},errors:{[lt.id]:Y}}}}let W=l||i,[B,J]=Mr(e.history,v,p,j,f,m.v7_partialHydration&&L===!0,m.v7_skipActionErrorRevalidation,we,gt,yt,he,He,Ee,W,s,D);if(Wt(k=>!(p&&p.some(Y=>Y.route.id===k))||B&&B.some(Y=>Y.route.id===k)),rt=++bt,B.length===0&&J.length===0){let k=gr();return We(f,V({matches:p,loaderData:{},errors:D&&le(D[1])?{[D[0]]:D[1].error}:null},Ar(D),k?{fetchers:new Map(v.fetchers)}:{}),{flushSync:P}),{shortCircuited:!0}}if(q){let k={};if(!b){k.navigation=I;let Y=hr(D);Y!==void 0&&(k.actionData=Y)}J.length>0&&(k.fetchers=Bn(J)),ee(k,{flushSync:P})}J.forEach(k=>{Pe(k.key),k.controller&&Z.set(k.key,k.controller)});let Ke=()=>J.forEach(k=>Pe(k.key));O&&O.signal.addEventListener("abort",Ke);let{loaderResults:it,fetcherResults:Se}=await mr(v,p,B,J,u);if(u.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Ke),J.forEach(k=>Z.delete(k.key));let ge=Lt(it);if(ge)return await Ne(u,ge.result,!0,{replace:C}),{shortCircuited:!0};if(ge=Lt(Se),ge)return Ee.add(ge.key),await Ne(u,ge.result,!0,{replace:C}),{shortCircuited:!0};let{loaderData:Kt,errors:ot}=Or(v,p,it,D,J,Se,Fe);Fe.forEach((k,Y)=>{k.subscribe(Ve=>{(Ve||k.done)&&Fe.delete(Y)})}),m.v7_partialHydration&&L&&v.errors&&(ot=V({},v.errors,ot));let Ae=gr(),Pt=yr(rt),Ct=Ae||Pt||J.length>0;return V({matches:p,loaderData:Kt,errors:ot},Ct?{fetchers:new Map(v.fetchers)}:{})}function hr(u){if(u&&!le(u[1]))return{[u[0]]:u[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function Bn(u){return u.forEach(f=>{let p=v.fetchers.get(f.key),b=st(void 0,p?p.data:void 0);v.fetchers.set(f.key,b)}),new Map(v.fetchers)}function zn(u,f,p,b){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Pe(u);let R=(b&&b.flushSync)===!0,T=l||i,U=Xt(v.location,v.matches,s,m.v7_prependBasename,p,m.v7_relativeSplatPath,f,b==null?void 0:b.relative),C=Le(T,U,s),L=St(C,T,U);if(L.active&&L.matches&&(C=L.matches),!C){Re(u,f,re(404,{pathname:U}),{flushSync:R});return}let{path:P,submission:D,error:I}=Dr(m.v7_normalizeFormMethod,!0,U,b);if(I){Re(u,f,I,{flushSync:R});return}let j=ct(C,P),q=(b&&b.preventScrollReset)===!0;if(D&&me(D.formMethod)){Hn(u,f,P,j,C,L.active,R,q,D);return}He.set(u,{routeId:f,path:P}),Wn(u,f,P,j,C,L.active,R,q,D)}async function Hn(u,f,p,b,R,T,U,C,L){zt(),He.delete(u);function P(X){if(!X.route.action&&!X.route.lazy){let $e=re(405,{method:L.formMethod,pathname:p,routeId:f});return Re(u,f,$e,{flushSync:U}),!0}return!1}if(!T&&P(b))return;let D=v.fetchers.get(u);xe(u,Ja(L,D),{flushSync:U});let I=new AbortController,j=Je(e.history,p,I.signal,L);if(T){let X=await xt(R,new URL(j.url).pathname,j.signal,u);if(X.type==="aborted")return;if(X.type==="error"){Re(u,f,X.error,{flushSync:U});return}else if(X.matches){if(R=X.matches,b=ct(R,p),P(b))return}else{Re(u,f,re(404,{pathname:p}),{flushSync:U});return}}Z.set(u,I);let q=bt,B=(await at("action",v,j,[b],R,u))[b.route.id];if(j.signal.aborted){Z.get(u)===I&&Z.delete(u);return}if(m.v7_fetcherPersist&&he.has(u)){if(ke(B)||le(B)){xe(u,Ce(void 0));return}}else{if(ke(B))if(Z.delete(u),rt>q){xe(u,Ce(void 0));return}else return Ee.add(u),xe(u,st(L)),Ne(j,B,!1,{fetcherSubmission:L,preventScrollReset:C});if(le(B)){Re(u,f,B.error);return}}if(De(B))throw re(400,{type:"defer-action"});let J=v.navigation.location||v.location,Ke=Je(e.history,J,I.signal),it=l||i,Se=v.navigation.state!=="idle"?Le(it,v.navigation.location,s):v.matches;M(Se,"Didn't find any matches after fetcher action");let ge=++bt;ze.set(u,ge);let Kt=st(L,B.data);v.fetchers.set(u,Kt);let[ot,Ae]=Mr(e.history,v,Se,L,J,!1,m.v7_skipActionErrorRevalidation,we,gt,yt,he,He,Ee,it,s,[b.route.id,B]);Ae.filter(X=>X.key!==u).forEach(X=>{let $e=X.key,Sr=v.fetchers.get($e),Xn=st(void 0,Sr?Sr.data:void 0);v.fetchers.set($e,Xn),Pe($e),X.controller&&Z.set($e,X.controller)}),ee({fetchers:new Map(v.fetchers)});let Pt=()=>Ae.forEach(X=>Pe(X.key));I.signal.addEventListener("abort",Pt);let{loaderResults:Ct,fetcherResults:k}=await mr(v,Se,ot,Ae,Ke);if(I.signal.aborted)return;I.signal.removeEventListener("abort",Pt),ze.delete(u),Z.delete(u),Ae.forEach(X=>Z.delete(X.key));let Y=Lt(Ct);if(Y)return Ne(Ke,Y.result,!1,{preventScrollReset:C});if(Y=Lt(k),Y)return Ee.add(Y.key),Ne(Ke,Y.result,!1,{preventScrollReset:C});let{loaderData:Ve,errors:lt}=Or(v,Se,Ct,void 0,Ae,k,Fe);if(v.fetchers.has(u)){let X=Ce(B.data);v.fetchers.set(u,X)}yr(ge),v.navigation.state==="loading"&&ge>rt?(M(_,"Expected pending action"),O&&O.abort(),We(v.navigation.location,{matches:Se,loaderData:Ve,errors:lt,fetchers:new Map(v.fetchers)})):(ee({errors:lt,loaderData:Nr(v.loaderData,Ve,Se,lt),fetchers:new Map(v.fetchers)}),we=!1)}async function Wn(u,f,p,b,R,T,U,C,L){let P=v.fetchers.get(u);xe(u,st(L,P?P.data:void 0),{flushSync:U});let D=new AbortController,I=Je(e.history,p,D.signal);if(T){let B=await xt(R,new URL(I.url).pathname,I.signal,u);if(B.type==="aborted")return;if(B.type==="error"){Re(u,f,B.error,{flushSync:U});return}else if(B.matches)R=B.matches,b=ct(R,p);else{Re(u,f,re(404,{pathname:p}),{flushSync:U});return}}Z.set(u,D);let j=bt,W=(await at("loader",v,I,[b],R,u))[b.route.id];if(De(W)&&(W=await nr(W,I.signal,!0)||W),Z.get(u)===D&&Z.delete(u),!I.signal.aborted){if(he.has(u)){xe(u,Ce(void 0));return}if(ke(W))if(rt>j){xe(u,Ce(void 0));return}else{Ee.add(u),await Ne(I,W,!1,{preventScrollReset:C});return}if(le(W)){Re(u,f,W.error);return}M(!De(W),"Unhandled fetcher deferred data"),xe(u,Ce(W.data))}}async function Ne(u,f,p,b){let{submission:R,fetcherSubmission:T,preventScrollReset:U,replace:C}=b===void 0?{}:b;f.response.headers.has("X-Remix-Revalidate")&&(we=!0);let L=f.response.headers.get("Location");M(L,"Expected a Location header on the redirect Response"),L=Fr(L,new URL(u.url),s,e.history);let P=Be(v.location,L,{_isRedirect:!0});if(r){let B=!1;if(f.response.headers.has("X-Remix-Reload-Document"))B=!0;else if(tr.test(L)){const J=e.history.createURL(L);B=J.origin!==t.location.origin||ae(J.pathname,s)==null}if(B){C?t.location.replace(L):t.location.assign(L);return}}O=null;let D=C===!0||f.response.headers.has("X-Remix-Replace")?K.Replace:K.Push,{formMethod:I,formAction:j,formEncType:q}=v.navigation;!R&&!T&&I&&j&&q&&(R=Br(v.navigation));let W=R||T;if(Ta.has(f.response.status)&&W&&me(W.formMethod))await Oe(D,P,{submission:V({},W,{formAction:L}),preventScrollReset:U||H,enableViewTransition:p?Q:void 0});else{let B=Jt(P,R);await Oe(D,P,{overrideNavigation:B,fetcherSubmission:T,preventScrollReset:U||H,enableViewTransition:p?Q:void 0})}}async function at(u,f,p,b,R,T){let U,C={};try{U=await Oa(c,u,f,p,b,R,T,o,a)}catch(L){return b.forEach(P=>{C[P.route.id]={type:z.error,error:L}}),C}for(let[L,P]of Object.entries(U))if(za(P)){let D=P.result;C[L]={type:z.redirect,response:ja(D,p,L,R,s,m.v7_relativeSplatPath)}}else C[L]=await Aa(P);return C}async function mr(u,f,p,b,R){let T=u.matches,U=at("loader",u,R,p,f,null),C=Promise.all(b.map(async D=>{if(D.matches&&D.match&&D.controller){let j=(await at("loader",u,Je(e.history,D.path,D.controller.signal),[D.match],D.matches,D.key))[D.match.route.id];return{[D.key]:j}}else return Promise.resolve({[D.key]:{type:z.error,error:re(404,{pathname:D.path})}})})),L=await U,P=(await C).reduce((D,I)=>Object.assign(D,I),{});return await Promise.all([Ka(f,L,R.signal,T,u.loaderData),Va(f,P,b)]),{loaderResults:L,fetcherResults:P}}function zt(){we=!0,gt.push(...Wt()),He.forEach((u,f)=>{Z.has(f)&&yt.add(f),Pe(f)})}function xe(u,f,p){p===void 0&&(p={}),v.fetchers.set(u,f),ee({fetchers:new Map(v.fetchers)},{flushSync:(p&&p.flushSync)===!0})}function Re(u,f,p,b){b===void 0&&(b={});let R=je(v.matches,f);Et(u),ee({errors:{[R.route.id]:p},fetchers:new Map(v.fetchers)},{flushSync:(b&&b.flushSync)===!0})}function pr(u){return nt.set(u,(nt.get(u)||0)+1),he.has(u)&&he.delete(u),v.fetchers.get(u)||nn}function Et(u){let f=v.fetchers.get(u);Z.has(u)&&!(f&&f.state==="loading"&&ze.has(u))&&Pe(u),He.delete(u),ze.delete(u),Ee.delete(u),m.v7_fetcherPersist&&he.delete(u),yt.delete(u),v.fetchers.delete(u)}function Kn(u){let f=(nt.get(u)||0)-1;f<=0?(nt.delete(u),he.add(u),m.v7_fetcherPersist||Et(u)):nt.set(u,f),ee({fetchers:new Map(v.fetchers)})}function Pe(u){let f=Z.get(u);f&&(f.abort(),Z.delete(u))}function vr(u){for(let f of u){let p=pr(f),b=Ce(p.data);v.fetchers.set(f,b)}}function gr(){let u=[],f=!1;for(let p of Ee){let b=v.fetchers.get(p);M(b,"Expected fetcher: "+p),b.state==="loading"&&(Ee.delete(p),u.push(p),f=!0)}return vr(u),f}function yr(u){let f=[];for(let[p,b]of ze)if(b<u){let R=v.fetchers.get(p);M(R,"Expected fetcher: "+p),R.state==="loading"&&(Pe(p),ze.delete(p),f.push(p))}return vr(f),f.length>0}function Vn(u,f){let p=v.blockers.get(u)||Ye;return Ie.get(u)!==f&&Ie.set(u,f),p}function br(u){v.blockers.delete(u),Ie.delete(u)}function Rt(u,f){let p=v.blockers.get(u)||Ye;M(p.state==="unblocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="blocked"||p.state==="blocked"&&f.state==="proceeding"||p.state==="blocked"&&f.state==="unblocked"||p.state==="proceeding"&&f.state==="unblocked","Invalid blocker state transition: "+p.state+" -> "+f.state);let b=new Map(v.blockers);b.set(u,f),ee({blockers:b})}function wr(u){let{currentLocation:f,nextLocation:p,historyAction:b}=u;if(Ie.size===0)return;Ie.size>1&&be(!1,"A router only supports one blocker at a time");let R=Array.from(Ie.entries()),[T,U]=R[R.length-1],C=v.blockers.get(T);if(!(C&&C.state==="proceeding")&&U({currentLocation:f,nextLocation:p,historyAction:b}))return T}function Ht(u){let f=re(404,{pathname:u}),p=l||i,{matches:b,route:R}=jr(p);return Wt(),{notFoundMatches:b,route:R,error:f}}function Wt(u){let f=[];return Fe.forEach((p,b)=>{(!u||u(b))&&(p.cancel(),f.push(b),Fe.delete(b))}),f}function $n(u,f,p){if(w=u,S=f,E=p||null,!N&&v.navigation===$t){N=!0;let b=Rr(v.location,v.matches);b!=null&&ee({restoreScrollPosition:b})}return()=>{w=null,S=null,E=null}}function Er(u,f){return E&&E(u,f.map(b=>Xr(b,v.loaderData)))||u.key}function Jn(u,f){if(w&&S){let p=Er(u,f);w[p]=S()}}function Rr(u,f){if(w){let p=Er(u,f),b=w[p];if(typeof b=="number")return b}return null}function St(u,f,p){if(h)if(u){if(Object.keys(u[0].params).length>0)return{active:!0,matches:Mt(f,p,s,!0)}}else return{active:!0,matches:Mt(f,p,s,!0)||[]};return{active:!1,matches:null}}async function xt(u,f,p,b){if(!h)return{type:"success",matches:u};let R=u;for(;;){let T=l==null,U=l||i,C=o;try{await h({signal:p,path:f,matches:R,fetcherKey:b,patch:(D,I)=>{p.aborted||Ur(D,I,U,C,a)}})}catch(D){return{type:"error",error:D,partialMatches:R}}finally{T&&!p.aborted&&(i=[...i])}if(p.aborted)return{type:"aborted"};let L=Le(U,f,s);if(L)return{type:"success",matches:L};let P=Mt(U,f,s,!0);if(!P||R.length===P.length&&R.every((D,I)=>D.route.id===P[I].route.id))return{type:"success",matches:null};R=P}}function Yn(u){o={},l=Ut(u,a,void 0,o)}function Gn(u,f){let p=l==null;Ur(u,f,l||i,o,a),p&&(i=[...i],ee({}))}return fe={get basename(){return s},get future(){return m},get state(){return v},get routes(){return i},get window(){return t},initialize:In,subscribe:Nn,enableScrollRestoration:$n,navigate:fr,fetch:zn,revalidate:An,createHref:u=>e.history.createHref(u),encodeLocation:u=>e.history.encodeLocation(u),getFetcher:pr,deleteFetcher:Kn,dispose:On,getBlocker:Vn,deleteBlocker:br,patchRoutes:Gn,_internalFetchControllers:Z,_internalActiveDeferreds:Fe,_internalSetRoutes:Yn},fe}function _a(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Xt(e,t,r,n,a,o,i,l){let s,c;if(i){s=[];for(let m of t)if(s.push(m),m.route.id===i){c=m;break}}else s=t,c=t[t.length-1];let h=At(a||".",Nt(s,o),ae(e.pathname,r)||e.pathname,l==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&c){let m=ar(h.search);if(c.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&m){let y=new URLSearchParams(h.search),g=y.getAll("index");y.delete("index"),g.filter(E=>E).forEach(E=>y.append("index",E));let w=y.toString();h.search=w?"?"+w:""}}return n&&r!=="/"&&(h.pathname=h.pathname==="/"?r:ye([r,h.pathname])),pe(h)}function Dr(e,t,r,n){if(!n||!_a(n))return{path:r};if(n.formMethod&&!Wa(n.formMethod))return{path:r,error:re(405,{method:n.formMethod})};let a=()=>({path:r,error:re(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),l=sn(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!me(i))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((g,w)=>{let[E,S]=w;return""+g+E+"="+S+`
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!me(i))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}M(typeof FormData=="function","FormData is not available in this environment");let s,c;if(n.formData)s=Zt(n.formData),c=n.formData;else if(n.body instanceof FormData)s=Zt(n.body),c=n.body;else if(n.body instanceof URLSearchParams)s=n.body,c=Ir(s);else if(n.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(n.body),c=Ir(s)}catch{return a()}let h={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(me(h.formMethod))return{path:r,submission:h};let m=de(r);return t&&m.search&&ar(m.search)&&s.append("index",""),m.search="?"+s,{path:pe(m),submission:h}}function Tr(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function Mr(e,t,r,n,a,o,i,l,s,c,h,m,y,g,w,E){let S=E?le(E[1])?E[1].error:E[1].data:void 0,N=e.createURL(t.location),x=e.createURL(a),F=r;o&&t.errors?F=Tr(r,Object.keys(t.errors)[0],!0):E&&le(E[1])&&(F=Tr(r,E[0]));let A=E?E[1].statusCode:void 0,$=i&&A&&A>=400,fe=F.filter((_,H)=>{let{route:O}=_;if(O.lazy)return!0;if(O.loader==null)return!1;if(o)return Qt(O,t.loaderData,t.errors);if(Ua(t.loaderData,t.matches[H],_)||s.some(oe=>oe===_.route.id))return!0;let Q=t.matches[H],G=_;return _r(_,V({currentUrl:N,currentParams:Q.params,nextUrl:x,nextParams:G.params},n,{actionResult:S,actionStatus:A,defaultShouldRevalidate:$?!1:l||N.pathname+N.search===x.pathname+x.search||N.search!==x.search||on(Q,G)}))}),v=[];return m.forEach((_,H)=>{if(o||!r.some(te=>te.route.id===_.routeId)||h.has(H))return;let O=Le(g,_.path,w);if(!O){v.push({key:H,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let Q=t.fetchers.get(H),G=ct(O,_.path),oe=!1;y.has(H)?oe=!1:c.has(H)?(c.delete(H),oe=!0):Q&&Q.state!=="idle"&&Q.data===void 0?oe=l:oe=_r(G,V({currentUrl:N,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:r[r.length-1].params},n,{actionResult:S,actionStatus:A,defaultShouldRevalidate:$?!1:l})),oe&&v.push({key:H,routeId:_.routeId,path:_.path,matches:O,match:G,controller:new AbortController})}),[fe,v]}function Qt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Ua(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function on(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function _r(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Ur(e,t,r,n,a){var o;let i;if(e){let c=n[e];M(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),i=c.children}else i=r;let l=t.filter(c=>!i.some(h=>ln(c,h))),s=Ut(l,a,[e||"_","patch",String(((o=i)==null?void 0:o.length)||"0")],n);i.push(...s)}function ln(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>ln(r,o))}):!1}async function Fa(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];M(a,"No route found in manifest");let o={};for(let i in n){let s=a[i]!==void 0&&i!=="hasErrorBoundary";be(!s,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!s&&!qn.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,V({},t(a),{lazy:void 0}))}async function Ia(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,o,i)=>Object.assign(a,{[r[i].route.id]:o}),{})}async function Oa(e,t,r,n,a,o,i,l,s,c){let h=o.map(g=>g.route.lazy?Fa(g.route,s,l):void 0),m=o.map((g,w)=>{let E=h[w],S=a.some(x=>x.route.id===g.route.id);return V({},g,{shouldLoad:S,resolve:async x=>(x&&n.method==="GET"&&(g.route.lazy||g.route.loader)&&(S=!0),S?Na(t,n,g,E,x,c):Promise.resolve({type:z.data,result:void 0}))})}),y=await e({matches:m,request:n,params:o[0].params,fetcherKey:i,context:c});try{await Promise.all(h)}catch{}return y}async function Na(e,t,r,n,a,o){let i,l,s=c=>{let h,m=new Promise((w,E)=>h=E);l=()=>h(),t.signal.addEventListener("abort",l);let y=w=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):c({request:t,params:r.params,context:o},...w!==void 0?[w]:[]),g=(async()=>{try{return{type:"data",result:await(a?a(E=>y(E)):y())}}catch(w){return{type:"error",result:w}}})();return Promise.race([g,m])};try{let c=r.route[e];if(n)if(c){let h,[m]=await Promise.all([s(c).catch(y=>{h=y}),n]);if(h!==void 0)throw h;i=m}else if(await n,c=r.route[e],c)i=await s(c);else if(e==="action"){let h=new URL(t.url),m=h.pathname+h.search;throw re(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:z.data,result:void 0};else if(c)i=await s(c);else{let h=new URL(t.url),m=h.pathname+h.search;throw re(404,{pathname:m})}M(i.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:z.error,result:c}}finally{l&&t.signal.removeEventListener("abort",l)}return i}async function Aa(e){let{result:t,type:r}=e;if(un(t)){let m;try{let y=t.headers.get("Content-Type");y&&/\bapplication\/json\b/.test(y)?t.body==null?m=null:m=await t.json():m=await t.text()}catch(y){return{type:z.error,error:y}}return r===z.error?{type:z.error,error:new dt(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:z.data,data:m,statusCode:t.status,headers:t.headers}}if(r===z.error){if(kr(t)){var n,a;if(t.data instanceof Error){var o,i;return{type:z.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:new dt(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:Xe(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:z.error,error:t,statusCode:Xe(t)?t.status:void 0}}if(Ha(t)){var l,s;return{type:z.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(kr(t)){var c,h;return{type:z.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}}return{type:z.data,data:t}}function ja(e,t,r,n,a,o){let i=e.headers.get("Location");if(M(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!tr.test(i)){let l=n.slice(0,n.findIndex(s=>s.route.id===r)+1);i=Xt(new URL(t.url),l,a,!0,i,o),e.headers.set("Location",i)}return e}function Fr(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(tr.test(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let l=ae(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Je(e,t,r,n){let a=e.createURL(sn(t)).toString(),o={signal:r};if(n&&me(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=Zt(n.formData):o.body=n.formData}return new Request(a,o)}function Zt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Ir(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ka(e,t,r,n,a){let o={},i=null,l,s=!1,c={},h=r&&le(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let y=m.route.id,g=t[y];if(M(!ke(g),"Cannot handle redirect results in processLoaderData"),le(g)){let w=g.error;h!==void 0&&(w=h,h=void 0),i=i||{};{let E=je(e,y);i[E.route.id]==null&&(i[E.route.id]=w)}o[y]=void 0,s||(s=!0,l=Xe(g.error)?g.error.status:500),g.headers&&(c[y]=g.headers)}else De(g)?(n.set(y,g.deferredData),o[y]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(c[y]=g.headers)):(o[y]=g.data,g.statusCode&&g.statusCode!==200&&!s&&(l=g.statusCode),g.headers&&(c[y]=g.headers))}),h!==void 0&&r&&(i={[r[0]]:h},o[r[0]]=void 0),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:c}}function Or(e,t,r,n,a,o,i){let{loaderData:l,errors:s}=ka(t,r,n,i);return a.forEach(c=>{let{key:h,match:m,controller:y}=c,g=o[h];if(M(g,"Did not find corresponding fetcher result"),!(y&&y.signal.aborted))if(le(g)){let w=je(e.matches,m==null?void 0:m.route.id);s&&s[w.route.id]||(s=V({},s,{[w.route.id]:g.error})),e.fetchers.delete(h)}else if(ke(g))M(!1,"Unhandled fetcher revalidation redirect");else if(De(g))M(!1,"Unhandled fetcher deferred data");else{let w=Ce(g.data);e.fetchers.set(h,w)}}),{loaderData:l,errors:s}}function Nr(e,t,r,n){let a=V({},t);for(let o of r){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function Ar(e){return e?le(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function je(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function jr(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 re(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=t===void 0?{}:t,l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&r&&n?s="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):e===404?(l="Not Found",s='No route matches URL "'+r+'"'):e===405&&(l="Method Not Allowed",a&&r&&n?s="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(s='Invalid request method "'+a.toUpperCase()+'"')),new dt(e||500,l,new Error(s),!0)}function Lt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(ke(a))return{key:n,result:a}}}function sn(e){let t=typeof e=="string"?de(e):e;return pe(V({},t,{hash:""}))}function Ba(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function za(e){return un(e.result)&&Da.has(e.result.status)}function De(e){return e.type===z.deferred}function le(e){return e.type===z.error}function ke(e){return(e&&e.type)===z.redirect}function kr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ha(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function un(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Wa(e){return La.has(e.toLowerCase())}function me(e){return Pa.has(e.toLowerCase())}async function Ka(e,t,r,n,a){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[l,s]=o[i],c=e.find(y=>(y==null?void 0:y.route.id)===l);if(!c)continue;let h=n.find(y=>y.route.id===c.route.id),m=h!=null&&!on(h,c)&&(a&&a[c.route.id])!==void 0;De(s)&&m&&await nr(s,r,!1).then(y=>{y&&(t[l]=y)})}}async function Va(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:o,controller:i}=r[n],l=t[a];e.find(c=>(c==null?void 0:c.route.id)===o)&&De(l)&&(M(i,"Expected an AbortController for revalidating fetcher deferred result"),await nr(l,i.signal,!0).then(c=>{c&&(t[a]=c)}))}}async function nr(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:z.error,error:a}}return{type:z.data,data:e.deferredData.data}}}function ar(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ct(e,t){let r=typeof t=="string"?de(t).search:t.search;if(e[e.length-1].route.index&&ar(r||""))return e[e.length-1];let n=tn(e);return n[n.length-1]}function Br(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Jt(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 $a(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 st(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 Ja(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 Ce(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 Ya(e,t){try{let r=e.sessionStorage.getItem(an);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function Ga(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(an,JSON.stringify(r))}catch(n){be(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(this,arguments)}const Ze=d.createContext(null),mt=d.createContext(null),It=d.createContext(null),se=d.createContext(null),qe=d.createContext(null),ue=d.createContext({outlet:null,matches:[],isDataRoute:!1}),cn=d.createContext(null);function dn(e,t){let{relative:r}=t===void 0?{}:t;_e()||M(!1);let{basename:n,navigator:a}=d.useContext(se),{hash:o,pathname:i,search:l}=et(e,{relative:r}),s=i;return n!=="/"&&(s=i==="/"?n:ye([n,i])),a.createHref({pathname:s,search:l,hash:o})}function _e(){return d.useContext(qe)!=null}function ve(){return _e()||M(!1),d.useContext(qe).location}function Xa(){return d.useContext(qe).navigationType}function Qa(e){_e()||M(!1);let{pathname:t}=ve();return d.useMemo(()=>Ge(e,qr(t)),[t,e])}function fn(e){d.useContext(se).static||d.useLayoutEffect(e)}function jt(){let{isDataRoute:e}=d.useContext(ue);return e?fi():Za()}function Za(){_e()||M(!1);let e=d.useContext(Ze),{basename:t,future:r,navigator:n}=d.useContext(se),{matches:a}=d.useContext(ue),{pathname:o}=ve(),i=JSON.stringify(Nt(a,r.v7_relativeSplatPath)),l=d.useRef(!1);return fn(()=>{l.current=!0}),d.useCallback(function(c,h){if(h===void 0&&(h={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let m=At(c,JSON.parse(i),o,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ye([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,i,o,e])}const hn=d.createContext(null);function qa(){return d.useContext(hn)}function mn(e){let t=d.useContext(ue).outlet;return t&&d.createElement(hn.Provider,{value:e},t)}function ei(){let{matches:e}=d.useContext(ue),t=e[e.length-1];return t?t.params:{}}function et(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=d.useContext(se),{matches:a}=d.useContext(ue),{pathname:o}=ve(),i=JSON.stringify(Nt(a,n.v7_relativeSplatPath));return d.useMemo(()=>At(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function pn(e,t){return vn(e,t)}function vn(e,t,r,n){_e()||M(!1);let{navigator:a}=d.useContext(se),{matches:o}=d.useContext(ue),i=o[o.length-1],l=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let c=ve(),h;if(t){var m;let S=typeof t=="string"?de(t):t;s==="/"||(m=S.pathname)!=null&&m.startsWith(s)||M(!1),h=S}else h=c;let y=h.pathname||"/",g=y;if(s!=="/"){let S=s.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=Le(e,{pathname:g}),E=gn(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:ye([s,a.encodeLocation?a.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:ye([s,a.encodeLocation?a.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,r,n);return t&&E?d.createElement(qe.Provider,{value:{location:Te({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:K.Pop}},E):E}function ti(){let e=Rn(),t=Xe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:a},r):null,null)}const ri=d.createElement(ti,null);class ni extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){}render(){return this.state.error!==void 0?d.createElement(ue.Provider,{value:this.props.routeContext},d.createElement(cn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ai(e){let{routeContext:t,match:r,children:n}=e,a=d.useContext(Ze);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),d.createElement(ue.Provider,{value:t},n)}function gn(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let h=i.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);h>=0||M(!1),i=i.slice(0,Math.min(i.length,h+1))}let s=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=h),m.route.id){let{loaderData:y,errors:g}=r,w=m.route.loader&&y[m.route.id]===void 0&&(!g||g[m.route.id]===void 0);if(m.route.lazy||w){s=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((h,m,y)=>{let g,w=!1,E=null,S=null;r&&(g=l&&m.route.id?l[m.route.id]:void 0,E=m.route.errorElement||ri,s&&(c<0&&y===0?(hi("route-fallback"),w=!0,S=null):c===y&&(w=!0,S=m.route.hydrateFallbackElement||null)));let N=t.concat(i.slice(0,y+1)),x=()=>{let F;return g?F=E:w?F=S:m.route.Component?F=d.createElement(m.route.Component,null):m.route.element?F=m.route.element:F=h,d.createElement(ai,{match:m,routeContext:{outlet:h,matches:N,isDataRoute:r!=null},children:F})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?d.createElement(ni,{location:r.location,revalidation:r.revalidation,component:E,error:g,children:x(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):x()},null)}var yn=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(yn||{}),ie=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(ie||{});function ir(e){let t=d.useContext(Ze);return t||M(!1),t}function Ue(e){let t=d.useContext(mt);return t||M(!1),t}function ii(e){let t=d.useContext(ue);return t||M(!1),t}function pt(e){let t=ii(),r=t.matches[t.matches.length-1];return r.route.id||M(!1),r.route.id}function bn(){return pt(ie.UseRouteId)}function wn(){return Ue(ie.UseNavigation).navigation}function oi(){let e=ir(),t=Ue(ie.UseRevalidator);return d.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function En(){let{matches:e,loaderData:t}=Ue(ie.UseMatches);return d.useMemo(()=>e.map(r=>Xr(r,t)),[e,t])}function li(){let e=Ue(ie.UseLoaderData),t=pt(ie.UseLoaderData);if(!(e.errors&&e.errors[t]!=null))return e.loaderData[t]}function si(e){return Ue(ie.UseRouteLoaderData).loaderData[e]}function ui(){let e=Ue(ie.UseActionData),t=pt(ie.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Rn(){var e;let t=d.useContext(cn),r=Ue(ie.UseRouteError),n=pt(ie.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Sn(){let e=d.useContext(It);return e==null?void 0:e._data}function ci(){let e=d.useContext(It);return e==null?void 0:e._error}let di=0;function xn(e){let{router:t,basename:r}=ir(),n=Ue(ie.UseBlocker),[a,o]=d.useState(""),i=d.useCallback(l=>{if(typeof e!="function")return!!e;if(r==="/")return e(l);let{currentLocation:s,nextLocation:c,historyAction:h}=l;return e({currentLocation:Te({},s,{pathname:ae(s.pathname,r)||s.pathname}),nextLocation:Te({},c,{pathname:ae(c.pathname,r)||c.pathname}),historyAction:h})},[r,e]);return d.useEffect(()=>{let l=String(++di);return o(l),()=>t.deleteBlocker(l)},[t]),d.useEffect(()=>{a!==""&&t.getBlocker(a,i)},[t,a,i]),a&&n.blockers.has(a)?n.blockers.get(a):Ye}function fi(){let{router:e}=ir(yn.UseNavigateStable),t=pt(ie.UseNavigateStable),r=d.useRef(!1);return fn(()=>{r.current=!0}),d.useCallback(function(a,o){o===void 0&&(o={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Te({fromRouteId:t},o)))},[e,t])}const zr={};function hi(e,t,r){zr[e]||(zr[e]=!0)}function vt(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}const mi="startTransition",Hr=qt[mi];function pi(e){let{basename:t,children:r,initialEntries:n,initialIndex:a,future:o}=e,i=d.useRef();i.current==null&&(i.current=$r({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=i.current,[s,c]=d.useState({action:l.action,location:l.location}),{v7_startTransition:h}=o||{},m=d.useCallback(y=>{h&&Hr?Hr(()=>c(y)):c(y)},[c,h]);return d.useLayoutEffect(()=>l.listen(m),[l,m]),d.useEffect(()=>vt(o),[o]),d.createElement(tt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}function vi(e){let{to:t,replace:r,state:n,relative:a}=e;_e()||M(!1);let{future:o,static:i}=d.useContext(se),{matches:l}=d.useContext(ue),{pathname:s}=ve(),c=jt(),h=At(t,Nt(l,o.v7_relativeSplatPath),s,a==="path"),m=JSON.stringify(h);return d.useEffect(()=>c(JSON.parse(m),{replace:r,state:n,relative:a}),[c,m,a,r,n]),null}function gi(e){return mn(e.context)}function Pn(e){M(!1)}function tt(e){let{basename:t="/",children:r=null,location:n,navigationType:a=K.Pop,navigator:o,static:i=!1,future:l}=e;_e()&&M(!1);let s=t.replace(/^\/*/,"/"),c=d.useMemo(()=>({basename:s,navigator:o,static:i,future:Te({v7_relativeSplatPath:!1},l)}),[s,l,o,i]);typeof n=="string"&&(n=de(n));let{pathname:h="/",search:m="",hash:y="",state:g=null,key:w="default"}=n,E=d.useMemo(()=>{let S=ae(h,s);return S==null?null:{location:{pathname:S,search:m,hash:y,state:g,key:w},navigationType:a}},[s,h,m,y,g,w,a]);return E==null?null:d.createElement(se.Provider,{value:c},d.createElement(qe.Provider,{children:r,value:E}))}function yi(e){let{children:t,location:r}=e;return pn(ft(t),r)}function bi(e){let{children:t,errorElement:r,resolve:n}=e;return d.createElement(Ei,{resolve:n,errorElement:r},d.createElement(Ri,null,t))}var ce=(function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e})(ce||{});const wi=new Promise(()=>{});class Ei extends d.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=ce.pending;if(!(n instanceof Promise))o=ce.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});else if(this.state.error){o=ce.error;let i=this.state.error;a=Promise.reject().catch(()=>{}),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>i})}else n._tracked?(a=n,o="_error"in a?ce.error:"_data"in a?ce.success:ce.pending):(o=ce.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then(i=>Object.defineProperty(n,"_data",{get:()=>i}),i=>Object.defineProperty(n,"_error",{get:()=>i})));if(o===ce.error&&a._error instanceof Ft)throw wi;if(o===ce.error&&!r)throw a._error;if(o===ce.error)return d.createElement(It.Provider,{value:a,children:r});if(o===ce.success)return d.createElement(It.Provider,{value:a,children:t});throw a}}function Ri(e){let{children:t}=e,r=Sn(),n=typeof t=="function"?t(r):t;return d.createElement(d.Fragment,null,n)}function ft(e,t){t===void 0&&(t=[]);let r=[];return d.Children.forEach(e,(n,a)=>{if(!d.isValidElement(n))return;let o=[...t,a];if(n.type===d.Fragment){r.push.apply(r,ft(n.props.children,o));return}n.type!==Pn&&M(!1),!n.props.index||!n.props.children||M(!1);let i={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=ft(n.props.children,o)),r.push(i)}),r}function Si(e){return gn(e)}function or(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:d.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function xi(e,t){return rr({basename:t==null?void 0:t.basename,future:Te({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:$r({initialEntries:t==null?void 0:t.initialEntries,initialIndex:t==null?void 0:t.initialIndex}),hydrationData:t==null?void 0:t.hydrationData,routes:e,mapRouteProperties:or,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation}).initialize()}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(this,arguments)}function lr(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}const _t="get",Yt="application/x-www-form-urlencoded";function kt(e){return e!=null&&typeof e.tagName=="string"}function Pi(e){return kt(e)&&e.tagName.toLowerCase()==="button"}function Ci(e){return kt(e)&&e.tagName.toLowerCase()==="form"}function Li(e){return kt(e)&&e.tagName.toLowerCase()==="input"}function Di(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ti(e,t){return e.button===0&&(!t||t==="_self")&&!Di(e)}function Ot(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Mi(e,t){let r=Ot(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let Dt=null;function _i(){if(Dt===null)try{new FormData(document.createElement("form"),0),Dt=!1}catch{Dt=!0}return Dt}const Ui=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gt(e){return e!=null&&!Ui.has(e)?null:e}function Fi(e,t){let r,n,a,o,i;if(Ci(e)){let l=e.getAttribute("action");n=l?ae(l,t):null,r=e.getAttribute("method")||_t,a=Gt(e.getAttribute("enctype"))||Yt,o=new FormData(e)}else if(Pi(e)||Li(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?ae(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||_t,a=Gt(e.getAttribute("formenctype"))||Gt(l.getAttribute("enctype"))||Yt,o=new FormData(l,e),!_i()){let{name:c,type:h,value:m}=e;if(h==="image"){let y=c?c+".":"";o.append(y+"x","0"),o.append(y+"y","0")}else c&&o.append(c,m)}}else{if(kt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=_t,n=null,a=Yt,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const Ii=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Oi=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Ni=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"],Ai="6";try{window.__reactRouterVersion=Ai}catch{}function ji(e,t){return rr({basename:t==null?void 0:t.basename,future:ne({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Jr({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Cn(),routes:e,mapRouteProperties:or,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function ki(e,t){return rr({basename:t==null?void 0:t.basename,future:ne({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Yr({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Cn(),routes:e,mapRouteProperties:or,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function Cn(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ne({},t,{errors:Bi(t.errors)})),t}function Bi(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new dt(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack="",r[n]=o}}else r[n]=a;return r}const sr=d.createContext({isTransitioning:!1}),ur=d.createContext(new Map),zi="startTransition",Me=qt[zi],Hi="flushSync",Wr=Qn[Hi],Wi="useId",Kr=qt[Wi];function Ki(e){Me?Me(e):e()}function ut(e){Wr?Wr(e):e()}class Vi{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function $i(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=d.useState(r.state),[i,l]=d.useState(),[s,c]=d.useState({isTransitioning:!1}),[h,m]=d.useState(),[y,g]=d.useState(),[w,E]=d.useState(),S=d.useRef(new Map),{v7_startTransition:N}=n||{},x=d.useCallback(_=>{N?Ki(_):_()},[N]),F=d.useCallback((_,H)=>{let{deletedFetchers:O,flushSync:Q,viewTransitionOpts:G}=H;_.fetchers.forEach((te,we)=>{te.data!==void 0&&S.current.set(we,te.data)}),O.forEach(te=>S.current.delete(te));let oe=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!G||oe){Q?ut(()=>o(_)):x(()=>o(_));return}if(Q){ut(()=>{y&&(h&&h.resolve(),y.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let te=r.window.document.startViewTransition(()=>{ut(()=>o(_))});te.finished.finally(()=>{ut(()=>{m(void 0),g(void 0),l(void 0),c({isTransitioning:!1})})}),ut(()=>g(te));return}y?(h&&h.resolve(),y.skipTransition(),E({state:_,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(l(_),c({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,y,h,S,x]);d.useLayoutEffect(()=>r.subscribe(F),[r,F]),d.useEffect(()=>{s.isTransitioning&&!s.flushSync&&m(new Vi)},[s]),d.useEffect(()=>{if(h&&i&&r.window){let _=i,H=h.promise,O=r.window.document.startViewTransition(async()=>{x(()=>o(_)),await H});O.finished.finally(()=>{m(void 0),g(void 0),l(void 0),c({isTransitioning:!1})}),g(O)}},[x,i,h,r.window]),d.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,y,a.location,i]),d.useEffect(()=>{!s.isTransitioning&&w&&(l(w.state),c({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),E(void 0))},[s.isTransitioning,w]),d.useEffect(()=>{},[]);let A=d.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:_=>r.navigate(_),push:(_,H,O)=>r.navigate(_,{state:H,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(_,H,O)=>r.navigate(_,{replace:!0,state:H,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[r]),$=r.basename||"/",fe=d.useMemo(()=>({router:r,navigator:A,static:!1,basename:$}),[r,A,$]),v=d.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return d.useEffect(()=>vt(n,r.future),[n,r.future]),d.createElement(d.Fragment,null,d.createElement(Ze.Provider,{value:fe},d.createElement(mt.Provider,{value:a},d.createElement(ur.Provider,{value:S.current},d.createElement(sr.Provider,{value:s},d.createElement(tt,{basename:$,location:a.location,navigationType:a.historyAction,navigator:A,future:v},a.initialized||r.future.v7_partialHydration?d.createElement(Ji,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Ji=d.memo(Yi);function Yi(e){let{routes:t,future:r,state:n}=e;return vn(t,void 0,n,r)}function Gi(e){let{basename:t,children:r,future:n,window:a}=e,o=d.useRef();o.current==null&&(o.current=Jr({window:a,v5Compat:!0}));let i=o.current,[l,s]=d.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},h=d.useCallback(m=>{c&&Me?Me(()=>s(m)):s(m)},[s,c]);return d.useLayoutEffect(()=>i.listen(h),[i,h]),d.useEffect(()=>vt(n),[n]),d.createElement(tt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function Xi(e){let{basename:t,children:r,future:n,window:a}=e,o=d.useRef();o.current==null&&(o.current=Yr({window:a,v5Compat:!0}));let i=o.current,[l,s]=d.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},h=d.useCallback(m=>{c&&Me?Me(()=>s(m)):s(m)},[s,c]);return d.useLayoutEffect(()=>i.listen(h),[i,h]),d.useEffect(()=>vt(n),[n]),d.createElement(tt,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}function Qi(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=d.useState({action:a.action,location:a.location}),{v7_startTransition:l}=n||{},s=d.useCallback(c=>{l&&Me?Me(()=>i(c)):i(c)},[i,l]);return d.useLayoutEffect(()=>a.listen(s),[a,s]),d.useEffect(()=>vt(n),[n]),d.createElement(tt,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const Zi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qi=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ln=d.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:l,target:s,to:c,preventScrollReset:h,viewTransition:m}=t,y=lr(t,Ii),{basename:g}=d.useContext(se),w,E=!1;if(typeof c=="string"&&qi.test(c)&&(w=c,Zi))try{let F=new URL(window.location.href),A=c.startsWith("//")?new URL(F.protocol+c):new URL(c),$=ae(A.pathname,g);A.origin===F.origin&&$!=null?c=$+A.search+A.hash:E=!0}catch{}let S=dn(c,{relative:a}),N=Tn(c,{replace:i,state:l,target:s,preventScrollReset:h,relative:a,viewTransition:m});function x(F){n&&n(F),F.defaultPrevented||N(F)}return d.createElement("a",ne({},y,{href:w||S,onClick:E||o?n:x,ref:r,target:s}))}),eo=d.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,viewTransition:c,children:h}=t,m=lr(t,Oi),y=et(s,{relative:m.relative}),g=ve(),w=d.useContext(mt),{navigator:E,basename:S}=d.useContext(se),N=w!=null&&Fn(y)&&c===!0,x=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,F=g.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(F=F.toLowerCase(),A=A?A.toLowerCase():null,x=x.toLowerCase()),A&&S&&(A=ae(A,S)||A);const $=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let fe=F===x||!i&&F.startsWith(x)&&F.charAt($)==="/",v=A!=null&&(A===x||!i&&A.startsWith(x)&&A.charAt(x.length)==="/"),_={isActive:fe,isPending:v,isTransitioning:N},H=fe?n:void 0,O;typeof o=="function"?O=o(_):O=[o,fe?"active":null,v?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Q=typeof l=="function"?l(_):l;return d.createElement(Ln,ne({},m,{"aria-current":H,className:O,ref:r,style:Q,to:s,viewTransition:c}),typeof h=="function"?h(_):h)}),Dn=d.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:o,state:i,method:l=_t,action:s,onSubmit:c,relative:h,preventScrollReset:m,viewTransition:y}=e,g=lr(e,Ni),w=dr(),E=_n(s,{relative:h}),S=l.toLowerCase()==="get"?"get":"post",N=x=>{if(c&&c(x),x.defaultPrevented)return;x.preventDefault();let F=x.nativeEvent.submitter,A=(F==null?void 0:F.getAttribute("formmethod"))||l;w(F||x.currentTarget,{fetcherKey:r,method:A,navigate:n,replace:o,state:i,relative:h,preventScrollReset:m,viewTransition:y})};return d.createElement("form",ne({ref:t,method:S,action:E,onSubmit:a?c:N},g))});function to(e){let{getKey:t,storageKey:r}=e;return Un({getKey:t,storageKey:r}),null}var Qe;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Qe||(Qe={}));var ht;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ht||(ht={}));function Bt(e){let t=d.useContext(Ze);return t||M(!1),t}function cr(e){let t=d.useContext(mt);return t||M(!1),t}function Tn(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,viewTransition:l}=t===void 0?{}:t,s=jt(),c=ve(),h=et(e,{relative:i});return d.useCallback(m=>{if(Ti(m,r)){m.preventDefault();let y=n!==void 0?n:pe(c)===pe(h);s(e,{replace:y,state:a,preventScrollReset:o,relative:i,viewTransition:l})}},[c,s,h,n,a,r,e,o,i,l])}function ro(e){let t=d.useRef(Ot(e)),r=d.useRef(!1),n=ve(),a=d.useMemo(()=>Mi(n.search,r.current?null:t.current),[n.search]),o=jt(),i=d.useCallback((l,s)=>{const c=Ot(typeof l=="function"?l(a):l);r.current=!0,o("?"+c,s)},[o,a]);return[a,i]}function no(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let ao=0,Mn=()=>"__"+String(++ao)+"__";function dr(){let{router:e}=Bt(Qe.UseSubmit),{basename:t}=d.useContext(se),r=bn();return d.useCallback(function(n,a){a===void 0&&(a={}),no();let{action:o,method:i,encType:l,formData:s,body:c}=Fi(n,t);if(a.navigate===!1){let h=a.fetcherKey||Mn();e.fetch(h,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}function _n(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=d.useContext(se),a=d.useContext(ue);a||M(!1);let[o]=a.matches.slice(-1),i=ne({},et(e||".",{relative:r})),l=ve();if(e==null){i.search=l.search;let s=new URLSearchParams(i.search),c=s.getAll("index");if(c.some(m=>m==="")){s.delete("index"),c.filter(y=>y).forEach(y=>s.append("index",y));let m=s.toString();i.search=m?"?"+m:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:ye([n,i.pathname])),pe(i)}function io(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=Bt(Qe.UseFetcher),a=cr(ht.UseFetcher),o=d.useContext(ur),i=d.useContext(ue),l=(t=i.matches[i.matches.length-1])==null?void 0:t.route.id;o||M(!1),i||M(!1),l==null&&M(!1);let s=Kr?Kr():"",[c,h]=d.useState(r||s);r&&r!==c?h(r):c||h(Mn()),d.useEffect(()=>(n.getFetcher(c),()=>{n.deleteFetcher(c)}),[n,c]);let m=d.useCallback((x,F)=>{l||M(!1),n.fetch(c,l,x,F)},[c,l,n]),y=dr(),g=d.useCallback((x,F)=>{y(x,ne({},F,{navigate:!1,fetcherKey:c}))},[c,y]),w=d.useMemo(()=>d.forwardRef((F,A)=>d.createElement(Dn,ne({},F,{navigate:!1,fetcherKey:c,ref:A}))),[c]),E=a.fetchers.get(c)||nn,S=o.get(c);return d.useMemo(()=>ne({Form:w,submit:g,load:m},E,{data:S}),[w,g,m,E,S])}function oo(){let e=cr(ht.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[r,n]=t;return ne({},n,{key:r})})}const Vr="react-router-scroll-positions";let Tt={};function Un(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=Bt(Qe.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=cr(ht.UseScrollRestoration),{basename:i}=d.useContext(se),l=ve(),s=En(),c=wn();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),so(d.useCallback(()=>{if(c.state==="idle"){let h=(t?t(l,s):null)||l.key;Tt[h]=window.scrollY}try{sessionStorage.setItem(r||Vr,JSON.stringify(Tt))}catch{}window.history.scrollRestoration="auto"},[r,t,c.state,l,s])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let h=sessionStorage.getItem(r||Vr);h&&(Tt=JSON.parse(h))}catch{}},[r]),d.useLayoutEffect(()=>{let h=t&&i!=="/"?(y,g)=>t(ne({},y,{pathname:ae(y.pathname,i)||y.pathname}),g):t,m=n==null?void 0:n.enableScrollRestoration(Tt,()=>window.scrollY,h);return()=>m&&m()},[n,i,t]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(l.hash){let h=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(h){h.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[l,a,o]))}function lo(e,t){let{capture:r}=t||{};d.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}function so(e,t){let{capture:r}={};d.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function uo(e){let{when:t,message:r}=e,n=xn(t);d.useEffect(()=>{n.state==="blocked"&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),d.useEffect(()=>{n.state==="blocked"&&!t&&n.reset()},[n,t])}function Fn(e,t){t===void 0&&(t={});let r=d.useContext(sr);r==null&&M(!1);let{basename:n}=Bt(Qe.useViewTransitionState),a=et(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ae(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=ae(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ge(a.pathname,i)!=null||Ge(a.pathname,o)!=null}const fo=Object.freeze(Object.defineProperty({__proto__:null,AbortedDeferredError:Ft,Await:bi,BrowserRouter:Gi,Form:Dn,HashRouter:Xi,Link:Ln,MemoryRouter:pi,NavLink:eo,Navigate:vi,get NavigationType(){return K},Outlet:gi,Route:Pn,Router:tt,RouterProvider:$i,Routes:yi,ScrollRestoration:to,UNSAFE_DataRouterContext:Ze,UNSAFE_DataRouterStateContext:mt,UNSAFE_ErrorResponseImpl:dt,UNSAFE_FetchersContext:ur,UNSAFE_LocationContext:qe,UNSAFE_NavigationContext:se,UNSAFE_RouteContext:ue,UNSAFE_ViewTransitionContext:sr,UNSAFE_useRouteId:bn,UNSAFE_useScrollRestoration:Un,createBrowserRouter:ji,createHashRouter:ki,createMemoryRouter:xi,createPath:pe,createRoutesFromChildren:ft,createRoutesFromElements:ft,createSearchParams:Ot,defer:Ra,generatePath:da,isRouteErrorResponse:Xe,json:ya,matchPath:Ge,matchRoutes:Le,parsePath:de,redirect:er,redirectDocument:Sa,renderMatches:Si,replace:xa,resolvePath:en,unstable_HistoryRouter:Qi,unstable_usePrompt:uo,useActionData:ui,useAsyncError:ci,useAsyncValue:Sn,useBeforeUnload:lo,useBlocker:xn,useFetcher:io,useFetchers:oo,useFormAction:_n,useHref:dn,useInRouterContext:_e,useLinkClickHandler:Tn,useLoaderData:li,useLocation:ve,useMatch:Qa,useMatches:En,useNavigate:jt,useNavigation:wn,useNavigationType:Xa,useOutlet:mn,useOutletContext:qa,useParams:ei,useResolvedPath:et,useRevalidator:oi,useRouteError:Rn,useRouteLoaderData:si,useRoutes:pn,useSearchParams:ro,useSubmit:dr,useViewTransitionState:Fn},Symbol.toStringTag,{value:"Module"}));export{Gi as B,Ln as L,vi as N,yi as R,ro as a,jt as b,ei as c,Pn as d,fo as e,ve as u};