diff --git a/redux-hooks/assets/index-BaNzopln.js b/redux-hooks/assets/index-Bhq2Kt1u.js similarity index 93% rename from redux-hooks/assets/index-BaNzopln.js rename to redux-hooks/assets/index-Bhq2Kt1u.js index b24bf805..eb2b27a2 100644 --- a/redux-hooks/assets/index-BaNzopln.js +++ b/redux-hooks/assets/index-Bhq2Kt1u.js @@ -10,12 +10,12 @@ Error generating stack: `+v.message+` The error may be correlated with this previous error: ${he.current.stack} -`),V}Hg(()=>{he.current=void 0,ee.current=void 0,j.current=R});const G=w.useMemo(()=>w.createElement(A,{...R,ref:ce}),[ce,A,R]);return w.useMemo(()=>C?w.createElement(J.Provider,{value:I},G):G,[J,G,I])}const W=w.memo(F);if(W.WrappedComponent=A,W.displayName=F.displayName=P,f){const ae=w.forwardRef(function(re,J){return w.createElement(W,{...re,reactReduxForwardedRef:J})});return ae.displayName=P,ae.WrappedComponent=A,L2(ae,A)}return L2(W,A)}}var GL=TF;function OF(e){const{children:t,context:n,serverState:r,store:i}=e,o=w.useMemo(()=>{const f=HL(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=w.useMemo(()=>i.getState(),[i]);Hg(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,l]);const c=n||qo;return w.createElement(c.Provider,{value:o},t)}var d_=OF;function h_(e=qo){return function(){return w.useContext(e)}}var YL=h_();function WL(e=qo){const t=e===qo?YL:h_(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var jF=WL();function MF(e=qo){const t=e===qo?jF:WL(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var KL=MF(),PF=(e,t)=>e===t;function LF(e=qo){const t=e===qo?YL:h_(e),n=(r,i={})=>{const{equalityFn:o=PF}=typeof i=="function"?{equalityFn:i}:i,l=t(),{store:c,subscription:f,getServerState:h}=l;w.useRef(!0);const m=w.useCallback({[r.name](x){return r(x)}}[r.name],[r]),y=RB.useSyncExternalStoreWithSelector(f.addNestedSub,c.getState,h||c.getState,m,o);return w.useDebugValue(y),y};return Object.assign(n,{withTypes:()=>n}),n}var ZL=LF();var JA="popstate";function NF(e={}){function t(r,i){let{pathname:o,search:l,hash:c}=r.location;return N2("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ah(i)}return DF(t,n,null,e)}function vn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RF(){return Math.random().toString(36).substring(2,10)}function eT(e,t){return{usr:e.state,key:e.key,idx:t}}function N2(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Sf(t):t,state:n,key:t&&t.key||r||RF()}}function Ah({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Sf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function DF(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,c="POP",f=null,h=m();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function m(){return(l.state||{idx:null}).idx}function y(){c="POP";let A=m(),O=A==null?null:A-h;h=A,f&&f({action:c,location:_.location,delta:O})}function x(A,O){c="PUSH";let P=N2(_.location,A,O);h=m()+1;let N=eT(P,h),F=_.createHref(P);try{l.pushState(N,"",F)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;i.location.assign(F)}o&&f&&f({action:c,location:_.location,delta:1})}function b(A,O){c="REPLACE";let P=N2(_.location,A,O);h=m();let N=eT(P,h),F=_.createHref(P);l.replaceState(N,"",F),o&&f&&f({action:c,location:_.location,delta:0})}function C(A){return kF(A)}let _={get action(){return c},get location(){return e(i,l)},listen(A){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(JA,y),f=A,()=>{i.removeEventListener(JA,y),f=null}},createHref(A){return t(i,A)},createURL:C,encodeLocation(A){let O=C(A);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:x,replace:b,go(A){return l.go(A)}};return _}function kF(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),vn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ah(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function XL(e,t,n="/"){return IF(e,t,n,!1)}function IF(e,t,n,r){let i=typeof t=="string"?Sf(t):t,o=Go(i.pathname||"/",n);if(o==null)return null;let l=QL(e);zF(l);let c=null;for(let f=0;c==null&&f{let m={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;vn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let y=$o([r,m.relativePath]),x=n.concat(m);l.children&&l.children.length>0&&(vn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),QL(l.children,t,x,y,f)),!(l.path==null&&!l.index)&&t.push({path:y,score:qF(y,l.index),routesMeta:x})};return e.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))o(l,c);else for(let f of JL(l.path))o(l,c,!0,f)}),t}function JL(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=JL(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),i&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function zF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var UF=/^:[\w-]+$/,BF=3,FF=2,$F=1,VF=10,HF=-2,tT=e=>e==="*";function qF(e,t){let n=e.split("/"),r=n.length;return n.some(tT)&&(r+=HF),t&&(r+=FF),n.filter(i=>!tT(i)).reduce((i,o)=>i+(UF.test(o)?BF:o===""?$F:VF),r)}function GF(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function YF(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let c=0;c{if(m==="*"){let C=c[x]||"";l=o.slice(0,o.length-C.length).replace(/(.)\/+$/,"$1")}const b=c[x];return y&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function WF(e,t=!1,n=!0){Sa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function KF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Go(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ZF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Sf(e):e;return{pathname:n?n.startsWith("/")?n:XF(n,t):t,search:e$(r),hash:t$(i)}}function XF(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Cb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function QF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function m_(e){let t=QF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function p_(e,t,n,r=!1){let i;typeof e=="string"?i=Sf(e):(i={...e},vn(!i.pathname||!i.pathname.includes("?"),Cb("?","pathname","search",i)),vn(!i.pathname||!i.pathname.includes("#"),Cb("#","pathname","hash",i)),vn(!i.search||!i.search.includes("#"),Cb("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,c;if(l==null)c=n;else{let y=t.length-1;if(!r&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),y-=1;i.pathname=x.join("/")}c=y>=0?t[y]:"/"}let f=ZF(i,c),h=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var $o=e=>e.join("/").replace(/\/\/+/g,"/"),JF=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),e$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,t$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function n$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var eN=["POST","PUT","PATCH","DELETE"];new Set(eN);var r$=["GET",...eN];new Set(r$);var Cf=w.createContext(null);Cf.displayName="DataRouter";var oy=w.createContext(null);oy.displayName="DataRouterState";w.createContext(!1);var tN=w.createContext({isTransitioning:!1});tN.displayName="ViewTransition";var i$=w.createContext(new Map);i$.displayName="Fetchers";var a$=w.createContext(null);a$.displayName="Await";var Oa=w.createContext(null);Oa.displayName="Navigation";var Wh=w.createContext(null);Wh.displayName="Location";var ja=w.createContext({outlet:null,matches:[],isDataRoute:!1});ja.displayName="Route";var g_=w.createContext(null);g_.displayName="RouteError";function o$(e,{relative:t}={}){vn(Ku(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=w.useContext(Oa),{hash:i,pathname:o,search:l}=Kh(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:$o([n,o])),r.createHref({pathname:c,search:l,hash:i})}function Ku(){return w.useContext(Wh)!=null}function Or(){return vn(Ku(),"useLocation() may be used only in the context of a component."),w.useContext(Wh).location}var nN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rN(e){w.useContext(Oa).static||w.useLayoutEffect(e)}function uo(){let{isDataRoute:e}=w.useContext(ja);return e?b$():s$()}function s$(){vn(Ku(),"useNavigate() may be used only in the context of a component.");let e=w.useContext(Cf),{basename:t,navigator:n}=w.useContext(Oa),{matches:r}=w.useContext(ja),{pathname:i}=Or(),o=JSON.stringify(m_(r)),l=w.useRef(!1);return rN(()=>{l.current=!0}),w.useCallback((f,h={})=>{if(Sa(l.current,nN),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=p_(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:$o([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,o,i,e])}w.createContext(null);function Ef(){let{matches:e}=w.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Kh(e,{relative:t}={}){let{matches:n}=w.useContext(ja),{pathname:r}=Or(),i=JSON.stringify(m_(n));return w.useMemo(()=>p_(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function l$(e,t){return iN(e,t)}function iN(e,t,n,r,i){vn(Ku(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=w.useContext(Oa),{matches:l}=w.useContext(ja),c=l[l.length-1],f=c?c.params:{},h=c?c.pathname:"/",m=c?c.pathnameBase:"/",y=c&&c.route;{let P=y&&y.path||"";aN(h,!y||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +`),V}Hg(()=>{he.current=void 0,ee.current=void 0,j.current=R});const G=w.useMemo(()=>w.createElement(A,{...R,ref:ce}),[ce,A,R]);return w.useMemo(()=>C?w.createElement(J.Provider,{value:I},G):G,[J,G,I])}const W=w.memo(F);if(W.WrappedComponent=A,W.displayName=F.displayName=P,f){const ae=w.forwardRef(function(re,J){return w.createElement(W,{...re,reactReduxForwardedRef:J})});return ae.displayName=P,ae.WrappedComponent=A,L2(ae,A)}return L2(W,A)}}var GL=TF;function OF(e){const{children:t,context:n,serverState:r,store:i}=e,o=w.useMemo(()=>{const f=HL(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=w.useMemo(()=>i.getState(),[i]);Hg(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,l]);const c=n||qo;return w.createElement(c.Provider,{value:o},t)}var d_=OF;function h_(e=qo){return function(){return w.useContext(e)}}var YL=h_();function WL(e=qo){const t=e===qo?YL:h_(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var jF=WL();function MF(e=qo){const t=e===qo?jF:WL(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var PF=MF(),LF=(e,t)=>e===t;function NF(e=qo){const t=e===qo?YL:h_(e),n=(r,i={})=>{const{equalityFn:o=LF}=typeof i=="function"?{equalityFn:i}:i,l=t(),{store:c,subscription:f,getServerState:h}=l;w.useRef(!0);const m=w.useCallback({[r.name](x){return r(x)}}[r.name],[r]),y=RB.useSyncExternalStoreWithSelector(f.addNestedSub,c.getState,h||c.getState,m,o);return w.useDebugValue(y),y};return Object.assign(n,{withTypes:()=>n}),n}var RF=NF();var JA="popstate";function DF(e={}){function t(r,i){let{pathname:o,search:l,hash:c}=r.location;return N2("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ah(i)}return IF(t,n,null,e)}function vn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kF(){return Math.random().toString(36).substring(2,10)}function eT(e,t){return{usr:e.state,key:e.key,idx:t}}function N2(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Sf(t):t,state:n,key:t&&t.key||r||kF()}}function Ah({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Sf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function IF(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,c="POP",f=null,h=m();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function m(){return(l.state||{idx:null}).idx}function y(){c="POP";let A=m(),O=A==null?null:A-h;h=A,f&&f({action:c,location:_.location,delta:O})}function x(A,O){c="PUSH";let P=N2(_.location,A,O);h=m()+1;let N=eT(P,h),F=_.createHref(P);try{l.pushState(N,"",F)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;i.location.assign(F)}o&&f&&f({action:c,location:_.location,delta:1})}function b(A,O){c="REPLACE";let P=N2(_.location,A,O);h=m();let N=eT(P,h),F=_.createHref(P);l.replaceState(N,"",F),o&&f&&f({action:c,location:_.location,delta:0})}function C(A){return zF(A)}let _={get action(){return c},get location(){return e(i,l)},listen(A){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(JA,y),f=A,()=>{i.removeEventListener(JA,y),f=null}},createHref(A){return t(i,A)},createURL:C,encodeLocation(A){let O=C(A);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:x,replace:b,go(A){return l.go(A)}};return _}function zF(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),vn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ah(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function KL(e,t,n="/"){return UF(e,t,n,!1)}function UF(e,t,n,r){let i=typeof t=="string"?Sf(t):t,o=Go(i.pathname||"/",n);if(o==null)return null;let l=ZL(e);BF(l);let c=null;for(let f=0;c==null&&f{let m={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;vn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let y=$o([r,m.relativePath]),x=n.concat(m);l.children&&l.children.length>0&&(vn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),ZL(l.children,t,x,y,f)),!(l.path==null&&!l.index)&&t.push({path:y,score:YF(y,l.index),routesMeta:x})};return e.forEach((l,c)=>{if(l.path===""||!l.path?.includes("?"))o(l,c);else for(let f of XL(l.path))o(l,c,!0,f)}),t}function XL(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=XL(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),i&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function BF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:WF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var FF=/^:[\w-]+$/,$F=3,VF=2,HF=1,qF=10,GF=-2,tT=e=>e==="*";function YF(e,t){let n=e.split("/"),r=n.length;return n.some(tT)&&(r+=GF),t&&(r+=VF),n.filter(i=>!tT(i)).reduce((i,o)=>i+(FF.test(o)?$F:o===""?HF:qF),r)}function WF(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function KF(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let c=0;c{if(m==="*"){let C=c[x]||"";l=o.slice(0,o.length-C.length).replace(/(.)\/+$/,"$1")}const b=c[x];return y&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function ZF(e,t=!1,n=!0){Sa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function XF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Go(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function QF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Sf(e):e;return{pathname:n?n.startsWith("/")?n:JF(n,t):t,search:n$(r),hash:r$(i)}}function JF(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Cb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function e$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function m_(e){let t=e$(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function p_(e,t,n,r=!1){let i;typeof e=="string"?i=Sf(e):(i={...e},vn(!i.pathname||!i.pathname.includes("?"),Cb("?","pathname","search",i)),vn(!i.pathname||!i.pathname.includes("#"),Cb("#","pathname","hash",i)),vn(!i.search||!i.search.includes("#"),Cb("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,c;if(l==null)c=n;else{let y=t.length-1;if(!r&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),y-=1;i.pathname=x.join("/")}c=y>=0?t[y]:"/"}let f=QF(i,c),h=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var $o=e=>e.join("/").replace(/\/\/+/g,"/"),t$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),n$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,r$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function i$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var QL=["POST","PUT","PATCH","DELETE"];new Set(QL);var a$=["GET",...QL];new Set(a$);var Cf=w.createContext(null);Cf.displayName="DataRouter";var oy=w.createContext(null);oy.displayName="DataRouterState";w.createContext(!1);var JL=w.createContext({isTransitioning:!1});JL.displayName="ViewTransition";var o$=w.createContext(new Map);o$.displayName="Fetchers";var s$=w.createContext(null);s$.displayName="Await";var Oa=w.createContext(null);Oa.displayName="Navigation";var Wh=w.createContext(null);Wh.displayName="Location";var ja=w.createContext({outlet:null,matches:[],isDataRoute:!1});ja.displayName="Route";var g_=w.createContext(null);g_.displayName="RouteError";function l$(e,{relative:t}={}){vn(Ku(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=w.useContext(Oa),{hash:i,pathname:o,search:l}=Kh(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:$o([n,o])),r.createHref({pathname:c,search:l,hash:i})}function Ku(){return w.useContext(Wh)!=null}function Or(){return vn(Ku(),"useLocation() may be used only in the context of a component."),w.useContext(Wh).location}var eN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function tN(e){w.useContext(Oa).static||w.useLayoutEffect(e)}function uo(){let{isDataRoute:e}=w.useContext(ja);return e?w$():u$()}function u$(){vn(Ku(),"useNavigate() may be used only in the context of a component.");let e=w.useContext(Cf),{basename:t,navigator:n}=w.useContext(Oa),{matches:r}=w.useContext(ja),{pathname:i}=Or(),o=JSON.stringify(m_(r)),l=w.useRef(!1);return tN(()=>{l.current=!0}),w.useCallback((f,h={})=>{if(Sa(l.current,eN),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=p_(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:$o([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,o,i,e])}w.createContext(null);function Ef(){let{matches:e}=w.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Kh(e,{relative:t}={}){let{matches:n}=w.useContext(ja),{pathname:r}=Or(),i=JSON.stringify(m_(n));return w.useMemo(()=>p_(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function c$(e,t){return nN(e,t)}function nN(e,t,n,r,i){vn(Ku(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=w.useContext(Oa),{matches:l}=w.useContext(ja),c=l[l.length-1],f=c?c.params:{},h=c?c.pathname:"/",m=c?c.pathnameBase:"/",y=c&&c.route;{let P=y&&y.path||"";rN(h,!y||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let x=Or(),b;if(t){let P=typeof t=="string"?Sf(t):t;vn(m==="/"||P.pathname?.startsWith(m),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${P.pathname}" was given in the \`location\` prop.`),b=P}else b=x;let C=b.pathname||"/",_=C;if(m!=="/"){let P=m.replace(/^\//,"").split("/");_="/"+C.replace(/^\//,"").split("/").slice(P.length).join("/")}let A=XL(e,{pathname:_});Sa(y||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Sa(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let O=h$(A&&A.map(P=>Object.assign({},P,{params:Object.assign({},f,P.params),pathname:$o([m,o.encodeLocation?o.encodeLocation(P.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?m:$o([m,o.encodeLocation?o.encodeLocation(P.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathnameBase])})),l,n,r,i);return t&&O?w.createElement(Wh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},O):O}function u$(){let e=y$(),t=n$(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,l)}var c$=w.createElement(u$,null),f$=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?w.createElement(ja.Provider,{value:this.props.routeContext},w.createElement(g_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function d$({routeContext:e,match:t,children:n}){let r=w.useContext(Cf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(ja.Provider,{value:e},n)}function h$(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n?.errors;if(l!=null){let h=o.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);vn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,f=-1;if(n)for(let h=0;h=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,m,y)=>{let x,b=!1,C=null,_=null;n&&(x=l&&m.route.id?l[m.route.id]:void 0,C=m.route.errorElement||c$,c&&(f<0&&y===0?(aN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,_=null):f===y&&(b=!0,_=m.route.hydrateFallbackElement||null)));let A=t.concat(o.slice(0,y+1)),O=()=>{let P;return x?P=C:b?P=_:m.route.Component?P=w.createElement(m.route.Component,null):m.route.element?P=m.route.element:P=h,w.createElement(d$,{match:m,routeContext:{outlet:h,matches:A,isDataRoute:n!=null},children:P})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?w.createElement(f$,{location:n.location,revalidation:n.revalidation,component:C,error:x,children:O(),routeContext:{outlet:null,matches:A,isDataRoute:!0},unstable_onError:r}):O()},null)}function v_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function m$(e){let t=w.useContext(Cf);return vn(t,v_(e)),t}function p$(e){let t=w.useContext(oy);return vn(t,v_(e)),t}function g$(e){let t=w.useContext(ja);return vn(t,v_(e)),t}function y_(e){let t=g$(e),n=t.matches[t.matches.length-1];return vn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function v$(){return y_("useRouteId")}function y$(){let e=w.useContext(g_),t=p$("useRouteError"),n=y_("useRouteError");return e!==void 0?e:t.errors?.[n]}function b$(){let{router:e}=m$("useNavigate"),t=y_("useNavigate"),n=w.useRef(!1);return rN(()=>{n.current=!0}),w.useCallback(async(i,o={})=>{Sa(n.current,nN),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var nT={};function aN(e,t,n){!t&&!nT[e]&&(nT[e]=!0,Sa(!1,n))}w.memo(x$);function x$({routes:e,future:t,state:n,unstable_onError:r}){return iN(e,void 0,n,r,t)}function b_({to:e,replace:t,state:n,relative:r}){vn(Ku()," may be used only in the context of a component.");let{static:i}=w.useContext(Oa);Sa(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:o}=w.useContext(ja),{pathname:l}=Or(),c=uo(),f=p_(e,m_(o),l,r==="path"),h=JSON.stringify(f);return w.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function ft(e){vn(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function w$({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){vn(!Ku(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=w.useMemo(()=>({basename:l,navigator:i,static:o,future:{}}),[l,i,o]);typeof n=="string"&&(n=Sf(n));let{pathname:f="/",search:h="",hash:m="",state:y=null,key:x="default"}=n,b=w.useMemo(()=>{let C=Go(f,l);return C==null?null:{location:{pathname:C,search:h,hash:m,state:y,key:x},navigationType:r}},[l,f,h,m,y,x,r]);return Sa(b!=null,` is not able to match the URL "${f}${h}${m}" because it does not start with the basename, so the won't render anything.`),b==null?null:w.createElement(Oa.Provider,{value:c},w.createElement(Wh.Provider,{children:t,value:b}))}function sy({children:e,location:t}){return l$(R2(e),t)}function R2(e,t=[]){let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;let o=[...t,i];if(r.type===w.Fragment){n.push.apply(n,R2(r.props.children,o));return}vn(r.type===ft,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),vn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||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=R2(r.props.children,o)),n.push(l)}),n}var Mg="get",Pg="application/x-www-form-urlencoded";function ly(e){return e!=null&&typeof e.tagName=="string"}function _$(e){return ly(e)&&e.tagName.toLowerCase()==="button"}function S$(e){return ly(e)&&e.tagName.toLowerCase()==="form"}function C$(e){return ly(e)&&e.tagName.toLowerCase()==="input"}function E$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function A$(e,t){return e.button===0&&(!t||t==="_self")&&!E$(e)}var Qp=null;function T$(){if(Qp===null)try{new FormData(document.createElement("form"),0),Qp=!1}catch{Qp=!0}return Qp}var O$=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Eb(e){return e!=null&&!O$.has(e)?(Sa(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Pg}"`),null):e}function j$(e,t){let n,r,i,o,l;if(S$(e)){let c=e.getAttribute("action");r=c?Go(c,t):null,n=e.getAttribute("method")||Mg,i=Eb(e.getAttribute("enctype"))||Pg,o=new FormData(e)}else if(_$(e)||C$(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a