function Sa(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function xa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wt={exports:{}},tt={};/**
 * @license React
 * react-jsx-runtime.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 zr;function Ca(){if(zr)return tt;zr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,n,o){var l=null;if(o!==void 0&&(l=""+o),n.key!==void 0&&(l=""+n.key),"key"in n){o={};for(var s in n)s!=="key"&&(o[s]=n[s])}else o=n;return n=o.ref,{$$typeof:e,type:a,key:l,ref:n!==void 0?n:null,props:o}}return tt.Fragment=t,tt.jsx=r,tt.jsxs=r,tt}var Br;function La(){return Br||(Br=1,Wt.exports=Ca()),Wt.exports}var pl=La(),Yt={exports:{}},Y={};/**
 * @license React
 * react.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 Wr;function Pa(){if(Wr)return Y;Wr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),p=Symbol.iterator;function h(m){return m===null||typeof m!="object"?null:(m=p&&m[p]||m["@@iterator"],typeof m=="function"?m:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function S(m,C,A){this.props=m,this.context=C,this.refs=b,this.updater=A||g}S.prototype.isReactComponent={},S.prototype.setState=function(m,C){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,C,"setState")},S.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function E(){}E.prototype=S.prototype;function _(m,C,A){this.props=m,this.context=C,this.refs=b,this.updater=A||g}var P=_.prototype=new E;P.constructor=_,w(P,S.prototype),P.isPureReactComponent=!0;var T=Array.isArray,x={H:null,A:null,T:null,S:null,V:null},y=Object.prototype.hasOwnProperty;function O(m,C,A,k,V,ee){return A=ee.ref,{$$typeof:e,type:m,key:C,ref:A!==void 0?A:null,props:ee}}function U(m,C){return O(m.type,C,void 0,void 0,void 0,m.props)}function j(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function K(m){var C={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(A){return C[A]})}var re=/\/+/g;function se(m,C){return typeof m=="object"&&m!==null&&m.key!=null?K(""+m.key):C.toString(36)}function oe(){}function X(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(oe,oe):(m.status="pending",m.then(function(C){m.status==="pending"&&(m.status="fulfilled",m.value=C)},function(C){m.status==="pending"&&(m.status="rejected",m.reason=C)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function Q(m,C,A,k,V){var ee=typeof m;(ee==="undefined"||ee==="boolean")&&(m=null);var z=!1;if(m===null)z=!0;else switch(ee){case"bigint":case"string":case"number":z=!0;break;case"object":switch(m.$$typeof){case e:case t:z=!0;break;case c:return z=m._init,Q(z(m._payload),C,A,k,V)}}if(z)return V=V(m),z=k===""?"."+se(m,0):k,T(V)?(A="",z!=null&&(A=z.replace(re,"$&/")+"/"),Q(V,C,A,"",function($t){return $t})):V!=null&&(j(V)&&(V=U(V,A+(V.key==null||m&&m.key===V.key?"":(""+V.key).replace(re,"$&/")+"/")+z)),C.push(V)),1;z=0;var xe=k===""?".":k+":";if(T(m))for(var ne=0;ne<m.length;ne++)k=m[ne],ee=xe+se(k,ne),z+=Q(k,C,A,ee,V);else if(ne=h(m),typeof ne=="function")for(m=ne.call(m),ne=0;!(k=m.next()).done;)k=k.value,ee=xe+se(k,ne++),z+=Q(k,C,A,ee,V);else if(ee==="object"){if(typeof m.then=="function")return Q(X(m),C,A,k,V);throw C=String(m),Error("Objects are not valid as a React child (found: "+(C==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":C)+"). If you meant to render a collection of children, use an array instead.")}return z}function G(m,C,A){if(m==null)return m;var k=[],V=0;return Q(m,k,"","",function(ee){return C.call(A,ee,V++)}),k}function ue(m){if(m._status===-1){var C=m._result;C=C(),C.then(function(A){(m._status===0||m._status===-1)&&(m._status=1,m._result=A)},function(A){(m._status===0||m._status===-1)&&(m._status=2,m._result=A)}),m._status===-1&&(m._status=0,m._result=C)}if(m._status===1)return m._result.default;throw m._result}var de=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var C=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(C))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)};function ce(){}return Y.Children={map:G,forEach:function(m,C,A){G(m,function(){C.apply(this,arguments)},A)},count:function(m){var C=0;return G(m,function(){C++}),C},toArray:function(m){return G(m,function(C){return C})||[]},only:function(m){if(!j(m))throw Error("React.Children.only expected to receive a single React element child.");return m}},Y.Component=S,Y.Fragment=r,Y.Profiler=n,Y.PureComponent=_,Y.StrictMode=a,Y.Suspense=i,Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,Y.__COMPILER_RUNTIME={__proto__:null,c:function(m){return x.H.useMemoCache(m)}},Y.cache=function(m){return function(){return m.apply(null,arguments)}},Y.cloneElement=function(m,C,A){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var k=w({},m.props),V=m.key,ee=void 0;if(C!=null)for(z in C.ref!==void 0&&(ee=void 0),C.key!==void 0&&(V=""+C.key),C)!y.call(C,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&C.ref===void 0||(k[z]=C[z]);var z=arguments.length-2;if(z===1)k.children=A;else if(1<z){for(var xe=Array(z),ne=0;ne<z;ne++)xe[ne]=arguments[ne+2];k.children=xe}return O(m.type,V,void 0,void 0,ee,k)},Y.createContext=function(m){return m={$$typeof:l,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:o,_context:m},m},Y.createElement=function(m,C,A){var k,V={},ee=null;if(C!=null)for(k in C.key!==void 0&&(ee=""+C.key),C)y.call(C,k)&&k!=="key"&&k!=="__self"&&k!=="__source"&&(V[k]=C[k]);var z=arguments.length-2;if(z===1)V.children=A;else if(1<z){for(var xe=Array(z),ne=0;ne<z;ne++)xe[ne]=arguments[ne+2];V.children=xe}if(m&&m.defaultProps)for(k in z=m.defaultProps,z)V[k]===void 0&&(V[k]=z[k]);return O(m,ee,void 0,void 0,null,V)},Y.createRef=function(){return{current:null}},Y.forwardRef=function(m){return{$$typeof:s,render:m}},Y.isValidElement=j,Y.lazy=function(m){return{$$typeof:c,_payload:{_status:-1,_result:m},_init:ue}},Y.memo=function(m,C){return{$$typeof:u,type:m,compare:C===void 0?null:C}},Y.startTransition=function(m){var C=x.T,A={};x.T=A;try{var k=m(),V=x.S;V!==null&&V(A,k),typeof k=="object"&&k!==null&&typeof k.then=="function"&&k.then(ce,de)}catch(ee){de(ee)}finally{x.T=C}},Y.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},Y.use=function(m){return x.H.use(m)},Y.useActionState=function(m,C,A){return x.H.useActionState(m,C,A)},Y.useCallback=function(m,C){return x.H.useCallback(m,C)},Y.useContext=function(m){return x.H.useContext(m)},Y.useDebugValue=function(){},Y.useDeferredValue=function(m,C){return x.H.useDeferredValue(m,C)},Y.useEffect=function(m,C,A){var k=x.H;if(typeof A=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return k.useEffect(m,C)},Y.useId=function(){return x.H.useId()},Y.useImperativeHandle=function(m,C,A){return x.H.useImperativeHandle(m,C,A)},Y.useInsertionEffect=function(m,C){return x.H.useInsertionEffect(m,C)},Y.useLayoutEffect=function(m,C){return x.H.useLayoutEffect(m,C)},Y.useMemo=function(m,C){return x.H.useMemo(m,C)},Y.useOptimistic=function(m,C){return x.H.useOptimistic(m,C)},Y.useReducer=function(m,C,A){return x.H.useReducer(m,C,A)},Y.useRef=function(m){return x.H.useRef(m)},Y.useState=function(m){return x.H.useState(m)},Y.useSyncExternalStore=function(m,C,A){return x.H.useSyncExternalStore(m,C,A)},Y.useTransition=function(){return x.H.useTransition()},Y.version="19.1.0",Y}var Yr;function Ma(){return Yr||(Yr=1,Yt.exports=Pa()),Yt.exports}var d=Ma();const Ta=xa(d),yl=Sa({__proto__:null,default:Ta},[d]);var rt={},Vr;function _a(){if(Vr)return rt;Vr=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.parse=l,rt.serialize=u;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const h=function(){};return h.prototype=Object.create(null),h})();function l(h,g){const w=new o,b=h.length;if(b<2)return w;const S=(g==null?void 0:g.decode)||c;let E=0;do{const _=h.indexOf("=",E);if(_===-1)break;const P=h.indexOf(";",E),T=P===-1?b:P;if(_>T){E=h.lastIndexOf(";",_-1)+1;continue}const x=s(h,E,_),y=i(h,_,x),O=h.slice(x,y);if(w[O]===void 0){let U=s(h,_+1,T),j=i(h,T,U);const K=S(h.slice(U,j));w[O]=K}E=T+1}while(E<b);return w}function s(h,g,w){do{const b=h.charCodeAt(g);if(b!==32&&b!==9)return g}while(++g<w);return w}function i(h,g,w){for(;g>w;){const b=h.charCodeAt(--g);if(b!==32&&b!==9)return g+1}return w}function u(h,g,w){const b=(w==null?void 0:w.encode)||encodeURIComponent;if(!e.test(h))throw new TypeError(`argument name is invalid: ${h}`);const S=b(g);if(!t.test(S))throw new TypeError(`argument val is invalid: ${g}`);let E=h+"="+S;if(!w)return E;if(w.maxAge!==void 0){if(!Number.isInteger(w.maxAge))throw new TypeError(`option maxAge is invalid: ${w.maxAge}`);E+="; Max-Age="+w.maxAge}if(w.domain){if(!r.test(w.domain))throw new TypeError(`option domain is invalid: ${w.domain}`);E+="; Domain="+w.domain}if(w.path){if(!a.test(w.path))throw new TypeError(`option path is invalid: ${w.path}`);E+="; Path="+w.path}if(w.expires){if(!p(w.expires)||!Number.isFinite(w.expires.valueOf()))throw new TypeError(`option expires is invalid: ${w.expires}`);E+="; Expires="+w.expires.toUTCString()}if(w.httpOnly&&(E+="; HttpOnly"),w.secure&&(E+="; Secure"),w.partitioned&&(E+="; Partitioned"),w.priority)switch(typeof w.priority=="string"?w.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${w.priority}`)}if(w.sameSite)switch(typeof w.sameSite=="string"?w.sameSite.toLowerCase():w.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${w.sameSite}`)}return E}function c(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function p(h){return n.call(h)==="[object Date]"}return rt}_a();/**
 * react-router v7.6.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var wn=e=>{throw TypeError(e)},Da=(e,t,r)=>t.has(e)||wn("Cannot "+r),Vt=(e,t,r)=>(Da(e,t,"read from private field"),r?r.call(e):t.get(e)),Oa=(e,t,r)=>t.has(e)?wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Jr="popstate";function vl(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return st("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:ke(n)}return Aa(t,r,null,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ae(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ka(){return Math.random().toString(36).substring(2,10)}function Gr(e,t){return{usr:e.state,key:e.key,idx:t}}function st(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ne(t):t,state:r,key:t&&t.key||a||ka()}}function ke({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 Ne(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 Aa(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",i=null,u=c();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function c(){return(l.state||{idx:null}).idx}function p(){s="POP";let S=c(),E=S==null?null:S-u;u=S,i&&i({action:s,location:b.location,delta:E})}function h(S,E){s="PUSH";let _=st(b.location,S,E);u=c()+1;let P=Gr(_,u),T=b.createHref(_);try{l.pushState(P,"",T)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;n.location.assign(T)}o&&i&&i({action:s,location:b.location,delta:1})}function g(S,E){s="REPLACE";let _=st(b.location,S,E);u=c();let P=Gr(_,u),T=b.createHref(_);l.replaceState(P,"",T),o&&i&&i({action:s,location:b.location,delta:0})}function w(S){return En(S)}let b={get action(){return s},get location(){return e(n,l)},listen(S){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Jr,p),i=S,()=>{n.removeEventListener(Jr,p),i=null}},createHref(S){return t(n,S)},createURL:w,encodeLocation(S){let E=w(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:h,replace:g,go(S){return l.go(S)}};return b}function En(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),W(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ke(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var it,Xr=class{constructor(e){if(Oa(this,it,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Vt(this,it).has(e))return Vt(this,it).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Vt(this,it).set(e,t)}};it=new WeakMap;var Na=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ia(e){return Na.has(e)}var Fa=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function $a(e){return Fa.has(e)}function ja(e){return e.index===!0}function Tt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(W(n.index!==!0||!n.children,"Cannot specify children on an index route"),W(!a[s],`Found a route id collision on id "${s}".  Route id's must be globally unique within Data Router usages`),ja(n)){let i={...n,...t(n),id:s};return a[s]=i,i}else{let i={...n,...t(n),id:s,children:void 0};return a[s]=i,n.children&&(i.children=Tt(n.children,t,l,a)),i}})}function Ce(e,t,r="/"){return xt(e,t,r,!1)}function xt(e,t,r,a){let n=typeof t=="string"?Ne(t):t,o=ge(n.pathname||"/",r);if(o==null)return null;let l=bn(e);Ha(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=qa(o);s=Xa(l[i],u,a)}return s}function Rn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],handle:r.handle}}function bn(e,t=[],r=[],a=""){let n=(o,l,s)=>{let i={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};i.relativePath.startsWith("/")&&(W(i.relativePath.startsWith(a),`Absolute route path "${i.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),i.relativePath=i.relativePath.slice(a.length));let u=Le([a,i.relativePath]),c=r.concat(i);o.children&&o.children.length>0&&(W(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),bn(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Ja(u,o.index),routesMeta:c})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))n(o,l);else for(let i of Sn(o.path))n(o,l,i)}),t}function Sn(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 l=Sn(a.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),n&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function Ha(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ga(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Ua=/^:[\w-]+$/,za=3,Ba=2,Wa=1,Ya=10,Va=-2,qr=e=>e==="*";function Ja(e,t){let r=e.split("/"),a=r.length;return r.some(qr)&&(a+=Va),t&&(a+=Ba),r.filter(n=>!qr(n)).reduce((n,o)=>n+(Ua.test(o)?za:o===""?Wa:Ya),a)}function Ga(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 Xa(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s<a.length;++s){let i=a[s],u=s===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",p=_t({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},c),h=i.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=_t({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),l.push({params:n,pathname:Le([o,p.pathname]),pathnameBase:Za(Le([o,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(o=Le([o,p.pathnameBase]))}return l}function _t(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=xn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],l=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:p},h)=>{if(c==="*"){let w=s[h]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=s[h];return p&&!g?u[c]=void 0:u[c]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function xn(e,t=!1,r=!0){ae(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,(l,s,i)=>(a.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function qa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ae(!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 ge(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 Ka(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Ne(e):e;return{pathname:r?r.startsWith("/")?r:Qa(r,t):t,search:eo(a),hash:to(n)}}function Qa(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 Jt(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 Cn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function cr(e){let t=Cn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function dr(e,t,r,a=!1){let n;typeof e=="string"?n=Ne(e):(n={...e},W(!n.pathname||!n.pathname.includes("?"),Jt("?","pathname","search",n)),W(!n.pathname||!n.pathname.includes("#"),Jt("#","pathname","hash",n)),W(!n.search||!n.search.includes("#"),Jt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let p=t.length-1;if(!a&&l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),p-=1;n.pathname=h.join("/")}s=p>=0?t[p]:"/"}let i=Ka(n,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||c)&&(i.pathname+="/"),i}var Le=e=>e.join("/").replace(/\/\/+/g,"/"),Za=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,to=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ro=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function no(e,t){return new ro(e,typeof t=="number"?{status:t}:t)}var ao=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},Ae=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 ze(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Ln=["POST","PUT","PATCH","DELETE"],oo=new Set(Ln),io=["GET",...Ln],lo=new Set(io),so=new Set([301,302,303,307,308]),uo=new Set([307,308]),Gt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,co=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Mn="remix-router-transitions",Tn=Symbol("ResetLoaderData");function gl(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";W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||co,o={},l=Tt(e.routes,n,void 0,o),s,i=e.basename||"/",u=e.dataStrategy||yo,c={unstable_middleware:!1,...e.future},p=null,h=new Set,g=null,w=null,b=null,S=e.hydrationData!=null,E=Ce(l,e.history.location,i),_=!1,P=null,T;if(E==null&&!e.patchRoutesOnNavigation){let f=Re(404,{pathname:e.history.location.pathname}),{matches:v,route:R}=un(l);T=!0,E=v,P={[R.id]:f}}else if(E&&!e.hydrationData&&pt(E,l,e.history.location.pathname).active&&(E=null),E)if(E.some(f=>f.route.lazy))T=!1;else if(!E.some(f=>f.route.loader))T=!0;else{let f=e.hydrationData?e.hydrationData.loaderData:null,v=e.hydrationData?e.hydrationData.errors:null;if(v){let R=E.findIndex(L=>v[L.route.id]!==void 0);T=E.slice(0,R+1).every(L=>!tr(L.route,f,v))}else T=E.every(R=>!tr(R.route,f,v))}else{T=!1,E=[];let f=pt(null,l,e.history.location.pathname);f.active&&f.matches&&(_=!0,E=f.matches)}let x,y={historyAction:e.history.action,location:e.history.location,matches:E,initialized:T,navigation:Gt,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||P,fetchers:new Map,blockers:new Map},O="POP",U=!1,j,K=!1,re=new Map,se=null,oe=!1,X=!1,Q=new Set,G=new Map,ue=0,de=-1,ce=new Map,m=new Set,C=new Map,A=new Map,k=new Set,V=new Map,ee,z=null;function xe(){if(p=e.history.listen(({action:f,location:v,delta:R})=>{if(ee){ee(),ee=void 0;return}ae(V.size===0||R!=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 L=$r({currentLocation:y.location,nextLocation:v,historyAction:f});if(L&&R!=null){let M=new Promise(N=>{ee=N});e.history.go(R*-1),mt(L,{state:"blocked",location:v,proceed(){mt(L,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),M.then(()=>e.history.go(R))},reset(){let N=new Map(y.blockers);N.set(L,nt),he({blockers:N})}});return}return Ie(f,v)}),r){Po(t,re);let f=()=>Mo(t,re);t.addEventListener("pagehide",f),se=()=>t.removeEventListener("pagehide",f)}return y.initialized||Ie("POP",y.location,{initialHydration:!0}),x}function ne(){p&&p(),se&&se(),h.clear(),j&&j.abort(),y.fetchers.forEach((f,v)=>Ht(v)),y.blockers.forEach((f,v)=>Fr(v))}function $t(f){return h.add(f),()=>h.delete(f)}function he(f,v={}){y={...y,...f};let R=[],L=[];y.fetchers.forEach((M,N)=>{M.state==="idle"&&(k.has(N)?R.push(N):L.push(N))}),k.forEach(M=>{!y.fetchers.has(M)&&!G.has(M)&&R.push(M)}),[...h].forEach(M=>M(y,{deletedFetchers:R,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),R.forEach(M=>Ht(M)),L.forEach(M=>y.fetchers.delete(M))}function We(f,v,{flushSync:R}={}){var $,B;let L=y.actionData!=null&&y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&y.navigation.state==="loading"&&(($=f.state)==null?void 0:$._isRedirect)!==!0,M;v.actionData?Object.keys(v.actionData).length>0?M=v.actionData:M=null:L?M=y.actionData:M=null;let N=v.loaderData?ln(y.loaderData,v.loaderData,v.matches||[],v.errors):y.loaderData,H=y.blockers;H.size>0&&(H=new Map(H),H.forEach((F,J)=>H.set(J,nt)));let D=U===!0||y.navigation.formMethod!=null&&ve(y.navigation.formMethod)&&((B=f.state)==null?void 0:B._isRedirect)!==!0;s&&(l=s,s=void 0),oe||O==="POP"||(O==="PUSH"?e.history.push(f,f.state):O==="REPLACE"&&e.history.replace(f,f.state));let I;if(O==="POP"){let F=re.get(y.location.pathname);F&&F.has(f.pathname)?I={currentLocation:y.location,nextLocation:f}:re.has(f.pathname)&&(I={currentLocation:f,nextLocation:y.location})}else if(K){let F=re.get(y.location.pathname);F?F.add(f.pathname):(F=new Set([f.pathname]),re.set(y.location.pathname,F)),I={currentLocation:y.location,nextLocation:f}}he({...v,actionData:M,loaderData:N,historyAction:O,location:f,initialized:!0,navigation:Gt,revalidation:"idle",restoreScrollPosition:Hr(f,v.matches||y.matches),preventScrollReset:D,blockers:H},{viewTransitionOpts:I,flushSync:R===!0}),O="POP",U=!1,K=!1,oe=!1,X=!1,z==null||z.resolve(),z=null}async function _r(f,v){if(typeof f=="number"){e.history.go(f);return}let R=er(y.location,y.matches,i,f,v==null?void 0:v.fromRouteId,v==null?void 0:v.relative),{path:L,submission:M,error:N}=Kr(!1,R,v),H=y.location,D=st(y.location,L,v&&v.state);D={...D,...e.history.encodeLocation(D)};let I=v&&v.replace!=null?v.replace:void 0,$="PUSH";I===!0?$="REPLACE":I===!1||M!=null&&ve(M.formMethod)&&M.formAction===y.location.pathname+y.location.search&&($="REPLACE");let B=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,F=(v&&v.flushSync)===!0,J=$r({currentLocation:H,nextLocation:D,historyAction:$});if(J){mt(J,{state:"blocked",location:D,proceed(){mt(J,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),_r(f,v)},reset(){let te=new Map(y.blockers);te.set(J,nt),he({blockers:te})}});return}await Ie($,D,{submission:M,pendingError:N,preventScrollReset:B,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:F})}function ua(){z||(z=To()),jt(),he({revalidation:"loading"});let f=z.promise;return y.navigation.state==="submitting"?f:y.navigation.state==="idle"?(Ie(y.historyAction,y.location,{startUninterruptedRevalidation:!0}),f):(Ie(O||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:K===!0}),f)}async function Ie(f,v,R){j&&j.abort(),j=null,O=f,oe=(R&&R.startUninterruptedRevalidation)===!0,wa(y.location,y.matches),U=(R&&R.preventScrollReset)===!0,K=(R&&R.enableViewTransition)===!0;let L=s||l,M=R&&R.overrideNavigation,N=R!=null&&R.initialHydration&&y.matches&&y.matches.length>0&&!_?y.matches:Ce(L,v,i),H=(R&&R.flushSync)===!0;if(N&&y.initialized&&!X&&bo(y.location,v)&&!(R&&R.submission&&ve(R.submission.formMethod))){We(v,{matches:N},{flushSync:H});return}let D=pt(N,L,v.pathname);if(D.active&&D.matches&&(N=D.matches),!N){let{error:fe,notFoundMatches:pe,route:q}=Ut(v.pathname);We(v,{matches:pe,loaderData:{},errors:{[q.id]:fe}},{flushSync:H});return}j=new AbortController;let I=Ve(e.history,v,j.signal,R&&R.submission),$=new Xr(e.unstable_getContext?await e.unstable_getContext():void 0),B;if(R&&R.pendingError)B=[He(N).route.id,{type:"error",error:R.pendingError}];else if(R&&R.submission&&ve(R.submission.formMethod)){let fe=await ca(I,v,R.submission,N,$,D.active,R&&R.initialHydration===!0,{replace:R.replace,flushSync:H});if(fe.shortCircuited)return;if(fe.pendingActionResult){let[pe,q]=fe.pendingActionResult;if(ye(q)&&ze(q.error)&&q.error.status===404){j=null,We(v,{matches:fe.matches,loaderData:{},errors:{[pe]:q.error}});return}}N=fe.matches||N,B=fe.pendingActionResult,M=Xt(v,R.submission),H=!1,D.active=!1,I=Ve(e.history,I.url,I.signal)}let{shortCircuited:F,matches:J,loaderData:te,errors:le}=await da(I,v,N,$,D.active,M,R&&R.submission,R&&R.fetcherSubmission,R&&R.replace,R&&R.initialHydration===!0,H,B);F||(j=null,We(v,{matches:J||N,...sn(B),loaderData:te,errors:le}))}async function ca(f,v,R,L,M,N,H,D={}){jt();let I=Co(v,R);if(he({navigation:I},{flushSync:D.flushSync===!0}),N){let F=await yt(L,v.pathname,f.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){let J=He(F.partialMatches).route.id;return{matches:F.partialMatches,pendingActionResult:[J,{type:"error",error:F.error}]}}else if(F.matches)L=F.matches;else{let{notFoundMatches:J,error:te,route:le}=Ut(v.pathname);return{matches:J,pendingActionResult:[le.id,{type:"error",error:te}]}}}let $,B=lt(L,v);if(!B.route.action&&!B.route.lazy)$={type:"error",error:Re(405,{method:f.method,pathname:v.pathname,routeId:B.route.id})};else{let F=Je(n,o,f,L,B,H?[]:a,M),J=await qe(f,F,M,null);if($=J[B.route.id],!$){for(let te of L)if(J[te.route.id]){$=J[te.route.id];break}}if(f.signal.aborted)return{shortCircuited:!0}}if(Ue($)){let F;return D&&D.replace!=null?F=D.replace:F=nn($.response.headers.get("Location"),new URL(f.url),i)===y.location.pathname+y.location.search,await Fe(f,$,!0,{submission:R,replace:F}),{shortCircuited:!0}}if(ye($)){let F=He(L,B.route.id);return(D&&D.replace)!==!0&&(O="PUSH"),{matches:L,pendingActionResult:[F.route.id,$,B.route.id]}}return{matches:L,pendingActionResult:[B.route.id,$]}}async function da(f,v,R,L,M,N,H,D,I,$,B,F){let J=N||Xt(v,H),te=H||D||cn(J),le=!oe&&!$;if(M){if(le){let Ee=Dr(F);he({navigation:J,...Ee!==void 0?{actionData:Ee}:{}},{flushSync:B})}let Z=await yt(R,v.pathname,f.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){let Ee=He(Z.partialMatches).route.id;return{matches:Z.partialMatches,loaderData:{},errors:{[Ee]:Z.error}}}else if(Z.matches)R=Z.matches;else{let{error:Ee,notFoundMatches:De,route:gt}=Ut(v.pathname);return{matches:De,loaderData:{},errors:{[gt.id]:Ee}}}}let fe=s||l,{dsMatches:pe,revalidatingFetchers:q}=Qr(f,L,n,o,e.history,y,R,te,v,$?[]:a,$===!0,X,Q,k,C,m,fe,i,e.patchRoutesOnNavigation!=null,F);if(de=++ue,!e.dataStrategy&&!pe.some(Z=>Z.shouldLoad)&&q.length===0){let Z=Nr();return We(v,{matches:R,loaderData:{},errors:F&&ye(F[1])?{[F[0]]:F[1].error}:null,...sn(F),...Z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:B}),{shortCircuited:!0}}if(le){let Z={};if(!M){Z.navigation=J;let Ee=Dr(F);Ee!==void 0&&(Z.actionData=Ee)}q.length>0&&(Z.fetchers=fa(q)),he(Z,{flushSync:B})}q.forEach(Z=>{_e(Z.key),Z.controller&&G.set(Z.key,Z.controller)});let Ke=()=>q.forEach(Z=>_e(Z.key));j&&j.signal.addEventListener("abort",Ke);let{loaderResults:$e,fetcherResults:Qe}=await Or(pe,q,f,L);if(f.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Ke),q.forEach(Z=>G.delete(Z.key));let we=wt($e);if(we)return await Fe(f,we.result,!0,{replace:I}),{shortCircuited:!0};if(we=wt(Qe),we)return m.add(we.key),await Fe(f,we.result,!0,{replace:I}),{shortCircuited:!0};let{loaderData:Ze,errors:et}=on(y,R,$e,F,q,Qe);$&&y.errors&&(et={...y.errors,...et});let zt=Nr(),je=Ir(de),vt=zt||je||q.length>0;return{matches:R,loaderData:Ze,errors:et,...vt?{fetchers:new Map(y.fetchers)}:{}}}function Dr(f){if(f&&!ye(f[1]))return{[f[0]]:f[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function fa(f){return f.forEach(v=>{let R=y.fetchers.get(v.key),L=at(void 0,R?R.data:void 0);y.fetchers.set(v.key,L)}),new Map(y.fetchers)}async function ha(f,v,R,L){_e(f);let M=(L&&L.flushSync)===!0,N=s||l,H=er(y.location,y.matches,i,R,v,L==null?void 0:L.relative),D=Ce(N,H,i),I=pt(D,N,H);if(I.active&&I.matches&&(D=I.matches),!D){Me(f,v,Re(404,{pathname:H}),{flushSync:M});return}let{path:$,submission:B,error:F}=Kr(!0,H,L);if(F){Me(f,v,F,{flushSync:M});return}let J=lt(D,$),te=new Xr(e.unstable_getContext?await e.unstable_getContext():void 0),le=(L&&L.preventScrollReset)===!0;if(B&&ve(B.formMethod)){await ma(f,v,$,J,D,te,I.active,M,le,B);return}C.set(f,{routeId:v,path:$}),await pa(f,v,$,J,D,te,I.active,M,le,B)}async function ma(f,v,R,L,M,N,H,D,I,$){jt(),C.delete(f);function B(ie){if(!ie.route.action&&!ie.route.lazy){let Ye=Re(405,{method:$.formMethod,pathname:R,routeId:v});return Me(f,v,Ye,{flushSync:D}),!0}return!1}if(!H&&B(L))return;let F=y.fetchers.get(f);Te(f,Lo($,F),{flushSync:D});let J=new AbortController,te=Ve(e.history,R,J.signal,$);if(H){let ie=await yt(M,R,te.signal,f);if(ie.type==="aborted")return;if(ie.type==="error"){Me(f,v,ie.error,{flushSync:D});return}else if(ie.matches){if(M=ie.matches,L=lt(M,R),B(L))return}else{Me(f,v,Re(404,{pathname:R}),{flushSync:D});return}}G.set(f,J);let le=ue,fe=Je(n,o,te,M,L,a,N),q=(await qe(te,fe,N,f))[L.route.id];if(te.signal.aborted){G.get(f)===J&&G.delete(f);return}if(k.has(f)){if(Ue(q)||ye(q)){Te(f,Oe(void 0));return}}else{if(Ue(q))if(G.delete(f),de>le){Te(f,Oe(void 0));return}else return m.add(f),Te(f,at($)),Fe(te,q,!1,{fetcherSubmission:$,preventScrollReset:I});if(ye(q)){Me(f,v,q.error);return}}let Ke=y.navigation.location||y.location,$e=Ve(e.history,Ke,J.signal),Qe=s||l,we=y.navigation.state!=="idle"?Ce(Qe,y.navigation.location,i):y.matches;W(we,"Didn't find any matches after fetcher action");let Ze=++ue;ce.set(f,Ze);let et=at($,q.data);y.fetchers.set(f,et);let{dsMatches:zt,revalidatingFetchers:je}=Qr($e,N,n,o,e.history,y,we,$,Ke,a,!1,X,Q,k,C,m,Qe,i,e.patchRoutesOnNavigation!=null,[L.route.id,q]);je.filter(ie=>ie.key!==f).forEach(ie=>{let Ye=ie.key,Ur=y.fetchers.get(Ye),ba=at(void 0,Ur?Ur.data:void 0);y.fetchers.set(Ye,ba),_e(Ye),ie.controller&&G.set(Ye,ie.controller)}),he({fetchers:new Map(y.fetchers)});let vt=()=>je.forEach(ie=>_e(ie.key));J.signal.addEventListener("abort",vt);let{loaderResults:Z,fetcherResults:Ee}=await Or(zt,je,$e,N);if(J.signal.aborted)return;if(J.signal.removeEventListener("abort",vt),ce.delete(f),G.delete(f),je.forEach(ie=>G.delete(ie.key)),y.fetchers.has(f)){let ie=Oe(q.data);y.fetchers.set(f,ie)}let De=wt(Z);if(De)return Fe($e,De.result,!1,{preventScrollReset:I});if(De=wt(Ee),De)return m.add(De.key),Fe($e,De.result,!1,{preventScrollReset:I});let{loaderData:gt,errors:Bt}=on(y,we,Z,void 0,je,Ee);Ir(Ze),y.navigation.state==="loading"&&Ze>de?(W(O,"Expected pending action"),j&&j.abort(),We(y.navigation.location,{matches:we,loaderData:gt,errors:Bt,fetchers:new Map(y.fetchers)})):(he({errors:Bt,loaderData:ln(y.loaderData,gt,we,Bt),fetchers:new Map(y.fetchers)}),X=!1)}async function pa(f,v,R,L,M,N,H,D,I,$){let B=y.fetchers.get(f);Te(f,at($,B?B.data:void 0),{flushSync:D});let F=new AbortController,J=Ve(e.history,R,F.signal);if(H){let q=await yt(M,R,J.signal,f);if(q.type==="aborted")return;if(q.type==="error"){Me(f,v,q.error,{flushSync:D});return}else if(q.matches)M=q.matches,L=lt(M,R);else{Me(f,v,Re(404,{pathname:R}),{flushSync:D});return}}G.set(f,F);let te=ue,le=Je(n,o,J,M,L,a,N),pe=(await qe(J,le,N,f))[L.route.id];if(G.get(f)===F&&G.delete(f),!J.signal.aborted){if(k.has(f)){Te(f,Oe(void 0));return}if(Ue(pe))if(de>te){Te(f,Oe(void 0));return}else{m.add(f),await Fe(J,pe,!1,{preventScrollReset:I});return}if(ye(pe)){Me(f,v,pe.error);return}Te(f,Oe(pe.data))}}async function Fe(f,v,R,{submission:L,fetcherSubmission:M,preventScrollReset:N,replace:H}={}){v.response.headers.has("X-Remix-Revalidate")&&(X=!0);let D=v.response.headers.get("Location");W(D,"Expected a Location header on the redirect Response"),D=nn(D,new URL(f.url),i);let I=st(y.location,D,{_isRedirect:!0});if(r){let le=!1;if(v.response.headers.has("X-Remix-Reload-Document"))le=!0;else if(fr.test(D)){const fe=En(D,!0);le=fe.origin!==t.location.origin||ge(fe.pathname,i)==null}if(le){H?t.location.replace(D):t.location.assign(D);return}}j=null;let $=H===!0||v.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:B,formAction:F,formEncType:J}=y.navigation;!L&&!M&&B&&F&&J&&(L=cn(y.navigation));let te=L||M;if(uo.has(v.response.status)&&te&&ve(te.formMethod))await Ie($,I,{submission:{...te,formAction:D},preventScrollReset:N||U,enableViewTransition:R?K:void 0});else{let le=Xt(I,L);await Ie($,I,{overrideNavigation:le,fetcherSubmission:M,preventScrollReset:N||U,enableViewTransition:R?K:void 0})}}async function qe(f,v,R,L){let M,N={};try{M=await vo(u,f,v,L,R,!1)}catch(H){return v.filter(D=>D.shouldLoad).forEach(D=>{N[D.route.id]={type:"error",error:H}}),N}if(f.signal.aborted)return N;for(let[H,D]of Object.entries(M))if(So(D)){let I=D.result;N[H]={type:"redirect",response:Eo(I,f,H,v,i)}}else N[H]=await wo(D);return N}async function Or(f,v,R,L){let M=qe(R,f,L,null),N=Promise.all(v.map(async I=>{if(I.matches&&I.match&&I.request&&I.controller){let B=(await qe(I.request,I.matches,L,I.key))[I.match.route.id];return{[I.key]:B}}else return Promise.resolve({[I.key]:{type:"error",error:Re(404,{pathname:I.path})}})})),H=await M,D=(await N).reduce((I,$)=>Object.assign(I,$),{});return{loaderResults:H,fetcherResults:D}}function jt(){X=!0,C.forEach((f,v)=>{G.has(v)&&Q.add(v),_e(v)})}function Te(f,v,R={}){y.fetchers.set(f,v),he({fetchers:new Map(y.fetchers)},{flushSync:(R&&R.flushSync)===!0})}function Me(f,v,R,L={}){let M=He(y.matches,v);Ht(f),he({errors:{[M.route.id]:R},fetchers:new Map(y.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function kr(f){return A.set(f,(A.get(f)||0)+1),k.has(f)&&k.delete(f),y.fetchers.get(f)||Pn}function Ht(f){let v=y.fetchers.get(f);G.has(f)&&!(v&&v.state==="loading"&&ce.has(f))&&_e(f),C.delete(f),ce.delete(f),m.delete(f),k.delete(f),Q.delete(f),y.fetchers.delete(f)}function ya(f){let v=(A.get(f)||0)-1;v<=0?(A.delete(f),k.add(f)):A.set(f,v),he({fetchers:new Map(y.fetchers)})}function _e(f){let v=G.get(f);v&&(v.abort(),G.delete(f))}function Ar(f){for(let v of f){let R=kr(v),L=Oe(R.data);y.fetchers.set(v,L)}}function Nr(){let f=[],v=!1;for(let R of m){let L=y.fetchers.get(R);W(L,`Expected fetcher: ${R}`),L.state==="loading"&&(m.delete(R),f.push(R),v=!0)}return Ar(f),v}function Ir(f){let v=[];for(let[R,L]of ce)if(L<f){let M=y.fetchers.get(R);W(M,`Expected fetcher: ${R}`),M.state==="loading"&&(_e(R),ce.delete(R),v.push(R))}return Ar(v),v.length>0}function va(f,v){let R=y.blockers.get(f)||nt;return V.get(f)!==v&&V.set(f,v),R}function Fr(f){y.blockers.delete(f),V.delete(f)}function mt(f,v){let R=y.blockers.get(f)||nt;W(R.state==="unblocked"&&v.state==="blocked"||R.state==="blocked"&&v.state==="blocked"||R.state==="blocked"&&v.state==="proceeding"||R.state==="blocked"&&v.state==="unblocked"||R.state==="proceeding"&&v.state==="unblocked",`Invalid blocker state transition: ${R.state} -> ${v.state}`);let L=new Map(y.blockers);L.set(f,v),he({blockers:L})}function $r({currentLocation:f,nextLocation:v,historyAction:R}){if(V.size===0)return;V.size>1&&ae(!1,"A router only supports one blocker at a time");let L=Array.from(V.entries()),[M,N]=L[L.length-1],H=y.blockers.get(M);if(!(H&&H.state==="proceeding")&&N({currentLocation:f,nextLocation:v,historyAction:R}))return M}function Ut(f){let v=Re(404,{pathname:f}),R=s||l,{matches:L,route:M}=un(R);return{notFoundMatches:L,route:M,error:v}}function ga(f,v,R){if(g=f,b=v,w=R||null,!S&&y.navigation===Gt){S=!0;let L=Hr(y.location,y.matches);L!=null&&he({restoreScrollPosition:L})}return()=>{g=null,b=null,w=null}}function jr(f,v){return w&&w(f,v.map(L=>Rn(L,y.loaderData)))||f.key}function wa(f,v){if(g&&b){let R=jr(f,v);g[R]=b()}}function Hr(f,v){if(g){let R=jr(f,v),L=g[R];if(typeof L=="number")return L}return null}function pt(f,v,R){if(e.patchRoutesOnNavigation)if(f){if(Object.keys(f[0].params).length>0)return{active:!0,matches:xt(v,R,i,!0)}}else return{active:!0,matches:xt(v,R,i,!0)||[]};return{active:!1,matches:null}}async function yt(f,v,R,L){if(!e.patchRoutesOnNavigation)return{type:"success",matches:f};let M=f;for(;;){let N=s==null,H=s||l,D=o;try{await e.patchRoutesOnNavigation({signal:R,path:v,matches:M,fetcherKey:L,patch:(B,F)=>{R.aborted||Zr(B,F,H,D,n)}})}catch(B){return{type:"error",error:B,partialMatches:M}}finally{N&&!R.aborted&&(l=[...l])}if(R.aborted)return{type:"aborted"};let I=Ce(H,v,i);if(I)return{type:"success",matches:I};let $=xt(H,v,i,!0);if(!$||M.length===$.length&&M.every((B,F)=>B.route.id===$[F].route.id))return{type:"success",matches:null};M=$}}function Ea(f){o={},s=Tt(f,n,void 0,o)}function Ra(f,v){let R=s==null;Zr(f,v,s||l,o,n),R&&(l=[...l],he({}))}return x={get basename(){return i},get future(){return c},get state(){return y},get routes(){return l},get window(){return t},initialize:xe,subscribe:$t,enableScrollRestoration:ga,navigate:_r,fetch:ha,revalidate:ua,createHref:f=>e.history.createHref(f),encodeLocation:f=>e.history.encodeLocation(f),getFetcher:kr,deleteFetcher:ya,dispose:ne,getBlocker:va,deleteBlocker:Fr,patchRoutes:Ra,_internalFetchControllers:G,_internalSetRoutes:Ea},x}function fo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function er(e,t,r,a,n,o){let l,s;if(n){l=[];for(let u of t)if(l.push(u),u.route.id===n){s=u;break}}else l=t,s=t[t.length-1];let i=dr(a||".",cr(l),ge(e.pathname,r)||e.pathname,o==="path");if(a==null&&(i.search=e.search,i.hash=e.hash),(a==null||a===""||a===".")&&s){let u=mr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let c=new URLSearchParams(i.search),p=c.getAll("index");c.delete("index"),p.filter(g=>g).forEach(g=>c.append("index",g));let h=c.toString();i.search=h?`?${h}`:""}}return r!=="/"&&(i.pathname=i.pathname==="/"?r:Le([r,i.pathname])),ke(i)}function Kr(e,t,r){if(!r||!fo(r))return{path:t};if(r.formMethod&&!xo(r.formMethod))return{path:t,error:Re(405,{method:r.formMethod})};let a=()=>({path:t,error:Re(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Nn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return a();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,[g,w])=>`${h}${g}=${w}
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!ve(o))return a();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return a()}}}W(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=nr(r.formData),i=r.formData;else if(r.body instanceof FormData)s=nr(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=an(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=an(s)}catch{return a()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let c=Ne(t);return e&&c.search&&mr(c.search)&&s.append("index",""),c.search=`?${s}`,{path:ke(c),submission:u}}function Qr(e,t,r,a,n,o,l,s,i,u,c,p,h,g,w,b,S,E,_,P){var oe;let T=P?ye(P[1])?P[1].error:P[1].data:void 0,x=n.createURL(o.location),y=n.createURL(i),O;if(c&&o.errors){let X=Object.keys(o.errors)[0];O=l.findIndex(Q=>Q.route.id===X)}else if(P&&ye(P[1])){let X=P[0];O=l.findIndex(Q=>Q.route.id===X)-1}let U=P?P[1].statusCode:void 0,j=U&&U>=400,K={currentUrl:x,currentParams:((oe=o.matches[0])==null?void 0:oe.params)||{},nextUrl:y,nextParams:l[0].params,...s,actionResult:T,actionStatus:U},re=l.map((X,Q)=>{let{route:G}=X,ue=null;if(O!=null&&Q>O?ue=!1:G.lazy?ue=!0:G.loader==null?ue=!1:c?ue=tr(G,o.loaderData,o.errors):ho(o.loaderData,o.matches[Q],X)&&(ue=!0),ue!==null)return rr(r,a,e,X,u,t,ue);let de=j?!1:p||x.pathname+x.search===y.pathname+y.search||x.search!==y.search||mo(o.matches[Q],X),ce={...K,defaultShouldRevalidate:de},m=Dt(X,ce);return rr(r,a,e,X,u,t,m,ce)}),se=[];return w.forEach((X,Q)=>{if(c||!l.some(k=>k.route.id===X.routeId)||g.has(Q))return;let G=o.fetchers.get(Q),ue=G&&G.state!=="idle"&&G.data===void 0,de=Ce(S,X.path,E);if(!de){if(_&&ue)return;se.push({key:Q,routeId:X.routeId,path:X.path,matches:null,match:null,request:null,controller:null});return}if(b.has(Q))return;let ce=lt(de,X.path),m=new AbortController,C=Ve(n,X.path,m.signal),A=null;if(h.has(Q))h.delete(Q),A=Je(r,a,C,de,ce,u,t);else if(ue)p&&(A=Je(r,a,C,de,ce,u,t));else{let k={...K,defaultShouldRevalidate:j?!1:p};Dt(ce,k)&&(A=Je(r,a,C,de,ce,u,t,k))}A&&se.push({key:Q,routeId:X.routeId,path:X.path,matches:A,match:ce,request:C,controller:m})}),{dsMatches:re,revalidatingFetchers:se}}function tr(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function ho(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function mo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Zr(e,t,r,a,n){let o;if(e){let i=a[e];W(i,`No route found to patch children into: routeId = ${e}`),i.children||(i.children=[]),o=i.children}else o=r;let l=t.filter(i=>!o.some(u=>_n(i,u))),s=Tt(l,n,[e||"_","patch",String((o==null?void 0:o.length)||"0")],a);o.push(...s)}function _n(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,a)=>{var n;return(n=t.children)==null?void 0:n.some(o=>_n(r,o))}):!1}var en=new WeakMap,Dn=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(W(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let l=en.get(n);l||(l={},en.set(n,l));let s=l[e];if(s)return s;let i=(async()=>{let u=Ia(e),p=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)ae(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(p)ae(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let h=await o();h!=null&&(Object.assign(n,{[e]:h}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(h=>h===void 0)&&(n.lazy=void 0))})();return l[e]=i,i},tn=new WeakMap;function po(e,t,r,a,n){let o=r[e.id];if(W(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let c=tn.get(o);if(c)return{lazyRoutePromise:c,lazyHandlerPromise:c};let p=(async()=>{W(typeof e.lazy=="function","No lazy route function found");let h=await e.lazy(),g={};for(let w in h){let b=h[w];if(b===void 0)continue;let S=$a(w),_=o[w]!==void 0&&w!=="hasErrorBoundary";S?ae(!S,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?ae(!_,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):g[w]=b}Object.assign(o,g),Object.assign(o,{...a(o),lazy:void 0})})();return tn.set(o,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let l=Object.keys(e.lazy),s=[],i;for(let c of l){if(n&&n.includes(c))continue;let p=Dn({key:c,route:e,manifest:r,mapRouteProperties:a});p&&(s.push(p),c===t&&(i=p))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u==null||u.catch(()=>{}),i==null||i.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}async function rn(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 yo(e){return e.matches.some(t=>t.route.unstable_middleware)?On(e,!1,()=>rn(e),(t,r)=>({[r]:{type:"error",result:t}})):rn(e)}async function On(e,t,r,a){let{matches:n,request:o,params:l,context:s}=e,i={handlerResult:void 0};try{let u=n.flatMap(p=>p.route.unstable_middleware?p.route.unstable_middleware.map(h=>[p.route.id,h]):[]),c=await kn({request:o,params:l,context:s},u,t,i,r);return t?c:i.handlerResult}catch(u){if(!i.middlewareError)throw u;let c=await a(i.middlewareError.error,i.middlewareError.routeId);return i.handlerResult?Object.assign(i.handlerResult,c):c}}async function kn(e,t,r,a,n,o=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let s=t[o];if(!s)return a.handlerResult=await n(),a.handlerResult;let[i,u]=s,c=!1,p,h=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");c=!0,await kn(e,t,r,a,n,o+1)};try{let g=await u({request:e.request,params:e.params,context:e.context},h);return c?g===void 0?p:g:h()}catch(g){throw a.middlewareError?a.middlewareError.error!==g&&(a.middlewareError={routeId:i,error:g}):a.middlewareError={routeId:i,error:g},g}}function An(e,t,r,a,n){let o=Dn({key:"unstable_middleware",route:a.route,manifest:t,mapRouteProperties:e}),l=po(a.route,ve(r.method)?"action":"loader",t,e,n);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function rr(e,t,r,a,n,o,l,s=null){let i=!1,u=An(e,t,r,a,n);return{...a,_lazyPromises:u,shouldLoad:l,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(c){return i=!0,s?typeof c=="boolean"?Dt(a,{...s,defaultShouldRevalidate:c}):Dt(a,s):l},resolve(c){return i||l||c&&r.method==="GET"&&(a.route.lazy||a.route.loader)?go({request:r,match:a,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:c,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Je(e,t,r,a,n,o,l,s=null){return a.map(i=>i.route.id!==n.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:An(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rr(e,t,r,i,o,l,!0,s))}async function vo(e,t,r,a,n,o){r.some(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware})&&await Promise.all(r.map(u=>{var c;return(c=u._lazyPromises)==null?void 0:c.middleware}));let l={request:t,params:r[0].params,context:n,matches:r},i=await e({...l,fetcherKey:a,unstable_runClientMiddleware:u=>{let c=l;return On(c,!1,()=>u({...c,fetcherKey:a,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(p,h)=>({[h]:{type:"error",result:p}}))}});try{await Promise.all(r.flatMap(u=>{var c,p;return[(c=u._lazyPromises)==null?void 0:c.handler,(p=u._lazyPromises)==null?void 0:p.route]}))}catch{}return i}async function go({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:n,scopedContext:o}){let l,s,i=ve(e.method),u=i?"action":"loader",c=p=>{let h,g=new Promise((S,E)=>h=E);s=()=>h(),e.signal.addEventListener("abort",s);let w=S=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):p({request:e,params:t.params,context:o},...S!==void 0?[S]:[]),b=(async()=>{try{return{type:"data",result:await(n?n(E=>w(E)):w())}}catch(S){return{type:"error",result:S}}})();return Promise.race([b,g])};try{let p=i?t.route.action:t.route.loader;if(r||a)if(p){let h,[g]=await Promise.all([c(p).catch(w=>{h=w}),r,a]);if(h!==void 0)throw h;l=g}else{await r;let h=i?t.route.action:t.route.loader;if(h)[l]=await Promise.all([c(h),a]);else if(u==="action"){let g=new URL(e.url),w=g.pathname+g.search;throw Re(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(p)l=await c(p);else{let h=new URL(e.url),g=h.pathname+h.search;throw Re(404,{pathname:g})}}catch(p){return{type:"error",result:p}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function wo(e){var a,n,o,l,s,i;let{result:t,type:r}=e;if(hr(t)){let u;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new Ae(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?ar(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:new Ae(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ze(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ze(t)?t.status:void 0}:ar(t)?{type:"data",data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Eo(e,t,r,a,n){let o=e.headers.get("Location");if(W(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!fr.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=er(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function nn(e,t,r){if(fr.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ge(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Ve(e,t,r,a){let n=e.createURL(Nn(t)).toString(),o={signal:r};if(a&&ve(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=nr(a.formData):o.body=a.formData}return new Request(n,o)}function nr(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function an(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Ro(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},c=r&&ye(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let h=p.route.id,g=t[h];if(W(!Ue(g),"Cannot handle redirect results in processLoaderData"),ye(g)){let w=g.error;if(c!==void 0&&(w=c,c=void 0),l=l||{},n)l[h]=w;else{let b=He(e,h);l[b.route.id]==null&&(l[b.route.id]=w)}a||(o[h]=Tn),i||(i=!0,s=ze(g.error)?g.error.status:500),g.headers&&(u[h]=g.headers)}else o[h]=g.data,g.statusCode&&g.statusCode!==200&&!i&&(s=g.statusCode),g.headers&&(u[h]=g.headers)}),c!==void 0&&r&&(l={[r[0]]:c},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function on(e,t,r,a,n,o){let{loaderData:l,errors:s}=Ro(t,r,a);return n.filter(i=>!i.matches||i.matches.some(u=>u.shouldLoad)).forEach(i=>{let{key:u,match:c,controller:p}=i,h=o[u];if(W(h,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(ye(h)){let g=He(e.matches,c==null?void 0:c.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:h.error}),e.fetchers.delete(u)}else if(Ue(h))W(!1,"Unhandled fetcher revalidation redirect");else{let g=Oe(h.data);e.fetchers.set(u,g)}}),{loaderData:l,errors:s}}function ln(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Tn).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function sn(e){return e?ye(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function He(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 un(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,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`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"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`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&&(s=`Invalid request method "${a.toUpperCase()}"`)),new Ae(e||500,l,new Error(s),!0)}function wt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ue(n))return{key:a,result:n}}}function Nn(e){let t=typeof e=="string"?Ne(e):e;return ke({...t,hash:""})}function bo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function So(e){return hr(e.result)&&so.has(e.result.status)}function ye(e){return e.type==="error"}function Ue(e){return(e&&e.type)==="redirect"}function ar(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function hr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function xo(e){return lo.has(e.toUpperCase())}function ve(e){return oo.has(e.toUpperCase())}function mr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function lt(e,t){let r=typeof t=="string"?Ne(t).search:t.search;if(e[e.length-1].route.index&&mr(r||""))return e[e.length-1];let a=Cn(e);return a[a.length-1]}function cn(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=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(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Xt(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 Co(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 at(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 Lo(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 Oe(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 Po(e,t){try{let r=e.sessionStorage.getItem(Mn);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 Mo(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Mn,JSON.stringify(r))}catch(a){ae(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function To(){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=d.createContext(null);Be.displayName="DataRouter";var Ge=d.createContext(null);Ge.displayName="DataRouterState";var pr=d.createContext({isTransitioning:!1});pr.displayName="ViewTransition";var yr=d.createContext(new Map);yr.displayName="Fetchers";var _o=d.createContext(null);_o.displayName="Await";var be=d.createContext(null);be.displayName="Navigation";var kt=d.createContext(null);kt.displayName="Location";var Se=d.createContext({outlet:null,matches:[],isDataRoute:!1});Se.displayName="Route";var vr=d.createContext(null);vr.displayName="RouteError";function Do(e,{relative:t}={}){W(ct(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=d.useContext(be),{hash:n,pathname:o,search:l}=dt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Le([r,o])),a.createHref({pathname:s,search:l,hash:n})}function ct(){return d.useContext(kt)!=null}function Pe(){return W(ct(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(kt).location}var In="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fn(e){d.useContext(be).static||d.useLayoutEffect(e)}function Oo(){let{isDataRoute:e}=d.useContext(Se);return e?Vo():ko()}function ko(){W(ct(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Be),{basename:t,navigator:r}=d.useContext(be),{matches:a}=d.useContext(Se),{pathname:n}=Pe(),o=JSON.stringify(cr(a)),l=d.useRef(!1);return Fn(()=>{l.current=!0}),d.useCallback((i,u={})=>{if(ae(l.current,In),!l.current)return;if(typeof i=="number"){r.go(i);return}let c=dr(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Le([t,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Ao=d.createContext(null);function No(e){let t=d.useContext(Se).outlet;return t&&d.createElement(Ao.Provider,{value:e},t)}function gr(){let{matches:e}=d.useContext(Se),t=e[e.length-1];return t?t.params:{}}function dt(e,{relative:t}={}){let{matches:r}=d.useContext(Se),{pathname:a}=Pe(),n=JSON.stringify(cr(r));return d.useMemo(()=>dr(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Io(e,t,r,a){W(ct(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=d.useContext(be),{matches:o}=d.useContext(Se),l=o[o.length-1],s=l?l.params:{},i=l?l.pathname:"/",u=l?l.pathnameBase:"/",c=l&&l.route;{let E=c&&c.path||"";$n(i,!c||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${i}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let p=Pe(),h;h=p;let g=h.pathname||"/",w=g;if(u!=="/"){let E=u.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=Ce(e,{pathname:w});return ae(c||b!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),ae(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.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.`),Uo(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},s,E.params),pathname:Le([u,n.encodeLocation?n.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?u:Le([u,n.encodeLocation?n.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),o,r,a)}function Fo(){let e=Sr(),t=ze(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},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:n},r):null,l)}var $o=d.createElement(Fo,null),jo=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?d.createElement(Se.Provider,{value:this.props.routeContext},d.createElement(vr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ho({routeContext:e,match:t,children:r}){let a=d.useContext(Be);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Se.Provider,{value:e},r)}function Uo(e,t=[],r=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,o=r==null?void 0:r.errors;if(o!=null){let i=n.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);W(i>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,i+1))}let l=!1,s=-1;if(r)for(let i=0;i<n.length;i++){let u=n[i];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(s=i),u.route.id){let{loaderData:c,errors:p}=r,h=u.route.loader&&!c.hasOwnProperty(u.route.id)&&(!p||p[u.route.id]===void 0);if(u.route.lazy||h){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((i,u,c)=>{let p,h=!1,g=null,w=null;r&&(p=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||$o,l&&(s<0&&c===0?($n("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,w=null):s===c&&(h=!0,w=u.route.hydrateFallbackElement||null)));let b=t.concat(n.slice(0,c+1)),S=()=>{let E;return p?E=g:h?E=w:u.route.Component?E=d.createElement(u.route.Component,null):u.route.element?E=u.route.element:E=i,d.createElement(Ho,{match:u,routeContext:{outlet:i,matches:b,isDataRoute:r!=null},children:E})};return r&&(u.route.ErrorBoundary||u.route.errorElement||c===0)?d.createElement(jo,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:S(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):S()},null)}function wr(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function zo(e){let t=d.useContext(Be);return W(t,wr(e)),t}function ft(e){let t=d.useContext(Ge);return W(t,wr(e)),t}function Bo(e){let t=d.useContext(Se);return W(t,wr(e)),t}function ht(e){let t=Bo(e),r=t.matches[t.matches.length-1];return W(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Wo(){return ht("useRouteId")}function Yo(){return ft("useNavigation").navigation}function Er(){let{matches:e,loaderData:t}=ft("useMatches");return d.useMemo(()=>e.map(r=>Rn(r,t)),[e,t])}function Rr(){let e=ft("useLoaderData"),t=ht("useLoaderData");return e.loaderData[t]}function br(){let e=ft("useActionData"),t=ht("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Sr(){var a;let e=d.useContext(vr),t=ft("useRouteError"),r=ht("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Vo(){let{router:e}=zo("useNavigate"),t=ht("useNavigate"),r=d.useRef(!1);return Fn(()=>{r.current=!0}),d.useCallback(async(n,o={})=>{ae(r.current,In),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var dn={};function $n(e,t,r){!t&&!dn[e]&&(dn[e]=!0,ae(!1,r))}var fn={};function hn(e,t){!e&&!fn[t]&&(fn[t]=!0,console.warn(t))}function wl(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ae(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ae(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ae(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var El=["HydrateFallback","hydrateFallbackElement"],Jo=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 Rl({router:e,flushSync:t}){let[r,a]=d.useState(e.state),[n,o]=d.useState(),[l,s]=d.useState({isTransitioning:!1}),[i,u]=d.useState(),[c,p]=d.useState(),[h,g]=d.useState(),w=d.useRef(new Map),b=d.useCallback((P,{deletedFetchers:T,flushSync:x,viewTransitionOpts:y})=>{P.fetchers.forEach((U,j)=>{U.data!==void 0&&w.current.set(j,U.data)}),T.forEach(U=>w.current.delete(U)),hn(x===!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 O=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(hn(y==null||O,"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."),!y||!O){t&&x?t(()=>a(P)):d.startTransition(()=>a(P));return}if(t&&x){t(()=>{c&&(i&&i.resolve(),c.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:y.currentLocation,nextLocation:y.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>a(P))});U.finished.finally(()=>{t(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>p(U));return}c?(i&&i.resolve(),c.skipTransition(),g({state:P,currentLocation:y.currentLocation,nextLocation:y.nextLocation})):(o(P),s({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}))},[e.window,t,c,i]);d.useLayoutEffect(()=>e.subscribe(b),[e,b]),d.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new Jo)},[l]),d.useEffect(()=>{if(i&&n&&e.window){let P=n,T=i.promise,x=e.window.document.startViewTransition(async()=>{d.startTransition(()=>a(P)),await T});x.finished.finally(()=>{u(void 0),p(void 0),o(void 0),s({isTransitioning:!1})}),p(x)}},[n,i,e.window]),d.useEffect(()=>{i&&n&&r.location.key===n.location.key&&i.resolve()},[i,c,r.location,n]),d.useEffect(()=>{!l.isTransitioning&&h&&(o(h.state),s({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),g(void 0))},[l.isTransitioning,h]);let S=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,T,x)=>e.navigate(P,{state:T,preventScrollReset:x==null?void 0:x.preventScrollReset}),replace:(P,T,x)=>e.navigate(P,{replace:!0,state:T,preventScrollReset:x==null?void 0:x.preventScrollReset})}),[e]),E=e.basename||"/",_=d.useMemo(()=>({router:e,navigator:S,static:!1,basename:E}),[e,S,E]);return d.createElement(d.Fragment,null,d.createElement(Be.Provider,{value:_},d.createElement(Ge.Provider,{value:r},d.createElement(yr.Provider,{value:w.current},d.createElement(pr.Provider,{value:l},d.createElement(qo,{basename:E,location:r.location,navigationType:r.historyAction,navigator:S},d.createElement(Go,{routes:e.routes,future:e.future,state:r})))))),null)}var Go=d.memo(Xo);function Xo({routes:e,future:t,state:r}){return Io(e,void 0,r,t)}function bl(e){return No(e.context)}function qo({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){W(!ct(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=Ne(r));let{pathname:i="/",search:u="",hash:c="",state:p=null,key:h="default"}=r,g=d.useMemo(()=>{let w=ge(i,l);return w==null?null:{location:{pathname:w,search:u,hash:c,state:p,key:h},navigationType:a}},[l,i,u,c,p,h,a]);return ae(g!=null,`<Router basename="${l}"> is not able to match the URL "${i}${u}${c}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(be.Provider,{value:s},d.createElement(kt.Provider,{children:t,value:g}))}function Sl(e){return function(){const r={params:gr(),loaderData:Rr(),actionData:br(),matches:Er()};return d.createElement(e,r)}}function xl(e){return function(){const r={params:gr(),loaderData:Rr(),actionData:br()};return d.createElement(e,r)}}function Cl(e){return function(){const r={params:gr(),loaderData:Rr(),actionData:br(),error:Sr()};return d.createElement(e,r)}}var Ct="get",Lt="application/x-www-form-urlencoded";function At(e){return e!=null&&typeof e.tagName=="string"}function Ko(e){return At(e)&&e.tagName.toLowerCase()==="button"}function Qo(e){return At(e)&&e.tagName.toLowerCase()==="form"}function Zo(e){return At(e)&&e.tagName.toLowerCase()==="input"}function ei(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ti(e,t){return e.button===0&&(!t||t==="_self")&&!ei(e)}var Et=null;function ri(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var ni=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qt(e){return e!=null&&!ni.has(e)?(ae(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lt}"`),null):e}function ai(e,t){let r,a,n,o,l;if(Qo(e)){let s=e.getAttribute("action");a=s?ge(s,t):null,r=e.getAttribute("method")||Ct,n=qt(e.getAttribute("enctype"))||Lt,o=new FormData(e)}else if(Ko(e)||Zo(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||s.getAttribute("action");if(a=i?ge(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Ct,n=qt(e.getAttribute("formenctype"))||qt(s.getAttribute("enctype"))||Lt,o=new FormData(s,e),!ri()){let{name:u,type:c,value:p}=e;if(c==="image"){let h=u?`${u}.`:"";o.append(`${h}x`,"0"),o.append(`${h}y`,"0")}else u&&o.append(u,p)}}else{if(At(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ct,a=null,n=Lt,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function jn(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 oi(e,t,r){let a=e.map(o=>{var i;let l=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(u=>({rel:"stylesheet",href:u})):[],((i=l==null?void 0:l.links)==null?void 0:i.call(l))||[]]}).flat(2),n=Cr(e,r);return Bn(a,n)}function Hn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function ii(e){if(!e.css)return;let t=Hn(e);await Promise.all(t.map(zn))}async function Un(e,t){if(!e.css&&!t.links||!di())return;let r=[];if(e.css&&r.push(...Hn(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!xr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(zn))}async function zn(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function a(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{a(),t()},r.onerror=()=>{a(),t()},document.head.appendChild(r)})}function xr(e){return e!=null&&typeof e.page=="string"}function li(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 si(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await jn(o,r);return l.links?l.links():[]}return[]}));return Bn(a.flat(1).filter(li).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function mn(e,t,r,a,n,o){let l=(i,u)=>r[u]?i.route.id!==r[u].route.id:!0,s=(i,u)=>{var c;return r[u].pathname!==i.pathname||((c=r[u].route.path)==null?void 0:c.endsWith("*"))&&r[u].params["*"]!==i.params["*"]};return o==="assets"?t.filter((i,u)=>l(i,u)||s(i,u)):o==="data"?t.filter((i,u)=>{var p;let c=a.routes[i.route.id];if(!c||!c.hasLoader)return!1;if(l(i,u)||s(i,u))return!0;if(i.route.shouldRevalidate){let h=i.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function Cr(e,t,{includeHydrateFallback:r}={}){return ui(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 ui(e){return[...new Set(e)]}function ci(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Bn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!xr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(ci(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var Rt;function di(){if(Rt!==void 0)return Rt;let e=document.createElement("link");return Rt=e.relList.supports("preload"),e=null,Rt}function pn(e){return{__html:e}}var fi=-1,hi=-2,mi=-3,pi=-4,yi=-5,vi=-6,gi=-7,wi="B",Ei="D",Wn="E",Ri="M",bi="N",Yn="P",Si="R",xi="S",Ci="Y",Li="U",Pi="Z",Vn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Mi(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(`
`);t=o.pop()||"";for(const l of o)a.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Kt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function or(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return yn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,yn.call(this,a)}function yn(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case gi:u(void 0);continue;case yi:u(null);continue;case hi:u(NaN);continue;case vi:u(1/0);continue;case mi:u(-1/0);continue;case pi:u(-0);continue}if(t[i]){u(t[i]);continue}const c=r[i];if(!c||typeof c!="object"){t[i]=c,u(c);continue}if(Array.isArray(c))if(typeof c[0]=="string"){const[p,h,g]=c;switch(p){case Ei:u(t[i]=new Date(h));continue;case Li:u(t[i]=new URL(h));continue;case wi:u(t[i]=BigInt(h));continue;case Si:u(t[i]=new RegExp(h,g));continue;case Ci:u(t[i]=Symbol.for(h));continue;case xi:const w=new Set;t[i]=w;for(let T=c.length-1;T>0;T--)l.push([c[T],x=>{w.add(x)}]);u(w);continue;case Ri:const b=new Map;t[i]=b;for(let T=c.length-2;T>0;T-=2){const x=[];l.push([c[T+1],y=>{x[1]=y}]),l.push([c[T],y=>{x[0]=y}]),s.push(()=>{b.set(x[0],x[1])})}u(b);continue;case bi:const S=Object.create(null);t[i]=S;for(const T of Object.keys(h).reverse()){const x=[];l.push([h[T],y=>{x[1]=y}]),l.push([Number(T.slice(1)),y=>{x[0]=y}]),s.push(()=>{S[x[0]]=x[1]})}u(S);continue;case Yn:if(t[h])u(t[i]=t[h]);else{const T=new Vn;a[h]=T,u(t[i]=T.promise)}continue;case Wn:const[,E,_]=c;let P=_&&Kt&&Kt[_]?new Kt[_](E):new Error(E);t[i]=P,u(P);continue;case Pi:u(t[i]=t[h]);continue;default:if(Array.isArray(n)){const T=[],x=c.slice(1);for(let y=0;y<x.length;y++){const O=x[y];l.push([O,U=>{T[y]=U}])}s.push(()=>{for(const y of n){const O=y(c[0],...T);if(O){u(t[i]=O.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const p=[];t[i]=p;for(let h=0;h<c.length;h++){const g=c[h];g!==fi&&l.push([g,w=>{p[h]=w}])}u(p);continue}else{const p={};t[i]=p;for(const h of Object.keys(c).reverse()){const g=[];l.push([c[h],w=>{g[1]=w}]),l.push([Number(h.slice(1)),w=>{g[0]=w}]),s.push(()=>{p[g[0]]=g[1]})}u(p);continue}}for(;s.length>0;)s.pop()();return o}async function Ti(e,t){const{plugins:r}=t??{},a=new Vn,n=e.pipeThrough(Mi()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await _i.call(o,n);let s=a.promise;return l.done?a.resolve():s=Di.call(o,n).then(a.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);a.reject(i)}),{done:s.then(()=>n.closed),value:l.value}}async function _i(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:or.call(this,r)}}async function Di(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case Yn:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=or.call(this,s);o.resolve(i);break}case Wn:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=or.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}async function Oi(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var ir=Symbol("SingleFetchRedirect"),Jn=class extends Error{},ki=202,Gn=new Set([100,101,204,205]);function Ll(e,t,r,a,n){let o=Ai(e,l=>{let s=t.routes[l.route.id];me(s,"Route not found in manifest");let i=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasShouldRevalidate:!!(i!=null&&i.shouldRevalidate)}},Ui,a,n);return async l=>l.unstable_runClientMiddleware(o)}function Ai(e,t,r,a,n){return async o=>{let{request:l,matches:s,fetcherKey:i}=o,u=e();if(l.method!=="GET")return Ni(o,r,n);let c=s.some(p=>{let{hasLoader:h,hasClientLoader:g}=t(p);return p.unstable_shouldCallHandler()&&h&&!g});return!a&&!c?Ii(o,t,r,n):i?ji(o,r,n):Fi(o,u,t,r,a,n)}}async function Ni(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());me(a,"No action match found");let n,o=await a.resolve(async l=>await l(async()=>{let{data:i,status:u}=await t(e,r,[a.route.id]);return n=u,ut(i,a.route.id)}));return hr(o.result)||ze(o.result)||ar(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:no(o.result,n)}}}async function Ii(e,t,r,a){let n=e.matches.filter(l=>l.unstable_shouldCallHandler()),o={};return await Promise.all(n.map(l=>l.resolve(async s=>{try{let{hasClientLoader:i}=t(l),u=l.route.id,c=i?await s(async()=>{let{data:p}=await r(e,a,[u]);return ut(p,u)}):await s();o[l.route.id]={type:"data",result:c}}catch(i){o[l.route.id]={type:"error",result:i}}}))),o}async function Fi(e,t,r,a,n,o){let l=new Set,s=!1,i=e.matches.map(()=>vn()),u=vn(),c={},p=Promise.all(e.matches.map(async(g,w)=>g.resolve(async b=>{i[w].resolve();let S=g.route.id,{hasLoader:E,hasClientLoader:_,hasShouldRevalidate:P}=r(g),T=!g.unstable_shouldRevalidateArgs||g.unstable_shouldRevalidateArgs.actionStatus==null||g.unstable_shouldRevalidateArgs.actionStatus<400;if(!g.unstable_shouldCallHandler(T)){s||(s=g.unstable_shouldRevalidateArgs!=null&&E&&P===!0);return}if(_){E&&(s=!0);try{let y=await b(async()=>{let{data:O}=await a(e,o,[S]);return ut(O,S)});c[S]={type:"data",result:y}}catch(y){c[S]={type:"error",result:y}}return}E&&l.add(S);try{let y=await b(async()=>{let O=await u.promise;return ut(O,S)});c[S]={type:"data",result:y}}catch(y){c[S]={type:"error",result:y}}})));if(await Promise.all(i.map(g=>g.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||l.size===0)&&!window.__reactRouterHdrActive)u.resolve({routes:{}});else{let g=n&&s&&l.size>0?[...l.keys()]:void 0;try{let w=await a(e,o,g);u.resolve(w.data)}catch(w){u.reject(w)}}return await p,await $i(u.promise,e.matches,l,c),c}async function $i(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let l of t)if(l.route.id in o.routes){let s=o.routes[l.route.id];if("error"in s){n=s.error;break}}}n!==void 0&&Array.from(r.values()).forEach(l=>{a[l].result instanceof Jn&&(a[l].result=n)})}catch{}}async function ji(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());me(a,"No fetcher match found");let n=a.route.id,o=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,[n]);return ut(s,n)}));return{[a.route.id]:o}}function Hi(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let a of t)a&&r.push(a);for(let a of r)e.searchParams.append("index",a);return e}function Xn(e,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":t&&ge(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}async function Ui(e,t,r){let{request:a}=e,n=Xn(a.url,t);a.method==="GET"&&(n=Hi(n),r&&n.searchParams.set("_routes",r.join(",")));let o=await fetch(n,await Oi(a));if(o.status===404&&!o.headers.has("X-Remix-Response"))throw new Ae(404,"Not Found",!0);if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:ki,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Gn.has(o.status)){let l={};return r&&a.method!=="GET"&&(l[r[0]]={data:void 0}),{status:o.status,data:{routes:l}}}me(o.body,"No response body to decode");try{let l=await zi(o.body,window),s;if(a.method==="GET"){let i=l.value;ir in i?s={redirect:i[ir]}:s={routes:i}}else{let i=l.value,u=r==null?void 0:r[0];me(u,"No routeId found for single fetch call decoding"),"redirect"in i?s={redirect:i}:s={routes:{[u]:i}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function zi(e,t){return Ti(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,l]=a,s=Error;n&&n in t&&typeof t[n]=="function"&&(s=t[n]);let i=new s(o);return i.stack=l,{value:i}}if(r==="ErrorResponse"){let[n,o,l]=a;return{value:new Ae(o,l,n)}}if(r==="SingleFetchRedirect")return{value:{[ir]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function ut(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:l,status:s}=e.redirect;throw ao(a,{status:s,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...l?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Jn(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function vn(){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 Pl=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?d.createElement(qn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function qn({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
        console.log(
          "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
        );
      `}});if(ze(e))return d.createElement(lr,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return d.createElement(lr,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),r)}function lr({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){var o;let{routeModules:n}=Xe();return(o=n.root)!=null&&o.Layout&&!r?a:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},a,t?d.createElement(nl,null):null)))}function Bi(){return d.createElement(lr,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
              console.log(
                "💿 Hey developer 👋. You can provide a way better UX than this " +
                "when your app is loading JS modules and/or running \`clientLoader\` " +
                "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
                "for more information."
              );
            `}}))}function Kn(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function Wi(e,t,r){let a=Qn(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Bi:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(qn,{error:Sr()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:d.createElement(t.Layout,null,d.createElement(a,null))}:{Component:a},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function Ml(e,t,r,a,n,o){return Lr(t,r,a,n,o,"",Kn(t),e)}function bt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let a=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(a),new Ae(400,"Bad Request",new Error(a),!0)}}function Qt(e,t){let r=e==="clientAction"?"a":"an",a=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(a),new Ae(405,"Method Not Allowed",new Error(a),!0)}function Lr(e,t,r,a,n,o="",l=Kn(e),s){return(l[o]||[]).map(i=>{var _,P,T;let u=t[i.id];function c(x){return me(typeof x=="function","No single fetch function available for route handler"),x()}function p(x){return i.hasLoader?c(x):Promise.resolve(null)}function h(x){if(!i.hasAction)throw Qt("action",i.id);return c(x)}function g(x){import(x)}function w(x){x.clientActionModule&&g(x.clientActionModule),x.clientLoaderModule&&g(x.clientLoaderModule)}async function b(x){let y=t[i.id],O=y?Un(i,y):Promise.resolve();try{return x()}finally{await O}}let S={id:i.id,index:i.index,path:i.path};if(u){Object.assign(S,{...S,...Wi(i,u,n),unstable_middleware:u.unstable_clientMiddleware,handle:u.handle,shouldRevalidate:gn(S.path,u,i,a,s)});let x=r&&r.loaderData&&i.id in r.loaderData,y=x?(_=r==null?void 0:r.loaderData)==null?void 0:_[i.id]:void 0,O=r&&r.errors&&i.id in r.errors,U=O?(P=r==null?void 0:r.errors)==null?void 0:P[i.id]:void 0,j=s==null&&(((T=u.clientLoader)==null?void 0:T.hydrate)===!0||!i.hasLoader);S.loader=async({request:K,params:re,context:se},oe)=>{try{return await b(async()=>(me(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:K,params:re,context:se,async serverLoader(){if(bt("loader",i),j){if(x)return y;if(O)throw U}return p(oe)}}):p(oe)))}finally{j=!1}},S.loader.hydrate=Zn(i.id,u.clientLoader,i.hasLoader,n),S.action=({request:K,params:re,context:se},oe)=>b(async()=>{if(me(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Qt("clientAction",i.id);return h(oe)}return u.clientAction({request:K,params:re,context:se,async serverAction(){return bt("action",i),h(oe)}})})}else{i.hasClientLoader||(S.loader=(O,U)=>b(()=>p(U))),i.hasClientAction||(S.action=(O,U)=>b(()=>{if(n)throw Qt("clientAction",i.id);return h(U)}));let x;async function y(){return x?await x:(x=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(U=>setTimeout(U,0));let O=Vi(i,t);return w(i),await O})(),await x)}S.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:O}=i.clientLoaderModule?await import(i.clientLoaderModule):await y();return me(O,"No `clientLoader` export found"),(U,j)=>O({...U,async serverLoader(){return bt("loader",i),p(j)}})}:void 0,action:i.hasClientAction?async()=>{let O=i.clientActionModule?import(i.clientActionModule):y();w(i);let{clientAction:U}=await O;return me(U,"No `clientAction` export found"),(j,K)=>U({...j,async serverAction(){return bt("action",i),h(K)}})}:void 0,unstable_middleware:i.hasClientMiddleware?async()=>{let{unstable_clientMiddleware:O}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await y();return me(O,"No `unstable_clientMiddleware` export found"),O}:void 0,shouldRevalidate:async()=>{let O=await y();return gn(S.path,O,i,a,s)},handle:async()=>(await y()).handle,Component:async()=>(await y()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await y()).ErrorBoundary:void 0}}let E=Lr(e,t,r,a,n,i.id,l,s);return E.length>0&&(S.children=E),S})}function gn(e,t,r,a,n){if(n)return Yi(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?xn(e)[1].map(s=>s.paramName):[];const l=s=>o.some(i=>s.currentParams[i]!==s.nextParams[i]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return i=>s({...i,defaultShouldRevalidate:l(i)})}else return s=>l(s)}if(a&&t.shouldRevalidate){let o=t.shouldRevalidate;return l=>o({...l,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function Yi(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function Vi(e,t){let r=jn(e,t),a=ii(e),n=await r;return await Promise.all([a,Un(e,n)]),{Component:Qn(n),ErrorBoundary:n.ErrorBoundary,unstable_clientMiddleware:n.unstable_clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function Qn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function Zn(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Pt=new Set,Ji=1e3,Ot=new Set,Gi=7680;function Pr(e,t){return e.mode==="lazy"&&t===!0}function Xi({sri:e,...t},r){let a=new Set(r.state.matches.map(s=>s.route.id)),n=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(n.pop();n.length>0;)o.push(`/${n.join("/")}`),n.pop();o.forEach(s=>{let i=Ce(r.routes,s,r.basename);i&&i.forEach(u=>a.add(u.route.id))});let l=[...a].reduce((s,i)=>Object.assign(s,{[i]:t.routes[i]}),{});return{...t,routes:l,sri:e?!0:void 0}}function Tl(e,t,r,a,n,o){if(Pr(a,r))return async({path:l,patch:s,signal:i,fetcherKey:u})=>{Ot.has(l)||await ea([l],u?window.location.href:l,e,t,r,n,o,a.manifestPath,s,i)}}function _l(e,t,r,a,n,o){d.useEffect(()=>{var c,p;if(!Pr(n,a)||((p=(c=window.navigator)==null?void 0:c.connection)==null?void 0:p.saveData)===!0)return;function l(h){let g=h.tagName==="FORM"?h.getAttribute("action"):h.getAttribute("href");if(!g)return;let w=h.tagName==="A"?h.pathname:new URL(g,window.location.origin).pathname;Ot.has(w)||Pt.add(w)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(l);let h=Array.from(Pt.keys()).filter(g=>Ot.has(g)?(Pt.delete(g),!1):!0);if(h.length!==0)try{await ea(h,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(g){console.error("Failed to fetch manifest patches",g)}}let i=Qi(s,100);s();let u=new MutationObserver(()=>i());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[a,o,t,r,e,n])}function qi(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Zt="react-router-manifest-version";async function ea(e,t,r,a,n,o,l,s,i,u){let c=new URL(qi(s,l),window.location.origin);if(e.sort().forEach(b=>c.searchParams.append("p",b)),c.searchParams.set("version",r.version),c.toString().length>Gi){Pt.clear();return}let p;try{let b=await fetch(c,{signal:u});if(b.ok){if(b.status===204&&b.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}if(sessionStorage.getItem(Zt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Zt,r.version),window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(b.status>=400)throw new Error(await b.text())}else throw new Error(`${b.status} ${b.statusText}`);sessionStorage.removeItem(Zt),p=await b.json()}catch(b){if(u!=null&&u.aborted)return;throw b}let h=new Set(Object.keys(r.routes)),g=Object.values(p).reduce((b,S)=>(S&&!h.has(S.id)&&(b[S.id]=S),b),{});Object.assign(r.routes,g),e.forEach(b=>Ki(b,Ot));let w=new Set;Object.values(g).forEach(b=>{b&&(!b.parentId||!g[b.parentId])&&w.add(b.parentId)}),w.forEach(b=>i(b||null,Lr(g,a,null,n,o,b)))}function Ki(e,t){if(t.size>=Ji){let r=t.values().next().value;t.delete(r)}t.add(e)}function Qi(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Mr(){let e=d.useContext(Be);return me(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Nt(){let e=d.useContext(Ge);return me(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var It=d.createContext(void 0);It.displayName="FrameworkContext";function Xe(){let e=d.useContext(It);return me(e,"You must render this element inside a <HydratedRouter> element"),e}function Zi(e,t){let r=d.useContext(It),[a,n]=d.useState(!1),[o,l]=d.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:c,onTouchStart:p}=t,h=d.useRef(null);d.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let b=E=>{E.forEach(_=>{l(_.isIntersecting)})},S=new IntersectionObserver(b,{threshold:.5});return h.current&&S.observe(h.current),()=>{S.disconnect()}}},[e]),d.useEffect(()=>{if(a){let b=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(b)}}},[a]);let g=()=>{n(!0)},w=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,h,{}]:[o,h,{onFocus:ot(s,g),onBlur:ot(i,w),onMouseEnter:ot(u,g),onMouseLeave:ot(c,w),onTouchStart:ot(p,g)}]:[!1,h,{}]}function ot(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Tr(e,t,r){if(r&&!Mt)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}function Dl(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:a}=Xe(),{errors:n,matches:o}=Nt(),l=Tr(o,n,e),s=d.useMemo(()=>oi(l,r,t),[l,r,t]);return d.createElement(d.Fragment,null,typeof a=="string"?d.createElement("style",{dangerouslySetInnerHTML:{__html:a}}):null,typeof a=="object"?d.createElement("link",{rel:"stylesheet",href:a.href}):null,s.map(({key:i,link:u})=>xr(u)?d.createElement(ta,{key:i,...u}):d.createElement("link",{key:i,...u})))}function ta({page:e,...t}){let{router:r}=Mr(),a=d.useMemo(()=>Ce(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?d.createElement(tl,{page:e,matches:a,...t}):null}function el(e){let{manifest:t,routeModules:r}=Xe(),[a,n]=d.useState([]);return d.useEffect(()=>{let o=!1;return si(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function tl({page:e,matches:t,...r}){let a=Pe(),{manifest:n,routeModules:o}=Xe(),{basename:l}=Mr(),{loaderData:s,matches:i}=Nt(),u=d.useMemo(()=>mn(e,t,i,n,a,"data"),[e,t,i,n,a]),c=d.useMemo(()=>mn(e,t,i,n,a,"assets"),[e,t,i,n,a]),p=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,b=!1;if(t.forEach(E=>{var P;let _=n.routes[E.route.id];!_||!_.hasLoader||(!u.some(T=>T.route.id===E.route.id)&&E.route.id in s&&((P=o[E.route.id])!=null&&P.shouldRevalidate)||_.hasClientLoader?b=!0:w.add(E.route.id))}),w.size===0)return[];let S=Xn(e,l);return b&&w.size>0&&S.searchParams.set("_routes",t.filter(E=>w.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[l,s,a,n,u,t,e,o]),h=d.useMemo(()=>Cr(c,n),[c,n]),g=el(c);return d.createElement(d.Fragment,null,p.map(w=>d.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),h.map(w=>d.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),g.map(({key:w,link:b})=>d.createElement("link",{key:w,...b})))}function Ol(){let{isSpaMode:e,routeModules:t}=Xe(),{errors:r,matches:a,loaderData:n}=Nt(),o=Pe(),l=Tr(a,r,e),s=null;r&&(s=r[l[l.length-1].route.id]);let i=[],u=null,c=[];for(let p=0;p<l.length;p++){let h=l[p],g=h.route.id,w=n[g],b=h.params,S=t[g],E=[],_={id:g,data:w,meta:[],params:h.params,pathname:h.pathname,handle:h.route.handle,error:s};if(c[p]=_,S!=null&&S.meta?E=typeof S.meta=="function"?S.meta({data:w,params:b,location:o,matches:c,error:s}):Array.isArray(S.meta)?[...S.meta]:S.meta:u&&(E=[...u]),E=E||[],!Array.isArray(E))throw new Error("The route at "+h.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.

To reference the meta function API, see https://remix.run/route/meta`);_.meta=E,c[p]=_,i=[...E],u=i}return d.createElement(d.Fragment,null,i.flat().map(p=>{if(!p)return null;if("tagName"in p){let{tagName:h,...g}=p;if(!rl(h))return console.warn(`A meta object uses an invalid tagName: ${h}. Expected either 'link' or 'meta'`),null;let w=h;return d.createElement(w,{key:JSON.stringify(g),...g})}if("title"in p)return d.createElement("title",{key:"title"},String(p.title));if("charset"in p&&(p.charSet??(p.charSet=p.charset),delete p.charset),"charSet"in p&&p.charSet!=null)return typeof p.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:p.charSet}):null;if("script:ld+json"in p)try{let h=JSON.stringify(p["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${h}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:h}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(p),...p})}))}function rl(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Mt=!1;function nl(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:l}=Xe(),{router:s,static:i,staticContext:u}=Mr(),{matches:c}=Nt(),p=Pr(o,l);n&&(n.didRenderScripts=!0);let h=Tr(c,null,a);d.useEffect(()=>{Mt=!0},[]);let g=d.useMemo(()=>{var P;let E=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",_=i?`${(P=t.hmr)!=null&&P.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};
${h.map((T,x)=>{let y=`route${x}`,O=t.routes[T.route.id];me(O,`Route ${T.route.id} not found in manifest`);let{clientActionModule:U,clientLoaderModule:j,clientMiddlewareModule:K,hydrateFallbackModule:re,module:se}=O,oe=[...U?[{module:U,varName:`${y}_clientAction`}]:[],...j?[{module:j,varName:`${y}_clientLoader`}]:[],...K?[{module:K,varName:`${y}_clientMiddleware`}]:[],...re?[{module:re,varName:`${y}_HydrateFallback`}]:[],{module:se,varName:`${y}_main`}];if(oe.length===1)return`import * as ${y} from ${JSON.stringify(se)};`;let X=oe.map(G=>`import * as ${G.varName} from "${G.module}";`).join(`
`),Q=`const ${y} = {${oe.map(G=>`...${G.varName}`).join(",")}};`;return[X,Q].join(`
`)}).join(`
`)}
  ${p?`window.__reactRouterManifest = ${JSON.stringify(Xi(t,s),null,2)};`:""}
  window.__reactRouterRouteModules = {${h.map((T,x)=>`${JSON.stringify(T.route.id)}:route${x}`).join(",")}};

import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:pn(E),type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:pn(_),type:"module",async:!0}))},[]),w=Mt?[]:al(t.entry.imports.concat(Cr(h,t,{includeHydrateFallback:!0}))),b=typeof t.sri=="object"?t.sri:{};return Mt?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:b})}}):null,p?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:b[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:b[t.entry.module],suppressHydrationWarning:!0}),w.map(S=>d.createElement("link",{key:S,rel:"modulepreload",href:S,crossOrigin:e.crossOrigin,integrity:b[S],suppressHydrationWarning:!0})),g)}function al(e){return[...new Set(e)]}function ol(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var ra=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ra&&(window.__reactRouterVersion="7.6.2")}catch{}var na=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,aa=d.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:i,to:u,preventScrollReset:c,viewTransition:p,...h},g){let{basename:w}=d.useContext(be),b=typeof u=="string"&&na.test(u),S,E=!1;if(typeof u=="string"&&b&&(S=u,ra))try{let j=new URL(window.location.href),K=u.startsWith("//")?new URL(j.protocol+u):new URL(u),re=ge(K.pathname,w);K.origin===j.origin&&re!=null?u=re+K.search+K.hash:E=!0}catch{ae(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=Do(u,{relative:n}),[P,T,x]=Zi(a,h),y=sl(u,{replace:l,state:s,target:i,preventScrollReset:c,relative:n,viewTransition:p});function O(j){t&&t(j),j.defaultPrevented||y(j)}let U=d.createElement("a",{...h,...x,href:S||_,onClick:E||o?t:O,ref:ol(g,T),target:i,"data-discover":!b&&r==="render"?"true":void 0});return P&&!b?d.createElement(d.Fragment,null,U,d.createElement(ta,{page:_})):U});aa.displayName="Link";var il=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:i,...u},c){let p=dt(l,{relative:u.relative}),h=Pe(),g=d.useContext(Ge),{navigator:w,basename:b}=d.useContext(be),S=g!=null&&ml(p)&&s===!0,E=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,_=h.pathname,P=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(_=_.toLowerCase(),P=P?P.toLowerCase():null,E=E.toLowerCase()),P&&b&&(P=ge(P,b)||P);const T=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let x=_===E||!n&&_.startsWith(E)&&_.charAt(T)==="/",y=P!=null&&(P===E||!n&&P.startsWith(E)&&P.charAt(E.length)==="/"),O={isActive:x,isPending:y,isTransitioning:S},U=x?t:void 0,j;typeof a=="function"?j=a(O):j=[a,x?"active":null,y?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let K=typeof o=="function"?o(O):o;return d.createElement(aa,{...u,"aria-current":U,className:j,ref:c,style:K,to:l,viewTransition:s},typeof i=="function"?i(O):i)});il.displayName="NavLink";var oa=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=Ct,action:s,onSubmit:i,relative:u,preventScrollReset:c,viewTransition:p,...h},g)=>{let w=sa(),b=dl(s,{relative:u}),S=l.toLowerCase()==="get"?"get":"post",E=typeof s=="string"&&na.test(s),_=P=>{if(i&&i(P),P.defaultPrevented)return;P.preventDefault();let T=P.nativeEvent.submitter,x=(T==null?void 0:T.getAttribute("formmethod"))||l;w(T||P.currentTarget,{fetcherKey:t,method:x,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:p})};return d.createElement("form",{ref:g,method:S,action:b,onSubmit:a?i:_,...h,"data-discover":!E&&e==="render"?"true":void 0})});oa.displayName="Form";function ll({getKey:e,storageKey:t,...r}){let a=d.useContext(It),{basename:n}=d.useContext(be),o=Pe(),l=Er();fl({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!a||!e)return null;let u=ur(o,l,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let i=((u,c)=>{if(!window.history.state||!window.history.state.key){let p=Math.random().toString(32).slice(2);window.history.replaceState({key:p},"")}try{let h=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof h=="number"&&window.scrollTo(0,h)}catch(p){console.error(p),sessionStorage.removeItem(u)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||sr)}, ${JSON.stringify(s)})`}})}ll.displayName="ScrollRestoration";function ia(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ft(e){let t=d.useContext(Be);return W(t,ia(e)),t}function la(e){let t=d.useContext(Ge);return W(t,ia(e)),t}function sl(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=Oo(),i=Pe(),u=dt(e,{relative:o});return d.useCallback(c=>{if(ti(c,t)){c.preventDefault();let p=r!==void 0?r:ke(i)===ke(u);s(e,{replace:p,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[i,s,u,r,a,t,e,n,o,l])}var ul=0,cl=()=>`__${String(++ul)}__`;function sa(){let{router:e}=Ft("useSubmit"),{basename:t}=d.useContext(be),r=Wo();return d.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=ai(a,t);if(n.navigate===!1){let c=n.fetcherKey||cl();await e.fetch(c,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function dl(e,{relative:t}={}){let{basename:r}=d.useContext(be),a=d.useContext(Se);W(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...dt(e||".",{relative:t})},l=Pe();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),i=s.getAll("index");if(i.some(c=>c==="")){s.delete("index"),i.filter(p=>p).forEach(p=>s.append("index",p));let c=s.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Le([r,o.pathname])),ke(o)}function kl({key:e}={}){var S;let{router:t}=Ft("useFetcher"),r=la("useFetcher"),a=d.useContext(yr),n=d.useContext(Se),o=(S=n.matches[n.matches.length-1])==null?void 0:S.route.id;W(a,"useFetcher must be used inside a FetchersContext"),W(n,"useFetcher must be used inside a RouteContext"),W(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let l=d.useId(),[s,i]=d.useState(e||l);e&&e!==s&&i(e),d.useEffect(()=>(t.getFetcher(s),()=>t.deleteFetcher(s)),[t,s]);let u=d.useCallback(async(E,_)=>{W(o,"No routeId available for fetcher.load()"),await t.fetch(s,o,E,_)},[s,o,t]),c=sa(),p=d.useCallback(async(E,_)=>{await c(E,{..._,navigate:!1,fetcherKey:s})},[s,c]),h=d.useMemo(()=>{let E=d.forwardRef((_,P)=>d.createElement(oa,{..._,navigate:!1,fetcherKey:s,ref:P}));return E.displayName="fetcher.Form",E},[s]),g=r.fetchers.get(s)||Pn,w=a.get(s);return d.useMemo(()=>({Form:h,submit:p,load:u,...g,data:w}),[h,p,u,g,w])}var sr="react-router-scroll-positions",St={};function ur(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:ge(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function fl({getKey:e,storageKey:t}={}){let{router:r}=Ft("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=la("useScrollRestoration"),{basename:o}=d.useContext(be),l=Pe(),s=Er(),i=Yo();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),hl(d.useCallback(()=>{if(i.state==="idle"){let u=ur(l,s,o,e);St[u]=window.scrollY}try{sessionStorage.setItem(t||sr,JSON.stringify(St))}catch(u){ae(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[i.state,e,o,l,s,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||sr);u&&(St=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r==null?void 0:r.enableScrollRestoration(St,()=>window.scrollY,e?(c,p)=>ur(c,p,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(l.hash){let u=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(u){u.scrollIntoView();return}}n!==!0&&window.scrollTo(0,0)}},[l,a,n]))}function hl(e,t){let{capture:r}={};d.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function ml(e,t={}){let r=d.useContext(pr);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ft("useViewTransitionState"),n=dt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=ge(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=ge(r.nextLocation.pathname,a)||r.nextLocation.pathname;return _t(n.pathname,l)!=null||_t(n.pathname,o)!=null}[...Gn];function Al(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 Ae(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 l=new o(n.message);l.stack=n.stack,r[a]=l}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack=n.stack,r[a]=o}}else r[a]=n;return r}function Nl(e,t,r,a,n,o){let l={...e,loaderData:{...e.loaderData}},s=Ce(t,a,n);if(s)for(let i of s){let u=i.route.id,c=r(u);Zn(u,c.clientLoader,c.hasLoader,o)&&(c.hasHydrateFallback||!c.hasLoader)?delete l.loaderData[u]:c.hasLoader||(l.loaderData[u]=null)}return l}export{Rr as A,Oo as B,xa as C,kl as D,Pe as E,It as F,aa as L,Ol as M,bl as O,Pl as R,ll as S,d as a,Rl as b,Lr as c,zi as d,Al as e,gl as f,Nl as g,Tl as h,W as i,Ll as j,vl as k,Ml as l,wl as m,El as n,pl as o,Ta as p,yl as q,Ma as r,xl as s,Cl as t,_l as u,Dl as v,Sl as w,nl as x,Sr as y,ze as z};
