@techdocs/cli 1.8.20-next.0 → 1.8.20-next.2
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/CHANGELOG.md +22 -0
- package/dist/{cjs/generate-CHbYjdPP.cjs.js → commands/generate/generate.cjs.js} +4 -5
- package/dist/commands/generate/generate.cjs.js.map +1 -0
- package/dist/commands/index.cjs.js +231 -0
- package/dist/commands/index.cjs.js.map +1 -0
- package/dist/{cjs/migrate-Ddd_MQkE.cjs.js → commands/migrate/migrate.cjs.js} +5 -7
- package/dist/commands/migrate/migrate.cjs.js.map +1 -0
- package/dist/{cjs/publish-DH7Mbt7b.cjs.js → commands/publish/publish.cjs.js} +5 -7
- package/dist/commands/publish/publish.cjs.js.map +1 -0
- package/dist/{cjs/mkdocs-HM8xNBvh.cjs.js → commands/serve/mkdocs.cjs.js} +9 -10
- package/dist/commands/serve/mkdocs.cjs.js.map +1 -0
- package/dist/{cjs/serve-QoNUyZPw.cjs.js → commands/serve/serve.cjs.js} +12 -94
- package/dist/commands/serve/serve.cjs.js.map +1 -0
- package/dist/commands/serve/utils.cjs.js +24 -0
- package/dist/commands/serve/utils.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +541 -141
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/{2177.9af93c36.chunk.js → 2177.e1184707.chunk.js} +2 -2
- package/dist/embedded-app/static/{2177.9af93c36.chunk.js.map → 2177.e1184707.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{4036.a109c6eb.chunk.js → 4036.c70fd6f0.chunk.js} +2 -2
- package/dist/embedded-app/static/{4036.a109c6eb.chunk.js.map → 4036.c70fd6f0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9605.7441e12c.chunk.js → 9605.6d4a0d4f.chunk.js} +3 -3
- package/dist/embedded-app/static/{9605.7441e12c.chunk.js.map → 9605.6d4a0d4f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.4da17177.js +553 -0
- package/dist/embedded-app/static/main.4da17177.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.116dde6e.js → module-material-ui.05c1a36a.js} +4 -4
- package/dist/embedded-app/static/{module-material-ui.116dde6e.js.map → module-material-ui.05c1a36a.js.map} +1 -1
- package/dist/embedded-app/static/module-remix-run.e486ee73.js +14 -0
- package/dist/embedded-app/static/module-remix-run.e486ee73.js.map +1 -0
- package/dist/embedded-app/static/{runtime.500b1c12.js → runtime.4da17177.js} +2 -2
- package/dist/embedded-app/static/{runtime.500b1c12.js.map → runtime.4da17177.js.map} +1 -1
- package/dist/embedded-app/static/vendor.4da17177.js +169 -0
- package/dist/embedded-app/static/vendor.4da17177.js.map +1 -0
- package/dist/index.cjs.js +4 -230
- package/dist/index.cjs.js.map +1 -1
- package/dist/{cjs/PublisherConfig-Cn5i8vF5.cjs.js → lib/PublisherConfig.cjs.js} +1 -1
- package/dist/lib/PublisherConfig.cjs.js.map +1 -0
- package/dist/lib/httpServer.cjs.js +93 -0
- package/dist/lib/httpServer.cjs.js.map +1 -0
- package/dist/lib/mkdocsServer.cjs.js +58 -0
- package/dist/lib/mkdocsServer.cjs.js.map +1 -0
- package/dist/lib/run.cjs.js +58 -0
- package/dist/lib/run.cjs.js.map +1 -0
- package/dist/{cjs/utility-CsspJYjU.cjs.js → lib/utility.cjs.js} +1 -1
- package/dist/lib/utility.cjs.js.map +1 -0
- package/dist/package.json.cjs.js +6 -0
- package/dist/package.json.cjs.js.map +1 -0
- package/package.json +7 -7
- package/dist/cjs/PublisherConfig-Cn5i8vF5.cjs.js.map +0 -1
- package/dist/cjs/generate-CHbYjdPP.cjs.js.map +0 -1
- package/dist/cjs/migrate-Ddd_MQkE.cjs.js.map +0 -1
- package/dist/cjs/mkdocs-HM8xNBvh.cjs.js.map +0 -1
- package/dist/cjs/publish-DH7Mbt7b.cjs.js.map +0 -1
- package/dist/cjs/serve-QoNUyZPw.cjs.js.map +0 -1
- package/dist/cjs/utility-CsspJYjU.cjs.js.map +0 -1
- package/dist/cjs/utils-FcpnJ4zG.cjs.js +0 -129
- package/dist/cjs/utils-FcpnJ4zG.cjs.js.map +0 -1
- package/dist/embedded-app/static/main.500b1c12.js +0 -533
- package/dist/embedded-app/static/main.500b1c12.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.bf7ca63f.js +0 -23
- package/dist/embedded-app/static/module-react-router-dom.bf7ca63f.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.fae32787.js +0 -23
- package/dist/embedded-app/static/module-react-router.fae32787.js.map +0 -1
- package/dist/embedded-app/static/vendor.500b1c12.js +0 -151
- package/dist/embedded-app/static/vendor.500b1c12.js.map +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9669],{73970:(Aa,kr,Ce)=>{Ce.d(kr,{Kd:()=>ia,N_:()=>sa});var oe=Ce(14041),zt=Ce.t(oe,2),Wr=Ce(43144),Kr=Ce.t(Wr,2),Oe=Ce(18690),Bt=Ce(74808);/**
|
|
2
|
-
* @remix-run/router v1.19.2
|
|
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
|
-
*/function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}var J;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(J||(J={}));const kt="popstate";function Na(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((m,w)=>p(m,typeof m=="string"?null:m.state,w===0?"default":void 0));let o=u(r??a.length-1),i=J.Pop,c=null;function u(m){return Math.min(Math.max(m,0),a.length-1)}function d(){return a[o]}function p(m,w,R){w===void 0&&(w=null);let E=de(a?d().pathname:"/",m,w,R);return ce(E.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(m)),E}function y(m){return typeof m=="string"?m:fe(m)}return{get index(){return o},get action(){return i},get location(){return d()},createHref:y,createURL(m){return new URL(y(m),"http://localhost")},encodeLocation(m){let w=typeof m=="string"?ue(m):m;return{pathname:w.pathname||"",search:w.search||"",hash:w.hash||""}},push(m,w){i=J.Push;let R=p(m,w);o+=1,a.splice(o,a.length,R),n&&c&&c({action:i,location:R,delta:1})},replace(m,w){i=J.Replace;let R=p(m,w);a[o]=R,n&&c&&c({action:i,location:R,delta:0})},go(m){i=J.Pop;let w=u(o+m),R=a[w];o=w,c&&c({action:i,location:R,delta:m})},listen(m){return c=m,()=>{c=null}}}}function Vr(e){e===void 0&&(e={});function t(n,a){let{pathname:o,search:i,hash:c}=n.location;return de("",{pathname:o,search:i,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:fe(a)}return Kt(t,r,null,e)}function Ia(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:c="",hash:u=""}=ue(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),de("",{pathname:i,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(a,o){let i=a.document.querySelector("base"),c="";if(i&&i.getAttribute("href")){let u=a.location.href,d=u.indexOf("#");c=d===-1?u:u.slice(0,d)}return c+"#"+(typeof o=="string"?o:fe(o))}function n(a,o){ce(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Kt(t,r,n,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ce(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $r(){return Math.random().toString(36).substr(2,8)}function Wt(e,t){return{usr:e.state,key:e.key,idx:t}}function de(e,t,r,n){return r===void 0&&(r=null),z({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ue(t):t,{state:r,key:t&&t.key||n||$r()})}function fe(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ue(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Kt(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,c=J.Pop,u=null,d=p();d==null&&(d=0,i.replaceState(z({},i.state,{idx:d}),""));function p(){return(i.state||{idx:null}).idx}function y(){c=J.Pop;let E=p(),F=E==null?null:E-d;d=E,u&&u({action:c,location:R.location,delta:F})}function b(E,F){c=J.Push;let D=de(R.location,E,F);r&&r(D,E),d=p()+1;let L=Wt(D,d),g=R.createHref(D);try{i.pushState(L,"",g)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(g)}o&&u&&u({action:c,location:R.location,delta:1})}function m(E,F){c=J.Replace;let D=de(R.location,E,F);r&&r(D,E),d=p();let L=Wt(D,d),g=R.createHref(D);i.replaceState(L,"",g),o&&u&&u({action:c,location:R.location,delta:0})}function w(E){let F=a.location.origin!=="null"?a.location.origin:a.location.href,D=typeof E=="string"?E:fe(E);return D=D.replace(/ $/,"%20"),W(F,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,F)}let R={get action(){return c},get location(){return e(a,i)},listen(E){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(kt,y),u=E,()=>{a.removeEventListener(kt,y),u=null}},createHref(E){return t(a,E)},createURL:w,encodeLocation(E){let F=w(E);return{pathname:F.pathname,search:F.search,hash:F.hash}},push:b,replace:m,go(E){return i.go(E)}};return R}var B;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(B||(B={}));const Yr=new Set(["lazy","caseSensitive","path","id","index","children"]);function Jr(e){return e.index===!0}function je(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,o)=>{let i=[...r,String(o)],c=typeof a.id=="string"?a.id:i.join("-");if(W(a.index!==!0||!a.children,"Cannot specify children on an index route"),W(!n[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),Jr(a)){let u=z({},a,t(a),{id:c});return n[c]=u,u}else{let u=z({},a,t(a),{id:c,children:void 0});return n[c]=u,a.children&&(u.children=je(a.children,t,i,n)),u}})}function Re(e,t,r){return r===void 0&&(r="/"),rt(e,t,r,!1)}function rt(e,t,r,n){let a=typeof t=="string"?ue(t):t,o=Ve(a.pathname||"/",r);if(o==null)return null;let i=Vt(e);Xr(i);let c=null;for(let u=0;c==null&&u<i.length;++u){let d=sn(o);c=on(i[u],d,n)}return c}function Gr(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Vt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,c)=>{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(W(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let d=$e([n,u.relativePath]),p=r.concat(u);o.children&&o.children.length>0&&(W(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Vt(o.children,t,p,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:nn(d,o.index),routesMeta:p})};return e.forEach((o,i)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,i);else for(let u of $t(o.path))a(o,i,u)}),t}function $t(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=$t(n.join("/")),c=[];return c.push(...i.map(u=>u===""?o:[o,u].join("/"))),a&&c.push(...i),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function Xr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:an(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Qr=/^:[\w-]+$/,Zr=3,qr=2,en=1,tn=10,rn=null,Yt=e=>e==="*";function nn(e,t){let r=e.split("/"),n=r.length;return r.some(Yt)&&(n+=rn),t&&(n+=qr),r.filter(a=>!Yt(a)).reduce((a,o)=>a+(Qr.test(o)?Zr:o===""?en:tn),n)}function an(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function on(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let c=0;c<n.length;++c){let u=n[c],d=c===n.length-1,p=o==="/"?t:t.slice(o.length)||"/",y=Jt({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),b=u.route;if(!y&&d&&r&&!n[n.length-1].route.index&&(y=Jt({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!y)return null;Object.assign(a,y.params),i.push({params:a,pathname:$e([o,y.pathname]),pathnameBase:hn($e([o,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(o=$e([o,y.pathnameBase]))}return i}function Oa(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(ce(!1,'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".')),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=i=>i==null?"":typeof i=="string"?i:String(i),o=r.split(/\/+/).map((i,c,u)=>{if(c===u.length-1&&i==="*")return a(t["*"]);const p=i.match(/^:([\w-]+)(\??)$/);if(p){const[,y,b]=p;let m=t[y];return W(b==="?"||m!=null,'Missing ":'+y+'" param'),a(m)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+o.join("/")}function Jt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ln(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:n.reduce((d,p,y)=>{let{paramName:b,isOptional:m}=p;if(b==="*"){let R=c[y]||"";i=o.slice(0,o.length-R.length).replace(/(.)\/+$/,"$1")}const w=c[y];return m&&!w?d[b]=void 0:d[b]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:i,pattern:e}}function ln(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ce(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,(i,c,u)=>(n.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function sn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ce(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ve(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 un(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ue(e):e;return{pathname:r?r.startsWith("/")?r:cn(r,t):t,search:mn(n),hash:pn(a)}}function cn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function St(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 Gt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function dn(e,t){let r=Gt(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function fn(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ue(e):(a=z({},e),W(!a.pathname||!a.pathname.includes("?"),St("?","pathname","search",a)),W(!a.pathname||!a.pathname.includes("#"),St("#","pathname","hash",a)),W(!a.search||!a.search.includes("#"),St("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,c;if(i==null)c=r;else{let y=t.length-1;if(!n&&i.startsWith("..")){let b=i.split("/");for(;b[0]==="..";)b.shift(),y-=1;a.pathname=b.join("/")}c=y>=0?t[y]:"/"}let u=un(a,c),d=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}function ja(e){return e===""||e.pathname===""?"/":typeof e=="string"?ue(e).pathname:e.pathname}const $e=e=>e.join("/").replace(/\/\/+/g,"/"),hn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ha=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),z({},n,{headers:a}))};class yn{constructor(t,r){this.type="DataWithResponseInit",this.data=t,this.init=r||null}}function za(e,t){return new yn(e,typeof t=="number"?{status:t}:t)}class Xt extends null{}class vn{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],W(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((o,i)=>n=i),this.controller=new AbortController;let a=()=>n(new Xt("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((o,i)=>{let[c,u]=i;return Object.assign(o,{[c]:this.trackPromise(c,u)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,void 0,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){if(this.controller.signal.aborted&&n instanceof Xt)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let o=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>o}),this.emit(!1,r),Promise.reject(o)}return a===void 0?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(o=>{t.removeEventListener("abort",n),(o||this.done)&&a(o)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return W(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,r)=>{let[n,a]=r;return Object.assign(t,{[n]:wn(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function gn(e){return e instanceof Promise&&e._tracked===!0}function wn(e){if(!gn(e))return e;if(e._error)throw e._error;return e._data}const Ba=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new vn(t,n)},Qt=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status>"u"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,z({},n,{headers:a}))},ka=(e,t)=>{let r=Qt(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},Wa=(e,t)=>{let r=Qt(e,t);return r.headers.set("X-Remix-Replace","true"),r};class Et{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Ye(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zt=["post","put","patch","delete"],Rn=new Set(Zt),bn=["get",...Zt],Sn=new Set(bn),En=new Set([301,302,303,307,308]),Pn=new Set([307,308]),Pt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Je={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Dt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),er="remix-router-transitions";function Ka(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let l=e.detectErrorBoundary;a=s=>({hasErrorBoundary:l(s)})}else a=qt;let o={},i=je(e.routes,a,void 0,o),c,u=e.basename||"/",d=e.unstable_dataStrategy||sr,p=e.unstable_patchRoutesOnNavigation,y=z({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,m=new Set,w=1e3,R=new Set,E=null,F=null,D=null,L=e.hydrationData!=null,g=Re(i,e.history.location,u),j=null;if(g==null&&!p){let l=Y(404,{pathname:e.history.location.pathname}),{matches:s,route:h}=nt(i);g=s,j={[h.id]:l}}g&&!e.hydrationData&&yt(g,i,e.history.location.pathname).active&&(g=null);let H;if(g)if(g.some(l=>l.route.lazy))H=!1;else if(!g.some(l=>l.route.loader))H=!0;else if(y.v7_partialHydration){let l=e.hydrationData?e.hydrationData.loaderData:null,s=e.hydrationData?e.hydrationData.errors:null,h=v=>v.route.loader?typeof v.route.loader=="function"&&v.route.loader.hydrate===!0?!1:l&&l[v.route.id]!==void 0||s&&s[v.route.id]!==void 0:!0;if(s){let v=g.findIndex(P=>s[P.route.id]!==void 0);H=g.slice(0,v+1).every(h)}else H=g.every(h)}else H=e.hydrationData!=null;else if(H=!1,g=[],y.v7_partialHydration){let l=yt(null,i,e.history.location.pathname);l.active&&l.matches&&(g=l.matches)}let A,f={historyAction:e.history.action,location:e.history.location,matches:g,initialized:H,navigation:Pt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},U=J.Pop,O=!1,N,G=!1,ae=new Map,ee=null,De=!1,Me=!1,ut=[],ct=new Set,Z=new Map,dt=0,Ze=-1,Be=new Map,me=new Set,ke=new Map,qe=new Map,pe=new Set,Ue=new Map,Ae=new Map,ya=new Map,ft;function va(){if(b=e.history.listen(l=>{let{action:s,location:h,delta:v}=l;if(ft){ft(),ft=void 0;return}ce(Ae.size===0||v!=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 P=Or({currentLocation:f.location,nextLocation:h,historyAction:s});if(P&&v!=null){let C=new Promise(M=>{ft=M});e.history.go(v*-1),mt(P,{state:"blocked",location:h,proceed(){mt(P,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),C.then(()=>e.history.go(v))},reset(){let M=new Map(f.blockers);M.set(P,Je),ne({blockers:M})}});return}return Ne(s,h)}),r){Bn(t,ae);let l=()=>kn(t,ae);t.addEventListener("pagehide",l),ee=()=>t.removeEventListener("pagehide",l)}return f.initialized||Ne(J.Pop,f.location,{initialHydration:!0}),A}function ga(){b&&b(),ee&&ee(),m.clear(),N&&N.abort(),f.fetchers.forEach((l,s)=>ht(s)),f.blockers.forEach((l,s)=>Ir(s))}function wa(l){return m.add(l),()=>m.delete(l)}function ne(l,s){s===void 0&&(s={}),f=z({},f,l);let h=[],v=[];y.v7_fetcherPersist&&f.fetchers.forEach((P,C)=>{P.state==="idle"&&(pe.has(C)?v.push(C):h.push(C))}),[...m].forEach(P=>P(f,{deletedFetchers:v,unstable_viewTransitionOpts:s.viewTransitionOpts,unstable_flushSync:s.flushSync===!0})),y.v7_fetcherPersist&&(h.forEach(P=>f.fetchers.delete(P)),v.forEach(P=>ht(P)))}function We(l,s,h){var v,P;let{flushSync:C}=h===void 0?{}:h,M=f.actionData!=null&&f.navigation.formMethod!=null&&le(f.navigation.formMethod)&&f.navigation.state==="loading"&&((v=l.state)==null?void 0:v._isRedirect)!==!0,S;s.actionData?Object.keys(s.actionData).length>0?S=s.actionData:S=null:M?S=f.actionData:S=null;let _=s.loaderData?yr(f.loaderData,s.loaderData,s.matches||[],s.errors):f.loaderData,x=f.blockers;x.size>0&&(x=new Map(x),x.forEach((V,$)=>x.set($,Je)));let T=O===!0||f.navigation.formMethod!=null&&le(f.navigation.formMethod)&&((P=l.state)==null?void 0:P._isRedirect)!==!0;c&&(i=c,c=void 0),De||U===J.Pop||(U===J.Push?e.history.push(l,l.state):U===J.Replace&&e.history.replace(l,l.state));let K;if(U===J.Pop){let V=ae.get(f.location.pathname);V&&V.has(l.pathname)?K={currentLocation:f.location,nextLocation:l}:ae.has(l.pathname)&&(K={currentLocation:l,nextLocation:f.location})}else if(G){let V=ae.get(f.location.pathname);V?V.add(l.pathname):(V=new Set([l.pathname]),ae.set(f.location.pathname,V)),K={currentLocation:f.location,nextLocation:l}}ne(z({},s,{actionData:S,loaderData:_,historyAction:U,location:l,initialized:!0,navigation:Pt,revalidation:"idle",restoreScrollPosition:Hr(l,s.matches||f.matches),preventScrollReset:T,blockers:x}),{viewTransitionOpts:K,flushSync:C===!0}),U=J.Pop,O=!1,G=!1,De=!1,Me=!1,ut=[]}async function Cr(l,s){if(typeof l=="number"){e.history.go(l);return}let h=xt(f.location,f.matches,u,y.v7_prependBasename,l,y.v7_relativeSplatPath,s?.fromRouteId,s?.relative),{path:v,submission:P,error:C}=rr(y.v7_normalizeFormMethod,!1,h,s),M=f.location,S=de(f.location,v,s&&s.state);S=z({},S,e.history.encodeLocation(S));let _=s&&s.replace!=null?s.replace:void 0,x=J.Push;_===!0?x=J.Replace:_===!1||P!=null&&le(P.formMethod)&&P.formAction===f.location.pathname+f.location.search&&(x=J.Replace);let T=s&&"preventScrollReset"in s?s.preventScrollReset===!0:void 0,K=(s&&s.unstable_flushSync)===!0,V=Or({currentLocation:M,nextLocation:S,historyAction:x});if(V){mt(V,{state:"blocked",location:S,proceed(){mt(V,{state:"proceeding",proceed:void 0,reset:void 0,location:S}),Cr(l,s)},reset(){let $=new Map(f.blockers);$.set(V,Je),ne({blockers:$})}});return}return await Ne(x,S,{submission:P,pendingError:C,preventScrollReset:T,replace:s&&s.replace,enableViewTransition:s&&s.unstable_viewTransition,flushSync:K})}function Ra(){if(Ot(),ne({revalidation:"loading"}),f.navigation.state!=="submitting"){if(f.navigation.state==="idle"){Ne(f.historyAction,f.location,{startUninterruptedRevalidation:!0});return}Ne(U||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation,enableViewTransition:G===!0})}}async function Ne(l,s,h){N&&N.abort(),N=null,U=l,De=(h&&h.startUninterruptedRevalidation)===!0,_a(f.location,f.matches),O=(h&&h.preventScrollReset)===!0,G=(h&&h.enableViewTransition)===!0;let v=c||i,P=h&&h.overrideNavigation,C=Re(v,s,u),M=(h&&h.flushSync)===!0,S=yt(C,v,s.pathname);if(S.active&&S.matches&&(C=S.matches),!C){let{error:k,notFoundMatches:te,route:q}=jt(s.pathname);We(s,{matches:te,loaderData:{},errors:{[q.id]:k}},{flushSync:M});return}if(f.initialized&&!Me&&Mn(f.location,s)&&!(h&&h.submission&&le(h.submission.formMethod))){We(s,{matches:C},{flushSync:M});return}N=new AbortController;let _=He(e.history,s,N.signal,h&&h.submission),x;if(h&&h.pendingError)x=[_e(C).route.id,{type:B.error,error:h.pendingError}];else if(h&&h.submission&&le(h.submission.formMethod)){let k=await ba(_,s,h.submission,C,S.active,{replace:h.replace,flushSync:M});if(k.shortCircuited)return;if(k.pendingActionResult){let[te,q]=k.pendingActionResult;if(re(q)&&Ye(q.error)&&q.error.status===404){N=null,We(s,{matches:k.matches,loaderData:{},errors:{[te]:q.error}});return}}C=k.matches||C,x=k.pendingActionResult,P=Ft(s,h.submission),M=!1,S.active=!1,_=He(e.history,_.url,_.signal)}let{shortCircuited:T,matches:K,loaderData:V,errors:$}=await Sa(_,s,C,S.active,P,h&&h.submission,h&&h.fetcherSubmission,h&&h.replace,h&&h.initialHydration===!0,M,x);T||(N=null,We(s,z({matches:K||C},vr(x),{loaderData:V,errors:$})))}async function ba(l,s,h,v,P,C){C===void 0&&(C={}),Ot();let M=Hn(s,h);if(ne({navigation:M},{flushSync:C.flushSync===!0}),P){let x=await vt(v,s.pathname,l.signal);if(x.type==="aborted")return{shortCircuited:!0};if(x.type==="error"){let{boundaryId:T,error:K}=pt(s.pathname,x);return{matches:x.partialMatches,pendingActionResult:[T,{type:B.error,error:K}]}}else if(x.matches)v=x.matches;else{let{notFoundMatches:T,error:K,route:V}=jt(s.pathname);return{matches:T,pendingActionResult:[V.id,{type:B.error,error:K}]}}}let S,_=Fe(v,s);if(!_.route.action&&!_.route.lazy)S={type:B.error,error:Y(405,{method:l.method,pathname:s.pathname,routeId:_.route.id})};else if(S=(await et("action",f,l,[_],v,null))[_.route.id],l.signal.aborted)return{shortCircuited:!0};if(be(S)){let x;return C&&C.replace!=null?x=C.replace:x=fr(S.response.headers.get("Location"),new URL(l.url),u)===f.location.pathname+f.location.search,await Ie(l,S,!0,{submission:h,replace:x}),{shortCircuited:!0}}if(he(S))throw Y(400,{type:"defer-action"});if(re(S)){let x=_e(v,_.route.id);return(C&&C.replace)!==!0&&(U=J.Push),{matches:v,pendingActionResult:[x.route.id,S]}}return{matches:v,pendingActionResult:[_.route.id,S]}}async function Sa(l,s,h,v,P,C,M,S,_,x,T){let K=P||Ft(s,C),V=C||M||br(K),$=!De&&(!y.v7_partialHydration||!_);if(v){if($){let X=_r(T);ne(z({navigation:K},X!==void 0?{actionData:X}:{}),{flushSync:x})}let I=await vt(h,s.pathname,l.signal);if(I.type==="aborted")return{shortCircuited:!0};if(I.type==="error"){let{boundaryId:X,error:ie}=pt(s.pathname,I);return{matches:I.partialMatches,loaderData:{},errors:{[X]:ie}}}else if(I.matches)h=I.matches;else{let{error:X,notFoundMatches:ie,route:Q}=jt(s.pathname);return{matches:ie,loaderData:{},errors:{[Q.id]:X}}}}let k=c||i,[te,q]=ar(e.history,f,h,V,s,y.v7_partialHydration&&_===!0,y.v7_skipActionErrorRevalidation,Me,ut,ct,pe,ke,me,k,u,T);if(Ht(I=>!(h&&h.some(X=>X.route.id===I))||te&&te.some(X=>X.route.id===I)),Ze=++dt,te.length===0&&q.length===0){let I=Ar();return We(s,z({matches:h,loaderData:{},errors:T&&re(T[1])?{[T[0]]:T[1].error}:null},vr(T),I?{fetchers:new Map(f.fetchers)}:{}),{flushSync:x}),{shortCircuited:!0}}if($){let I={};if(!v){I.navigation=K;let X=_r(T);X!==void 0&&(I.actionData=X)}q.length>0&&(I.fetchers=Ea(q)),ne(I,{flushSync:x})}q.forEach(I=>{Z.has(I.key)&&Le(I.key),I.controller&&Z.set(I.key,I.controller)});let tt=()=>q.forEach(I=>Le(I.key));N&&N.signal.addEventListener("abort",tt);let{loaderResults:ve,fetcherResults:Ke}=await Fr(f,h,te,q,l);if(l.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",tt),q.forEach(I=>Z.delete(I.key));let Te=at(ve);if(Te)return await Ie(l,Te.result,!0,{replace:S}),{shortCircuited:!0};if(Te=at(Ke),Te)return me.add(Te.key),await Ie(l,Te.result,!0,{replace:S}),{shortCircuited:!0};let{loaderData:gt,errors:ge}=pr(f,h,te,ve,T,q,Ke,Ue);Ue.forEach((I,X)=>{I.subscribe(ie=>{(ie||I.done)&&Ue.delete(X)})}),y.v7_partialHydration&&_&&f.errors&&Object.entries(f.errors).filter(I=>{let[X]=I;return!te.some(ie=>ie.route.id===X)}).forEach(I=>{let[X,ie]=I;ge=Object.assign(ge||{},{[X]:ie})});let wt=Ar(),Rt=Nr(Ze),bt=wt||Rt||q.length>0;return z({matches:h,loaderData:gt,errors:ge},bt?{fetchers:new Map(f.fetchers)}:{})}function _r(l){if(l&&!re(l[1]))return{[l[0]]:l[1].data};if(f.actionData)return Object.keys(f.actionData).length===0?null:f.actionData}function Ea(l){return l.forEach(s=>{let h=f.fetchers.get(s.key),v=Ge(void 0,h?h.data:void 0);f.fetchers.set(s.key,v)}),new Map(f.fetchers)}function Pa(l,s,h,v){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Z.has(l)&&Le(l);let P=(v&&v.unstable_flushSync)===!0,C=c||i,M=xt(f.location,f.matches,u,y.v7_prependBasename,h,y.v7_relativeSplatPath,s,v?.relative),S=Re(C,M,u),_=yt(S,C,M);if(_.active&&_.matches&&(S=_.matches),!S){ye(l,s,Y(404,{pathname:M}),{flushSync:P});return}let{path:x,submission:T,error:K}=rr(y.v7_normalizeFormMethod,!0,M,v);if(K){ye(l,s,K,{flushSync:P});return}let V=Fe(S,x);if(O=(v&&v.preventScrollReset)===!0,T&&le(T.formMethod)){Da(l,s,x,V,S,_.active,P,T);return}ke.set(l,{routeId:s,path:x}),xa(l,s,x,V,S,_.active,P,T)}async function Da(l,s,h,v,P,C,M,S){Ot(),ke.delete(l);function _(Q){if(!Q.route.action&&!Q.route.lazy){let we=Y(405,{method:S.formMethod,pathname:h,routeId:s});return ye(l,s,we,{flushSync:M}),!0}return!1}if(!C&&_(v))return;let x=f.fetchers.get(l);xe(l,zn(S,x),{flushSync:M});let T=new AbortController,K=He(e.history,h,T.signal,S);if(C){let Q=await vt(P,h,K.signal);if(Q.type==="aborted")return;if(Q.type==="error"){let{error:we}=pt(h,Q);ye(l,s,we,{flushSync:M});return}else if(Q.matches){if(P=Q.matches,v=Fe(P,h),_(v))return}else{ye(l,s,Y(404,{pathname:h}),{flushSync:M});return}}Z.set(l,T);let V=dt,k=(await et("action",f,K,[v],P,l))[v.route.id];if(K.signal.aborted){Z.get(l)===T&&Z.delete(l);return}if(y.v7_fetcherPersist&&pe.has(l)){if(be(k)||re(k)){xe(l,Ee(void 0));return}}else{if(be(k))if(Z.delete(l),Ze>V){xe(l,Ee(void 0));return}else return me.add(l),xe(l,Ge(S)),Ie(K,k,!1,{fetcherSubmission:S});if(re(k)){ye(l,s,k.error);return}}if(he(k))throw Y(400,{type:"defer-action"});let te=f.navigation.location||f.location,q=He(e.history,te,T.signal),tt=c||i,ve=f.navigation.state!=="idle"?Re(tt,f.navigation.location,u):f.matches;W(ve,"Didn't find any matches after fetcher action");let Ke=++dt;Be.set(l,Ke);let Te=Ge(S,k.data);f.fetchers.set(l,Te);let[gt,ge]=ar(e.history,f,ve,S,te,!1,y.v7_skipActionErrorRevalidation,Me,ut,ct,pe,ke,me,tt,u,[v.route.id,k]);ge.filter(Q=>Q.key!==l).forEach(Q=>{let we=Q.key,Br=f.fetchers.get(we),Ua=Ge(void 0,Br?Br.data:void 0);f.fetchers.set(we,Ua),Z.has(we)&&Le(we),Q.controller&&Z.set(we,Q.controller)}),ne({fetchers:new Map(f.fetchers)});let wt=()=>ge.forEach(Q=>Le(Q.key));T.signal.addEventListener("abort",wt);let{loaderResults:Rt,fetcherResults:bt}=await Fr(f,ve,gt,ge,q);if(T.signal.aborted)return;T.signal.removeEventListener("abort",wt),Be.delete(l),Z.delete(l),ge.forEach(Q=>Z.delete(Q.key));let I=at(Rt);if(I)return Ie(q,I.result,!1);if(I=at(bt),I)return me.add(I.key),Ie(q,I.result,!1);let{loaderData:X,errors:ie}=pr(f,ve,gt,Rt,void 0,ge,bt,Ue);if(f.fetchers.has(l)){let Q=Ee(k.data);f.fetchers.set(l,Q)}Nr(Ke),f.navigation.state==="loading"&&Ke>Ze?(W(U,"Expected pending action"),N&&N.abort(),We(f.navigation.location,{matches:ve,loaderData:X,errors:ie,fetchers:new Map(f.fetchers)})):(ne({errors:ie,loaderData:yr(f.loaderData,X,ve,ie),fetchers:new Map(f.fetchers)}),Me=!1)}async function xa(l,s,h,v,P,C,M,S){let _=f.fetchers.get(l);xe(l,Ge(S,_?_.data:void 0),{flushSync:M});let x=new AbortController,T=He(e.history,h,x.signal);if(C){let k=await vt(P,h,T.signal);if(k.type==="aborted")return;if(k.type==="error"){let{error:te}=pt(h,k);ye(l,s,te,{flushSync:M});return}else if(k.matches)P=k.matches,v=Fe(P,h);else{ye(l,s,Y(404,{pathname:h}),{flushSync:M});return}}Z.set(l,x);let K=dt,$=(await et("loader",f,T,[v],P,l))[v.route.id];if(he($)&&($=await Ct($,T.signal,!0)||$),Z.get(l)===x&&Z.delete(l),!T.signal.aborted){if(pe.has(l)){xe(l,Ee(void 0));return}if(be($))if(Ze>K){xe(l,Ee(void 0));return}else{me.add(l),await Ie(T,$,!1);return}if(re($)){ye(l,s,$.error);return}W(!he($),"Unhandled fetcher deferred data"),xe(l,Ee($.data))}}async function Ie(l,s,h,v){let{submission:P,fetcherSubmission:C,replace:M}=v===void 0?{}:v;s.response.headers.has("X-Remix-Revalidate")&&(Me=!0);let S=s.response.headers.get("Location");W(S,"Expected a Location header on the redirect Response"),S=fr(S,new URL(l.url),u);let _=de(f.location,S,{_isRedirect:!0});if(r){let k=!1;if(s.response.headers.has("X-Remix-Reload-Document"))k=!0;else if(Dt.test(S)){const te=e.history.createURL(S);k=te.origin!==t.location.origin||Ve(te.pathname,u)==null}if(k){M?t.location.replace(S):t.location.assign(S);return}}N=null;let x=M===!0||s.response.headers.has("X-Remix-Replace")?J.Replace:J.Push,{formMethod:T,formAction:K,formEncType:V}=f.navigation;!P&&!C&&T&&K&&V&&(P=br(f.navigation));let $=P||C;if(Pn.has(s.response.status)&&$&&le($.formMethod))await Ne(x,_,{submission:z({},$,{formAction:S}),preventScrollReset:O,enableViewTransition:h?G:void 0});else{let k=Ft(_,P);await Ne(x,_,{overrideNavigation:k,fetcherSubmission:C,preventScrollReset:O,enableViewTransition:h?G:void 0})}}async function et(l,s,h,v,P,C){let M,S={};try{M=await ur(d,l,s,h,v,P,C,o,a)}catch(_){return v.forEach(x=>{S[x.route.id]={type:B.error,error:_}}),S}for(let[_,x]of Object.entries(M))if(wr(x)){let T=x.result;S[_]={type:B.redirect,response:dr(T,h,_,P,u,y.v7_relativeSplatPath)}}else S[_]=await cr(x);return S}async function Fr(l,s,h,v,P){let C=l.matches,M=et("loader",l,P,h,s,null),S=Promise.all(v.map(async T=>{if(T.matches&&T.match&&T.controller){let V=(await et("loader",l,He(e.history,T.path,T.controller.signal),[T.match],T.matches,T.key))[T.match.route.id];return{[T.key]:V}}else return Promise.resolve({[T.key]:{type:B.error,error:Y(404,{pathname:T.path})}})})),_=await M,x=(await S).reduce((T,K)=>Object.assign(T,K),{});return await Promise.all([On(s,_,P.signal,C,l.loaderData),jn(s,x,v)]),{loaderResults:_,fetcherResults:x}}function Ot(){Me=!0,ut.push(...Ht()),ke.forEach((l,s)=>{Z.has(s)&&(ct.add(s),Le(s))})}function xe(l,s,h){h===void 0&&(h={}),f.fetchers.set(l,s),ne({fetchers:new Map(f.fetchers)},{flushSync:(h&&h.flushSync)===!0})}function ye(l,s,h,v){v===void 0&&(v={});let P=_e(f.matches,s);ht(l),ne({errors:{[P.route.id]:h},fetchers:new Map(f.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function Mr(l){return y.v7_fetcherPersist&&(qe.set(l,(qe.get(l)||0)+1),pe.has(l)&&pe.delete(l)),f.fetchers.get(l)||Dn}function ht(l){let s=f.fetchers.get(l);Z.has(l)&&!(s&&s.state==="loading"&&Be.has(l))&&Le(l),ke.delete(l),Be.delete(l),me.delete(l),pe.delete(l),ct.delete(l),f.fetchers.delete(l)}function La(l){if(y.v7_fetcherPersist){let s=(qe.get(l)||0)-1;s<=0?(qe.delete(l),pe.add(l)):qe.set(l,s)}else ht(l);ne({fetchers:new Map(f.fetchers)})}function Le(l){let s=Z.get(l);W(s,"Expected fetch controller: "+l),s.abort(),Z.delete(l)}function Ur(l){for(let s of l){let h=Mr(s),v=Ee(h.data);f.fetchers.set(s,v)}}function Ar(){let l=[],s=!1;for(let h of me){let v=f.fetchers.get(h);W(v,"Expected fetcher: "+h),v.state==="loading"&&(me.delete(h),l.push(h),s=!0)}return Ur(l),s}function Nr(l){let s=[];for(let[h,v]of Be)if(v<l){let P=f.fetchers.get(h);W(P,"Expected fetcher: "+h),P.state==="loading"&&(Le(h),Be.delete(h),s.push(h))}return Ur(s),s.length>0}function Ta(l,s){let h=f.blockers.get(l)||Je;return Ae.get(l)!==s&&Ae.set(l,s),h}function Ir(l){f.blockers.delete(l),Ae.delete(l)}function mt(l,s){let h=f.blockers.get(l)||Je;W(h.state==="unblocked"&&s.state==="blocked"||h.state==="blocked"&&s.state==="blocked"||h.state==="blocked"&&s.state==="proceeding"||h.state==="blocked"&&s.state==="unblocked"||h.state==="proceeding"&&s.state==="unblocked","Invalid blocker state transition: "+h.state+" -> "+s.state);let v=new Map(f.blockers);v.set(l,s),ne({blockers:v})}function Or(l){let{currentLocation:s,nextLocation:h,historyAction:v}=l;if(Ae.size===0)return;Ae.size>1&&ce(!1,"A router only supports one blocker at a time");let P=Array.from(Ae.entries()),[C,M]=P[P.length-1],S=f.blockers.get(C);if(!(S&&S.state==="proceeding")&&M({currentLocation:s,nextLocation:h,historyAction:v}))return C}function jt(l){let s=Y(404,{pathname:l}),h=c||i,{matches:v,route:P}=nt(h);return Ht(),{notFoundMatches:v,route:P,error:s}}function pt(l,s){return{boundaryId:_e(s.partialMatches).route.id,error:Y(400,{type:"route-discovery",pathname:l,message:s.error!=null&&"message"in s.error?s.error:String(s.error)})}}function Ht(l){let s=[];return Ue.forEach((h,v)=>{(!l||l(v))&&(h.cancel(),s.push(v),Ue.delete(v))}),s}function Ca(l,s,h){if(E=l,D=s,F=h||null,!L&&f.navigation===Pt){L=!0;let v=Hr(f.location,f.matches);v!=null&&ne({restoreScrollPosition:v})}return()=>{E=null,D=null,F=null}}function jr(l,s){return F&&F(l,s.map(v=>Gr(v,f.loaderData)))||l.key}function _a(l,s){if(E&&D){let h=jr(l,s);E[h]=D()}}function Hr(l,s){if(E){let h=jr(l,s),v=E[h];if(typeof v=="number")return v}return null}function yt(l,s,h){if(p){if(R.has(h))return{active:!1,matches:l};if(l){if(Object.keys(l[0].params).length>0)return{active:!0,matches:rt(s,h,u,!0)}}else return{active:!0,matches:rt(s,h,u,!0)||[]}}return{active:!1,matches:null}}async function vt(l,s,h){let v=l;for(;;){let P=c==null,C=c||i;try{await Cn(p,s,v,C,o,a,ya,h)}catch(_){return{type:"error",error:_,partialMatches:v}}finally{P&&(i=[...i])}if(h.aborted)return{type:"aborted"};let M=Re(C,s,u);if(M)return zr(s,R),{type:"success",matches:M};let S=rt(C,s,u,!0);if(!S||v.length===S.length&&v.every((_,x)=>_.route.id===S[x].route.id))return zr(s,R),{type:"success",matches:null};v=S}}function zr(l,s){if(s.size>=w){let h=s.values().next().value;s.delete(h)}s.add(l)}function Fa(l){o={},c=je(l,a,void 0,o)}function Ma(l,s){let h=c==null;lr(l,s,c||i,o,a),h&&(i=[...i],ne({}))}return A={get basename(){return u},get future(){return y},get state(){return f},get routes(){return i},get window(){return t},initialize:va,subscribe:wa,enableScrollRestoration:Ca,navigate:Cr,fetch:Pa,revalidate:Ra,createHref:l=>e.history.createHref(l),encodeLocation:l=>e.history.encodeLocation(l),getFetcher:Mr,deleteFetcher:La,dispose:ga,getBlocker:Ta,deleteBlocker:Ir,patchRoutes:Ma,_internalFetchControllers:Z,_internalActiveDeferreds:Ue,_internalSetRoutes:Fa},A}const xn=Symbol("deferred");function Va(e,t){W(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(t?t.basename:null)||"/",a;if(t!=null&&t.mapRouteProperties)a=t.mapRouteProperties;else if(t!=null&&t.detectErrorBoundary){let m=t.detectErrorBoundary;a=w=>({hasErrorBoundary:m(w)})}else a=qt;let o=z({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},t?t.future:null),i=je(e,a,void 0,r);async function c(m,w){let{requestContext:R,skipLoaderErrorBubbling:E,unstable_dataStrategy:F}=w===void 0?{}:w,D=new URL(m.url),L=m.method,g=de("",fe(D),null,"default"),j=Re(i,g,n);if(!Tt(L)&&L!=="HEAD"){let A=Y(405,{method:L}),{matches:f,route:U}=nt(i);return{basename:n,location:g,matches:f,loaderData:{},actionData:null,errors:{[U.id]:A},statusCode:A.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!j){let A=Y(404,{pathname:g.pathname}),{matches:f,route:U}=nt(i);return{basename:n,location:g,matches:f,loaderData:{},actionData:null,errors:{[U.id]:A},statusCode:A.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let H=await d(m,g,j,R,F||null,E===!0,null);return Se(H)?H:z({location:g,basename:n},H)}async function u(m,w){let{routeId:R,requestContext:E,unstable_dataStrategy:F}=w===void 0?{}:w,D=new URL(m.url),L=m.method,g=de("",fe(D),null,"default"),j=Re(i,g,n);if(!Tt(L)&&L!=="HEAD"&&L!=="OPTIONS")throw Y(405,{method:L});if(!j)throw Y(404,{pathname:g.pathname});let H=R?j.find(O=>O.route.id===R):Fe(j,g);if(R&&!H)throw Y(403,{pathname:g.pathname,routeId:R});if(!H)throw Y(404,{pathname:g.pathname});let A=await d(m,g,j,E,F||null,!1,H);if(Se(A))return A;let f=A.errors?Object.values(A.errors)[0]:void 0;if(f!==void 0)throw f;if(A.actionData)return Object.values(A.actionData)[0];if(A.loaderData){var U;let O=Object.values(A.loaderData)[0];return(U=A.activeDeferreds)!=null&&U[H.route.id]&&(O[xn]=A.activeDeferreds[H.route.id]),O}}async function d(m,w,R,E,F,D,L){W(m.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(le(m.method.toLowerCase()))return await p(m,R,L||Fe(R,w),E,F,D,L!=null);let g=await y(m,R,E,F,D,L);return Se(g)?g:z({},g,{actionData:null,actionHeaders:{}})}catch(g){if(An(g)&&Se(g.result)){if(g.type===B.error)throw g.result;return g.result}if(In(g))return g;throw g}}async function p(m,w,R,E,F,D,L){let g;if(!R.route.action&&!R.route.lazy){let A=Y(405,{method:m.method,pathname:new URL(m.url).pathname,routeId:R.route.id});if(L)throw A;g={type:B.error,error:A}}else g=(await b("action",m,[R],w,L,E,F))[R.route.id],m.signal.aborted&&tr(m,L,o);if(be(g))throw new Response(null,{status:g.response.status,headers:{Location:g.response.headers.get("Location")}});if(he(g)){let A=Y(400,{type:"defer-action"});if(L)throw A;g={type:B.error,error:A}}if(L){if(re(g))throw g.error;return{matches:[R],loaderData:{},actionData:{[R.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let j=new Request(m.url,{headers:m.headers,redirect:m.redirect,signal:m.signal});if(re(g)){let A=D?R:_e(w,R.route.id),f=await y(j,w,E,F,D,null,[A.route.id,g]);return z({},f,{statusCode:Ye(g.error)?g.error.status:g.statusCode!=null?g.statusCode:500,actionData:null,actionHeaders:z({},g.headers?{[R.route.id]:g.headers}:{})})}let H=await y(j,w,E,F,D,null);return z({},H,{actionData:{[R.route.id]:g.data}},g.statusCode?{statusCode:g.statusCode}:{},{actionHeaders:g.headers?{[R.route.id]:g.headers}:{}})}async function y(m,w,R,E,F,D,L){let g=D!=null;if(g&&!(D!=null&&D.route.loader)&&!(D!=null&&D.route.lazy))throw Y(400,{method:m.method,pathname:new URL(m.url).pathname,routeId:D?.route.id});let H=(D?[D]:L&&re(L[1])?nr(w,L[0]):w).filter(N=>N.route.loader||N.route.lazy);if(H.length===0)return{matches:w,loaderData:w.reduce((N,G)=>Object.assign(N,{[G.route.id]:null}),{}),errors:L&&re(L[1])?{[L[0]]:L[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let A=await b("loader",m,H,w,g,R,E);m.signal.aborted&&tr(m,g,o);let f=new Map,U=mr(w,A,L,f,F),O=new Set(H.map(N=>N.route.id));return w.forEach(N=>{O.has(N.route.id)||(U.loaderData[N.route.id]=null)}),z({},U,{matches:w,activeDeferreds:f.size>0?Object.fromEntries(f.entries()):null})}async function b(m,w,R,E,F,D,L){let g=await ur(L||sr,m,null,w,R,E,null,r,a,D),j={};return await Promise.all(E.map(async H=>{if(!(H.route.id in g))return;let A=g[H.route.id];if(wr(A)){let f=A.result;throw dr(f,w,H.route.id,E,n,o.v7_relativeSplatPath)}if(Se(A.result)&&F)throw A;j[H.route.id]=await cr(A)})),j}return{dataRoutes:i,query:c,queryRoute:u}}function $a(e,t,r){return z({},t,{statusCode:Ye(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function tr(e,t,r){if(r.v7_throwAbortReason&&e.signal.reason!==void 0)throw e.signal.reason;let n=t?"queryRoute":"query";throw new Error(n+"() call aborted: "+e.method+" "+e.url)}function Ln(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xt(e,t,r,n,a,o,i,c){let u,d;if(i){u=[];for(let y of t)if(u.push(y),y.route.id===i){d=y;break}}else u=t,d=t[t.length-1];let p=fn(a||".",dn(u,o),Ve(e.pathname,r)||e.pathname,c==="path");return a==null&&(p.search=e.search,p.hash=e.hash),(a==null||a===""||a===".")&&d&&d.route.index&&!_t(p.search)&&(p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(p.pathname=p.pathname==="/"?r:$e([r,p.pathname])),fe(p)}function rr(e,t,r,n){if(!n||!Ln(n))return{path:r};if(n.formMethod&&!Tt(n.formMethod))return{path:r,error:Y(405,{method:n.formMethod})};let a=()=>({path:r,error:Y(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),c=gr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!le(i))return a();let b=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,w)=>{let[R,E]=w;return""+m+R+"="+E+`
|
|
11
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:b}}}else if(n.formEncType==="application/json"){if(!le(i))return a();try{let b=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:b,text:void 0}}}catch{return a()}}}W(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=Lt(n.formData),d=n.formData;else if(n.body instanceof FormData)u=Lt(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=hr(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=hr(u)}catch{return a()}let p={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(le(p.formMethod))return{path:r,submission:p};let y=ue(r);return t&&y.search&&_t(y.search)&&u.append("index",""),y.search="?"+u,{path:fe(y),submission:p}}function nr(e,t){let r=e;if(t){let n=e.findIndex(a=>a.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function ar(e,t,r,n,a,o,i,c,u,d,p,y,b,m,w,R){let E=R?re(R[1])?R[1].error:R[1].data:void 0,F=e.createURL(t.location),D=e.createURL(a),L=R&&re(R[1])?R[0]:void 0,g=L?nr(r,L):r,j=R?R[1].statusCode:void 0,H=i&&j&&j>=400,A=g.filter((U,O)=>{let{route:N}=U;if(N.lazy)return!0;if(N.loader==null)return!1;if(o)return typeof N.loader!="function"||N.loader.hydrate?!0:t.loaderData[N.id]===void 0&&(!t.errors||t.errors[N.id]===void 0);if(Tn(t.loaderData,t.matches[O],U)||u.some(ee=>ee===U.route.id))return!0;let G=t.matches[O],ae=U;return or(U,z({currentUrl:F,currentParams:G.params,nextUrl:D,nextParams:ae.params},n,{actionResult:E,actionStatus:j,defaultShouldRevalidate:H?!1:c||F.pathname+F.search===D.pathname+D.search||F.search!==D.search||ir(G,ae)}))}),f=[];return y.forEach((U,O)=>{if(o||!r.some(De=>De.route.id===U.routeId)||p.has(O))return;let N=Re(m,U.path,w);if(!N){f.push({key:O,routeId:U.routeId,path:U.path,matches:null,match:null,controller:null});return}let G=t.fetchers.get(O),ae=Fe(N,U.path),ee=!1;b.has(O)?ee=!1:d.has(O)?(d.delete(O),ee=!0):G&&G.state!=="idle"&&G.data===void 0?ee=c:ee=or(ae,z({currentUrl:F,currentParams:t.matches[t.matches.length-1].params,nextUrl:D,nextParams:r[r.length-1].params},n,{actionResult:E,actionStatus:j,defaultShouldRevalidate:H?!1:c})),ee&&f.push({key:O,routeId:U.routeId,path:U.path,matches:N,match:ae,controller:new AbortController})}),[A,f]}function Tn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function ir(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function or(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function Cn(e,t,r,n,a,o,i,c){let u=[t,...r.map(d=>d.route.id)].join("-");try{let d=i.get(u);d||(d=e({path:t,matches:r,patch:(p,y)=>{c.aborted||lr(p,y,n,a,o)}}),i.set(u,d)),d&&Un(d)&&await d}finally{i.delete(u)}}function lr(e,t,r,n,a){if(e){var o;let i=n[e];W(i,"No route found to patch children into: routeId = "+e);let c=je(t,a,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...c):i.children=c}else{let i=je(t,a,["patch",String(r.length||"0")],n);r.push(...i)}}async function _n(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];W(a,"No route found in manifest");let o={};for(let i in n){let u=a[i]!==void 0&&i!=="hasErrorBoundary";ce(!u,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!u&&!Yr.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,z({},t(a),{lazy:void 0}))}async function sr(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,o,i)=>Object.assign(a,{[r[i].route.id]:o}),{})}async function ur(e,t,r,n,a,o,i,c,u,d){let p=o.map(m=>m.route.lazy?_n(m.route,u,c):void 0),y=o.map((m,w)=>{let R=p[w],E=a.some(D=>D.route.id===m.route.id);return z({},m,{shouldLoad:E,resolve:async D=>(D&&n.method==="GET"&&(m.route.lazy||m.route.loader)&&(E=!0),E?Fn(t,n,m,R,D,d):Promise.resolve({type:B.data,result:void 0}))})}),b=await e({matches:y,request:n,params:o[0].params,fetcherKey:i,context:d});try{await Promise.all(p)}catch{}return b}async function Fn(e,t,r,n,a,o){let i,c,u=d=>{let p,y=new Promise((w,R)=>p=R);c=()=>p(),t.signal.addEventListener("abort",c);let b=w=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:o},...w!==void 0?[w]:[]),m=(async()=>{try{return{type:"data",result:await(a?a(R=>b(R)):b())}}catch(w){return{type:"error",result:w}}})();return Promise.race([m,y])};try{let d=r.route[e];if(n)if(d){let p,[y]=await Promise.all([u(d).catch(b=>{p=b}),n]);if(p!==void 0)throw p;i=y}else if(await n,d=r.route[e],d)i=await u(d);else if(e==="action"){let p=new URL(t.url),y=p.pathname+p.search;throw Y(405,{method:t.method,pathname:y,routeId:r.route.id})}else return{type:B.data,result:void 0};else if(d)i=await u(d);else{let p=new URL(t.url),y=p.pathname+p.search;throw Y(404,{pathname:y})}W(i.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:B.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return i}async function cr(e){let{result:t,type:r}=e;if(Se(t)){let d;try{let p=t.headers.get("Content-Type");p&&/\bapplication\/json\b/.test(p)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(p){return{type:B.error,error:p}}return r===B.error?{type:B.error,error:new Et(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:B.data,data:d,statusCode:t.status,headers:t.headers}}if(r===B.error){if(Rr(t)){var n;if(t.data instanceof Error){var a;return{type:B.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status}}t=new Et(((n=t.init)==null?void 0:n.status)||500,void 0,t.data)}return{type:B.error,error:t,statusCode:Ye(t)?t.status:void 0}}if(Nn(t)){var o,i;return{type:B.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}if(Rr(t)){var c,u;return{type:B.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:B.data,data:t}}function dr(e,t,r,n,a,o){let i=e.headers.get("Location");if(W(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Dt.test(i)){let c=n.slice(0,n.findIndex(u=>u.route.id===r)+1);i=xt(new URL(t.url),c,a,!0,i,o),e.headers.set("Location",i)}return e}function fr(e,t,r){if(Dt.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=Ve(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function He(e,t,r,n){let a=e.createURL(gr(t)).toString(),o={signal:r};if(n&&le(n.formMethod)){let{formMethod:i,formEncType:c}=n;o.method=i.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(n.json)):c==="text/plain"?o.body=n.text:c==="application/x-www-form-urlencoded"&&n.formData?o.body=Lt(n.formData):o.body=n.formData}return new Request(a,o)}function Lt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function hr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function mr(e,t,r,n,a){let o={},i=null,c,u=!1,d={},p=r&&re(r[1])?r[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let b=y.route.id,m=t[b];if(W(!be(m),"Cannot handle redirect results in processLoaderData"),re(m)){let w=m.error;if(p!==void 0&&(w=p,p=void 0),i=i||{},a)i[b]=w;else{let R=_e(e,b);i[R.route.id]==null&&(i[R.route.id]=w)}o[b]=void 0,u||(u=!0,c=Ye(m.error)?m.error.status:500),m.headers&&(d[b]=m.headers)}else he(m)?(n.set(b,m.deferredData),o[b]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[b]=m.headers)):(o[b]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(c=m.statusCode),m.headers&&(d[b]=m.headers))}),p!==void 0&&r&&(i={[r[0]]:p},o[r[0]]=void 0),{loaderData:o,errors:i,statusCode:c||200,loaderHeaders:d}}function pr(e,t,r,n,a,o,i,c){let{loaderData:u,errors:d}=mr(t,n,a,c,!1);return o.forEach(p=>{let{key:y,match:b,controller:m}=p,w=i[y];if(W(w,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(re(w)){let R=_e(e.matches,b?.route.id);d&&d[R.route.id]||(d=z({},d,{[R.route.id]:w.error})),e.fetchers.delete(y)}else if(be(w))W(!1,"Unhandled fetcher revalidation redirect");else if(he(w))W(!1,"Unhandled fetcher deferred data");else{let R=Ee(w.data);e.fetchers.set(y,R)}}),{loaderData:u,errors:d}}function yr(e,t,r,n){let a=z({},t);for(let o of r){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function vr(e){return e?re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _e(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function nt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Y(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=t===void 0?{}:t,c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",o==="route-discovery"?u='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
|
|
12
|
-
`+i):a&&r&&n?u="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u='Route "'+n+'" does not match URL "'+r+'"'):e===404?(c="Not Found",u='No route matches URL "'+r+'"'):e===405&&(c="Method Not Allowed",a&&r&&n?u="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(u='Invalid request method "'+a.toUpperCase()+'"')),new Et(e||500,c,new Error(u),!0)}function at(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(be(a))return{key:n,result:a}}}function gr(e){let t=typeof e=="string"?ue(e):e;return fe(z({},t,{hash:""}))}function Mn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Un(e){return typeof e=="object"&&e!=null&&"then"in e}function An(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type===B.data||e.type===B.error)}function wr(e){return Se(e.result)&&En.has(e.result.status)}function he(e){return e.type===B.deferred}function re(e){return e.type===B.error}function be(e){return(e&&e.type)===B.redirect}function Rr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Nn(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Se(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function In(e){if(!Se(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Tt(e){return Sn.has(e.toLowerCase())}function le(e){return Rn.has(e.toLowerCase())}async function On(e,t,r,n,a){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[c,u]=o[i],d=e.find(b=>b?.route.id===c);if(!d)continue;let p=n.find(b=>b.route.id===d.route.id),y=p!=null&&!ir(p,d)&&(a&&a[d.route.id])!==void 0;he(u)&&y&&await Ct(u,r,!1).then(b=>{b&&(t[c]=b)})}}async function jn(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:o,controller:i}=r[n],c=t[a];e.find(d=>d?.route.id===o)&&he(c)&&(W(i,"Expected an AbortController for revalidating fetcher deferred result"),await Ct(c,i.signal,!0).then(d=>{d&&(t[a]=d)}))}}async function Ct(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:B.data,data:e.deferredData.unwrappedData}}catch(a){return{type:B.error,error:a}}return{type:B.data,data:e.deferredData.data}}}function _t(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Fe(e,t){let r=typeof t=="string"?ue(t).search:t.search;if(e[e.length-1].route.index&&_t(r||""))return e[e.length-1];let n=Gt(e);return n[n.length-1]}function br(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Ft(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 Hn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ge(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 zn(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 Ee(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 Bn(e,t){try{let r=e.sessionStorage.getItem(er);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function kn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(er,JSON.stringify(r))}catch(n){ce(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
|
|
13
|
-
* React Router DOM v6.26.2
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) Remix Software Inc.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
19
|
-
*
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},se.apply(this,arguments)}function Wn(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}const Mt="get",Ut="application/x-www-form-urlencoded";function it(e){return e!=null&&typeof e.tagName=="string"}function Kn(e){return it(e)&&e.tagName.toLowerCase()==="button"}function Vn(e){return it(e)&&e.tagName.toLowerCase()==="form"}function $n(e){return it(e)&&e.tagName.toLowerCase()==="input"}function Yn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Jn(e,t){return e.button===0&&(!t||t==="_self")&&!Yn(e)}function At(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Gn(e,t){let r=At(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}let ot=null;function Xn(){if(ot===null)try{new FormData(document.createElement("form"),0),ot=!1}catch{ot=!0}return ot}const Qn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nt(e){return e!=null&&!Qn.has(e)?null:e}function Zn(e,t){let r,n,a,o,i;if(Vn(e)){let c=e.getAttribute("action");n=c?stripBasename(c,t):null,r=e.getAttribute("method")||Mt,a=Nt(e.getAttribute("enctype"))||Ut,o=new FormData(e)}else if(Kn(e)||$n(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(n=u?stripBasename(u,t):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Mt,a=Nt(e.getAttribute("formenctype"))||Nt(c.getAttribute("enctype"))||Ut,o=new FormData(c,e),!Xn()){let{name:d,type:p,value:y}=e;if(p==="image"){let b=d?d+".":"";o.append(b+"x","0"),o.append(b+"y","0")}else d&&o.append(d,y)}}else{if(it(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Mt,n=null,a=Ut,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}const qn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ya=null,Ja=null,ea="6";try{window.__reactRouterVersion=ea}catch{}function Ga(e,t){return createRouter({basename:t?.basename,future:se({},t?.future,{v7_prependBasename:!0}),history:createBrowserHistory({window:t?.window}),hydrationData:t?.hydrationData||Sr(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,unstable_dataStrategy:t?.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t?.unstable_patchRoutesOnNavigation,window:t?.window}).initialize()}function Xa(e,t){return createRouter({basename:t?.basename,future:se({},t?.future,{v7_prependBasename:!0}),history:createHashHistory({window:t?.window}),hydrationData:t?.hydrationData||Sr(),routes:e,mapRouteProperties:UNSAFE_mapRouteProperties,unstable_dataStrategy:t?.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t?.unstable_patchRoutesOnNavigation,window:t?.window}).initialize()}function Sr(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=se({},t,{errors:ta(t.errors)})),t}function ta(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new UNSAFE_ErrorResponseImpl(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack="",r[n]=o}}else r[n]=a;return r}const Er=oe.createContext({isTransitioning:!1}),Pr=oe.createContext(new Map),Pe=zt["startTransition"],Dr=Kr["flushSync"],xr=zt["useId"];function ra(e){Pe?Pe(e):e()}function Xe(e){Dr?Dr(e):e()}class na{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function ei(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=React.useState(r.state),[i,c]=React.useState(),[u,d]=React.useState({isTransitioning:!1}),[p,y]=React.useState(),[b,m]=React.useState(),[w,R]=React.useState(),E=React.useRef(new Map),{v7_startTransition:F}=n||{},D=React.useCallback(f=>{F?ra(f):f()},[F]),L=React.useCallback((f,U)=>{let{deletedFetchers:O,unstable_flushSync:N,unstable_viewTransitionOpts:G}=U;O.forEach(ee=>E.current.delete(ee)),f.fetchers.forEach((ee,De)=>{ee.data!==void 0&&E.current.set(De,ee.data)});let ae=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!G||ae){N?Xe(()=>o(f)):D(()=>o(f));return}if(N){Xe(()=>{b&&(p&&p.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let ee=r.window.document.startViewTransition(()=>{Xe(()=>o(f))});ee.finished.finally(()=>{Xe(()=>{y(void 0),m(void 0),c(void 0),d({isTransitioning:!1})})}),Xe(()=>m(ee));return}b?(p&&p.resolve(),b.skipTransition(),R({state:f,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(c(f),d({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[r.window,b,p,E,D]);React.useLayoutEffect(()=>r.subscribe(L),[r,L]),React.useEffect(()=>{u.isTransitioning&&!u.flushSync&&y(new na)},[u]),React.useEffect(()=>{if(p&&i&&r.window){let f=i,U=p.promise,O=r.window.document.startViewTransition(async()=>{D(()=>o(f)),await U});O.finished.finally(()=>{y(void 0),m(void 0),c(void 0),d({isTransitioning:!1})}),m(O)}},[D,i,p,r.window]),React.useEffect(()=>{p&&i&&a.location.key===i.location.key&&p.resolve()},[p,b,a.location,i]),React.useEffect(()=>{!u.isTransitioning&&w&&(c(w.state),d({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),R(void 0))},[u.isTransitioning,w]),React.useEffect(()=>{},[]);let g=React.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:f=>r.navigate(f),push:(f,U,O)=>r.navigate(f,{state:U,preventScrollReset:O?.preventScrollReset}),replace:(f,U,O)=>r.navigate(f,{replace:!0,state:U,preventScrollReset:O?.preventScrollReset})}),[r]),j=r.basename||"/",H=React.useMemo(()=>({router:r,navigator:g,static:!1,basename:j}),[r,g,j]),A=React.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return React.createElement(React.Fragment,null,React.createElement(UNSAFE_DataRouterContext.Provider,{value:H},React.createElement(UNSAFE_DataRouterStateContext.Provider,{value:a},React.createElement(Pr.Provider,{value:E.current},React.createElement(Er.Provider,{value:u},React.createElement(Router,{basename:j,location:a.location,navigationType:a.historyAction,navigator:g,future:A},a.initialized||r.future.v7_partialHydration?React.createElement(aa,{routes:r.routes,future:r.future,state:a}):t))))),null)}const aa=null;function ti(e){let{routes:t,future:r,state:n}=e;return UNSAFE_useRoutesImpl(t,void 0,n,r)}function ia(e){let{basename:t,children:r,future:n,window:a}=e,o=oe.useRef();o.current==null&&(o.current=Vr({window:a,v5Compat:!0}));let i=o.current,[c,u]=oe.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},p=oe.useCallback(y=>{d&&Pe?Pe(()=>u(y)):u(y)},[u,d]);return oe.useLayoutEffect(()=>i.listen(p),[i,p]),oe.createElement(Oe.Ix,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:i,future:n})}function ri(e){let{basename:t,children:r,future:n,window:a}=e,o=React.useRef();o.current==null&&(o.current=createHashHistory({window:a,v5Compat:!0}));let i=o.current,[c,u]=React.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},p=React.useCallback(y=>{d&&Pe?Pe(()=>u(y)):u(y)},[u,d]);return React.useLayoutEffect(()=>i.listen(p),[i,p]),React.createElement(Router,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:i,future:n})}function ni(e){let{basename:t,children:r,future:n,history:a}=e,[o,i]=React.useState({action:a.action,location:a.location}),{v7_startTransition:c}=n||{},u=React.useCallback(d=>{c&&Pe?Pe(()=>i(d)):i(d)},[i,c]);return React.useLayoutEffect(()=>a.listen(u),[a,u]),React.createElement(Router,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const oa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",la=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sa=oe.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:c,target:u,to:d,preventScrollReset:p,unstable_viewTransition:y}=t,b=Wn(t,qn),{basename:m}=oe.useContext(Oe.jb),w,R=!1;if(typeof d=="string"&&la.test(d)&&(w=d,oa))try{let L=new URL(window.location.href),g=d.startsWith("//")?new URL(L.protocol+d):new URL(d),j=Ve(g.pathname,m);g.origin===L.origin&&j!=null?d=j+g.search+g.hash:R=!0}catch{}let E=(0,Oe.$P)(d,{relative:a}),F=ca(d,{replace:i,state:c,target:u,preventScrollReset:p,relative:a,unstable_viewTransition:y});function D(L){n&&n(L),L.defaultPrevented||F(L)}return oe.createElement("a",se({},b,{href:w||E,onClick:R||o?n:D,ref:r,target:u}))}),ai=null,ua=null;function ii(e){let{getKey:t,storageKey:r}=e;return ma({getKey:t,storageKey:r}),null}var ze;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ze||(ze={}));var Qe;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qe||(Qe={}));function oi(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function lt(e){let t=React.useContext(UNSAFE_DataRouterContext);return t||UNSAFE_invariant(!1),t}function It(e){let t=React.useContext(UNSAFE_DataRouterStateContext);return t||UNSAFE_invariant(!1),t}function ca(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,u=(0,Oe.Zp)(),d=(0,Oe.zy)(),p=(0,Oe.x$)(e,{relative:i});return oe.useCallback(y=>{if(Jn(y,r)){y.preventDefault();let b=n!==void 0?n:(0,Bt.AO)(d)===(0,Bt.AO)(p);u(e,{replace:b,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c})}},[d,u,p,n,a,r,e,o,i,c])}function li(e){let t=React.useRef(At(e)),r=React.useRef(!1),n=useLocation(),a=React.useMemo(()=>Gn(n.search,r.current?null:t.current),[n.search]),o=useNavigate(),i=React.useCallback((c,u)=>{const d=At(typeof c=="function"?c(a):c);r.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function da(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let fa=0,Lr=()=>"__"+String(++fa)+"__";function ha(){let{router:e}=lt(ze.UseSubmit),{basename:t}=React.useContext(UNSAFE_NavigationContext),r=UNSAFE_useRouteId();return React.useCallback(function(n,a){a===void 0&&(a={}),da();let{action:o,method:i,encType:c,formData:u,body:d}=Zn(n,t);if(a.navigate===!1){let p=a.fetcherKey||Lr();e.fetch(p,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function si(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=React.useContext(UNSAFE_NavigationContext),a=React.useContext(UNSAFE_RouteContext);a||UNSAFE_invariant(!1);let[o]=a.matches.slice(-1),i=se({},useResolvedPath(e||".",{relative:r})),c=useLocation();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:joinPaths([n,i.pathname])),createPath(i)}function ui(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=lt(ze.UseFetcher),a=It(Qe.UseFetcher),o=React.useContext(Pr),i=React.useContext(UNSAFE_RouteContext),c=(t=i.matches[i.matches.length-1])==null?void 0:t.route.id;o||UNSAFE_invariant(!1),i||UNSAFE_invariant(!1),c==null&&UNSAFE_invariant(!1);let u=xr?xr():"",[d,p]=React.useState(r||u);r&&r!==d?p(r):d||p(Lr()),React.useEffect(()=>(n.getFetcher(d),()=>{n.deleteFetcher(d)}),[n,d]);let y=React.useCallback((D,L)=>{c||UNSAFE_invariant(!1),n.fetch(d,c,D,L)},[d,c,n]),b=ha(),m=React.useCallback((D,L)=>{b(D,se({},L,{navigate:!1,fetcherKey:d}))},[d,b]),w=React.useMemo(()=>React.forwardRef((L,g)=>React.createElement(ua,se({},L,{navigate:!1,fetcherKey:d,ref:g}))),[d]),R=a.fetchers.get(d)||IDLE_FETCHER,E=o.get(d);return React.useMemo(()=>se({Form:w,submit:m,load:y},R,{data:E}),[w,m,y,R,E])}function ci(){let e=It(Qe.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[r,n]=t;return se({},n,{key:r})})}const Tr="react-router-scroll-positions";let st={};function ma(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=lt(ze.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=It(Qe.UseScrollRestoration),{basename:i}=React.useContext(UNSAFE_NavigationContext),c=useLocation(),u=useMatches(),d=useNavigation();React.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),pa(React.useCallback(()=>{if(d.state==="idle"){let p=(t?t(c,u):null)||c.key;st[p]=window.scrollY}try{sessionStorage.setItem(r||Tr,JSON.stringify(st))}catch{}window.history.scrollRestoration="auto"},[r,t,d.state,c,u])),typeof document<"u"&&(React.useLayoutEffect(()=>{try{let p=sessionStorage.getItem(r||Tr);p&&(st=JSON.parse(p))}catch{}},[r]),React.useLayoutEffect(()=>{let p=t&&i!=="/"?(b,m)=>t(se({},b,{pathname:stripBasename(b.pathname,i)||b.pathname}),m):t,y=n?.enableScrollRestoration(st,()=>window.scrollY,p);return()=>y&&y()},[n,i,t]),React.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(c.hash){let p=document.getElementById(decodeURIComponent(c.hash.slice(1)));if(p){p.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[c,a,o]))}function di(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}function pa(e,t){let{capture:r}=t||{};React.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function fi(e){let{when:t,message:r}=e,n=useBlocker(t);React.useEffect(()=>{n.state==="blocked"&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),React.useEffect(()=>{n.state==="blocked"&&!t&&n.reset()},[n,t])}function hi(e,t){t===void 0&&(t={});let r=React.useContext(Er);r==null&&UNSAFE_invariant(!1);let{basename:n}=lt(ze.useViewTransitionState),a=useResolvedPath(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=stripBasename(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=stripBasename(r.nextLocation.pathname,n)||r.nextLocation.pathname;return matchPath(a.pathname,i)!=null||matchPath(a.pathname,o)!=null}}}]);})();
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=module-react-router-dom.bf7ca63f.js.map
|