@techdocs/cli 1.8.2-next.2 → 1.8.2-next.3
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 +11 -0
- package/dist/embedded-app/.config-schema.json +93 -93
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/2000.e59f95de.chunk.js +5 -0
- package/dist/embedded-app/static/2000.e59f95de.chunk.js.map +1 -0
- package/dist/embedded-app/static/2136.04b92ddc.chunk.js +5 -0
- package/dist/embedded-app/static/2136.04b92ddc.chunk.js.map +1 -0
- package/dist/embedded-app/static/2604.82403d28.chunk.js +5 -0
- package/dist/embedded-app/static/2604.82403d28.chunk.js.map +1 -0
- package/dist/embedded-app/static/{3216.ac631978.chunk.js → 3216.2ad91911.chunk.js} +2 -2
- package/dist/embedded-app/static/{3216.ac631978.chunk.js.map → 3216.2ad91911.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3472.d6c98551.chunk.js → 3472.083d3a54.chunk.js} +2 -2
- package/dist/embedded-app/static/{3472.d6c98551.chunk.js.map → 3472.083d3a54.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4256.28999c0e.chunk.js +5 -0
- package/dist/embedded-app/static/4256.28999c0e.chunk.js.map +1 -0
- package/dist/embedded-app/static/496.fa9edfbf.chunk.js +5 -0
- package/dist/embedded-app/static/{2136.ba64702c.chunk.js.map → 496.fa9edfbf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{356.9eae4154.chunk.js → 636.6da734d7.chunk.js} +3 -3
- package/dist/embedded-app/static/636.6da734d7.chunk.js.map +1 -0
- package/dist/embedded-app/static/72.86c6077c.chunk.js +5 -0
- package/dist/embedded-app/static/72.86c6077c.chunk.js.map +1 -0
- package/dist/embedded-app/static/732.ba37d04a.chunk.js +5 -0
- package/dist/embedded-app/static/732.ba37d04a.chunk.js.map +1 -0
- package/dist/embedded-app/static/736.aa1a24e1.chunk.js +3 -0
- package/dist/embedded-app/static/736.aa1a24e1.chunk.js.map +1 -0
- package/dist/embedded-app/static/7380.48342232.chunk.js +5 -0
- package/dist/embedded-app/static/7380.48342232.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.fe153bbe.js +495 -0
- package/dist/embedded-app/static/main.fe153bbe.js.map +1 -0
- package/dist/embedded-app/static/module-react-router-dom.dd995f7e.js +22 -0
- package/dist/embedded-app/static/module-react-router-dom.dd995f7e.js.map +1 -0
- package/dist/embedded-app/static/module-react-router.07bc98eb.js +22 -0
- package/dist/embedded-app/static/module-react-router.07bc98eb.js.map +1 -0
- package/dist/embedded-app/static/{runtime.a5edb6db.js → runtime.fe153bbe.js} +3 -3
- package/dist/embedded-app/static/runtime.fe153bbe.js.map +1 -0
- package/dist/embedded-app/static/vendor.fe153bbe.js +163 -0
- package/dist/embedded-app/static/vendor.fe153bbe.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/2000.29c21849.chunk.js +0 -5
- package/dist/embedded-app/static/2000.29c21849.chunk.js.map +0 -1
- package/dist/embedded-app/static/2136.ba64702c.chunk.js +0 -5
- package/dist/embedded-app/static/2604.e7dcd742.chunk.js +0 -5
- package/dist/embedded-app/static/2604.e7dcd742.chunk.js.map +0 -1
- package/dist/embedded-app/static/356.9eae4154.chunk.js.map +0 -1
- package/dist/embedded-app/static/4256.3a3f74a4.chunk.js +0 -5
- package/dist/embedded-app/static/4256.3a3f74a4.chunk.js.map +0 -1
- package/dist/embedded-app/static/496.cfeba817.chunk.js +0 -5
- package/dist/embedded-app/static/496.cfeba817.chunk.js.map +0 -1
- package/dist/embedded-app/static/72.9a3dbf13.chunk.js +0 -5
- package/dist/embedded-app/static/72.9a3dbf13.chunk.js.map +0 -1
- package/dist/embedded-app/static/732.1ba465ce.chunk.js +0 -5
- package/dist/embedded-app/static/732.1ba465ce.chunk.js.map +0 -1
- package/dist/embedded-app/static/7380.13fba490.chunk.js +0 -5
- package/dist/embedded-app/static/7380.13fba490.chunk.js.map +0 -1
- package/dist/embedded-app/static/9892.775e589e.chunk.js +0 -3
- package/dist/embedded-app/static/9892.775e589e.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.a5edb6db.js +0 -495
- package/dist/embedded-app/static/main.a5edb6db.js.map +0 -1
- package/dist/embedded-app/static/module-react-router-dom.139b0dd8.js +0 -22
- package/dist/embedded-app/static/module-react-router-dom.139b0dd8.js.map +0 -1
- package/dist/embedded-app/static/module-react-router.5cd3c8c6.js +0 -22
- package/dist/embedded-app/static/module-react-router.5cd3c8c6.js.map +0 -1
- package/dist/embedded-app/static/runtime.a5edb6db.js.map +0 -1
- package/dist/embedded-app/static/vendor.a5edb6db.js +0 -164
- package/dist/embedded-app/static/vendor.a5edb6db.js.map +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[6101],{33648:function(Wr,Kt,et){var H;et.d(Kt,{CF:function(){return qe},E5:function(){return mt},IT:function(){return Te},Iz:function(){return ie},W4:function(){return qt},YX:function(){return pt},ag:function(){return Dt},c5:function(){return lr},co:function(){return Re},i6:function(){return Pe},kX:function(){return jt},oT:function(){return Pt},wF:function(){return Ut},wh:function(){return St},yY:function(){return Tt},yo:function(){return se}});var y=et(85668),B=et(75696);/**
|
|
2
|
-
* React Router v6.21.3
|
|
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 Me(){return Me=Object.assign?Object.assign.bind():function(l){for(var s=1;s<arguments.length;s++){var v=arguments[s];for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(l[R]=v[R])}return l},Me.apply(this,arguments)}const ut=y.createContext(null),$t=y.createContext(null),k=y.createContext(null),se=y.createContext(null),$e=y.createContext(null),ve=y.createContext({outlet:null,matches:[],isDataRoute:!1}),be=y.createContext(null);function Re(l,s){let{relative:v}=s===void 0?{}:s;ie()||(0,B.q4)(!1);let{basename:R,navigator:S}=y.useContext(se),{hash:T,pathname:L,search:W}=Pt(l,{relative:v}),Z=L;return R!=="/"&&(Z=L==="/"?R:(0,B.En)([R,L])),S.createHref({pathname:Z,search:W,hash:T})}function ie(){return y.useContext($e)!=null}function Te(){return ie()||(0,B.q4)(!1),y.useContext($e).location}function Q(){return React.useContext($e).navigationType}function Rr(l){ie()||UNSAFE_invariant(!1);let{pathname:s}=Te();return React.useMemo(()=>matchPath(l,s),[s,l])}const Er=null;function Je(l){y.useContext(se).static||y.useLayoutEffect(l)}function Pe(){let{isDataRoute:l}=y.useContext(ve);return l?ft():Jt()}function Jt(){ie()||(0,B.q4)(!1);let l=y.useContext(ut),{basename:s,future:v,navigator:R}=y.useContext(se),{matches:S}=y.useContext(ve),{pathname:T}=Te(),L=JSON.stringify((0,B.M5)(S,v.v7_relativeSplatPath)),W=y.useRef(!1);return Je(()=>{W.current=!0}),y.useCallback(function(z,J){if(J===void 0&&(J={}),!W.current)return;if(typeof z=="number"){R.go(z);return}let U=(0,B._)(z,JSON.parse(L),T,J.relative==="path");l==null&&s!=="/"&&(U.pathname=U.pathname==="/"?s:(0,B.En)([s,U.pathname])),(J.replace?R.replace:R.push)(U,J.state,J)},[s,R,L,T,l])}const dt=y.createContext(null);function Vt(){return React.useContext(dt)}function Dt(l){let s=y.useContext(ve).outlet;return s&&y.createElement(dt.Provider,{value:l},s)}function qt(){let{matches:l}=y.useContext(ve),s=l[l.length-1];return s?s.params:{}}function Pt(l,s){let{relative:v}=s===void 0?{}:s,{future:R}=y.useContext(se),{matches:S}=y.useContext(ve),{pathname:T}=Te(),L=JSON.stringify((0,B.M5)(S,R.v7_relativeSplatPath));return y.useMemo(()=>(0,B._)(l,JSON.parse(L),T,v==="path"),[l,L,T,v])}function St(l,s){return Ct(l,s)}function Ct(l,s,v,R){ie()||(0,B.q4)(!1);let{navigator:S}=y.useContext(se),{matches:T}=y.useContext(ve),L=T[T.length-1],W=L?L.params:{},Z=L?L.pathname:"/",z=L?L.pathnameBase:"/",J=L&&L.route,U=Te(),X;if(s){var ne;let he=typeof s=="string"?(0,B.O8)(s):s;z==="/"||(ne=he.pathname)!=null&&ne.startsWith(z)||(0,B.q4)(!1),X=he}else X=U;let pe=X.pathname||"/",Ce=z==="/"?pe:pe.slice(z.length)||"/",Ee=(0,B.Cm)(l,{pathname:Ce}),je=Mt(Ee&&Ee.map(he=>Object.assign({},he,{params:Object.assign({},W,he.params),pathname:(0,B.En)([z,S.encodeLocation?S.encodeLocation(he.pathname).pathname:he.pathname]),pathnameBase:he.pathnameBase==="/"?z:(0,B.En)([z,S.encodeLocation?S.encodeLocation(he.pathnameBase).pathname:he.pathnameBase])})),T,v,R);return s&&je?y.createElement($e.Provider,{value:{location:Me({pathname:"/",search:"",hash:"",state:null,key:"default"},X),navigationType:B.So.Pop}},je):je}function Yt(){let l=Ie(),s=(0,B.e8)(l)?l.status+" "+l.statusText:l instanceof Error?l.message:JSON.stringify(l),v=l instanceof Error?l.stack:null,R="rgba(200,200,200, 0.5)",S={padding:"0.5rem",backgroundColor:R},T={padding:"2px 4px",backgroundColor:R},L=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),v?y.createElement("pre",{style:S},v):null,L)}const Xt=y.createElement(Yt,null);class Lt extends y.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,v){return v.location!==s.location||v.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:v.error,location:v.location,revalidation:s.revalidation||v.revalidation}}componentDidCatch(s,v){console.error("React Router caught the following error during render",s,v)}render(){return this.state.error!==void 0?y.createElement(ve.Provider,{value:this.props.routeContext},y.createElement(be.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gt(l){let{routeContext:s,match:v,children:R}=l,S=y.useContext(ut);return S&&S.static&&S.staticContext&&(v.route.errorElement||v.route.ErrorBoundary)&&(S.staticContext._deepestRenderedBoundaryId=v.route.id),y.createElement(ve.Provider,{value:s},R)}function Mt(l,s,v,R){var S;if(s===void 0&&(s=[]),v===void 0&&(v=null),R===void 0&&(R=null),l==null){var T;if((T=v)!=null&&T.errors)l=v.matches;else return null}let L=l,W=(S=v)==null?void 0:S.errors;if(W!=null){let J=L.findIndex(U=>U.route.id&&(W==null?void 0:W[U.route.id]));J>=0||(0,B.q4)(!1),L=L.slice(0,Math.min(L.length,J+1))}let Z=!1,z=-1;if(v&&R&&R.v7_partialHydration)for(let J=0;J<L.length;J++){let U=L[J];if((U.route.HydrateFallback||U.route.hydrateFallbackElement)&&(z=J),U.route.id){let{loaderData:X,errors:ne}=v,pe=U.route.loader&&X[U.route.id]===void 0&&(!ne||ne[U.route.id]===void 0);if(U.route.lazy||pe){Z=!0,z>=0?L=L.slice(0,z+1):L=[L[0]];break}}}return L.reduceRight((J,U,X)=>{let ne,pe=!1,Ce=null,Ee=null;v&&(ne=W&&U.route.id?W[U.route.id]:void 0,Ce=U.route.errorElement||Xt,Z&&(z<0&&X===0?(or("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),pe=!0,Ee=null):z===X&&(pe=!0,Ee=U.route.hydrateFallbackElement||null)));let je=s.concat(L.slice(0,X+1)),he=()=>{let ge;return ne?ge=Ce:pe?ge=Ee:U.route.Component?ge=y.createElement(U.route.Component,null):U.route.element?ge=U.route.element:ge=J,y.createElement(Gt,{match:U,routeContext:{outlet:J,matches:je,isDataRoute:v!=null},children:ge})};return v&&(U.route.ErrorBoundary||U.route.errorElement||X===0)?y.createElement(Lt,{location:v.location,revalidation:v.revalidation,component:Ce,error:ne,children:he(),routeContext:{outlet:null,matches:je,isDataRoute:!0}}):he()},null)}var tt=function(l){return l.UseBlocker="useBlocker",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l}(tt||{}),fe=function(l){return l.UseBlocker="useBlocker",l.UseLoaderData="useLoaderData",l.UseActionData="useActionData",l.UseRouteError="useRouteError",l.UseNavigation="useNavigation",l.UseRouteLoaderData="useRouteLoaderData",l.UseMatches="useMatches",l.UseRevalidator="useRevalidator",l.UseNavigateStable="useNavigate",l.UseRouteId="useRouteId",l}(fe||{});function wr(l){return l+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ct(l){let s=y.useContext(ut);return s||(0,B.q4)(!1),s}function _e(l){let s=y.useContext($t);return s||(0,B.q4)(!1),s}function Qt(l){let s=y.useContext(ve);return s||(0,B.q4)(!1),s}function Se(l){let s=Qt(l),v=s.matches[s.matches.length-1];return v.route.id||(0,B.q4)(!1),v.route.id}function Zt(){return Se(fe.UseRouteId)}function xr(){return _e(fe.UseNavigation).navigation}function _t(){let l=ct(tt.UseRevalidator),s=_e(fe.UseRevalidator);return React.useMemo(()=>({revalidate:l.router.revalidate,state:s.revalidation}),[l.router.revalidate,s.revalidation])}function er(){let{matches:l,loaderData:s}=_e(fe.UseMatches);return React.useMemo(()=>l.map(v=>UNSAFE_convertRouteMatchToUiMatch(v,s)),[l,s])}function tr(){let l=_e(fe.UseLoaderData),s=Se(fe.UseLoaderData);if(l.errors&&l.errors[s]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+s+")");return}return l.loaderData[s]}function rr(l){return _e(fe.UseRouteLoaderData).loaderData[l]}function Kr(){let l=_e(fe.UseActionData),s=Se(fe.UseLoaderData);return l.actionData?l.actionData[s]:void 0}function Ie(){var l;let s=y.useContext(be),v=_e(fe.UseRouteError),R=Se(fe.UseRouteError);return s!==void 0?s:(l=v.errors)==null?void 0:l[R]}function nr(){let l=React.useContext(k);return l==null?void 0:l._data}function Dr(){let l=React.useContext(k);return l==null?void 0:l._error}let ar=0;function $r(l){let{router:s,basename:v}=ct(tt.UseBlocker),R=_e(fe.UseBlocker),[S,T]=React.useState(""),L=React.useCallback(W=>{if(typeof l!="function")return!!l;if(v==="/")return l(W);let{currentLocation:Z,nextLocation:z,historyAction:J}=W;return l({currentLocation:Me({},Z,{pathname:stripBasename(Z.pathname,v)||Z.pathname}),nextLocation:Me({},z,{pathname:stripBasename(z.pathname,v)||z.pathname}),historyAction:J})},[v,l]);return React.useEffect(()=>{let W=String(++ar);return T(W),()=>s.deleteBlocker(W)},[s]),React.useEffect(()=>{S!==""&&s.getBlocker(S,L)},[s,S,L]),S&&R.blockers.has(S)?R.blockers.get(S):IDLE_BLOCKER}function ft(){let{router:l}=ct(tt.UseNavigateStable),s=Se(fe.UseNavigateStable),v=y.useRef(!1);return Je(()=>{v.current=!0}),y.useCallback(function(S,T){T===void 0&&(T={}),v.current&&(typeof S=="number"?l.navigate(S):l.navigate(S,Me({fromRouteId:s},T)))},[l,s])}const Ot={};function or(l,s,v){!s&&!Ot[l]&&(Ot[l]=!0)}const ir="startTransition",ht=(H||(H=et.t(y,2)))[ir];function Pr(l){let{fallbackElement:s,router:v,future:R}=l,[S,T]=React.useState(v.state),{v7_startTransition:L}=R||{},W=React.useCallback(U=>{L&&ht?ht(()=>T(U)):T(U)},[T,L]);React.useLayoutEffect(()=>v.subscribe(W),[v,W]),React.useEffect(()=>{},[]);let Z=React.useMemo(()=>({createHref:v.createHref,encodeLocation:v.encodeLocation,go:U=>v.navigate(U),push:(U,X,ne)=>v.navigate(U,{state:X,preventScrollReset:ne==null?void 0:ne.preventScrollReset}),replace:(U,X,ne)=>v.navigate(U,{replace:!0,state:X,preventScrollReset:ne==null?void 0:ne.preventScrollReset})}),[v]),z=v.basename||"/",J=React.useMemo(()=>({router:v,navigator:Z,static:!1,basename:z}),[v,Z,z]);return React.createElement(React.Fragment,null,React.createElement(ut.Provider,{value:J},React.createElement($t.Provider,{value:S},React.createElement(mt,{basename:z,location:S.location,navigationType:S.historyAction,navigator:Z,future:{v7_relativeSplatPath:v.future.v7_relativeSplatPath}},S.initialized||v.future.v7_partialHydration?React.createElement(Sr,{routes:v.routes,future:v.future,state:S}):s))),null)}function Sr(l){let{routes:s,future:v,state:R}=l;return Ct(s,void 0,R,v)}function Ut(l){let{basename:s,children:v,initialEntries:R,initialIndex:S,future:T}=l,L=y.useRef();L.current==null&&(L.current=(0,B.Wi)({initialEntries:R,initialIndex:S,v5Compat:!0}));let W=L.current,[Z,z]=y.useState({action:W.action,location:W.location}),{v7_startTransition:J}=T||{},U=y.useCallback(X=>{J&&ht?ht(()=>z(X)):z(X)},[z,J]);return y.useLayoutEffect(()=>W.listen(U),[W,U]),y.createElement(mt,{basename:s,children:v,location:Z.location,navigationType:Z.action,navigator:W,future:T})}function pt(l){let{to:s,replace:v,state:R,relative:S}=l;ie()||(0,B.q4)(!1);let{future:T,static:L}=y.useContext(se),{matches:W}=y.useContext(ve),{pathname:Z}=Te(),z=Pe(),J=(0,B._)(s,(0,B.M5)(W,T.v7_relativeSplatPath),Z,S==="path"),U=JSON.stringify(J);return y.useEffect(()=>z(JSON.parse(U),{replace:v,state:R,relative:S}),[z,U,S,v,R]),null}function Tt(l){return Dt(l.context)}function jt(l){(0,B.q4)(!1)}function mt(l){let{basename:s="/",children:v=null,location:R,navigationType:S=B.So.Pop,navigator:T,static:L=!1,future:W}=l;ie()&&(0,B.q4)(!1);let Z=s.replace(/^\/*/,"/"),z=y.useMemo(()=>({basename:Z,navigator:T,static:L,future:Me({v7_relativeSplatPath:!1},W)}),[Z,W,T,L]);typeof R=="string"&&(R=(0,B.O8)(R));let{pathname:J="/",search:U="",hash:X="",state:ne=null,key:pe="default"}=R,Ce=y.useMemo(()=>{let Ee=(0,B.mc)(J,Z);return Ee==null?null:{location:{pathname:Ee,search:U,hash:X,state:ne,key:pe},navigationType:S}},[Z,J,U,X,ne,pe,S]);return Ce==null?null:y.createElement(se.Provider,{value:z},y.createElement($e.Provider,{children:v,value:Ce}))}function lr(l){let{children:s,location:v}=l;return St(qe(s),v)}function Cr(l){let{children:s,errorElement:v,resolve:R}=l;return React.createElement(sr,{resolve:R,errorElement:v},React.createElement(Ve,null,s))}var me=function(l){return l[l.pending=0]="pending",l[l.success=1]="success",l[l.error=2]="error",l}(me||{});const vt=new Promise(()=>{});class sr extends y.Component{constructor(s){super(s),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,v){console.error("<Await> caught the following error during render",s,v)}render(){let{children:s,errorElement:v,resolve:R}=this.props,S=null,T=me.pending;if(!(R instanceof Promise))T=me.success,S=Promise.resolve(),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_data",{get:()=>R});else if(this.state.error){T=me.error;let L=this.state.error;S=Promise.reject().catch(()=>{}),Object.defineProperty(S,"_tracked",{get:()=>!0}),Object.defineProperty(S,"_error",{get:()=>L})}else R._tracked?(S=R,T=S._error!==void 0?me.error:S._data!==void 0?me.success:me.pending):(T=me.pending,Object.defineProperty(R,"_tracked",{get:()=>!0}),S=R.then(L=>Object.defineProperty(R,"_data",{get:()=>L}),L=>Object.defineProperty(R,"_error",{get:()=>L})));if(T===me.error&&S._error instanceof B.ay)throw vt;if(T===me.error&&!v)throw S._error;if(T===me.error)return y.createElement(k.Provider,{value:S,children:v});if(T===me.success)return y.createElement(k.Provider,{value:S,children:s});throw S}}function Ve(l){let{children:s}=l,v=nr(),R=typeof s=="function"?s(v):s;return React.createElement(React.Fragment,null,R)}function qe(l,s){s===void 0&&(s=[]);let v=[];return y.Children.forEach(l,(R,S)=>{if(!y.isValidElement(R))return;let T=[...s,S];if(R.type===y.Fragment){v.push.apply(v,qe(R.props.children,T));return}R.type!==jt&&(0,B.q4)(!1),!R.props.index||!R.props.children||(0,B.q4)(!1);let L={id:R.props.id||T.join("-"),caseSensitive:R.props.caseSensitive,element:R.props.element,Component:R.props.Component,index:R.props.index,path:R.props.path,loader:R.props.loader,action:R.props.action,errorElement:R.props.errorElement,ErrorBoundary:R.props.ErrorBoundary,hasErrorBoundary:R.props.ErrorBoundary!=null||R.props.errorElement!=null,shouldRevalidate:R.props.shouldRevalidate,handle:R.props.handle,lazy:R.props.lazy};R.props.children&&(L.children=qe(R.props.children,T)),v.push(L)}),v}function ur(l){return Mt(l)}function At(l){let s={hasErrorBoundary:l.ErrorBoundary!=null||l.errorElement!=null};return l.Component&&Object.assign(s,{element:React.createElement(l.Component),Component:void 0}),l.HydrateFallback&&Object.assign(s,{hydrateFallbackElement:React.createElement(l.HydrateFallback),HydrateFallback:void 0}),l.ErrorBoundary&&Object.assign(s,{errorElement:React.createElement(l.ErrorBoundary),ErrorBoundary:void 0}),s}function Jr(l,s){return createRouter({basename:s==null?void 0:s.basename,future:Me({},s==null?void 0:s.future,{v7_prependBasename:!0}),history:createMemoryHistory({initialEntries:s==null?void 0:s.initialEntries,initialIndex:s==null?void 0:s.initialIndex}),hydrationData:s==null?void 0:s.hydrationData,routes:l,mapRouteProperties:At}).initialize()}},75696:function(Wr,Kt,et){et.d(Kt,{Cm:function(){return Pe},En:function(){return Ie},Ep:function(){return Re},M5:function(){return tr},MP:function(){return Zt},O8:function(){return ie},So:function(){return y},Wi:function(){return Me},Yz:function(){return fe},_:function(){return rr},ay:function(){return ft},e8:function(){return pt},mc:function(){return Se},q4:function(){return k}});/**
|
|
11
|
-
* @remix-run/router v1.14.2
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Remix Software Inc.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/function H(){return H=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},H.apply(this,arguments)}var y;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(y||(y={}));const B="popstate";function Me(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:r,v5Compat:n=!1}=e,a;a=t.map((x,C)=>m(x,typeof x=="string"?null:x.state,C===0?"default":void 0));let d=h(r==null?a.length-1:r),i=y.Pop,p=null;function h(x){return Math.min(Math.max(x,0),a.length-1)}function b(){return a[d]}function m(x,C,P){C===void 0&&(C=null);let w=be(a?b().pathname:"/",x,C,P);return se(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(x)),w}function _(x){return typeof x=="string"?x:Re(x)}return{get index(){return d},get action(){return i},get location(){return b()},createHref:_,createURL(x){return new URL(_(x),"http://localhost")},encodeLocation(x){let C=typeof x=="string"?ie(x):x;return{pathname:C.pathname||"",search:C.search||"",hash:C.hash||""}},push(x,C){i=y.Push;let P=m(x,C);d+=1,a.splice(d,a.length,P),n&&p&&p({action:i,location:P,delta:1})},replace(x,C){i=y.Replace;let P=m(x,C);a[d]=P,n&&p&&p({action:i,location:P,delta:0})},go(x){i=y.Pop;let C=h(d+x),P=a[C];d=C,p&&p({action:i,location:P,delta:x})},listen(x){return p=x,()=>{p=null}}}}function ut(e){e===void 0&&(e={});function t(n,a){let{pathname:d,search:i,hash:p}=n.location;return be("",{pathname:d,search:i,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Re(a)}return Te(t,r,null,e)}function $t(e){e===void 0&&(e={});function t(a,d){let{pathname:i="/",search:p="",hash:h=""}=ie(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),be("",{pathname:i,search:p,hash:h},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(a,d){let i=a.document.querySelector("base"),p="";if(i&&i.getAttribute("href")){let h=a.location.href,b=h.indexOf("#");p=b===-1?h:h.slice(0,b)}return p+"#"+(typeof d=="string"?d:Re(d))}function n(a,d){se(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(d)+")")}return Te(t,r,n,e)}function k(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function se(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch{}}}function $e(){return Math.random().toString(36).substr(2,8)}function ve(e,t){return{usr:e.state,key:e.key,idx:t}}function be(e,t,r,n){return r===void 0&&(r=null),H({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ie(t):t,{state:r,key:t&&t.key||n||$e()})}function Re(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 ie(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 Te(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:d=!1}=n,i=a.history,p=y.Pop,h=null,b=m();b==null&&(b=0,i.replaceState(H({},i.state,{idx:b}),""));function m(){return(i.state||{idx:null}).idx}function _(){p=y.Pop;let w=m(),g=w==null?null:w-b;b=w,h&&h({action:p,location:P.location,delta:g})}function E(w,g){p=y.Push;let F=be(P.location,w,g);r&&r(F,w),b=m()+1;let q=ve(F,b),V=P.createHref(F);try{i.pushState(q,"",V)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;a.location.assign(V)}d&&h&&h({action:p,location:P.location,delta:1})}function x(w,g){p=y.Replace;let F=be(P.location,w,g);r&&r(F,w),b=m();let q=ve(F,b),V=P.createHref(F);i.replaceState(q,"",V),d&&h&&h({action:p,location:P.location,delta:0})}function C(w){let g=a.location.origin!=="null"?a.location.origin:a.location.href,F=typeof w=="string"?w:Re(w);return k(g,"No window.location.(origin|href) available to create URL for href: "+F),new URL(F,g)}let P={get action(){return p},get location(){return e(a,i)},listen(w){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(B,_),h=w,()=>{a.removeEventListener(B,_),h=null}},createHref(w){return t(a,w)},createURL:C,encodeLocation(w){let g=C(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:E,replace:x,go(w){return i.go(w)}};return P}var Q;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q||(Q={}));const Rr=new Set(["lazy","caseSensitive","path","id","index","children"]);function Er(e){return e.index===!0}function Je(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,d)=>{let i=[...r,d],p=typeof a.id=="string"?a.id:i.join("-");if(k(a.index!==!0||!a.children,"Cannot specify children on an index route"),k(!n[p],'Found a route id collision on id "'+p+`". Route id's must be globally unique within Data Router usages`),Er(a)){let h=H({},a,t(a),{id:p});return n[p]=h,h}else{let h=H({},a,t(a),{id:p,children:void 0});return n[p]=h,a.children&&(h.children=Je(a.children,t,i,n)),h}})}function Pe(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ie(t):t,a=Se(n.pathname||"/",r);if(a==null)return null;let d=dt(e);Dt(d);let i=null;for(let p=0;i==null&&p<d.length;++p)i=tt(d[p],_e(a));return i}function Jt(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 dt(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(d,i,p)=>{let h={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:i,route:d};h.relativePath.startsWith("/")&&(k(h.relativePath.startsWith(n),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(n.length));let b=Ie([n,h.relativePath]),m=r.concat(h);d.children&&d.children.length>0&&(k(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+b+'".')),dt(d.children,t,m,b)),!(d.path==null&&!d.index)&&t.push({path:b,score:Gt(b,d.index),routesMeta:m})};return e.forEach((d,i)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))a(d,i);else for(let h of Vt(d.path))a(d,i,h)}),t}function Vt(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),d=r.replace(/\?$/,"");if(n.length===0)return a?[d,""]:[d];let i=Vt(n.join("/")),p=[];return p.push(...i.map(h=>h===""?d:[d,h].join("/"))),a&&p.push(...i),p.map(h=>e.startsWith("/")&&h===""?"/":h)}function Dt(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Mt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qt=/^:[\w-]+$/,Pt=3,St=2,Ct=1,Yt=10,Xt=-2,Lt=e=>e==="*";function Gt(e,t){let r=e.split("/"),n=r.length;return r.some(Lt)&&(n+=Xt),t&&(n+=St),r.filter(a=>!Lt(a)).reduce((a,d)=>a+(qt.test(d)?Pt:d===""?Ct:Yt),n)}function Mt(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 tt(e,t){let{routesMeta:r}=e,n={},a="/",d=[];for(let i=0;i<r.length;++i){let p=r[i],h=i===r.length-1,b=a==="/"?t:t.slice(a.length)||"/",m=wr({path:p.relativePath,caseSensitive:p.caseSensitive,end:h},b);if(!m)return null;Object.assign(n,m.params);let _=p.route;d.push({params:n,pathname:Ie([a,m.pathname]),pathnameBase:nr(Ie([a,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(a=Ie([a,m.pathnameBase]))}return d}function fe(e,t){t===void 0&&(t={});let r=e;r.endsWith("*")&&r!=="*"&&!r.endsWith("/*")&&(se(!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),d=r.split(/\/+/).map((i,p,h)=>{if(p===h.length-1&&i==="*")return a(t["*"]);const m=i.match(/^:([\w-]+)(\??)$/);if(m){const[,_,E]=m;let x=t[_];return k(E==="?"||x!=null,'Missing ":'+_+'" param'),a(x)}return i.replace(/\?$/g,"")}).filter(i=>!!i);return n+d.join("/")}function wr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ct(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let d=a[0],i=d.replace(/(.)\/+$/,"$1"),p=a.slice(1);return{params:n.reduce((b,m,_)=>{let{paramName:E,isOptional:x}=m;if(E==="*"){let P=p[_]||"";i=d.slice(0,d.length-P.length).replace(/(.)\/+$/,"$1")}const C=p[_];return x&&!C?b[E]=void 0:b[E]=Qt(C||"",E),b},{}),pathname:d,pathnameBase:i,pattern:e}}function ct(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),se(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,p,h)=>(n.push({paramName:p,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function _e(e){try{return decodeURI(e)}catch(t){return se(!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 Qt(e,t){try{return decodeURIComponent(e)}catch(r){return se(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Se(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 Zt(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ie(e):e;return{pathname:r?r.startsWith("/")?r:xr(r,t):t,search:Dr(n),hash:ar(a)}}function xr(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 _t(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 er(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function tr(e,t){let r=er(e);return t?r.map((n,a)=>a===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function rr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ie(e):(a=H({},e),k(!a.pathname||!a.pathname.includes("?"),_t("?","pathname","search",a)),k(!a.pathname||!a.pathname.includes("#"),_t("#","pathname","hash",a)),k(!a.search||!a.search.includes("#"),_t("#","search","hash",a)));let d=e===""||a.pathname==="",i=d?"/":a.pathname,p;if(i==null)p=r;else{let _=t.length-1;if(!n&&i.startsWith("..")){let E=i.split("/");for(;E[0]==="..";)E.shift(),_-=1;a.pathname=E.join("/")}p=_>=0?t[_]:"/"}let h=Zt(a,p),b=i&&i!=="/"&&i.endsWith("/"),m=(d||i===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(b||m)&&(h.pathname+="/"),h}function Kr(e){return e===""||e.pathname===""?"/":typeof e=="string"?ie(e).pathname:e.pathname}const Ie=e=>e.join("/").replace(/\/\/+/g,"/"),nr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Dr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ar=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$r=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),H({},n,{headers:a}))};class ft extends Error{}class Ot{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],k(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((d,i)=>n=i),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((d,i)=>{let[p,h]=i;return Object.assign(d,{[p]:this.trackPromise(p,h)})},{}),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 d=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:()=>d}),this.emit(!1,r),Promise.reject(d)}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(d=>{t.removeEventListener("abort",n),(d||this.done)&&a(d)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return k(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]:ir(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function or(e){return e instanceof Promise&&e._tracked===!0}function ir(e){if(!or(e))return e;if(e._error)throw e._error;return e._data}const ht=function(t,r){r===void 0&&(r={});let n=typeof r=="number"?{status:r}:r;return new Ot(t,n)},Pr=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status=="undefined"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,H({},n,{headers:a}))},Sr=(e,t)=>{let r=Pr(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Ut{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 pt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Tt=["post","put","patch","delete"],jt=new Set(Tt),mt=["get",...Tt],lr=new Set(mt),Cr=new Set([301,302,303,307,308]),me=new Set([307,308]),vt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ve={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ur=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),At="remix-router-transitions";function Jr(e){const t=e.window?e.window:typeof window!="undefined"?window:void 0,r=typeof t!="undefined"&&typeof t.document!="undefined"&&typeof t.document.createElement!="undefined",n=!r;k(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 o=e.detectErrorBoundary;a=u=>({hasErrorBoundary:o(u)})}else a=ur;let d={},i=Je(e.routes,a,void 0,d),p,h=e.basename||"/",b=H({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,_=new Set,E=null,x=null,C=null,P=e.hydrationData!=null,w=Pe(i,e.history.location,h),g=null;if(w==null){let o=oe(404,{pathname:e.history.location.pathname}),{matches:u,route:f}=Ft(i);w=u,g={[f.id]:o}}let F,q=w.some(o=>o.route.lazy),V=w.some(o=>o.route.loader);if(q)F=!1;else if(!V)F=!0;else if(b.v7_partialHydration){let o=e.hydrationData?e.hydrationData.loaderData:null,u=e.hydrationData?e.hydrationData.errors:null;F=w.every(f=>f.route.loader&&f.route.loader.hydrate!==!0&&(o&&o[f.route.id]!==void 0||u&&u[f.route.id]!==void 0))}else F=e.hydrationData!=null;let Y,c={historyAction:e.history.action,location:e.history.location,matches:w,initialized:F,navigation:vt,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||g,fetchers:new Map,blockers:new Map},G=y.Pop,K=!1,ee,Oe=!1,xe=new Map,Le=null,nt=!1,Ye=!1,It=[],Nt=[],le=new Map,Bt=0,bt=-1,at=new Map,Ae=new Set,ot=new Map,Rt=new Map,Fe=new Set,Xe=new Map,Ge=new Map,hr=!1;function tn(){if(m=e.history.listen(o=>{let{action:u,location:f,delta:D}=o;if(hr){hr=!1;return}se(Ge.size===0||D!=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 M=kr({currentLocation:c.location,nextLocation:f,historyAction:u});if(M&&D!=null){hr=!0,e.history.go(D*-1),zt(M,{state:"blocked",location:f,proceed(){zt(M,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),e.history.go(D)},reset(){let N=new Map(c.blockers);N.set(M,Ve),ye({blockers:N})}});return}return Qe(u,f)}),r){Zr(t,xe);let o=()=>en(t,xe);t.addEventListener("pagehide",o),Le=()=>t.removeEventListener("pagehide",o)}return c.initialized||Qe(y.Pop,c.location,{initialHydration:!0}),Y}function rn(){m&&m(),Le&&Le(),_.clear(),ee&&ee.abort(),c.fetchers.forEach((o,u)=>kt(u)),c.blockers.forEach((o,u)=>Br(u))}function nn(o){return _.add(o),()=>_.delete(o)}function ye(o,u){u===void 0&&(u={}),c=H({},c,o);let f=[],D=[];b.v7_fetcherPersist&&c.fetchers.forEach((M,N)=>{M.state==="idle"&&(Fe.has(N)?D.push(N):f.push(N))}),[..._].forEach(M=>M(c,{deletedFetchers:D,unstable_viewTransitionOpts:u.viewTransitionOpts,unstable_flushSync:u.flushSync===!0})),b.v7_fetcherPersist&&(f.forEach(M=>c.fetchers.delete(M)),D.forEach(M=>kt(M)))}function Et(o,u,f){var D,M;let{flushSync:N}=f===void 0?{}:f,A=c.actionData!=null&&c.navigation.formMethod!=null&&we(c.navigation.formMethod)&&c.navigation.state==="loading"&&((D=o.state)==null?void 0:D._isRedirect)!==!0,j;u.actionData?Object.keys(u.actionData).length>0?j=u.actionData:j=null:A?j=c.actionData:j=null;let O=u.loaderData?he(c.loaderData,u.loaderData,u.matches||[],u.errors):c.loaderData,$=c.blockers;$.size>0&&($=new Map($),$.forEach((re,ce)=>$.set(ce,Ve)));let ue=K===!0||c.navigation.formMethod!=null&&we(c.navigation.formMethod)&&((M=o.state)==null?void 0:M._isRedirect)!==!0;p&&(i=p,p=void 0),nt||G===y.Pop||(G===y.Push?e.history.push(o,o.state):G===y.Replace&&e.history.replace(o,o.state));let I;if(G===y.Pop){let re=xe.get(c.location.pathname);re&&re.has(o.pathname)?I={currentLocation:c.location,nextLocation:o}:xe.has(o.pathname)&&(I={currentLocation:o,nextLocation:c.location})}else if(Oe){let re=xe.get(c.location.pathname);re?re.add(o.pathname):(re=new Set([o.pathname]),xe.set(c.location.pathname,re)),I={currentLocation:c.location,nextLocation:o}}ye(H({},u,{actionData:j,loaderData:O,historyAction:G,location:o,initialized:!0,navigation:vt,revalidation:"idle",restoreScrollPosition:Hr(o,u.matches||c.matches),preventScrollReset:ue,blockers:$}),{viewTransitionOpts:I,flushSync:N===!0}),G=y.Pop,K=!1,Oe=!1,nt=!1,Ye=!1,It=[],Nt=[]}async function Tr(o,u){if(typeof o=="number"){e.history.go(o);return}let f=S(c.location,c.matches,h,b.v7_prependBasename,o,b.v7_relativeSplatPath,u==null?void 0:u.fromRouteId,u==null?void 0:u.relative),{path:D,submission:M,error:N}=T(b.v7_normalizeFormMethod,!1,f,u),A=c.location,j=be(c.location,D,u&&u.state);j=H({},j,e.history.encodeLocation(j));let O=u&&u.replace!=null?u.replace:void 0,$=y.Push;O===!0?$=y.Replace:O===!1||M!=null&&we(M.formMethod)&&M.formAction===c.location.pathname+c.location.search&&($=y.Replace);let ue=u&&"preventScrollReset"in u?u.preventScrollReset===!0:void 0,I=(u&&u.unstable_flushSync)===!0,re=kr({currentLocation:A,nextLocation:j,historyAction:$});if(re){zt(re,{state:"blocked",location:j,proceed(){zt(re,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),Tr(o,u)},reset(){let ce=new Map(c.blockers);ce.set(re,Ve),ye({blockers:ce})}});return}return await Qe($,j,{submission:M,pendingError:N,preventScrollReset:ue,replace:u&&u.replace,enableViewTransition:u&&u.unstable_viewTransition,flushSync:I})}function an(){if(pr(),ye({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){Qe(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}Qe(G||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function Qe(o,u,f){ee&&ee.abort(),ee=null,G=o,nt=(f&&f.startUninterruptedRevalidation)===!0,pn(c.location,c.matches),K=(f&&f.preventScrollReset)===!0,Oe=(f&&f.enableViewTransition)===!0;let D=p||i,M=f&&f.overrideNavigation,N=Pe(D,u,h),A=(f&&f.flushSync)===!0;if(!N){let ce=oe(404,{pathname:u.pathname}),{matches:De,route:de}=Ft(D);mr(),Et(u,{matches:De,loaderData:{},errors:{[de.id]:ce}},{flushSync:A});return}if(c.initialized&&!Ye&&Vr(c.location,u)&&!(f&&f.submission&&we(f.submission.formMethod))){Et(u,{matches:N},{flushSync:A});return}ee=new AbortController;let j=ne(e.history,u,ee.signal,f&&f.submission),O,$;if(f&&f.pendingError)$={[ge(N).route.id]:f.pendingError};else if(f&&f.submission&&we(f.submission.formMethod)){let ce=await on(j,u,f.submission,N,{replace:f.replace,flushSync:A});if(ce.shortCircuited)return;O=ce.pendingActionData,$=ce.pendingActionError,M=fr(u,f.submission),A=!1,j=new Request(j.url,{signal:j.signal})}let{shortCircuited:ue,loaderData:I,errors:re}=await ln(j,u,N,M,f&&f.submission,f&&f.fetcherSubmission,f&&f.replace,f&&f.initialHydration===!0,A,O,$);ue||(ee=null,Et(u,H({matches:N},O?{actionData:O}:{},{loaderData:I,errors:re})))}async function on(o,u,f,D,M){M===void 0&&(M={}),pr();let N=Gr(u,f);ye({navigation:N},{flushSync:M.flushSync===!0});let A,j=gt(D,u);if(!j.route.action&&!j.route.lazy)A={type:Q.error,error:oe(405,{method:o.method,pathname:u.pathname,routeId:j.route.id})};else if(A=await X("action",o,j,D,d,a,h,b.v7_relativeSplatPath),o.signal.aborted)return{shortCircuited:!0};if(ke(A)){let O;return M&&M.replace!=null?O=M.replace:O=A.location===c.location.pathname+c.location.search,await wt(c,A,{submission:f,replace:O}),{shortCircuited:!0}}if(Be(A)){let O=ge(D,j.route.id);return(M&&M.replace)!==!0&&(G=y.Push),{pendingActionData:{},pendingActionError:{[O.route.id]:A.error}}}if(Ne(A))throw oe(400,{type:"defer-action"});return{pendingActionData:{[j.route.id]:A.data}}}async function ln(o,u,f,D,M,N,A,j,O,$,ue){let I=D||fr(u,M),re=M||N||Ur(I),ce=p||i,[De,de]=W(e.history,c,f,re,u,b.v7_partialHydration&&j===!0,Ye,It,Nt,Fe,ot,Ae,ce,h,$,ue);if(mr(te=>!(f&&f.some(ae=>ae.route.id===te))||De&&De.some(ae=>ae.route.id===te)),bt=++Bt,De.length===0&&de.length===0){let te=Ir();return Et(u,H({matches:f,loaderData:{},errors:ue||null},$?{actionData:$}:{},te?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O}),{shortCircuited:!0}}if(!nt&&(!b.v7_partialHydration||!j)){de.forEach(ae=>{let Ue=c.fetchers.get(ae.key),Wt=yt(void 0,Ue?Ue.data:void 0);c.fetchers.set(ae.key,Wt)});let te=$||c.actionData;ye(H({navigation:I},te?Object.keys(te).length===0?{actionData:null}:{actionData:te}:{},de.length>0?{fetchers:new Map(c.fetchers)}:{}),{flushSync:O})}de.forEach(te=>{le.has(te.key)&&We(te.key),te.controller&&le.set(te.key,te.controller)});let it=()=>de.forEach(te=>We(te.key));ee&&ee.signal.addEventListener("abort",it);let{results:vr,loaderResults:lt,fetcherResults:Ke}=await jr(c.matches,f,De,de,o);if(o.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener("abort",it),de.forEach(te=>le.delete(te.key));let Ze=Lr(vr);if(Ze){if(Ze.idx>=De.length){let te=de[Ze.idx-De.length].key;Ae.add(te)}return await wt(c,Ze.result,{replace:A}),{shortCircuited:!0}}let{loaderData:gr,errors:yr}=je(c,f,De,lt,ue,de,Ke,Xe);Xe.forEach((te,ae)=>{te.subscribe(Ue=>{(Ue||te.done)&&Xe.delete(ae)})});let br=Ir(),st=Nr(bt),Ht=br||st||de.length>0;return H({loaderData:gr,errors:yr},Ht?{fetchers:new Map(c.fetchers)}:{})}function sn(o,u,f,D){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.");le.has(o)&&We(o);let M=(D&&D.unstable_flushSync)===!0,N=p||i,A=S(c.location,c.matches,h,b.v7_prependBasename,f,b.v7_relativeSplatPath,u,D==null?void 0:D.relative),j=Pe(N,A,h);if(!j){xt(o,u,oe(404,{pathname:A}),{flushSync:M});return}let{path:O,submission:$,error:ue}=T(b.v7_normalizeFormMethod,!0,A,D);if(ue){xt(o,u,ue,{flushSync:M});return}let I=gt(j,O);if(K=(D&&D.preventScrollReset)===!0,$&&we($.formMethod)){un(o,u,O,I,j,M,$);return}ot.set(o,{routeId:u,path:O}),dn(o,u,O,I,j,M,$)}async function un(o,u,f,D,M,N,A){if(pr(),ot.delete(o),!D.route.action&&!D.route.lazy){let ae=oe(405,{method:A.formMethod,pathname:f,routeId:u});xt(o,u,ae,{flushSync:N});return}let j=c.fetchers.get(o);He(o,Qr(A,j),{flushSync:N});let O=new AbortController,$=ne(e.history,f,O.signal,A);le.set(o,O);let ue=Bt,I=await X("action",$,D,M,d,a,h,b.v7_relativeSplatPath);if($.signal.aborted){le.get(o)===O&&le.delete(o);return}if(b.v7_fetcherPersist&&Fe.has(o)){if(ke(I)||Be(I)){He(o,ze(void 0));return}}else{if(ke(I))if(le.delete(o),bt>ue){He(o,ze(void 0));return}else return Ae.add(o),He(o,yt(A)),wt(c,I,{fetcherSubmission:A});if(Be(I)){xt(o,u,I.error);return}}if(Ne(I))throw oe(400,{type:"defer-action"});let re=c.navigation.location||c.location,ce=ne(e.history,re,O.signal),De=p||i,de=c.navigation.state!=="idle"?Pe(De,c.navigation.location,h):c.matches;k(de,"Didn't find any matches after fetcher action");let it=++Bt;at.set(o,it);let vr=yt(A,I.data);c.fetchers.set(o,vr);let[lt,Ke]=W(e.history,c,de,A,re,!1,Ye,It,Nt,Fe,ot,Ae,De,h,{[D.route.id]:I.data},void 0);Ke.filter(ae=>ae.key!==o).forEach(ae=>{let Ue=ae.key,Wt=c.fetchers.get(Ue),vn=yt(void 0,Wt?Wt.data:void 0);c.fetchers.set(Ue,vn),le.has(Ue)&&We(Ue),ae.controller&&le.set(Ue,ae.controller)}),ye({fetchers:new Map(c.fetchers)});let Ze=()=>Ke.forEach(ae=>We(ae.key));O.signal.addEventListener("abort",Ze);let{results:gr,loaderResults:yr,fetcherResults:br}=await jr(c.matches,de,lt,Ke,ce);if(O.signal.aborted)return;O.signal.removeEventListener("abort",Ze),at.delete(o),le.delete(o),Ke.forEach(ae=>le.delete(ae.key));let st=Lr(gr);if(st){if(st.idx>=lt.length){let ae=Ke[st.idx-lt.length].key;Ae.add(ae)}return wt(c,st.result)}let{loaderData:Ht,errors:te}=je(c,c.matches,lt,yr,void 0,Ke,br,Xe);if(c.fetchers.has(o)){let ae=ze(I.data);c.fetchers.set(o,ae)}Nr(it),c.navigation.state==="loading"&&it>bt?(k(G,"Expected pending action"),ee&&ee.abort(),Et(c.navigation.location,{matches:de,loaderData:Ht,errors:te,fetchers:new Map(c.fetchers)})):(ye({errors:te,loaderData:he(c.loaderData,Ht,de,te),fetchers:new Map(c.fetchers)}),Ye=!1)}async function dn(o,u,f,D,M,N,A){let j=c.fetchers.get(o);He(o,yt(A,j?j.data:void 0),{flushSync:N});let O=new AbortController,$=ne(e.history,f,O.signal);le.set(o,O);let ue=Bt,I=await X("loader",$,D,M,d,a,h,b.v7_relativeSplatPath);if(Ne(I)&&(I=await Or(I,$.signal,!0)||I),le.get(o)===O&&le.delete(o),!$.signal.aborted){if(Fe.has(o)){He(o,ze(void 0));return}if(ke(I))if(bt>ue){He(o,ze(void 0));return}else{Ae.add(o),await wt(c,I);return}if(Be(I)){xt(o,u,I.error);return}k(!Ne(I),"Unhandled fetcher deferred data"),He(o,ze(I.data))}}async function wt(o,u,f){let{submission:D,fetcherSubmission:M,replace:N}=f===void 0?{}:f;u.revalidate&&(Ye=!0);let A=be(o.location,u.location,{_isRedirect:!0});if(k(A,"Expected a location on the redirect navigation"),r){let re=!1;if(u.reloadDocument)re=!0;else if(qe.test(u.location)){const ce=e.history.createURL(u.location);re=ce.origin!==t.location.origin||Se(ce.pathname,h)==null}if(re){N?t.location.replace(u.location):t.location.assign(u.location);return}}ee=null;let j=N===!0?y.Replace:y.Push,{formMethod:O,formAction:$,formEncType:ue}=o.navigation;!D&&!M&&O&&$&&ue&&(D=Ur(o.navigation));let I=D||M;if(me.has(u.status)&&I&&we(I.formMethod))await Qe(j,A,{submission:H({},I,{formAction:u.location}),preventScrollReset:K});else{let re=fr(A,D);await Qe(j,A,{overrideNavigation:re,fetcherSubmission:M,preventScrollReset:K})}}async function jr(o,u,f,D,M){let N=await Promise.all([...f.map(O=>X("loader",M,O,u,d,a,h,b.v7_relativeSplatPath)),...D.map(O=>O.matches&&O.match&&O.controller?X("loader",ne(e.history,O.path,O.controller.signal),O.match,O.matches,d,a,h,b.v7_relativeSplatPath):{type:Q.error,error:oe(404,{pathname:O.path})})]),A=N.slice(0,f.length),j=N.slice(f.length);return await Promise.all([_r(o,f,A,A.map(()=>M.signal),!1,c.loaderData),_r(o,D.map(O=>O.match),j,D.map(O=>O.controller?O.controller.signal:null),!0)]),{results:N,loaderResults:A,fetcherResults:j}}function pr(){Ye=!0,It.push(...mr()),ot.forEach((o,u)=>{le.has(u)&&(Nt.push(u),We(u))})}function He(o,u,f){f===void 0&&(f={}),c.fetchers.set(o,u),ye({fetchers:new Map(c.fetchers)},{flushSync:(f&&f.flushSync)===!0})}function xt(o,u,f,D){D===void 0&&(D={});let M=ge(c.matches,u);kt(o),ye({errors:{[M.route.id]:f},fetchers:new Map(c.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function Ar(o){return b.v7_fetcherPersist&&(Rt.set(o,(Rt.get(o)||0)+1),Fe.has(o)&&Fe.delete(o)),c.fetchers.get(o)||sr}function kt(o){let u=c.fetchers.get(o);le.has(o)&&!(u&&u.state==="loading"&&at.has(o))&&We(o),ot.delete(o),at.delete(o),Ae.delete(o),Fe.delete(o),c.fetchers.delete(o)}function cn(o){if(b.v7_fetcherPersist){let u=(Rt.get(o)||0)-1;u<=0?(Rt.delete(o),Fe.add(o)):Rt.set(o,u)}else kt(o);ye({fetchers:new Map(c.fetchers)})}function We(o){let u=le.get(o);k(u,"Expected fetch controller: "+o),u.abort(),le.delete(o)}function Fr(o){for(let u of o){let f=Ar(u),D=ze(f.data);c.fetchers.set(u,D)}}function Ir(){let o=[],u=!1;for(let f of Ae){let D=c.fetchers.get(f);k(D,"Expected fetcher: "+f),D.state==="loading"&&(Ae.delete(f),o.push(f),u=!0)}return Fr(o),u}function Nr(o){let u=[];for(let[f,D]of at)if(D<o){let M=c.fetchers.get(f);k(M,"Expected fetcher: "+f),M.state==="loading"&&(We(f),at.delete(f),u.push(f))}return Fr(u),u.length>0}function fn(o,u){let f=c.blockers.get(o)||Ve;return Ge.get(o)!==u&&Ge.set(o,u),f}function Br(o){c.blockers.delete(o),Ge.delete(o)}function zt(o,u){let f=c.blockers.get(o)||Ve;k(f.state==="unblocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="blocked"||f.state==="blocked"&&u.state==="proceeding"||f.state==="blocked"&&u.state==="unblocked"||f.state==="proceeding"&&u.state==="unblocked","Invalid blocker state transition: "+f.state+" -> "+u.state);let D=new Map(c.blockers);D.set(o,u),ye({blockers:D})}function kr(o){let{currentLocation:u,nextLocation:f,historyAction:D}=o;if(Ge.size===0)return;Ge.size>1&&se(!1,"A router only supports one blocker at a time");let M=Array.from(Ge.entries()),[N,A]=M[M.length-1],j=c.blockers.get(N);if(!(j&&j.state==="proceeding")&&A({currentLocation:u,nextLocation:f,historyAction:D}))return N}function mr(o){let u=[];return Xe.forEach((f,D)=>{(!o||o(D))&&(f.cancel(),u.push(D),Xe.delete(D))}),u}function hn(o,u,f){if(E=o,C=u,x=f||null,!P&&c.navigation===vt){P=!0;let D=Hr(c.location,c.matches);D!=null&&ye({restoreScrollPosition:D})}return()=>{E=null,C=null,x=null}}function zr(o,u){return x&&x(o,u.map(D=>Jt(D,c.loaderData)))||o.key}function pn(o,u){if(E&&C){let f=zr(o,u);E[f]=C()}}function Hr(o,u){if(E){let f=zr(o,u),D=E[f];if(typeof D=="number")return D}return null}function mn(o){d={},p=Je(o,a,void 0,d)}return Y={get basename(){return h},get future(){return b},get state(){return c},get routes(){return i},get window(){return t},initialize:tn,subscribe:nn,enableScrollRestoration:hn,navigate:Tr,fetch:sn,revalidate:an,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:Ar,deleteFetcher:cn,dispose:rn,getBlocker:fn,deleteBlocker:Br,_internalFetchControllers:le,_internalActiveDeferreds:Xe,_internalSetRoutes:mn},Y}const l=Symbol("deferred");function s(e,t){k(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 E=t.detectErrorBoundary;a=x=>({hasErrorBoundary:E(x)})}else a=ur;let d=H({v7_relativeSplatPath:!1},t?t.future:null),i=Je(e,a,void 0,r);async function p(E,x){let{requestContext:C}=x===void 0?{}:x,P=new URL(E.url),w=E.method,g=be("",Re(P),null,"default"),F=Pe(i,g,n);if(!dr(w)&&w!=="HEAD"){let V=oe(405,{method:w}),{matches:Y,route:c}=Ft(i);return{basename:n,location:g,matches:Y,loaderData:{},actionData:null,errors:{[c.id]:V},statusCode:V.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}else if(!F){let V=oe(404,{pathname:g.pathname}),{matches:Y,route:c}=Ft(i);return{basename:n,location:g,matches:Y,loaderData:{},actionData:null,errors:{[c.id]:V},statusCode:V.status,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}let q=await b(E,g,F,C);return rt(q)?q:H({location:g,basename:n},q)}async function h(E,x){let{routeId:C,requestContext:P}=x===void 0?{}:x,w=new URL(E.url),g=E.method,F=be("",Re(w),null,"default"),q=Pe(i,F,n);if(!dr(g)&&g!=="HEAD"&&g!=="OPTIONS")throw oe(405,{method:g});if(!q)throw oe(404,{pathname:F.pathname});let V=C?q.find(K=>K.route.id===C):gt(q,F);if(C&&!V)throw oe(403,{pathname:F.pathname,routeId:C});if(!V)throw oe(404,{pathname:F.pathname});let Y=await b(E,F,q,P,V);if(rt(Y))return Y;let c=Y.errors?Object.values(Y.errors)[0]:void 0;if(c!==void 0)throw c;if(Y.actionData)return Object.values(Y.actionData)[0];if(Y.loaderData){var G;let K=Object.values(Y.loaderData)[0];return(G=Y.activeDeferreds)!=null&&G[V.route.id]&&(K[l]=Y.activeDeferreds[V.route.id]),K}}async function b(E,x,C,P,w){k(E.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(we(E.method.toLowerCase()))return await m(E,C,w||gt(C,x),P,w!=null);let g=await _(E,C,P,w);return rt(g)?g:H({},g,{actionData:null,actionHeaders:{}})}catch(g){if(Xr(g)){if(g.type===Q.error)throw g.response;return g.response}if(Yr(g))return g;throw g}}async function m(E,x,C,P,w){let g;if(!C.route.action&&!C.route.lazy){let V=oe(405,{method:E.method,pathname:new URL(E.url).pathname,routeId:C.route.id});if(w)throw V;g={type:Q.error,error:V}}else if(g=await X("action",E,C,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:w,requestContext:P}),E.signal.aborted){let V=w?"queryRoute":"query";throw new Error(V+"() call aborted: "+E.method+" "+E.url)}if(ke(g))throw new Response(null,{status:g.status,headers:{Location:g.location}});if(Ne(g)){let V=oe(400,{type:"defer-action"});if(w)throw V;g={type:Q.error,error:V}}if(w){if(Be(g))throw g.error;return{matches:[C],loaderData:{},actionData:{[C.route.id]:g.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{},activeDeferreds:null}}if(Be(g)){let V=ge(x,C.route.id),Y=await _(E,x,P,void 0,{[V.route.id]:g.error});return H({},Y,{statusCode:pt(g.error)?g.error.status:500,actionData:null,actionHeaders:H({},g.headers?{[C.route.id]:g.headers}:{})})}let F=new Request(E.url,{headers:E.headers,redirect:E.redirect,signal:E.signal}),q=await _(F,x,P);return H({},q,g.statusCode?{statusCode:g.statusCode}:{},{actionData:{[C.route.id]:g.data},actionHeaders:H({},g.headers?{[C.route.id]:g.headers}:{})})}async function _(E,x,C,P,w){let g=P!=null;if(g&&!(P!=null&&P.route.loader)&&!(P!=null&&P.route.lazy))throw oe(400,{method:E.method,pathname:new URL(E.url).pathname,routeId:P==null?void 0:P.route.id});let q=(P?[P]:L(x,Object.keys(w||{})[0])).filter(K=>K.route.loader||K.route.lazy);if(q.length===0)return{matches:x,loaderData:x.reduce((K,ee)=>Object.assign(K,{[ee.route.id]:null}),{}),errors:w||null,statusCode:200,loaderHeaders:{},activeDeferreds:null};let V=await Promise.all([...q.map(K=>X("loader",E,K,x,r,a,n,d.v7_relativeSplatPath,{isStaticRequest:!0,isRouteRequest:g,requestContext:C}))]);if(E.signal.aborted){let K=g?"queryRoute":"query";throw new Error(K+"() call aborted: "+E.method+" "+E.url)}let Y=new Map,c=Ee(x,q,V,w,Y),G=new Set(q.map(K=>K.route.id));return x.forEach(K=>{G.has(K.route.id)||(c.loaderData[K.route.id]=null)}),H({},c,{matches:x,activeDeferreds:Y.size>0?Object.fromEntries(Y.entries()):null})}return{dataRoutes:i,query:p,queryRoute:h}}function v(e,t,r){return H({},t,{statusCode:500,errors:{[t._deepestRenderedBoundaryId||e[0].id]:r}})}function R(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function S(e,t,r,n,a,d,i,p){let h,b;if(i){h=[];for(let _ of t)if(h.push(_),_.route.id===i){b=_;break}}else h=t,b=t[t.length-1];let m=rr(a||".",tr(h,d),Se(e.pathname,r)||e.pathname,p==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&b&&b.route.index&&!cr(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ie([r,m.pathname])),Re(m)}function T(e,t,r,n){if(!n||!R(n))return{path:r};if(n.formMethod&&!dr(n.formMethod))return{path:r,error:oe(405,{method:n.formMethod})};let a=()=>({path:r,error:oe(400,{type:"invalid-body"})}),d=n.formMethod||"get",i=e?d.toUpperCase():d.toLowerCase(),p=Mr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!we(i))return a();let E=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,C)=>{let[P,w]=C;return""+x+P+"="+w+`
|
|
20
|
-
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:void 0,text:E}}}else if(n.formEncType==="application/json"){if(!we(i))return a();try{let E=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:p,formEncType:n.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}k(typeof FormData=="function","FormData is not available in this environment");let h,b;if(n.formData)h=pe(n.formData),b=n.formData;else if(n.body instanceof FormData)h=pe(n.body),b=n.body;else if(n.body instanceof URLSearchParams)h=n.body,b=Ce(h);else if(n.body==null)h=new URLSearchParams,b=new FormData;else try{h=new URLSearchParams(n.body),b=Ce(h)}catch{return a()}let m={formMethod:i,formAction:p,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:b,json:void 0,text:void 0};if(we(m.formMethod))return{path:r,submission:m};let _=ie(r);return t&&_.search&&cr(_.search)&&h.append("index",""),_.search="?"+h,{path:Re(_),submission:m}}function L(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 W(e,t,r,n,a,d,i,p,h,b,m,_,E,x,C,P){let w=P?Object.values(P)[0]:C?Object.values(C)[0]:void 0,g=e.createURL(t.location),F=e.createURL(a),q=P?Object.keys(P)[0]:void 0,Y=L(r,q).filter((G,K)=>{let{route:ee}=G;if(ee.lazy)return!0;if(ee.loader==null)return!1;if(d)return ee.loader.hydrate?!0:t.loaderData[ee.id]===void 0&&(!t.errors||t.errors[ee.id]===void 0);if(Z(t.loaderData,t.matches[K],G)||p.some(Le=>Le===G.route.id))return!0;let Oe=t.matches[K],xe=G;return J(G,H({currentUrl:g,currentParams:Oe.params,nextUrl:F,nextParams:xe.params},n,{actionResult:w,defaultShouldRevalidate:i||g.pathname+g.search===F.pathname+F.search||g.search!==F.search||z(Oe,xe)}))}),c=[];return m.forEach((G,K)=>{if(d||!r.some(nt=>nt.route.id===G.routeId)||b.has(K))return;let ee=Pe(E,G.path,x);if(!ee){c.push({key:K,routeId:G.routeId,path:G.path,matches:null,match:null,controller:null});return}let Oe=t.fetchers.get(K),xe=gt(ee,G.path),Le=!1;_.has(K)?Le=!1:h.includes(K)?Le=!0:Oe&&Oe.state!=="idle"&&Oe.data===void 0?Le=i:Le=J(xe,H({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:F,nextParams:r[r.length-1].params},n,{actionResult:w,defaultShouldRevalidate:i})),Le&&c.push({key:K,routeId:G.routeId,path:G.path,matches:ee,match:xe,controller:new AbortController})}),[Y,c]}function Z(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function z(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function J(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function U(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];k(a,"No route found in manifest");let d={};for(let i in n){let h=a[i]!==void 0&&i!=="hasErrorBoundary";se(!h,'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.')),!h&&!Rr.has(i)&&(d[i]=n[i])}Object.assign(a,d),Object.assign(a,H({},t(a),{lazy:void 0}))}async function X(e,t,r,n,a,d,i,p,h){h===void 0&&(h={});let b,m,_,E=P=>{let w,g=new Promise((F,q)=>w=q);return _=()=>w(),t.signal.addEventListener("abort",_),Promise.race([P({request:t,params:r.params,context:h.requestContext}),g])};try{let P=r.route[e];if(r.route.lazy)if(P){let w,g=await Promise.all([E(P).catch(F=>{w=F}),U(r.route,d,a)]);if(w)throw w;m=g[0]}else if(await U(r.route,d,a),P=r.route[e],P)m=await E(P);else if(e==="action"){let w=new URL(t.url),g=w.pathname+w.search;throw oe(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:Q.data,data:void 0};else if(P)m=await E(P);else{let w=new URL(t.url),g=w.pathname+w.search;throw oe(404,{pathname:g})}k(m!==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){b=Q.error,m=P}finally{_&&t.signal.removeEventListener("abort",_)}if(rt(m)){let P=m.status;if(Cr.has(P)){let g=m.headers.get("Location");if(k(g,"Redirects returned/thrown from loaders/actions must have a Location header"),!qe.test(g))g=S(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,g,p);else if(!h.isStaticRequest){let F=new URL(t.url),q=g.startsWith("//")?new URL(F.protocol+g):new URL(g),V=Se(q.pathname,i)!=null;q.origin===F.origin&&V&&(g=q.pathname+q.search+q.hash)}if(h.isStaticRequest)throw m.headers.set("Location",g),m;return{type:Q.redirect,status:P,location:g,revalidate:m.headers.get("X-Remix-Revalidate")!==null,reloadDocument:m.headers.get("X-Remix-Reload-Document")!==null}}if(h.isRouteRequest)throw{type:b===Q.error?Q.error:Q.data,response:m};let w;try{let g=m.headers.get("Content-Type");g&&/\bapplication\/json\b/.test(g)?m.body==null?w=null:w=await m.json():w=await m.text()}catch(g){return{type:Q.error,error:g}}return b===Q.error?{type:b,error:new Ut(P,m.statusText,w),headers:m.headers}:{type:Q.data,data:w,statusCode:m.status,headers:m.headers}}if(b===Q.error)return{type:b,error:m};if(qr(m)){var x,C;return{type:Q.deferred,deferredData:m,statusCode:(x=m.init)==null?void 0:x.status,headers:((C=m.init)==null?void 0:C.headers)&&new Headers(m.init.headers)}}return{type:Q.data,data:m}}function ne(e,t,r,n){let a=e.createURL(Mr(t)).toString(),d={signal:r};if(n&&we(n.formMethod)){let{formMethod:i,formEncType:p}=n;d.method=i.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(n.json)):p==="text/plain"?d.body=n.text:p==="application/x-www-form-urlencoded"&&n.formData?d.body=pe(n.formData):d.body=n.formData}return new Request(a,d)}function pe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Ce(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ee(e,t,r,n,a){let d={},i=null,p,h=!1,b={};return r.forEach((m,_)=>{let E=t[_].route.id;if(k(!ke(m),"Cannot handle redirect results in processLoaderData"),Be(m)){let x=ge(e,E),C=m.error;n&&(C=Object.values(n)[0],n=void 0),i=i||{},i[x.route.id]==null&&(i[x.route.id]=C),d[E]=void 0,h||(h=!0,p=pt(m.error)?m.error.status:500),m.headers&&(b[E]=m.headers)}else Ne(m)?(a.set(E,m.deferredData),d[E]=m.deferredData.data):d[E]=m.data,m.statusCode!=null&&m.statusCode!==200&&!h&&(p=m.statusCode),m.headers&&(b[E]=m.headers)}),n&&(i=n,d[Object.keys(n)[0]]=void 0),{loaderData:d,errors:i,statusCode:p||200,loaderHeaders:b}}function je(e,t,r,n,a,d,i,p){let{loaderData:h,errors:b}=Ee(t,r,n,a,p);for(let m=0;m<d.length;m++){let{key:_,match:E,controller:x}=d[m];k(i!==void 0&&i[m]!==void 0,"Did not find corresponding fetcher result");let C=i[m];if(!(x&&x.signal.aborted))if(Be(C)){let P=ge(e.matches,E==null?void 0:E.route.id);b&&b[P.route.id]||(b=H({},b,{[P.route.id]:C.error})),e.fetchers.delete(_)}else if(ke(C))k(!1,"Unhandled fetcher revalidation redirect");else if(Ne(C))k(!1,"Unhandled fetcher deferred data");else{let P=ze(C.data);e.fetchers.set(_,P)}}return{loaderData:h,errors:b}}function he(e,t,r,n){let a=H({},t);for(let d of r){let i=d.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&d.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function ge(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 Ft(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 oe(e,t){let{pathname:r,routeId:n,method:a,type:d}=t===void 0?{}:t,i="Unknown Server Error",p="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?p="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.":d==="defer-action"?p="defer() is not supported in actions":d==="invalid-body"&&(p="Unable to encode submission body")):e===403?(i="Forbidden",p='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",p='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?p="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&&(p='Invalid request method "'+a.toUpperCase()+'"')),new Ut(e||500,i,new Error(p),!0)}function Lr(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(ke(r))return{result:r,idx:t}}}function Mr(e){let t=typeof e=="string"?ie(e):e;return Re(H({},t,{hash:""}))}function Vr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Ne(e){return e.type===Q.deferred}function Be(e){return e.type===Q.error}function ke(e){return(e&&e.type)===Q.redirect}function qr(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 rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body!="undefined"}function Yr(e){if(!rt(e))return!1;let t=e.status,r=e.headers.get("Location");return t>=300&&t<=399&&r!=null}function Xr(e){return e&&rt(e.response)&&(e.type===Q.data||e.type===Q.error)}function dr(e){return lr.has(e.toLowerCase())}function we(e){return jt.has(e.toLowerCase())}async function _r(e,t,r,n,a,d){for(let i=0;i<r.length;i++){let p=r[i],h=t[i];if(!h)continue;let b=e.find(_=>_.route.id===h.route.id),m=b!=null&&!z(b,h)&&(d&&d[h.route.id])!==void 0;if(Ne(p)&&(a||m)){let _=n[i];k(_,"Expected an AbortSignal for revalidating fetcher deferred result"),await Or(p,_,a).then(E=>{E&&(r[i]=E||r[i])})}}}async function Or(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Q.data,data:e.deferredData.unwrappedData}}catch(a){return{type:Q.error,error:a}}return{type:Q.data,data:e.deferredData.data}}}function cr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function gt(e,t){let r=typeof t=="string"?ie(t).search:t.search;if(e[e.length-1].route.index&&cr(r||""))return e[e.length-1];let n=er(e);return n[n.length-1]}function Ur(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:d,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(d!=null)return{formMethod:t,formAction:r,formEncType:n,formData:d,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 fr(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 Gr(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 yt(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 Qr(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 ze(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 Zr(e,t){try{let r=e.sessionStorage.getItem(At);if(r){let n=JSON.parse(r);for(let[a,d]of Object.entries(n||{}))d&&Array.isArray(d)&&t.set(a,new Set(d||[]))}}catch{}}function en(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(At,JSON.stringify(r))}catch(n){se(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}}}]);})();
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=module-react-router.5cd3c8c6.js.map
|