@techdocs/cli 1.8.21 → 1.8.22-next.1

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -3
  2. package/dist/embedded-app/.config-schema.json +186 -0
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/index.html.tmpl +1 -1
  5. package/dist/embedded-app/static/{124.b47d39f0.chunk.js → 124.bf989b54.chunk.js} +1 -1
  6. package/dist/embedded-app/static/{124.b47d39f0.chunk.js.map → 124.bf989b54.chunk.js.map} +1 -1
  7. package/dist/embedded-app/static/{1297.bdbb2ab3.chunk.js → 1297.5286dfc5.chunk.js} +1 -1
  8. package/dist/embedded-app/static/{1297.bdbb2ab3.chunk.js.map → 1297.5286dfc5.chunk.js.map} +1 -1
  9. package/dist/embedded-app/static/{2177.e1184707.chunk.js → 2177.5218bd9b.chunk.js} +1 -1
  10. package/dist/embedded-app/static/{2177.e1184707.chunk.js.map → 2177.5218bd9b.chunk.js.map} +1 -1
  11. package/dist/embedded-app/static/{2401.35bcb315.chunk.js → 2401.1dc679e2.chunk.js} +1 -1
  12. package/dist/embedded-app/static/{2401.35bcb315.chunk.js.map → 2401.1dc679e2.chunk.js.map} +1 -1
  13. package/dist/embedded-app/static/{2420.860e0793.chunk.js → 2420.c2c4fb34.chunk.js} +1 -1
  14. package/dist/embedded-app/static/{2420.860e0793.chunk.js.map → 2420.c2c4fb34.chunk.js.map} +1 -1
  15. package/dist/embedded-app/static/{287.47551c87.chunk.js → 287.2ab77cb3.chunk.js} +1 -1
  16. package/dist/embedded-app/static/{287.47551c87.chunk.js.map → 287.2ab77cb3.chunk.js.map} +1 -1
  17. package/dist/embedded-app/static/{3182.98e9d2a1.chunk.js → 3182.b8a79377.chunk.js} +1 -1
  18. package/dist/embedded-app/static/{3182.98e9d2a1.chunk.js.map → 3182.b8a79377.chunk.js.map} +1 -1
  19. package/dist/embedded-app/static/{3632.9a960ad0.chunk.js → 3632.de80939d.chunk.js} +1 -1
  20. package/dist/embedded-app/static/{3632.9a960ad0.chunk.js.map → 3632.de80939d.chunk.js.map} +1 -1
  21. package/dist/embedded-app/static/{4036.c70fd6f0.chunk.js → 4036.a7456a2d.chunk.js} +1 -1
  22. package/dist/embedded-app/static/{4036.c70fd6f0.chunk.js.map → 4036.a7456a2d.chunk.js.map} +1 -1
  23. package/dist/embedded-app/static/{4487.e5c9da4f.chunk.js → 4487.bd329be6.chunk.js} +1 -1
  24. package/dist/embedded-app/static/{4487.e5c9da4f.chunk.js.map → 4487.bd329be6.chunk.js.map} +1 -1
  25. package/dist/embedded-app/static/{5724.3b064b18.chunk.js → 5724.0f3b3ce6.chunk.js} +1 -1
  26. package/dist/embedded-app/static/{5724.3b064b18.chunk.js.map → 5724.0f3b3ce6.chunk.js.map} +1 -1
  27. package/dist/embedded-app/static/{6271.eb3d4c17.chunk.js → 6271.2f62fb0b.chunk.js} +1 -1
  28. package/dist/embedded-app/static/{6271.eb3d4c17.chunk.js.map → 6271.2f62fb0b.chunk.js.map} +1 -1
  29. package/dist/embedded-app/static/{6415.f399ab03.chunk.js → 6415.3b0fd3d0.chunk.js} +1 -1
  30. package/dist/embedded-app/static/{6415.f399ab03.chunk.js.map → 6415.3b0fd3d0.chunk.js.map} +1 -1
  31. package/dist/embedded-app/static/{8307.39e989c7.chunk.js → 8307.a297621e.chunk.js} +1 -1
  32. package/dist/embedded-app/static/{8307.39e989c7.chunk.js.map → 8307.a297621e.chunk.js.map} +1 -1
  33. package/dist/embedded-app/static/{8384.1a62b18a.chunk.js → 8384.a571926d.chunk.js} +1 -1
  34. package/dist/embedded-app/static/{8384.1a62b18a.chunk.js.map → 8384.a571926d.chunk.js.map} +1 -1
  35. package/dist/embedded-app/static/{9234.e3ee67ee.chunk.js → 9234.921d36f1.chunk.js} +1 -1
  36. package/dist/embedded-app/static/{9234.e3ee67ee.chunk.js.map → 9234.921d36f1.chunk.js.map} +1 -1
  37. package/dist/embedded-app/static/{9605.6d4a0d4f.chunk.js → 9605.79eaa6f9.chunk.js} +1 -1
  38. package/dist/embedded-app/static/{9605.6d4a0d4f.chunk.js.map → 9605.79eaa6f9.chunk.js.map} +1 -1
  39. package/dist/embedded-app/static/{9652.4e8f3b00.chunk.js → 9652.62cbe616.chunk.js} +1 -1
  40. package/dist/embedded-app/static/{9652.4e8f3b00.chunk.js.map → 9652.62cbe616.chunk.js.map} +1 -1
  41. package/dist/embedded-app/static/main.995b65c9.js +553 -0
  42. package/dist/embedded-app/static/main.995b65c9.js.map +1 -0
  43. package/dist/embedded-app/static/module-remix-run.e7427c94.js +13 -0
  44. package/dist/embedded-app/static/module-remix-run.e7427c94.js.map +1 -0
  45. package/dist/embedded-app/static/{runtime.9768e58f.js → runtime.995b65c9.js} +2 -2
  46. package/dist/embedded-app/static/{runtime.9768e58f.js.map → runtime.995b65c9.js.map} +1 -1
  47. package/dist/embedded-app/static/vendor.995b65c9.js +170 -0
  48. package/dist/embedded-app/static/vendor.995b65c9.js.map +1 -0
  49. package/dist/package.json.cjs.js +1 -1
  50. package/package.json +8 -8
  51. package/dist/embedded-app/static/main.9768e58f.js +0 -553
  52. package/dist/embedded-app/static/main.9768e58f.js.map +0 -1
  53. package/dist/embedded-app/static/module-remix-run.e486ee73.js +0 -14
  54. package/dist/embedded-app/static/module-remix-run.e486ee73.js.map +0 -1
  55. package/dist/embedded-app/static/vendor.9768e58f.js +0 -169
  56. package/dist/embedded-app/static/vendor.9768e58f.js.map +0 -1
