1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`096e0fc61894dc4de53509062dbec606037182d5`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`cda1f084-d04b-4bb2-95d1-160c7c68f38c`,e._sentryDebugIdIdentifier=`sentry-dbid-cda1f084-d04b-4bb2-95d1-160c7c68f38c`)}catch{}})();import{n as e}from"./chunk.B-8nAmdL.js";import{n as t}from"./jsx-runtime.C8csbUBy.js";import{t as n}from"./preload-helper.DyC2CmYF.js";var r=e(t(),1),i=e=>{throw TypeError(e)},a=(e,t,n)=>t.has(e)||i(`Cannot `+n),o=(e,t,n)=>(a(e,t,`read from private field`),n?n.call(e):t.get(e)),s=(e,t,n)=>t.has(e)?i(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),c=`popstate`;function l(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function u(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>d(e,typeof e==`string`?null:e.state,t===0?`default`:void 0,typeof e==`string`?void 0:e.unstable_mask));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function u(){return i[a]}function d(e,t=null,n,r){let a=g(i?u().pathname:`/`,e,t,n,r);return p(a.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),a}function f(e){return typeof e==`string`?e:_(e)}return{get index(){return a},get action(){return o},get location(){return u()},createHref:f,createURL(e){return new URL(f(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?v(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=l(e)?e:d(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=l(e)?e:d(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function d(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return g(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:_(t)}return y(t,n,null,e)}function f(e,t){if(e===!1||e==null)throw Error(t)}function p(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function m(){return Math.random().toString(36).substring(2,10)}function h(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function g(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?v(t):t,state:n,key:t&&t.key||r||m(),unstable_mask:i}}function _({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function v(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=l(e)?e:g(y.location,e,t);n&&n(r,e),d=f()+1;let c=h(r,d),p=y.createHref(r.unstable_mask||r);try{o.pushState(c,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&u&&u({action:s,location:y.location,delta:1})}function _(e,t){s=`REPLACE`;let r=l(e)?e:g(y.location,e,t);n&&n(r,e),d=f();let i=h(r,d),c=y.createHref(r.unstable_mask||r);o.replaceState(i,``,c),a&&u&&u({action:s,location:y.location,delta:0})}function v(e){return b(e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(c,p),u=e,()=>{i.removeEventListener(c,p),u=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:_,go(e){return o.go(e)}};return y}function b(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),f(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:_(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function x(e){return{defaultValue:e}}var S,C=class{constructor(e){if(s(this,S,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(o(this,S).has(e))return o(this,S).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){o(this,S).set(e,t)}};S=new WeakMap;var w=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function T(e){return w.has(e)}var E=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function D(e){return E.has(e)}function O(e){return e.index===!0}function k(e,t,n=[],r={},i=!1){return e.map((e,a)=>
1{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(f(e.index!==!0||!e.children,`Cannot specify children on an index route`),f(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),O(e)){let n={...e,id:s};return r[s]=A(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=A(n,t(n)),e.children&&(n.children=k(e.children,t,o,r,i)),n}})}function A(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function j(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r){let i=B((typeof t==`string`?v(t):t).pathname||`/`,n);if(i==null)return null;let a=M(e);P(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=z(i);o=ce(a[e],t,r)}return o}function te(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function M(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;f(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=H([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(f(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),M(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of N(e.path))a(e,t,!0,n)}),t}function N(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=N(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function P(e){e.sort((e,t)=>e.score===t.score?L(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,F=3,re=2,I=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=re),n.filter(e=>!oe(e)).reduce((e,t)=>e+(ne.test(t)?F:t===``?I:ie),r)}function L(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ce(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=R({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
1Object.assign(i,u.params),o.push({params:i,pathname:H([a,u.pathname]),pathnameBase:be(H([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=H([a,u.pathnameBase]))}return o}function R(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=le(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function le(e,t=!1,n=!0){p(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function z(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return p(!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 B(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ue({basename:e,pathname:t}){return t===`/`?e:H([e,t])}var de=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>de.test(e);function V(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?v(e):e,a;return n?(n=ve(n),a=n.startsWith(`/`)?pe(n.substring(1),`/`):pe(n,t)):a=t,{pathname:a,search:xe(r),hash:Se(i)}}function pe(e,t){let n=ye(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function me(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ge(e){let t=he(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _e(e,t,n,r=!1){let i;typeof e==`string`?i=v(e):(i={...e},f(!i.pathname||!i.pathname.includes(`?`),me(`?`,`pathname`,`search`,i)),f(!i.pathname||!i.pathname.includes(`#`),me(`#`,`pathname`,`hash`,i)),f(!i.search||!i.search.includes(`#`),me(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=V(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ve=e=>e.replace(/\/\/+/g,`/`),H=e=>ve(e.join(`/`)),ye=e=>e.replace(/\/+$/,``),be=e=>ye(e).replace(/^\/*/,`/`),xe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Se=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ce=class{constructor(e,t){this.type=`DataWithResponseInit`,this.data=e,this.init=t||null}};function we(e,t){return new Ce(e,typeof t==`number`?{status:t}:t)}var Te=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},Ee=(e,t)=>{let n=Te(e,t);return n.headers.set(`X-Remix-Reload-Document`,`true`),n},De=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Oe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ke(e){return H(e.map(e=>
1e.route.path).filter(Boolean))||`/`}var Ae=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function je(e,t){let n=e;if(typeof n!=`string`||!de.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ae)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=B(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{p(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var U=Symbol(`Uninstrumented`);function Me(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Pe(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Pe(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[U]??i,a=Pe(n[e],t,(...e)=>W(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[U]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[U]??e,r=Pe(n.middleware,t,(...e)=>W(e[0]));return r?(r[U]=t,r):e})),r}function Ne(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[U]??e.navigate,r=Pe(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?_(n):`.`,...G(e,r??{})}});r&&(r[U]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[U]??e.fetch,r=Pe(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...G(e,i??{})}});r&&(r[U]=t,e.fetch=r)}return e}function Pe(e,t,n){return e.length===0?null:async(...r)=>{let i=await Fe(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Fe(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Fe(e,t,n,r-1),a=await o,f(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function W(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:Ie(t),params:{...r},unstable_pattern:i,context:Le(n)}}function G(e,t){return{currentUrl:_(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 Ie(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Le(e){if(ze(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Re=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ze(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Re}var K=[`POST`,`PUT`,`PATCH`,`DELETE`],Be=new Set(K),Ve=[`GET`,...K],He=new Set(Ve),Ue=new Set([301,302,303,307,308]),We=new Set([307,308]),Ge={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ke={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qe={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Je=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ye=`remix-router-transitions`,Xe=Symbol(`ResetLoaderData`);function Ze(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;f(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Je,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...Me(t.map(e=>
1e.route).filter(Boolean),e)})}let o={},s=k(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||mt,d={unstable_passThroughRequests:!1,...e.future},m=null,h=new Set,_=null,y=null,x=null,S=e.hydrationData!=null,w=j(s,e.history.location,l),T=!1,E=null,D,O;if(w==null&&!e.patchRoutesOnNavigation){let t=q(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Lt(s);D=!0,O=!D,w=n,E={[r.id]:t}}else if(w&&!e.hydrationData&<(w,s,e.history.location.pathname).active&&(w=null),!w){D=!1,O=!D,w=[];let t=lt(null,s,e.history.location.pathname);t.active&&t.matches&&(T=!0,w=t.matches)}else if(w.some(e=>e.route.lazy))D=!1,O=!D;else if(!w.some(e=>nt(e.route)))D=!0,O=!D;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=w;if(n){let e=w.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}O=!1,D=!0,r.forEach(e=>{let r=rt(e.route,t,n);O||=r.renderFallback,D&&=!r.shouldLoad})}let A,M={historyAction:e.history.action,location:e.history.location,matches:w,initialized:D,renderFallback:O,navigation:Ge,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},N=`POP`,P=null,ne=!1,F,re=!1,I=new Map,ie=null,ae=!1,oe=!1,se=new Set,L=new Map,ce=0,R=-1,le=new Map,z=new Set,ue=new Map,de=new Map,V=new Set,pe=new Map,me,he=null;function ge(){if(m=e.history.listen(({action:t,location:n,delta:r})=>{if(me){me(),me=void 0;return}p(pe.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 i=Ze({currentLocation:M.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{me=e});e.history.go(r*-1),Xe(i,{state:`blocked`,location:n,proceed(){Xe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(M.blockers);e.set(i,qe),H({blockers:e})}}),P?.resolve(),P=null;return}return Se(t,n)}),n){on(t,I);let e=()=>sn(t,I);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return M.initialized||Se(`POP`,M.location,{initialHydration:!0}),A}function _e(){m&&m(),ie&&ie(),h.clear(),F&&F.abort(),M.fetchers.forEach((e,t)=>Re(t)),M.blockers.forEach((e,t)=>Ye(t))}function ve(e){return h.add(e),()=>h.delete(e)}function H(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),M={...M,...e};let n=[],r=[];M.fetchers.forEach((e,t)=>{e.state===`idle`&&(V.has(t)?n.push(t):r.push(t))}),V.forEach(e=>{!M.fetchers.has(e)&&!L.has(e)&&n.push(e)}),[...h].forEach(r=>r(M,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Re(e)),r.forEach(e=>M.fetchers.delete(e))}function ye(t,n,{flushSync:r}={}){let i=M.actionData!=null&&M.navigation.formMethod!=null&&Y(M.navigation.formMethod)&&M.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?M.actionData:null;let o=n.loaderData?Pt(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,l=M.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,qe)));let u=ae?!1:ct(t,n.matches||M.matches),d=ne===!0||M.navigation.formMethod!=null&&Y(M.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),ae||N===`POP`||(N===`PUSH`?e.history.push(t,t.state):N===`REPLACE`&&e.history.replace(t,t.state));let f;if(N===`POP`){let e=I.get(M.location.pathname);e&&e.has(t.pathname)?f={currentLocation:M.location,nextLocation:t}:I.has(t.pathname)&&(f={currentLocation:t,nextLocation:M.location})}else if(re){let e=I.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),I.set(M.location.pathname,e)),f={currentLocation:M.location,nextLocation:t}}H({...n,actionData:a,loaderData:o,historyAction:N,location:t,initialized:!0,renderFallback:!1,navigation:Ge,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),N=`POP`,ne=!1,re=!1,ae=!1,oe=!1,P?.resolve(),P=null,he?.resolve(),he=null}async function be(t,n){if(P?.resolve(),P=null,typeof t==`number`){P||=cn();let n=P.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=et(!1,$e(M.location,M.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?v(n.unstable_mask):{...M.location.unstable_mask,...n.unstable_mask}});let s=M.location,c=g(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Y(i.formMethod)&&i.formAction===M.location.pathname+M.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ze({currentLocation:s,nextLocation:c,historyAction:d});if(m){Xe(m,{state:`blocked`,location:c,proceed(){Xe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),be(t,n)},reset(){let e=new Map(M.blockers);e.set(m,qe),H({blockers:e})}});return}await Se(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function xe(){he||=cn(),Fe(),H({revalidation:`loading`});let e=he.promise;return M.navigation.state===`submitting`?e:M.navigation.state===`idle`?(Se(M.historyAction,M.location,{startUninterruptedRevalidation:!0}
1),e):(Se(N||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:re===!0}),e)}async function Se(t,n,r){F&&F.abort(),F=null,N=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ot(M.location,M.matches),ne=(r&&r.preventScrollReset)===!0,re=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&M.matches&&M.matches.length>0&&!T?M.matches:j(i,n,l),u=(r&&r.flushSync)===!0;if(o&&M.initialized&&!oe&&Bt(M.location,n)&&!(r&&r.submission&&Y(r.submission.formMethod))){ye(n,{matches:o},{flushSync:u});return}let d=lt(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);ye(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}F=new AbortController;let f=Ot(e.history,n,F.signal,r&&r.submission),p=e.getContext?await e.getContext():new C,m;if(r&&r.pendingError)m=[It(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Y(r.submission.formMethod)){let t=await Ce(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(J(r)&&Oe(r.error)&&r.error.status===404){F=null,ye(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=en(n,r.submission),u=!1,d.active=!1,f=Ot(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await we(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(F=null,ye(n,{matches:g||o,...Ft(m),loaderData:_,errors:v}))}async function Ce(t,n,i,c,u,d,f,p={}){if(Fe(),H({navigation:tn(n,i)},{flushSync:p.flushSync===!0}),d){let e=await ut(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Lt(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=It(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Qe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=Qt(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:q(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await U(t,n,bt(a,o,t,n,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Gt(m)){let n;return n=p&&p.replace!=null?p.replace:Dt(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===M.location.pathname+M.location.search,await je(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(J(m)){let e=It(c,h.route.id);return(p&&p.replace)!==!0&&(N=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function we(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||en(n,p),x=p||m||$t(b),S=!ae&&!g;if(d){if(S){let e=Te(v);H({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ut(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Lt(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=It(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:w,revalidatingFetchers:T}=tt(t,u,a,o,e.history,M,i,x,n,g?[]:r,g===!0,oe,se,V,ue,z,C,l,e.patchRoutesOnNavigation!=null,v,y);if(R=++ce,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=Ve();return ye(n,{matches:i,loaderData:{},errors:v&&J(v[1])?{[v[0]]:v[1].error}:null,...Ft(v),...e?{fetchers:new Map(M.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Te(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Ee(T)),H(e,{flushSync:_})}
1T.forEach(e=>{K(e.key),e.controller&&L.set(e.key,e.controller)});let E=()=>T.forEach(e=>K(e.key));F&&F.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Pe(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener(`abort`,E),T.forEach(e=>L.delete(e.key));let k=Rt(D);if(k)return await je(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Rt(O),k)return z.add(k.key),await je(t,k.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:A,errors:j}=Nt(M,i,D,v,T,O);g&&M.errors&&(j={...M.errors,...j});let ee=Ve(),te=He(R),N=ee||te||T.length>0;return{matches:i,loaderData:A,errors:j,...N?{fetchers:new Map(M.fetchers)}:{}}}function Te(e){if(e&&!J(e[1]))return{[e[0]]:e[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Ee(e){return e.forEach(e=>{let t=M.fetchers.get(e.key),n=nn(void 0,t?t.data:void 0);M.fetchers.set(e.key,n)}),new Map(M.fetchers)}async function De(t,n,r,i){K(t);let a=(i&&i.flushSync)===!0,o=c||s,u=$e(M.location,M.matches,l,r,n,i?.relative),d=j(o,u,l),f=lt(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){G(t,n,q(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=et(!0,u,i);if(h){G(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new C,_=(i&&i.preventScrollReset)===!0;if(m&&Y(m.formMethod)){await ke(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}ue.set(t,{routeId:n,path:p}),await Ae(t,n,p,d,g,f.active,a,_,m)}async function ke(t,n,i,u,d,p,m,h,g,_){Fe(),ue.delete(t),W(t,rn(g,M.fetchers.get(t)),{flushSync:m});let v=new AbortController,y=Ot(e.history,i,v.signal,g);if(p){let e=await ut(u,new URL(y.url).pathname,y.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){G(t,n,e.error,{flushSync:m});return}else if(e.matches)u=e.matches;else{G(t,n,q(404,{pathname:i}),{flushSync:m});return}}let b=Qt(u,i);if(!b.route.action&&!b.route.lazy){G(t,n,q(405,{method:g.formMethod,pathname:i,routeId:n}),{flushSync:m});return}L.set(t,v);let x=ce,S=bt(a,o,y,i,u,b,r,d),C=await U(y,i,S,d,t),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){L.get(t)===v&&L.delete(t);return}if(V.has(t)){if(Gt(w)||J(w)){W(t,an(void 0));return}}else{if(Gt(w))if(L.delete(t),R>x){W(t,an(void 0));return}else return z.add(t),W(t,nn(g)),je(y,w,!1,{fetcherSubmission:g,preventScrollReset:h});if(J(w)){G(t,n,w.error);return}}let T=M.navigation.location||M.location,E=Ot(e.history,T,v.signal),D=c||s,O=M.navigation.state===`idle`?M.matches:j(D,M.navigation.location,l);f(O,`Didn't find any matches after fetcher action`);let k=++ce;le.set(t,k);let A=nn(g,w.data);M.fetchers.set(t,A);let{dsMatches:ee,revalidatingFetchers:te}=tt(E,d,a,o,e.history,M,O,g,T,r,!1,oe,se,V,ue,z,D,l,e.patchRoutesOnNavigation!=null,[b.route.id,w],_);te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=M.fetchers.get(t),r=nn(void 0,n?n.data:void 0);M.fetchers.set(t,r),K(t),e.controller&&L.set(t,e.controller)}),H({fetchers:new Map(M.fetchers)});let P=()=>te.forEach(e=>K(e.key));v.signal.addEventListener(`abort`,P);let{loaderResults:ne,fetcherResults:re}=await Pe(ee,te,E,T,d);if(v.signal.aborted)return;if(v.signal.removeEventListener(`abort`,P),le.delete(t),L.delete(t),te.forEach(e=>L.delete(e.key)),M.fetchers.has(t)){let e=an(w.data);M.fetchers.set(t,e)}let I=Rt(ne);if(I)return je(E,I.result,!1,{preventScrollReset:h});if(I=Rt(re),I)return z.add(I.key),je(E,I.result,!1,{preventScrollReset:h});let{loaderData:ie,errors:ae}=Nt(M,O,ne,void 0,te,re);He(k),M.navigation.state===`loading`&&k>R?(f(N,`Expected pending action`),F&&F.abort(),ye(M.navigation.location,{matches:O,loaderData:ie,errors:ae,fetchers:new Map(M.fetchers)})):(H({errors:ae,loaderData:Pt(M.loaderData,ie,O,ae),fetchers:new Map(M.fetchers)}),oe=!1)}async function Ae(t,n,i,s,c,l,u,d,f){let p=M.fetchers.get(t);W(t,nn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ot(e.history,i,m.signal);if(l){let e=await ut(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){G(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{G(t,n,q(404,{pathname:i}),{flushSync:u});return}}let g=Qt(s,i);L.set(t,m);let _=ce,v=await U(h,i,bt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(L.get(t)===m&&L.delete(t),!h.signal.aborted){if(V.has(t)){W(t,an(void 0));return}if(Gt(y))if(R>_){W(t,an(void 0));return}else{z.add(t),await je(h,y,!1,{preventScrollReset:d});return}if(J(y)){G(t,n,y.error);return}W(t,an(y.data))}}async function je(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(P?.resolve(),P=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let d=i.response.headers.get(`Location`);f(d,`Expected a Location header on the redirect Response`),d=Dt(d,new URL(r.url),l,e.history);let p=g(M.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(fe(d)){let n=b(d,!0);e=n.origin!==t.location.origin||B(n.pathname,l)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}F=null;let m=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:h,formAction:_,formEncType:v}=M.navigation;!o&&!s&&h&&_&&v&&(o=$t(M.navigation));let y=o||s;We.has(i.response.status)&&y&&Y(y.formMethod)?await Se(m,p,{submission:{...y,formAction:d},preventScrollReset:c||ne,enableViewTransition:a?re:void 0}):await Se(m,p,{overrideNavigation:en(p,o),fetcherSubmission:s,preventScrollReset:c||ne,enableViewTransition:a?re:void 0})}async function U(e,t,n,r,i){let a,o={};try{a=await xt(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>
1e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Y(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!M.loaderData.hasOwnProperty(e.route.id)&&(!M.errors||!M.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Wt(r)){let i=r.result;o[t]={type:`redirect`,response:Tt(i,e,t,n,l)}}else o[t]=await wt(r);return o}async function Pe(e,t,n,r,i){let a=U(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await U(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:q(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){oe=!0,ue.forEach((e,t)=>{L.has(t)&&se.add(t),K(t)})}function W(e,t,n={}){M.fetchers.set(e,t),H({fetchers:new Map(M.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function G(e,t,n,r={}){let i=It(M.matches,t);Re(e),H({errors:{[i.route.id]:n},fetchers:new Map(M.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Ie(e){return de.set(e,(de.get(e)||0)+1),V.has(e)&&V.delete(e),M.fetchers.get(e)||Ke}function Le(e,t){K(e,t?.reason),W(e,an(null))}function Re(e){let t=M.fetchers.get(e);L.has(e)&&!(t&&t.state===`loading`&&le.has(e))&&K(e),ue.delete(e),le.delete(e),z.delete(e),V.delete(e),se.delete(e),M.fetchers.delete(e)}function ze(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),V.add(e)):de.set(e,t),H({fetchers:new Map(M.fetchers)})}function K(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function Be(e){for(let t of e){let e=an(Ie(t).data);M.fetchers.set(t,e)}}function Ve(){let e=[],t=!1;for(let n of z){let r=M.fetchers.get(n);f(r,`Expected fetcher: ${n}`),r.state===`loading`&&(z.delete(n),e.push(n),t=!0)}return Be(e),t}function He(e){let t=[];for(let[n,r]of le)if(r<e){let e=M.fetchers.get(n);f(e,`Expected fetcher: ${n}`),e.state===`loading`&&(K(n),le.delete(n),t.push(n))}return Be(t),t.length>0}function Ue(e,t){let n=M.blockers.get(e)||qe;return pe.get(e)!==t&&pe.set(e,t),n}function Ye(e){M.blockers.delete(e),pe.delete(e)}function Xe(e,t){let n=M.blockers.get(e)||qe;f(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(M.blockers);r.set(e,t),H({blockers:r})}function Ze({currentLocation:e,nextLocation:t,historyAction:n}){if(pe.size===0)return;pe.size>1&&p(!1,`A router only supports one blocker at a time`);let r=Array.from(pe.entries()),[i,a]=r[r.length-1],o=M.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Qe(e){let t=q(404,{pathname:e}),{matches:n,route:r}=Lt(c||s);return{notFoundMatches:n,route:r,error:t}}function it(e,t,n){if(_=e,x=t,y=n||null,!S&&M.navigation===Ge){S=!0;let e=ct(M.location,M.matches);e!=null&&H({restoreScrollPosition:e})}return()=>{_=null,x=null,y=null}}function at(e,t){return y&&y(e,t.map(e=>te(e,M.loaderData)))||e.key}function ot(e,t){if(_&&x){let n=at(e,t);_[n]=x()}}function ct(e,t){if(_){let n=at(e,t),r=_[n];if(typeof r==`number`)return r}return null}function lt(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:ee(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:ee(n,r,l,!0)}}return{active:!1,matches:null}}async function ut(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||st(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=j(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=ee(d,n,l,!0),!(m&&u.length<m.length&&dt(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=ee(d,n,l,!0),!m||dt(u,m))return{type:`success`,matches:null};u=m}}function dt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ft(e){o={},c=k(e,a,void 0,o)}function pt(e,t,n=!1){let r=c==null;st(e,t,c||s,o,a,n),r&&(s=[...s],H({}))}return A={get basename(){return l},get future(){return d},get state(){return M},get routes(){return s},get window(){return t},initialize:ge,subscribe:ve,enableScrollRestoration:it,navigate:be,fetch:De,revalidate:xe,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ie,resetFetcher:Le,deleteFetcher:ze,dispose:_e,getBlocker:Ue,deleteBlocker:Ye,patchRoutes:pt,_internalFetchControllers:L,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){H(e)}},e.unstable_instrumentations&&(A=Ne(A,e.unstable_instrumentations.map(e=>
1e.router).filter(Boolean))),A}function Qe(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function $e(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=_e(r||`.`,ge(o),B(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Zt(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ue({basename:n,pathname:c.pathname})),_(c)}function et(e,t,n){if(!n||!Qe(n))return{path:t};if(n.formMethod&&!Xt(n.formMethod))return{path:t,error:q(405,{method:n.formMethod})};let r=()=>({path:t,error:q(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=zt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Y(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} 2`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Y(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}f(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=At(n.formData),s=n.formData;else if(n.body instanceof FormData)o=At(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=jt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=jt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Y(c.formMethod))return{path:t,submission:c};let l=v(t);return e&&l.search&&Zt(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:_(l),submission:c}}function tt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?J(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&J(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=ke(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!nt(s))f=!1;else if(u){let{shouldLoad:e}=rt(s,a.loaderData,a.errors);f=e}else it(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return yt(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?at(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return yt(n,r,e,c,O,i,l,t,ot(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=j(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Qt(y,e.path),S=new AbortController,C=Ot(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=bt(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=bt(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};ot(x,a)&&(w=bt(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function nt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!nt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function it(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function at(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ot(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function st(e,t,n,r,i,a){let o;if(e){let t=r[e];f(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];
2if(t.forEach(e=>{let t=o.find(t=>ct(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=k(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=k([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function ct(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((e,n)=>t.children?.some(t=>ct(e,t)))??!1:!1}var lt=new WeakMap,ut=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(f(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=lt.get(i);o||(o={},lt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=T(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)p(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)p(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},dt=new WeakMap;function ft(e,t,n,r,i){let a=n[e.id];if(f(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=dt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{f(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=D(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?p(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?p(!o,`Route "${a.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.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return dt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=ut({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function pt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function mt(e){return e.matches.some(e=>e.route.middleware)?ht(e,()=>pt(e)):pt(e)}function ht(e,t){return gt(e,t,e=>{if(Yt(e))throw e;return e},Ht,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=It(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function gt(e,t,n,r,i){let{matches:a,...o}=e;return await _t(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function _t(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await _t(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function vt(e,t,n,r,i){let a=ut({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=ft(r.route,Y(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function yt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=vt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ot(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ot(a,{...l,defaultShouldRevalidate:e}):ot(a,l):c}
2,resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Y(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Y(n.method)||!p)?St({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function bt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?yt(e,t,n,r,ke(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:vt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function xt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:kt(t,n),unstable_pattern:ke(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return ht(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function St({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Y(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:kt(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw q(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw q(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Ct(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 wt(e){let{result:t,type:n}=e;if(qt(t)){let e;try{e=await Ct(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new De(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Kt(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:Vt(t),statusCode:Oe(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Oe(t)?t.status:void 0}:Kt(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 Tt(e,t,n,r,i){let a=e.headers.get(`Location`);if(f(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!fe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=$e(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Et=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Dt(e,t,n,r){if(fe(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Et.includes(i.protocol))throw Error(`Invalid redirect location`);let a=B(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ve(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Et.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Ot(e,t,n,r){let i=e.createURL(zt(t)).toString(),a={signal:n};if(r&&Y(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=At(r.formData):a.body=r.formData}
2return new Request(i,a)}function kt(e,t){let n=new URL(e.url),r=typeof t==`string`?v(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function At(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function jt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Mt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&J(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,p=t[d];if(f(!Gt(p),`Cannot handle redirect results in processLoaderData`),J(p)){let t=p.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=It(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Xe),c||(c=!0,s=Oe(p.error)?p.error.status:500),p.headers&&(l[d]=p.headers)}else a[d]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[d]=p.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Nt(e,t,n,r,i,a){let{loaderData:o,errors:s}=Mt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(f(o,`Did not find corresponding fetcher result`),J(o)){let t=It(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(Gt(o))f(!1,`Unhandled fetcher revalidation redirect`);else{let t=an(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function Pt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Xe).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Ft(e){return e?J(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function It(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Lt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function q(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new De(e||500,o,Error(s),!0)}function Rt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Gt(r))return{key:n,result:r}}}function zt(e){return _({...typeof e==`string`?v(e):e,hash:``})}function Bt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function Vt(e){return new De(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Ht(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Ut(t))}function Ut(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Wt(e){return qt(e.result)&&Ue.has(e.result.status)}function J(e){return e.type===`error`}function Gt(e){return(e&&e.type)===`redirect`}function Kt(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function qt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Jt(e){return Ue.has(e)}function Yt(e){return qt(e)&&Jt(e.status)&&e.headers.has(`Location`)}function Xt(e){return He.has(e.toUpperCase())}function Y(e){return Be.has(e.toUpperCase())}function Zt(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Qt(e,t){let n=typeof t==`string`?v(t).search:t.search;if(e[e.length-1].route.index&&Zt(n||``))return e[e.length-1];let r=he(e);return r[r.length-1]}function $t(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function en(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function tn(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function nn(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 rn(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 an(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 on(e,t){try{let n=e.sessionStorage.getItem(Ye);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function sn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ye,JSON.stringify(n))}catch(e){p(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function cn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ln=r.createContext(null);ln.displayName=`DataRouter`;var un=r.createContext(null);un.displayName=`DataRouterState`;var dn=r.createContext(!1);function fn(){return r.useContext(dn)}var pn=r.createContext({isTransitioning:!1});pn.displayName=`ViewTransition`;var mn=r.createContext(new Map);mn.displayName=`Fetchers`;var hn=r.createContext(null);hn.displayName=`Await`;var X=r.createContext(null);X.displayName=`Navigation`;var gn=r.createContext(null);gn.displayName=`Location`;var Z=r.createContext({outlet:null,matches:[],isDataRoute:!1});Z.displayName=`Route`;var _n=r.createContext(null);_n.displayName=`RouteError`;var vn=`REACT_ROUTER_ERROR`,yn=`REDIRECT`,bn=`ROUTE_ERROR_RESPONSE`;function xn(e){if(e.startsWith(`${vn}:${yn}:{`))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 Sn(e){if(e.startsWith(`${vn}:${bn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new De(t.status,t.statusText,t.data)}catch{}}function Cn(e,{relative:t}={}){f(wn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(X),{hash:a,pathname:o,search:s}=Nn(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:H([n,o])),i.createHref({pathname:c,search:s,hash:a})}function wn(){return r.useContext(gn)!=null}
2function Q(){return f(wn(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(gn).location}function Tn(e){f(wn(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=Q();return r.useMemo(()=>R(e,z(t)),[t,e])}var En=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Dn(e){r.useContext(X).static||r.useLayoutEffect(e)}function On(){let{isDataRoute:e}=r.useContext(Z);return e?er():kn()}function kn(){f(wn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(ln),{basename:t,navigator:n}=r.useContext(X),{matches:i}=r.useContext(Z),{pathname:a}=Q(),o=JSON.stringify(ge(i)),s=r.useRef(!1);return Dn(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(p(s.current,En),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=_e(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:H([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var An=r.createContext(null);function jn(e){let t=r.useContext(Z).outlet;return r.useMemo(()=>t&&r.createElement(An.Provider,{value:e},t),[t,e])}function Mn(){let{matches:e}=r.useContext(Z);return e[e.length-1]?.params??{}}function Nn(e,{relative:t}={}){let{matches:n}=r.useContext(Z),{pathname:i}=Q(),a=JSON.stringify(ge(n));return r.useMemo(()=>_e(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function Pn(e,t,n){f(wn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(X),{matches:a}=r.useContext(Z),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;nr(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 3 4Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=Q(),m;if(t){let e=typeof t==`string`?v(t):t;f(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=d;let h=m.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=j(e,{pathname:g});p(u||_!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),p(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Vn(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:H([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:H([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&y?r.createElement(gn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...m},navigationType:`POP`}},y):y}function Fn(){let e=$n(),t=Oe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`ð¿ Hey developer ð`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application
4Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var In=r.createElement(Fn,null),Ln=class extends r.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?t.error:e.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`){let t=Sn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(Z.Provider,{value:this.props.routeContext},r.createElement(_n.Provider,{value:e,children:this.props.component}));return this.context?r.createElement(zn,{error:e},t):t}};Ln.contextType=dn;var Rn=new WeakMap;function zn({children:e,error:t}){let{basename:n}=r.useContext(X);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=xn(t.digest);if(e){let i=Rn.get(t);if(i)throw i;let a=je(e.location,n);if(Ae&&!Rn.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Rn.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Bn({routeContext:e,match:t,children:n}){let i=r.useContext(ln);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(Z.Provider,{value:e},n)}function Vn(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);f(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:ke(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||In,s&&(c<0&&l===0?(nr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(Bn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Ln,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Hn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Un(e){let t=r.useContext(ln);return f(t,Hn(e)),t}function Wn(e){let t=r.useContext(un);return f(t,Hn(e)),t}function Gn(e){let t=r.useContext(Z);return f(t,Hn(e)),t}function Kn(e){let t=Gn(e),n=t.matches[t.matches.length-1];return f(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function qn(){return Kn(`useRouteId`)}function Jn(){return Wn(`useNavigation`).navigation}function Yn(){let{matches:e,loaderData:t}=Wn(`useMatches`);return r.useMemo(()=>e.map(e=>te(e,t)),[e,t])}function Xn(){let e=Wn(`useLoaderData`),t=Kn(`useLoaderData`);return e.loaderData[t]}function Zn(e){return Wn(`useRouteLoaderData`).loaderData[e]}function Qn(){let e=Wn(`useActionData`),t=Kn(`useLoaderData`);return e.actionData?e.actionData[t]:void 0}function $n(){let e=r.useContext(_n),t=Wn(`useRouteError`),n=Kn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function er(){let{router:e}=Un(`useNavigate`),t=Kn(`useNavigate`),n=r.useRef(!1);return Dn(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{p(n.current,En),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var tr={};function nr(e,t,n){!t&&!tr[e]&&(tr[e]=!0,p(!1,n))}var rr={};function ir(e,t){!e&&!rr[t]&&(rr[t]=!0,console.warn(t))}var ar=r.useOptimistic,or=()=>void 0;function sr(e){return ar?ar(e):[e,or]}function cr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&p(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&p(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:r.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&p(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var lr=[`HydrateFallback`,`hydrateFallbackElement`],ur=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>
4{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function dr({router:e,flushSync:t,onError:n,unstable_useTransitions:i}){i=fn()||i;let[a,o]=r.useState(e.state),[s,c]=sr(a),[l,u]=r.useState(),[d,f]=r.useState({isTransitioning:!1}),[p,m]=r.useState(),[h,g]=r.useState(),[_,v]=r.useState(),y=r.useRef(new Map),b=r.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:a.location,params:a.matches[0]?.params??{},unstable_pattern:ke(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),ir(d===!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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ir(_==null||b,"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."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):r.startTransition(()=>{i===!0&&c(e=>fr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,n]);r.useLayoutEffect(()=>e.subscribe(b),[e,b]);let x=s.initialized;r.useLayoutEffect(()=>{!x&&e.state.initialized&&b(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[x,b,e.state]),r.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new ur)},[d]),r.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):r.startTransition(()=>{i===!0&&c(e=>fr(e,t)),o(t)}),await n});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),r.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),r.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let S=r.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),C=e.basename||`/`,w=r.useMemo(()=>({router:e,navigator:S,static:!1,basename:C,onError:n}),[e,S,C,n]);return r.createElement(r.Fragment,null,r.createElement(ln.Provider,{value:w},r.createElement(un.Provider,{value:s},r.createElement(mn.Provider,{value:y.current},r.createElement(pn.Provider,{value:d},r.createElement(_r,{basename:C,location:s.location,navigationType:s.historyAction,navigator:S,unstable_useTransitions:i},r.createElement(pr,{routes:e.routes,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function fr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var pr=r.memo(mr);function mr({routes:e,future:t,state:n,isStatic:r,onError:i}){return Pn(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function hr({basename:e,children:t,initialEntries:n,initialIndex:i,unstable_useTransitions:a}){let o=r.useRef();o.current??=u({initialEntries:n,initialIndex:i,v5Compat:!0});let s=o.current,[c,l]=r.useState({action:s.action,location:s.location}),d=r.useCallback(e=>{a===!1?l(e):r.startTransition(()=>l(e))},[a]);return r.useLayoutEffect(()=>s.listen(d),[s,d]),r.createElement(_r,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:s,unstable_useTransitions:a})}function gr(e){return jn(e.context)}function _r({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,unstable_useTransitions:s}){f(!wn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=v(n));let{pathname:u=`/`,search:d=``,hash:m=``,state:h=null,key:g=`default`,unstable_mask:_}=n,y=r.useMemo(()=>{let e=B(u,c);return e==null?null:{location:{pathname:e,search:d,hash:m,state:h,key:g,unstable_mask:_},navigationType:i}},[c,u,d,m,h,g,i,_]);
4return p(y!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(X.Provider,{value:l},r.createElement(gn.Provider,{children:t,value:y}))}r.Component;function vr(){return{params:Mn(),loaderData:Xn(),actionData:Qn(),matches:Yn()}}function yr(e){return function(){let t=vr();return r.createElement(e,t)}}function br(){return{params:Mn(),loaderData:Xn(),actionData:Qn()}}function xr(e){return function(){let t=br();return r.createElement(e,t)}}function Sr(){return{params:Mn(),loaderData:Xn(),actionData:Qn(),error:$n()}}function Cr(e){return function(){let t=Sr();return r.createElement(e,t)}}var wr=`get`,Tr=`application/x-www-form-urlencoded`;function Er(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Dr(e){return Er(e)&&e.tagName.toLowerCase()===`button`}function Or(e){return Er(e)&&e.tagName.toLowerCase()===`form`}function kr(e){return Er(e)&&e.tagName.toLowerCase()===`input`}function Ar(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jr(e,t){return e.button===0&&(!t||t===`_self`)&&!Ar(e)}function Mr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Nr(e,t){let n=Mr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Pr=null;function Fr(){if(Pr===null)try{new FormData(document.createElement(`form`),0),Pr=!1}catch{Pr=!0}return Pr}var Ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Lr(e){return e!=null&&!Ir.has(e)?(p(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tr}"`),null):e}function Rr(e,t){let n,r,i,a,o;if(Or(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||wr,i=Lr(e.getAttribute(`enctype`))||Tr,a=new FormData(e)}else if(Dr(e)||kr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?B(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||wr,i=Lr(e.getAttribute(`formenctype`))||Lr(o.getAttribute(`enctype`))||Tr,a=new FormData(o,e),!Fr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Er(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=wr,r=null,i=Tr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var zr=-1,Br=-2,Vr=-3,Hr=-4,Ur=-5,Wr=-6,Gr=-7,Kr=`B`,qr=`D`,Jr=`E`,Yr=`M`,Xr=`N`,Zr=`P`,Qr=`R`,$r=`S`,ei=`Y`,ti=`U`,ni=`Z`,ri=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ii=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function ai(){let e=new TextDecoder,t=``;return new TransformStream({transform(n,r){let i=e.decode(n,{stream:!0}),a=(t+i).split(` 5`);t=a.pop()||``;for(let e of a)r.enqueue(e)},flush(e){t&&e.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var oi=typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0;function si(e){let{hydrated:t,values:n}=this;if(typeof e==`number`)return ci.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();let r=n.length;for(let t of e)n.push(t);return t.length=n.length,ci.call(this,r)}function ci(e){let{hydrated:t,values:n,deferred:r,plugins:i}=this,a,o=[[e,e=>{a=e}]],s=[];for(;o.length>0;){let[e,a]=o.pop();switch(e){case Gr:a(void 0);continue;case Ur:a(null);continue;case Br:a(NaN);continue;case Wr:a(1/0);continue;case Vr:a(-1/0);continue;case Hr:a(-0);continue}if(t[e]){a(t[e]);continue}let c=n[e];if(!c||typeof c!=`object`){t[e]=c,a(c);continue}if(Array.isArray(c))if(typeof c[0]==`string`){let[n,l,u]=c;switch(n){case qr:a(t[e]=new Date(l));continue;case ti:a(t[e]=new URL(l));continue;case Kr:a(t[e]=BigInt(l));continue;case Qr:a(t[e]=new RegExp(l,u));continue;case ei:a(t[e]=Symbol.for(l));continue;case $r:let n=new Set;t[e]=n;for(let e=c.length-1;e>0;e--)o.push([c[e],e=>{n.add(e)}]);a(n);continue;case Yr:let d=new Map;t[e]=d;for(let e=c.length-2;e>0;e-=2){let t=[];o.push([c[e+1],e=>{t[1]=e}]),o.push([c[e],e=>{t[0]=e}]),s.push(()=>{d.set(t[0],t[1])})}a(d);continue;case Xr:let f=Object.create(null);t[e]=f;for(let e of Object.keys(l).reverse()){let t=[];o.push([l[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{f[t[0]]=t[1]})}a(f);continue;case Zr:if(t[l])a(t[e]=t[l]);else{let n=new ii;r[l]=n,a(t[e]=n.promise)}continue;case Jr:let[,p,m]=c,h=m&&oi&&ri.includes(m)&&m in oi&&typeof oi[m]==`function`?new oi[m](p):Error(p);t[e]=h,a(h);continue;case ni:a(t[e]=t[l]);continue;default:if(Array.isArray(i)){let n=[],r=c.slice(1);for(let e=0;e<r.length;e++){let t=r[e];o.push([t,t=>{n[e]=t}])}s.push(()=>{for(let r of i){let i=r(c[0],...n);if(i){a(t[e]=i.value);return}}throw SyntaxError()});continue}throw SyntaxError()}}else{let n=[];t[e]=n;for(let e=0;e<c.length;e++){let t=c[e];t!==zr&&o.push([t,t=>{n[e]=t}])}a(n);continue}else{let n={};t[e]=n;for(let e of Object.keys(c).reverse()){let t=[];o.push([c[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{n[t[0]]=t[1]})}a(n);continue}}for(;s.length>0;)s.pop()();return a}
5async function li(e,t){let{plugins:n}=t??{},r=new ii,i=e.pipeThrough(ai()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:n},o=await ui.call(a,i),s=r.promise;return o.done?r.resolve():s=di.call(a,i).then(r.resolve).catch(e=>{for(let t of Object.values(a.deferred))t.reject(e);r.reject(e)}),{done:s.then(()=>i.closed),value:o.value}}async function ui(e){let t=await e.read();if(!t.value)throw SyntaxError();let n;try{n=JSON.parse(t.value)}catch{throw SyntaxError()}return{done:t.done,value:si.call(this,n)}}async function di(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;let n=t.value;switch(n[0]){case Zr:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=si.call(this,a);r.resolve(o);break}case Jr:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=si.call(this,a);r.reject(o);break}default:throw SyntaxError()}t=await e.read()}}async function fi(e){let t={signal:e.signal};if(e.method!==`GET`){t.method=e.method;let n=e.headers.get(`Content-Type`);n&&/\bapplication\/json\b/.test(n)?(t.headers={"Content-Type":n},t.body=JSON.stringify(await e.json())):n&&/\btext\/plain\b/.test(n)?(t.headers={"Content-Type":n},t.body=await e.text()):n&&/\bapplication\/x-www-form-urlencoded\b/.test(n)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var pi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},mi=/[&><\u2028\u2029]/g;function hi(e){return e.replace(mi,e=>pi[e])}function $(e,t){if(e===!1||e==null)throw Error(t)}var gi=Symbol(`SingleFetchRedirect`),_i=class extends Error{},vi=new Set([100,101,204,205]);function yi(e,t,n,r,i,a){let o=bi(e,e=>{let r=t.routes[e.route.id];$(r,`Route not found in manifest`);let i=n[e.route.id];return{hasLoader:r.hasLoader,hasClientLoader:r.hasClientLoader,hasS
5houldRevalidate:!!i?.shouldRevalidate}},Oi,r,i,a);return async e=>e.runClientMiddleware(o)}function bi(e,t,n,r,i,a,o=()=>!0){return async s=>{let{request:c,matches:l,fetcherKey:u}=s,d=e();if(c.method!==`GET`)return xi(s,n,i,a);let f=l.some(e=>{let{hasLoader:n,hasClientLoader:r}=t(e);return e.shouldCallHandler()&&n&&!r});return!r&&!f?Si(s,t,n,i,a):u?Ti(s,n,i,a):Ci(s,d,t,n,r,i,a,o)}}async function xi(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No action match found`);let a,o=await i.resolve(async o=>await o(async()=>{let{data:o,status:s}=await t(e,n,r,[i.route.id]);return a=s,Ai(o,i.route.id)}));return qt(o.result)||Oe(o.result)||Kt(o.result)?{[i.route.id]:o}:{[i.route.id]:{type:o.type,result:we(o.result,a)}}}async function Si(e,t,n,r,i){let a=e.matches.filter(e=>e.shouldCallHandler()),o={};return await Promise.all(a.map(a=>a.resolve(async s=>{try{let{hasClientLoader:c}=t(a),l=a.route.id,u=c?await s(async()=>{let{data:t}=await n(e,r,i,[l]);return Ai(t,l)}):await s();o[a.route.id]={type:`data`,result:u}}catch(e){o[a.route.id]={type:`error`,result:e}}}))),o}async function Ci(e,t,n,r,i,a,o,s=()=>!0){let c=new Set,l=!1,u=e.matches.map(()=>ji()),d=ji(),f={},p=Promise.all(e.matches.map(async(t,i)=>t.resolve(async p=>{u[i].resolve();let m=t.route.id,{hasLoader:h,hasClientLoader:g,hasShouldRevalidate:_}=n(t),v=!t.shouldRevalidateArgs||t.shouldRevalidateArgs.actionStatus==null||t.shouldRevalidateArgs.actionStatus<400;if(!t.shouldCallHandler(v)){l||=t.shouldRevalidateArgs!=null&&h&&_===!0;return}if(s(t)&&g){h&&(l=!0);try{f[m]={type:`data`,result:await p(async()=>{let{data:t}=await r(e,a,o,[m]);return Ai(t,m)})}}catch(e){f[m]={type:`error`,result:e}}return}h&&c.add(m);try{f[m]={type:`data`,result:await p(async()=>Ai(await d.promise,m))}}catch(e){f[m]={type:`error`,result:e}}})));if(await Promise.all(u.map(e=>e.promise)),(!t.state.initialized&&t.state.navigation.state===`idle`||c.size===0)&&!window.__reactRouterHdrActive)d.resolve({routes:{}});else{let t=i&&l&&c.size>0?[...c.keys()]:void 0;try{let n=await r(e,a,o,t);d.resolve(n.data)}catch(e){d.reject(e)}}return await p,await wi(d.promise,e.matches,c,f),f}async function wi(e,t,n,r){try{let i,a=await e;if(`routes`in a){for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if(`error`in t){i=t.error,r[e.route.id]?.result??(r[e.route.id]={type:`error`,result:i});break}}}i!==void 0&&Array.from(n.values()).forEach(e=>{r[e].result instanceof _i&&(r[e].result=i)})}catch{}}async function Ti(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No fetcher match found`);let a=i.route.id,o=await i.resolve(async i=>i(async()=>{let{data:i}=await t(e,n,r,[a]);return Ai(i,a)}));return{[i.route.id]:o}}function Ei(e){let t=e.searchParams.getAll(`index`);e.searchParams.delete(`index`);let n=[];for(let e of t)e&&n.push(e);for(let t of n)e.searchParams.append(`index`,t);return e}function Di(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&B(i.pathname,t)===`/`?i.pathname=`${ye(t)}/_root.${r}`:i.pathname=`${ye(i.pathname)}.${r}`,i}async function Oi(e,t,n,r){let{request:i}=e,a=Di(i.url,t,n,`data`);i.method===`GET`&&(a=Ei(a),r&&a.searchParams.set(`_routes`,r.join(`,`)));let o=await fetch(a,await fi(i));if(o.status>=400&&!o.headers.has(`X-Remix-Response`))throw new De(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has(`X-Remix-Redirect`))return{status:202,data:{redirect:{redirect:o.headers.get(`X-Remix-Redirect`),status:Number(o.headers.get(`X-Remix-Status`)||`302`),revalidate:o.headers.get(`X-Remix-Revalidate`)===`true`,reload:o.headers.get(`X-Remix-Reload-Document`)===`true`,replace:o.headers.get(`X-Remix-Replace`)===`true`}}};if(vi.has(o.status)){let e={};return r&&i.method!==`GET`&&(e[r[0]]={data:void 0}),{status:o.status,data:{routes:e}}}$(o.body,`No response body to decode`);try{let e=await ki(o.body,window),t;if(i.method===`GET`){let n=e.value;t=gi in n?{redirect:n[gi]}:{routes:n}}else{let n=e.value,i=r?.[0];$(i,`No routeId found for single fetch call decoding`),t=`redirect`in n?{redirect:n}:{routes:{[i]:n}}}return{status:o.status,data:t}}catch{throw Error(`Unable to decode turbo-stream response`)}}function ki(e,t){return li(e,{plugins:[(e,...n)=>{if(e===`SanitizedError`){let[e,r,i]=n,a=Error;e&&ri.includes(e)&&e in t&&typeof t[e]==`function`&&(a=t[e]);let o=new a(r);return o.stack=i,{value:o}}if(e===`ErrorResponse`){let[e,t,r]=n;return{value:new De(t,r,e)}}if(e===`SingleFetchRedirect`)return{value:{[gi]:n[0]}};if(e===`SingleFetchClassInstance`)return{value:n[0]};if(e===`SingleFetchFallback`)return{value:void 0}}]})}function Ai(e,t){if(`redirect`in e){let{redirect:t,revalidate:n,reload:r,replace:i,status:a}=e.redirect;throw Te(t,{status:a,headers:{...n?{"X-Remix-Revalidate":`yes`}:null,...r?{"X-Remix-Reload-Document":`yes`}:null,...i?{"X-Remix-Replace":`yes`}:null}})}let n=e.routes[t];if(n==null)throw new _i(`No result found for routeId "${t}"`);if(`error`in n)throw n.error;if(`data`in n)return n.data;throw Error(`Invalid response found for routeId "${t}"`)}function ji(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}async function Mi(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
5isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ni(e,t,n){return Gi(e.map(e=>{let r=t[e.route.id],i=n.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:`stylesheet`,href:e})):[],r?.links?.()||[]]}).flat(2),Hi(e,n))}function Pi(e){return e.css?e.css.map(e=>({rel:`stylesheet`,href:e})):[]}async function Fi(e){if(!e.css)return;let t=Pi(e);await Promise.all(t.map(Li))}async function Ii(e,t){if(!e.css&&!t.links||!qi())return;let n=[];if(e.css&&n.push(...Pi(e)),t.links&&n.push(...t.links()),n.length===0)return;let r=[];for(let e of n)!Ri(e)&&e.rel===`stylesheet`&&r.push({...e,rel:`preload`,as:`style`});await Promise.all(r.map(Li))}async function Li(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let n=document.createElement(`link`);Object.assign(n,e);function r(){document.head.contains(n)&&document.head.removeChild(n)}n.onload=()=>{r(),t()},n.onerror=()=>{r(),t()},document.head.appendChild(n)})}function Ri(e){return e!=null&&typeof e.page==`string`}function zi(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 Bi(e,t,n){return Gi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Mi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(zi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Vi(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Hi(e,t,{includeHydrateFallback:n}={}){return Ui(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ui(e){return[...new Set(e)]}function Wi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Gi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ri(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Wi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Ki;function qi(){if(Ki!==void 0)return Ki;let e=document.createElement(`link`);return Ki=e.relList.supports(`preload`),e=null,Ki}function Ji(){return r.createElement(za,{title:`Loading...`,renderScripts:!0},r.createElement(`script`,{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 Yi(e){let t={};return Object.values(e).forEach(e=>{if(e){let n=e.parentId||``;t[n]||(t[n]=[]),t[n].push(e)}}),t}function Xi(e,t,n){let i=ia(t),a=t.HydrateFallback&&(!n||e.id===`root`)?t.HydrateFallback:e.id===`root`?Ji:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id===`root`?()=>r.createElement(Ra,{error:$n()}):void 0;return e.id===`root`&&t.Layout?{...i?{element:r.createElement(t.Layout,null,r.createElement(i,null))}:{Component:i},...o?{errorElement:r.createElement(t.Layout,null,r.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:r.createElement(t.Layout,null,r.createElement(a,null))}:{HydrateFallback:a}}:{Component:i,ErrorBoundary:o,HydrateFallback:a}}function Zi(e,t,n,r,i,a){return ea(t,n,r,i,a,``,Yi(t),e)}function Qi(e,t){if(e===`loader`&&!t.hasLoader||e===`action`&&!t.hasAction){let n=`You are trying to call ${e===`action`?`serverAction()`:`serverLoader()`} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new De(400,`Bad Request`,Error(n),!0)}}function $i(e,t){let n=e===`clientAction`?`a`:`an`,r=`Route "${t}" does not have ${n} ${e}, but you are trying to submit to it. To fix this, please add ${n} \`${e}\` function to the route`;throw console.error(r),new De(405,`Method Not Allowed`,Error(r),!0)}function ea(e,t,r,i,a,o=``,s=Yi(e),c){return(s[o]||[]).map(o=>{let l=t[o.id];function u(e){return $(typeof e==`function`,`No single fetch function available for route handler`),e()}function d(e){return o.hasLoader?u(e):Promise.resolve(null)}function f(e){if(!o.hasAction)throw $i(`action`,o.id);return u(e)}function p(e){n(()=>import(e),[])}function m(e){e.clientActionModule&&p(e.clientActionModule),e.clientLoaderModule&&p(e.clientLoaderModule)}async function h(e){let n=t[o.id],r=n?Ii(o,n):Promise.resolve();try{return e()}finally{await r}}let g={id:o.id,index:o.index,path:o.path};if(l){Object.assign(g,{...g,...Xi(o,l,a),middleware:l.clientMiddleware,handle:l.handle,shouldRevalidate:ta(g.path,l,o,i,c)});let e=r&&r.loaderData&&o.id in r.loaderData,t=e?r?.loaderData?.[o.id]:void 0,n=r&&r.errors&&o.id in r.errors,s=n?r?.errors?.[o.id]:void 0,u=c==null&&(l.clientLoader?.hydrate===!0||!o.hasLoader);g.loader=async({request:r,params:i,context:a,unstable_pattern:c,unstable_url:f},p)=>{try{return await h(async()=>($(l,"No `routeModule` available for critical-route loader"),l.clientLoader?l.clientLoader({request:r,params:i,context:a,unstable_pattern:c,unstable_url:f,async serverLoader(){if
12(Qi(`loader`,o),u){if(e)return t;if(n)throw s}return d(p)}}):d(p)))}finally{u=!1}},g.loader.hydrate=aa(o.id,l.clientLoader,o.hasLoader,a),g.action=({request:e,params:t,context:n,unstable_pattern:r,unstable_url:i},s)=>h(async()=>{if($(l,"No `routeModule` available for critical-route action"),!l.clientAction){if(a)throw $i(`clientAction`,o.id);return f(s)}return l.clientAction({request:e,params:t,context:n,unstable_pattern:r,unstable_url:i,async serverAction(){return Qi(`action`,o),f(s)}})})}else{o.hasClientLoader||(g.loader=(e,t)=>h(()=>d(t))),o.hasClientAction||(g.action=(e,t)=>h(()=>{if(a)throw $i(`clientAction`,o.id);return f(t)}));let e;async function r(){return e||=(async()=>{(o.clientLoaderModule||o.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=ra(o,t);return m(o),await e})(),await e}g.lazy={loader:o.hasClientLoader?async()=>{let{clientLoader:e}=o.clientLoaderModule?await n(()=>import(o.clientLoaderModule),[]):await r();return $(e,"No `clientLoader` export found"),(t,n)=>e({...t,async serverLoader(){return Qi(`loader`,o),d(n)}})}:void 0,action:o.hasClientAction?async()=>{let e=o.clientActionModule?n(()=>import(o.clientActionModule),[]):r();m(o);let{clientAction:t}=await e;return $(t,"No `clientAction` export found"),(e,n)=>t({...e,async serverAction(){return Qi(`action`,o),f(n)}})}:void 0,middleware:o.hasClientMiddleware?async()=>{let{clientMiddleware:e}=o.clientMiddlewareModule?await n(()=>import(o.clientMiddlewareModule),[]):await r();return $(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await r();return ta(g.path,e,o,i,c)},handle:async()=>(await r()).handle,Component:async()=>(await r()).Component,ErrorBoundary:o.hasErrorBoundary?async()=>(await r()).ErrorBoundary:void 0}}let _=ea(e,t,r,i,a,o.id,s,c);return _.length>0&&(g.children=_),g})}function ta(e,t,n,r,i){if(i)return na(n.id,t.shouldRevalidate,i);if(!r&&n.hasLoader&&!n.hasClientLoader){let n=e?le(e)[1].map(e=>e.paramName):[],r=e=>n.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:r(t)})}else return e=>r(e)}return t.shouldRevalidate}function na(e,t,n){let r=!1;return i=>r?t?t(i):i.defaultShouldRevalidate:(r=!0,n.has(e))}async function ra(e,t){let n=Mi(e,t),r=Fi(e),i=await n;return await Promise.all([r,Ii(e,i)]),{Component:ia(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}function ia(e){if(e.default!=null&&!(typeof e.default==`object`&&Object.keys(e.default).length===0))return e.default}function aa(e,t,n,r){return r&&e!==`root`||t!=null&&(t.hydrate===!0||n!==!0)}var oa=new Set,sa=1e3,ca=new Set,la=7680;function ua(e,t){return e.mode===`lazy`&&t===!0}function da({sri:e,...t},n){let r=new Set(n.state.matches.map(e=>e.route.id)),i=n.state.location.pathname.split(`/`).filter(Boolean),a=[`/`];for(i.pop();i.length>0;)a.push(`/${i.join(`/`)}`),i.pop();a.forEach(e=>{let t=j(n.routes,e,n.basename);t&&t.forEach(e=>r.add(e.route.id))});let o=[...r].reduce((e,n)=>Object.assign(e,{[n]:t.routes[n]}),{});return{...t,routes:o,sri:e?!0:void 0}}function fa(e,t,n,r,i,a,o){if(ua(i,r))return async({path:s,patch:c,signal:l,fetcherKey:u})=>{if(ca.has(s))return;let{state:d}=e();await ga([s],u?window.location.href:_(d.navigation.location||d.location),t,n,r,a,o,i.manifestPath,c,l)}}function pa(e,t,n,i,a,o){r.useEffect(()=>{if(!ua(a,i)||window.navigator?.connection?.saveData===!0)return;function r(e){let t=e.tagName===`FORM`?e.getAttribute(`action`):e.getAttribute(`href`);if(!t)return;let n=e.tagName===`A`?e.pathname:new URL(t,window.location.origin).pathname;ca.has(n)||oa.add(n)}async function s(){document.querySelectorAll(`a[data-discover], form[data-discover]`).forEach(r);let s=Array.from(oa.keys()).filter(e=>ca.has(e)?(oa.delete(e),!1):!0);if(s.length!==0)try{await ga(s,null,t,n,i,o,e.basename,a.manifestPath,e.patchRoutes)}catch(e){console.error(`Failed to fetch manifest patches`,e)}}let c=va(s,100);s();let l=new MutationObserver(()=>c());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-discover`,`href`,`action`]}),()=>l.disconnect()},[i,o,t,n,e,a])}function ma(e,t){let n=e||`/__manifest`;return t==null?n:H([t,n])}var ha=`react-router-manifest-version`;async function ga(e,t,n,r,i,a,o,s,c,l){let u=new URLSearchParams;u.set(`paths`,e.sort().join(`,`)),u.set(`version`,n.version);let d=new URL(ma(s,o),window.location.origin);if(d.search=u.toString(),d.toString().length>la){oa.clear();return}let f;try{let e=await fetch(d,{signal:l});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);if(e.status===204&&e.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(ha)===n.version){console.error(`Unable to discover routes due to manifest version mismatch.`);return}sessionStorage.setItem(ha,n.version)}catch{}window.location.href=t,console.warn(`Detected manifest version mismatch, reloading...`),await new Promise(()=>{})}else if(e.status>=400)throw Error(await e.text());try{sessionStorage.removeItem(ha)}catch{}f=await e.json()}catch(e){if(l?.aborted)return;throw e}let p=new Set(Object.keys(n.routes)),m=Object.values(f).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(n.routes,m),e.forEach(e=>_a(e,ca));let h=new Set;Object.values(m).forEach(e=>{e&&(!e.parentId||!m[e.parentId])&&h.add(e.parentId)}),h.forEach(e=>c(e||null,ea(m,r,null,i,a,e)))}function _a(e,t){if(t.size>=sa){let e=t.values().next().value;t.delete(e)}t.add(e)}function va(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function ya(){let e=r.useContext(ln);return $(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ba(){let e=r.useContext(un);return $(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var xa=r.createContext(void 0);xa.displayName=`FrameworkContext`;function Sa(){let e=r.useContext(xa);return $(e,`You must render this element inside a <HydratedRouter> element`),e}function Ca(e,t){let n=r.useContext(xa),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:wa(c,m),onBlur:wa(l,h),onMouseEnter:wa(u,m),onMouseLeave:wa(d,h),onTouchStart:wa(f,m)}]:[o,p,{}]:[!1,p,{}]}function wa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ta(e,t,n){if(n&&!Ma)return[e[0]];if(t){let n=e.findIndex(e=>t[e.route.id]!==void 0);return e.slice(0,n+1)}return e}var Ea=`data-react-router-critical-css`;function Da({nonce:e,crossOrigin:t}){let{isSpaMode:n,manifest:i,routeModules:a,criticalCss:o}=Sa(),{errors:s,matches:c}=ba(),l=Ta(c,s,n),u=r.useMemo(()=>Ni(l,a,i),[l,a,i]);return r.createElement(r.Fragment,null,typeof o==`string`?r.createElement(`style`,{[Ea]:``,nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o==`object`?r.createElement(`link`,{[Ea]:``,rel:`stylesheet`,href:o.href,nonce:e,crossOrigin:t}):null,u.map(({key:n,link:i})=>Ri(i)?r.createElement(Oa,{key:n,nonce:e,...i,crossOrigin:i.crossOrigin??t}):r.createElement(`link`,{key:n,nonce:e,...i,crossOrigin:i.crossOrigin??t})))}function Oa({page:e,...t}){let n=fn(),{router:i}=ya(),a=r.useMemo(()=>j(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?r.createElement(Aa,{page:e,matches:a,...t}):r.createElement(ja,{page:e,matches:a,...t}):null}function ka(e){let{manifest:t,routeModules:n}=Sa(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Bi(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Aa({page:e,matches:t,...n}){let i=Q(),{future:a}=Sa(),{basename:o}=ya(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Di(e,o,a.unstable_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ja({page:e,matches:t,...n}){let i=Q(),{future:a,manifest:o,routeModules:s}=Sa(),{basename:c}=ya(),{loaderData:l,matches:u}=ba(),d=r.useMemo(()=>Vi(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Vi(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>
12{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Di(e,c,a.unstable_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.unstable_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Hi(f,o),[f,o]),h=ka(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}var Ma=!1;function Na(){Ma=!0}function Pa(e){let{manifest:t,serverHandoffString:n,isSpaMode:i,renderMeta:a,routeDiscovery:o,ssr:s}=Sa(),{router:c,static:l,staticContext:u}=ya(),{matches:d}=ba(),f=fn(),p=ua(o,s);a&&(a.didRenderScripts=!0);let m=Ta(d,null,i);r.useEffect(()=>{Na()},[]);let h=r.useMemo(()=>{if(f)return null;let i=u?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:` `,a=l?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:``}${p?``:`import ${JSON.stringify(t.url)}`}; 13${m.map((e,n)=>{let r=`route${n}`,i=t.routes[e.route.id];$(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:o,clientMiddlewareModule:s,hydrateFallbackModule:c,module:l}=i,u=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...o?[{module:o,varName:`${r}_clientLoader`}]:[],...s?[{module:s,varName:`${r}_clientMiddleware`}]:[],...c?[{module:c,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return u.length===1?`import * as ${r} from ${JSON.stringify(l)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join(` 14`),`const ${r} = {${u.map(e=>`...${e.varName}`).join(`,`)}};`].join(` 15`)}).join(` 16`)} 17 ${p?`window.__reactRouterManifest = ${JSON.stringify(da(t,c),null,2)};`:``} 18 window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(`,`)}}; 19 20import(${JSON.stringify(t.entry.module)});`:` `;return r.createElement(r.Fragment,null,r.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:void 0}),r.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:`module`,async:!0}))},[]),g=Ma||f?[]:Fa(t.entry.imports.concat(Hi(m,t,{includeHydrateFallback:!0}))),_=typeof t.sri==`object`?t.sri:{};return ir(!f,`The <Scripts /> element is a no-op when using RSC and can be safely removed.`),Ma||f?null:r.createElement(r.Fragment,null,typeof t.sri==`object`?r.createElement(`script`,{...e,"rr-importmap":``,type:`importmap`,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:_})}}):null,p?null:r.createElement(`link`,{rel:`modulepreload`,href:t.url,crossOrigin:e.crossOrigin,integrity:_[t.url],suppressHydrationWarning:!0}),r.createElement(`link`,{rel:`modulepreload`,href:t.entry.module,crossOrigin:e.crossOrigin,integrity:_[t.entry.module],suppressHydrationWarning:!0}),g.map(t=>r.createElement(`link`,{key:t,rel:`modulepreload`,href:t,crossOrigin:e.crossOrigin,integrity:_[t],suppressHydrationWarning:!0})),h)}function Fa(e){return[...new Set(e)]}function Ia(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var La=class extends r.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||t.error,location:t.location}:{error:e.error||null,location:e.location}}render(){return this.state.error?r.createElement(Ra,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Ra({error:e,isOutsideRemixApp:t}){console.error(e);let n=r.createElement(`script`,{dangerouslySetInnerHTML:{__html:` 21 console.log( 22 "ð¿ 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." 23 ); 24 `}});if(Oe(e))return r.createElement(za,{title:`Unhandled Thrown Response!`},r.createElement(`h1`,{style:{fontSize:`24px`}},e.status,` `,e.statusText),n);let i;if(e instanceof Error)i=e;else{let t=e==null?`Unknown Error`:typeof e==`object`&&`toString`in e?e.toString():JSON.stringify(e);i=Error(t)}
24return r.createElement(za,{title:`Application Error!`,isOutsideRemixApp:t},r.createElement(`h1`,{style:{fontSize:`24px`}},`Application Error`),r.createElement(`pre`,{style:{padding:`2rem`,background:`hsla(10, 50%, 50%, 0.1)`,color:`red`,overflow:`auto`}},i.stack),n)}function za({title:e,renderScripts:t,isOutsideRemixApp:n,children:i}){let{routeModules:a}=Sa();return a.root?.Layout&&!n?i:r.createElement(`html`,{lang:`en`},r.createElement(`head`,null,r.createElement(`meta`,{charSet:`utf-8`}),r.createElement(`meta`,{name:`viewport`,content:`width=device-width,initial-scale=1,viewport-fit=cover`}),r.createElement(`title`,null,e)),r.createElement(`body`,null,r.createElement(`main`,{style:{fontFamily:`system-ui, sans-serif`,padding:`2rem`}},i,t?r.createElement(Pa,null):null)))}var Ba=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ba&&(window.__reactRouterVersion=`7.14.2`)}catch{}function Va({basename:e,children:t,history:n,unstable_useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(_r,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,unstable_useTransitions:i})}Va.displayName=`unstable_HistoryRouter`;var Ha=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ua=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,unstable_mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=r.useContext(X),y=typeof u==`string`&&Ha.test(u),b=je(u,g);u=b.to;let x=Cn(u,{relative:i}),S=Q(),C=null;if(s){let e=_e(s,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:H([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Ca(n,m),D=Xa(u,{replace:o,unstable_mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||a),A=r.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Ia(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?r.createElement(r.Fragment,null,A,r.createElement(Oa,{page:x})):A});Ua.displayName=`Link`;var Wa=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Nn(o,{relative:l.relative}),f=Q(),p=r.useContext(un),{navigator:m,basename:h}=r.useContext(X),g=p!=null&&co(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=B(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return r.createElement(Ua,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Wa.displayName=`NavLink`;var Ga=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=wr,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=r.useContext(X),_=eo(),v=to(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Ha.test(c);return r.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?r.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Ga.displayName=`Form`;function Ka({getKey:e,storageKey:t,...n}){let i=r.useContext(xa),{basename:a}=r.useContext(X),o=Q(),s=Yn();oo({getKey:e,storageKey:t});let c=r.useMemo(()=>
24{if(!i||!e)return null;let t=ao(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${hi(JSON.stringify(t||ro))}, ${hi(JSON.stringify(c))})`}})}Ka.displayName=`ScrollRestoration`;function qa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ja(e){let t=r.useContext(ln);return f(t,qa(e)),t}function Ya(e){let t=r.useContext(un);return f(t,qa(e)),t}function Xa(e,{target:t,replace:n,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let d=On(),f=Q(),p=Nn(e,{relative:s});return r.useCallback(m=>{if(jr(m,t)){m.preventDefault();let t=n===void 0?_(f)===_(p):n,h=()=>d(e,{replace:t,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l});u?r.startTransition(()=>h()):h()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function Za(e){p(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=r.useRef(Mr(e)),n=r.useRef(!1),i=Q(),a=r.useMemo(()=>Nr(i.search,n.current?null:t.current),[i.search]),o=On();return[a,r.useCallback((e,t)=>{let r=Mr(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var Qa=0,$a=()=>`__${String(++Qa)}__`;function eo(){let{router:e}=Ja(`useSubmit`),{basename:t}=r.useContext(X),n=qn(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rr(e,t);r.navigate===!1?await i(r.fetcherKey||$a(),n,r.action||o,{unstable_defaultShouldRevalidate:r.unstable_defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync}):await a(r.action||o,{unstable_defaultShouldRevalidate:r.unstable_defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function to(e,{relative:t}={}){let{basename:n}=r.useContext(X),i=r.useContext(Z);f(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Nn(e||`.`,{relative:t})},s=Q();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:H([n,o.pathname])),_(o)}function no({key:e}={}){let{router:t}=Ja(`useFetcher`),n=Ya(`useFetcher`),i=r.useContext(mn),a=r.useContext(Z),o=a.matches[a.matches.length-1]?.route.id;f(i,`useFetcher must be used inside a FetchersContext`),f(a,`useFetcher must be used inside a RouteContext`),f(o!=null,`useFetcher can only be used on routes that contain a unique "id"`);let s=r.useId(),[c,l]=r.useState(e||s);e&&e!==c&&l(e);let{deleteFetcher:u,getFetcher:d,resetFetcher:p,fetch:m}=t;r.useEffect(()=>(d(c),()=>u(c)),[u,d,c]);let h=r.useCallback(async(e,t)=>{f(o,`No routeId available for fetcher.load()`),await m(c,o,e,t)},[c,o,m]),g=eo(),_=r.useCallback(async(e,t)=>{await g(e,{...t,navigate:!1,fetcherKey:c})},[c,g]),v=r.useCallback(e=>p(c,e),[p,c]),y=r.useMemo(()=>{let e=r.forwardRef((e,t)=>r.createElement(Ga,{...e,navigate:!1,fetcherKey:c,ref:t}));return e.displayName=`fetcher.Form`,e},[c]),b=n.fetchers.get(c)||Ke,x=i.get(c);return r.useMemo(()=>({Form:y,submit:_,load:h,reset:v,...b,data:x}),[y,_,h,v,b,x])}var ro=`react-router-scroll-positions`,io={};function ao(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:B(e.pathname,n)||e.pathname},t)),i??=e.key,i}function oo({getKey:e,storageKey:t}={}){let{router:n}=Ja(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=Ya(`useScrollRestoration`),{basename:o}=r.useContext(X),s=Q(),c=Yn(),l=Jn();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),so(r.useCallback(()=>
24{if(l.state===`idle`){let t=ao(s,c,o,e);io[t]=window.scrollY}try{sessionStorage.setItem(t||ro,JSON.stringify(io))}catch(e){p(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ro);e&&(io=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(io,()=>window.scrollY,e?(t,n)=>ao(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{p(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function so(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function co(e,{relative:t}={}){let n=r.useContext(pn);f(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Ja(`useViewTransitionState`),a=Nn(e,{relative:t});if(!n.isTransitioning)return!1;let o=B(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=B(n.nextLocation.pathname,i)||n.nextLocation.pathname;return R(a.pathname,s)!=null||R(a.pathname,o)!=null}export{Qn as A,Zn as B,f as C,Te as D,j as E,Q as F,yr as H,Tn as I,Yn as L,pa as M,wn as N,Ee as O,Xn as P,On as R,lr as S,cr as T,Cr as U,Za as V,xr as W,Ze as _,Da as a,fa as b,gr as c,Pa as d,Ka as f,x as g,Zi as h,Ua as i,no as j,aa as k,La as l,ea as m,Ga as n,hr as o,d as p,xa as r,vi as s,De as t,dr as u,we as v,Oe as w,yi as x,ki as y,$n 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.