@accounter/client
Version:
Accounter client application
4 lines • 97.2 kB
JavaScript
import{s as e}from"./dist-BbgEzppd.js";import{o as t}from"./utils-BUNz070n.js";var n=`modulepreload`,r=function(e){return`/`+e},i={},a=function(e,t,a){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=r(t,a),t in i)return;i[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(a)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:n,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},o=e(t(),1),s=e=>{throw TypeError(e)},c=(e,t,n)=>t.has(e)||s(`Cannot `+n),l=(e,t,n)=>(c(e,t,`read from private field`),n?n.call(e):t.get(e)),u=(e,t,n)=>t.has(e)?s(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return v(``,{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:y(t)}return x(t,n,null,e)}function m(e,t){if(e===!1||e==null)throw Error(t)}function h(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function g(){return Math.random().toString(36).substring(2,10)}function _(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 v(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?b(t):t,state:n,key:t&&t.key||r||g(),unstable_mask:i}}function y({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 b(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 x(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:v(y.location,e,t);n&&n(r,e),l=u()+1;let d=_(r,l),p=y.createHref(r.unstable_mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:v(y.location,e,t);n&&n(r,e),l=u();let i=_(r,l),d=y.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:y.location,delta:0})}function g(e){return S(e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function S(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),m(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:y(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function C(e){return{defaultValue:e}}var w,T=class{constructor(e){if(u(this,w,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(l(this,w).has(e))return l(this,w).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){l(this,w).set(e,t)}};w=new WeakMap;var E=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function D(e){return E.has(e)}var O=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function k(e){return O.has(e)}function A(e){return e.index===!0}function ee(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(m(e.index!==!0||!e.children,`Cannot specify children on an index route`),m(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),A(e)){let n={...e,id:s};return r[s]=j(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=j(n,t(n)),e.children&&(n.children=ee(e.children,t,o,r,i)),n}})}function j(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function M(e,t,n=`/`){return te(e,t,n,!1)}function te(e,t,n,r){let i=B((typeof t==`string`?b(t):t).pathname||`/`,n);if(i==null)return null;let a=N(e);F(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=de(i);o=le(a[e],t,r)}return o}function ne(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 N(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;m(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=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(m(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),N(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 P(e.path))a(e,t,!0,n)}),t}function P(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=P(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 F(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var I=/^:[\w-]+$/,L=3,re=2,ie=1,ae=10,oe=-2,R=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(R)&&(r+=oe),t&&(r+=re),n.filter(e=>!R(e)).reduce((e,t)=>e+(I.test(t)?L:t===``?ie:ae),r)}function ce(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 le(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=z({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=z({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:W([a,u.pathname]),pathnameBase:ve(W([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=W([a,u.pathnameBase]))}return o}function z(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ue(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 ue(e,t=!1,n=!0){h(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 de(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return h(!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 V({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var H=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>H.test(e);function pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?b(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?me(n.substring(1),`/`):me(n,t)):a=t,{pathname:a,search:ye(r),hash:be(i)}}function me(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function he(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 ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function _e(e){let t=ge(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function U(e,t,n,r=!1){let i;typeof e==`string`?i=b(e):(i={...e},m(!i.pathname||!i.pathname.includes(`?`),he(`?`,`pathname`,`search`,i)),m(!i.pathname||!i.pathname.includes(`#`),he(`#`,`pathname`,`hash`,i)),m(!i.search||!i.search.includes(`#`),he(`#`,`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=pe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var W=e=>e.join(`/`).replace(/\/\/+/g,`/`),ve=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),ye=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,xe=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 Se(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ce(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var we=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Te(e,t){let n=e;if(typeof n!=`string`||!H.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(we)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{h(!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 Ee=Symbol(`Uninstrumented`);function De(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=ke(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=ke(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[Ee]??i,a=ke(n[e],t,(...e)=>je(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ee]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ee]??e,r=ke(n.middleware,t,(...e)=>je(e[0]));return r?(r[Ee]=t,r):e})),r}function Oe(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[Ee]??e.navigate,r=ke(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?y(n):`.`,...Me(e,r??{})}});r&&(r[Ee]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ee]??e.fetch,r=ke(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Me(e,i??{})}});r&&(r[Ee]=t,e.fetch=r)}return e}function ke(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ae(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ae(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=Ae(e,t,n,r-1),a=await o,m(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 je(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:Ne(t),params:{...r},unstable_pattern:i,context:Pe(n)}}function Me(e,t){return{currentUrl:y(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 Ne(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Pe(e){if(K(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var G=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function K(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`)===G}var Fe=[`POST`,`PUT`,`PATCH`,`DELETE`],Ie=new Set(Fe),Le=[`GET`,...Fe],Re=new Set(Le),q=new Set([301,302,303,307,308]),ze=new Set([307,308]),Be={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ve={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},He={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Ue=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),We=`remix-router-transitions`,Ge=Symbol(`ResetLoaderData`);function Ke(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;m(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Ue,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...De(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=ee(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||lt,d={unstable_passThroughRequests:!1,...e.future},f=null,p=new Set,g=null,_=null,y=null,x=e.hydrationData!=null,C=M(s,e.history.location,l),w=!1,E=null,D,O;if(C==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Mt(s);D=!0,O=!D,C=n,E={[r.id]:t}}else if(C&&!e.hydrationData&&ct(C,s,e.history.location.pathname).active&&(C=null),!C){D=!1,O=!D,C=[];let t=ct(null,s,e.history.location.pathname);t.active&&t.matches&&(w=!0,C=t.matches)}else if(C.some(e=>e.route.lazy))D=!1,O=!D;else if(!C.some(e=>Ze(e.route)))D=!0,O=!D;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=C;if(n){let e=C.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}O=!1,D=!0,r.forEach(e=>{let r=Qe(e.route,t,n);O||=r.renderFallback,D&&=!r.shouldLoad})}let k,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:D,renderFallback:O,navigation:Be,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},j=`POP`,N=null,P=!1,F,I=!1,L=new Map,re=null,ie=!1,ae=!1,oe=new Set,R=new Map,se=0,ce=-1,le=new Map,z=new Set,ue=new Map,de=new Map,V=new Set,H=new Map,pe,me=null;function he(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}h(H.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=tt({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),et(i,{state:`blocked`,location:n,proceed(){et(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,He),U({blockers:e})}}),N?.resolve(),N=null;return}return be(t,n)}),n){en(t,L);let e=()=>tn(t,L);t.addEventListener(`pagehide`,e),re=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||be(`POP`,A.location,{initialHydration:!0}),k}function ge(){f&&f(),re&&re(),p.clear(),F&&F.abort(),A.fetchers.forEach((e,t)=>Le(t)),A.blockers.forEach((e,t)=>$e(t))}function _e(e){return p.add(e),()=>p.delete(e)}function U(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}),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(V.has(t)?n.push(t):r.push(t))}),V.forEach(e=>{!A.fetchers.has(e)&&!R.has(e)&&n.push(e)}),[...p].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Le(e)),r.forEach(e=>A.fetchers.delete(e))}function W(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&X(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?kt(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,l=A.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,He)));let u=ie?!1:st(t,n.matches||A.matches),d=P===!0||A.navigation.formMethod!=null&&X(A.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),ie||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let f;if(j===`POP`){let e=L.get(A.location.pathname);e&&e.has(t.pathname)?f={currentLocation:A.location,nextLocation:t}:L.has(t.pathname)&&(f={currentLocation:t,nextLocation:A.location})}else if(I){let e=L.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),L.set(A.location.pathname,e)),f={currentLocation:A.location,nextLocation:t}}U({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:Be,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),j=`POP`,P=!1,I=!1,ie=!1,ae=!1,N?.resolve(),N=null,me?.resolve(),me=null}async function ve(t,n){if(N?.resolve(),N=null,typeof t==`number`){N||=nn();let n=N.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Ye(!1,Je(A.location,A.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?b(n.unstable_mask):{...A.location.unstable_mask,...n.unstable_mask}});let s=A.location,c=v(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&&X(i.formMethod)&&i.formAction===A.location.pathname+A.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=tt({currentLocation:s,nextLocation:c,historyAction:d});if(m){et(m,{state:`blocked`,location:c,proceed(){et(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),ve(t,n)},reset(){let e=new Map(A.blockers);e.set(m,He),U({blockers:e})}});return}await be(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function ye(){me||=nn(),Pe(),U({revalidation:`loading`});let e=me.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(be(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(be(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:I===!0}),e)}async function be(t,n,r){F&&F.abort(),F=null,j=t,ie=(r&&r.startUninterruptedRevalidation)===!0,ot(A.location,A.matches),P=(r&&r.preventScrollReset)===!0,I=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:M(i,n,l),u=(r&&r.flushSync)===!0;if(o&&A.initialized&&!ae&&Ft(A.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){W(n,{matches:o},{flushSync:u});return}let d=ct(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);W(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}F=new AbortController;let f=Ct(e.history,n,F.signal,r&&r.submission),p=e.getContext?await e.getContext():new T,m;if(r&&r.pendingError)m=[jt(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let t=await xe(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(Y(r)&&Se(r.error)&&r.error.status===404){F=null,W(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=Yt(n,r.submission),u=!1,d.active=!1,f=Ct(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await Ce(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,W(n,{matches:g||o,...At(m),loaderData:_,errors:v}))}async function xe(t,n,i,c,u,d,f,p={}){if(Pe(),U({navigation:Xt(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}=Mt(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=jt(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}=rt(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:J(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await Me(t,n,ht(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(Bt(m)){let n;return n=p&&p.replace!=null?p.replace:St(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===A.location.pathname+A.location.search,await je(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(m)){let e=jt(c,h.route.id);return(p&&p.replace)!==!0&&(j=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function Ce(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||Yt(n,p),x=p||m||Jt(b),S=!ie&&!g;if(d){if(S){let e=we(v);U({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}=Mt(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=jt(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}=rt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:w,revalidatingFetchers:T}=Xe(t,u,a,o,e.history,A,i,x,n,g?[]:r,g===!0,ae,oe,V,ue,z,C,l,e.patchRoutesOnNavigation!=null,v,y);if(ce=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=Ge();return W(n,{matches:i,loaderData:{},errors:v&&Y(v[1])?{[v[0]]:v[1].error}:null,...At(v),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),U(e,{flushSync:_})}T.forEach(e=>{q(e.key),e.controller&&R.set(e.key,e.controller)});let E=()=>T.forEach(e=>q(e.key));F&&F.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ne(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener(`abort`,E),T.forEach(e=>R.delete(e.key));let k=Nt(D);if(k)return await je(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Nt(O),k)return z.add(k.key),await je(t,k.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:ee,errors:j}=Ot(A,i,D,v,T,O);g&&A.errors&&(j={...A.errors,...j});let M=Ge(),te=Ke(ce),ne=M||te||T.length>0;return{matches:i,loaderData:ee,errors:j,...ne?{fetchers:new Map(A.fetchers)}:{}}}function we(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){return e.forEach(e=>{let t=A.fetchers.get(e.key),n=Zt(void 0,t?t.data:void 0);A.fetchers.set(e.key,n)}),new Map(A.fetchers)}async function Ee(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=c||s,u=Je(A.location,A.matches,l,r,n,i?.relative),d=M(o,u,l),f=ct(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){K(t,n,J(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=Ye(!0,u,i);if(h){K(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new T,_=(i&&i.preventScrollReset)===!0;if(m&&X(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,f,p,h,g,_){Pe(),ue.delete(t),G(t,Qt(g,A.fetchers.get(t)),{flushSync:p});let v=new AbortController,y=Ct(e.history,i,v.signal,g);if(f){let e=await ut(u,new URL(y.url).pathname,y.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:p});return}else if(e.matches)u=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:p});return}}let b=qt(u,i);if(!b.route.action&&!b.route.lazy){K(t,n,J(405,{method:g.formMethod,pathname:i,routeId:n}),{flushSync:p});return}R.set(t,v);let x=se,S=ht(a,o,y,i,u,b,r,d),C=await Me(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){R.get(t)===v&&R.delete(t);return}if(V.has(t)){if(Bt(w)||Y(w)){G(t,$t(void 0));return}}else{if(Bt(w))if(R.delete(t),ce>x){G(t,$t(void 0));return}else return z.add(t),G(t,Zt(g)),je(y,w,!1,{fetcherSubmission:g,preventScrollReset:h});if(Y(w)){K(t,n,w.error);return}}let T=A.navigation.location||A.location,E=Ct(e.history,T,v.signal),D=c||s,O=A.navigation.state===`idle`?A.matches:M(D,A.navigation.location,l);m(O,`Didn't find any matches after fetcher action`);let k=++se;le.set(t,k);let ee=Zt(g,w.data);A.fetchers.set(t,ee);let{dsMatches:te,revalidatingFetchers:ne}=Xe(E,d,a,o,e.history,A,O,g,T,r,!1,ae,oe,V,ue,z,D,l,e.patchRoutesOnNavigation!=null,[b.route.id,w],_);ne.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.fetchers.get(t),r=Zt(void 0,n?n.data:void 0);A.fetchers.set(t,r),q(t),e.controller&&R.set(t,e.controller)}),U({fetchers:new Map(A.fetchers)});let N=()=>ne.forEach(e=>q(e.key));v.signal.addEventListener(`abort`,N);let{loaderResults:P,fetcherResults:I}=await Ne(te,ne,E,T,d);if(v.signal.aborted)return;if(v.signal.removeEventListener(`abort`,N),le.delete(t),R.delete(t),ne.forEach(e=>R.delete(e.key)),A.fetchers.has(t)){let e=$t(w.data);A.fetchers.set(t,e)}let L=Nt(P);if(L)return je(E,L.result,!1,{preventScrollReset:h});if(L=Nt(I),L)return z.add(L.key),je(E,L.result,!1,{preventScrollReset:h});let{loaderData:re,errors:ie}=Ot(A,O,P,void 0,ne,I);Ke(k),A.navigation.state===`loading`&&k>ce?(m(j,`Expected pending action`),F&&F.abort(),W(A.navigation.location,{matches:O,loaderData:re,errors:ie,fetchers:new Map(A.fetchers)})):(U({errors:ie,loaderData:kt(A.loaderData,re,O,ie),fetchers:new Map(A.fetchers)}),ae=!1)}async function Ae(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);G(t,Zt(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ct(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`){K(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=qt(s,i);R.set(t,m);let _=se,v=(await Me(h,i,ht(a,o,h,i,s,g,r,c),c,t))[g.route.id];if(R.get(t)===m&&R.delete(t),!h.signal.aborted){if(V.has(t)){G(t,$t(void 0));return}if(Bt(v))if(ce>_){G(t,$t(void 0));return}else{z.add(t),await je(h,v,!1,{preventScrollReset:d});return}if(Y(v)){K(t,n,v.error);return}G(t,$t(v.data))}}async function je(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(N?.resolve(),N=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);m(d,`Expected a Location header on the redirect Response`),d=St(d,new URL(r.url),l,e.history);let f=v(A.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=S(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 p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:h,formAction:g,formEncType:_}=A.navigation;!o&&!s&&h&&g&&_&&(o=Jt(A.navigation));let y=o||s;ze.has(i.response.status)&&y&&X(y.formMethod)?await be(p,f,{submission:{...y,formAction:d},preventScrollReset:c||P,enableViewTransition:a?I:void 0}):await be(p,f,{overrideNavigation:Yt(f,o),fetcherSubmission:s,preventScrollReset:c||P,enableViewTransition:a?I:void 0})}async function Me(e,t,n,r,i){let a,o={};try{a=await gt(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!X(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.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(zt(r)){let i=r.result;o[t]={type:`redirect`,response:bt(i,e,t,n,l)}}else o[t]=await yt(r);return o}async function Ne(e,t,n,r,i){let a=Me(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Me(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:J(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Pe(){ae=!0,ue.forEach((e,t)=>{R.has(t)&&oe.add(t),q(t)})}function G(e,t,n={}){A.fetchers.set(e,t),U({fetchers:new Map(A.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=jt(A.matches,t);Le(e),U({errors:{[i.route.id]:n},fetchers:new Map(A.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Fe(e){return de.set(e,(de.get(e)||0)+1),V.has(e)&&V.delete(e),A.fetchers.get(e)||Ve}function Ie(e,t){q(e,t?.reason),G(e,$t(null))}function Le(e){let t=A.fetchers.get(e);R.has(e)&&!(t&&t.state===`loading`&&le.has(e))&&q(e),ue.delete(e),le.delete(e),z.delete(e),V.delete(e),oe.delete(e),A.fetchers.delete(e)}function Re(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),V.add(e)):de.set(e,t),U({fetchers:new Map(A.fetchers)})}function q(e,t){let n=R.get(e);n&&(n.abort(t),R.delete(e))}function We(e){for(let t of e){let e=$t(Fe(t).data);A.fetchers.set(t,e)}}function Ge(){let e=[],t=!1;for(let n of z){let r=A.fetchers.get(n);m(r,`Expected fetcher: ${n}`),r.state===`loading`&&(z.delete(n),e.push(n),t=!0)}return We(e),t}function Ke(e){let t=[];for(let[n,r]of le)if(r<e){let e=A.fetchers.get(n);m(e,`Expected fetcher: ${n}`),e.state===`loading`&&(q(n),le.delete(n),t.push(n))}return We(t),t.length>0}function qe(e,t){let n=A.blockers.get(e)||He;return H.get(e)!==t&&H.set(e,t),n}function $e(e){A.blockers.delete(e),H.delete(e)}function et(e,t){let n=A.blockers.get(e)||He;m(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(A.blockers);r.set(e,t),U({blockers:r})}function tt({currentLocation:e,nextLocation:t,historyAction:n}){if(H.size===0)return;H.size>1&&h(!1,`A router only supports one blocker at a time`);let r=Array.from(H.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function rt(e){let t=J(404,{pathname:e}),{matches:n,route:r}=Mt(c||s);return{notFoundMatches:n,route:r,error:t}}function it(e,t,n){if(g=e,y=t,_=n||null,!x&&A.navigation===Be){x=!0;let e=st(A.location,A.matches);e!=null&&U({restoreScrollPosition:e})}return()=>{g=null,y=null,_=null}}function at(e,t){return _&&_(e,t.map(e=>ne(e,A.loaderData)))||e.key}function ot(e,t){if(g&&y){let n=at(e,t);g[n]=y()}}function st(e,t){if(g){let n=at(e,t),r=g[n];if(typeof r==`number`)return r}return null}function ct(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:te(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:te(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||nt(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=M(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=te(d,n,l,!0),!(m&&u.length<m.length&&dt(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=te(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=ee(e,a,void 0,o)}function pt(e,t,n=!1){let r=c==null;nt(e,t,c||s,o,a,n),r&&(s=[...s],U({}))}return k={get basename(){return l},get future(){return d},get state(){return A},get routes(){return s},get window(){return t},initialize:he,subscribe:_e,enableScrollRestoration:it,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Fe,resetFetcher:Ie,deleteFetcher:Re,dispose:ge,getBlocker:qe,deleteBlocker:$e,patchRoutes:pt,_internalFetchControllers:R,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){U(e)}},e.unstable_instrumentations&&(k=Oe(k,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),k}function qe(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Je(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=U(r||`.`,_e(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=Kt(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=V({basename:n,pathname:c.pathname})),y(c)}function Ye(e,t,n){if(!n||!qe(n))return{path:t};if(n.formMethod&&!Gt(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Pt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(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}
`,``):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(!X(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()}}}m(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Tt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Tt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Et(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Et(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(X(c.formMethod))return{path:t,submission:c};let l=b(t);return e&&l.search&&Kt(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:y(l),submission:c}}function Xe(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?Y(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&&Y(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=Ce(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(!Ze(s))f=!1;else if(u){let{shouldLoad:e}=Qe(s,a.loaderData,a.errors);f=e}else $e(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return mt(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?et(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return mt(n,r,e,c,O,i,l,t,tt(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=M(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=Ct(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=ht(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=ht(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};tt(x,a)&&(w=ht(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 Ze(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Qe(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ze(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 $e(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function et(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function tt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function nt(e,t,n,r,i,a){let o;if(e){let t=r[e];m(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>rt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=ee(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]=ee([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 rt(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=>rt(e,t)))??!1:!1}var it=new WeakMap,at=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(m(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=it.get(i);o||(o={},it.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=D(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)h(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)h(!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},ot=new WeakMap;function st(e,t,n,r,i){let a=n[e.id];if(m(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=ot.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{m(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=k(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?h(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?h(!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 ot.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=at({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 ct(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 lt(e){return e.matches.some(e=>e.route.middleware)?ut(e,()=>ct(e)):ct(e)}function ut(e,t){return dt(e,t,e=>{if(Wt(e))throw e;return e},Lt,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=jt(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 dt(e,t,n,r,i){let{matches:a,...o}=e;return await ft(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function ft(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 ft(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 pt(e,t,n,r,i){let a=at({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=st(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function mt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=pt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?tt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?tt(a,{...l,defaultShouldRevalidate:e}):tt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?_t({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 ht(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?mt(e,t,n,r,Ce(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:pt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function gt(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:wt(t,n),unstable_pattern:Ce(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 ut(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 _t({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(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:wt(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 J(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 J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function vt(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 yt(e){let{result:t,type:n}=e;if(Ht(t)){let e;try{e=await vt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new xe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Vt(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:It(t),statusCode:Se(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Se(t)?t.status:void 0}:Vt(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 bt(e,t,n,r,i){let a=e.headers.get(`Location`);if(m(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=Je(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var xt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function St(e,t,n,r){if(fe(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(xt.includes(i.protocol))throw Error(`Invalid redirect location`);let a=B(i.pathname,n)!=null;if(i.origin===t.origin&&a)return i.pathname+i.search+i.hash}try{let t=r.createURL(e);if(xt.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Ct(e,t,n,r){let i=e.createURL(Pt(t)).toString(),a={signal:n};if(r&&X(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=Tt(r.formData):a.body=r.formData}return new Request(i,a)}function wt(e,t){let n=new URL(e.url),r=typeof t==`string`?b(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 Tt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Et(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Dt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(m(!Bt(f),`Cannot handle redirect results in processLoaderData`),Y(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=jt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Ge),c||(c=!0,s=Se(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.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 Ot(e,t,n,r,i,a){let{loaderData:o,errors:s}=Dt(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(m(o,`Did not find corresponding fetcher result`),Y(o)){let t=jt(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(Bt(o))m(!1,`Unhandled fetcher revalidation redirect`);else{let t=$t(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function kt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Ge).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 At(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function jt(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 Mt(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 J(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 xe(e||500,o,Error(s),!0)}function Nt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Bt(r))return{key:n,result:r}}}function Pt(e){return y({...typeof e==`string`?b(e):e,hash:``})}function Ft(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function It(e){return new xe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Lt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Rt(t))}function Rt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function zt(e){return Ht(e.result)&&q.has(e.result.status)}function Y(e){return e.type===`error`}function Bt(e){return(e&&e.type)===`redirect`}function Vt(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Ht(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Ut(e){return q.has(e)}function Wt(e){return Ht(e)&&Ut(e.status)&&e.headers.has(`Location`)}function Gt(e){return Re.has(e.toUpperCase())}function X(e){return Ie.has(e.toUpperCase())}function Kt(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function qt(e,t){let n=typeof t==`string`?b(t).search:t.search;if(e[e.length-1].route.index&&Kt(n||``))return e[e.length-1];let r=ge(e);return r[r.length-1]}function Jt(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 Yt(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 Xt(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 Zt(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 Qt(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 $t(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 en(e,t){try{let n=e.sessionStorage.getItem(We);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 tn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(We,JSON.stringify(n))}catch(e){h(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function nn(){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 rn=o.createContext(null);rn.displayName=`DataRouter`;var an=o.createContext(null);an.displayName=`DataRouterState`;var on=o.createContext(!1);function sn(){return o.useContext(on)}var cn=o.createContext({isTransitioning:!1});cn.displayName=`ViewTransition`;var ln=o.createContext(new Map);ln.displayName=`Fetchers`;var un=o.createContext(null);un.displayName=`Await`;var Z=o.createContext(null);Z.displayName=`Navigation`;var dn=o.createContext(null);dn.displayName=`Location`;var Q=o.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var fn=o.createContext(null);fn.displayName=`RouteError`;var pn=`REACT_ROUTER_ERROR`,mn=`REDIRECT`,hn=`ROUTE_ERROR_RESPONSE`;function gn(e){if(e.startsWith(`${pn}:${mn}:{`))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 _n(e){if(e.startsWith(`${pn}:${hn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xe(t.status,t.statusText,t.data)}catch{}}function vn(e,{relative:t}={}){m(yn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(Z),{hash:i,pathname:a,search:s}=Dn(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:W([n,a])),r.createHref({pathname:c,search:s,hash:i})}function yn(){return o.useContext(dn)!=null}function $(){return m(yn(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(dn).location}var bn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function xn(e){o.useContext(Z).static||o.useLayoutEffect(e)}function Sn(){let{isDataRoute:e}=o.useContext(Q);return e?Kn():Cn()}function Cn(){m(yn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(rn),{basename:t,navigator:n}=o.useContext(Z),{matches:r}=o.useContext(Q),{pathname:i}=$(),a=JSON.stringify(_e(r)),s=o.useRef(!1);return xn(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(h(s.current,bn),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=U(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}var wn=o.createContext(null);function Tn(e){let t=o.useContext(Q).outlet;return o.useMemo(()=>t&&o.createElement(wn.Provider,{value:e},t),[t,e])}function En(){let{matches:e}=o.useContext(Q),t=e[e.length-1];return t?t.params:{}}function Dn(e,{relative:t}={}){let{matches:n}=o.useContext(Q),{pathname:r}=$(),i=JSON.stringify(_e(n));return o.useMemo(()=>U(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function On(e,t,n){m(yn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=o.useContext(Z),{matches:i}=o.useContext(Q),a=i[i.length-1],s=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;Jn(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.
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),f;if(t){let e=typeof t==`string`?b(t):t;m(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.`),f=e}else f=d;let p=f.pathname||`/`,g=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=M(e,{pathname:g});h(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),h(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 v=Fn(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:W([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:W([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&v?o.createElement(dn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...f},navigationType:`POP`}},v):v}function kn(){let e=Gn(),t=Se(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=o.createElement(o.Fragment,null,o.createElement(`p`,null,`💿 Hey developer 👋`),o.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,o.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,o.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),o.createElement(o.Fragment,null,o.createElement(`h2`,null,`Unexpected Application Error!`),o.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?o.createElement(`pre`,{style:i},n):null,s)}var An=o.createElement(kn,null),jn=class extends o.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=_n(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:o.createElement(Q.Provider,{value:this.props.routeContext},o.createElement(fn.Provider,{value:e,children:this.props.component}));return this.context?o.createElement(Nn,{error:e},t):t}};jn.contextType=on;var Mn=new WeakMap;function Nn({children:e,error:t}){let{basename:n}=o.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=gn(t.digest);if(e){let r=Mn.get(t);if(r)throw r;let i=Te(e.location,n);if(we&&!Mn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Mn.set(t,n),n}return o.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Pn({routeContext:e,match:t,children:n}){let r=o.useContext(rn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(Q.Provider,{value:e},n)}function Fn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);m(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:a}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Ce(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||An,s&&(c<0&&l===0?(Jn(`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(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(Pn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?o.createElement(jn,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function In(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ln(e){let t=o.useContext(rn);return m(t,In(e)),t}function Rn(e){let t=o.useContext(an);return m(t,In(e)),t}function zn(e){let t=o.useContext(Q);return m(t,In(e)),t}function Bn(e){let t=zn(e),n=t.matches[t.matches.length-1];return m(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Vn(){return Bn(`useRouteId`)}function Hn(){return Rn(`useNavigation`).navigation}function Un(){let{matches:e,loaderData:t}=Rn(`useMatches`);return o.useMemo(()=>e.map(e=>ne(e,t)),[e,t])}function Wn(){let e=Rn(`useLoaderData`),t=Bn(`useLoaderData`);return e.loaderData[t]}function Gn(){let e=o.useContext(fn),t=Rn(`useRouteError`),n=Bn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Kn(){let{router:e}=Ln(`useNavigate`),t=Bn(`useNavigate`),n=o.useRef(!1);return xn(()=>{n.current=!0}),o.useCallback(async(r,i={})=>{h(n.current,bn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var qn={};function Jn(e,t,n){!t&&!qn[e]&&(qn[e]=!0,h(!1,n))}var Yn={};function Xn(e,t){!e&&!Yn[t]&&(Yn[t]=!0,console.warn(t))}var Zn=o.useOptimistic,Qn=()=>void 0;function $n(e){return Zn?Zn(e):[e,Qn]}function er(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&h(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:o.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&h(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:o.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&h(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:o.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tr=[`HydrateFallback`,`hydrateFallbackElement`],nr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function rr({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=sn()||r;let[i,a]=o.useState(e.state),[s,c]=$n(i),[l,u]=o.useState(),[d,f]=o.useState({isTransitioning:!1}),[p,m]=o.useState(),[h,g]=o.useState(),[_,v]=o.useState(),y=o.useRef(new Map),b=o.useCallback((i,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:Ce(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),Xn(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(Xn(_==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(()=>a(i)):r===!1?a(i):o.startTransition(()=>{r===!0&&c(e=>ir(e,i)),a(i)});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(()=>a(i))});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:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,c,n]);o.useLayoutEffect(()=>e.subscribe(b),[e,b]),o.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new nr)},[d]),o.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):o.startTransition(()=>{r===!0&&c(e=>ir(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(i)}},[l,p,e.window,r,c]),o.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),o.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=o.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]),S=e.basename||`/`,C=o.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return o.createElement(o.Fragment,null,o.createElement(rn.Provider,{value:C},o.createElement(an.Provider,{value:s},o.createElement(ln.Provider,{value:y.current},o.createElement(cn.Provider,{value:d},o.createElement(lr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,unstable_useTransitions:r},o.createElement(ar,{routes:e.routes,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function ir(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 ar=o.memo(or);function or({routes:e,future:t,state:n,isStatic:r,onError:i}){return On(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function sr({to:e,replace:t,state:n,relative:r}){m(yn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=o.useContext(Z);h(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=o.useContext(Q),{pathname:s}=$(),c=Sn(),l=U(e,_e(a),s,r===`path`),u=JSON.stringify(l);return o.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function cr(e){return Tn(e.context)}function lr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:s}){m(!yn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=o.useMemo(()=>({basename:c,navigator:i,static:a,unstable_useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=b(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:g=`default`,unstable_mask:_}=n,v=o.useMemo(()=>{let e=B(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:g,unstable_mask:_},navigationType:r}},[c,u,d,f,p,g,r,_]);return h(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:o.createElement(Z.Provider,{value:l},o.createElement(dn.Provider,{children:t,value:v}))}o.Component;var ur=`get`,dr=`application/x-www-form-urlencoded`;function fr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function pr(e){return fr(e)&&e.tagName.toLowerCase()===`button`}function mr(e){return fr(e)&&e.tagName.toLowerCase()===`form`}function hr(e){return fr(e)&&e.tagName.toLowerCase()===`input`}function gr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _r(e,t){return e.button===0&&(!t||t===`_self`)&&!gr(e)}function vr(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 yr(e,t){let n=vr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var br=null;function xr(){if(br===null)try{new FormData(document.createElement(`form`),0),br=!1}catch{br=!0}return br}var Sr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Cr(e){return e!=null&&!Sr.has(e)?(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dr}"`),null):e}function wr(e,t){let n,r,i,a,o;if(mr(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||ur,i=Cr(e.getAttribute(`enctype`))||dr,a=new FormData(e)}else if(pr(e)||hr(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`)||ur,i=Cr(e.getAttribute(`formenctype`))||Cr(o.getAttribute(`enctype`))||dr,a=new FormData(o,e),!xr()){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(fr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ur,r=null,i=dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Tr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Er=/[&><\u2028\u2029]/g;function Dr(e){return e.replace(Er,e=>Tr[e])}function Or(e,t){if(e===!1||e==null)throw Error(t)}function kr(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=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Ar(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jr(e){return e!=null&&typeof e.page==`string`}function Mr(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 Nr(e,t,n){return Rr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ar(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Mr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Pr(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 Fr(e,t,{includeHydrateFallback:n}={}){return Ir(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 Ir(e){return[...new Set(e)]}function Lr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Rr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!jr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Lr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function zr(){let e=o.useContext(rn);return Or(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Br(){let e=o.useContext(an);return Or(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Vr=o.createContext(void 0);Vr.displayName=`FrameworkContext`;function Hr(){let e=o.useContext(Vr);return Or(e,`You must render this element inside a <HydratedRouter> element`),e}function Ur(e,t){let n=o.useContext(Vr),[r,i]=o.useState(!1),[a,s]=o.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=o.useRef(null);o.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]),o.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),s(!1)};return n?e===`intent`?[a,p,{onFocus:Wr(c,m),onBlur:Wr(l,h),onMouseEnter:Wr(u,m),onMouseLeave:Wr(d,h),onTouchStart:Wr(f,m)}]:[a,p,{}]:[!1,p,{}]}function Wr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Gr({page:e,...t}){let n=sn(),{router:r}=zr(),i=o.useMemo(()=>M(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?o.createElement(qr,{page:e,matches:i,...t}):o.createElement(Jr,{page:e,matches:i,...t}):null}function Kr(e){let{manifest:t,routeModules:n}=Hr(),[r,i]=o.useState([]);return o.useEffect(()=>{let r=!1;return Nr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function qr({page:e,matches:t,...n}){let r=$(),{future:i}=Hr(),{basename:a}=zr(),s=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=kr(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return o.createElement(o.Fragment,null,s.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Jr({page:e,matches:t,...n}){let r=$(),{future:i,manifest:a,routeModules:s}=Hr(),{basename:c}=zr(),{loaderData:l,matches:u}=Br(),d=o.useMemo(()=>Pr(e,t,u,a,r,`data`),[e,t,u,a,r]),f=o.useMemo(()=>Pr(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=a.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?o=!0:n.add(e.route.id))}),n.size===0)return[];let u=kr(e,c,i.unstable_trailingSlashAwareDataRequests,`data`);return o&&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,i.unstable_trailingSlashAwareDataRequests,l,r,a,d,t,e,s]),m=o.useMemo(()=>Fr(f,a),[f,a]),h=Kr(f);return o.createElement(o.Fragment,null,p.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>o.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>o.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Yr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}o.Component;var Xr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Xr&&(window.__reactRouterVersion=`7.14.0`)}catch{}function Zr(e,t){return Ke({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||Qr(),routes:e,mapRouteProperties:er,hydrationRouteProperties:tr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Qr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:$r(e.errors)}),e}function $r(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new xe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function ei({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=o.useState({action:n.action,location:n.location}),s=o.useCallback(e=>{r===!1?a(e):o.startTransition(()=>a(e))},[r]);return o.useLayoutEffect(()=>n.listen(s),[n,s]),o.createElement(lr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}ei.displayName=`unstable_HistoryRouter`;var ti=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ni=o.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,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}=o.useContext(Z),y=typeof u==`string`&&ti.test(u),b=Te(u,g);u=b.to;let x=vn(u,{relative:r}),S=$(),C=null;if(s){let e=U(s,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:W([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Ur(n,m),D=li(u,{replace:a,unstable_mask:s,state:c,target:l,preventScrollReset:d,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=o.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Yr(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?o.createElement(o.Fragment,null,A,o.createElement(Gr,{page:x})):A});ni.displayName=`Link`;var ri=o.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...l},u){let d=Dn(a,{relative:l.relative}),f=$(),p=o.useContext(an),{navigator:m,basename:h}=o.useContext(Z),g=p!=null&&bi(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===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&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 i==`function`?i(C):i;return o.createElement(ni,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:s},typeof c==`function`?c(C):c)});ri.displayName=`NavLink`;var ii=o.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:s=ur,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=o.useContext(Z),_=pi(),v=mi(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&ti.test(c);return o.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||s,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?o.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});ii.displayName=`Form`;function ai({getKey:e,storageKey:t,...n}){let r=o.useContext(Vr),{basename:i}=o.useContext(Z),a=$(),s=Un();vi({getKey:e,storageKey:t});let c=o.useMemo(()=>{if(!r||!e)return null;let t=_i(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.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 o.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Dr(JSON.stringify(t||hi))}, ${Dr(JSON.stringify(c))})`}})}ai.displayName=`ScrollRestoration`;function oi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function si(e){let t=o.useContext(rn);return m(t,oi(e)),t}function ci(e){let t=o.useContext(an);return m(t,oi(e)),t}function li(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let d=Sn(),f=$(),p=Dn(e,{relative:s});return o.useCallback(m=>{if(_r(m,t)){m.preventDefault();let t=n===void 0?y(f)===y(p):n,h=()=>d(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l});u?o.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,s,c,l,u])}function ui(e){h(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=o.useRef(vr(e)),n=o.useRef(!1),r=$(),i=o.useMemo(()=>yr(r.search,n.current?null:t.current),[r.search]),a=Sn();return[i,o.useCallback((e,t)=>{let r=vr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var di=0,fi=()=>`__${String(++di)}__`;function pi(){let{router:e}=si(`useSubmit`),{basename:t}=o.useContext(Z),n=Vn(),r=e.fetch,i=e.navigate;return o.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=wr(e,t);a.navigate===!1?await r(a.fetcherKey||fi(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function mi(e,{relative:t}={}){let{basename:n}=o.useContext(Z),r=o.useContext(Q);m(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Dn(e||`.`,{relative:t})},s=$();if(e==null){a.search=s.search;let e=new URLSearchParams(a.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();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:W([n,a.pathname])),y(a)}var hi=`react-router-scroll-positions`,gi={};function _i(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 vi({getKey:e,storageKey:t}={}){let{router:n}=si(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ci(`useScrollRestoration`),{basename:a}=o.useContext(Z),s=$(),c=Un(),l=Hn();o.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),yi(o.useCallback(()=>{if(l.state===`idle`){let t=_i(s,c,a,e);gi[t]=window.scrollY}try{sessionStorage.setItem(t||hi,JSON.stringify(gi))}catch(e){h(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(o.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||hi);e&&(gi=JSON.parse(e))}catch{}},[t]),o.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(gi,()=>window.scrollY,e?(t,n)=>_i(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),o.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{h(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function yi(e,t){let{capture:n}=t||{};o.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function bi(e,{relative:t}={}){let n=o.useContext(cn);m(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=si(`useViewTransitionState`),i=Dn(e,{relative:t});if(!n.isTransitioning)return!1;let a=B(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=B(n.nextLocation.pathname,r)||n.nextLocation.pathname;return z(i.pathname,s)!=null||z(i.pathname,a)!=null}var xi=/^((?:1[6-9]|[2]\d)\d{2})(-)(?:((?:0[13578]|1[02])(-31))|(?:(?:0[1,3-9]|1[0-2])(-)(?:29|30)))$|^(?:(?:(?:1[6-9]|[2]\d)(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(-02-29)$|^(?:(?:1[6-9]|[2-9]\d)\d{2})(-)(?:(?:0[1-9])|(?:1[0-2]))(-)(?:0[1-9]|1\d|2[0-8])$/,Si=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,Ci=`00000000-0000-0000-0000-000000000000`,wi=`contoReportFilters`;function Ti(e){if(typeof e==`boolean`&&e===!0)return!0;if(Array.isArray(e))return e.some(e=>!!e);if(typeof e==`object`){for(let t of Object.values(e))if(Ti(t))return!0}return!1}function Ei(e,t){if(!t)return;if(t===!0&&typeof e!=`object`)return e;if(!Ti(t))return;if(Array.isArray(e))return e;let n=Object.entries(t).filter(([e,t])=>!!t).map(([e,t])=>e);return Object.fromEntries(n.filter(t=>t in e).map(n=>{let r=Ei(e[n],t[n]);if([`localCurrencyAmount`,`originalAmount`,`withholdingTax`,`vat`,`tags`,`amount`,`defaultIrsCode`,`irsCode`].includes(n)&&r){let t=e[n];return delete t.formatted,[n,t]}return[n,r]}))}function Di(e){return Object.values(e??{}).filter(e=>e!==void 0&&(typeof e!=`object`||(Array.isArray(e)?e.length>0:!Di(e)))).length===0}function Oi(e){return e.isDirty?`border-1 border-green-500`:``}function ki(e){return!e||Di(e)?null:encodeURIComponent(JSON.stringify(e))}function Ai(e,t){let n=new URLSearchParams;t&&n.append(`page`,String(t));let r=ki(e);return r&&n.append(`chargesFilters`,r),n.size>0?`?${n}`:`/`}function ji(e){return!e||Di(e)?null:encodeURIComponent(JSON.stringify(e))}function Mi(e){let t=new URLSearchParams,n=ji(e);return n&&t.append(wi,n),t.size>0?`?${t}`:``}function Ni(e){return!e||Di(e)?null:encodeURIComponent(JSON.stringify(e))}function Pi(e){let t=new URLSearchParams,n=Ni(e);return n&&t.append(`trialBalanceReportFilters`,n),t.size>0?`?${t}`:``}var Fi={HOME:`/`,LOGIN:`/login`,AUTH_CALLBACK:`/auth/callback`,ACCEPT_INVITATION:(e=`:token`)=>`/accept-invitation/${e}`,NETWORK_ERROR:`/network-error`,CHARGES:{ROOT:`/charges`,ALL:(e,t)=>`/charges${Ai(e,t)}`,MISSING_INFO:`/charges/missing-info`,LEDGER_VALIDATION:`/charges/ledger-validation`,DETAIL:e=>`/charges/${e}`},BUSINESSES:{ROOT:`/businesses`,ALL:`/businesses`,LEDGER:`/businesses/ledger`,CONTRACTS:`/businesses/contracts`,DETAIL:e=>`/businesses/${e}`,DETAIL_LEDGER:e=>`/businesses/${e}/ledger`},BUSINESS_TRIPS:{ROOT:`/business-trips`,ALL:`/business-trips`,DETAIL:e=>`/business-trips/${e}`},CHARTS:{ROOT:`/charts`,MAIN:`/charts`,MONTHLY_INCOME_EXPENSE:`/charts/monthly-income-expense`},DOCUMENTS:{ROOT:`/documents`,ALL:`/documents`,ISSUE_DOCUMENT:`/documents/issue-document`,ISSUE_DOCUMENTS:`/documents/issue-documents`},REPORTS:{ROOT:`/reports`,TRIAL_BALANCE:e=>`/reports/trial-balance${Pi(e)}`,CONTO:e=>`/reports/conto${Mi(e)}`,VAT_MONTHLY:`/reports/vat-monthly`,PROFIT_AND_LOSS:e=>e?`/reports/profit-and-loss/${e}`:`/reports/profit-and-loss`,TAX:e=>e?`/reports/tax/${e}`:`/reports/tax`,DEPRECIATION:`/reports/depreciation`,SHAAM_6111:`/reports/shaam6111`,YEARLY_LEDGER:`/reports/yearly-ledger`,ANNUAL_REVENUE:`/reports/annual-revenue`,CORPORATE_TAX_RULING_COMPLIANCE:e=>e?`/reports/corporate-tax-ruling-compliance/${e}`:`/reports/corporate-tax-ruling-compliance`,BALANCE:`/reports/balance`,VALIDATE_REPORTS:`/reports/validate-reports`},BANK_DEPOSITS:{ROOT:`/bank-deposits`,ALL:`/bank-deposits`},WORKFLOWS:{ROOT:`/workflows`,ANNUAL_AUDIT:e=>e?`/workflows/annual-audit/${e}`:`/workflows/annual-audit`},ACCOUNTANT_APPROVALS:`/accountant-approvals`,SALARIES:`/salaries`,TAGS:`/tags`,TAX_CATEGORIES:`/tax-categories`,SORT_CODES:`/sort-codes`};export{Gn as C,Dn as S,a as T,$ as _,wi as a,Hn as b,Si as c,cr as d,rr as f,Wn as g,Se as h,Ei as i,ni as l,C as m,Oi as n,Ci as o,Zr as p,Di as r,xi as s,Fi as t,sr as u,Un as v,ui as w,En as x,Sn as y};