@@ -1,14 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[4538],{21613:(In,wr,br)=>{br.d(wr,{AO:()=>se,Gh:()=>Ot,HS:()=>_e,Oi:()=>H,Rr:()=>oe,o1:()=>jt,pX:()=>Oe,pb:()=>Be,rc:()=>V,sC:()=>Rr,tH:()=>ft,tW:()=>Ar,ue:()=>fe,yD:()=>_t,zR:()=>Dr});/**
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 A(){return A=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},A.apply(this,arguments)}var V;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(V||(V={}));const Et="popstate";function Rr(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((h,R)=>v(h,typeof h=="string"?null:h.state,R===0?"default":void 0));let s=u(r??a.length-1),l=V.Pop,f=null;function u(h){return Math.min(Math.max(h,0),a.length-1)}function p(){return a[s]}function v(h,R,w){R===void 0&&(R=null);let P=ue(a?p().pathname:"/",h,R,w);return de(P.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),P}function y(h){return typeof h=="string"?h:se(h)}return{get index(){return s},get action(){return l},get location(){return p()},createHref:y,createURL(h){return new URL(y(h),"http://localhost")},encodeLocation(h){let R=typeof h=="string"?oe(h):h;return{pathname:R.pathname||"",search:R.search||"",hash:R.hash||""}},push(h,R){l=V.Push;let w=v(h,R);s+=1,a.splice(s,a.length,w),n&&f&&f({action:l,location:w,delta:1})},replace(h,R){l=V.Replace;let w=v(h,R);a[s]=w,n&&f&&f({action:l,location:w,delta:0})},go(h){l=V.Pop;let R=u(s+h),w=a[R];s=R,f&&f({action:l,location:w,delta:h})},listen(h){return f=h,()=>{f=null}}}}function Dr(e){e===void 0&&(e={});function t(n,a){let{pathname:s,search:l,hash:f}=n.location;return ue("",{pathname:s,search:l,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:se(a)}return xt(t,r,null,e)}function An(e){e===void 0&&(e={});function t(a,s){let{pathname:l="/",search:f="",hash:u=""}=oe(a.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),ue("",{pathname:l,search:f,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(a,s){let l=a.document.querySelector("base"),f="";if(l&&l.getAttribute("href")){let u=a.location.href,p=u.indexOf("#");f=p===-1?u:u.slice(0,p)}return f+"#"+(typeof s=="string"?s:se(s))}function n(a,s){de(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return xt(t,r,n,e)}function H(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function de(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Sr(){return Math.random().toString(36).substr(2,8)}function Pt(e,t){return{usr:e.state,key:e.key,idx:t}}function ue(e,t,r,n){return r===void 0&&(r=null),A({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?oe(t):t,{state:r,key:t&&t.key||n||Sr()})}function se(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 oe(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 xt(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:s=!1}=n,l=a.history,f=V.Pop,u=null,p=v();p==null&&(p=0,l.replaceState(A({},l.state,{idx:p}),""));function v(){return(l.state||{idx:null}).idx}function y(){f=V.Pop;let P=v(),F=P==null?null:P-p;p=P,u&&u({action:f,location:w.location,delta:F})}function E(P,F){f=V.Push;let M=ue(w.location,P,F);r&&r(M,P),p=v()+1;let _=Pt(M,p),g=w.createHref(M);try{l.pushState(_,"",g)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;a.location.assign(g)}s&&u&&u({action:f,location:w.location,delta:1})}function h(P,F){f=V.Replace;let M=ue(w.location,P,F);r&&r(M,P),p=v();let _=Pt(M,p),g=w.createHref(M);l.replaceState(_,"",g),s&&u&&u({action:f,location:w.location,delta:0})}function R(P){let F=a.location.origin!=="null"?a.location.origin:a.location.href,M=typeof P=="string"?P:se(P);return M=M.replace(/ $/,"%20"),H(F,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,F)}let w={get action(){return f},get location(){return e(a,l)},listen(P){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(Et,y),u=P,()=>{a.removeEventListener(Et,y),u=null}},createHref(P){return t(a,P)},createURL:R,encodeLocation(P){let F=R(P);return{pathname:F.pathname,search:F.search,hash:F.hash}},push:E,replace:h,go(P){return l.go(P)}};return w}var z;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(z||(z={}));const Er=new Set(["lazy","caseSensitive","path","id","index","children"]);function Pr(e){return e.index===!0}function Fe(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,s)=>{let l=[...r,String(s)],f=typeof a.id=="string"?a.id:l.join("-");if(H(a.index!==!0||!a.children,"Cannot specify children on an index route"),H(!n[f],'Found a route id collision on id "'+f+`". Route id's must be globally unique within Data Router usages`),Pr(a)){let u=A({},a,t(a),{id:f});return n[f]=u,u}else{let u=A({},a,t(a),{id:f,children:void 0});return n[f]=u,a.children&&(u.children=Fe(a.children,t,l,n)),u}})}function fe(e,t,r){return r===void 0&&(r="/"),Je(e,t,r,!1)}function Je(e,t,r,n){let a=typeof t=="string"?oe(t):t,s=Be(a.pathname||"/",r);if(s==null)return null;let l=Lt(e);Lr(l);let f=null;for(let u=0;f==null&&u<l.length;++u){let p=zr(s);f=Ir(l[u],p,n)}return f}function xr(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 Lt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(s,l,f)=>{let u={relativePath:f===void 0?s.path||"":f,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};u.relativePath.startsWith("/")&&(H(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 p=_e([n,u.relativePath]),v=r.concat(u);s.children&&s.children.length>0&&(H(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),Lt(s.children,t,v,p)),!(s.path==null&&!s.index)&&t.push({path:p,score:Or(p,s.index),routesMeta:v})};return e.forEach((s,l)=>{var f;if(s.path===""||!((f=s.path)!=null&&f.includes("?")))a(s,l);else for(let u of Mt(s.path))a(s,l,u)}),t}function Mt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return a?[s,""]:[s];let l=Mt(n.join("/")),f=[];return f.push(...l.map(u=>u===""?s:[s,u].join("/"))),a&&f.push(...l),f.map(u=>e.startsWith("/")&&u===""?"/":u)}function Lr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ur(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Mr=/^:[\w-]+$/,Tr=3,Cr=2,jr=1,Fr=10,_r=-2,Tt=e=>e==="*";function Or(e,t){let r=e.split("/"),n=r.length;return r.some(Tt)&&(n+=_r),t&&(n+=Cr),r.filter(a=>!Tt(a)).reduce((a,s)=>a+(Mr.test(s)?Tr:s===""?jr:Fr),n)}function Ur(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 Ir(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},s="/",l=[];for(let f=0;f<n.length;++f){let u=n[f],p=f===n.length-1,v=s==="/"?t:t.slice(s.length)||"/",y=Ct({path:u.relativePath,caseSensitive:u.caseSensitive,end:p},v),E=u.route;if(!y&&p&&r&&!n[n.length-1].route.index&&(y=Ct({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},v)),!y)return null;Object.assign(a,y.params),l.push({params:a,pathname:_e([s,y.pathname]),pathnameBase:Br(_e([s,y.pathnameBase])),route:E}),y.pathnameBase!=="/"&&(s=_e([s,y.pathnameBase]))}return l}function Ar(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(de(!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=l=>l==null?"":typeof l=="string"?l:String(l),s=r.split(/\/+/).map((l,f,u)=>{if(f===u.length-1&&l==="*")return a(t["*"]);const v=l.match(/^:([\w-]+)(\??)$/);if(v){const[,y,E]=v;let h=t[y];return H(E==="?"||h!=null,'Missing ":'+y+'" param'),a(h)}return l.replace(/\?$/g,"")}).filter(l=>!!l);return n+s.join("/")}function Ct(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Hr(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let s=a[0],l=s.replace(/(.)\/+$/,"$1"),f=a.slice(1);return{params:n.reduce((p,v,y)=>{let{paramName:E,isOptional:h}=v;if(E==="*"){let w=f[y]||"";l=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const R=f[y];return h&&!R?p[E]=void 0:p[E]=(R||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function Hr(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),de(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,(l,f,u)=>(n.push({paramName:f,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 zr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return de(!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 Be(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 jt(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?oe(e):e;return{pathname:r?r.startsWith("/")?r:Nr(r,t):t,search:Wr(n),hash:kr(a)}}function Nr(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 ut(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 Ft(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _t(e,t){let r=Ft(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ot(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=oe(e):(a=A({},e),H(!a.pathname||!a.pathname.includes("?"),ut("?","pathname","search",a)),H(!a.pathname||!a.pathname.includes("#"),ut("#","pathname","hash",a)),H(!a.search||!a.search.includes("#"),ut("#","search","hash",a)));let s=e===""||a.pathname==="",l=s?"/":a.pathname,f;if(l==null)f=r;else{let y=t.length-1;if(!n&&l.startsWith("..")){let E=l.split("/");for(;E[0]==="..";)E.shift(),y-=1;a.pathname=E.join("/")}f=y>=0?t[y]:"/"}let u=jt(a,f),p=l&&l!=="/"&&l.endsWith("/"),v=(s||l===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(p||v)&&(u.pathname+="/"),u}function Hn(e){return e===""||e.pathname===""?"/":typeof e=="string"?oe(e).pathname:e.pathname}const _e=e=>e.join("/").replace(/\/\/+/g,"/"),Br=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zn=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),A({},n,{headers:a}))};class Kr{constructor(t,r){this.type="DataWithResponseInit",this.data=t,this.init=r||null}}function Nn(e,t){return new Kr(e,typeof t=="number"?{status:t}:t)}class ft extends Error{}class $r{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],H(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((s,l)=>n=l),this.controller=new AbortController;let a=()=>n(new ft("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((s,l)=>{let[f,u]=l;return Object.assign(s,{[f]:this.trackPromise(f,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 ft)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 s=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:()=>s}),this.emit(!1,r),Promise.reject(s)}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(s=>{t.removeEventListener("abort",n),(s||this.done)&&a(s)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return H(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]:Yr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Vr(e){return e instanceof Promise&&e._tracked===!0}function Yr(e){if(!Vr(e))return e;if(e._error)throw e._error;return e._data}const Bn=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new $r(t,n)},Ut=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,A({},n,{headers:a}))},Wn=(e,t)=>{let r=Ut(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},kn=(e,t)=>{let r=Ut(e,t);return r.headers.set("X-Remix-Replace","true"),r};class ct{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 Oe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const It=["post","put","patch","delete"],Jr=new Set(It),Xr=["get",...It],Gr=new Set(Xr),Qr=new Set([301,302,303,307,308]),Zr=new Set([307,308]),ht={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},We={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},pt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,At=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ht="remix-router-transitions";function Kn(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;H(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 i=e.detectErrorBoundary;a=o=>({hasErrorBoundary:i(o)})}else a=At;let s={},l=Fe(e.routes,a,void 0,s),f,u=e.basename||"/",p=e.unstable_dataStrategy||Vt,v=e.unstable_patchRoutesOnNavigation,y=A({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),E=null,h=new Set,R=1e3,w=new Set,P=null,F=null,M=null,_=e.hydrationData!=null,g=fe(l,e.history.location,u),K=null;if(g==null&&!v){let i=Y(404,{pathname:e.history.location.pathname}),{matches:o,route:d}=Xe(l);g=o,K={[d.id]:i}}g&&!e.hydrationData&&at(g,l,e.history.location.pathname).active&&(g=null);let B;if(g)if(g.some(i=>i.route.lazy))B=!1;else if(!g.some(i=>i.route.loader))B=!0;else if(y.v7_partialHydration){let i=e.hydrationData?e.hydrationData.loaderData:null,o=e.hydrationData?e.hydrationData.errors:null,d=m=>m.route.loader?typeof m.route.loader=="function"&&m.route.loader.hydrate===!0?!1:i&&i[m.route.id]!==void 0||o&&o[m.route.id]!==void 0:!0;if(o){let m=g.findIndex(D=>o[D.route.id]!==void 0);B=g.slice(0,m+1).every(d)}else B=g.every(d)}else B=e.hydrationData!=null;else if(B=!1,g=[],y.v7_partialHydration){let i=at(null,l,e.history.location.pathname);i.active&&i.matches&&(g=i.matches)}let O,c={historyAction:e.history.action,location:e.history.location,matches:g,initialized:B,navigation:ht,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||K,fetchers:new Map,blockers:new Map},I=V.Pop,J=!1,U,te=!1,ie=new Map,le=null,Ie=!1,Le=!1,Qe=[],Ze=new Set,Q=new Map,qe=0,Ke=-1,Ae=new Map,he=new Set,He=new Map,$e=new Map,pe=new Set,Me=new Map,Te=new Map,vn=new Map,et;function wn(){if(E=e.history.listen(i=>{let{action:o,location:d,delta:m}=i;if(et){et(),et=void 0;return}de(Te.size===0||m!=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 D=pr({currentLocation:c.location,nextLocation:d,historyAction:o});if(D&&m!=null){let L=new Promise(C=>{et=C});e.history.go(m*-1),rt(D,{state:"blocked",location:d,proceed(){rt(D,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),L.then(()=>e.history.go(m))},reset(){let C=new Map(c.blockers);C.set(D,We),re({blockers:C})}});return}return Ce(o,d)}),r){yn(t,ie);let i=()=>gn(t,ie);t.addEventListener("pagehide",i),le=()=>t.removeEventListener("pagehide",i)}return c.initialized||Ce(V.Pop,c.location,{initialHydration:!0}),O}function bn(){E&&E(),le&&le(),h.clear(),U&&U.abort(),c.fetchers.forEach((i,o)=>tt(o)),c.blockers.forEach((i,o)=>hr(o))}function Rn(i){return h.add(i),()=>h.delete(i)}function re(i,o){o===void 0&&(o={}),c=A({},c,i);let d=[],m=[];y.v7_fetcherPersist&&c.fetchers.forEach((D,L)=>{D.state==="idle"&&(pe.has(L)?m.push(L):d.push(L))}),[...h].forEach(D=>D(c,{deletedFetchers:m,unstable_viewTransitionOpts:o.viewTransitionOpts,unstable_flushSync:o.flushSync===!0})),y.v7_fetcherPersist&&(d.forEach(D=>c.fetchers.delete(D)),m.forEach(D=>tt(D)))}function ze(i,o,d){var m,D;let{flushSync:L}=d===void 0?{}:d,C=c.actionData!=null&&c.navigation.formMethod!=null&&ae(c.navigation.formMethod)&&c.navigation.state==="loading"&&((m=i.state)==null?void 0:m._isRedirect)!==!0,b;o.actionData?Object.keys(o.actionData).length>0?b=o.actionData:b=null:C?b=c.actionData:b=null;let T=o.loaderData?er(c.loaderData,o.loaderData,o.matches||[],o.errors):c.loaderData,S=c.blockers;S.size>0&&(S=new Map(S),S.forEach((k,$)=>S.set($,We)));let x=J===!0||c.navigation.formMethod!=null&&ae(c.navigation.formMethod)&&((D=i.state)==null?void 0:D._isRedirect)!==!0;f&&(l=f,f=void 0),Ie||I===V.Pop||(I===V.Push?e.history.push(i,i.state):I===V.Replace&&e.history.replace(i,i.state));let W;if(I===V.Pop){let k=ie.get(c.location.pathname);k&&k.has(i.pathname)?W={currentLocation:c.location,nextLocation:i}:ie.has(i.pathname)&&(W={currentLocation:i,nextLocation:c.location})}else if(te){let k=ie.get(c.location.pathname);k?k.add(i.pathname):(k=new Set([i.pathname]),ie.set(c.location.pathname,k)),W={currentLocation:c.location,nextLocation:i}}re(A({},o,{actionData:b,loaderData:T,historyAction:I,location:i,initialized:!0,navigation:ht,revalidation:"idle",restoreScrollPosition:yr(i,o.matches||c.matches),preventScrollReset:x,blockers:S}),{viewTransitionOpts:W,flushSync:L===!0}),I=V.Pop,J=!1,te=!1,Ie=!1,Le=!1,Qe=[]}async function or(i,o){if(typeof i=="number"){e.history.go(i);return}let d=mt(c.location,c.matches,u,y.v7_prependBasename,i,y.v7_relativeSplatPath,o?.fromRouteId,o?.relative),{path:m,submission:D,error:L}=Nt(y.v7_normalizeFormMethod,!1,d,o),C=c.location,b=ue(c.location,m,o&&o.state);b=A({},b,e.history.encodeLocation(b));let T=o&&o.replace!=null?o.replace:void 0,S=V.Push;T===!0?S=V.Replace:T===!1||D!=null&&ae(D.formMethod)&&D.formAction===c.location.pathname+c.location.search&&(S=V.Replace);let x=o&&"preventScrollReset"in o?o.preventScrollReset===!0:void 0,W=(o&&o.unstable_flushSync)===!0,k=pr({currentLocation:C,nextLocation:b,historyAction:S});if(k){rt(k,{state:"blocked",location:b,proceed(){rt(k,{state:"proceeding",proceed:void 0,reset:void 0,location:b}),or(i,o)},reset(){let $=new Map(c.blockers);$.set(k,We),re({blockers:$})}});return}return await Ce(S,b,{submission:D,pendingError:L,preventScrollReset:x,replace:o&&o.replace,enableViewTransition:o&&o.unstable_viewTransition,flushSync:W})}function Dn(){if(Rt(),re({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){Ce(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}Ce(I||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation,enableViewTransition:te===!0})}}async function Ce(i,o,d){U&&U.abort(),U=null,I=i,Ie=(d&&d.startUninterruptedRevalidation)===!0,Fn(c.location,c.matches),J=(d&&d.preventScrollReset)===!0,te=(d&&d.enableViewTransition)===!0;let m=f||l,D=d&&d.overrideNavigation,L=fe(m,o,u),C=(d&&d.flushSync)===!0,b=at(L,m,o.pathname);if(b.active&&b.matches&&(L=b.matches),!L){let{error:N,notFoundMatches:q,route:Z}=Dt(o.pathname);ze(o,{matches:q,loaderData:{},errors:{[Z.id]:N}},{flushSync:C});return}if(c.initialized&&!Le&&ln(c.location,o)&&!(d&&d.submission&&ae(d.submission.formMethod))){ze(o,{matches:L},{flushSync:C});return}U=new AbortController;let T=Ue(e.history,o,U.signal,d&&d.submission),S;if(d&&d.pendingError)S=[Pe(L).route.id,{type:z.error,error:d.pendingError}];else if(d&&d.submission&&ae(d.submission.formMethod)){let N=await Sn(T,o,d.submission,L,b.active,{replace:d.replace,flushSync:C});if(N.shortCircuited)return;if(N.pendingActionResult){let[q,Z]=N.pendingActionResult;if(ee(Z)&&Oe(Z.error)&&Z.error.status===404){U=null,ze(o,{matches:N.matches,loaderData:{},errors:{[q]:Z.error}});return}}L=N.matches||L,S=N.pendingActionResult,D=bt(o,d.submission),C=!1,b.active=!1,T=Ue(e.history,T.url,T.signal)}let{shortCircuited:x,matches:W,loaderData:k,errors:$}=await En(T,o,L,b.active,D,d&&d.submission,d&&d.fetcherSubmission,d&&d.replace,d&&d.initialHydration===!0,C,S);x||(U=null,ze(o,A({matches:W||L},tr(S),{loaderData:k,errors:$})))}async function Sn(i,o,d,m,D,L){L===void 0&&(L={}),Rt();let C=pn(o,d);if(re({navigation:C},{flushSync:L.flushSync===!0}),D){let S=await it(m,o.pathname,i.signal);if(S.type==="aborted")return{shortCircuited:!0};if(S.type==="error"){let{boundaryId:x,error:W}=nt(o.pathname,S);return{matches:S.partialMatches,pendingActionResult:[x,{type:z.error,error:W}]}}else if(S.matches)m=S.matches;else{let{notFoundMatches:x,error:W,route:k}=Dt(o.pathname);return{matches:x,pendingActionResult:[k.id,{type:z.error,error:W}]}}}let b,T=xe(m,o);if(!T.route.action&&!T.route.lazy)b={type:z.error,error:Y(405,{method:i.method,pathname:o.pathname,routeId:T.route.id})};else if(b=(await Ve("action",c,i,[T],m,null))[T.route.id],i.signal.aborted)return{shortCircuited:!0};if(we(b)){let S;return L&&L.replace!=null?S=L.replace:S=Gt(b.response.headers.get("Location"),new URL(i.url),u)===c.location.pathname+c.location.search,await je(i,b,!0,{submission:d,replace:S}),{shortCircuited:!0}}if(ce(b))throw Y(400,{type:"defer-action"});if(ee(b)){let S=Pe(m,T.route.id);return(L&&L.replace)!==!0&&(I=V.Push),{matches:m,pendingActionResult:[S.route.id,b]}}return{matches:m,pendingActionResult:[T.route.id,b]}}async function En(i,o,d,m,D,L,C,b,T,S,x){let W=D||bt(o,L),k=L||C||ir(W),$=!Ie&&(!y.v7_partialHydration||!T);if(m){if($){let X=lr(x);re(A({navigation:W},X!==void 0?{actionData:X}:{}),{flushSync:S})}let j=await it(d,o.pathname,i.signal);if(j.type==="aborted")return{shortCircuited:!0};if(j.type==="error"){let{boundaryId:X,error:ne}=nt(o.pathname,j);return{matches:j.partialMatches,loaderData:{},errors:{[X]:ne}}}else if(j.matches)d=j.matches;else{let{error:X,notFoundMatches:ne,route:G}=Dt(o.pathname);return{matches:ne,loaderData:{},errors:{[G.id]:X}}}}let N=f||l,[q,Z]=Wt(e.history,c,d,k,o,y.v7_partialHydration&&T===!0,y.v7_skipActionErrorRevalidation,Le,Qe,Ze,pe,He,he,N,u,x);if(St(j=>!(d&&d.some(X=>X.route.id===j))||q&&q.some(X=>X.route.id===j)),Ke=++qe,q.length===0&&Z.length===0){let j=fr();return ze(o,A({matches:d,loaderData:{},errors:x&&ee(x[1])?{[x[0]]:x[1].error}:null},tr(x),j?{fetchers:new Map(c.fetchers)}:{}),{flushSync:S}),{shortCircuited:!0}}if($){let j={};if(!m){j.navigation=W;let X=lr(x);X!==void 0&&(j.actionData=X)}Z.length>0&&(j.fetchers=Pn(Z)),re(j,{flushSync:S})}Z.forEach(j=>{Q.has(j.key)&&Se(j.key),j.controller&&Q.set(j.key,j.controller)});let Ye=()=>Z.forEach(j=>Se(j.key));U&&U.signal.addEventListener("abort",Ye);let{loaderResults:ye,fetcherResults:Ne}=await sr(c,d,q,Z,i);if(i.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ye),Z.forEach(j=>Q.delete(j.key));let Ee=Ge(ye);if(Ee)return await je(i,Ee.result,!0,{replace:b}),{shortCircuited:!0};if(Ee=Ge(Ne),Ee)return he.add(Ee.key),await je(i,Ee.result,!0,{replace:b}),{shortCircuited:!0};let{loaderData:ot,errors:ge}=qt(c,d,q,ye,x,Z,Ne,Me);Me.forEach((j,X)=>{j.subscribe(ne=>{(ne||j.done)&&Me.delete(X)})}),y.v7_partialHydration&&T&&c.errors&&Object.entries(c.errors).filter(j=>{let[X]=j;return!q.some(ne=>ne.route.id===X)}).forEach(j=>{let[X,ne]=j;ge=Object.assign(ge||{},{[X]:ne})});let lt=fr(),st=cr(Ke),dt=lt||st||Z.length>0;return A({matches:d,loaderData:ot,errors:ge},dt?{fetchers:new Map(c.fetchers)}:{})}function lr(i){if(i&&!ee(i[1]))return{[i[0]]:i[1].data};if(c.actionData)return Object.keys(c.actionData).length===0?null:c.actionData}function Pn(i){return i.forEach(o=>{let d=c.fetchers.get(o.key),m=ke(void 0,d?d.data:void 0);c.fetchers.set(o.key,m)}),new Map(c.fetchers)}function xn(i,o,d,m){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.");Q.has(i)&&Se(i);let D=(m&&m.unstable_flushSync)===!0,L=f||l,C=mt(c.location,c.matches,u,y.v7_prependBasename,d,y.v7_relativeSplatPath,o,m?.relative),b=fe(L,C,u),T=at(b,L,C);if(T.active&&T.matches&&(b=T.matches),!b){me(i,o,Y(404,{pathname:C}),{flushSync:D});return}let{path:S,submission:x,error:W}=Nt(y.v7_normalizeFormMethod,!0,C,m);if(W){me(i,o,W,{flushSync:D});return}let k=xe(b,S);if(J=(m&&m.preventScrollReset)===!0,x&&ae(x.formMethod)){Ln(i,o,S,k,b,T.active,D,x);return}He.set(i,{routeId:o,path:S}),Mn(i,o,S,k,b,T.active,D,x)}async function Ln(i,o,d,m,D,L,C,b){Rt(),He.delete(i);function T(G){if(!G.route.action&&!G.route.lazy){let ve=Y(405,{method:b.formMethod,pathname:d,routeId:o});return me(i,o,ve,{flushSync:C}),!0}return!1}if(!L&&T(m))return;let S=c.fetchers.get(i);De(i,mn(b,S),{flushSync:C});let x=new AbortController,W=Ue(e.history,d,x.signal,b);if(L){let G=await it(D,d,W.signal);if(G.type==="aborted")return;if(G.type==="error"){let{error:ve}=nt(d,G);me(i,o,ve,{flushSync:C});return}else if(G.matches){if(D=G.matches,m=xe(D,d),T(m))return}else{me(i,o,Y(404,{pathname:d}),{flushSync:C});return}}Q.set(i,x);let k=qe,N=(await Ve("action",c,W,[m],D,i))[m.route.id];if(W.signal.aborted){Q.get(i)===x&&Q.delete(i);return}if(y.v7_fetcherPersist&&pe.has(i)){if(we(N)||ee(N)){De(i,Re(void 0));return}}else{if(we(N))if(Q.delete(i),Ke>k){De(i,Re(void 0));return}else return he.add(i),De(i,ke(b)),je(W,N,!1,{fetcherSubmission:b});if(ee(N)){me(i,o,N.error);return}}if(ce(N))throw Y(400,{type:"defer-action"});let q=c.navigation.location||c.location,Z=Ue(e.history,q,x.signal),Ye=f||l,ye=c.navigation.state!=="idle"?fe(Ye,c.navigation.location,u):c.matches;H(ye,"Didn't find any matches after fetcher action");let Ne=++qe;Ae.set(i,Ne);let Ee=ke(b,N.data);c.fetchers.set(i,Ee);let[ot,ge]=Wt(e.history,c,ye,b,q,!1,y.v7_skipActionErrorRevalidation,Le,Qe,Ze,pe,He,he,Ye,u,[m.route.id,N]);ge.filter(G=>G.key!==i).forEach(G=>{let ve=G.key,vr=c.fetchers.get(ve),Un=ke(void 0,vr?vr.data:void 0);c.fetchers.set(ve,Un),Q.has(ve)&&Se(ve),G.controller&&Q.set(ve,G.controller)}),re({fetchers:new Map(c.fetchers)});let lt=()=>ge.forEach(G=>Se(G.key));x.signal.addEventListener("abort",lt);let{loaderResults:st,fetcherResults:dt}=await sr(c,ye,ot,ge,Z);if(x.signal.aborted)return;x.signal.removeEventListener("abort",lt),Ae.delete(i),Q.delete(i),ge.forEach(G=>Q.delete(G.key));let j=Ge(st);if(j)return je(Z,j.result,!1);if(j=Ge(dt),j)return he.add(j.key),je(Z,j.result,!1);let{loaderData:X,errors:ne}=qt(c,ye,ot,st,void 0,ge,dt,Me);if(c.fetchers.has(i)){let G=Re(N.data);c.fetchers.set(i,G)}cr(Ne),c.navigation.state==="loading"&&Ne>Ke?(H(I,"Expected pending action"),U&&U.abort(),ze(c.navigation.location,{matches:ye,loaderData:X,errors:ne,fetchers:new Map(c.fetchers)})):(re({errors:ne,loaderData:er(c.loaderData,X,ye,ne),fetchers:new Map(c.fetchers)}),Le=!1)}async function Mn(i,o,d,m,D,L,C,b){let T=c.fetchers.get(i);De(i,ke(b,T?T.data:void 0),{flushSync:C});let S=new AbortController,x=Ue(e.history,d,S.signal);if(L){let N=await it(D,d,x.signal);if(N.type==="aborted")return;if(N.type==="error"){let{error:q}=nt(d,N);me(i,o,q,{flushSync:C});return}else if(N.matches)D=N.matches,m=xe(D,d);else{me(i,o,Y(404,{pathname:d}),{flushSync:C});return}}Q.set(i,S);let W=qe,$=(await Ve("loader",c,x,[m],D,i))[m.route.id];if(ce($)&&($=await vt($,x.signal,!0)||$),Q.get(i)===S&&Q.delete(i),!x.signal.aborted){if(pe.has(i)){De(i,Re(void 0));return}if(we($))if(Ke>W){De(i,Re(void 0));return}else{he.add(i),await je(x,$,!1);return}if(ee($)){me(i,o,$.error);return}H(!ce($),"Unhandled fetcher deferred data"),De(i,Re($.data))}}async function je(i,o,d,m){let{submission:D,fetcherSubmission:L,replace:C}=m===void 0?{}:m;o.response.headers.has("X-Remix-Revalidate")&&(Le=!0);let b=o.response.headers.get("Location");H(b,"Expected a Location header on the redirect Response"),b=Gt(b,new URL(i.url),u);let T=ue(c.location,b,{_isRedirect:!0});if(r){let N=!1;if(o.response.headers.has("X-Remix-Reload-Document"))N=!0;else if(pt.test(b)){const q=e.history.createURL(b);N=q.origin!==t.location.origin||Be(q.pathname,u)==null}if(N){C?t.location.replace(b):t.location.assign(b);return}}U=null;let S=C===!0||o.response.headers.has("X-Remix-Replace")?V.Replace:V.Push,{formMethod:x,formAction:W,formEncType:k}=c.navigation;!D&&!L&&x&&W&&k&&(D=ir(c.navigation));let $=D||L;if(Zr.has(o.response.status)&&$&&ae($.formMethod))await Ce(S,T,{submission:A({},$,{formAction:b}),preventScrollReset:J,enableViewTransition:d?te:void 0});else{let N=bt(T,D);await Ce(S,T,{overrideNavigation:N,fetcherSubmission:L,preventScrollReset:J,enableViewTransition:d?te:void 0})}}async function Ve(i,o,d,m,D,L){let C,b={};try{C=await Yt(p,i,o,d,m,D,L,s,a)}catch(T){return m.forEach(S=>{b[S.route.id]={type:z.error,error:T}}),b}for(let[T,S]of Object.entries(C))if(nr(S)){let x=S.result;b[T]={type:z.redirect,response:Xt(x,d,T,D,u,y.v7_relativeSplatPath)}}else b[T]=await Jt(S);return b}async function sr(i,o,d,m,D){let L=i.matches,C=Ve("loader",i,D,d,o,null),b=Promise.all(m.map(async x=>{if(x.matches&&x.match&&x.controller){let k=(await Ve("loader",i,Ue(e.history,x.path,x.controller.signal),[x.match],x.matches,x.key))[x.match.route.id];return{[x.key]:k}}else return Promise.resolve({[x.key]:{type:z.error,error:Y(404,{pathname:x.path})}})})),T=await C,S=(await b).reduce((x,W)=>Object.assign(x,W),{});return await Promise.all([cn(o,T,D.signal,L,i.loaderData),hn(o,S,m)]),{loaderResults:T,fetcherResults:S}}function Rt(){Le=!0,Qe.push(...St()),He.forEach((i,o)=>{Q.has(o)&&(Ze.add(o),Se(o))})}function De(i,o,d){d===void 0&&(d={}),c.fetchers.set(i,o),re({fetchers:new Map(c.fetchers)},{flushSync:(d&&d.flushSync)===!0})}function me(i,o,d,m){m===void 0&&(m={});let D=Pe(c.matches,o);tt(i),re({errors:{[D.route.id]:d},fetchers:new Map(c.fetchers)},{flushSync:(m&&m.flushSync)===!0})}function dr(i){return y.v7_fetcherPersist&&($e.set(i,($e.get(i)||0)+1),pe.has(i)&&pe.delete(i)),c.fetchers.get(i)||qr}function tt(i){let o=c.fetchers.get(i);Q.has(i)&&!(o&&o.state==="loading"&&Ae.has(i))&&Se(i),He.delete(i),Ae.delete(i),he.delete(i),pe.delete(i),Ze.delete(i),c.fetchers.delete(i)}function Tn(i){if(y.v7_fetcherPersist){let o=($e.get(i)||0)-1;o<=0?($e.delete(i),pe.add(i)):$e.set(i,o)}else tt(i);re({fetchers:new Map(c.fetchers)})}function Se(i){let o=Q.get(i);H(o,"Expected fetch controller: "+i),o.abort(),Q.delete(i)}function ur(i){for(let o of i){let d=dr(o),m=Re(d.data);c.fetchers.set(o,m)}}function fr(){let i=[],o=!1;for(let d of he){let m=c.fetchers.get(d);H(m,"Expected fetcher: "+d),m.state==="loading"&&(he.delete(d),i.push(d),o=!0)}return ur(i),o}function cr(i){let o=[];for(let[d,m]of Ae)if(m<i){let D=c.fetchers.get(d);H(D,"Expected fetcher: "+d),D.state==="loading"&&(Se(d),Ae.delete(d),o.push(d))}return ur(o),o.length>0}function Cn(i,o){let d=c.blockers.get(i)||We;return Te.get(i)!==o&&Te.set(i,o),d}function hr(i){c.blockers.delete(i),Te.delete(i)}function rt(i,o){let d=c.blockers.get(i)||We;H(d.state==="unblocked"&&o.state==="blocked"||d.state==="blocked"&&o.state==="blocked"||d.state==="blocked"&&o.state==="proceeding"||d.state==="blocked"&&o.state==="unblocked"||d.state==="proceeding"&&o.state==="unblocked","Invalid blocker state transition: "+d.state+" -> "+o.state);let m=new Map(c.blockers);m.set(i,o),re({blockers:m})}function pr(i){let{currentLocation:o,nextLocation:d,historyAction:m}=i;if(Te.size===0)return;Te.size>1&&de(!1,"A router only supports one blocker at a time");let D=Array.from(Te.entries()),[L,C]=D[D.length-1],b=c.blockers.get(L);if(!(b&&b.state==="proceeding")&&C({currentLocation:o,nextLocation:d,historyAction:m}))return L}function Dt(i){let o=Y(404,{pathname:i}),d=f||l,{matches:m,route:D}=Xe(d);return St(),{notFoundMatches:m,route:D,error:o}}function nt(i,o){return{boundaryId:Pe(o.partialMatches).route.id,error:Y(400,{type:"route-discovery",pathname:i,message:o.error!=null&&"message"in o.error?o.error:String(o.error)})}}function St(i){let o=[];return Me.forEach((d,m)=>{(!i||i(m))&&(d.cancel(),o.push(m),Me.delete(m))}),o}function jn(i,o,d){if(P=i,M=o,F=d||null,!_&&c.navigation===ht){_=!0;let m=yr(c.location,c.matches);m!=null&&re({restoreScrollPosition:m})}return()=>{P=null,M=null,F=null}}function mr(i,o){return F&&F(i,o.map(m=>xr(m,c.loaderData)))||i.key}function Fn(i,o){if(P&&M){let d=mr(i,o);P[d]=M()}}function yr(i,o){if(P){let d=mr(i,o),m=P[d];if(typeof m=="number")return m}return null}function at(i,o,d){if(v){if(w.has(d))return{active:!1,matches:i};if(i){if(Object.keys(i[0].params).length>0)return{active:!0,matches:Je(o,d,u,!0)}}else return{active:!0,matches:Je(o,d,u,!0)||[]}}return{active:!1,matches:null}}async function it(i,o,d){let m=i;for(;;){let D=f==null,L=f||l;try{await nn(v,o,m,L,s,a,vn,d)}catch(T){return{type:"error",error:T,partialMatches:m}}finally{D&&(l=[...l])}if(d.aborted)return{type:"aborted"};let C=fe(L,o,u);if(C)return gr(o,w),{type:"success",matches:C};let b=Je(L,o,u,!0);if(!b||m.length===b.length&&m.every((T,S)=>T.route.id===b[S].route.id))return gr(o,w),{type:"success",matches:null};m=b}}function gr(i,o){if(o.size>=R){let d=o.values().next().value;o.delete(d)}o.add(i)}function _n(i){s={},f=Fe(i,a,void 0,s)}function On(i,o){let d=f==null;$t(i,o,f||l,s,a),d&&(l=[...l],re({}))}return O={get basename(){return u},get future(){return y},get state(){return c},get routes(){return l},get window(){return t},initialize:wn,subscribe:Rn,enableScrollRestoration:jn,navigate:or,fetch:xn,revalidate:Dn,createHref:i=>e.history.createHref(i),encodeLocation:i=>e.history.encodeLocation(i),getFetcher:dr,deleteFetcher:Tn,dispose:bn,getBlocker:Cn,deleteBlocker:hr,patchRoutes:On,_internalFetchControllers:Q,_internalActiveDeferreds:Me,_internalSetRoutes:_n},O}const en=Symbol("deferred");function $n(e,t){H(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 h=t.detectErrorBoundary;a=R=>({hasErrorBoundary:h(R)})}else a=At;let s=A({v7_relativeSplatPath:!1,v7_throwAbortReason:!1},t?t.future:null),l=Fe(e,a,void 0,r);async function f(h,R){let{requestContext:w,skipLoaderErrorBubbling:P,unstable_dataStrategy:F}=R===void 0?{}:R,M=new URL(h.url),_=h.method,g=ue("",se(M),null,"default"),K=fe(l,g,n);if(!gt(_)&&_!=="HEAD"){let O=Y(405,{method:_}),{matches:c,route:I}=Xe(l);return{basename:n,location:g,matches:c,loaderData:{},actionData:null,errors:{[I.id]:O},statusCode:O.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!K){let O=Y(404,{pathname:g.pathname}),{matches:c,route:I}=Xe(l);return{basename:n,location:g,matches:c,loaderData:{},actionData:null,errors:{[I.id]:O},statusCode:O.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let B=await p(h,g,K,w,F||null,P===!0,null);return be(B)?B:A({location:g,basename:n},B)}async function u(h,R){let{routeId:w,requestContext:P,unstable_dataStrategy:F}=R===void 0?{}:R,M=new URL(h.url),_=h.method,g=ue("",se(M),null,"default"),K=fe(l,g,n);if(!gt(_)&&_!=="HEAD"&&_!=="OPTIONS")throw Y(405,{method:_});if(!K)throw Y(404,{pathname:g.pathname});let B=w?K.find(J=>J.route.id===w):xe(K,g);if(w&&!B)throw Y(403,{pathname:g.pathname,routeId:w});if(!B)throw Y(404,{pathname:g.pathname});let O=await p(h,g,K,P,F||null,!1,B);if(be(O))return O;let c=O.errors?Object.values(O.errors)[0]:void 0;if(c!==void 0)throw c;if(O.actionData)return Object.values(O.actionData)[0];if(O.loaderData){var I;let J=Object.values(O.loaderData)[0];return(I=O.activeDeferreds)!=null&&I[B.route.id]&&(J[en]=O.activeDeferreds[B.route.id]),J}}async function p(h,R,w,P,F,M,_){H(h.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(ae(h.method.toLowerCase()))return await v(h,w,_||xe(w,R),P,F,M,_!=null);let g=await y(h,w,P,F,M,_);return be(g)?g:A({},g,{actionData:null,actionHeaders:{}})}catch(g){if(dn(g)&&be(g.result)){if(g.type===z.error)throw g.result;return g.result}if(fn(g))return g;throw g}}async function v(h,R,w,P,F,M,_){let g;if(!w.route.action&&!w.route.lazy){let O=Y(405,{method:h.method,pathname:new URL(h.url).pathname,routeId:w.route.id});if(_)throw O;g={type:z.error,error:O}}else g=(await E("action",h,[w],R,_,P,F))[w.route.id],h.signal.aborted&&zt(h,_,s);if(we(g))throw new Response(null,{status:g.response.status,headers:{Location:g.response.headers.get("Location")}});if(ce(g)){let O=Y(400,{type:"defer-action"});if(_)throw O;g={type:z.error,error:O}}if(_){if(ee(g))throw g.error;return{matches:[w],loaderData:{},actionData:{[w.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let K=new Request(h.url,{headers:h.headers,redirect:h.redirect,signal:h.signal});if(ee(g)){let O=M?w:Pe(R,w.route.id),c=await y(K,R,P,F,M,null,[O.route.id,g]);return A({},c,{statusCode:Oe(g.error)?g.error.status:g.statusCode!=null?g.statusCode:500,actionData:null,actionHeaders:A({},g.headers?{[w.route.id]:g.headers}:{})})}let B=await y(K,R,P,F,M,null);return A({},B,{actionData:{[w.route.id]:g.data}},g.statusCode?{statusCode:g.statusCode}:{},{actionHeaders:g.headers?{[w.route.id]:g.headers}:{}})}async function y(h,R,w,P,F,M,_){let g=M!=null;if(g&&!(M!=null&&M.route.loader)&&!(M!=null&&M.route.lazy))throw Y(400,{method:h.method,pathname:new URL(h.url).pathname,routeId:M?.route.id});let B=(M?[M]:_&&ee(_[1])?Bt(R,_[0]):R).filter(U=>U.route.loader||U.route.lazy);if(B.length===0)return{matches:R,loaderData:R.reduce((U,te)=>Object.assign(U,{[te.route.id]:null}),{}),errors:_&&ee(_[1])?{[_[0]]:_[1].error}:null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let O=await E("loader",h,B,R,g,w,P);h.signal.aborted&&zt(h,g,s);let c=new Map,I=Zt(R,O,_,c,F),J=new Set(B.map(U=>U.route.id));return R.forEach(U=>{J.has(U.route.id)||(I.loaderData[U.route.id]=null)}),A({},I,{matches:R,activeDeferreds:c.size>0?Object.fromEntries(c.entries()):null})}async function E(h,R,w,P,F,M,_){let g=await Yt(_||Vt,h,null,R,w,P,null,r,a,M),K={};return await Promise.all(P.map(async B=>{if(!(B.route.id in g))return;let O=g[B.route.id];if(nr(O)){let c=O.result;throw Xt(c,R,B.route.id,P,n,s.v7_relativeSplatPath)}if(be(O.result)&&F)throw O;K[B.route.id]=await Jt(O)})),K}return{dataRoutes:l,query:f,queryRoute:u}}function Vn(e,t,r){return A({},t,{statusCode:Oe(r)?r.status:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function zt(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 tn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function mt(e,t,r,n,a,s,l,f){let u,p;if(l){u=[];for(let y of t)if(u.push(y),y.route.id===l){p=y;break}}else u=t,p=t[t.length-1];let v=Ot(a||".",_t(u,s),Be(e.pathname,r)||e.pathname,f==="path");return a==null&&(v.search=e.search,v.hash=e.hash),(a==null||a===""||a===".")&&p&&p.route.index&&!wt(v.search)&&(v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(v.pathname=v.pathname==="/"?r:_e([r,v.pathname])),se(v)}function Nt(e,t,r,n){if(!n||!tn(n))return{path:r};if(n.formMethod&&!gt(n.formMethod))return{path:r,error:Y(405,{method:n.formMethod})};let a=()=>({path:r,error:Y(400,{type:"invalid-body"})}),s=n.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),f=rr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ae(l))return a();let E=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((h,R)=>{let[w,P]=R;return""+h+w+"="+P+`
11
- `},""):String(n.body);return{path:r,submission:{formMethod:l,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:E}}}else if(n.formEncType==="application/json"){if(!ae(l))return a();try{let E=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:l,formAction:f,formEncType:n.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}H(typeof FormData=="function","FormData is not available in this environment");let u,p;if(n.formData)u=yt(n.formData),p=n.formData;else if(n.body instanceof FormData)u=yt(n.body),p=n.body;else if(n.body instanceof URLSearchParams)u=n.body,p=Qt(u);else if(n.body==null)u=new URLSearchParams,p=new FormData;else try{u=new URLSearchParams(n.body),p=Qt(u)}catch{return a()}let v={formMethod:l,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(ae(v.formMethod))return{path:r,submission:v};let y=oe(r);return t&&y.search&&wt(y.search)&&u.append("index",""),y.search="?"+u,{path:se(y),submission:v}}function Bt(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 Wt(e,t,r,n,a,s,l,f,u,p,v,y,E,h,R,w){let P=w?ee(w[1])?w[1].error:w[1].data:void 0,F=e.createURL(t.location),M=e.createURL(a),_=w&&ee(w[1])?w[0]:void 0,g=_?Bt(r,_):r,K=w?w[1].statusCode:void 0,B=l&&K&&K>=400,O=g.filter((I,J)=>{let{route:U}=I;if(U.lazy)return!0;if(U.loader==null)return!1;if(s)return typeof U.loader!="function"||U.loader.hydrate?!0:t.loaderData[U.id]===void 0&&(!t.errors||t.errors[U.id]===void 0);if(rn(t.loaderData,t.matches[J],I)||u.some(le=>le===I.route.id))return!0;let te=t.matches[J],ie=I;return Kt(I,A({currentUrl:F,currentParams:te.params,nextUrl:M,nextParams:ie.params},n,{actionResult:P,actionStatus:K,defaultShouldRevalidate:B?!1:f||F.pathname+F.search===M.pathname+M.search||F.search!==M.search||kt(te,ie)}))}),c=[];return y.forEach((I,J)=>{if(s||!r.some(Ie=>Ie.route.id===I.routeId)||v.has(J))return;let U=fe(h,I.path,R);if(!U){c.push({key:J,routeId:I.routeId,path:I.path,matches:null,match:null,controller:null});return}let te=t.fetchers.get(J),ie=xe(U,I.path),le=!1;E.has(J)?le=!1:p.has(J)?(p.delete(J),le=!0):te&&te.state!=="idle"&&te.data===void 0?le=f:le=Kt(ie,A({currentUrl:F,currentParams:t.matches[t.matches.length-1].params,nextUrl:M,nextParams:r[r.length-1].params},n,{actionResult:P,actionStatus:K,defaultShouldRevalidate:B?!1:f})),le&&c.push({key:J,routeId:I.routeId,path:I.path,matches:U,match:ie,controller:new AbortController})}),[O,c]}function rn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function kt(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Kt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function nn(e,t,r,n,a,s,l,f){let u=[t,...r.map(p=>p.route.id)].join("-");try{let p=l.get(u);p||(p=e({path:t,matches:r,patch:(v,y)=>{f.aborted||$t(v,y,n,a,s)}}),l.set(u,p)),p&&sn(p)&&await p}finally{l.delete(u)}}function $t(e,t,r,n,a){if(e){var s;let l=n[e];H(l,"No route found to patch children into: routeId = "+e);let f=Fe(t,a,[e,"patch",String(((s=l.children)==null?void 0:s.length)||"0")],n);l.children?l.children.push(...f):l.children=f}else{let l=Fe(t,a,["patch",String(r.length||"0")],n);r.push(...l)}}async function an(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];H(a,"No route found in manifest");let s={};for(let l in n){let u=a[l]!==void 0&&l!=="hasErrorBoundary";de(!u,'Route "'+a.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!u&&!Er.has(l)&&(s[l]=n[l])}Object.assign(a,s),Object.assign(a,A({},t(a),{lazy:void 0}))}async function Vt(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,s,l)=>Object.assign(a,{[r[l].route.id]:s}),{})}async function Yt(e,t,r,n,a,s,l,f,u,p){let v=s.map(h=>h.route.lazy?an(h.route,u,f):void 0),y=s.map((h,R)=>{let w=v[R],P=a.some(M=>M.route.id===h.route.id);return A({},h,{shouldLoad:P,resolve:async M=>(M&&n.method==="GET"&&(h.route.lazy||h.route.loader)&&(P=!0),P?on(t,n,h,w,M,p):Promise.resolve({type:z.data,result:void 0}))})}),E=await e({matches:y,request:n,params:s[0].params,fetcherKey:l,context:p});try{await Promise.all(v)}catch{}return E}async function on(e,t,r,n,a,s){let l,f,u=p=>{let v,y=new Promise((R,w)=>v=w);f=()=>v(),t.signal.addEventListener("abort",f);let E=R=>typeof p!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):p({request:t,params:r.params,context:s},...R!==void 0?[R]:[]),h=(async()=>{try{return{type:"data",result:await(a?a(w=>E(w)):E())}}catch(R){return{type:"error",result:R}}})();return Promise.race([h,y])};try{let p=r.route[e];if(n)if(p){let v,[y]=await Promise.all([u(p).catch(E=>{v=E}),n]);if(v!==void 0)throw v;l=y}else if(await n,p=r.route[e],p)l=await u(p);else if(e==="action"){let v=new URL(t.url),y=v.pathname+v.search;throw Y(405,{method:t.method,pathname:y,routeId:r.route.id})}else return{type:z.data,result:void 0};else if(p)l=await u(p);else{let v=new URL(t.url),y=v.pathname+v.search;throw Y(404,{pathname:y})}H(l.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(p){return{type:z.error,result:p}}finally{f&&t.signal.removeEventListener("abort",f)}return l}async function Jt(e){let{result:t,type:r}=e;if(be(t)){let p;try{let v=t.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(v){return{type:z.error,error:v}}return r===z.error?{type:z.error,error:new ct(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:z.data,data:p,statusCode:t.status,headers:t.headers}}if(r===z.error){if(ar(t)){var n;if(t.data instanceof Error){var a;return{type:z.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status}}t=new ct(((n=t.init)==null?void 0:n.status)||500,void 0,t.data)}return{type:z.error,error:t,statusCode:Oe(t)?t.status:void 0}}if(un(t)){var s,l;return{type:z.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(ar(t)){var f,u;return{type:z.data,data:t.data,statusCode:(f=t.init)==null?void 0:f.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:z.data,data:t}}function Xt(e,t,r,n,a,s){let l=e.headers.get("Location");if(H(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!pt.test(l)){let f=n.slice(0,n.findIndex(u=>u.route.id===r)+1);l=mt(new URL(t.url),f,a,!0,l,s),e.headers.set("Location",l)}return e}function Gt(e,t,r){if(pt.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),s=Be(a.pathname,r)!=null;if(a.origin===t.origin&&s)return a.pathname+a.search+a.hash}return e}function Ue(e,t,r,n){let a=e.createURL(rr(t)).toString(),s={signal:r};if(n&&ae(n.formMethod)){let{formMethod:l,formEncType:f}=n;s.method=l.toUpperCase(),f==="application/json"?(s.headers=new Headers({"Content-Type":f}),s.body=JSON.stringify(n.json)):f==="text/plain"?s.body=n.text:f==="application/x-www-form-urlencoded"&&n.formData?s.body=yt(n.formData):s.body=n.formData}return new Request(a,s)}function yt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Qt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Zt(e,t,r,n,a){let s={},l=null,f,u=!1,p={},v=r&&ee(r[1])?r[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let E=y.route.id,h=t[E];if(H(!we(h),"Cannot handle redirect results in processLoaderData"),ee(h)){let R=h.error;if(v!==void 0&&(R=v,v=void 0),l=l||{},a)l[E]=R;else{let w=Pe(e,E);l[w.route.id]==null&&(l[w.route.id]=R)}s[E]=void 0,u||(u=!0,f=Oe(h.error)?h.error.status:500),h.headers&&(p[E]=h.headers)}else ce(h)?(n.set(E,h.deferredData),s[E]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(f=h.statusCode),h.headers&&(p[E]=h.headers)):(s[E]=h.data,h.statusCode&&h.statusCode!==200&&!u&&(f=h.statusCode),h.headers&&(p[E]=h.headers))}),v!==void 0&&r&&(l={[r[0]]:v},s[r[0]]=void 0),{loaderData:s,errors:l,statusCode:f||200,loaderHeaders:p}}function qt(e,t,r,n,a,s,l,f){let{loaderData:u,errors:p}=Zt(t,n,a,f,!1);return s.forEach(v=>{let{key:y,match:E,controller:h}=v,R=l[y];if(H(R,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(ee(R)){let w=Pe(e.matches,E?.route.id);p&&p[w.route.id]||(p=A({},p,{[w.route.id]:R.error})),e.fetchers.delete(y)}else if(we(R))H(!1,"Unhandled fetcher revalidation redirect");else if(ce(R))H(!1,"Unhandled fetcher deferred data");else{let w=Re(R.data);e.fetchers.set(y,w)}}),{loaderData:u,errors:p}}function er(e,t,r,n){let a=A({},t);for(let s of r){let l=s.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(a[l]=t[l]):e[l]!==void 0&&s.route.loader&&(a[l]=e[l]),n&&n.hasOwnProperty(l))break}return a}function tr(e){return e?ee(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Pe(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 Xe(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:s,message:l}=t===void 0?{}:t,f="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(f="Bad Request",s==="route-discovery"?u='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
12
- `+l):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.":s==="defer-action"?u="defer() is not supported in actions":s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(f="Forbidden",u='Route "'+n+'" does not match URL "'+r+'"'):e===404?(f="Not Found",u='No route matches URL "'+r+'"'):e===405&&(f="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 ct(e||500,f,new Error(u),!0)}function Ge(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(we(a))return{key:n,result:a}}}function rr(e){let t=typeof e=="string"?oe(e):e;return se(A({},t,{hash:""}))}function ln(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function sn(e){return typeof e=="object"&&e!=null&&"then"in e}function dn(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type===z.data||e.type===z.error)}function nr(e){return be(e.result)&&Qr.has(e.result.status)}function ce(e){return e.type===z.deferred}function ee(e){return e.type===z.error}function we(e){return(e&&e.type)===z.redirect}function ar(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function un(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 be(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fn(e){if(!be(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function gt(e){return Gr.has(e.toLowerCase())}function ae(e){return Jr.has(e.toLowerCase())}async function cn(e,t,r,n,a){let s=Object.entries(t);for(let l=0;l<s.length;l++){let[f,u]=s[l],p=e.find(E=>E?.route.id===f);if(!p)continue;let v=n.find(E=>E.route.id===p.route.id),y=v!=null&&!kt(v,p)&&(a&&a[p.route.id])!==void 0;ce(u)&&y&&await vt(u,r,!1).then(E=>{E&&(t[f]=E)})}}async function hn(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:s,controller:l}=r[n],f=t[a];e.find(p=>p?.route.id===s)&&ce(f)&&(H(l,"Expected an AbortController for revalidating fetcher deferred result"),await vt(f,l.signal,!0).then(p=>{p&&(t[a]=p)}))}}async function vt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:z.data,data:e.deferredData.unwrappedData}}catch(a){return{type:z.error,error:a}}return{type:z.data,data:e.deferredData.data}}}function wt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xe(e,t){let r=typeof t=="string"?oe(t).search:t.search;if(e[e.length-1].route.index&&wt(r||""))return e[e.length-1];let n=Ft(e);return n[n.length-1]}function ir(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:s,json:l}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:l,text:void 0}}}function bt(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 pn(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 ke(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 mn(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 Re(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 yn(e,t){try{let r=e.sessionStorage.getItem(Ht);if(r){let n=JSON.parse(r);for(let[a,s]of Object.entries(n||{}))s&&Array.isArray(s)&&t.set(a,new Set(s||[]))}}catch{}}function gn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Ht,JSON.stringify(r))}catch(n){de(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
13
-
14
- //# sourceMappingURL=module-remix-run.e486ee73.js.map