function uo(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"}))}var Ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function As(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function a(){var n=!1;try{n=this instanceof a}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}),r}var cr={exports:{}},W={};var da;function fo(){if(da)return W;da=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"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),y=Symbol.iterator;function w(m){return m===null||typeof m!="object"?null:(m=y&&m[y]||m["@@iterator"],typeof m=="function"?m:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function C(m,P,k){this.props=m,this.context=P,this.refs=v,this.updater=k||E}C.prototype.isReactComponent={},C.prototype.setState=function(m,P){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,P,"setState")},C.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function S(){}S.prototype=C.prototype;function D(m,P,k){this.props=m,this.context=P,this.refs=v,this.updater=k||E}var M=D.prototype=new S;M.constructor=D,b(M,C.prototype),M.isPureReactComponent=!0;var T=Array.isArray;function $(){}var _={H:null,A:null,T:null,S:null},g=Object.prototype.hasOwnProperty;function J(m,P,k){var I=k.ref;return{$$typeof:e,type:m,key:P,ref:I!==void 0?I:null,props:k}}function X(m,P){return J(m.type,P,m.props)}function ne(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function V(m){var P={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(k){return P[k]})}var se=/\/+/g;function ee(m,P){return typeof m=="object"&&m!==null&&m.key!=null?V(""+m.key):P.toString(36)}function ce(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then($,$):(m.status="pending",m.then(function(P){m.status==="pending"&&(m.status="fulfilled",m.value=P)},function(P){m.status==="pending"&&(m.status="rejected",m.reason=P)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function K(m,P,k,I,B){var Y=typeof m;(Y==="undefined"||Y==="boolean")&&(m=null);var Z=!1;if(m===null)Z=!0;else switch(Y){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(m.$$typeof){case e:case t:Z=!0;break;case f:return Z=m._init,K(Z(m._payload),P,k,I,B)}}if(Z)return B=B(m),Z=I===""?"."+ee(m,0):I,T(B)?(k="",Z!=null&&(k=Z.replace(se,"$&/")+"/"),K(B,P,k,"",function(nr){return nr})):B!=null&&(ne(B)&&(B=X(B,k+(B.key==null||m&&m.key===B.key?"":(""+B.key).replace(se,"$&/")+"/")+Z)),P.push(B)),1;Z=0;var ye=I===""?".":I+":";if(T(m))for(var fe=0;fe<m.length;fe++)I=m[fe],Y=ye+ee(I,fe),Z+=K(I,P,k,Y,B);else if(fe=w(m),typeof fe=="function")for(m=fe.call(m),fe=0;!(I=m.next()).done;)I=I.value,Y=ye+ee(I,fe++),Z+=K(I,P,k,Y,B);else if(Y==="object"){if(typeof m.then=="function")return K(ce(m),P,k,I,B);throw P=String(m),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Z}function Q(m,P,k){if(m==null)return m;var I=[],B=0;return K(m,I,"","",function(Y){return P.call(k,Y,B++)}),I}function we(m){if(m._status===-1){var P=m._result;P=P(),P.then(function(k){(m._status===0||m._status===-1)&&(m._status=1,m._result=k)},function(k){(m._status===0||m._status===-1)&&(m._status=2,m._result=k)}),m._status===-1&&(m._status=0,m._result=P)}if(m._status===1)return m._result.default;throw m._result}var te=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=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(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},de={map:Q,forEach:function(m,P,k){Q(m,function(){P.apply(this,arguments)},k)},count:function(m){var P=0;return Q(m,function(){P++}),P},toArray:function(m){return Q(m,function(P){return P})||[]},only:function(m){if(!ne(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return W.Activity=c,W.Children=de,W.Component=C,W.Fragment=r,W.Profiler=n,W.PureComponent=D,W.StrictMode=a,W.Suspense=s,W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,W.__COMPILER_RUNTIME={__proto__:null,c:function(m){return _.H.useMemoCache(m)}},W.cache=function(m){return function(){return m.apply(null,arguments)}},W.cacheSignal=function(){return null},W.cloneElement=function(m,P,k){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var I=b({},m.props),B=m.key;if(P!=null)for(Y in P.key!==void 0&&(B=""+P.key),P)!g.call(P,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&P.ref===void 0||(I[Y]=P[Y]);var Y=arguments.length-2;if(Y===1)I.children=k;else if(1<Y){for(var Z=Array(Y),ye=0;ye<Y;ye++)Z[ye]=arguments[ye+2];I.children=Z}return J(m.type,B,I)},W.createContext=function(m){return m={$$typeof:i,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:o,_context:m},m},W.createElement=function(m,P,k){var I,B={},Y=null;if(P!=null)for(I in P.key!==void 0&&(Y=""+P.key),P)g.call(P,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(B[I]=P[I]);var Z=arguments.length-2;if(Z===1)B.children=k;else if(1<Z){for(var ye=Array(Z),fe=0;fe<Z;fe++)ye[fe]=arguments[fe+2];B.children=ye}if(m&&m.defaultProps)for(I in Z=m.defaultProps,Z)B[I]===void 0&&(B[I]=Z[I]);return J(m,Y,B)},W.createRef=function(){return{current:null}},W.forwardRef=function(m){return{$$typeof:l,render:m}},W.isValidElement=ne,W.lazy=function(m){return{$$typeof:f,_payload:{_status:-1,_result:m},_init:we}},W.memo=function(m,P){return{$$typeof:u,type:m,compare:P===void 0?null:P}},W.startTransition=function(m){var P=_.T,k={};_.T=k;try{var I=m(),B=_.S;B!==null&&B(k,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then($,te)}catch(Y){te(Y)}finally{P!==null&&k.types!==null&&(P.types=k.types),_.T=P}},W.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},W.use=function(m){return _.H.use(m)},W.useActionState=function(m,P,k){return _.H.useActionState(m,P,k)},W.useCallback=function(m,P){return _.H.useCallback(m,P)},W.useContext=function(m){return _.H.useContext(m)},W.useDebugValue=function(){},W.useDeferredValue=function(m,P){return _.H.useDeferredValue(m,P)},W.useEffect=function(m,P){return _.H.useEffect(m,P)},W.useEffectEvent=function(m){return _.H.useEffectEvent(m)},W.useId=function(){return _.H.useId()},W.useImperativeHandle=function(m,P,k){return _.H.useImperativeHandle(m,P,k)},W.useInsertionEffect=function(m,P){return _.H.useInsertionEffect(m,P)},W.useLayoutEffect=function(m,P){return _.H.useLayoutEffect(m,P)},W.useMemo=function(m,P){return _.H.useMemo(m,P)},W.useOptimistic=function(m,P){return _.H.useOptimistic(m,P)},W.useReducer=function(m,P,k){return _.H.useReducer(m,P,k)},W.useRef=function(m){return _.H.useRef(m)},W.useState=function(m){return _.H.useState(m)},W.useSyncExternalStore=function(m,P,k){return _.H.useSyncExternalStore(m,P,k)},W.useTransition=function(){return _.H.useTransition()},W.version="19.2.8",W}var fa;function ho(){return fa||(fa=1,cr.exports=fo()),cr.exports}var d=ho();const mo=co(d),po=uo({__proto__:null,default:mo},[d]);var Va=e=>{throw TypeError(e)},Ja=(e,t,r)=>t.has(e)||Va("Cannot "+r),Ce=(e,t,r)=>(Ja(e,t,"read from private field"),r?r.call(e):t.get(e)),wt=(e,t,r)=>t.has(e)?Va("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ae=(e,t,r,a)=>(Ja(e,t,"write to private field"),t.set(e,r),r),qt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,kr=/^[\\/]{2}/;function Ga(e,t){return t+e.replace(/\\/g,"/")}var ha="popstate";function ma(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Is(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return bt("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:De(n)}return vo(t,r,null,e)}function z(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function le(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yo(){return Math.random().toString(36).substring(2,10)}function pa(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function bt(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Oe(t):t,state:r,key:t&&t.key||a||yo(),mask:n}}function De({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 Oe(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 vo(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=f();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function f(){return(i.state||{idx:null}).idx}function c(){l="POP";let v=f(),C=v==null?null:v-u;u=v,s&&s({action:l,location:b.location,delta:C})}function y(v,C){l="PUSH";let S=ma(v)?v:bt(b.location,v,C);u=f()+1;let D=pa(S,u),M=b.createHref(S.mask||S);try{i.pushState(D,"",M)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;n.location.assign(M)}o&&s&&s({action:l,location:b.location,delta:1})}function w(v,C){l="REPLACE";let S=ma(v)?v:bt(b.location,v,C);u=f();let D=pa(S,u),M=b.createHref(S.mask||S);i.replaceState(D,"",M),o&&s&&s({action:l,location:b.location,delta:0})}function E(v){return Xa(n,v)}let b={get action(){return l},get location(){return e(n,i)},listen(v){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(ha,c),s=v,()=>{n.removeEventListener(ha,c),s=null}},createHref(v){return t(n,v)},createURL:E,encodeLocation(v){let C=E(v);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:y,replace:w,go(v){return i.go(v)}};return b}function Xa(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),z(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:De(t);return n=n.replace(/ $/,"%20"),!r&&kr.test(n)&&(n=a+n),new URL(n,a)}var Rt,ya=class{constructor(e){if(wt(this,Rt,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Ce(this,Rt).has(e))return Ce(this,Rt).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ce(this,Rt).set(e,t)}};Rt=new WeakMap;var go=new Set(["lazy","caseSensitive","path","id","index","children"]);function wo(e){return go.has(e)}var Ro=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Eo(e){return Ro.has(e)}function bo(e){return e.index===!0}function St(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(z(o.index!==!0||!o.children,"Cannot specify children on an index route"),z(n||!a[s],`Found a route id collision on id "${s}".  Route id's must be globally unique within Data Router usages`),bo(o)){let u={...o,id:s};return a[s]=va(u,t(u)),u}else{let u={...o,id:s,children:void 0};return a[s]=va(u,t(u)),o.children&&(u.children=St(o.children,t,l,a,n)),u}})}function va(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ka(e,t,r="/"){return Te(e,t,r,!1)}function Te(e,t,r,a,n){let o=typeof t=="string"?Oe(t):t,i=Pe(o.pathname||"/",r);if(i==null)return null;let l=n??zt(e),s=null,u=ko(i);for(let f=0;s==null&&f<l.length;++f)s=Oo(l[f],u,a);return s}function qa(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function zt(e){let t=Qa(e);return So(t),t}function Qa(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let f={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(a)&&s)return;z(f.relativePath.startsWith(a),`Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(a.length)}let c=Le([a,f.relativePath]),y=r.concat(f);i.children&&i.children.length>0&&(z(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Qa(i.children,t,y,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:_o(c,i.index),routesMeta:y.map((w,E)=>{let[b,v]=Nr(w.relativePath,w.caseSensitive,E===y.length-1);return{...w,matcher:b,compiledParams:v}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Za(i.path))o(i,l,!0,s)}),t}function Za(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Za(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function So(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Do(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var xo=/^:[\w-]+$/,Lo=3,Po=2,Co=1,To=10,Mo=-2,ga=e=>e==="*";function _o(e,t){let r=e.split("/"),a=r.length;return r.some(ga)&&(a+=Mo),t&&(a+=Po),r.filter(n=>!ga(n)).reduce((n,o)=>n+(xo.test(o)?Lo:o===""?Co:To),a)}function Do(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 Oo(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,f=o==="/"?t:t.slice(o.length)||"/",c={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},y=s.matcher&&s.compiledParams?en(c,f,s.matcher,s.compiledParams):Jt(c,f),w=s.route;if(!y&&u&&r&&!a[a.length-1].route.index&&(y=Jt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!y)return null;Object.assign(n,y.params),i.push({params:n,pathname:Le([o,y.pathname]),pathnameBase:Io(Le([o,y.pathnameBase])),route:w}),y.pathnameBase!=="/"&&(o=Le([o,y.pathnameBase]))}return i}function Jt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Nr(e.path,e.caseSensitive,e.end);return en(e,t,r,a)}function en(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((u,{paramName:f,isOptional:c},y)=>{if(f==="*"){let E=l[y]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const w=l[y];return c&&!w?u[f]=void 0:u[f]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Nr(e,t=!1,r=!0){le(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,f)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let c=f.charAt(u+i.length);return c&&c!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function ko(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return le(!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 Pe(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 No({basename:e,pathname:t}){return t==="/"?e:Le([e,t])}var Ar=e=>qt.test(e);function Ao(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Oe(e):e,o;return r?(r=Ir(r),r.startsWith("/")?o=wa(r.substring(1),"/"):o=wa(r,t)):o=t,{pathname:o,search:Fo(a),hash:$o(n)}}function wa(e,t){let r=Gt(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function dr(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 tn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Qt(e){let t=tn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Lt(e,t,r,a=!1){let n;typeof e=="string"?n=Oe(e):(n={...e},z(!n.pathname||!n.pathname.includes("?"),dr("?","pathname","search",n)),z(!n.pathname||!n.pathname.includes("#"),dr("#","pathname","hash",n)),z(!n.search||!n.search.includes("#"),dr("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!a&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),c-=1;n.pathname=y.join("/")}l=c>=0?t[c]:"/"}let s=Ao(n,l),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||f)&&(s.pathname+="/"),s}var Ir=e=>e.replace(/[\\/]{2,}/g,"/"),Le=e=>Ir(e.join("/")),Gt=e=>e.replace(/\/+$/,""),Io=e=>Gt(e).replace(/^\/*/,"/"),Fo=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$o=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jo=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Uo(e,t){return new jo(e,typeof t=="number"?{status:t}:t)}var Ho=(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})},rn=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ge=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 et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Pt(e){let t=e.map(r=>r.route.path).filter(Boolean);return Le(t)||"/"}var an=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nn(e,t){let r=e;if(typeof r!="string"||!qt.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(an)try{let o=new URL(window.location.href),i=kr.test(r)?new URL(Ga(r,o.protocol)):new URL(r),l=Pe(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{le(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Je=Symbol("Uninstrumented");function zo(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let l of i)o[l]&&r[l].push(o[l])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=lt(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let i=n[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=lt(l,i,()=>{});s&&(a.lazy=Object.assign(a.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[Je]??o,l=lt(r[n],i,(...s)=>Ra(s[0]));l&&(n==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[Je]=i,a[n]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Je]??n,i=lt(r.middleware,o,(...l)=>Ra(l[0]));return i?(i[Je]=o,i):n})),a}function Bo(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let i of o)n[i]&&r[i].push(n[i])}})),r.navigate.length>0){let a=e.navigate[Je]??e.navigate,n=lt(r.navigate,a,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?De(i):".",...Ea(e,l??{})}});n&&(n[Je]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Je]??e.fetch,n=lt(r.fetch,a,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...Ea(e,s??{})}});n&&(n[Je]=a,e.fetch=n)}return e}function lt(e,t,r){return e.length===0?null:async(...a)=>{let n=await on(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function on(e,t,r,a){let n=e[a],o;if(n){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=on(e,t,r,a-1),o=await i,z(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(l,t)}catch(s){console.error("An instrumentation function threw an error:",s)}i||await l(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ra(e){let{request:t,context:r,params:a,pattern:n}=e;return{request:Wo(t),params:{...a},pattern:n,context:Yo(r)}}function Ea(e,t){return{currentUrl:De(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Wo(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Yo(e){if(Jo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Vo=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Vo}var ln=["POST","PUT","PATCH","DELETE"],Go=new Set(ln),Xo=["GET",...ln],Ko=new Set(Xo),sn=new Set([301,302,303,307,308]),qo=new Set([307,308]),fr={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qo={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},pt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Zo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),un="remix-router-transitions",cn=Symbol("ResetLoaderData"),Qe,nt,Ye,ot,ei=class{constructor(e){wt(this,Qe),wt(this,nt),wt(this,Ye),wt(this,ot),Ae(this,Qe,e),Ae(this,nt,zt(e))}get stableRoutes(){return Ce(this,Qe)}get activeRoutes(){return Ce(this,Ye)??Ce(this,Qe)}get branches(){return Ce(this,ot)??Ce(this,nt)}get hasHMRRoutes(){return Ce(this,Ye)!=null}setRoutes(e){Ae(this,Qe,e),Ae(this,nt,zt(e))}setHmrRoutes(e){Ae(this,Ye,e),Ae(this,ot,zt(e))}commitHmrRoutes(){Ce(this,Ye)&&(Ae(this,Qe,Ce(this,Ye)),Ae(this,nt,Ce(this,ot)),Ae(this,Ye,void 0),Ae(this,ot,void 0))}};Qe=new WeakMap;nt=new WeakMap;Ye=new WeakMap;ot=new WeakMap;function Fs(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";z(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||Zo,o=n;if(e.instrumentations){let h=e.instrumentations;o=p=>({...n(p),...zo(h.map(R=>R.route).filter(Boolean),p)})}let i={},l=new ei(St(e.routes,o,void 0,i)),s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let u=e.dataStrategy||oi,f={...e.future},c=null,y=new Set,w=null,E=null,b=null,v=null,C=e.hydrationData!=null,S=Te(l.activeRoutes,e.history.location,s,!1,l.branches),D=!1,M=null,T,$;if(S==null&&!e.patchRoutesOnNavigation){let h=Me(404,{pathname:e.history.location.pathname}),{matches:p,route:R}=At(l.activeRoutes);T=!0,$=!T,S=p,M={[R.id]:h}}else if(S&&!e.hydrationData&&_t(S,l.activeRoutes,e.history.location.pathname).active&&(S=null),S)if(S.some(h=>h.route.lazy))T=!1,$=!T;else if(!S.some(h=>Fr(h.route)))T=!0,$=!T;else{let h=e.hydrationData?e.hydrationData.loaderData:null,p=e.hydrationData?e.hydrationData.errors:null,R=S;if(p){let x=S.findIndex(L=>p[L.route.id]!==void 0);R=R.slice(0,x+1)}$=!1,T=!0,R.forEach(x=>{let L=dn(x.route,h,p);$=$||L.renderFallback,T=T&&!L.shouldLoad})}else{T=!1,$=!T,S=[];let h=_t(null,l.activeRoutes,e.history.location.pathname);h.active&&h.matches&&(D=!0,S=h.matches)}let _,g={historyAction:e.history.action,location:e.history.location,matches:S,initialized:T,renderFallback:$,navigation:fr,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},J="POP",X=null,ne=!1,V,se=!1,ee=new Map,ce=null,K=!1,Q=!1,we=new Set,te=new Map,de=0,m=-1,P=new Map,k=new Set,I=new Map,B=new Map,Y=new Set,Z=new Map,ye,fe=null;function nr(){if(c=e.history.listen(({action:h,location:p,delta:R})=>{if(ye){ye(),ye=void 0;return}le(Z.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 x=oa({currentLocation:g.location,nextLocation:p,historyAction:h});if(x&&R!=null){let L=new Promise(N=>{ye=N});e.history.go(R*-1),Mt(x,{state:"blocked",location:p,proceed(){Mt(x,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),L.then(()=>e.history.go(R))},reset(){let N=new Map(g.blockers);N.set(x,pt),me({blockers:N})}}),X?.resolve(),X=null;return}return Xe(h,p)}),r){xi(t,ee);let h=()=>Li(t,ee);t.addEventListener("pagehide",h),ce=()=>t.removeEventListener("pagehide",h)}return g.initialized||Xe("POP",g.location,{initialHydration:!0}),_}function Yn(){c&&c(),ce&&ce(),y.clear(),V&&V.abort(),g.fetchers.forEach((h,p)=>ir(g.fetchers,p)),g.blockers.forEach((h,p)=>na(p))}function Vn(h){if(y.add(h),w){let{newErrors:p}=w;w=null,h(g,{deletedFetchers:[],newErrors:p,viewTransitionOpts:void 0,flushSync:!1})}return()=>y.delete(h)}function me(h,p={}){h.matches&&(h.matches=h.matches.map(L=>{let N=i[L.route.id],A=L.route;return A.element!==N.element||A.errorElement!==N.errorElement||A.hydrateFallbackElement!==N.hydrateFallbackElement?{...L,route:N}:L})),g={...g,...h};let R=[],x=[];g.fetchers.forEach((L,N)=>{L.state==="idle"&&(Y.has(N)?R.push(N):x.push(N))}),Y.forEach(L=>{!g.fetchers.has(L)&&!te.has(L)&&R.push(L)}),y.size===0&&(w={newErrors:h.errors??null}),[...y].forEach(L=>L(g,{deletedFetchers:R,newErrors:h.errors??null,viewTransitionOpts:p.viewTransitionOpts,flushSync:p.flushSync===!0})),R.forEach(L=>ir(g.fetchers,L)),x.forEach(L=>g.fetchers.delete(L))}function rt(h,p,{flushSync:R}={}){let x=g.actionData!=null&&g.navigation.formMethod!=null&&pe(g.navigation.formMethod)&&g.navigation.state==="loading"&&h.state?._isRedirect!==!0,L;p.actionData?Object.keys(p.actionData).length>0?L=p.actionData:L=null:x?L=g.actionData:L=null;let N=p.loaderData?Da(g.loaderData,p.loaderData,p.matches||[],p.errors):g.loaderData,A=g.blockers;A.size>0&&(A=new Map(A),A.forEach((j,G)=>A.set(G,pt)));let F=K?!1:la(h,p.matches||g.matches),O=ne===!0||g.navigation.formMethod!=null&&pe(g.navigation.formMethod)&&h.state?._isRedirect!==!0;l.commitHmrRoutes(),K||J==="POP"||(J==="PUSH"?e.history.push(h,h.state):J==="REPLACE"&&e.history.replace(h,h.state));let U;if(J==="POP"){let j=ee.get(g.location.pathname);j&&j.has(h.pathname)?U={currentLocation:g.location,nextLocation:h}:ee.has(h.pathname)&&(U={currentLocation:h,nextLocation:g.location})}else if(se){let j=ee.get(g.location.pathname);j?j.add(h.pathname):(j=new Set([h.pathname]),ee.set(g.location.pathname,j)),U={currentLocation:g.location,nextLocation:h}}me({...p,actionData:L,loaderData:N,historyAction:J,location:h,initialized:!0,renderFallback:!1,navigation:fr,revalidation:"idle",restoreScrollPosition:F,preventScrollReset:O,blockers:A},{viewTransitionOpts:U,flushSync:R===!0}),J="POP",ne=!1,se=!1,K=!1,Q=!1,X?.resolve(),X=null,fe?.resolve(),fe=null}async function Qr(h,p){if(X?.resolve(),X=null,typeof h=="number"){X||(X=Na());let ae=X.promise;return e.history.go(h),ae}let R=wr(g.location,g.matches,s,h,p?.fromRouteId,p?.relative),{path:x,submission:L,error:N}=ba(!1,R,p),A;p?.mask&&(A={pathname:"",search:"",hash:"",...typeof p.mask=="string"?Oe(p.mask):{...g.location.mask,...p.mask}});let F=g.location,O=bt(F,x,p&&p.state,void 0,A);O={...O,...e.history.encodeLocation(O)};let U=p&&p.replace!=null?p.replace:void 0,j="PUSH";U===!0?j="REPLACE":U===!1||L!=null&&pe(L.formMethod)&&L.formAction===g.location.pathname+g.location.search&&(j="REPLACE");let G=p&&"preventScrollReset"in p?p.preventScrollReset===!0:void 0,H=(p&&p.flushSync)===!0,re=oa({currentLocation:F,nextLocation:O,historyAction:j});if(re){Mt(re,{state:"blocked",location:O,proceed(){Mt(re,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),Qr(h,p)},reset(){let ae=new Map(g.blockers);ae.set(re,pt),me({blockers:ae})}});return}await Xe(j,O,{submission:L,pendingError:N,preventScrollReset:G,replace:p&&p.replace,enableViewTransition:p&&p.viewTransition,flushSync:H,callSiteDefaultShouldRevalidate:p&&p.defaultShouldRevalidate})}function Jn(){fe||(fe=Na()),or(),me({revalidation:"loading"});let h=fe.promise;return g.navigation.state==="submitting"?h:g.navigation.state==="idle"?(Xe(g.historyAction,g.location,{startUninterruptedRevalidation:!0}),h):(Xe(J||g.historyAction,g.navigation.location,{overrideNavigation:g.navigation,enableViewTransition:se===!0}),h)}async function Xe(h,p,R){V&&V.abort(),V=null,J=h,K=(R&&R.startUninterruptedRevalidation)===!0,oo(g.location,g.matches),ne=(R&&R.preventScrollReset)===!0,se=(R&&R.enableViewTransition)===!0;let x=l.activeRoutes,L=R?.initialHydration&&g.matches&&g.matches.length>0&&!D?g.matches:Te(x,p,s,!1,l.branches),N=(R&&R.flushSync)===!0;if(L&&g.initialized&&!Q&&mi(g.location,p)&&!(R&&R.submission&&pe(R.submission.formMethod))){rt(p,{matches:L},{flushSync:N});return}let A=_t(L,x,p.pathname);if(A.active&&A.matches&&(L=A.matches),!L){let{error:ue,notFoundMatches:oe,route:Re}=lr(p.pathname);rt(p,{matches:oe,loaderData:{},errors:{[Re.id]:ue}},{flushSync:N});return}let F=R&&R.overrideNavigation?{...R.overrideNavigation,matches:L,historyAction:h}:void 0;V=new AbortController;let O=it(e.history,p,V.signal,R&&R.submission),U=e.getContext?await e.getContext():new ya,j;if(R&&R.pendingError)j=[Ve(L).route.id,{type:"error",error:R.pendingError}];else if(R&&R.submission&&pe(R.submission.formMethod)){let ue=await Gn(O,p,R.submission,L,h,U,A.active,R&&R.initialHydration===!0,{replace:R.replace,flushSync:N});if(ue.shortCircuited)return;if(ue.pendingActionResult){let[oe,Re]=ue.pendingActionResult;if(xe(Re)&&et(Re.error)&&Re.error.status===404){V=null,rt(p,{matches:ue.matches,loaderData:{},errors:{[oe]:Re.error}});return}}L=ue.matches||L,j=ue.pendingActionResult,F=hr(p,L,h,R.submission),N=!1,A.active=!1,O=it(e.history,O.url,O.signal)}let{shortCircuited:G,matches:H,loaderData:re,errors:ae,workingFetchers:he}=await Xn(O,p,L,h,U,A.active,F,R&&R.submission,R&&R.fetcherSubmission,R&&R.replace,R&&R.initialHydration===!0,N,j,R&&R.callSiteDefaultShouldRevalidate);G||(V=null,rt(p,{matches:H||L,...Oa(j),loaderData:re,errors:ae,...he?{fetchers:he}:{}}))}async function Gn(h,p,R,x,L,N,A,F,O={}){or();let U=bi(p,x,L,R);if(me({navigation:U},{flushSync:O.flushSync===!0}),A){let H=await Dt(x,p.pathname,h.signal);if(H.type==="aborted")return{shortCircuited:!0};if(H.type==="error"){if(H.partialMatches.length===0){let{matches:ae,route:he}=At(l.activeRoutes);return{matches:ae,pendingActionResult:[he.id,{type:"error",error:H.error}]}}let re=Ve(H.partialMatches).route.id;return{matches:H.partialMatches,pendingActionResult:[re,{type:"error",error:H.error}]}}else if(H.matches)x=H.matches;else{let{notFoundMatches:re,error:ae,route:he}=lr(p.pathname);return{matches:re,pendingActionResult:[he.id,{type:"error",error:ae}]}}}let j,G=Bt(x,p);if(!G.route.action&&!G.route.lazy)j={type:"error",error:Me(405,{method:h.method,pathname:p.pathname,routeId:G.route.id})};else{let H=st(o,i,h,p,x,G,F?[]:a,N),re=await ht(h,p,H,N,null);if(j=re[G.route.id],!j){for(let ae of x)if(re[ae.route.id]){j=re[ae.route.id];break}}if(h.signal.aborted)return{shortCircuited:!0}}if(Ze(j)){let H;return O&&O.replace!=null?H=O.replace:H=Ta(j.response.headers.get("Location"),new URL(h.url),s,e.history)===g.location.pathname+g.location.search,await Ke(h,j,!0,{submission:R,replace:H}),{shortCircuited:!0}}if(xe(j)){let H=Ve(x,G.route.id);return(O&&O.replace)!==!0&&(J="PUSH"),{matches:x,pendingActionResult:[H.route.id,j,G.route.id]}}return{matches:x,pendingActionResult:[G.route.id,j]}}async function Xn(h,p,R,x,L,N,A,F,O,U,j,G,H,re){let ae=A||hr(p,R,x,F),he=F||O||ka(ae),ue=!K&&!j;if(N){if(ue){let be=Zr(H);me({navigation:ae,...be!==void 0?{actionData:be}:{}},{flushSync:G})}let q=await Dt(R,p.pathname,h.signal);if(q.type==="aborted")return{shortCircuited:!0};if(q.type==="error"){if(q.partialMatches.length===0){let{matches:Ne,route:He}=At(l.activeRoutes);return{matches:Ne,loaderData:{},errors:{[He.id]:q.error}}}let be=Ve(q.partialMatches).route.id;return{matches:q.partialMatches,loaderData:{},errors:{[be]:q.error}}}else if(q.matches)R=q.matches;else{let{error:be,notFoundMatches:Ne,route:He}=lr(p.pathname);return{matches:Ne,loaderData:{},errors:{[He.id]:be}}}}let oe=l.activeRoutes,{dsMatches:Re,revalidatingFetchers:Ee}=Sa(h,L,o,i,e.history,g,R,he,p,j?[]:a,j===!0,Q,we,Y,I,k,oe,s,e.patchRoutesOnNavigation!=null,l.branches,H,re);if(m=++de,!e.dataStrategy&&!Re.some(q=>q.shouldLoad)&&!Re.some(q=>q.route.middleware&&q.route.middleware.length>0)&&Ee.length===0){let q=new Map(g.fetchers),be=ra(q);return rt(p,{matches:R,loaderData:{},errors:H&&xe(H[1])?{[H[0]]:H[1].error}:null,...Oa(H),...be?{fetchers:q}:{}},{flushSync:G}),{shortCircuited:!0}}if(ue){let q={};if(!N){q.navigation=ae;let be=Zr(H);be!==void 0&&(q.actionData=be)}Ee.length>0&&(q.fetchers=Kn(Ee)),me(q,{flushSync:G})}Ee.forEach(q=>{Ue(q.key),q.controller&&te.set(q.key,q.controller)});let mt=()=>Ee.forEach(q=>Ue(q.key));V&&V.signal.addEventListener("abort",mt);let{loaderResults:ze,fetcherResults:at}=await ea(Re,Ee,h,p,L);if(h.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",mt),Ee.forEach(q=>te.delete(q.key));let Be=It(ze);if(Be)return await Ke(h,Be.result,!0,{replace:U}),{shortCircuited:!0};if(Be=It(at),Be)return k.add(Be.key),await Ke(h,Be.result,!0,{replace:U}),{shortCircuited:!0};let ke=new Map(g.fetchers),{loaderData:sr,errors:We}=_a(g,R,ze,H,Ee,at,ke);j&&g.errors&&(We={...g.errors,...We});let Ot=ra(ke),kt=aa(m,ke),Nt=Ot||kt||Ee.length>0;return{matches:R,loaderData:sr,errors:We,...Nt?{workingFetchers:ke}:{}}}function Zr(h){if(h&&!xe(h[1]))return{[h[0]]:h[1].data};if(g.actionData)return Object.keys(g.actionData).length===0?null:g.actionData}function Kn(h){let p=new Map(g.fetchers);return h.forEach(R=>{let x=p.get(R.key),L=yt(void 0,x?x.data:void 0);p.set(R.key,L)}),p}async function qn(h,p,R,x){Ue(h);let L=(x&&x.flushSync)===!0,N=l.activeRoutes,A=wr(g.location,g.matches,s,R,p,x?.relative),F=Te(N,A,s,!1,l.branches),O=_t(F,N,A);if(O.active&&O.matches&&(F=O.matches),!F){je(h,p,Me(404,{pathname:A}),{flushSync:L});return}let{path:U,submission:j,error:G}=ba(!0,A,x);if(G){je(h,p,G,{flushSync:L});return}let H=e.getContext?await e.getContext():new ya,re=(x&&x.preventScrollReset)===!0;if(j&&pe(j.formMethod)){await Qn(h,p,U,F,H,O.active,L,re,j,x&&x.defaultShouldRevalidate);return}I.set(h,{routeId:p,path:U}),await Zn(h,p,U,F,H,O.active,L,re,j)}async function Qn(h,p,R,x,L,N,A,F,O,U){or(),I.delete(h);let j=g.fetchers.get(h);$e(h,Si(O,j),{flushSync:A});let G=new AbortController,H=it(e.history,R,G.signal,O);if(N){let ie=await Dt(x,new URL(H.url).pathname,H.signal,h);if(ie.type==="aborted")return;if(ie.type==="error"){je(h,p,ie.error,{flushSync:A});return}else if(ie.matches)x=ie.matches;else{je(h,p,Me(404,{pathname:R}),{flushSync:A});return}}let re=Bt(x,R);if(!re.route.action&&!re.route.lazy){let ie=Me(405,{method:O.formMethod,pathname:R,routeId:p});je(h,p,ie,{flushSync:A});return}te.set(h,G);let ae=de,he=st(o,i,H,R,x,re,a,L),ue=await ht(H,R,he,L,h),oe=ue[re.route.id];if(!oe){for(let ie of he)if(ue[ie.route.id]){oe=ue[ie.route.id];break}}if(H.signal.aborted){te.get(h)===G&&te.delete(h);return}if(Y.has(h)){if(Ze(oe)||xe(oe)){$e(h,Ie(void 0));return}}else{if(Ze(oe))if(te.delete(h),m>ae){$e(h,Ie(void 0));return}else return k.add(h),$e(h,yt(O)),Ke(H,oe,!1,{fetcherSubmission:O,preventScrollReset:F});if(xe(oe)){je(h,p,oe.error);return}}let Re=g.navigation.location||g.location,Ee=it(e.history,Re,G.signal),mt=l.activeRoutes,ze=g.navigation.state!=="idle"?Te(mt,g.navigation.location,s,!1,l.branches):g.matches;z(ze,"Didn't find any matches after fetcher action");let at=++de;P.set(h,at);let{dsMatches:Be,revalidatingFetchers:ke}=Sa(Ee,L,o,i,e.history,g,ze,O,Re,a,!1,Q,we,Y,I,k,mt,s,e.patchRoutesOnNavigation!=null,l.branches,[re.route.id,oe],U),sr=yt(O,oe.data),We=new Map(g.fetchers);We.set(h,sr),ke.filter(ie=>ie.key!==h).forEach(ie=>{let qe=ie.key,ca=We.get(qe),so=yt(void 0,ca?ca.data:void 0);We.set(qe,so),Ue(qe),ie.controller&&te.set(qe,ie.controller)}),me({fetchers:We});let Ot=()=>ke.forEach(ie=>Ue(ie.key));G.signal.addEventListener("abort",Ot);let{loaderResults:kt,fetcherResults:Nt}=await ea(Be,ke,Ee,Re,L);if(G.signal.aborted)return;G.signal.removeEventListener("abort",Ot),P.delete(h),te.delete(h),ke.forEach(ie=>te.delete(ie.key));let q=g.fetchers.has(h),be=ie=>{if(!q)return ie;let qe=new Map(ie.fetchers);return qe.set(h,Ie(oe.data)),{...ie,fetchers:qe}},Ne=It(kt);if(Ne)return g=be(g),Ke(Ee,Ne.result,!1,{preventScrollReset:F});if(Ne=It(Nt),Ne)return k.add(Ne.key),g=be(g),Ke(Ee,Ne.result,!1,{preventScrollReset:F});let He=new Map(g.fetchers);q&&He.set(h,Ie(oe.data));let{loaderData:ua,errors:ur}=_a(g,ze,kt,void 0,ke,Nt,He);aa(at,He),g.navigation.state==="loading"&&at>m?(z(J,"Expected pending action"),V&&V.abort(),rt(g.navigation.location,{matches:ze,loaderData:ua,errors:ur,fetchers:He})):(me({errors:ur,loaderData:Da(g.loaderData,ua,ze,ur),fetchers:He}),Q=!1)}async function Zn(h,p,R,x,L,N,A,F,O){let U=g.fetchers.get(h);$e(h,yt(O,U?U.data:void 0),{flushSync:A});let j=new AbortController,G=it(e.history,R,j.signal);if(N){let oe=await Dt(x,new URL(G.url).pathname,G.signal,h);if(oe.type==="aborted")return;if(oe.type==="error"){je(h,p,oe.error,{flushSync:A});return}else if(oe.matches)x=oe.matches;else{je(h,p,Me(404,{pathname:R}),{flushSync:A});return}}let H=Bt(x,R);te.set(h,j);let re=de,ae=st(o,i,G,R,x,H,a,L),he=await ht(G,R,ae,L,h),ue=he[H.route.id];if(!ue){for(let oe of x)if(he[oe.route.id]){ue=he[oe.route.id];break}}if(te.get(h)===j&&te.delete(h),!G.signal.aborted){if(Y.has(h)){$e(h,Ie(void 0));return}if(Ze(ue))if(m>re){$e(h,Ie(void 0));return}else{k.add(h),await Ke(G,ue,!1,{preventScrollReset:F});return}if(xe(ue)){je(h,p,ue.error);return}$e(h,Ie(ue.data))}}async function Ke(h,p,R,{submission:x,fetcherSubmission:L,preventScrollReset:N,replace:A}={}){R||(X?.resolve(),X=null),p.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let F=p.response.headers.get("Location");z(F,"Expected a Location header on the redirect Response"),F=Ta(F,new URL(h.url),s,e.history);let O=bt(g.location,F,{_isRedirect:!0});if(r){let ae=!1;if(p.response.headers.has("X-Remix-Reload-Document"))ae=!0;else if(Ar(F)){const he=Xa(t,F,!0);ae=he.origin!==t.location.origin||Pe(he.pathname,s)==null}if(ae){A?t.location.replace(F):t.location.assign(F);return}}V=null;let U=A===!0||p.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:j,formAction:G,formEncType:H}=g.navigation;!x&&!L&&j&&G&&H&&(x=ka(g.navigation));let re=x||L;if(qo.has(p.response.status)&&re&&pe(re.formMethod))await Xe(U,O,{submission:{...re,formAction:F},preventScrollReset:N||ne,enableViewTransition:R?se:void 0});else{let ae=hr(O,[],U,x);await Xe(U,O,{overrideNavigation:ae,fetcherSubmission:L,preventScrollReset:N||ne,enableViewTransition:R?se:void 0})}}async function ht(h,p,R,x,L){let N,A={};try{N=await li(u,h,p,R,L,x,!1)}catch(F){return R.filter(O=>O.shouldLoad).forEach(O=>{A[O.route.id]={type:"error",error:F}}),A}if(h.signal.aborted)return A;if(!pe(h.method))for(let F of R){if(N[F.route.id]?.type==="error")break;!N.hasOwnProperty(F.route.id)&&!g.loaderData.hasOwnProperty(F.route.id)&&(!g.errors||!g.errors.hasOwnProperty(F.route.id))&&F.shouldCallHandler()&&(N[F.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${F.route.id}`)})}for(let[F,O]of Object.entries(N))if(gi(O)){let U=O.result;A[F]={type:"redirect",response:di(U,h,F,R,s)}}else A[F]=await ci(O);return A}async function ea(h,p,R,x,L){let N=ht(R,x,h,L,null),A=Promise.all(p.map(async U=>{if(U.matches&&U.match&&U.request&&U.controller){let G=(await ht(U.request,U.path,U.matches,L,U.key))[U.match.route.id];return{[U.key]:G}}else return Promise.resolve({[U.key]:{type:"error",error:Me(404,{pathname:U.path})}})})),F=await N,O=(await A).reduce((U,j)=>Object.assign(U,j),{});return{loaderResults:F,fetcherResults:O}}function or(){Q=!0,I.forEach((h,p)=>{te.has(p)&&we.add(p),Ue(p)})}function $e(h,p,R={}){let x=new Map(g.fetchers);x.set(h,p),me({fetchers:x},{flushSync:(R&&R.flushSync)===!0})}function je(h,p,R,x={}){let L=Ve(g.matches,p),N=new Map(g.fetchers);ir(N,h),me({errors:{[L.route.id]:R},fetchers:N},{flushSync:(x&&x.flushSync)===!0})}function eo(h){return B.set(h,(B.get(h)||0)+1),Y.has(h)&&Y.delete(h),g.fetchers.get(h)||Qo}function to(h,p){Ue(h,p?.reason),$e(h,Ie(null))}function ir(h,p){let R=g.fetchers.get(p);te.has(p)&&!(R&&R.state==="loading"&&P.has(p))&&Ue(p),I.delete(p),P.delete(p),k.delete(p),Y.delete(p),we.delete(p),h.delete(p)}function ro(h){let p=(B.get(h)||0)-1;p<=0?(B.delete(h),Y.add(h)):B.set(h,p),me({fetchers:new Map(g.fetchers)})}function Ue(h,p){let R=te.get(h);R&&(R.abort(p),te.delete(h))}function ta(h,p){for(let R of h){let x=p.get(R);z(x,`Expected fetcher: ${R}`);let L=Ie(x.data);p.set(R,L)}}function ra(h){let p=[],R=!1;for(let x of k){let L=h.get(x);z(L,`Expected fetcher: ${x}`),L.state==="loading"&&(k.delete(x),p.push(x),R=!0)}return ta(p,h),R}function aa(h,p){let R=[];for(let[x,L]of P)if(L<h){let N=p.get(x);z(N,`Expected fetcher: ${x}`),N.state==="loading"&&(Ue(x),P.delete(x),R.push(x))}return ta(R,p),R.length>0}function ao(h,p){let R=g.blockers.get(h)||pt;return Z.get(h)!==p&&Z.set(h,p),R}function na(h){g.blockers.delete(h),Z.delete(h)}function Mt(h,p){let R=g.blockers.get(h)||pt;z(R.state==="unblocked"&&p.state==="blocked"||R.state==="blocked"&&p.state==="blocked"||R.state==="blocked"&&p.state==="proceeding"||R.state==="blocked"&&p.state==="unblocked"||R.state==="proceeding"&&p.state==="unblocked",`Invalid blocker state transition: ${R.state} -> ${p.state}`);let x=new Map(g.blockers);x.set(h,p),me({blockers:x})}function oa({currentLocation:h,nextLocation:p,historyAction:R}){if(Z.size===0)return;Z.size>1&&le(!1,"A router only supports one blocker at a time");let x=Array.from(Z.entries()),[L,N]=x[x.length-1],A=g.blockers.get(L);if(!(A&&A.state==="proceeding")&&N({currentLocation:h,nextLocation:p,historyAction:R}))return L}function lr(h){let p=Me(404,{pathname:h}),R=l.activeRoutes,{matches:x,route:L}=At(R);return{notFoundMatches:x,route:L,error:p}}function no(h,p,R){if(E=h,v=p,b=R||null,!C&&g.navigation===fr){C=!0;let x=la(g.location,g.matches);x!=null&&me({restoreScrollPosition:x})}return()=>{E=null,v=null,b=null}}function ia(h,p){return b&&b(h,p.map(x=>qa(x,g.loaderData)))||h.key}function oo(h,p){if(E&&v){let R=ia(h,p);E[R]=v()}}function la(h,p){if(E){let R=ia(h,p),x=E[R];if(typeof x=="number")return x}return null}function _t(h,p,R){if(e.patchRoutesOnNavigation){let x=l.branches;if(h){if(Object.keys(h[0].params).length>0)return{active:!0,matches:Te(p,R,s,!0,x)}}else return{active:!0,matches:Te(p,R,s,!0,x)||[]}}return{active:!1,matches:null}}async function Dt(h,p,R,x){if(!e.patchRoutesOnNavigation)return{type:"success",matches:h};let L=h;for(;;){let N=i;try{await e.patchRoutesOnNavigation({signal:R,path:p,matches:L,fetcherKey:x,patch:(U,j)=>{R.aborted||xa(U,j,l,N,o,!1)}})}catch(U){return{type:"error",error:U,partialMatches:L}}if(R.aborted)return{type:"aborted"};let A=l.branches,F=Te(l.activeRoutes,p,s,!1,A),O=null;if(F){if(Object.keys(F[0].params).length===0)return{type:"success",matches:F};if(O=Te(l.activeRoutes,p,s,!0,A),!(O&&L.length<O.length&&sa(L,O.slice(0,L.length))))return{type:"success",matches:F}}if(O||(O=Te(l.activeRoutes,p,s,!0,A)),!O||sa(L,O))return{type:"success",matches:null};L=O}}function sa(h,p){return h.length===p.length&&h.every((R,x)=>R.route.id===p[x].route.id)}function io(h){i={},l.setHmrRoutes(St(h,o,void 0,i))}function lo(h,p,R=!1){xa(h,p,l,i,o,R),l.hasHMRRoutes||me({})}return _={get basename(){return s},get future(){return f},get state(){return g},get routes(){return l.stableRoutes},get branches(){return l.branches},get manifest(){return i},get window(){return t},initialize:nr,subscribe:Vn,enableScrollRestoration:no,navigate:Qr,fetch:qn,revalidate:Jn,createHref:h=>e.history.createHref(h),encodeLocation:h=>e.history.encodeLocation(h),getFetcher:eo,resetFetcher:to,deleteFetcher:ro,dispose:Yn,getBlocker:ao,deleteBlocker:na,patchRoutes:lo,_internalFetchControllers:te,_internalSetRoutes:io,_internalSetStateDoNotUseOrYouWillBreakYourApp(h){me(h)}},e.instrumentations&&(_=Bo(_,e.instrumentations.map(h=>h.router).filter(Boolean))),_}function ti(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function wr(e,t,r,a,n,o){let i,l;if(n){i=[];for(let u of t)if(i.push(u),u.route.id===n){l=u;break}}else i=t,l=t[t.length-1];let s=Lt(a||".",Qt(i),Pe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(s.search=e.search,s.hash=e.hash),(a==null||a===""||a===".")&&l){let u=$r(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let f=new URLSearchParams(s.search),c=f.getAll("index");f.delete("index"),c.filter(w=>w).forEach(w=>f.append("index",w));let y=f.toString();s.search=y?`?${y}`:""}}return r!=="/"&&(s.pathname=No({basename:r,pathname:s.pathname})),De(s)}function ba(e,t,r){if(!r||!ti(r))return{path:t};if(r.formMethod&&!Ei(r.formMethod))return{path:t,error:Me(405,{method:r.formMethod})};let a=()=>({path:t,error:Me(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=gn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pe(o))return a();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((y,[w,E])=>`${y}${w}=${E}
`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!pe(o))return a();try{let c=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:c,text:void 0}}}catch{return a()}}}z(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=br(r.formData),s=r.formData;else if(r.body instanceof FormData)l=br(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=Ma(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=Ma(l)}catch{return a()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(pe(u.formMethod))return{path:t,submission:u};let f=Oe(t);return e&&f.search&&$r(f.search)&&l.append("index",""),f.search=`?${l}`,{path:De(f),submission:u}}function Sa(e,t,r,a,n,o,i,l,s,u,f,c,y,w,E,b,v,C,S,D,M,T){let $=M?xe(M[1])?M[1].error:M[1].data:void 0,_=n.createURL(o.location),g=n.createURL(s),J;if(f&&o.errors){let K=Object.keys(o.errors)[0];J=i.findIndex(Q=>Q.route.id===K)}else if(M&&xe(M[1])){let K=M[0];J=i.findIndex(Q=>Q.route.id===K)-1}let X=M?M[1].statusCode:void 0,ne=X&&X>=400,V={currentUrl:_,currentParams:o.matches[0]?.params||{},nextUrl:g,nextParams:i[0].params,...l,actionResult:$,actionStatus:X},se=Pt(i),ee=i.map((K,Q)=>{let{route:we}=K,te=null;if(J!=null&&Q>J)te=!1;else if(we.lazy)te=!0;else if(!Fr(we))te=!1;else if(f){let{shouldLoad:k}=dn(we,o.loaderData,o.errors);te=k}else ri(o.loaderData,o.matches[Q],K)&&(te=!0);if(te!==null)return Rr(r,a,e,s,se,K,u,t,te);let de=!1;typeof T=="boolean"?de=T:ne?de=!1:(c||_.pathname+_.search===g.pathname+g.search||_.search!==g.search||ai(o.matches[Q],K))&&(de=!0);let m={...V,defaultShouldRevalidate:de},P=Et(K,m);return Rr(r,a,e,s,se,K,u,t,P,m,T)}),ce=[];return E.forEach((K,Q)=>{if(f||!i.some(B=>B.route.id===K.routeId)||w.has(Q))return;let we=o.fetchers.get(Q),te=we&&we.state!=="idle"&&we.data===void 0,de=Te(v,K.path,C??"/",!1,D);if(!de){if(S&&te)return;ce.push({key:Q,routeId:K.routeId,path:K.path,matches:null,match:null,request:null,controller:null});return}if(b.has(Q))return;let m=Bt(de,K.path),P=new AbortController,k=it(n,K.path,P.signal),I=null;if(y.has(Q))y.delete(Q),I=st(r,a,k,K.path,de,m,u,t);else if(te)c&&(I=st(r,a,k,K.path,de,m,u,t));else{let B;typeof T=="boolean"?B=T:ne?B=!1:B=c;let Y={...V,defaultShouldRevalidate:B};Et(m,Y)&&(I=st(r,a,k,K.path,de,m,u,t,Y))}I&&ce.push({key:Q,routeId:K.routeId,path:K.path,matches:I,match:m,request:k,controller:P})}),{dsMatches:ee,revalidatingFetchers:ce}}function Fr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dn(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Fr(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function ri(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function ai(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Et(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function xa(e,t,r,a,n,o){let i;if(e){let u=a[e];z(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r.activeRoutes;let l=[],s=[];if(t.forEach(u=>{let f=i.find(c=>fn(u,c));f?s.push({existingRoute:f,newRoute:u}):l.push(u)}),l.length>0){let u=St(l,n,[e||"_","patch",String(i?.length||"0")],a);i.push(...u)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:f,newRoute:c}=s[u],y=f,[w]=St([c],n,[],{},!0);Object.assign(y,{element:w.element?w.element:y.element,errorElement:w.errorElement?w.errorElement:y.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:y.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function fn(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)=>t.children?.some(n=>fn(r,n)))??!1:!1}var La=new WeakMap,hn=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(z(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=La.get(n);i||(i={},La.set(n,i));let l=i[e];if(l)return l;let s=(async()=>{let u=wo(e),c=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)le(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)le(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(n,{[e]:y}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(y=>y===void 0)&&(n.lazy=void 0))})();return i[e]=s,s},Pa=new WeakMap;function ni(e,t,r,a,n){let o=r[e.id];if(z(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=Pa.get(o);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let c=(async()=>{z(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),w={};for(let E in y){let b=y[E];if(b===void 0)continue;let v=Eo(E),S=o[E]!==void 0&&E!=="hasErrorBoundary";v?le(!v,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?le(!S,`Route "${o.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):w[E]=b}Object.assign(o,w),Object.assign(o,{...a(o),lazy:void 0})})();return Pa.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let f of i){if(n&&n.includes(f))continue;let c=hn({key:f,route:e,manifest:r,mapRouteProperties:a});c&&(l.push(c),f===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u?.catch(()=>{}),s?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function Ca(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 oi(e){return e.matches.some(t=>t.route.middleware)?mn(e,()=>Ca(e)):Ca(e)}function mn(e,t){return ii(e,t,a=>{if(Ri(a))throw a;return a},yi,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===n),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=Ve(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:a}})}}}async function ii(e,t,r,a,n){let{matches:o,...i}=e,l=o.flatMap(u=>u.route.middleware?u.route.middleware.map(f=>[u.route.id,f]):[]);return await pn(i,l,t,r,a,n)}async function pn(e,t,r,a,n,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s)return await r();let[u,f]=s,c,y=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await pn(e,t,r,a,n,o,i+1)},c.value}catch(w){return c={value:await o(w,u,c)},c.value}};try{let w=await f(e,y),E=w!=null?a(w):void 0;return n(E)?E:c?E??c.value:(c={value:await y()},c.value)}catch(w){return await o(w,u,c)}}function yn(e,t,r,a,n){let o=hn({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=ni(a.route,pe(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Rr(e,t,r,a,n,o,i,l,s,u=null,f){let c=!1,y=yn(e,t,r,o,i);return{...o,_lazyPromises:y,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler(w){return c=!0,u?typeof f=="boolean"?Et(o,{...u,defaultShouldRevalidate:f}):typeof w=="boolean"?Et(o,{...u,defaultShouldRevalidate:w}):Et(o,u):s},resolve(w){let{lazy:E,loader:b,middleware:v}=o.route,C=c||s||w&&!pe(r.method)&&(E||b),S=v&&v.length>0&&!b&&!E;return C&&(pe(r.method)||!S)?si({request:r,path:a,pattern:n,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:w,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function st(e,t,r,a,n,o,i,l,s=null){return n.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:yn(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Rr(e,t,r,a,Pt(n),u,i,l,!0,s))}async function li(e,t,r,a,n,o,i){a.some(f=>f._lazyPromises?.middleware)&&await Promise.all(a.map(f=>f._lazyPromises?.middleware));let l={request:t,url:vn(t,r),pattern:Pt(a),params:a[0].params,context:o,matches:a},u=await e({...l,fetcherKey:n,runClientMiddleware:f=>{let c=l;return mn(c,()=>f({...c,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return u}async function si({request:e,path:t,pattern:r,match:a,lazyHandlerPromise:n,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let s,u,f=pe(e.method),c=f?"action":"loader",y=w=>{let E,b=new Promise((S,D)=>E=D);u=()=>E(),e.signal.addEventListener("abort",u);let v=S=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${a.route.id}]`)):w({request:e,url:vn(e,t),pattern:r,params:a.params,context:l},...S!==void 0?[S]:[]),C=(async()=>{try{return{type:"data",result:await(i?i(D=>v(D)):v())}}catch(S){return{type:"error",result:S}}})();return Promise.race([C,b])};try{let w=f?a.route.action:a.route.loader;if(n||o)if(w){let E,[b]=await Promise.all([y(w).catch(v=>{E=v}),n,o]);if(E!==void 0)throw E;s=b}else{await n;let E=f?a.route.action:a.route.loader;if(E)[s]=await Promise.all([y(E),o]);else if(c==="action"){let b=new URL(e.url),v=b.pathname+b.search;throw Me(405,{method:e.method,pathname:v,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(w)s=await y(w);else{let E=new URL(e.url),b=E.pathname+E.search;throw Me(404,{pathname:b})}}catch(w){return{type:"error",result:w}}finally{u&&e.signal.removeEventListener("abort",u)}return s}async function ui(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function ci(e){let{result:t,type:r}=e;if(Zt(t)){let a;try{a=await ui(t)}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new Ge(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?Sr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:pi(t),statusCode:et(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:et(t)?t.status:void 0}:Sr(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function di(e,t,r,a,n){let o=e.headers.get("Location");if(z(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ar(o)){let i=a.slice(0,a.findIndex(l=>l.route.id===r)+1);o=wr(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}var fi=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Er(e){try{return fi.includes(new URL(e).protocol)}catch{return!1}}function Ta(e,t,r,a){if(Ar(e)){let n=e,o=kr.test(n)?new URL(Ga(n,t.protocol)):new URL(n);if(Er(o.toString()))throw new Error("Invalid redirect location");let i=Pe(o.pathname,r)!=null;if(o.origin===t.origin&&i)return Ir(o.pathname)+o.search+o.hash}try{let n=a.createURL(e);if(Er(n.toString()))throw new Error("Invalid redirect location")}catch{}return e}function it(e,t,r,a){let n=e.createURL(gn(t)).toString(),o={signal:r};if(a&&pe(a.formMethod)){let{formMethod:i,formEncType:l}=a;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(a.json)):l==="text/plain"?o.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?o.body=br(a.formData):o.body=a.formData}return new Request(n,o)}function vn(e,t){let r=new URL(e.url),a=typeof t=="string"?Oe(t):t;if(r.pathname=a.pathname||"/",a.search){let n=new URLSearchParams(a.search),o=n.getAll("index");n.delete("index");for(let i of o.filter(Boolean))n.append("index",i);r.search=n.size?`?${n.toString()}`:""}else r.search="";return r.hash=a.hash||"",r}function br(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Ma(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function hi(e,t,r,a=!1,n=!1){let o={},i=null,l,s=!1,u={},f=r&&xe(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let y=c.route.id,w=t[y];if(z(!Ze(w),"Cannot handle redirect results in processLoaderData"),xe(w)){let E=w.error;if(f!==void 0&&(E=f,f=void 0),i=i||{},n)i[y]=E;else{let b=Ve(e,y);i[b.route.id]==null&&(i[b.route.id]=E)}a||(o[y]=cn),s||(s=!0,l=et(w.error)?w.error.status:500),w.headers&&(u[y]=w.headers)}else o[y]=w.data,w.statusCode&&w.statusCode!==200&&!s&&(l=w.statusCode),w.headers&&(u[y]=w.headers)}),f!==void 0&&r&&(i={[r[0]]:f},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function _a(e,t,r,a,n,o,i){let{loaderData:l,errors:s}=hi(t,r,a);return n.filter(u=>!u.matches||u.matches.some(f=>f.shouldLoad)).forEach(u=>{let{key:f,match:c,controller:y}=u;if(y&&y.signal.aborted)return;let w=o[f];if(z(w,"Did not find corresponding fetcher result"),xe(w)){let E=Ve(e.matches,c?.route.id);s&&s[E.route.id]||(s={...s,[E.route.id]:w.error}),i.delete(f)}else if(Ze(w))z(!1,"Unhandled fetcher revalidation redirect");else{let E=Ie(w.data);i.set(f,E)}}),{loaderData:l,errors:s}}function Da(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==cn).reduce((o,[i,l])=>(o[i]=l,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(n[i]=e[i]),a&&a.hasOwnProperty(i))break}return n}function Oa(e){return e?xe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ve(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 At(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 Me(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?l=`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"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?l=`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&&(l=`Invalid request method "${a.toUpperCase()}"`)),new Ge(e||500,i,new Error(l),!0)}function It(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ze(n))return{key:a,result:n}}}function gn(e){let t=typeof e=="string"?Oe(e):e;return De({...t,hash:""})}function mi(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function pi(e){return new Ge(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function yi(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&vi(r))}function vi(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function gi(e){return Zt(e.result)&&sn.has(e.result.status)}function xe(e){return e.type==="error"}function Ze(e){return(e&&e.type)==="redirect"}function Sr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Zt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wi(e){return sn.has(e)}function Ri(e){return Zt(e)&&wi(e.status)&&e.headers.has("Location")}function Ei(e){return Ko.has(e.toUpperCase())}function pe(e){return Go.has(e.toUpperCase())}function $r(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Bt(e,t){let r=typeof t=="string"?Oe(t).search:t.search;if(e[e.length-1].route.index&&$r(r||""))return e[e.length-1];let a=tn(e);return a[a.length-1]}function ka(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}}}function hr(e,t,r,a){return a?{state:"loading",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bi(e,t,r,a){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function yt(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 Si(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 Ie(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 xi(e,t){try{let r=e.sessionStorage.getItem(un);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 Li(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(un,JSON.stringify(r))}catch(a){le(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Na(){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 tt=d.createContext(null);tt.displayName="DataRouter";var ut=d.createContext(null);ut.displayName="DataRouterState";var wn=d.createContext(!1);function jr(){return d.useContext(wn)}var Ur=d.createContext({isTransitioning:!1});Ur.displayName="ViewTransition";var Rn=d.createContext(new Map);Rn.displayName="Fetchers";var Pi=d.createContext(null);Pi.displayName="Await";var ge=d.createContext(null);ge.displayName="Navigation";var ct=d.createContext(null);ct.displayName="Location";var _e=d.createContext({outlet:null,matches:[],isDataRoute:!1});_e.displayName="Route";var Hr=d.createContext(null);Hr.displayName="RouteError";var En="REACT_ROUTER_ERROR",Ci="REDIRECT",Ti="ROUTE_ERROR_RESPONSE";function Mi(e){if(e.startsWith(`${En}:${Ci}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function _i(e){if(e.startsWith(`${En}:${Ti}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ge(t.status,t.statusText,t.data)}catch{}}function Di(e,{relative:t}={}){z(dt(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=d.useContext(ge),{hash:n,pathname:o,search:i}=Ct(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Le([r,o])),a.createHref({pathname:l,search:i,hash:n})}function dt(){return d.useContext(ct)!=null}function Se(){return z(dt(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(ct).location}function $s(){return d.useContext(ct).navigationType}var bn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Sn(e){d.useContext(ge).static||d.useLayoutEffect(e)}function zr(){let{isDataRoute:e}=d.useContext(_e);return e?Ji():Oi()}function Oi(){z(dt(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(tt),{basename:t,navigator:r}=d.useContext(ge),{matches:a}=d.useContext(_e),{pathname:n}=Se(),o=JSON.stringify(Qt(a)),i=d.useRef(!1);return Sn(()=>{i.current=!0}),d.useCallback((s,u={})=>{if(le(i.current,bn),!i.current)return;if(typeof s=="number"){r.go(s);return}let f=Lt(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Le([t,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[t,r,o,n,e])}var ki=d.createContext(null);function Ni(e){let t=d.useContext(_e).outlet;return d.useMemo(()=>t&&d.createElement(ki.Provider,{value:e},t),[t,e])}function Ai(){let{matches:e}=d.useContext(_e);return e[e.length-1]?.params??{}}function Ct(e,{relative:t}={}){let{matches:r}=d.useContext(_e),{pathname:a}=Se(),n=JSON.stringify(Qt(r));return d.useMemo(()=>Lt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Ii(e,t){return xn(e,t)}function xn(e,t,r){z(dt(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=d.useContext(ge),{matches:n}=d.useContext(_e),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;{let v=u&&u.path||"";Tn(l,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${v}">) 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="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let f=Se(),c;if(t){let v=typeof t=="string"?Oe(t):t;z(s==="/"||v.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${v.pathname}" was given in the \`location\` prop.`),c=v}else c=f;let y=c.pathname||"/",w=y;if(s!=="/"){let v=s.replace(/^\//,"").split("/");w="/"+y.replace(/^\//,"").split("/").slice(v.length).join("/")}let E=r&&r.state.matches.length?r.state.matches.map(v=>Object.assign(v,{route:r.manifest[v.route.id]||v.route})):Ka(e,{pathname:w});le(u||E!=null,`No routes matched location "${c.pathname}${c.search}${c.hash}" `),le(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${c.pathname}${c.search}${c.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.`);let b=Hi(E&&E.map(v=>Object.assign({},v,{params:Object.assign({},i,v.params),pathname:Le([s,a.encodeLocation?a.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?s:Le([s,a.encodeLocation?a.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),n,r);return t&&b?d.createElement(ct.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...c},navigationType:"POP"}},b):b}function Fi(){let e=Cn(),t=et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=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,i)}var $i=d.createElement(Fi,null),Ln=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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=_i(e.digest);r&&(e=r)}let t=e!==void 0?d.createElement(_e.Provider,{value:this.props.routeContext},d.createElement(Hr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(ji,{error:e},t):t}};Ln.contextType=wn;var mr=new WeakMap;function ji({children:e,error:t}){let{basename:r}=d.useContext(ge);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Mi(t.digest);if(a){let n=mr.get(t);if(n)throw n;let o=nn(a.location,r),i=o.absoluteURL||o.to;if(Er(i))throw new Error("Invalid redirect location");if(an&&!mr.get(t))if(o.isExternal||a.reloadDocument)window.location.href=i;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw mr.set(t,l),l}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i}`})}}return e}function Ui({routeContext:e,match:t,children:r}){let a=d.useContext(tt);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(_e.Provider,{value:e},r)}function Hi(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let f=n.findIndex(c=>c.route.id&&o?.[c.route.id]!==void 0);z(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,f+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let f=0;f<n.length;f++){let c=n[f];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=f),c.route.id){let{loaderData:y,errors:w}=a,E=c.route.loader&&!y.hasOwnProperty(c.route.id)&&(!w||w[c.route.id]===void 0);if(c.route.lazy||E){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(f,c)=>{s(f,{location:a.location,params:a.matches?.[0]?.params??{},pattern:Pt(a.matches),errorInfo:c})}:void 0;return n.reduceRight((f,c,y)=>{let w,E=!1,b=null,v=null;a&&(w=o&&c.route.id?o[c.route.id]:void 0,b=c.route.errorElement||$i,i&&(l<0&&y===0?(Tn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,v=null):l===y&&(E=!0,v=c.route.hydrateFallbackElement||null)));let C=t.concat(n.slice(0,y+1)),S=()=>{let D;return w?D=b:E?D=v:c.route.Component?D=d.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=f,d.createElement(Ui,{match:c,routeContext:{outlet:f,matches:C,isDataRoute:a!=null},children:D})};return a&&(c.route.ErrorBoundary||c.route.errorElement||y===0)?d.createElement(Ln,{location:a.location,revalidation:a.revalidation,component:b,error:w,children:S(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:u}):S()},null)}function Br(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pn(e){let t=d.useContext(tt);return z(t,Br(e)),t}function ft(e){let t=d.useContext(ut);return z(t,Br(e)),t}function zi(e){let t=d.useContext(_e);return z(t,Br(e)),t}function Tt(e){let t=zi(e),r=t.matches[t.matches.length-1];return z(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Bi(){return Tt("useRouteId")}function Wi(){let e=ft("useNavigation");return d.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function js(){let e=Pn("useRevalidator"),t=ft("useRevalidator"),r=d.useCallback(async()=>{await e.router.revalidate()},[e.router]);return d.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function Wr(){let{matches:e,loaderData:t}=ft("useMatches");return d.useMemo(()=>e.map(r=>qa(r,t)),[e,t])}function Yi(){let e=ft("useLoaderData"),t=Tt("useLoaderData");return e.loaderData[t]}function Vi(){let e=ft("useActionData"),t=Tt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Cn(){let e=d.useContext(Hr),t=ft("useRouteError"),r=Tt("useRouteError");return e!==void 0?e:t.errors?.[r]}function Ji(){let{router:e}=Pn("useNavigate"),t=Tt("useNavigate"),r=d.useRef(!1);return Sn(()=>{r.current=!0}),d.useCallback(async(n,o={})=>{le(r.current,bn),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Aa={};function Tn(e,t,r){!t&&!Aa[e]&&(Aa[e]=!0,le(!1,r))}var Ia={};function xr(e,t){!e&&!Ia[t]&&(Ia[t]=!0,console.warn(t))}var Gi="useOptimistic",Fa=po[Gi],Xi=()=>{};function Ki(e){return Fa?Fa(e):[e,Xi]}function Us(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&le(!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&&le(!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&&le(!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 Hs=["HydrateFallback","hydrateFallbackElement"],qi=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 zs({router:e,flushSync:t,onError:r,useTransitions:a}){a=jr()||a;let[o,i]=d.useState(e.state),[l,s]=Ki(o),[u,f]=d.useState(),[c,y]=d.useState({isTransitioning:!1}),[w,E]=d.useState(),[b,v]=d.useState(),[C,S]=d.useState(),D=d.useRef(new Map),M=d.useCallback((g,{deletedFetchers:J,newErrors:X,flushSync:ne,viewTransitionOpts:V})=>{X&&r&&Object.values(X).forEach(ee=>r(ee,{location:g.location,params:g.matches[0]?.params??{},pattern:Pt(g.matches)})),g.fetchers.forEach((ee,ce)=>{ee.data!==void 0&&D.current.set(ce,ee.data)}),J.forEach(ee=>D.current.delete(ee)),xr(ne===!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 se=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(xr(V==null||se,"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."),!V||!se){t&&ne?t(()=>i(g)):a===!1?i(g):d.startTransition(()=>{a===!0&&s(ee=>$a(ee,g)),i(g)});return}if(t&&ne){t(()=>{b&&(w?.resolve(),b.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let ee=e.window.document.startViewTransition(()=>{t(()=>i(g))});ee.finished.finally(()=>{t(()=>{E(void 0),v(void 0),f(void 0),y({isTransitioning:!1})})}),t(()=>v(ee));return}b?(w?.resolve(),b.skipTransition(),S({state:g,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(f(g),y({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[e.window,t,b,w,a,s,r]);d.useLayoutEffect(()=>e.subscribe(M),[e,M]),d.useEffect(()=>{c.isTransitioning&&!c.flushSync&&E(new qi)},[c]),d.useEffect(()=>{if(w&&u&&e.window){let g=u,J=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?i(g):d.startTransition(()=>{a===!0&&s(ne=>$a(ne,g)),i(g)}),await J});X.finished.finally(()=>{E(void 0),v(void 0),f(void 0),y({isTransitioning:!1})}),v(X)}},[u,w,e.window,a,s]),d.useEffect(()=>{w&&u&&l.location.key===u.location.key&&w.resolve()},[w,b,l.location,u]),d.useEffect(()=>{!c.isTransitioning&&C&&(f(C.state),y({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}),S(void 0))},[c.isTransitioning,C]);let T=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:g=>e.navigate(g),push:(g,J,X)=>e.navigate(g,{state:J,preventScrollReset:X?.preventScrollReset}),replace:(g,J,X)=>e.navigate(g,{replace:!0,state:J,preventScrollReset:X?.preventScrollReset})}),[e]),$=e.basename||"/",_=d.useMemo(()=>({router:e,navigator:T,static:!1,basename:$,onError:r}),[e,T,$,r]);return d.createElement(d.Fragment,null,d.createElement(tt.Provider,{value:_},d.createElement(ut.Provider,{value:l},d.createElement(Rn.Provider,{value:D.current},d.createElement(Ur.Provider,{value:c},d.createElement(tl,{basename:$,location:l.location,navigationType:l.historyAction,navigator:T,useTransitions:a},d.createElement(Qi,{routes:e.routes,manifest:e.manifest,future:e.future,state:l,isStatic:!1,onError:r})))))),null)}function $a(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Qi=d.memo(Zi);function Zi({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return xn(e,void 0,{manifest:t,state:a,isStatic:n,onError:o})}function Bs({to:e,replace:t,state:r,relative:a}){z(dt(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=d.useContext(ge);le(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=d.useContext(_e),{pathname:i}=Se(),l=zr(),s=Lt(e,Qt(o),i,a==="path"),u=JSON.stringify(s);return d.useEffect(()=>{l(JSON.parse(u),{replace:t,state:r,relative:a})},[l,u,a,t,r]),null}function Ws(e){return Ni(e.context)}function el(e){z(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tl({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){z(!dt(),"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,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=Oe(r));let{pathname:u="/",search:f="",hash:c="",state:y=null,key:w="default",mask:E}=r,b=d.useMemo(()=>{let v=Pe(u,l);return v==null?null:{location:{pathname:v,search:f,hash:c,state:y,key:w,mask:E},navigationType:a}},[l,u,f,c,y,w,a,E]);return le(b!=null,`<Router basename="${l}"> is not able to match the URL "${u}${f}${c}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:d.createElement(ge.Provider,{value:s},d.createElement(ct.Provider,{children:t,value:b}))}function Ys({children:e,location:t}){return Ii(Lr(e),t)}function Lr(e,t=[]){let r=[];return d.Children.forEach(e,(a,n)=>{if(!d.isValidElement(a))return;let o=[...t,n];if(a.type===d.Fragment){r.push.apply(r,Lr(a.props.children,o));return}z(a.type===el,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),z(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=Lr(a.props.children,o)),r.push(i)}),r}function rl(){return{params:Ai(),loaderData:Yi(),actionData:Vi(),matches:Wr()}}function Vs(e){return function(){const r=rl();return d.createElement(e,r)}}var Wt="get",Yt="application/x-www-form-urlencoded";function er(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function al(e){return er(e)&&e.tagName.toLowerCase()==="button"}function nl(e){return er(e)&&e.tagName.toLowerCase()==="form"}function ol(e){return er(e)&&e.tagName.toLowerCase()==="input"}function il(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ll(e,t){return e.button===0&&(!t||t==="_self")&&!il(e)}function Pr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function sl(e,t){let r=Pr(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var Ft=null;function ul(){if(Ft===null)try{new FormData(document.createElement("form"),0),Ft=!1}catch{Ft=!0}return Ft}var cl=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pr(e){return e!=null&&!cl.has(e)?(le(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yt}"`),null):e}function dl(e,t){let r,a,n,o,i;if(nl(e)){let l=e.getAttribute("action");a=l?Pe(l,t):null,r=e.getAttribute("method")||Wt,n=pr(e.getAttribute("enctype"))||Yt,o=new FormData(e)}else if(al(e)||ol(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?Pe(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||Wt,n=pr(e.getAttribute("formenctype"))||pr(l.getAttribute("enctype"))||Yt,o=new FormData(l,e),!ul()){let{name:u,type:f,value:c}=e;if(f==="image"){let y=u?`${u}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else u&&o.append(u,c)}}else{if(er(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Wt,a=null,n=Yt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var fl=-1,hl=-2,ml=-3,pl=-4,yl=-5,vl=-6,gl=-7,wl="B",Rl="D",Mn="E",El="M",bl="N",_n="P",Sl="R",xl="S",Ll="Y",Pl="U",Cl="Z",Dn=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Tl(){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 i of o)a.enqueue(i)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $t=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function Cr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return ja.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,ja.call(this,a)}function ja(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const i=[[e,s=>{o=s}]];let l=[];for(;i.length>0;){const[s,u]=i.pop();switch(s){case gl:u(void 0);continue;case yl:u(null);continue;case hl:u(NaN);continue;case vl:u(1/0);continue;case ml:u(-1/0);continue;case pl:u(-0);continue}if(t[s]){u(t[s]);continue}const f=r[s];if(!f||typeof f!="object"){t[s]=f,u(f);continue}if(Array.isArray(f))if(typeof f[0]=="string"){const[c,y,w]=f;switch(c){case Rl:u(t[s]=new Date(y));continue;case Pl:u(t[s]=new URL(y));continue;case wl:u(t[s]=BigInt(y));continue;case Sl:u(t[s]=new RegExp(y,w));continue;case Ll:u(t[s]=Symbol.for(y));continue;case xl:const E=new Set;t[s]=E;for(let M=f.length-1;M>0;M--)i.push([f[M],T=>{E.add(T)}]);u(E);continue;case El:const b=new Map;t[s]=b;for(let M=f.length-2;M>0;M-=2){const T=[];i.push([f[M+1],$=>{T[1]=$}]),i.push([f[M],$=>{T[0]=$}]),l.push(()=>{b.set(T[0],T[1])})}u(b);continue;case bl:const v=Object.create(null);t[s]=v;for(const M of Object.keys(y).reverse()){const T=[];i.push([y[M],$=>{T[1]=$}]),i.push([Number(M.slice(1)),$=>{T[0]=$}]),l.push(()=>{v[T[0]]=T[1]})}u(v);continue;case _n:if(t[y])u(t[s]=t[y]);else{const M=new Dn;a[y]=M,u(t[s]=M.promise)}continue;case Mn:const[,C,S]=f;let D=S&&$t&&rn.includes(S)&&S in $t&&typeof $t[S]=="function"?new $t[S](C):new Error(C);t[s]=D,u(D);continue;case Cl:u(t[s]=t[y]);continue;default:if(Array.isArray(n)){const M=[],T=f.slice(1);for(let $=0;$<T.length;$++){const _=T[$];i.push([_,g=>{M[$]=g}])}l.push(()=>{for(const $ of n){const _=$(f[0],...M);if(_){u(t[s]=_.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[s]=c;for(let y=0;y<f.length;y++){const w=f[y];w!==fl&&i.push([w,E=>{c[y]=E}])}u(c);continue}else{const c={};t[s]=c;for(const y of Object.keys(f).reverse()){const w=[];i.push([f[y],E=>{w[1]=E}]),i.push([Number(y.slice(1)),E=>{w[0]=E}]),l.push(()=>{c[w[0]]=w[1]})}u(c);continue}}for(;l.length>0;)l.pop()();return o}async function Ml(e,t){const{plugins:r}=t??{},a=new Dn,n=e.pipeThrough(Tl()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},i=await _l.call(o,n);let l=a.promise;return i.done?a.resolve():l=Dl.call(o,n).then(a.resolve).catch(s=>{for(const u of Object.values(o.deferred))u.reject(s);a.reject(s)}),{done:l.then(()=>n.closed),value:i.value}}async function _l(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:Cr.call(this,r)}}async function Dl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case _n:{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 i=r.slice(a+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=Cr.call(this,l);o.resolve(s);break}case Mn:{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 i=r.slice(a+1);let l;try{l=JSON.parse(i)}catch{throw new SyntaxError}const s=Cr.call(this,l);o.reject(s);break}default:throw new SyntaxError}t=await e.read()}}async function Ol(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 kl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Nl=/[&><\u2028\u2029]/g;function Tr(e){return e.replace(Nl,t=>kl[t])}function ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Mr=Symbol("SingleFetchRedirect"),On=class extends Error{},Al=202,Il=new Set([100,101,204,205]);function Js(e,t,r,a,n,o){let i=Fl(e,l=>{let s=t.routes[l.route.id];return ve(s,"Route not found in manifest"),{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader}},Wl,a,n,o);return async l=>l.runClientMiddleware(i)}function Fl(e,t,r,a,n,o,i=()=>!0){return async l=>{let{request:s,matches:u,fetcherKey:f}=l,c=e();if(s.method!=="GET")return $l(l,r,n,o);let y=u.some(w=>{let{hasLoader:E,hasClientLoader:b}=t(w);return w.shouldCallHandler()&&E&&!b});return!a&&!y?jl(l,t,r,n,o):f?zl(l,r,n,o):Ul(l,c,t,r,a,n,o,i)}}async function $l(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());ve(n,"No action match found");let o,i=await n.resolve(async l=>await l(async()=>{let{data:u,status:f}=await t(e,r,a,[n.route.id]);return o=f,xt(u,n.route.id)}));return Zt(i.result)||et(i.result)||Sr(i.result)?{[n.route.id]:i}:{[n.route.id]:{type:i.type,result:Uo(i.result,o)}}}async function jl(e,t,r,a,n){let o=e.matches.filter(l=>l.shouldCallHandler()),i={};return await Promise.all(o.map(l=>l.resolve(async s=>{try{let{hasClientLoader:u}=t(l),f=l.route.id,c=u?await s(async()=>{let{data:y}=await r(e,a,n,[f]);return xt(y,f)}):await s();i[l.route.id]={type:"data",result:c}}catch(u){i[l.route.id]={type:"error",result:u}}}))),i}async function Ul(e,t,r,a,n,o,i,l=()=>!0){let s=new Set,u=!1,f=e.matches.map(()=>Ua()),c=Ua(),y={},w=Promise.all(e.matches.map(async(b,v)=>b.resolve(async C=>{f[v].resolve();let S=b.route.id,{hasLoader:D,hasClientLoader:M}=r(b),T=!b.shouldRevalidateArgs||b.shouldRevalidateArgs.actionStatus==null||b.shouldRevalidateArgs.actionStatus<400;if(!b.shouldCallHandler(T)){u||(u=b.shouldRevalidateArgs!=null&&D);return}if(l(b)&&M){D&&(u=!0);try{let _=await C(async()=>{let{data:g}=await a(e,o,i,[S]);return xt(g,S)});y[S]={type:"data",result:_}}catch(_){y[S]={type:"error",result:_}}return}D&&s.add(S);try{let _=await C(async()=>{let g=await c.promise;return xt(g,S)});y[S]={type:"data",result:_}}catch(_){y[S]={type:"error",result:_}}})));if(await Promise.all(f.map(b=>b.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)c.resolve({routes:{}});else{let b=n&&u&&s.size>0?[...s.keys()]:void 0;try{let v=await a(e,o,i,b);c.resolve(v.data)}catch(v){c.reject(v)}}return await w,await Hl(c.promise,e.matches,s,y),y}async function Hl(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let i of t)if(i.route.id in o.routes){let l=o.routes[i.route.id];if("error"in l){n=l.error,a[i.route.id]?.result==null&&(a[i.route.id]={type:"error",result:n});break}}}n!==void 0&&Array.from(r.values()).forEach(i=>{a[i].result instanceof On&&(a[i].result=n)})}catch{}}async function zl(e,t,r,a){let n=e.matches.find(l=>l.shouldCallHandler());ve(n,"No fetcher match found");let o=n.route.id,i=await n.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,a,[o]);return xt(s,o)}));return{[n.route.id]:i}}function Bl(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 Yr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&Pe(n.pathname,t)==="/"?n.pathname=`${Gt(t)}/_root.${a}`:n.pathname=`${Gt(n.pathname)}.${a}`,n}async function Wl(e,t,r,a){let{request:n}=e,o=Yr(n.url,t,r,"data");n.method==="GET"&&(o=Bl(o),a&&o.searchParams.set("_routes",a.join(",")));let i=await fetch(o,await Ol(n));if(i.status>=400&&!i.headers.has("X-Remix-Response"))throw new Ge(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has("X-Remix-Redirect"))return{status:Al,data:{redirect:{redirect:i.headers.get("X-Remix-Redirect"),status:Number(i.headers.get("X-Remix-Status")||"302"),revalidate:i.headers.get("X-Remix-Revalidate")==="true",reload:i.headers.get("X-Remix-Reload-Document")==="true",replace:i.headers.get("X-Remix-Replace")==="true"}}};if(Il.has(i.status)){let l={};return a&&n.method!=="GET"&&(l[a[0]]={data:void 0}),{status:i.status,data:{routes:l}}}ve(i.body,"No response body to decode");try{let l=await Yl(i.body,window),s;if(n.method==="GET"){let u=l.value;Mr in u?s={redirect:u[Mr]}:s={routes:u}}else{let u=l.value,f=a?.[0];ve(f,"No routeId found for single fetch call decoding"),"redirect"in u?s={redirect:u}:s={routes:{[f]:u}}}return{status:i.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Yl(e,t){return Ml(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,i]=a,l=Error;n&&rn.includes(n)&&n in t&&typeof t[n]=="function"&&(l=t[n]);let s=new l(o);return s.stack=i,{value:s}}if(r==="ErrorResponse"){let[n,o,i]=a;return{value:new Ge(o,i,n)}}if(r==="SingleFetchRedirect")return{value:{[Mr]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function xt(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:i,status:l}=e.redirect;throw Ho(a,{status:l,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new On(`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 Ua(){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}}async function kn(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 Vl(e,t,r){let a=e.map(o=>{let i=t[o.route.id],l=r.routes[o.route.id];return[l&&l.css?l.css.map(s=>({rel:"stylesheet",href:s})):[],i?.links?.()||[]]}).flat(2),n=Jr(e,r);return Fn(a,n)}function Nn(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Jl(e){if(!e.css)return;let t=Nn(e);await Promise.all(t.map(In))}async function An(e,t){if(!e.css&&!t.links||!Ql())return;let r=[];if(e.css&&r.push(...Nn(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!Vr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(In))}async function In(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 Vr(e){return e!=null&&typeof e.page=="string"}function Gl(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 Xl(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await kn(o,r);return i.links?i.links():[]}return[]}));return Fn(a.flat(1).filter(Gl).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Ha(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let f=a.routes[s.route.id];if(!f||!f.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let c=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof c=="boolean")return c}return!0}):[]}function Jr(e,t,{includeHydrateFallback:r}={}){return Kl(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 Kl(e){return[...new Set(e)]}function ql(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Fn(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Vr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(ql(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}var jt;function Ql(){if(jt!==void 0)return jt;let e=document.createElement("link");return jt=e.relList.supports("preload"),e=null,jt}function Zl(){let{nonce:e}=Fe();return d.createElement(_r,{title:"Loading...",renderScripts:!0},d.createElement("script",{nonce:e,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 $n(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 es(e,t,r){let a=jn(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?Zl:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(zn,{error:Cn()}):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 Gs(e,t,r,a,n,o){return Gr(t,r,a,n,o,"",$n(t),e)}function Ut(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 Ge(400,"Bad Request",new Error(a),!0)}}function yr(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 Ge(405,"Method Not Allowed",new Error(a),!0)}function Gr(e,t,r,a,n,o="",i=$n(e),l){return(i[o]||[]).map(s=>{let u=t[s.id];function f(S){return ve(typeof S=="function","No single fetch function available for route handler"),S()}function c(S){return s.hasLoader?f(S):Promise.resolve(null)}function y(S){if(!s.hasAction)throw yr("action",s.id);return f(S)}function w(S){import(S)}function E(S){S.clientActionModule&&w(S.clientActionModule),S.clientLoaderModule&&w(S.clientLoaderModule)}async function b(S){let D=t[s.id],M=D?An(s,D):Promise.resolve();try{return S()}finally{await M}}let v={id:s.id,index:s.index,path:s.path};if(u){Object.assign(v,{...v,...es(s,u,n),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:za(v.path,u,s,a,l)});let S=r&&r.loaderData&&s.id in r.loaderData,D=S?r?.loaderData?.[s.id]:void 0,M=r&&r.errors&&s.id in r.errors,T=M?r?.errors?.[s.id]:void 0,$=l==null&&(u.clientLoader?.hydrate===!0||!s.hasLoader);v.loader=async({request:_,params:g,context:J,pattern:X,url:ne},V)=>{let se=$;return $=!1,await b(async()=>(ve(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:_,params:g,context:J,pattern:X,url:ne,async serverLoader(){if(Ut("loader",s),se){if(S)return D;if(M)throw T}return c(V)}}):c(V)))},v.loader.hydrate=as(s.id,u.clientLoader,s.hasLoader,n),v.action=({request:_,params:g,context:J,pattern:X,url:ne},V)=>b(async()=>{if(ve(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw yr("clientAction",s.id);return y(V)}return u.clientAction({request:_,params:g,context:J,pattern:X,url:ne,async serverAction(){return Ut("action",s),y(V)}})})}else{s.hasClientLoader||(v.loader=(M,T)=>b(()=>c(T))),s.hasClientAction||(v.action=(M,T)=>b(()=>{if(n)throw yr("clientAction",s.id);return y(T)}));let S;async function D(){return S?await S:(S=(async()=>{(s.clientLoaderModule||s.clientActionModule)&&await new Promise(T=>setTimeout(T,0));let M=rs(s,t);return E(s),await M})(),await S)}v.lazy={loader:s.hasClientLoader?async()=>{let{clientLoader:M}=s.clientLoaderModule?await import(s.clientLoaderModule):await D();return ve(M,"No `clientLoader` export found"),(T,$)=>M({...T,async serverLoader(){return Ut("loader",s),c($)}})}:void 0,action:s.hasClientAction?async()=>{let M=s.clientActionModule?import(s.clientActionModule):D();E(s);let{clientAction:T}=await M;return ve(T,"No `clientAction` export found"),($,_)=>T({...$,async serverAction(){return Ut("action",s),y(_)}})}:void 0,middleware:s.hasClientMiddleware?async()=>{let{clientMiddleware:M}=s.clientMiddlewareModule?await import(s.clientMiddlewareModule):await D();return ve(M,"No `clientMiddleware` export found"),M}:void 0,shouldRevalidate:async()=>{let M=await D();return za(v.path,M,s,a,l)},handle:async()=>(await D()).handle,Component:async()=>(await D()).Component,ErrorBoundary:s.hasErrorBoundary?async()=>(await D()).ErrorBoundary:void 0}}let C=Gr(e,t,r,a,n,s.id,i,l);return C.length>0&&(v.children=C),v})}function za(e,t,r,a,n){if(n)return ts(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?Nr(e)[1].map(l=>l.paramName):[];const i=l=>o.some(s=>l.currentParams[s]!==l.nextParams[s]);if(t.shouldRevalidate){let l=t.shouldRevalidate;return s=>l({...s,defaultShouldRevalidate:i(s)})}else return l=>i(l)}return t.shouldRevalidate}function ts(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function rs(e,t){let r=kn(e,t),a=Jl(e),n=await r;return await Promise.all([a,An(e,n)]),{Component:jn(n),ErrorBoundary:n.ErrorBoundary,clientMiddleware:n.clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function jn(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function as(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Vt=new Set,ns=1e3,Xt=new Set,os=7680;function is(e){let t=new Set;return e.forEach(r=>{r.startsWith("/")||(r=`/${r}`);for(let a=1;a<r.length;a++)r[a]==="/"&&t.add(r.slice(0,a));t.add(r)}),Array.from(t)}function Xr(e,t){return e.mode==="lazy"&&t===!0}function ls({sri:e,...t},r){let a=new Set(r.state.matches.map(l=>l.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(l=>{let s=Te(r.routes,l,r.basename||"/",!1,r.branches);s&&s.forEach(u=>a.add(u.route.id))});let i=[...a].reduce((l,s)=>Object.assign(l,{[s]:t.routes[s]}),{});return{...t,routes:i,sri:e?!0:void 0}}function Xs(e,t,r,a,n,o,i){if(Xr(n,a))return async({path:l,patch:s,signal:u,fetcherKey:f})=>{if(Xt.has(l))return;let{state:c}=e();await Un([l],f?window.location.href:De(c.navigation.location||c.location),t,r,a,o,i,n.manifestPath,s,u)}}function Ks(e,t,r,a,n,o){d.useEffect(()=>{if(!Xr(n,a)||window.navigator?.connection?.saveData===!0)return;function i(f){let c=f.tagName==="FORM"?f.getAttribute("action"):f.getAttribute("href");if(!c)return;let y=f.tagName==="A"?f.pathname:new URL(c,window.location.origin).pathname;Xt.has(y)||Vt.add(y)}async function l(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let f=Array.from(Vt.keys()).filter(c=>Xt.has(c)?(Vt.delete(c),!1):!0);if(f.length!==0)try{await Un(f,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(c){console.error("Failed to fetch manifest patches",c)}}let s=cs(l,100);l();let u=new MutationObserver(()=>s());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 ss(e,t){let r=e||"/__manifest";return t==null?r:Le([t,r])}var vr="react-router-manifest-version";async function Un(e,t,r,a,n,o,i,l,s,u){e=is(e);const f=new URLSearchParams;f.set("paths",e.sort().join(",")),f.set("version",r.version);let c=new URL(ss(l,i),window.location.origin);if(c.search=f.toString(),c.toString().length>os){Vt.clear();return}let y;try{let v=await fetch(c,{signal:u});if(v.ok){if(v.status===204&&v.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}try{if(sessionStorage.getItem(vr)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(vr,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(v.status>=400)throw new Error(await v.text())}else throw new Error(`${v.status} ${v.statusText}`);try{sessionStorage.removeItem(vr)}catch{}y=await v.json()}catch(v){if(u?.aborted)return;throw v}let w=new Set(Object.keys(r.routes)),E=Object.values(y).reduce((v,C)=>(C&&!w.has(C.id)&&(v[C.id]=C),v),{});Object.assign(r.routes,E),e.forEach(v=>us(v,Xt));let b=new Set;Object.values(E).forEach(v=>{v&&(!v.parentId||!E[v.parentId])&&b.add(v.parentId)}),b.forEach(v=>s(v||null,Gr(E,a,null,n,o,v)))}function us(e,t){if(t.size>=ns){let r=t.values().next().value;t.delete(r)}t.add(e)}function cs(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function tr(){let e=d.useContext(tt);return ve(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function rr(){let e=d.useContext(ut);return ve(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ar=d.createContext(void 0);ar.displayName="FrameworkContext";function Fe(){let e=d.useContext(ar);return ve(e,"You must render this element inside a <HydratedRouter> element"),e}function ds(e,t){let r=d.useContext(ar),[a,n]=d.useState(!1),[o,i]=d.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:f,onTouchStart:c}=t,y=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=C=>{C.forEach(S=>{i(S.isIntersecting)})},v=new IntersectionObserver(b,{threshold:.5});return y.current&&v.observe(y.current),()=>{v.disconnect()}}},[e]),d.useEffect(()=>{if(a){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[a]);let w=()=>{n(!0)},E=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,y,{}]:[o,y,{onFocus:vt(l,w),onBlur:vt(s,E),onMouseEnter:vt(u,w),onMouseLeave:vt(f,E),onTouchStart:vt(c,w)}]:[!1,y,{}]}function vt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Kr(e,t,r){if(r&&!Kt)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}var Ba="data-react-router-critical-css";function qs({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:a,routeModules:n,criticalCss:o,nonce:i}=Fe(),{errors:l,matches:s}=rr(),u=Kr(s,l,r),f=d.useMemo(()=>Vl(u,n,a),[u,n,a]);return e==null&&i&&(e=i),d.createElement(d.Fragment,null,typeof o=="string"?d.createElement("style",{[Ba]:"",nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o=="object"?d.createElement("link",{[Ba]:"",rel:"stylesheet",href:o.href,nonce:e,crossOrigin:t}):null,f.map(({key:c,link:y})=>Vr(y)?d.createElement(Hn,{key:c,nonce:e,...y,crossOrigin:y.crossOrigin??t}):d.createElement("link",{key:c,nonce:e,...y,crossOrigin:y.crossOrigin??t})))}function Hn({page:e,...t}){let r=jr(),{nonce:a}=Fe(),{router:n}=tr(),o=d.useMemo(()=>Ka(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?d.createElement(hs,{page:e,matches:o,...t}):d.createElement(ms,{page:e,matches:o,...t})):null}function fs(e){let{manifest:t,routeModules:r}=Fe(),[a,n]=d.useState([]);return d.useEffect(()=>{let o=!1;return Xl(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function hs({page:e,matches:t,...r}){let a=Se(),{future:n}=Fe(),{basename:o}=tr(),i=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=Yr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let f of t)typeof f.route.shouldRevalidate=="function"?s=!0:u.push(f.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return d.createElement(d.Fragment,null,i.map(l=>d.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function ms({page:e,matches:t,...r}){let a=Se(),{future:n,manifest:o,routeModules:i}=Fe(),{basename:l}=tr(),{loaderData:s,matches:u}=rr(),f=d.useMemo(()=>Ha(e,t,u,o,a,"data"),[e,t,u,o,a]),c=d.useMemo(()=>Ha(e,t,u,o,a,"assets"),[e,t,u,o,a]),y=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,v=!1;if(t.forEach(S=>{let D=o.routes[S.route.id];!D||!D.hasLoader||(!f.some(M=>M.route.id===S.route.id)&&S.route.id in s&&i[S.route.id]?.shouldRevalidate||D.hasClientLoader?v=!0:b.add(S.route.id))}),b.size===0)return[];let C=Yr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return v&&b.size>0&&C.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[C.pathname+C.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,f,t,e,i]),w=d.useMemo(()=>Jr(c,o),[c,o]),E=fs(c);return d.createElement(d.Fragment,null,y.map(b=>d.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),w.map(b=>d.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),E.map(({key:b,link:v})=>d.createElement("link",{key:b,nonce:r.nonce,...v,crossOrigin:v.crossOrigin??r.crossOrigin})))}function Qs(){let{isSpaMode:e,routeModules:t}=Fe(),{errors:r,matches:a,loaderData:n}=rr(),o=Se(),i=Kr(a,r,e),l=null;r&&(l=r[i[i.length-1].route.id]);let s=[],u=null,f=[];for(let c=0;c<i.length;c++){let y=i[c],w=y.route.id,E=n[w],b=y.params,v=t[w],C=[],S={id:w,data:E,loaderData:E,meta:[],params:y.params,pathname:y.pathname,handle:y.route.handle,error:l};if(f[c]=S,v?.meta?C=typeof v.meta=="function"?v.meta({data:E,loaderData:E,params:b,location:o,matches:f,error:l}):Array.isArray(v.meta)?[...v.meta]:v.meta:u&&(C=[...u]),C=C||[],!Array.isArray(C))throw new Error("The route at "+y.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://reactrouter.com/start/framework/route-module#meta`);S.meta=C,f[c]=S,s=[...C],u=s}return d.createElement(d.Fragment,null,s.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:y,...w}=c;if(!ps(y))return console.warn(`A meta object uses an invalid tagName: ${y}. Expected either 'link' or 'meta'`),null;let E=y;return d.createElement(E,{key:JSON.stringify(w),...w})}if("title"in c)return d.createElement("title",{key:"title"},String(c.title));if("charset"in c&&(c.charSet??(c.charSet=c.charset),delete c.charset),"charSet"in c&&c.charSet!=null)return typeof c.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let y=JSON.stringify(c["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${y}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:Tr(y)}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(c),...c})}))}function ps(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Kt=!1;function ys(){Kt=!0}function vs(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:i,nonce:l}=Fe(),{router:s,static:u,staticContext:f}=tr(),{matches:c}=rr(),y=jr(),w=Xr(o,i);e.nonce==null&&l&&(e={...e,nonce:l}),n&&(n.didRenderScripts=!0);let E=Kr(c,null,a);d.useEffect(()=>{ys()},[]);let b=d.useMemo(()=>{if(y)return null;let D=f?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",M=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${w?"":`import ${JSON.stringify(t.url)}`};
${E.map((T,$)=>{let _=`route${$}`,g=t.routes[T.route.id];ve(g,`Route ${T.route.id} not found in manifest`);let{clientActionModule:J,clientLoaderModule:X,clientMiddlewareModule:ne,hydrateFallbackModule:V,module:se}=g,ee=[...J?[{module:J,varName:`${_}_clientAction`}]:[],...X?[{module:X,varName:`${_}_clientLoader`}]:[],...ne?[{module:ne,varName:`${_}_clientMiddleware`}]:[],...V?[{module:V,varName:`${_}_HydrateFallback`}]:[],{module:se,varName:`${_}_main`}];if(ee.length===1)return`import * as ${_} from ${JSON.stringify(se)};`;let ce=ee.map(Q=>`import * as ${Q.varName} from "${Q.module}";`).join(`
`),K=`const ${_} = {${ee.map(Q=>`...${Q.varName}`).join(",")}};`;return[ce,K].join(`
`)}).join(`
`)}
  ${w?`window.__reactRouterManifest = ${JSON.stringify(ls(t,s),null,2)};`:""}
  window.__reactRouterRouteModules = {${E.map((T,$)=>`${JSON.stringify(T.route.id)}:route${$}`).join(",")}};

import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:D},type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:M},type:"module",async:!0}))},[]),v=Kt||y?[]:[...new Set(t.entry.imports.concat(Jr(E,t,{includeHydrateFallback:!0})))],C=typeof t.sri=="object"?t.sri:{};return xr(!y,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Kt||y?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:C})}}):null,w?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:C[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:C[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),v.map(S=>d.createElement("link",{key:S,rel:"modulepreload",href:S,crossOrigin:e.crossOrigin,integrity:C[S],nonce:e.nonce,suppressHydrationWarning:!0})),b)}function gs(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Zs=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(zn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function zn({error:e,isOutsideRemixApp:t}){let{nonce:r}=Fe();console.error(e);let a=d.createElement("script",{nonce:r,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(et(e))return d.createElement(_r,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),a);let n;if(e instanceof Error)n=e;else{let o=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(o)}return d.createElement(_r,{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"}},n.stack),a)}function _r({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){let{routeModules:n}=Fe();return n.root?.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(vs,null):null)))}var ws=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ws&&(window.__reactRouterVersion="7.18.2")}catch{}var Bn=d.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:f,preventScrollReset:c,viewTransition:y,defaultShouldRevalidate:w,...E},b){let{basename:v,navigator:C,useTransitions:S}=d.useContext(ge),D=typeof f=="string"&&qt.test(f),M=nn(f,v);f=M.to;let T=Di(f,{relative:n}),$=Se(),_=null;if(l){let ce=Lt(l,[],$.mask?$.mask.pathname:"/",!0);v!=="/"&&(ce.pathname=ce.pathname==="/"?v:Le([v,ce.pathname])),_=C.createHref(ce)}let[g,J,X]=ds(a,E),ne=xs(f,{replace:i,mask:l,state:s,target:u,preventScrollReset:c,relative:n,viewTransition:y,defaultShouldRevalidate:w,useTransitions:S});function V(ce){t&&t(ce),ce.defaultPrevented||ne(ce)}let se=!(M.isExternal||o),ee=d.createElement("a",{...E,...X,href:(se?_:void 0)||M.absoluteURL||T,onClick:se?V:t,ref:gs(b,J),target:u,"data-discover":!D&&r==="render"?"true":void 0});return g&&!D?d.createElement(d.Fragment,null,ee,d.createElement(Hn,{page:T})):ee});Bn.displayName="Link";var Rs=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},f){let c=Ct(i,{relative:u.relative}),y=Se(),w=d.useContext(ut),{navigator:E,basename:b}=d.useContext(ge),v=w!=null&&Ds(c)&&l===!0,C=E.encodeLocation?E.encodeLocation(c).pathname:c.pathname,S=y.pathname,D=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(S=S.toLowerCase(),D=D?D.toLowerCase():null,C=C.toLowerCase()),D&&b&&(D=Pe(D,b)||D);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let T=S===C||!n&&S.startsWith(C)&&S.charAt(M)==="/",$=D!=null&&(D===C||!n&&D.startsWith(C)&&D.charAt(C.length)==="/"),_={isActive:T,isPending:$,isTransitioning:v},g=T?t:void 0,J;typeof a=="function"?J=a(_):J=[a,T?"active":null,$?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let X=typeof o=="function"?o(_):o;return d.createElement(Bn,{...u,"aria-current":g,className:J,ref:f,style:X,to:i,viewTransition:l},typeof s=="function"?s(_):s)});Rs.displayName="NavLink";var Es=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=Wt,action:l,onSubmit:s,relative:u,preventScrollReset:f,viewTransition:c,defaultShouldRevalidate:y,...w},E)=>{let{useTransitions:b}=d.useContext(ge),v=Cs(),C=Ts(l,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",D=typeof l=="string"&&qt.test(l),M=T=>{if(s&&s(T),T.defaultPrevented)return;T.preventDefault();let $=T.nativeEvent.submitter,_=$?.getAttribute("formmethod")||i,g=()=>v($||T.currentTarget,{fetcherKey:t,method:_,navigate:r,replace:n,state:o,relative:u,preventScrollReset:f,viewTransition:c,defaultShouldRevalidate:y});b&&r!==!1?d.startTransition(()=>g()):g()};return d.createElement("form",{ref:E,method:S,action:C,onSubmit:a?s:M,...w,"data-discover":!D&&e==="render"?"true":void 0})});Es.displayName="Form";function bs({getKey:e,storageKey:t,...r}){let a=d.useContext(ar),{basename:n}=d.useContext(ge),o=Se(),i=Wr();Ms({getKey:e,storageKey:t});let l=d.useMemo(()=>{if(!a||!e)return null;let u=Or(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,f)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let y=JSON.parse(sessionStorage.getItem(u)||"{}")[f||window.history.state.key];typeof y=="number"&&window.scrollTo(0,y)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${Tr(JSON.stringify(t||Dr))}, ${Tr(JSON.stringify(l))})`}})}bs.displayName="ScrollRestoration";function Wn(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function qr(e){let t=d.useContext(tt);return z(t,Wn(e)),t}function Ss(e){let t=d.useContext(ut);return z(t,Wn(e)),t}function xs(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let f=zr(),c=Se(),y=Ct(e,{relative:i});return d.useCallback(w=>{if(ll(w,t)){w.preventDefault();let E=r!==void 0?r:De(c)===De(y),b=()=>f(e,{replace:E,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?d.startTransition(()=>b()):b()}},[c,f,y,r,a,n,t,e,o,i,l,s,u])}function eu(e){le(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(Pr(e)),r=d.useRef(!1),a=Se(),n=d.useMemo(()=>sl(a.search,r.current?null:t.current),[a.search]),o=zr(),i=d.useCallback((l,s)=>{const u=Pr(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var Ls=0,Ps=()=>`__${String(++Ls)}__`;function Cs(){let{router:e}=qr("useSubmit"),{basename:t}=d.useContext(ge),r=Bi(),a=e.fetch,n=e.navigate;return d.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:f,body:c}=dl(o,t);if(i.navigate===!1){let y=i.fetcherKey||Ps();await a(y,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:c,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:c,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function Ts(e,{relative:t}={}){let{basename:r}=d.useContext(ge),a=d.useContext(_e);z(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...Ct(e||".",{relative:t})},i=Se();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(f=>f==="")){l.delete("index"),s.filter(c=>c).forEach(c=>l.append("index",c));let f=l.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Le([r,o.pathname])),De(o)}var Dr="react-router-scroll-positions",Ht={};function Or(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:Pe(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Ms({getKey:e,storageKey:t}={}){let{router:r}=qr("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=Ss("useScrollRestoration"),{basename:o}=d.useContext(ge),i=Se(),l=Wr(),s=Wi();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),_s(d.useCallback(()=>{if(s.state==="idle"){let u=Or(i,l,o,e);Ht[u]=window.scrollY}try{sessionStorage.setItem(t||Dr,JSON.stringify(Ht))}catch(u){le(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Dr);u&&(Ht=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Ht,()=>window.scrollY,e?(f,c)=>Or(f,c,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{le(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function _s(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 Ds(e,{relative:t}={}){let r=d.useContext(Ur);z(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=qr("useViewTransitionState"),n=Ct(e,{relative:t});if(!r.isTransitioning)return!1;let o=Pe(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=Pe(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Jt(n.pathname,i)!=null||Jt(n.pathname,o)!=null}var gr={exports:{}},gt={};var Wa;function Os(){if(Wa)return gt;Wa=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,n,o){var i=null;if(o!==void 0&&(i=""+o),n.key!==void 0&&(i=""+n.key),"key"in n){o={};for(var l in n)l!=="key"&&(o[l]=n[l])}else o=n;return n=o.ref,{$$typeof:e,type:a,key:i,ref:n!==void 0?n:null,props:o}}return gt.Fragment=t,gt.jsx=r,gt.jsxs=r,gt}var Ya;function ks(){return Ya||(Ya=1,gr.exports=Os()),gr.exports}var tu=ks();export{Yl as A,Gr as B,Fs as C,Xs as D,Js as E,ar as F,Is as G,Gs as H,Us as I,Hs as J,ho as K,Bn as L,Qs as M,Bs as N,Ws as O,Ns as P,As as Q,po as R,bs as S,Ai as a,Se as b,zr as c,$s as d,js as e,mo as f,co as g,Ys as h,et as i,tu as j,el as k,eu as l,Wr as m,qs as n,vs as o,Wi as p,Ka as q,d as r,as as s,Il as t,Cn as u,z as v,Vs as w,Ks as x,Zs as y,zs as z};
