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