codesesh 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{chunk-HIYT2ZJL.js → chunk-G2BTNW3C.js} +1678 -217
- package/dist/chunk-G2BTNW3C.js.map +1 -0
- package/dist/{chunk-DHNP33L4.js → chunk-KD3DGWZY.js} +2 -2
- package/dist/{dist-DMGLFBW6.js → dist-ALXOBKV2.js} +14 -2
- package/dist/index.js +168 -43
- package/dist/index.js.map +1 -1
- package/dist/scan-refresh-worker.js +243 -24
- package/dist/scan-refresh-worker.js.map +1 -1
- package/dist/search-index-worker.js +2 -2
- package/dist/smart-tag-worker.js +2 -2
- package/dist/web/assets/{AgentIcon-DcUJM198.js → AgentIcon-CEj7HO1m.js} +1 -1
- package/dist/web/assets/BookmarkButton-DLEnIyeE.js +1 -0
- package/dist/web/assets/{Dashboard-wjTLT17d.js → Dashboard-DUG0IFcy.js} +2 -2
- package/dist/web/assets/DialogTitle-Dv6DQPIb.js +1 -0
- package/dist/web/assets/Projects-BMaZc6J5.js +1 -0
- package/dist/web/assets/SearchFilterBar-iP6pzlZo.js +1 -0
- package/dist/web/assets/SearchResultsPanel-RuiLPkbP.js +1 -0
- package/dist/web/assets/{SessionDetail-CgR7ipmi.js → SessionDetail-De1Wl3mu.js} +35 -35
- package/dist/web/assets/{index-DuB6tGoe.css → index-B-CV7pFu.css} +1 -1
- package/dist/web/assets/index-CQI8F_8X.js +1930 -0
- package/dist/web/assets/session-indexes-BuxBafvh.js +4 -0
- package/dist/web/index.html +7 -8
- package/package.json +1 -1
- package/dist/chunk-HIYT2ZJL.js.map +0 -1
- package/dist/web/assets/BookmarkButton-CJjTjyae.js +0 -1
- package/dist/web/assets/DialogTitle-Bz0eXTGu.js +0 -1
- package/dist/web/assets/Projects-DBxubQuM.js +0 -1
- package/dist/web/assets/SearchFilterBar-BG9ah_Po.js +0 -1
- package/dist/web/assets/SearchResultsPanel-Clmf2xKw.js +0 -1
- package/dist/web/assets/index-DR07vs5V.js +0 -1890
- package/dist/web/assets/preload-helper-CmKXJxR3.js +0 -1
- package/dist/web/assets/session-indexes-EHJdYE4j.js +0 -4
- /package/dist/{chunk-DHNP33L4.js.map → chunk-KD3DGWZY.js.map} +0 -0
- /package/dist/{dist-DMGLFBW6.js.map → dist-ALXOBKV2.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){let n=new Map,r=new Map,i=(e,t)=>`${e}\0${t}`,a=e=>{let t=i(e.reference.agentName,e.reference.sessionId);r.delete(t),n.set(t,e)},o=e=>{let t=i(e.agentName,e.sessionId);n.delete(t),r.set(t,e)};for(let t of e.changedSessionHeads)a(t);for(let t of e.removedSessionRefs)o(t);for(let e of t.changedSessionHeads)a(e);for(let e of t.removedSessionRefs)o(e);return{type:`sessions-updated`,changedAgents:Array.from(new Set([...e.changedAgents,...t.changedAgents])),newSessions:e.newSessions+t.newSessions,updatedSessions:e.updatedSessions+t.updatedSessions,removedSessions:e.removedSessions+t.removedSessions,totalSessions:t.totalSessions,timestamp:t.timestamp,changedSessionHeads:[...n.values()],removedSessionRefs:[...r.values()]}}function t(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function n(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function r(e){let t=new Date(e);return`${String(t.getFullYear()).padStart(4,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}var i=new Set([`git_remote`,`git_common_dir`,`manifest_path`,`synthetic`,`path`,`loose`]);function a(e){return i.has(e)}function o(e){return`${e.kind}:${e.key}`}function s(e,t){return`${e}\0${t.toLowerCase()}`}function c(e){return{agentName:e.agentName.trim().toLowerCase(),sessionId:e.sessionId}}function l(e){let t=e.indexOf(`/`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t).trim().toLowerCase();return n?{agentName:n,sessionId:e.slice(t+1)}:null}function u(e){let t=c(e);return`${t.agentName}/${t.sessionId}`}function d(e){return l(e.slug)?.agentName??`unknown`}function f(e){return`/${encodeURIComponent(e.trim().toLowerCase())}`}function p(e){let t=c(e);return`${f(t.agentName)}/${encodeURIComponent(t.sessionId)}`}function m(e){return p({agentName:d(e),sessionId:e.id})}function h(e,t){return(t.time_updated??t.time_created)-(e.time_updated??e.time_created)}function g(e){for(let t=1;t<e.length;t+=1)if(h(e[t-1],e[t])>0)return[...e].sort(h);return[...e]}function _(e,t){return u({agentName:e,sessionId:t})}function v(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function y(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let n of e){let e=_(d(n),n.id);t.has(e)||t.set(e,n)}let a=g(e);for(let e of a){let t=d(e);v(n,t,e);let a=e.project_identity;if(!a?.key)continue;let c=o(a);v(r,c,e),v(i,s(c,t),e)}return{sourceSessions:e,sessionsByActivity:a,byRouteKey:t,byAgent:n,byProjectIdentityKey:r,byProjectAgentKey:i}}function b(e,t,n){let r=new Map;for(let t of e)r.set(_(d(t),t.id),t);for(let e of n)r.delete(_(e.agentName,e.sessionId));for(let e of t)r.set(_(e.reference.agentName,e.reference.sessionId),e.session);return g([...r.values()])}var x={id:`session-1`,slug:`claudecode/session-1`,title:`Fix flaky search index test`,directory:`/Users/dev/project`,project_identity:{kind:`git_remote`,key:`github.com/example/project`,displayName:`example/project`},time_created:17e11,time_updated:17000036e5,stats:{message_count:12,total_input_tokens:4200,total_output_tokens:1800,total_cost:.042,cost_source:`recorded`,total_tokens:6e3,total_cache_read_tokens:3e3,total_cache_create_tokens:500},model_usage:{"claude-5-sonnet":6e3},smart_tags:[`bugfix`],smart_tags_source_updated_at:17000036e5};x.id,x.id;var S=`modulepreload`,C=function(e){return`/`+e},w={},T=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=C(t,n),t=s(t),t in w)return;w[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:S,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{r as _,y as a,o as c,m as d,a as f,t as g,p as h,b as i,d as l,c as m,n,u as o,e as p,f as r,s,T as t,_ as u};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./jsx-runtime-n5LQ9ujS.js";import{a as n,c as r,l as i,t as a,u as o}from"./preload-helper-CmKXJxR3.js";var s=e(t(),1),c=e=>{throw TypeError(e)},l=(e,t,n)=>t.has(e)||c(`Cannot `+n),u=(e,t,n)=>(l(e,t,`read from private field`),n?n.call(e):t.get(e)),d=(e,t,n)=>t.has(e)?c(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),f=(e,t,n,r)=>(l(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),p=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,m=/^[\\/]{2}/;function h(e,t){return t+e.replace(/\\/g,`/`)}var g=`popstate`;function _(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function v(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return C(``,{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:w(t)}return E(t,n,null,e)}function y(e,t){if(e===!1||e==null)throw Error(t)}function b(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function x(){return Math.random().toString(36).substring(2,10)}function S(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function C(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?T(t):t,state:n,key:t&&t.key||r||x(),mask:i}}function w({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 T(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 E(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 d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=_(e)?e:C(h.location,e,t);n&&n(r,e),l=u()+1;let d=S(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=_(e)?e:C(h.location,e,t);n&&n(r,e),l=u();let i=S(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return D(i,e)}let h={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(g,d),c=e,()=>{i.removeEventListener(g,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function D(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),y(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:w(t);return i=i.replace(/ $/,`%20`),!n&&m.test(i)&&(i=r+i),new URL(i,r)}function O(e){return{defaultValue:e}}var k,A=class{constructor(e){if(d(this,k,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(u(this,k).has(e))return u(this,k).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){u(this,k).set(e,t)}};k=new WeakMap;var j=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function M(e){return j.has(e)}var ee=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function N(e){return ee.has(e)}function P(e){return e.index===!0}function te(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(y(e.index!==!0||!e.children,`Cannot specify children on an index route`),y(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),P(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=te(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ne(e,t,n=`/`){return I(e,t,n,!1)}function I(e,t,n,r,i){let a=U((typeof t==`string`?T(t):t).pathname||`/`,n);if(a==null)return null;let o=i??L(e),s=null,c=H(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function re(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 L(e){let t=ie(e);return R(t),t}function ie(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;y(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&&(y(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ie(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:V(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=he(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ae(e.path))a(e,t,!0,n)}),t}function ae(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=ae(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 R(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var oe=/^:[\w-]+$/,se=3,ce=2,le=1,ue=10,z=-2,B=e=>e===`*`;function V(e,t){let n=e.split(`/`),r=n.length;return n.some(B)&&(r+=z),t&&(r+=ce),n.filter(e=>!B(e)).reduce((e,t)=>e+(oe.test(t)?se:t===``?le:ue),r)}function de(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 fe(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={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?me(u,l,s.matcher,s.compiledParams):pe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:W([a,d.pathname]),pathnameBase:Ee(W([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=W([a,d.pathnameBase]))}return o}function pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=he(e.path,e.caseSensitive,e.end);return me(e,t,n,r)}function me(e,t,n,r){let 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 he(e,t=!1,n=!0){b(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 H(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return b(!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 U(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 ge({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var _e=e=>p.test(e);function ve(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?T(e):e,a;return n?(n=we(n),a=n.startsWith(`/`)?ye(n.substring(1),`/`):ye(n,t)):a=t,{pathname:a,search:De(r),hash:Oe(i)}}function ye(e,t){let n=Te(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function be(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 xe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Se(e){let t=xe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ce(e,t,n,r=!1){let i;typeof e==`string`?i=T(e):(i={...e},y(!i.pathname||!i.pathname.includes(`?`),be(`?`,`pathname`,`search`,i)),y(!i.pathname||!i.pathname.includes(`#`),be(`#`,`pathname`,`hash`,i)),y(!i.search||!i.search.includes(`#`),be(`#`,`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=ve(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var we=e=>e.replace(/[\\/]{2,}/g,`/`),W=e=>we(e.join(`/`)),Te=e=>e.replace(/\/+$/,``),Ee=e=>Te(e).replace(/^\/*/,`/`),De=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Oe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ke=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ae=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 je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function G(e){return W(e.map(e=>e.route.path).filter(Boolean))||`/`}var K=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Me(e,t){let n=e;if(typeof n!=`string`||!p.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(K)try{let e=new URL(window.location.href),r=m.test(n)?new URL(h(n,e.protocol)):new URL(n),a=U(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{b(!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 Ne=Symbol(`Uninstrumented`);function Pe(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=Ie(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=Ie(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[Ne]??i,a=Ie(n[e],t,(...e)=>q(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ne]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ne]??e,r=Ie(n.middleware,t,(...e)=>q(e[0]));return r?(r[Ne]=t,r):e})),r}function Fe(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[Ne]??e.navigate,r=Ie(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?w(n):`.`,...Re(e,r??{})}});r&&(r[Ne]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ne]??e.fetch,r=Ie(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Re(e,i??{})}});r&&(r[Ne]=t,e.fetch=r)}return e}function Ie(e,t,n){return e.length===0?null:async(...r)=>{let i=await Le(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Le(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=Le(e,t,n,r-1),a=await o,y(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 q(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ze(t),params:{...r},pattern:i,context:Be(n)}}function Re(e,t){return{currentUrl:w(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 ze(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Be(e){if(He(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Ve=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function He(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`)===Ve}var Ue=[`POST`,`PUT`,`PATCH`,`DELETE`],We=new Set(Ue),Ge=[`GET`,...Ue],Ke=new Set(Ge),qe=new Set([301,302,303,307,308]),Je=new Set([307,308]),Ye={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xe={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ze={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Qe=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),$e=`remix-router-transitions`,et=Symbol(`ResetLoaderData`),J,tt,nt,rt,it=class{constructor(e){d(this,J),d(this,tt),d(this,nt),d(this,rt),f(this,J,e),f(this,tt,L(e))}get stableRoutes(){return u(this,J)}get activeRoutes(){return u(this,nt)??u(this,J)}get branches(){return u(this,rt)??u(this,tt)}get hasHMRRoutes(){return u(this,nt)!=null}setRoutes(e){f(this,J,e),f(this,tt,L(e))}setHmrRoutes(e){f(this,nt,e),f(this,rt,L(e))}commitHmrRoutes(){u(this,nt)&&(f(this,J,u(this,nt)),f(this,tt,u(this,rt)),f(this,nt,void 0),f(this,rt,void 0))}};J=new WeakMap,tt=new WeakMap,nt=new WeakMap,rt=new WeakMap;function at(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;y(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Qe,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Pe(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new it(te(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||St,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=I(s.activeRoutes,e.history.location,c,!1,s.branches),x=!1,S=null,w,E;if(v==null&&!e.patchRoutesOnNavigation){let t=Y(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Kt(s.activeRoutes);w=!0,E=!w,v=n,S={[r.id]:t}}else if(v&&!e.hydrationData&&J(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){w=!1,E=!w,v=[];let t=J(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(x=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))w=!1,E=!w;else if(!v.some(e=>ut(e.route)))w=!0,E=!w;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}E=!1,w=!0,r.forEach(e=>{let r=dt(e.route,t,n);E||=r.renderFallback,w&&=!r.shouldLoad})}let O,k={historyAction:e.history.action,location:e.history.location,matches:v,initialized:w,renderFallback:E,navigation:Ye,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},j=`POP`,M=null,ee=!1,N,P=!1,F=new Map,ne=null,L=!1,ie=!1,ae=new Set,R=new Map,oe=0,se=-1,ce=new Map,le=new Set,ue=new Map,z=new Map,B=new Set,V=new Map,de,fe=null;function pe(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(de){de(),de=void 0;return}b(V.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=We({currentLocation:k.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{de=e});e.history.go(r*-1),Ue(i,{state:`blocked`,location:n,proceed(){Ue(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(k.blockers);e.set(i,Ze),H({blockers:e})}}),M?.resolve(),M=null;return}return be(t,n)}),n){hn(t,F);let e=()=>gn(t,F);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return k.initialized||be(`POP`,k.location,{initialHydration:!0}),O}function me(){d&&d(),ne&&ne(),f.clear(),N&&N.abort(),k.fetchers.forEach((e,t)=>Ie(k.fetchers,t)),k.blockers.forEach((e,t)=>He(t))}function he(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(k,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function H(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),k={...k,...e};let n=[],r=[];k.fetchers.forEach((e,t)=>{e.state===`idle`&&(B.has(t)?n.push(t):r.push(t))}),B.forEach(e=>{!k.fetchers.has(e)&&!R.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(k,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ie(k.fetchers,e)),r.forEach(e=>k.fetchers.delete(e))}function ge(t,n,{flushSync:r}={}){let i=k.actionData!=null&&k.navigation.formMethod!=null&&Z(k.navigation.formMethod)&&k.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?k.actionData:null;let o=n.loaderData?Ut(k.loaderData,n.loaderData,n.matches||[],n.errors):k.loaderData,c=k.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Ze)));let l=!L&&et(t,n.matches||k.matches),u=ee===!0||k.navigation.formMethod!=null&&Z(k.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),L||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=F.get(k.location.pathname);e&&e.has(t.pathname)?d={currentLocation:k.location,nextLocation:t}:F.has(t.pathname)&&(d={currentLocation:t,nextLocation:k.location})}else if(P){let e=F.get(k.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(k.location.pathname,e)),d={currentLocation:k.location,nextLocation:t}}H({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:Ye,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,ee=!1,P=!1,L=!1,ie=!1,M?.resolve(),M=null,fe?.resolve(),fe=null}async function ve(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||=_n();let n=M.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=ct(!1,st(k.location,k.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?T(n.mask):{...k.location.mask,...n.mask}});let s=k.location,l=C(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Z(i.formMethod)&&i.formAction===k.location.pathname+k.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=We({currentLocation:s,nextLocation:l,historyAction:d});if(m){Ue(m,{state:`blocked`,location:l,proceed(){Ue(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),ve(t,n)},reset(){let e=new Map(k.blockers);e.set(m,Ze),H({blockers:e})}});return}await be(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ye(){fe||=_n(),Ae(),H({revalidation:`loading`});let e=fe.promise;return k.navigation.state===`submitting`?e:k.navigation.state===`idle`?(be(k.historyAction,k.location,{startUninterruptedRevalidation:!0}),e):(be(j||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:P===!0}),e)}async function be(t,n,r){N&&N.abort(),N=null,j=t,L=(r&&r.startUninterruptedRevalidation)===!0,$e(k.location,k.matches),ee=(r&&r.preventScrollReset)===!0,P=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&k.matches&&k.matches.length>0&&!x?k.matches:I(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&k.initialized&&!ie&&Yt(k.location,n)&&!(r&&r.submission&&Z(r.submission.formMethod))){ge(n,{matches:a},{flushSync:o});return}let l=J(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);ge(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;N=new AbortController;let d=Lt(e.history,n,N.signal,r&&r.submission),f=e.getContext?await e.getContext():new A,p;if(r&&r.pendingError)p=[Gt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Z(r.submission.formMethod)){let i=await xe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(X(t)&&je(t.error)&&t.error.status===404){N=null,ge(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=un(n,a,t,r.submission),o=!1,l.active=!1,d=Lt(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Se(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(N=null,ge(n,{matches:h||a,...Wt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function xe(t,n,i,l,u,d,f,p,m={}){if(Ae(),H({navigation:dn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await tt(l,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}=Kt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Gt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ge(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=cn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Y(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Oe(t,n,Ot(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(en(h)){let n;return n=m&&m.replace!=null?m.replace:It(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===k.location.pathname+k.location.search,await De(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(X(h)){let e=Gt(l,g.route.id);return(m&&m.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Se(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||un(n,i,l,p),x=p||m||ln(b),S=!L&&!g;if(d){if(S){let e=Ce(v);H({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await tt(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}=Kt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Gt(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}=Ge(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=lt(t,u,a,o,e.history,k,i,x,n,g?[]:r,g===!0,ie,ae,B,ue,le,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(se=++oe,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(k.fetchers),t=ze(e);return ge(n,{matches:i,loaderData:{},errors:v&&X(v[1])?{[v[0]]:v[1].error}:null,...Wt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Ce(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=we(T)),H(e,{flushSync:_})}T.forEach(e=>{q(e.key),e.controller&&R.set(e.key,e.controller)});let E=()=>T.forEach(e=>q(e.key));N&&N.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await ke(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener(`abort`,E),T.forEach(e=>R.delete(e.key));let A=qt(D);if(A)return await De(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=qt(O),A)return le.add(A.key),await De(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(k.fetchers),{loaderData:M,errors:ee}=Ht(k,i,D,v,T,O,j);g&&k.errors&&(ee={...k.errors,...ee});let P=ze(j),te=Be(se,j),F=P||te||T.length>0;return{matches:i,loaderData:M,errors:ee,...F?{workingFetchers:j}:{}}}function Ce(e){if(e&&!X(e[1]))return{[e[0]]:e[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function we(e){let t=new Map(k.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=fn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function W(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=st(k.location,k.matches,c,r,n,i?.relative),u=I(o,l,c,!1,s.branches),d=J(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){K(t,n,Y(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=ct(!0,l,i);if(m){K(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new A,g=(i&&i.preventScrollReset)===!0;if(p&&Z(p.formMethod)){await Te(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ue.set(t,{routeId:n,path:f}),await Ee(t,n,f,u,h,d.active,a,g,p)}async function Te(t,n,i,l,u,d,f,p,m,h){Ae(),ue.delete(t),G(t,pn(m,k.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Lt(e.history,i,g.signal,m);if(d){let e=await tt(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{K(t,n,Y(404,{pathname:i}),{flushSync:f});return}}let v=cn(l,i);if(!v.route.action&&!v.route.lazy){K(t,n,Y(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}R.set(t,g);let b=oe,x=Ot(a,o,_,i,l,v,r,u),S=await Oe(_,i,x,u,t),C=S[v.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(_.signal.aborted){R.get(t)===g&&R.delete(t);return}if(B.has(t)){if(en(C)||X(C)){G(t,mn(void 0));return}}else{if(en(C))if(R.delete(t),se>b){G(t,mn(void 0));return}else return le.add(t),G(t,fn(m)),De(_,C,!1,{fetcherSubmission:m,preventScrollReset:p});if(X(C)){K(t,n,C.error);return}}let w=k.navigation.location||k.location,T=Lt(e.history,w,g.signal),E=s.activeRoutes,D=k.navigation.state===`idle`?k.matches:I(E,k.navigation.location,c,!1,s.branches);y(D,`Didn't find any matches after fetcher action`);let O=++oe;ce.set(t,O);let{dsMatches:A,revalidatingFetchers:M}=lt(T,u,a,o,e.history,k,D,m,w,r,!1,ie,ae,B,ue,le,E,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,C],h),ee=fn(m,C.data),P=new Map(k.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=fn(void 0,n?n.data:void 0);P.set(t,r),q(t),e.controller&&R.set(t,e.controller)}),H({fetchers:P});let te=()=>M.forEach(e=>q(e.key));g.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await ke(A,M,T,w,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,te),ce.delete(t),R.delete(t),M.forEach(e=>R.delete(e.key));let re=k.fetchers.has(t),L=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,mn(C.data)),{...e,fetchers:n}},z=qt(F);if(z)return k=L(k),De(T,z.result,!1,{preventScrollReset:p});if(z=qt(ne),z)return le.add(z.key),k=L(k),De(T,z.result,!1,{preventScrollReset:p});let V=new Map(k.fetchers);re&&V.set(t,mn(C.data));let{loaderData:de,errors:fe}=Ht(k,D,F,void 0,M,ne,V);Be(O,V),k.navigation.state===`loading`&&O>se?(y(j,`Expected pending action`),N&&N.abort(),ge(k.navigation.location,{matches:D,loaderData:de,errors:fe,fetchers:V})):(H({errors:fe,loaderData:Ut(k.loaderData,de,D,fe),fetchers:V}),ie=!1)}async function Ee(t,n,i,s,c,l,u,d,f){let p=k.fetchers.get(t);G(t,fn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Lt(e.history,i,m.signal);if(l){let e=await tt(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,Y(404,{pathname:i}),{flushSync:u});return}}let g=cn(s,i);R.set(t,m);let _=oe,v=await Oe(h,i,Ot(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(R.get(t)===m&&R.delete(t),!h.signal.aborted){if(B.has(t)){G(t,mn(void 0));return}if(en(y))if(se>_){G(t,mn(void 0));return}else{le.add(t),await De(h,y,!1,{preventScrollReset:d});return}if(X(y)){K(t,n,y.error);return}G(t,mn(y.data))}}async function De(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ie=!0);let d=i.response.headers.get(`Location`);y(d,`Expected a Location header on the redirect Response`),d=It(d,new URL(r.url),c,e.history);let f=C(k.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(_e(d)){let n=D(t,d,!0);e=n.origin!==t.location.origin||U(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}N=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=k.navigation;!o&&!s&&m&&h&&g&&(o=ln(k.navigation));let _=o||s;Je.has(i.response.status)&&_&&Z(_.formMethod)?await be(p,f,{submission:{..._,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?P:void 0}):await be(p,f,{overrideNavigation:un(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?P:void 0})}async function Oe(e,t,n,r,i){let a,o={};try{a=await kt(l,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(!Z(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!k.loaderData.hasOwnProperty(e.route.id)&&(!k.errors||!k.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($t(r)){let i=r.result;o[t]={type:`redirect`,response:Nt(i,e,t,n,c)}}else o[t]=await Mt(r);return o}async function ke(e,t,n,r,i){let a=Oe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Oe(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:Y(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ae(){ie=!0,ue.forEach((e,t)=>{R.has(t)&&ae.add(t),q(t)})}function G(e,t,n={}){let r=new Map(k.fetchers);r.set(e,t),H({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=Gt(k.matches,t),a=new Map(k.fetchers);Ie(a,e),H({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Me(e){return z.set(e,(z.get(e)||0)+1),B.has(e)&&B.delete(e),k.fetchers.get(e)||Xe}function Ne(e,t){q(e,t?.reason),G(e,mn(null))}function Ie(e,t){let n=k.fetchers.get(t);R.has(t)&&!(n&&n.state===`loading`&&ce.has(t))&&q(t),ue.delete(t),ce.delete(t),le.delete(t),B.delete(t),ae.delete(t),e.delete(t)}function Le(e){let t=(z.get(e)||0)-1;t<=0?(z.delete(e),B.add(e)):z.set(e,t),H({fetchers:new Map(k.fetchers)})}function q(e,t){let n=R.get(e);n&&(n.abort(t),R.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);y(e,`Expected fetcher: ${n}`);let r=mn(e.data);t.set(n,r)}}function ze(e){let t=[],n=!1;for(let r of le){let i=e.get(r);y(i,`Expected fetcher: ${r}`),i.state===`loading`&&(le.delete(r),t.push(r),n=!0)}return Re(t,e),n}function Be(e,t){let n=[];for(let[r,i]of ce)if(i<e){let e=t.get(r);y(e,`Expected fetcher: ${r}`),e.state===`loading`&&(q(r),ce.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ve(e,t){let n=k.blockers.get(e)||Ze;return V.get(e)!==t&&V.set(e,t),n}function He(e){k.blockers.delete(e),V.delete(e)}function Ue(e,t){let n=k.blockers.get(e)||Ze;y(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(k.blockers);r.set(e,t),H({blockers:r})}function We({currentLocation:e,nextLocation:t,historyAction:n}){if(V.size===0)return;V.size>1&&b(!1,`A router only supports one blocker at a time`);let r=Array.from(V.entries()),[i,a]=r[r.length-1],o=k.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ge(e){let t=Y(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Kt(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,g=t,h=n||null,!_&&k.navigation===Ye){_=!0;let e=et(k.location,k.matches);e!=null&&H({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function qe(e,t){return h&&h(e,t.map(e=>re(e,k.loaderData)))||e.key}function $e(e,t){if(m&&g){let n=qe(e,t);m[n]=g()}}function et(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function J(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:I(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:I(n,r,c,!0,e)}}return{active:!1,matches:null}}async function tt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||ht(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=I(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=I(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&nt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=I(s.activeRoutes,n,c,!0,u),!f||nt(l,f))return{type:`success`,matches:null};l=f}}function nt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function rt(e){o={},s.setHmrRoutes(te(e,a,void 0,o))}function at(e,t,n=!1){ht(e,t,s,o,a,n),s.hasHMRRoutes||H({})}return O={get basename(){return c},get future(){return u},get state(){return k},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:pe,subscribe:he,enableScrollRestoration:Ke,navigate:ve,fetch:W,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Me,resetFetcher:Ne,deleteFetcher:Le,dispose:me,getBlocker:Ve,deleteBlocker:He,patchRoutes:at,_internalFetchControllers:R,_internalSetRoutes:rt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){H(e)}},e.instrumentations&&(O=Fe(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function ot(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function st(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=Ce(r||`.`,Se(o),U(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=sn(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=ge({basename:n,pathname:c.pathname})),w(c)}function ct(e,t,n){if(!n||!ot(n))return{path:t};if(n.formMethod&&!on(n.formMethod))return{path:t,error:Y(405,{method:n.formMethod})};let r=()=>({path:t,error:Y(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Jt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Z(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
2
|
-
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Z(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()}}}y(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=zt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=zt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Bt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Bt(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(Z(c.formMethod))return{path:t,submission:c};let l=T(t);return e&&l.search&&sn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:w(l),submission:c}}function lt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?X(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&X(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=G(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ut(s))f=!1;else if(u){let{shouldLoad:e}=dt(s,a.loaderData,a.errors);f=e}else ft(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Dt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?pt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=mt(i,m);return Dt(n,r,e,c,k,i,l,t,h,m,x)}),j=[];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,b=I(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=cn(b,e.path),C=new AbortController,w=Lt(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Ot(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Ot(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};mt(S,a)&&(T=Ot(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ut(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ut(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 ft(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function pt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function mt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function ht(e,t,n,r,i,a){let o;if(e){let t=r[e];y(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>gt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=te(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]=te([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})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function gt(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=>gt(e,t)))??!1:!1}var _t=new WeakMap,vt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(y(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=_t.get(i);o||(o={},_t.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=M(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)b(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)b(!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},yt=new WeakMap;function bt(e,t,n,r,i){let a=n[e.id];if(y(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=yt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{y(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=N(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?b(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?b(!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 yt.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=vt({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 xt(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 St(e){return e.matches.some(e=>e.route.middleware)?Ct(e,()=>xt(e)):xt(e)}function Ct(e,t){return wt(e,t,e=>{if(an(e))throw e;return e},Zt,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=Gt(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 wt(e,t,n,r,i){let{matches:a,...o}=e;return await Tt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Tt(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 Tt(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 Et(e,t,n,r,i){let a=vt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=bt(r.route,Z(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Dt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Et(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?mt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?mt(a,{...l,defaultShouldRevalidate:e}):mt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Z(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Z(n.method)||!p)?At({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Ot(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Dt(e,t,n,r,G(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Et(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function kt(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,url:Rt(t,n),pattern:G(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 Ct(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 At({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Z(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,url:Rt(e,t),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 Y(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 Y(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function jt(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 Mt(e){let{result:t,type:n}=e;if(nn(t)){let e;try{e=await jt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Ae(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?tn(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:Xt(t),statusCode:je(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:je(t)?t.status:void 0}:tn(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 Nt(e,t,n,r,i){let a=e.headers.get(`Location`);if(y(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!_e(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=st(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Pt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ft(e){try{return Pt.includes(new URL(e).protocol)}catch{return!1}}function It(e,t,n,r){if(_e(e)){let r=e,i=m.test(r)?new URL(h(r,t.protocol)):new URL(r);if(Ft(i.toString()))throw Error(`Invalid redirect location`);let a=U(i.pathname,n)!=null;if(i.origin===t.origin&&a)return we(i.pathname)+i.search+i.hash}try{if(Ft(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Lt(e,t,n,r){let i=e.createURL(Jt(t)).toString(),a={signal:n};if(r&&Z(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=zt(r.formData):a.body=r.formData}return new Request(i,a)}function Rt(e,t){let n=new URL(e.url),r=typeof t==`string`?T(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 zt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Bt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Vt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&X(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(y(!en(f),`Cannot handle redirect results in processLoaderData`),X(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Gt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=et),c||(c=!0,s=je(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 Ht(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Vt(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 s=a[n];if(y(s,`Did not find corresponding fetcher result`),X(s)){let t=Gt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(en(s))y(!1,`Unhandled fetcher revalidation redirect`);else{let e=mn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Ut(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==et).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 Wt(e){return e?X(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Gt(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 Kt(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 Y(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 Ae(e||500,o,Error(s),!0)}function qt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(en(r))return{key:n,result:r}}}function Jt(e){return w({...typeof e==`string`?T(e):e,hash:``})}function Yt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Xt(e){return new Ae(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Zt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Qt(t))}function Qt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function $t(e){return nn(e.result)&&qe.has(e.result.status)}function X(e){return e.type===`error`}function en(e){return(e&&e.type)===`redirect`}function tn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function nn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function rn(e){return qe.has(e)}function an(e){return nn(e)&&rn(e.status)&&e.headers.has(`Location`)}function on(e){return Ke.has(e.toUpperCase())}function Z(e){return We.has(e.toUpperCase())}function sn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function cn(e,t){let n=typeof t==`string`?T(t).search:t.search;if(e[e.length-1].route.index&&sn(n||``))return e[e.length-1];let r=xe(e);return r[r.length-1]}function ln(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 un(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function fn(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 pn(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 mn(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 hn(e,t){try{let n=e.sessionStorage.getItem($e);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 gn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(n))}catch(e){b(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function _n(){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 vn=s.createContext(null);vn.displayName=`DataRouter`;var yn=s.createContext(null);yn.displayName=`DataRouterState`;var bn=s.createContext(!1);function xn(){return s.useContext(bn)}var Sn=s.createContext({isTransitioning:!1});Sn.displayName=`ViewTransition`;var Cn=s.createContext(new Map);Cn.displayName=`Fetchers`;var wn=s.createContext(null);wn.displayName=`Await`;var Q=s.createContext(null);Q.displayName=`Navigation`;var Tn=s.createContext(null);Tn.displayName=`Location`;var En=s.createContext({outlet:null,matches:[],isDataRoute:!1});En.displayName=`Route`;var Dn=s.createContext(null);Dn.displayName=`RouteError`;var On=`REACT_ROUTER_ERROR`,kn=`REDIRECT`,An=`ROUTE_ERROR_RESPONSE`;function jn(e){if(e.startsWith(`${On}:${kn}:{`))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 Mn(e){if(e.startsWith(`${On}:${An}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ae(t.status,t.statusText,t.data)}catch{}}function Nn(e,{relative:t}={}){y(Pn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=s.useContext(Q),{hash:i,pathname:a,search:o}=zn(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:W([n,a])),r.createHref({pathname:c,search:o,hash:i})}function Pn(){return s.useContext(Tn)!=null}function $(){return y(Pn(),`useLocation() may be used only in the context of a <Router> component.`),s.useContext(Tn).location}var Fn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function In(e){s.useContext(Q).static||s.useLayoutEffect(e)}function Ln(){let{isDataRoute:e}=s.useContext(En);return e?rr():Rn()}function Rn(){y(Pn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=s.useContext(vn),{basename:t,navigator:n}=s.useContext(Q),{matches:r}=s.useContext(En),{pathname:i}=$(),a=JSON.stringify(Se(r)),o=s.useRef(!1);return In(()=>{o.current=!0}),s.useCallback((r,s={})=>{if(b(o.current,Fn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Ce(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}s.createContext(null);function zn(e,{relative:t}={}){let{matches:n}=s.useContext(En),{pathname:r}=$(),i=JSON.stringify(Se(n));return s.useMemo(()=>Ce(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Bn(e,t,n){y(Pn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=s.useContext(Q),{matches:i}=s.useContext(En),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;ar(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
-
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),f;if(t){let e=typeof t==`string`?T(t):t;y(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||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ne(e,{pathname:m});b(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),b(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.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 g=qn(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,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&&g?s.createElement(Tn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function Vn(){let e=nr(),t=je(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},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=s.createElement(s.Fragment,null,s.createElement(`p`,null,`💿 Hey developer 👋`),s.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,s.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,s.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),s.createElement(s.Fragment,null,s.createElement(`h2`,null,`Unexpected Application Error!`),s.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?s.createElement(`pre`,{style:i},n):null,o)}var Hn=s.createElement(Vn,null),Un=class extends s.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=Mn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:s.createElement(En.Provider,{value:this.props.routeContext},s.createElement(Dn.Provider,{value:e,children:this.props.component}));return this.context?s.createElement(Gn,{error:e},t):t}};Un.contextType=bn;var Wn=new WeakMap;function Gn({children:e,error:t}){let{basename:n}=s.useContext(Q);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=jn(t.digest);if(e){let r=Wn.get(t);if(r)throw r;let i=Me(e.location,n),a=i.absoluteURL||i.to;if(Ft(a))throw Error(`Invalid redirect location`);if(K&&!Wn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Wn.set(t,n),n}return s.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Kn({routeContext:e,match:t,children:n}){let r=s.useContext(vn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(En.Provider,{value:e},n)}function qn(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);y(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 o=!1,c=-1;if(n&&r){o=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,s=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||s){n.isStatic&&(o=!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??{},pattern:G(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||Hn,o&&(c<0&&l===0?(ar(`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?s.createElement(n.route.Component,null):n.route.element?n.route.element:e,s.createElement(Kn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?s.createElement(Un,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yn(e){let t=s.useContext(vn);return y(t,Jn(e)),t}function Xn(e){let t=s.useContext(yn);return y(t,Jn(e)),t}function Zn(e){let t=s.useContext(En);return y(t,Jn(e)),t}function Qn(e){let t=Zn(e),n=t.matches[t.matches.length-1];return y(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $n(){return Qn(`useRouteId`)}function er(){let e=Xn(`useNavigation`);return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function tr(){let{matches:e,loaderData:t}=Xn(`useMatches`);return s.useMemo(()=>e.map(e=>re(e,t)),[e,t])}function nr(){let e=s.useContext(Dn),t=Xn(`useRouteError`),n=Qn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rr(){let{router:e}=Yn(`useNavigate`),t=Qn(`useNavigate`),n=s.useRef(!1);return In(()=>{n.current=!0}),s.useCallback(async(r,i={})=>{b(n.current,Fn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ir={};function ar(e,t,n){!t&&!ir[e]&&(ir[e]=!0,b(!1,n))}var or={};function sr(e,t){!e&&!or[t]&&(or[t]=!0,console.warn(t))}var cr=s.useOptimistic,lr=()=>void 0;function ur(e){return cr?cr(e):[e,lr]}function dr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&b(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:s.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&b(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:s.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&b(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:s.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var fr=[`HydrateFallback`,`hydrateFallbackElement`],pr=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 mr({router:e,flushSync:t,onError:n,useTransitions:r}){r=xn()||r;let[i,a]=s.useState(e.state),[o,c]=ur(i),[l,u]=s.useState(),[d,f]=s.useState({isTransitioning:!1}),[p,m]=s.useState(),[h,g]=s.useState(),[_,v]=s.useState(),y=s.useRef(new Map),b=s.useCallback((i,{deletedFetchers:o,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:G(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),sr(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(sr(_==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):s.startTransition(()=>{r===!0&&c(e=>hr(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]);s.useLayoutEffect(()=>e.subscribe(b),[e,b]),s.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new pr)},[d]),s.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):s.startTransition(()=>{r===!0&&c(e=>hr(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]),s.useEffect(()=>{p&&l&&o.location.key===l.location.key&&p.resolve()},[p,h,o.location,l]),s.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=s.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=s.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return s.createElement(s.Fragment,null,s.createElement(vn.Provider,{value:C},s.createElement(yn.Provider,{value:o},s.createElement(Cn.Provider,{value:y.current},s.createElement(Sn.Provider,{value:d},s.createElement(vr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},s.createElement(gr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function hr(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 gr=s.memo(_r);function _r({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Bn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function vr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){y(!Pn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=s.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof n==`string`&&(n=T(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=s.useMemo(()=>{let e=U(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[c,u,d,f,p,m,r,h]);return b(g!=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.`),g==null?null:s.createElement(Q.Provider,{value:l},s.createElement(Tn.Provider,{children:t,value:g}))}s.Component;var yr=`get`,br=`application/x-www-form-urlencoded`;function xr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Sr(e){return xr(e)&&e.tagName.toLowerCase()===`button`}function Cr(e){return xr(e)&&e.tagName.toLowerCase()===`form`}function wr(e){return xr(e)&&e.tagName.toLowerCase()===`input`}function Tr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Er(e,t){return e.button===0&&(!t||t===`_self`)&&!Tr(e)}function Dr(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 Or(e,t){let n=Dr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var kr=null;function Ar(){if(kr===null)try{new FormData(document.createElement(`form`),0),kr=!1}catch{kr=!0}return kr}var jr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Mr(e){return e!=null&&!jr.has(e)?(b(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${br}"`),null):e}function Nr(e,t){let n,r,i,a,o;if(Cr(e)){let o=e.getAttribute(`action`);r=o?U(o,t):null,n=e.getAttribute(`method`)||yr,i=Mr(e.getAttribute(`enctype`))||br,a=new FormData(e)}else if(Sr(e)||wr(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?U(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||yr,i=Mr(e.getAttribute(`formenctype`))||Mr(o.getAttribute(`enctype`))||br,a=new FormData(o,e),!Ar()){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(xr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=yr,r=null,i=br,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 Pr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Fr=/[&><\u2028\u2029]/g;function Ir(e){return e.replace(Fr,e=>Pr[e])}function Lr(e,t){if(e===!1||e==null)throw Error(t)}function Rr(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&&U(i.pathname,t)===`/`?i.pathname=`${Te(t)}/_root.${r}`:i.pathname=`${Te(i.pathname)}.${r}`,i}async function zr(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 Br(e){return e!=null&&typeof e.page==`string`}function Vr(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 Hr(e,t,n){return qr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await zr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Vr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ur(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,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 Wr(e,t,{includeHydrateFallback:n}={}){return Gr(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 Gr(e){return[...new Set(e)]}function Kr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function qr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Br(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Kr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Jr(){let e=s.useContext(vn);return Lr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Yr(){let e=s.useContext(yn);return Lr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Xr=s.createContext(void 0);Xr.displayName=`FrameworkContext`;function Zr(){let e=s.useContext(Xr);return Lr(e,`You must render this element inside a <HydratedRouter> element`),e}function Qr(e,t){let n=s.useContext(Xr),[r,i]=s.useState(!1),[a,o]=s.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=s.useRef(null);s.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),s.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:$r(c,m),onBlur:$r(l,h),onMouseEnter:$r(u,m),onMouseLeave:$r(d,h),onTouchStart:$r(f,m)}]:[a,p,{}]:[!1,p,{}]}function $r(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ei({page:e,...t}){let n=xn(),{nonce:r}=Zr(),{router:i}=Jr(),a=s.useMemo(()=>ne(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(ni,{page:e,matches:a,...t}):s.createElement(ri,{page:e,matches:a,...t})):null}function ti(e){let{manifest:t,routeModules:n}=Zr(),[r,i]=s.useState([]);return s.useEffect(()=>{let r=!1;return Hr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ni({page:e,matches:t,...n}){let r=$(),{future:i}=Zr(),{basename:a}=Jr(),o=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Rr(e,a,i.v8_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.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,o.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ri({page:e,matches:t,...n}){let r=$(),{future:i,manifest:a,routeModules:o}=Zr(),{basename:c}=Jr(),{loaderData:l,matches:u}=Yr(),d=s.useMemo(()=>Ur(e,t,u,a,r,`data`),[e,t,u,a,r]),f=s.useMemo(()=>Ur(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!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&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=Rr(e,c,i.v8_trailingSlashAwareDataRequests,`data`);return s&&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.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=s.useMemo(()=>Wr(f,a),[f,a]),h=ti(f);return s.createElement(s.Fragment,null,p.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>s.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>s.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ii(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}s.Component;var ai=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ai&&(window.__reactRouterVersion=`7.18.1`)}catch{}function oi(e,t){return at({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:v({window:t?.window}),hydrationData:t?.hydrationData||si(),routes:e,mapRouteProperties:dr,hydrationRouteProperties:fr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function si(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ci(e.errors)}),e}function ci(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 Ae(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&ke.includes(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 li({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=s.useState({action:n.action,location:n.location}),o=s.useCallback(e=>{r===!1?a(e):s.startTransition(()=>a(e))},[r]);return s.useLayoutEffect(()=>n.listen(o),[n,o]),s.createElement(vr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}li.displayName=`unstable_HistoryRouter`;var ui=s.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=s.useContext(Q),b=typeof u==`string`&&p.test(u),x=Me(u,_);u=x.to;let S=Nn(u,{relative:r}),C=$(),w=null;if(o){let e=Ce(o,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:W([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=Qr(n,h),O=_i(u,{replace:a,mask:o,state:c,target:l,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:m,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||i),j=s.createElement(`a`,{...h,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:ii(g,E),target:l,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?s.createElement(s.Fragment,null,j,s.createElement(ei,{page:S})):j});ui.displayName=`Link`;var di=s.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:c,...l},u){let d=zn(a,{relative:l.relative}),f=$(),p=s.useContext(yn),{navigator:m,basename:h}=s.useContext(Q),g=p!=null&&Oi(d)&&o===!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=U(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 s.createElement(ui,{...l,"aria-current":w,className:T,ref:u,style:E,to:a,viewTransition:o},typeof c==`function`?c(C):c)});di.displayName=`NavLink`;var fi=s.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=yr,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=s.useContext(Q),v=xi(),y=Si(c,{relative:u}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&p.test(c);return s.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||o,p=()=>v(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:m});_&&n!==!1?s.startTransition(()=>p()):p()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});fi.displayName=`Form`;function pi({getKey:e,storageKey:t,...n}){let r=s.useContext(Xr),{basename:i}=s.useContext(Q),a=$(),o=tr();Ei({getKey:e,storageKey:t});let c=s.useMemo(()=>{if(!r||!e)return null;let t=Ti(a,o,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 n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),s.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Ir(JSON.stringify(t||Ci))}, ${Ir(JSON.stringify(c))})`}})}pi.displayName=`ScrollRestoration`;function mi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hi(e){let t=s.useContext(vn);return y(t,mi(e)),t}function gi(e){let t=s.useContext(yn);return y(t,mi(e)),t}function _i(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Ln(),f=$(),p=zn(e,{relative:o});return s.useCallback(m=>{if(Er(m,t)){m.preventDefault();let t=n===void 0?w(f)===w(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l});u?s.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,c,l,u])}function vi(e){b(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=s.useRef(Dr(e)),n=s.useRef(!1),r=$(),i=s.useMemo(()=>Or(r.search,n.current?null:t.current),[r.search]),a=Ln();return[i,s.useCallback((e,t)=>{let r=Dr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var yi=0,bi=()=>`__${String(++yi)}__`;function xi(){let{router:e}=hi(`useSubmit`),{basename:t}=s.useContext(Q),n=$n(),r=e.fetch,i=e.navigate;return s.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Nr(e,t);if(a.navigate===!1){let e=a.fetcherKey||bi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.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 Si(e,{relative:t}={}){let{basename:n}=s.useContext(Q),r=s.useContext(En);y(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...zn(e||`.`,{relative:t})},o=$();if(e==null){a.search=o.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])),w(a)}var Ci=`react-router-scroll-positions`,wi={};function Ti(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:U(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ei({getKey:e,storageKey:t}={}){let{router:n}=hi(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=gi(`useScrollRestoration`),{basename:a}=s.useContext(Q),o=$(),c=tr(),l=er();s.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Di(s.useCallback(()=>{if(l.state===`idle`){let t=Ti(o,c,a,e);wi[t]=window.scrollY}try{sessionStorage.setItem(t||Ci,JSON.stringify(wi))}catch(e){b(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,c,t])),typeof document<`u`&&(s.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Ci);e&&(wi=JSON.parse(e))}catch{}},[t]),s.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(wi,()=>window.scrollY,e?(t,n)=>Ti(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{b(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Di(e,t){let{capture:n}=t||{};s.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Oi(e,{relative:t}={}){let n=s.useContext(Sn);y(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hi(`useViewTransitionState`),i=zn(e,{relative:t});if(!n.isTransitioning)return!1;let a=U(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=U(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pe(i.pathname,o)!=null||pe(i.pathname,a)!=null}function ki(e){return{kind:e.identityKind,key:e.identityKey}}function Ai(e){return`/projects/${encodeURIComponent(e.kind)}/${encodeURIComponent(e.key)}`}function ji(e){return o(i(e),e.id)}function Mi(e,t,n){let r=e.get(t);if(r){r.push(n);return}e.set(t,[n])}function Ni(e,t){let a=n(e),o=new Map,s=new Map,c=new Map,l=new Map,u=[],d=new Set(t.map(e=>e.name.toLowerCase()));for(let e of d)o.set(e,[]),s.set(e,[]);for(let t of e){let e=i(t),n={...t,agentKey:e,sessionId:t.id,reference:t.slug};u.push(n),d.has(e)&&s.get(e).push(n);let a=t.project_identity;if(!a?.key)continue;let o=r(a);Mi(c,o,n);let f=l.get(o);f?f.count+=1:l.set(o,{key:o,identityKind:a.kind,identityKey:a.key,label:a.displayName||t.directory,count:1})}for(let e of d)o.set(e,a.byAgent.get(e)??[]);return{byRouteKey:a.byRouteKey,byAgent:o,byProjectIdentityKey:a.byProjectIdentityKey,byProjectAgentKey:a.byProjectAgentKey,byLandingAgent:s,byLandingProjectIdentityKey:c,landingSessions:u,sessionsByActivity:a.sessionsByActivity,projectOptions:[...l.values()].toSorted((e,t)=>t.count-e.count).slice(0,8)}}function Pi(e){let t=new Map,n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],a=ji(i);t.has(a)||(t.set(a,i),n.set(a,r))}return{byReference:t,indexByReference:n}}export{Ai as a,oi as c,$ as d,tr as f,vi as h,ki as i,O as l,nr as m,Pi as n,ui as o,Ln as p,ji as r,mr as s,Ni as t,je as u};
|
|
File without changes
|
|
File without changes
|