@pplancq/react-template 2.7.5 → 2.7.7

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.
@@ -1,6 +0,0 @@
1
- /*! For license information please see lib-router.3451e29e.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_pplancq_react_template=self.webpackChunk_pplancq_react_template||[]).push([["535"],{31:function(e,t,r){r.d(t,{N_:()=>t$,Ys:()=>tD,k2:()=>tT,pg:()=>to,r5:()=>e9,sv:()=>tl});var n,a=r(41),o=e=>{throw TypeError(e)},i=(e,t,r)=>(t.has(e)||o("Cannot read from private field"),r?r.call(e):t.get(e)),l="popstate";function s(e,t){if(!1===e||null==e)throw Error(t)}function u(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function d(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?f(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function h({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function f(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function p(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),s(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:h(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var m=class{constructor(e){if(((e,t,r)=>t.has(e)?o("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r))(this,n,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(i(this,n).has(e))return i(this,n).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){i(this,n).set(e,t)}};n=new WeakMap;var y=new Set(["lazy","caseSensitive","path","id","index","children"]),v=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function g(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(s(!0!==e.index||!e.children,"Cannot specify children on an index route"),s(a||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),!0===e.index){let r={...e,...t(e),id:l};return n[l]=r,r}{let r={...e,...t(e),id:l,children:void 0};return n[l]=r,e.children&&(r.children=g(e.children,t,i,n,a)),r}})}function w(e,t,r="/"){return b(e,t,r,!1)}function b(e,t,r,n){let a=C(("string"==typeof t?f(t):t).pathname||"/",r);if(null==a)return null;let o=function e(t,r=[],n=[],a="",o=!1){let i=(t,i,l=o,u)=>{var c,d;let h,f,p={relativePath:void 0===u?t.path||"":u,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&l)return;s(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let m=M([a,p.relativePath]),y=n.concat(p);t.children&&t.children.length>0&&(s(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),e(t.children,r,y,m,l)),(null!=t.path||t.index)&&r.push({path:m,score:(c=m,d=t.index,f=(h=c.split("/")).length,h.some(x)&&(f+=-2),d&&(f+=2),h.filter(e=>!x(e)).reduce((e,t)=>e+(R.test(t)?3:""===t?1:10),f)),routesMeta:y})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))i(e,t,!0,r);else i(e,t)}),r}(e);o.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)});let i=null;for(let e=0;null==i&&e<o.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return u(!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}}(a);i=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=S({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},u),d=l.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=S({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:M([o,c.pathname]),pathnameBase:$(M([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=M([o,c.pathnameBase]))}return i}(o[e],t,n)}return i}function E(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}var R=/^:[\w-]+$/,x=e=>"*"===e;function S(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){u("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function C(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function P(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function L(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function k(e){let t=L(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function D(e,t,r,n=!1){let a,o;"string"==typeof e?a=f(e):(s(!(a={...e}).pathname||!a.pathname.includes("?"),P("?","pathname","search",a)),s(!a.pathname||!a.pathname.includes("#"),P("#","pathname","hash",a)),s(!a.search||!a.search.includes("#"),P("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=function(e,t="/"){var r;let n,{pathname:a,search:o="",hash:i=""}="string"==typeof e?f(e):e;return{pathname:a?a.startsWith("/")?a:(r=a,n=t.replace(/\/+$/,"").split("/"),r.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"):t,search:T(o),hash:O(i)}}(a,o),c=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}var M=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),T=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",A=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function j(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var z=["POST","PUT","PATCH","DELETE"],U=new Set(z),F=new Set(["GET",...z]),N=new Set([301,302,303,307,308]),_=new Set([307,308]),H={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},I={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},W={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},B=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Y=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),q="remix-router-transitions",V=Symbol("ResetLoaderData");function J(e,t,r,n,a,o){let i,l;if(a){for(let e of(i=[],t))if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=D(n||".",k(i),C(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=eA(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:M([e,t])}({basename:r,pathname:s.pathname})),h(s)}function K(e,t,r){var n;let a,o;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!F.has(n.toUpperCase())))return{path:t,error:eC(405,{method:r.formMethod})};let i=()=>({path:t,error:eC(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),u=eL(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!eO(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}
3
- `,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if("application/json"===r.formEncType){if(!eO(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return i()}}}if(s("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=eg(r.formData),o=r.formData;else if(r.body instanceof FormData)a=eg(r.body),o=r.body;else if(r.body instanceof URLSearchParams)o=ew(a=r.body);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=ew(a)}catch(e){return i()}let c={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(eO(c.formMethod))return{path:t,submission:c};let d=f(t);return e&&d.search&&eA(d.search)&&a.append("index",""),d.search=`?${a}`,{path:h(d),submission:c}}function X(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m,y,v,g,b){let E,R=b?eD(b[1])?b[1].error:b[1].data:void 0,x=a.createURL(o.location),S=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];E=i.findIndex(t=>t.route.id===e)}else if(b&&eD(b[1])){let e=b[0];E=i.findIndex(t=>t.route.id===e)-1}let C=b?b[1].statusCode:void 0,P=C&&C>=400,L={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...l,actionResult:R,actionStatus:C},k=i.map((a,i)=>{var l,s,h,f,p;let m,y,v,{route:g}=a,w=null;if(null!=E&&i>E?w=!1:g.lazy?w=!0:G(g)?c?w=Q(g,o.loaderData,o.errors):(l=o.loaderData,s=o.matches[i],h=a,m=!s||h.route.id!==s.route.id,y=!l.hasOwnProperty(h.route.id),(m||y)&&(w=!0)):w=!1,null!==w)return ec(r,n,e,a,u,t,w);let b=!P&&(d||x.pathname+x.search===S.pathname+S.search||x.search!==S.search||(f=o.matches[i],p=a,v=f.route.path,f.pathname!==p.pathname||null!=v&&v.endsWith("*")&&f.params["*"]!==p.params["*"])),R={...L,defaultShouldRevalidate:b},C=Z(a,R);return ec(r,n,e,a,u,t,C,R)}),D=[];return p.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),p=s&&"idle"!==s.state&&void 0===s.data,b=w(y,e.path,v);if(!b){if(g&&p)return;D.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(m.has(l))return;let E=ej(b,e.path),R=new AbortController,x=ev(a,e.path,R.signal),S=null;if(h.has(l))h.delete(l),S=ed(r,n,x,b,E,u,t);else if(p)d&&(S=ed(r,n,x,b,E,u,t));else{let e={...L,defaultShouldRevalidate:!P&&d};Z(E,e)&&(S=ed(r,n,x,b,E,u,t,e))}S&&D.push({key:l,routeId:e.routeId,path:e.path,matches:S,match:E,request:x,controller:R})}),{dsMatches:k,revalidatingFetchers:D}}function G(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Q(e,t,r){if(e.lazy)return!0;if(!G(e))return!1;let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function Z(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function ee(e,t,r,n,a,o){let i;if(e){let t=n[e];s(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r;let l=[],u=[];if(t.forEach(e=>{let t=i.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>r.children?.some(r=>e(t,r))))})(e,t));t?u.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=g(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&u.length>0)for(let e=0;e<u.length;e++){let{existingRoute:t,newRoute:r}=u[e],[n]=g([r],a,[],{},!0);Object.assign(t,{element:n.element?n.element:t.element,errorElement:n.errorElement?n.errorElement:t.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:t.hydrateFallbackElement})}}var et=new WeakMap,er=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(s(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=et.get(a);i||(i={},et.set(a,i));let l=i[e];if(l)return l;let c=(async()=>{let t=y.has(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)u(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)u(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=c,c},en=new WeakMap;async function ea(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function eo(e){return e.matches.some(e=>e.route.middleware)?ei(e,()=>ea(e)):ea(e)}function ei(e,t){return el(e,t,e=>e,ek,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.unstable_shouldCallHandler()),0));return Promise.resolve({[ex(n,n[a].route.id).route.id]:{type:"error",result:t}})}})}async function el(e,t,r,n,a){let{matches:o,request:i,params:l,context:s}=e,u=o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await es({request:i,params:l,context:s},u,t,r,n,a)}async function es(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await es(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function eu(e,t,r,n,a){let o=er({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o,i=r[e.id];if(s(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=en.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{s("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=v.has(e),o=void 0!==i[e]&&"hasErrorBoundary"!==e;a?u(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):o?u(!o,`Route "${i.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.`):r[e]=n}Object.assign(i,r),Object.assign(i,{...n(i),lazy:void 0})})();return en.set(i,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let l=Object.keys(e.lazy),c=[];for(let i of l){if(a&&a.includes(i))continue;let l=er({key:i,route:e,manifest:r,mapRouteProperties:n});l&&(c.push(l),i===t&&(o=l))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d?.catch(()=>{}),o?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:o}}(n.route,eO(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ec(e,t,r,n,a,o,i,l=null){let s=!1,u=eu(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:e=>(s=!0,l)?"boolean"==typeof e?Z(n,{...l,defaultShouldRevalidate:e}):Z(n,l):i,resolve(e){let{lazy:t,loader:a,middleware:l}=n.route,c=s||i||e&&!eO(r.method)&&(t||a),d=l&&l.length>0&&!a&&!t;return c&&!d?ef({request:r,match:n,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function ed(e,t,r,n,a,o,i,l=null){return n.map(n=>n.route.id!==a.route.id?{...n,shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:eu(e,t,r,n,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ec(e,t,r,n,o,i,!0,l))}async function eh(e,t,r,n,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let i={request:t,params:r[0].params,context:a,matches:r},l=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=>ei(i,()=>e({...i,fetcherKey:n,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),s=await e({...i,fetcherKey:n,runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return s}async function ef({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let i,l,s=eO(e.method),u=s?"action":"loader",c=r=>{let n,i=new Promise((e,t)=>n=t);l=()=>n(),e.signal.addEventListener("abort",l);let s=n=>"function"!=typeof r?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):r({request:e,params:t.params,context:o},...void 0!==n?[n]:[]);return Promise.race([(async()=>{try{let e=await (a?a(e=>s(e)):s());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),i])};try{let a=s?t.route.action:t.route.loader;if(r||n)if(a){let e,[t]=await Promise.all([c(a).catch(t=>{e=t}),r,n]);if(void 0!==e)throw e;i=t}else{await r;let a=s?t.route.action:t.route.loader;if(a)[i]=await Promise.all([c(a),n]);else{if("action"!==u)return{type:"data",result:void 0};let r=new URL(e.url),n=r.pathname+r.search;throw eC(405,{method:e.method,pathname:n,routeId:t.route.id})}}else if(a)i=await c(a);else{let t=new URL(e.url),r=t.pathname+t.search;throw eC(404,{pathname:r})}}catch(e){return{type:"error",result:e}}finally{l&&e.signal.removeEventListener("abort",l)}return i}async function ep(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function em(e){let{result:t,type:r}=e;if(eT(t)){let e;try{e=await ep(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new A(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r)return e$(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:new A(t.init?.status||500,void 0,t.data),statusCode:j(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:j(t)?t.status:void 0};return e$(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 ey(e,t,r){if(B.test(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e),a=null!=C(n.pathname,r);if(n.origin===t.origin&&a)return n.pathname+n.search+n.hash}return e}function ev(e,t,r,n){let a=e.createURL(eL(t)).toString(),o={signal:r};if(n&&eO(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=eg(n.formData):o.body=n.formData}return new Request(a,o)}function eg(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function ew(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eb(e,t,r,n,a,o){let{loaderData:i,errors:l}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,u=!1,c={},d=r&&eD(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let h=r.route.id,f=t[h];if(s(!eM(f),"Cannot handle redirect results in processLoaderData"),eD(f)){let t=f.error;if(void 0!==d&&(t=d,d=void 0),l=l||{},a)l[h]=t;else{let r=ex(e,h);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[h]=V),u||(u=!0,o=j(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else i[h]=f.data,f.statusCode&&200!==f.statusCode&&!u&&(o=f.statusCode),f.headers&&(c[h]=f.headers)}),void 0!==d&&r&&(l={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:c}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let i=o[r];if(s(i,"Did not find corresponding fetcher result"),eD(i)){let t=ex(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:i.error}),e.fetchers.delete(r)}else if(eM(i))s(!1,"Unhandled fetcher revalidation redirect");else{let t=eN(i.data);e.fetchers.set(r,t)}}),{loaderData:i,errors:l}}function eE(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==V).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eR(e){return e?eD(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ex(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function eS(e){let t=1===e.length?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 eC(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new A(e||500,i,Error(l),!0)}function eP(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eM(n))return{key:r,result:n}}}function eL(e){return h({..."string"==typeof e?f(e):e,hash:""})}function ek(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function eD(e){return"error"===e.type}function eM(e){return"redirect"===(e&&e.type)}function e$(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eT(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function eO(e){return U.has(e.toUpperCase())}function eA(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function ej(e,t){let r="string"==typeof t?f(t).search:t.search;if(e[e.length-1].route.index&&eA(r||""))return e[e.length-1];let n=L(e);return n[n.length-1]}function ez(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eU(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eF(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 eN(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var e_=a.createContext(null);e_.displayName="DataRouter";var eH=a.createContext(null);eH.displayName="DataRouterState";var eI=a.createContext(!1),eW=a.createContext({isTransitioning:!1});eW.displayName="ViewTransition";var eB=a.createContext(new Map);eB.displayName="Fetchers",a.createContext(null).displayName="Await";var eY=a.createContext(null);eY.displayName="Navigation";var eq=a.createContext(null);eq.displayName="Location";var eV=a.createContext({outlet:null,matches:[],isDataRoute:!1});eV.displayName="Route";var eJ=a.createContext(null);function eK(){return null!=a.useContext(eq)}function eX(){return s(eK(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(eq).location}eJ.displayName="RouteError";var eG="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function eQ(e){a.useContext(eY).static||a.useLayoutEffect(e)}var eZ=a.createContext(null);function e0(e,{relative:t}={}){let{matches:r}=a.useContext(eV),{pathname:n}=eX(),o=JSON.stringify(k(r));return a.useMemo(()=>D(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}var e1=a.createElement(function(){let e=e9(),t=j(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=a.createElement(a.Fragment,null,a.createElement("p",null,"\uD83D\uDCBF Hey developer \uD83D\uDC4B"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:o},"ErrorBoundary")," or"," ",a.createElement("code",{style:o},"errorElement")," prop on your route.")),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:{padding:"0.5rem",backgroundColor:n}},r):null,i)},null),e4=class extends a.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return void 0!==this.state.error?a.createElement(eV.Provider,{value:this.props.routeContext},a.createElement(eJ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function e2({routeContext:e,match:t,children:r}){let n=a.useContext(e_);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(eV.Provider,{value:e},r)}function e3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e5(e){let t=a.useContext(eH);return s(t,e3(e)),t}function e7(e){let t,r=(s(t=a.useContext(eV),e3(e)),t),n=r.matches[r.matches.length-1];return s(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function e9(){let e=a.useContext(eJ),t=e5("useRouteError"),r=e7("useRouteError");return void 0!==e?e:t.errors?.[r]}var e8={};function e6(e,t,r){t||e8[e]||(e8[e]=!0,u(!1,r))}var te={};function tt(e,t){e||te[t]||(te[t]=!0,console.warn(t))}function tr(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&u(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:a.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&u(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&u(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tn=["HydrateFallback","hydrateFallbackElement"],ta=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function to({router:e,flushSync:t,unstable_onError:r}){let[n,o]=a.useState(e.state),[i,l]=a.useState(),[s,u]=a.useState({isTransitioning:!1}),[c,d]=a.useState(),[h,f]=a.useState(),[p,m]=a.useState(),y=a.useRef(new Map),v=a.useCallback(e=>{o(t=>(e.errors&&r&&Object.entries(e.errors).forEach(([e,n])=>{t.errors?.[e]!==n&&r(n)}),e))},[r]),g=a.useCallback((r,{deletedFetchers:n,flushSync:o,viewTransitionOpts:i})=>{r.fetchers.forEach((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}),n.forEach(e=>y.current.delete(e)),tt(!1===o||null!=t,'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 s=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(tt(null==i||s,"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."),!i||!s)return void(t&&o?t(()=>v(r)):a.startTransition(()=>v(r)));if(t&&o){t(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>v(r))});n.finished.finally(()=>{t(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})}),t(()=>f(n));return}h?(c&&c.resolve(),h.skipTransition(),m({state:r,currentLocation:i.currentLocation,nextLocation:i.nextLocation})):(l(r),u({isTransitioning:!0,flushSync:!1,currentLocation:i.currentLocation,nextLocation:i.nextLocation}))},[e.window,t,h,c,v]);a.useLayoutEffect(()=>e.subscribe(g),[e,g]),a.useEffect(()=>{s.isTransitioning&&!s.flushSync&&d(new ta)},[s]),a.useEffect(()=>{if(c&&i&&e.window){let t=c.promise,r=e.window.document.startViewTransition(async()=>{a.startTransition(()=>v(i)),await t});r.finished.finally(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}),f(r)}},[i,c,e.window,v]),a.useEffect(()=>{c&&i&&n.location.key===i.location.key&&c.resolve()},[c,h,n.location,i]),a.useEffect(()=>{!s.isTransitioning&&p&&(l(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),m(void 0))},[s.isTransitioning,p]);let w=a.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),b=e.basename||"/",E=a.useMemo(()=>({router:e,navigator:w,static:!1,basename:b,unstable_onError:r}),[e,w,b,r]);return a.createElement(a.Fragment,null,a.createElement(e_.Provider,{value:E},a.createElement(eH.Provider,{value:n},a.createElement(eB.Provider,{value:y.current},a.createElement(eW.Provider,{value:s},a.createElement(ts,{basename:b,location:n.location,navigationType:n.historyAction,navigator:w},a.createElement(ti,{routes:e.routes,future:e.future,state:n,unstable_onError:r})))))),null)}var ti=a.memo(function({routes:e,future:t,state:r,unstable_onError:n}){return function(e,t,r,n,o){let i;s(eK(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=a.useContext(eY),{matches:c}=a.useContext(eV),d=c[c.length-1],h=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",y=d&&d.route;{let e=y&&y.path||"";e6(p,!y||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (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.
4
-
5
- Please change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let v=eX();if(t){let e="string"==typeof t?f(t):t;s("/"===m||e.pathname?.startsWith(m),`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 "${m}" but pathname "${e.pathname}" was given in the \`location\` prop.`),i=e}else i=v;let g=i.pathname||"/",b=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let E=w(e,{pathname:b});u(y||null!=E,`No routes matched location "${i.pathname}${i.search}${i.hash}" `),u(null==E||void 0!==E[E.length-1].route.element||void 0!==E[E.length-1].route.Component||void 0!==E[E.length-1].route.lazy,`Matched leaf route at location "${i.pathname}${i.search}${i.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 R=function(e,t=[],r=null,n=null,o=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let i=e,l=r?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);s(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,c=-1;if(r)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:n}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,i=c>=0?i.slice(0,c+1):[i[0]];break}}}return i.reduceRight((e,o,s)=>{let d,h=!1,f=null,p=null;r&&(d=l&&o.route.id?l[o.route.id]:void 0,f=o.route.errorElement||e1,u&&(c<0&&0===s?(e6("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):c===s&&(h=!0,p=o.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,s+1)),y=()=>{let t;return t=d?f:h?p:o.route.Component?a.createElement(o.route.Component,null):o.route.element?o.route.element:e,a.createElement(e2,{match:o,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===s)?a.createElement(e4,{location:r.location,revalidation:r.revalidation,component:f,error:d,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0},unstable_onError:n}):y()},null)}(E&&E.map(e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:M([m,l.encodeLocation?l.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:M([m,l.encodeLocation?l.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),c,r,n,o);return t&&R?a.createElement(eq.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...i},navigationType:"POP"}},R):R}(e,void 0,r,n,t)});function tl(e){var t;let r;return t=e.context,r=a.useContext(eV).outlet,a.useMemo(()=>r&&a.createElement(eZ.Provider,{value:t},r),[r,t])}function ts({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1}){s(!eK(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=a.useMemo(()=>({basename:l,navigator:o,static:i,future:{}}),[l,o,i]);"string"==typeof r&&(r=f(r));let{pathname:d="/",search:h="",hash:p="",state:m=null,key:y="default"}=r,v=a.useMemo(()=>{let e=C(d,l);return null==e?null:{location:{pathname:e,search:h,hash:p,state:m,key:y},navigationType:n}},[l,d,h,p,m,y,n]);return(u(null!=v,`<Router basename="${l}"> is not able to match the URL "${d}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==v)?null:a.createElement(eY.Provider,{value:c},a.createElement(eq.Provider,{children:t,value:v}))}a.Component;var tu="get",tc="application/x-www-form-urlencoded";function td(e){return null!=e&&"string"==typeof e.tagName}var th=null,tf=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tp(e){return null==e||tf.has(e)?e:(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tc}"`),null)}function tm(e,t){if(!1===e||null==e)throw Error(t)}async function ty(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(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 tv(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function tg(e,t,r){var n;let a,o;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await ty(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(tv).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),n.reduce((e,t)=>{!1;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return a.has(r)||(a.add(r),e.push({key:r,link:t})),e},[])}function tw(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function tb(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]}function tE(){let e=a.useContext(e_);return tm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tR(){let e=a.useContext(eH);return tm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window&&window,Symbol("SingleFetchRedirect");var tx=a.createContext(void 0);function tS(){let e=a.useContext(tx);return tm(e,"You must render this element inside a <HydratedRouter> element"),e}function tC(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function tP({page:e,...t}){let{router:r}=tE(),n=a.useMemo(()=>w(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?a.createElement(tL,{page:e,matches:n,...t}):null}function tL({page:e,matches:t,...r}){let n=eX(),{manifest:o,routeModules:i}=tS(),{basename:l}=tE(),{loaderData:s,matches:u}=tR(),c=a.useMemo(()=>tw(e,t,u,o,n,"data"),[e,t,u,o,n]),d=a.useMemo(()=>tw(e,t,u,o,n,"assets"),[e,t,u,o,n]),h=a.useMemo(()=>{var r;let a;if(e===n.pathname+n.search+n.hash)return[];let u=new Set,d=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?d=!0:u.add(e.route.id))}),0===u.size)return[];let h=(r="data","/"===(a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e).pathname?a.pathname=`_root.${r}`:l&&"/"===C(a.pathname,l)?a.pathname=`${l.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a);return d&&u.size>0&&h.searchParams.set("_routes",t.filter(e=>u.has(e.route.id)).map(e=>e.route.id).join(",")),[h.pathname+h.search]},[l,s,n,o,c,t,e,i]),f=a.useMemo(()=>tb(d,o),[d,o]),p=function(e){let{manifest:t,routeModules:r}=tS(),[n,o]=a.useState([]);return a.useEffect(()=>{let n=!1;return tg(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),n}(d);return a.createElement(a.Fragment,null,h.map(e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),f.map(e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>a.createElement("link",{key:e,nonce:r.nonce,...t})))}tx.displayName="FrameworkContext";a.Component;var tk="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tk&&(window.__reactRouterVersion="7.9.4")}catch(e){}function tD(e,t){let r;return(function(e){let t,r,n,a,o,i=e.window?e.window:"undefined"!=typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement;s(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let c=e.hydrationRouteProperties||[],h=e.mapRouteProperties||Y,f={},y=g(e.routes,h,void 0,f),v=e.basename||"/";v.startsWith("/")||(v=`/${v}`);let R=e.dataStrategy||eo,x={...e.future},S=null,P=new Set,L=null,k=null,D=null,M=null!=e.hydrationData,$=w(y,e.history.location,v),T=!1,O=null;if(null!=$||e.patchRoutesOnNavigation)if($&&!e.hydrationData&&e6($,y,e.history.location.pathname).active&&($=null),$)if($.some(e=>e.route.lazy))r=!1;else if($.some(e=>G(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=$.findIndex(e=>void 0!==n[e.route.id]);r=$.slice(0,e+1).every(e=>!Q(e.route,t,n))}else r=$.every(e=>!Q(e.route,t,n))}else r=!0;else{r=!1,$=[];let t=e6(null,y,e.history.location.pathname);t.active&&t.matches&&(T=!0,$=t.matches)}else{let t=eC(404,{pathname:e.history.location.pathname}),{matches:n,route:a}=eS(y);r=!0,$=n,O={[a.id]:t}}let A={historyAction:e.history.action,location:e.history.location,matches:$,initialized:r,navigation:H,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},z="POP",U=!1,F=!1,V=new Map,Z=null,et=!1,er=!1,en=new Set,ea=new Map,ei=0,el=-1,es=new Map,eu=new Set,ec=new Map,ef=new Map,ep=new Set,eg=new Map,ew=null;function eL(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=f[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(A={...A,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(ep.has(t)?r.push(t):n.push(t))}),ep.forEach(e=>{A.fetchers.has(e)||ea.has(e)||r.push(e)}),[...P].forEach(e=>e(A,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>eQ(e)),n.forEach(e=>A.fetchers.delete(e))}function ek(r,n,{flushSync:a}={}){let o,i,l=null!=A.actionData&&null!=A.navigation.formMethod&&eO(A.navigation.formMethod)&&"loading"===A.navigation.state&&r.state?._isRedirect!==!0;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?A.actionData:null;let s=n.loaderData?eE(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,u=A.blockers;u.size>0&&(u=new Map(u)).forEach((e,t)=>u.set(t,W));let c=!et&&e8(r,n.matches||A.matches),d=!0===U||null!=A.navigation.formMethod&&eO(A.navigation.formMethod)&&r.state?._isRedirect!==!0;if(t&&(y=t,t=void 0),et||"POP"===z||("PUSH"===z?e.history.push(r,r.state):"REPLACE"===z&&e.history.replace(r,r.state)),"POP"===z){let e=V.get(A.location.pathname);e&&e.has(r.pathname)?i={currentLocation:A.location,nextLocation:r}:V.has(r.pathname)&&(i={currentLocation:r,nextLocation:A.location})}else if(F){let e=V.get(A.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),V.set(A.location.pathname,e)),i={currentLocation:A.location,nextLocation:r}}eL({...n,actionData:o,loaderData:s,historyAction:z,location:r,initialized:!0,navigation:H,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:u},{viewTransitionOpts:i,flushSync:!0===a}),z="POP",U=!1,F=!1,et=!1,er=!1,ew?.resolve(),ew=null}async function e$(t,r){if("number"==typeof t)return void e.history.go(t);let{path:n,submission:a,error:o}=K(!1,J(A.location,A.matches,v,t,r?.fromRouteId,r?.relative),r),i=A.location,l=d(A.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let s=r&&null!=r.replace?r.replace:void 0,u="PUSH";!0===s?u="REPLACE":!1===s||null!=a&&eO(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(u="REPLACE");let c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,h=!0===(r&&r.flushSync),f=e5({currentLocation:i,nextLocation:l,historyAction:u});f?e3(f,{state:"blocked",location:l,proceed(){e3(f,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),e$(t,r)},reset(){let e=new Map(A.blockers);e.set(f,W),eL({blockers:e})}}):await eA(u,l,{submission:a,pendingError:o,preventScrollReset:c,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:h})}async function eA(r,n,o){var i,l,s,u;let c;a&&a.abort(),a=null,z=r,et=!0===(o&&o.startUninterruptedRevalidation),i=A.location,l=A.matches,L&&D&&(L[e9(i,l)]=D()),U=!0===(o&&o.preventScrollReset),F=!0===(o&&o.enableViewTransition);let d=t||y,h=o&&o.overrideNavigation,f=o?.initialHydration&&A.matches&&A.matches.length>0&&!T?A.matches:w(d,n,v),p=!0===(o&&o.flushSync);if(f&&A.initialized&&!er&&(s=A.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash||!1))&&!(o&&o.submission&&eO(o.submission.formMethod)))return void ek(n,{matches:f},{flushSync:p});let g=e6(f,d,n.pathname);if(g.active&&g.matches&&(f=g.matches),!f){let{error:e,notFoundMatches:t,route:r}=e7(n.pathname);ek(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:p});return}a=new AbortController;let b=ev(e.history,n,a.signal,o&&o.submission),E=e.getContext?await e.getContext():new m;if(o&&o.pendingError)c=[ex(f).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&eO(o.submission.formMethod)){let t=await e_(b,n,o.submission,f,E,g.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:p});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(eD(r)&&j(r.error)&&404===r.error.status){a=null,ek(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}f=t.matches||f,c=t.pendingActionResult,h=eU(n,o.submission),p=!1,g.active=!1,b=ev(e.history,b.url,b.signal)}let{shortCircuited:R,matches:x,loaderData:S,errors:C}=await eH(b,n,f,E,g.active,h,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,p,c);R||(a=null,ek(n,{matches:x||f,...eR(c),loaderData:S,errors:C}))}async function e_(e,t,r,n,a,o,i,l={}){var s;let u;if(eJ(),eL({navigation:{state:"submitting",location:t,formMethod:(s=r).formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}},{flushSync:!0===l.flushSync}),o){let r=await te(n,t.pathname,e.signal);if("aborted"===r.type)return{shortCircuited:!0};if("error"===r.type){if(0===r.partialMatches.length){let{matches:e,route:t}=eS(y);return{matches:e,pendingActionResult:[t.id,{type:"error",error:r.error}]}}let e=ex(r.partialMatches).route.id;return{matches:r.partialMatches,pendingActionResult:[e,{type:"error",error:r.error}]}}if(r.matches)n=r.matches;else{let{notFoundMatches:e,error:r,route:n}=e7(t.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:r}]}}}let d=ej(n,t);if(d.route.action||d.route.lazy){let t=ed(h,f,e,n,d,i?[]:c,a),r=await eq(e,t,a,null);if(!(u=r[d.route.id])){for(let e of n)if(r[e.route.id]){u=r[e.route.id];break}}if(e.signal.aborted)return{shortCircuited:!0}}else u={type:"error",error:eC(405,{method:e.method,pathname:t.pathname,routeId:d.route.id})};if(eM(u)){let t;return t=l&&null!=l.replace?l.replace:ey(u.response.headers.get("Location"),new URL(e.url),v)===A.location.pathname+A.location.search,await eY(e,u,!0,{submission:r,replace:t}),{shortCircuited:!0}}if(eD(u)){let e=ex(n,d.route.id);return!0!==(l&&l.replace)&&(z="PUSH"),{matches:n,pendingActionResult:[e.route.id,u,d.route.id]}}return{matches:n,pendingActionResult:[d.route.id,u]}}async function eH(r,n,o,i,l,s,u,d,p,m,g,w){let b=s||eU(n,u),E=u||d||ez(b),R=!et&&!m;if(l){if(R){let e=eI(w);eL({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:g})}let e=await te(o,n.pathname,r.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=eS(y);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=ex(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)o=e.matches;else{let{error:e,notFoundMatches:t,route:r}=e7(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let x=t||y,{dsMatches:S,revalidatingFetchers:C}=X(r,i,h,f,e.history,A,o,E,n,m?[]:c,!0===m,er,en,ep,ec,eu,x,v,null!=e.patchRoutesOnNavigation,w);if(el=++ei,!e.dataStrategy&&!S.some(e=>e.shouldLoad)&&!S.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===C.length){let e=e1();return ek(n,{matches:o,loaderData:{},errors:w&&eD(w[1])?{[w[0]]:w[1].error}:null,...eR(w),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(R){let e={};if(!l){e.navigation=b;let t=eI(w);void 0!==t&&(e.actionData=t)}C.length>0&&(C.forEach(e=>{let t=A.fetchers.get(e.key),r=eF(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}),e.fetchers=new Map(A.fetchers)),eL(e,{flushSync:g})}C.forEach(e=>{eZ(e.key),e.controller&&ea.set(e.key,e.controller)});let P=()=>C.forEach(e=>eZ(e.key));a&&a.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:k}=await eV(S,C,r,i);if(r.signal.aborted)return{shortCircuited:!0};a&&a.signal.removeEventListener("abort",P),C.forEach(e=>ea.delete(e.key));let D=eP(L);if(D)return await eY(r,D.result,!0,{replace:p}),{shortCircuited:!0};if(D=eP(k))return eu.add(D.key),await eY(r,D.result,!0,{replace:p}),{shortCircuited:!0};let{loaderData:M,errors:$}=eb(A,o,L,w,C,k);m&&A.errors&&($={...A.errors,...$});let T=e1(),O=e4(el);return{matches:o,loaderData:M,errors:$,...T||O||C.length>0?{fetchers:new Map(A.fetchers)}:{}}}function eI(e){if(e&&!eD(e[1]))return{[e[0]]:e[1].data};if(A.actionData)if(0===Object.keys(A.actionData).length)return null;else return A.actionData}async function eW(r,n,o,i,l,u,d,p,m){var g,b;eJ(),ec.delete(r);let E=A.fetchers.get(r);eK(r,(g=m,b=E,{state:"submitting",formMethod:g.formMethod,formAction:g.formAction,formEncType:g.formEncType,formData:g.formData,json:g.json,text:g.text,data:b?b.data:void 0}),{flushSync:d});let R=new AbortController,x=ev(e.history,o,R.signal,m);if(u){let e=await te(i,new URL(x.url).pathname,x.signal,r);if("aborted"===e.type)return;if("error"===e.type)return void eX(r,n,e.error,{flushSync:d});if(!e.matches)return void eX(r,n,eC(404,{pathname:o}),{flushSync:d});i=e.matches}let S=ej(i,o);if(!S.route.action&&!S.route.lazy){let e=eC(405,{method:m.formMethod,pathname:o,routeId:n});eX(r,n,e,{flushSync:d});return}ea.set(r,R);let C=ei,P=ed(h,f,x,i,S,c,l),L=(await eq(x,P,l,r))[S.route.id];if(x.signal.aborted){ea.get(r)===R&&ea.delete(r);return}if(ep.has(r)){if(eM(L)||eD(L))return void eK(r,eN(void 0))}else{if(eM(L))return(ea.delete(r),el>C)?void eK(r,eN(void 0)):(eu.add(r),eK(r,eF(m)),eY(x,L,!1,{fetcherSubmission:m,preventScrollReset:p}));if(eD(L))return void eX(r,n,L.error)}let k=A.navigation.location||A.location,D=ev(e.history,k,R.signal),M=t||y,$="idle"!==A.navigation.state?w(M,A.navigation.location,v):A.matches;s($,"Didn't find any matches after fetcher action");let T=++ei;es.set(r,T);let O=eF(m,L.data);A.fetchers.set(r,O);let{dsMatches:j,revalidatingFetchers:U}=X(D,l,h,f,e.history,A,$,m,k,c,!1,er,en,ep,ec,eu,M,v,null!=e.patchRoutesOnNavigation,[S.route.id,L]);U.filter(e=>e.key!==r).forEach(e=>{let t=e.key,r=A.fetchers.get(t),n=eF(void 0,r?r.data:void 0);A.fetchers.set(t,n),eZ(t),e.controller&&ea.set(t,e.controller)}),eL({fetchers:new Map(A.fetchers)});let F=()=>U.forEach(e=>eZ(e.key));R.signal.addEventListener("abort",F);let{loaderResults:N,fetcherResults:_}=await eV(j,U,D,l);if(R.signal.aborted)return;if(R.signal.removeEventListener("abort",F),es.delete(r),ea.delete(r),U.forEach(e=>ea.delete(e.key)),A.fetchers.has(r)){let e=eN(L.data);A.fetchers.set(r,e)}let H=eP(N);if(H)return eY(D,H.result,!1,{preventScrollReset:p});if(H=eP(_))return eu.add(H.key),eY(D,H.result,!1,{preventScrollReset:p});let{loaderData:I,errors:W}=eb(A,$,N,void 0,U,_);e4(T),"loading"===A.navigation.state&&T>el?(s(z,"Expected pending action"),a&&a.abort(),ek(A.navigation.location,{matches:$,loaderData:I,errors:W,fetchers:new Map(A.fetchers)})):(eL({errors:W,loaderData:eE(A.loaderData,I,$,W),fetchers:new Map(A.fetchers)}),er=!1)}async function eB(t,r,n,a,o,i,l,s,u){let d=A.fetchers.get(t);eK(t,eF(u,d?d.data:void 0),{flushSync:l});let p=new AbortController,m=ev(e.history,n,p.signal);if(i){let e=await te(a,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void eX(t,r,e.error,{flushSync:l});if(!e.matches)return void eX(t,r,eC(404,{pathname:n}),{flushSync:l});a=e.matches}let y=ej(a,n);ea.set(t,p);let v=ei,g=ed(h,f,m,a,y,c,o),w=(await eq(m,g,o,t))[y.route.id];if(ea.get(t)===p&&ea.delete(t),!m.signal.aborted){if(ep.has(t))return void eK(t,eN(void 0));if(eM(w))if(el>v)return void eK(t,eN(void 0));else{eu.add(t),await eY(m,w,!1,{preventScrollReset:s});return}if(eD(w))return void eX(t,r,w.error);eK(t,eN(w.data))}}async function eY(e,t,r,{submission:n,fetcherSubmission:o,preventScrollReset:u,replace:c}={}){t.response.headers.has("X-Remix-Revalidate")&&(er=!0);let h=t.response.headers.get("Location");s(h,"Expected a Location header on the redirect Response"),h=ey(h,new URL(e.url),v);let f=d(A.location,h,{_isRedirect:!0});if(l){let e=!1;if(t.response.headers.has("X-Remix-Reload-Document"))e=!0;else{let t;if(t=h,B.test(t)){let t=p(h,!0);e=t.origin!==i.location.origin||null==C(t.pathname,v)}}if(e)return void(c?i.location.replace(h):i.location.assign(h))}a=null;let m=!0===c||t.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:y,formAction:g,formEncType:w}=A.navigation;!n&&!o&&y&&g&&w&&(n=ez(A.navigation));let b=n||o;if(_.has(t.response.status)&&b&&eO(b.formMethod))await eA(m,f,{submission:{...b,formAction:h},preventScrollReset:u||U,enableViewTransition:r?F:void 0});else{let e=eU(f,n);await eA(m,f,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:u||U,enableViewTransition:r?F:void 0})}}async function eq(e,t,r,n){let a,o={};try{a=await eh(R,e,t,n,r,!1)}catch(e){return t.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:"error",error:e}}),o}if(e.signal.aborted)return o;for(let[r,n]of Object.entries(a)){var i;if(eT((i=n).result)&&N.has(i.result.status)){let a=n.result;o[r]={type:"redirect",response:function(e,t,r,n,a){let o,i=e.headers.get("Location");if(s(i,"Redirects returned/thrown from loaders/actions must have a Location header"),o=i,!B.test(o)){let o=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=J(new URL(t.url),o,a,i),e.headers.set("Location",i)}return e}(a,e,r,t,v)}}else o[r]=await em(n)}return o}async function eV(e,t,r,n){let a=eq(r,e,n,null),o=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:eC(404,{pathname:e.path})}});{let t=(await eq(e.request,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function eJ(){er=!0,ec.forEach((e,t)=>{ea.has(t)&&en.add(t),eZ(t)})}function eK(e,t,r={}){A.fetchers.set(e,t),eL({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eX(e,t,r,n={}){let a=ex(A.matches,t);eQ(e),eL({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eG(e){return ef.set(e,(ef.get(e)||0)+1),ep.has(e)&&ep.delete(e),A.fetchers.get(e)||I}function eQ(e){let t=A.fetchers.get(e);ea.has(e)&&!(t&&"loading"===t.state&&es.has(e))&&eZ(e),ec.delete(e),es.delete(e),eu.delete(e),ep.delete(e),en.delete(e),A.fetchers.delete(e)}function eZ(e,t){let r=ea.get(e);r&&(r.abort(t),ea.delete(e))}function e0(e){for(let t of e){let e=eN(eG(t).data);A.fetchers.set(t,e)}}function e1(){let e=[],t=!1;for(let r of eu){let n=A.fetchers.get(r);s(n,`Expected fetcher: ${r}`),"loading"===n.state&&(eu.delete(r),e.push(r),t=!0)}return e0(e),t}function e4(e){let t=[];for(let[r,n]of es)if(n<e){let e=A.fetchers.get(r);s(e,`Expected fetcher: ${r}`),"loading"===e.state&&(eZ(r),es.delete(r),t.push(r))}return e0(t),t.length>0}function e2(e){A.blockers.delete(e),eg.delete(e)}function e3(e,t){let r=A.blockers.get(e)||W;s("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(A.blockers);n.set(e,t),eL({blockers:n})}function e5({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eg.size)return;eg.size>1&&u(!1,"A router only supports one blocker at a time");let n=Array.from(eg.entries()),[a,o]=n[n.length-1],i=A.blockers.get(a);if((!i||"proceeding"!==i.state)&&o({currentLocation:e,nextLocation:t,historyAction:r}))return a}function e7(e){let r=eC(404,{pathname:e}),{matches:n,route:a}=eS(t||y);return{notFoundMatches:n,route:a,error:r}}function e9(e,t){return k&&k(e,t.map(e=>E(e,A.loaderData)))||e.key}function e8(e,t){if(L){let r=L[e9(e,t)];if("number"==typeof r)return r}return null}function e6(t,r,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:b(r,n,v,!0)||[]};else if(Object.keys(t[0].params).length>0)return{active:!0,matches:b(r,n,v,!0)}}return{active:!1,matches:null}}async function te(r,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:r};let i=r;for(;;){let r=null==t,l=t||y,s=f;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||ee(e,t,l,s,h,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{r&&!a.aborted&&(y=[...y])}if(a.aborted)return{type:"aborted"};let u=w(l,n,v);if(u)return{type:"success",matches:u};let c=b(l,n,v,!0);if(!c||i.length===c.length&&i.every((e,t)=>e.route.id===c[t].route.id))return{type:"success",matches:null};i=c}}return n={get basename(){return v},get future(){return x},get state(){return A},get routes(){return y},get window(){return i},initialize:function(){if(S=e.history.listen(({action:t,location:r,delta:n})=>{if(o){o(),o=void 0;return}u(0===eg.size||null!=n,"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 a=e5({currentLocation:A.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{o=e});e.history.go(-1*n),e3(a,{state:"blocked",location:r,proceed(){e3(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(A.blockers);e.set(a,W),eL({blockers:e})}});return}return eA(t,r)}),l){var t=i,r=V;try{let e=t.sessionStorage.getItem(q);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch(e){}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(q,JSON.stringify(r))}catch(e){u(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(i,V);i.addEventListener("pagehide",e),Z=()=>i.removeEventListener("pagehide",e)}return A.initialized||eA("POP",A.location,{initialHydration:!0}),n},subscribe:function(e){return P.add(e),()=>P.delete(e)},enableScrollRestoration:function(e,t,r){if(L=e,D=t,k=r||null,!M&&A.navigation===H){M=!0;let e=e8(A.location,A.matches);null!=e&&eL({restoreScrollPosition:e})}return()=>{L=null,D=null,k=null}},navigate:e$,fetch:async function r(r,n,a,o){eZ(r);let i=!0===(o&&o.flushSync),l=t||y,s=J(A.location,A.matches,v,a,n,o?.relative),u=w(l,s,v),c=e6(u,l,s);if(c.active&&c.matches&&(u=c.matches),!u)return void eX(r,n,eC(404,{pathname:s}),{flushSync:i});let{path:d,submission:h,error:f}=K(!0,s,o);if(f)return void eX(r,n,f,{flushSync:i});let p=e.getContext?await e.getContext():new m,g=!0===(o&&o.preventScrollReset);h&&eO(h.formMethod)?await eW(r,n,d,u,p,c.active,i,g,h):(ec.set(r,{routeId:n,path:d}),await eB(r,n,d,u,p,c.active,i,g,h))},revalidate:function(){let e,t,r;ew||(ew={promise:r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{a(e);try{await r}catch(e){}}}),resolve:e,reject:t}),eJ(),eL({revalidation:"loading"});let n=ew.promise;return"submitting"===A.navigation.state||("idle"===A.navigation.state?eA(A.historyAction,A.location,{startUninterruptedRevalidation:!0}):eA(z||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:!0===F})),n},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eG,resetFetcher:function(e,t){eZ(e,t?.reason),eK(e,eN(null))},deleteFetcher:function(e){let t=(ef.get(e)||0)-1;t<=0?(ef.delete(e),ep.add(e)):ef.set(e,t),eL({fetchers:new Map(A.fetchers)})},dispose:function(){S&&S(),Z&&Z(),P.clear(),a&&a.abort(),A.fetchers.forEach((e,t)=>eQ(t)),A.blockers.forEach((e,t)=>e2(t))},getBlocker:function(e,t){let r=A.blockers.get(e)||W;return eg.get(e)!==t&&eg.set(e,t),r},deleteBlocker:e2,patchRoutes:function(e,r,n=!1){let a=null==t;ee(e,r,t||y,f,h,n),a&&(y=[...y],eL({}))},_internalFetchControllers:ea,_internalSetRoutes:function(e){t=g(e,h,void 0,f={})},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eL(e)}}})({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:function(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",u=null,h=f();function f(){return(i.state||{idx:null}).idx}function m(){s="POP";let e=f(),t=null==e?null:e-h;h=e,u&&u({action:s,location:y.location,delta:t})}null==h&&(h=0,i.replaceState({...i.state,idx:h},""));let y={get action(){return s},get location(){return e(a,i)},listen(e){if(u)throw Error("A history only accepts one active listener");return a.addEventListener(l,m),u=e,()=>{a.removeEventListener(l,m),u=null}},createHref:e=>t(a,e),createURL:function(e){return p(e)},encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=d(y.location,e,t);let n=c(r,h=f()+1),l=y.createHref(r);try{i.pushState(n,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(l)}o&&u&&u({action:s,location:y.location,delta:1})},replace:function(e,t){s="REPLACE";let r=d(y.location,e,t);let n=c(r,h=f()),a=y.createHref(r);i.replaceState(n,"",a),o&&u&&u({action:s,location:y.location,delta:0})},go:e=>i.go(e)};return y}(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return d("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:h(t)},null,e)}({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new A(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:tr,hydrationRouteProperties:tn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}var tM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t$=a.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:o,replace:i,state:l,target:c,to:d,preventScrollReset:f,viewTransition:p,...m},y){let v,{basename:g}=a.useContext(eY),w="string"==typeof d&&tM.test(d),b=!1;if("string"==typeof d&&w&&(v=d,tk))try{let e=new URL(window.location.href),t=new URL(d.startsWith("//")?e.protocol+d:d),r=C(t.pathname,g);t.origin===e.origin&&null!=r?d=r+t.search+t.hash:b=!0}catch(e){u(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=function(e,{relative:t}={}){s(eK(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=a.useContext(eY),{hash:o,pathname:i,search:l}=e0(e,{relative:t}),u=i;return"/"!==r&&(u="/"===i?r:M([r,i])),n.createHref({pathname:u,search:l,hash:o})}(d,{relative:n}),[R,x,S]=function(e,t){let r=a.useContext(tx),[n,o]=a.useState(!1),[i,l]=a.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,f=a.useRef(null);a.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),a.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{o(!0)},m=()=>{o(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:tC(s,p),onBlur:tC(u,m),onMouseEnter:tC(c,p),onMouseLeave:tC(d,m),onTouchStart:tC(h,p)}]:[!1,f,{}]}(r,m),P=function(e,{target:t,replace:r,state:n,preventScrollReset:o,relative:i,viewTransition:l}={}){let c=function(){let{isDataRoute:e}=a.useContext(eV);return e?function(){let e,{router:t}=(s(e=a.useContext(e_),e3("useNavigate")),e),r=e7("useNavigate"),n=a.useRef(!1);return eQ(()=>{n.current=!0}),a.useCallback(async(e,a={})=>{u(n.current,eG),n.current&&("number"==typeof e?t.navigate(e):await t.navigate(e,{fromRouteId:r,...a}))},[t,r])}():function(){s(eK(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(e_),{basename:t,navigator:r}=a.useContext(eY),{matches:n}=a.useContext(eV),{pathname:o}=eX(),i=JSON.stringify(k(n)),l=a.useRef(!1);return eQ(()=>{l.current=!0}),a.useCallback((n,a={})=>{if(u(l.current,eG),!l.current)return;if("number"==typeof n)return void r.go(n);let s=D(n,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:M([t,s.pathname])),(a.replace?r.replace:r.push)(s,a.state,a)},[t,r,i,o,e])}()}(),d=eX(),f=e0(e,{relative:i});return a.useCallback(a=>{0!==a.button||t&&"_self"!==t||a.metaKey||a.altKey||a.ctrlKey||a.shiftKey||(a.preventDefault(),c(e,{replace:void 0!==r?r:h(d)===h(f),state:n,preventScrollReset:o,relative:i,viewTransition:l}))},[d,c,f,r,n,t,e,o,i,l])}(d,{replace:i,state:l,target:c,preventScrollReset:f,relative:n,viewTransition:p}),L=a.createElement("a",{...m,...S,href:v||E,onClick:b||o?e:function(t){e&&e(t),t.defaultPrevented||P(t)},ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(y,x),target:c,"data-discover":w||"render"!==t?void 0:"true"});return R&&!w?a.createElement(a.Fragment,null,L,a.createElement(tP,{page:E})):L});t$.displayName="Link";var tT=a.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:o,to:i,viewTransition:l,children:u,...c},d){let h,f=e0(i,{relative:c.relative}),p=eX(),m=a.useContext(eH),{navigator:y,basename:v}=a.useContext(eY),g=null!=m&&function(e,{relative:t}={}){let r=a.useContext(eW);s(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=tO("useViewTransitionState"),o=e0(e,{relative:t});if(!r.isTransitioning)return!1;let i=C(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=C(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=S(o.pathname,l)||null!=S(o.pathname,i)}(f)&&!0===l,w=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=C(E,v)||E);let R="/"!==w&&w.endsWith("/")?w.length-1:w.length,x=b===w||!n&&b.startsWith(w)&&"/"===b.charAt(R),P=null!=E&&(E===w||!n&&E.startsWith(w)&&"/"===E.charAt(w.length)),L={isActive:x,isPending:P,isTransitioning:g},k=x?e:void 0;h="function"==typeof r?r(L):[r,x?"active":null,P?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof o?o(L):o;return a.createElement(t$,{...c,"aria-current":k,className:h,ref:d,style:D,to:i,viewTransition:l},"function"==typeof u?u(L):u)});tT.displayName="NavLink",a.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:l=tu,action:u,onSubmit:c,relative:d,preventScrollReset:f,viewTransition:p,...m},y)=>{let v=function(){let{router:e}=tO("useSubmit"),{basename:t}=a.useContext(eY),r=e7("useRouteId");return a.useCallback(async(n,a={})=>{let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(td(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?C(i,t):null,r=e.getAttribute("method")||tu,a=tp(e.getAttribute("enctype"))||tc,o=new FormData(e)}else if(td(e)&&"button"===e.tagName.toLowerCase()||td(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?C(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||tu,a=tp(e.getAttribute("formenctype"))||tp(i.getAttribute("enctype"))||tc,o=new FormData(i,e),!function(){if(null===th)try{new FormData(document.createElement("form"),0),th=!1}catch(e){th=!0}return th}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,n)}}else if(td(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r=tu,n=null,a=tc,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||`__${String(++tA)}__`;await e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}(),g=function(e,{relative:t}={}){let{basename:r}=a.useContext(eY),n=a.useContext(eV);s(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={...e0(e||".",{relative:t})},l=eX();if(null==e){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();i.search=r?`?${r}`:""}}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(i.pathname="/"===i.pathname?r:M([r,i.pathname])),h(i)}(u,{relative:d}),w="get"===l.toLowerCase()?"get":"post",b="string"==typeof u&&tM.test(u);return a.createElement("form",{ref:y,method:w,action:g,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,a=n?.getAttribute("formmethod")||l;v(n||e.currentTarget,{fetcherKey:t,method:a,navigate:r,replace:o,state:i,relative:d,preventScrollReset:f,viewTransition:p})},...m,"data-discover":b||"render"!==e?void 0:"true"})}).displayName="Form";function tO(e){var t;let r=a.useContext(e_);return s(r,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),r}var tA=0}}]);
6
- //# sourceMappingURL=lib-router.3451e29e.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * react-router v7.9.4
3
- *
4
- * Copyright (c) Remix Software Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */