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