@scmlatam/web-ui 0.1.43 → 0.1.44
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.
|
@@ -34622,7 +34622,7 @@ function IV(e, { relative: t } = {}) {
|
|
|
34622
34622
|
return ap(s.pathname, a) != null || ap(s.pathname, i) != null;
|
|
34623
34623
|
}
|
|
34624
34624
|
const S1 = ({ name: e, items: t, setState: n }) => {
|
|
34625
|
-
const r = ou(), s = pr();
|
|
34625
|
+
const r = ou(), s = pr(), i = new URLSearchParams(s.search);
|
|
34626
34626
|
return /* @__PURE__ */ w(rt, { size: 12, children: /* @__PURE__ */ w(
|
|
34627
34627
|
as,
|
|
34628
34628
|
{
|
|
@@ -34646,7 +34646,7 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34646
34646
|
children: e.toUpperCase()
|
|
34647
34647
|
}
|
|
34648
34648
|
),
|
|
34649
|
-
children: t.map((
|
|
34649
|
+
children: t.map((a, l) => /* @__PURE__ */ re(
|
|
34650
34650
|
Ei,
|
|
34651
34651
|
{
|
|
34652
34652
|
sx: {
|
|
@@ -34658,15 +34658,15 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34658
34658
|
}
|
|
34659
34659
|
},
|
|
34660
34660
|
onClick: () => {
|
|
34661
|
-
|
|
34661
|
+
a.subgroups.length > 0 ? (n("expanded"), r(a.path)) : (n("open"), r(`${a.path}&view=${a.view}`));
|
|
34662
34662
|
},
|
|
34663
|
-
selected: s.pathname
|
|
34663
|
+
selected: `${s.pathname}?module=${i.get("module")}` === a.path,
|
|
34664
34664
|
children: [
|
|
34665
|
-
/* @__PURE__ */ w(Ti, { children:
|
|
34665
|
+
/* @__PURE__ */ w(Ti, { children: a.icon }),
|
|
34666
34666
|
/* @__PURE__ */ w(
|
|
34667
34667
|
Ar,
|
|
34668
34668
|
{
|
|
34669
|
-
primary:
|
|
34669
|
+
primary: a.title,
|
|
34670
34670
|
slotProps: {
|
|
34671
34671
|
primary: {
|
|
34672
34672
|
sx: { color: "#FFFFFF" }
|
|
@@ -34674,15 +34674,15 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34674
34674
|
}
|
|
34675
34675
|
}
|
|
34676
34676
|
),
|
|
34677
|
-
|
|
34677
|
+
a.subgroups.length > 0 && /* @__PURE__ */ w(t7, {})
|
|
34678
34678
|
]
|
|
34679
34679
|
},
|
|
34680
|
-
|
|
34680
|
+
l
|
|
34681
34681
|
))
|
|
34682
34682
|
}
|
|
34683
34683
|
) });
|
|
34684
34684
|
}, OV = ({ items: e, setState: t }) => {
|
|
34685
|
-
const n = ou(), r = pr();
|
|
34685
|
+
const n = ou(), r = pr(), s = new URLSearchParams(r.search);
|
|
34686
34686
|
return /* @__PURE__ */ w(rt, { size: 12, children: /* @__PURE__ */ w(
|
|
34687
34687
|
as,
|
|
34688
34688
|
{
|
|
@@ -34697,7 +34697,7 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34697
34697
|
}
|
|
34698
34698
|
},
|
|
34699
34699
|
component: "nav",
|
|
34700
|
-
children: e.map((
|
|
34700
|
+
children: e.map((i, a) => /* @__PURE__ */ w(
|
|
34701
34701
|
Ei,
|
|
34702
34702
|
{
|
|
34703
34703
|
sx: {
|
|
@@ -34705,17 +34705,17 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34705
34705
|
minHeight: "56px"
|
|
34706
34706
|
},
|
|
34707
34707
|
onClick: () => {
|
|
34708
|
-
|
|
34708
|
+
i.subgroups.length > 0 ? t("expanded") : n(`${i.path}&view=${i.view}`);
|
|
34709
34709
|
},
|
|
34710
|
-
selected: r.pathname ===
|
|
34711
|
-
children: /* @__PURE__ */ w(Ti, { children:
|
|
34710
|
+
selected: `${r.pathname}?module=${s.get("module")}` === i.path,
|
|
34711
|
+
children: /* @__PURE__ */ w(Ti, { children: i.icon })
|
|
34712
34712
|
},
|
|
34713
|
-
|
|
34713
|
+
a
|
|
34714
34714
|
))
|
|
34715
34715
|
}
|
|
34716
34716
|
) });
|
|
34717
34717
|
}, MV = ({ items: e }) => {
|
|
34718
|
-
const t = pr(), n = ou();
|
|
34718
|
+
const t = pr(), n = ou(), r = new URLSearchParams(t.search);
|
|
34719
34719
|
return /* @__PURE__ */ w(rt, { size: 12, children: /* @__PURE__ */ w(
|
|
34720
34720
|
as,
|
|
34721
34721
|
{
|
|
@@ -34730,16 +34730,18 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34730
34730
|
}
|
|
34731
34731
|
},
|
|
34732
34732
|
component: "nav",
|
|
34733
|
-
children: e.map((
|
|
34733
|
+
children: e.map((s, i) => /* @__PURE__ */ w(
|
|
34734
34734
|
Ei,
|
|
34735
34735
|
{
|
|
34736
34736
|
sx: {
|
|
34737
34737
|
borderRadius: "20px"
|
|
34738
34738
|
},
|
|
34739
34739
|
onClick: () => {
|
|
34740
|
-
n(
|
|
34740
|
+
n(
|
|
34741
|
+
`${t.pathname}?module=${r.get("module")}${s.path}`
|
|
34742
|
+
);
|
|
34741
34743
|
},
|
|
34742
|
-
selected:
|
|
34744
|
+
selected: `&view=${r.get("view")}` === s.path,
|
|
34743
34745
|
children: /* @__PURE__ */ w(
|
|
34744
34746
|
Ar,
|
|
34745
34747
|
{
|
|
@@ -34748,52 +34750,53 @@ const S1 = ({ name: e, items: t, setState: n }) => {
|
|
|
34748
34750
|
sx: { color: "#FFFFFF" }
|
|
34749
34751
|
}
|
|
34750
34752
|
},
|
|
34751
|
-
primary:
|
|
34753
|
+
primary: s.title
|
|
34752
34754
|
}
|
|
34753
34755
|
)
|
|
34754
34756
|
},
|
|
34755
|
-
|
|
34757
|
+
i
|
|
34756
34758
|
))
|
|
34757
34759
|
}
|
|
34758
34760
|
) });
|
|
34759
34761
|
}, DV = ({ state: e, setState: t, groups: n }) => {
|
|
34760
34762
|
const r = n.map(
|
|
34761
|
-
(
|
|
34762
|
-
title:
|
|
34763
|
-
color:
|
|
34764
|
-
icon:
|
|
34765
|
-
path:
|
|
34766
|
-
|
|
34763
|
+
(a) => a.items.map((l) => ({
|
|
34764
|
+
title: l.title,
|
|
34765
|
+
color: l.color,
|
|
34766
|
+
icon: l.icon,
|
|
34767
|
+
path: l.path,
|
|
34768
|
+
view: l.view,
|
|
34769
|
+
subgroups: l.subgroups
|
|
34767
34770
|
}))
|
|
34768
|
-
).flat(), s = pr();
|
|
34771
|
+
).flat(), s = pr(), i = new URLSearchParams(s.search);
|
|
34769
34772
|
switch (e) {
|
|
34770
34773
|
case "close":
|
|
34771
34774
|
return /* @__PURE__ */ w(rt, { sx: { height: "calc(100vh - 160px)" }, container: !0, spacing: 2, children: /* @__PURE__ */ w(OV, { items: r, setState: t }) });
|
|
34772
34775
|
case "open":
|
|
34773
|
-
return /* @__PURE__ */ w(rt, { sx: { height: "calc(100vh - 160px)" }, container: !0, spacing: 2, children: /* @__PURE__ */ w(rt, { size: 12, children: n.map((
|
|
34776
|
+
return /* @__PURE__ */ w(rt, { sx: { height: "calc(100vh - 160px)" }, container: !0, spacing: 2, children: /* @__PURE__ */ w(rt, { size: 12, children: n.map((a, l) => /* @__PURE__ */ w(
|
|
34774
34777
|
S1,
|
|
34775
34778
|
{
|
|
34776
|
-
name:
|
|
34777
|
-
items:
|
|
34779
|
+
name: a.name,
|
|
34780
|
+
items: a.items,
|
|
34778
34781
|
setState: t
|
|
34779
34782
|
},
|
|
34780
|
-
|
|
34783
|
+
l
|
|
34781
34784
|
)) }) });
|
|
34782
34785
|
case "expanded":
|
|
34783
34786
|
return /* @__PURE__ */ re(rt, { sx: { height: "calc(100vh - 160px)" }, container: !0, spacing: 2, children: [
|
|
34784
|
-
/* @__PURE__ */ w(rt, { size: 6, children: n.map((
|
|
34787
|
+
/* @__PURE__ */ w(rt, { size: 6, children: n.map((a, l) => /* @__PURE__ */ w(
|
|
34785
34788
|
S1,
|
|
34786
34789
|
{
|
|
34787
|
-
name:
|
|
34788
|
-
items:
|
|
34790
|
+
name: a.name,
|
|
34791
|
+
items: a.items,
|
|
34789
34792
|
setState: t
|
|
34790
34793
|
},
|
|
34791
|
-
|
|
34794
|
+
l
|
|
34792
34795
|
)) }),
|
|
34793
34796
|
/* @__PURE__ */ w(rt, { size: 6, children: /* @__PURE__ */ w(
|
|
34794
34797
|
MV,
|
|
34795
34798
|
{
|
|
34796
|
-
items: r.find((
|
|
34799
|
+
items: r.find((a) => a.path === `${s.pathname}?module=${i.get("module")}`)?.subgroups || []
|
|
34797
34800
|
}
|
|
34798
34801
|
) })
|
|
34799
34802
|
] });
|
|
@@ -59379,7 +59382,7 @@ async function mZ(e) {
|
|
|
59379
59382
|
return;
|
|
59380
59383
|
const {
|
|
59381
59384
|
default: t
|
|
59382
|
-
} = await import("./get-context-
|
|
59385
|
+
} = await import("./get-context-DAp5TFqK.js"), n = await t();
|
|
59383
59386
|
if (!e || !hZ(n))
|
|
59384
59387
|
return;
|
|
59385
59388
|
const r = x({}, e, {
|
package/dist/web-ui.js
CHANGED
package/dist/web-ui.umd.cjs
CHANGED
|
@@ -363,7 +363,7 @@ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:mr(18,`(${t})`));return
|
|
|
363
363
|
* @license MIT
|
|
364
364
|
*/var t2="popstate";function XV(e={}){function t(r,s){let{pathname:i,search:a,hash:l}=r.location;return Cm("",{pathname:i,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Cc(s)}return QV(t,n,null,e)}function bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _r(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZV(){return Math.random().toString(36).substring(2,10)}function n2(e,t){return{usr:e.state,key:e.key,idx:t}}function Cm(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?$a(t):t,state:n,key:t&&t.key||r||ZV()}}function Cc({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 $a(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 QV(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,l="POP",c=null,u=d();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function d(){return(a.state||{idx:null}).idx}function p(){l="POP";let b=d(),C=b==null?null:b-u;u=b,c&&c({action:l,location:m.location,delta:C})}function h(b,C){l="PUSH";let w=Cm(m.location,b,C);u=d()+1;let S=n2(w,u),E=m.createHref(w);try{a.pushState(S,"",E)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;s.location.assign(E)}i&&c&&c({action:l,location:m.location,delta:1})}function g(b,C){l="REPLACE";let w=Cm(m.location,b,C);u=d();let S=n2(w,u),E=m.createHref(w);a.replaceState(S,"",E),i&&c&&c({action:l,location:m.location,delta:0})}function y(b){return JV(b)}let m={get action(){return l},get location(){return e(s,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(t2,p),c=b,()=>{s.removeEventListener(t2,p),c=null}},createHref(b){return t(s,b)},createURL:y,encodeLocation(b){let C=y(b);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:h,replace:g,go(b){return a.go(b)}};return m}function JV(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Cc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function o2(e,t,n="/"){return e7(e,t,n,!1)}function e7(e,t,n,r){let s=typeof t=="string"?$a(t):t,i=ns(s.pathname||"/",n);if(i==null)return null;let a=r2(e);t7(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=p7(i);l=u7(a[c],u,r)}return l}function r2(e,t=[],n=[],r="",s=!1){let i=(a,l,c=s,u)=>{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;bn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let p=os([r,d.relativePath]),h=n.concat(d);a.children&&a.children.length>0&&(bn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),r2(a.children,t,h,p,c)),!(a.path==null&&!a.index)&&t.push({path:p,score:l7(p,a.index),routesMeta:h})};return e.forEach((a,l)=>{if(a.path===""||!a.path?.includes("?"))i(a,l);else for(let c of s2(a.path))i(a,l,!0,c)}),t}function s2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=s2(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function t7(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:c7(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var n7=/^:[\w-]+$/,o7=3,r7=2,s7=1,i7=10,a7=-2,i2=e=>e==="*";function l7(e,t){let n=e.split("/"),r=n.length;return n.some(i2)&&(r+=a7),t&&(r+=r7),n.filter(s=>!i2(s)).reduce((s,i)=>s+(n7.test(i)?o7:i===""?s7:i7),r)}function c7(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function u7(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",p=hp({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!p&&u&&n&&!r[r.length-1].route.index&&(p=hp({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!p)return null;Object.assign(s,p.params),a.push({params:s,pathname:os([i,p.pathname]),pathnameBase:m7(os([i,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(i=os([i,p.pathnameBase]))}return a}function hp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=d7(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,{paramName:d,isOptional:p},h)=>{if(d==="*"){let y=l[h]||"";a=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[h];return p&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function d7(e,t=!1,n=!0){_r(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function p7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _r(!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 ns(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 f7(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?$a(e):e;return{pathname:n?n.startsWith("/")?n:h7(n,t):t,search:b7(r),hash:y7(s)}}function h7(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function wm(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 <Link to="..."> and the router will parse it for you.`}function g7(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function a2(e){let t=g7(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function l2(e,t,n,r=!1){let s;typeof e=="string"?s=$a(e):(s={...e},bn(!s.pathname||!s.pathname.includes("?"),wm("?","pathname","search",s)),bn(!s.pathname||!s.pathname.includes("#"),wm("#","pathname","hash",s)),bn(!s.search||!s.search.includes("#"),wm("#","search","hash",s)));let i=e===""||s.pathname==="",a=i?"/":s.pathname,l;if(a==null)l=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),p-=1;s.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=f7(s,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var os=e=>e.join("/").replace(/\/\/+/g,"/"),m7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),b7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,y7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function v7(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var c2=["POST","PUT","PATCH","DELETE"];new Set(c2);var C7=["GET",...c2];new Set(C7);var Ra=f.createContext(null);Ra.displayName="DataRouter";var gp=f.createContext(null);gp.displayName="DataRouterState",f.createContext(!1);var u2=f.createContext({isTransitioning:!1});u2.displayName="ViewTransition";var w7=f.createContext(new Map);w7.displayName="Fetchers";var S7=f.createContext(null);S7.displayName="Await";var Hr=f.createContext(null);Hr.displayName="Navigation";var wc=f.createContext(null);wc.displayName="Location";var rs=f.createContext({outlet:null,matches:[],isDataRoute:!1});rs.displayName="Route";var Sm=f.createContext(null);Sm.displayName="RouteError";function x7(e,{relative:t}={}){bn(Sc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=f.useContext(Hr),{hash:s,pathname:i,search:a}=Pc(e,{relative:t}),l=i;return n!=="/"&&(l=i==="/"?n:os([n,i])),r.createHref({pathname:l,search:a,hash:s})}function Sc(){return f.useContext(wc)!=null}function ur(){return bn(Sc(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(wc).location}var d2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function p2(e){f.useContext(Hr).static||f.useLayoutEffect(e)}function xc(){let{isDataRoute:e}=f.useContext(rs);return e?L7():P7()}function P7(){bn(Sc(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Ra),{basename:t,navigator:n}=f.useContext(Hr),{matches:r}=f.useContext(rs),{pathname:s}=ur(),i=JSON.stringify(a2(r)),a=f.useRef(!1);return p2(()=>{a.current=!0}),f.useCallback((c,u={})=>{if(_r(a.current,d2),!a.current)return;if(typeof c=="number"){n.go(c);return}let d=l2(c,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:os([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,s,e])}f.createContext(null);function Pc(e,{relative:t}={}){let{matches:n}=f.useContext(rs),{pathname:r}=ur(),s=JSON.stringify(a2(n));return f.useMemo(()=>l2(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function E7(e,t){return f2(e,t)}function f2(e,t,n,r,s){bn(Sc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=f.useContext(Hr),{matches:a}=f.useContext(rs),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",p=l&&l.route;{let w=p&&p.path||"";g2(u,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${w}">) 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.
|
|
365
365
|
|
|
366
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let h=ur(),g;if(t){let w=typeof t=="string"?$a(t):t;bn(d==="/"||w.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=h;let y=g.pathname||"/",m=y;if(d!=="/"){let w=d.replace(/^\//,"").split("/");m="/"+y.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=o2(e,{pathname:m});_r(p||b!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),_r(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=k7(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:os([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:os([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,n,r,s);return t&&C?f.createElement(wc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},C):C}function T7(){let e=R7(),t=v7(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)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:s},n):null,a)}var I7=f.createElement(T7,null),O7=class extends f.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?f.createElement(rs.Provider,{value:this.props.routeContext},f.createElement(Sm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function M7({routeContext:e,match:t,children:n}){let r=f.useContext(Ra);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(rs.Provider,{value:e},n)}function k7(e,t=[],n=null,r=null,s=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 i=e,a=n?.errors;if(a!=null){let u=i.findIndex(d=>d.route.id&&a?.[d.route.id]!==void 0);bn(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let l=!1,c=-1;if(n)for(let u=0;u<i.length;u++){let d=i[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:p,errors:h}=n,g=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||g){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((u,d,p)=>{let h,g=!1,y=null,m=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||I7,l&&(c<0&&p===0?(g2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,m=null):c===p&&(g=!0,m=d.route.hydrateFallbackElement||null)));let b=t.concat(i.slice(0,p+1)),C=()=>{let w;return h?w=y:g?w=m:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,f.createElement(M7,{match:d,routeContext:{outlet:u,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?f.createElement(O7,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:C(),routeContext:{outlet:null,matches:b,isDataRoute:!0},unstable_onError:r}):C()},null)}function xm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function D7(e){let t=f.useContext(Ra);return bn(t,xm(e)),t}function F7(e){let t=f.useContext(gp);return bn(t,xm(e)),t}function N7(e){let t=f.useContext(rs);return bn(t,xm(e)),t}function Pm(e){let t=N7(e),n=t.matches[t.matches.length-1];return bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $7(){return Pm("useRouteId")}function R7(){let e=f.useContext(Sm),t=F7("useRouteError"),n=Pm("useRouteError");return e!==void 0?e:t.errors?.[n]}function L7(){let{router:e}=D7("useNavigate"),t=Pm("useNavigate"),n=f.useRef(!1);return p2(()=>{n.current=!0}),f.useCallback(async(s,i={})=>{_r(n.current,d2),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var h2={};function g2(e,t,n){!t&&!h2[e]&&(h2[e]=!0,_r(!1,n))}f.memo(A7);function A7({routes:e,future:t,state:n,unstable_onError:r}){return f2(e,void 0,n,r,t)}function Em(e){bn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function V7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1}){bn(!Sc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=f.useMemo(()=>({basename:a,navigator:s,static:i,future:{}}),[a,s,i]);typeof n=="string"&&(n=$a(n));let{pathname:c="/",search:u="",hash:d="",state:p=null,key:h="default"}=n,g=f.useMemo(()=>{let y=ns(c,a);return y==null?null:{location:{pathname:y,search:u,hash:d,state:p,key:h},navigationType:r}},[a,c,u,d,p,h,r]);return _r(g!=null,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:f.createElement(Hr.Provider,{value:l},f.createElement(wc.Provider,{children:t,value:g}))}function B7({children:e,location:t}){return E7(Tm(e),t)}function Tm(e,t=[]){let n=[];return f.Children.forEach(e,(r,s)=>{if(!f.isValidElement(r))return;let i=[...t,s];if(r.type===f.Fragment){n.push.apply(n,Tm(r.props.children,i));return}bn(r.type===Em,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.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&&(a.children=Tm(r.props.children,i)),n.push(a)}),n}var mp="get",bp="application/x-www-form-urlencoded";function yp(e){return e!=null&&typeof e.tagName=="string"}function _7(e){return yp(e)&&e.tagName.toLowerCase()==="button"}function H7(e){return yp(e)&&e.tagName.toLowerCase()==="form"}function z7(e){return yp(e)&&e.tagName.toLowerCase()==="input"}function j7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function G7(e,t){return e.button===0&&(!t||t==="_self")&&!j7(e)}var vp=null;function W7(){if(vp===null)try{new FormData(document.createElement("form"),0),vp=!1}catch{vp=!0}return vp}var U7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Im(e){return e!=null&&!U7.has(e)?(_r(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${bp}"`),null):e}function q7(e,t){let n,r,s,i,a;if(H7(e)){let l=e.getAttribute("action");r=l?ns(l,t):null,n=e.getAttribute("method")||mp,s=Im(e.getAttribute("enctype"))||bp,i=new FormData(e)}else if(_7(e)||z7(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?ns(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||mp,s=Im(e.getAttribute("formenctype"))||Im(l.getAttribute("enctype"))||bp,i=new FormData(l,e),!W7()){let{name:u,type:d,value:p}=e;if(d==="image"){let h=u?`${u}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else u&&i.append(u,p)}}else{if(yp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mp,r=null,s=bp,a=e}return i&&s==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Om(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Y7(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ns(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function K7(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function X7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Z7(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let a=await K7(i,n);return a.links?a.links():[]}return[]}));return tB(r.flat(1).filter(X7).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function m2(e,t,n,r,s,i){let a=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,l=(c,u)=>n[u].pathname!==c.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==c.params["*"];return i==="assets"?t.filter((c,u)=>a(c,u)||l(c,u)):i==="data"?t.filter((c,u)=>{let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(a(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Q7(e,t,{includeHydrateFallback:n}={}){return J7(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function J7(e){return[...new Set(e)]}function eB(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function tB(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(eB(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function b2(){let e=f.useContext(Ra);return Om(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nB(){let e=f.useContext(gp);return Om(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Mm=f.createContext(void 0);Mm.displayName="FrameworkContext";function y2(){let e=f.useContext(Mm);return Om(e,"You must render this element inside a <HydratedRouter> element"),e}function oB(e,t){let n=f.useContext(Mm),[r,s]=f.useState(!1),[i,a]=f.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=t,h=f.useRef(null);f.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let m=C=>{C.forEach(w=>{a(w.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return h.current&&b.observe(h.current),()=>{b.disconnect()}}},[e]),f.useEffect(()=>{if(r){let m=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(m)}}},[r]);let g=()=>{s(!0)},y=()=>{s(!1),a(!1)};return n?e!=="intent"?[i,h,{}]:[i,h,{onFocus:Ec(l,g),onBlur:Ec(c,y),onMouseEnter:Ec(u,g),onMouseLeave:Ec(d,y),onTouchStart:Ec(p,g)}]:[!1,h,{}]}function Ec(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rB({page:e,...t}){let{router:n}=b2(),r=f.useMemo(()=>o2(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?f.createElement(iB,{page:e,matches:r,...t}):null}function sB(e){let{manifest:t,routeModules:n}=y2(),[r,s]=f.useState([]);return f.useEffect(()=>{let i=!1;return Z7(e,t,n).then(a=>{i||s(a)}),()=>{i=!0}},[e,t,n]),r}function iB({page:e,matches:t,...n}){let r=ur(),{manifest:s,routeModules:i}=y2(),{basename:a}=b2(),{loaderData:l,matches:c}=nB(),u=f.useMemo(()=>m2(e,t,c,s,r,"data"),[e,t,c,s,r]),d=f.useMemo(()=>m2(e,t,c,s,r,"assets"),[e,t,c,s,r]),p=f.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,m=!1;if(t.forEach(C=>{let w=s.routes[C.route.id];!w||!w.hasLoader||(!u.some(S=>S.route.id===C.route.id)&&C.route.id in l&&i[C.route.id]?.shouldRevalidate||w.hasClientLoader?m=!0:y.add(C.route.id))}),y.size===0)return[];let b=Y7(e,a,"data");return m&&y.size>0&&b.searchParams.set("_routes",t.filter(C=>y.has(C.route.id)).map(C=>C.route.id).join(",")),[b.pathname+b.search]},[a,l,r,s,u,t,e,i]),h=f.useMemo(()=>Q7(d,s),[d,s]),g=sB(d);return f.createElement(f.Fragment,null,p.map(y=>f.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),h.map(y=>f.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),g.map(({key:y,link:m})=>f.createElement("link",{key:y,nonce:n.nonce,...m})))}function aB(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var v2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{v2&&(window.__reactRouterVersion="7.9.4")}catch{}function lB({basename:e,children:t,window:n}){let r=f.useRef();r.current==null&&(r.current=XV({window:n,v5Compat:!0}));let s=r.current,[i,a]=f.useState({action:s.action,location:s.location}),l=f.useCallback(c=>{f.startTransition(()=>a(c))},[a]);return f.useLayoutEffect(()=>s.listen(l),[s,l]),f.createElement(V7,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:s})}var C2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w2=f.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:a,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p,...h},g){let{basename:y}=f.useContext(Hr),m=typeof u=="string"&&C2.test(u),b,C=!1;if(typeof u=="string"&&m&&(b=u,v2))try{let O=new URL(window.location.href),F=u.startsWith("//")?new URL(O.protocol+u):new URL(u),D=ns(F.pathname,y);F.origin===O.origin&&D!=null?u=D+F.search+F.hash:C=!0}catch{_r(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=x7(u,{relative:s}),[S,E,P]=oB(r,h),k=pB(u,{replace:a,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:p});function M(O){t&&t(O),O.defaultPrevented||k(O)}let I=f.createElement("a",{...h,...P,href:b||w,onClick:C||i?t:M,ref:aB(g,E),target:c,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?f.createElement(f.Fragment,null,I,f.createElement(rB,{page:w})):I});w2.displayName="Link";var cB=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:a,viewTransition:l,children:c,...u},d){let p=Pc(a,{relative:u.relative}),h=ur(),g=f.useContext(gp),{navigator:y,basename:m}=f.useContext(Hr),b=g!=null&&bB(p)&&l===!0,C=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(w=w.toLowerCase(),S=S?S.toLowerCase():null,C=C.toLowerCase()),S&&m&&(S=ns(S,m)||S);const E=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=w===C||!s&&w.startsWith(C)&&w.charAt(E)==="/",k=S!=null&&(S===C||!s&&S.startsWith(C)&&S.charAt(C.length)==="/"),M={isActive:P,isPending:k,isTransitioning:b},I=P?t:void 0,O;typeof r=="function"?O=r(M):O=[r,P?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let F=typeof i=="function"?i(M):i;return f.createElement(w2,{...u,"aria-current":I,className:O,ref:d,style:F,to:a,viewTransition:l},typeof c=="function"?c(M):c)});cB.displayName="NavLink";var uB=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:a=mp,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,...h},g)=>{let y=gB(),m=mB(l,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",C=typeof l=="string"&&C2.test(l),w=S=>{if(c&&c(S),S.defaultPrevented)return;S.preventDefault();let E=S.nativeEvent.submitter,P=E?.getAttribute("formmethod")||a;y(E||S.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:s,state:i,relative:u,preventScrollReset:d,viewTransition:p})};return f.createElement("form",{ref:g,method:b,action:m,onSubmit:r?c:w,...h,"data-discover":!C&&e==="render"?"true":void 0})});uB.displayName="Form";function dB(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S2(e){let t=f.useContext(Ra);return bn(t,dB(e)),t}function pB(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:a}={}){let l=xc(),c=ur(),u=Pc(e,{relative:i});return f.useCallback(d=>{if(G7(d,t)){d.preventDefault();let p=n!==void 0?n:Cc(c)===Cc(u);l(e,{replace:p,state:r,preventScrollReset:s,relative:i,viewTransition:a})}},[c,l,u,n,r,t,e,s,i,a])}var fB=0,hB=()=>`__${String(++fB)}__`;function gB(){let{router:e}=S2("useSubmit"),{basename:t}=f.useContext(Hr),n=$7();return f.useCallback(async(r,s={})=>{let{action:i,method:a,encType:l,formData:c,body:u}=q7(r,t);if(s.navigate===!1){let d=s.fetcherKey||hB();await e.fetch(d,n,s.action||i,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||a,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||i,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||a,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function mB(e,{relative:t}={}){let{basename:n}=f.useContext(Hr),r=f.useContext(rs);bn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...Pc(e||".",{relative:t})},a=ur();if(e==null){i.search=a.search;let l=new URLSearchParams(i.search),c=l.getAll("index");if(c.some(d=>d==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let d=l.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:os([n,i.pathname])),Cc(i)}function bB(e,{relative:t}={}){let n=f.useContext(u2);bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=S2("useViewTransitionState"),s=Pc(e,{relative:t});if(!n.isTransitioning)return!1;let i=ns(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=ns(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hp(s.pathname,a)!=null||hp(s.pathname,i)!=null}const x2=({name:e,items:t,setState:n})=>{const r=xc(),s=ur();return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",subheader:e&&v.jsx(sc,{sx:{bgcolor:"transparent"},component:"div",id:"nested-list-subheader",children:e.toUpperCase()}),children:t.map((i,a)=>v.jsxs(mi,{sx:{borderRadius:"20px",minHeight:"56px",color:"#FFFFFF","& .MuiListItemText-primary":{color:"#FFFFFF"}},onClick:()=>{i.subgroups.length>0?(n("expanded"),r(i.path+i.subgroups[0].path)):(r(i.path),n("open"))},selected:s.pathname===i.path||s.pathname.startsWith(i.path),children:[v.jsx(bi,{children:i.icon}),v.jsx(Vr,{primary:i.title,slotProps:{primary:{sx:{color:"#FFFFFF"}}}}),i.subgroups.length>0&&v.jsx(WV,{})]},a))})})},yB=({items:e,setState:t})=>{const n=xc(),r=ur();return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",children:e.map((s,i)=>v.jsx(mi,{sx:{borderRadius:"20px",minHeight:"56px"},onClick:()=>{console.log("item",s),console.log("location.pathname",r.pathname),console.log("item.path",s.path),s.subgroups.length>0&&t("expanded"),n(s.path)},selected:r.pathname===s.path,children:v.jsx(bi,{children:s.icon})},i))})})},vB=({items:e})=>{const t=ur(),n=xc();return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",children:e.map((r,s)=>v.jsx(mi,{sx:{borderRadius:"20px"},onClick:()=>{n(t.pathname+r.path)},selected:t.pathname+r.path===t.pathname+t.search,children:v.jsx(Vr,{slotProps:{primary:{sx:{color:"#FFFFFF"}}},primary:r.title})},s))})})},CB=({state:e,setState:t,groups:n})=>{const r=n.map(i=>i.items.map(a=>({title:a.title,color:a.color,icon:a.icon,path:a.path,subgroups:a.subgroups}))).flat(),s=ur();switch(e){case"close":return v.jsx(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:v.jsx(yB,{items:r,setState:t})});case"open":return v.jsx(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:v.jsx(ot,{size:12,children:n.map((i,a)=>v.jsx(x2,{name:i.name,items:i.items,setState:t},a))})});case"expanded":return v.jsxs(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:[v.jsx(ot,{size:6,children:n.map((i,a)=>v.jsx(x2,{name:i.name,items:i.items,setState:t},a))}),v.jsx(ot,{size:6,children:v.jsx(vB,{items:r.find(i=>i.path===s.pathname)?.subgroups||[]})})]})}},wB=({state:e,logout:t})=>{switch(e){case"close":return v.jsx(ot,{container:!0,spacing:2,children:v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:12,children:v.jsx(Dn,{sx:{height:"56px",borderRadius:"20px",bottom:"20px","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},onClick:t,children:v.jsx(vm,{size:28,color:"#9a28e6"})})})});case"open":return v.jsx(ot,{container:!0,spacing:2,children:v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:12,children:v.jsx(Vn,{sx:{width:"100%",height:"56px",borderRadius:"20px",bottom:"20px",color:"#FFFFFF","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},size:"small",startIcon:v.jsx(vm,{size:28,color:"#9a28e6"}),onClick:t,children:"Cerrar sesión"})})});case"expanded":return v.jsxs(ot,{container:!0,spacing:2,children:[v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:6,children:v.jsx(Vn,{sx:{width:"100%",height:"56px",borderRadius:"20px",bottom:"20px",color:"#FFFFFF","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},color:"inherit",size:"small",startIcon:v.jsx(vm,{size:28,color:"#9D11F2"}),onClick:t,children:v.jsx("span",{style:{textTransform:"none"},children:"Cerrar sesión"})})}),v.jsx(ot,{size:6})]})}},SB=({items:e,logout:t,state:n,setState:r,getWidth:s})=>v.jsxs(Gn,{sx:{padding:"20px",height:"calc(100vh - 40px)",width:s(n),bgcolor:i=>i.palette.background.paper,borderRadius:5,border:i=>`1px solid ${i.palette.background.default}`,overflow:"hidden"},children:[v.jsx(KV,{state:n,setState:r}),v.jsx(CB,{state:n,setState:r,groups:e}),v.jsx(wB,{state:n,logout:t})]}),xB=()=>{const[e,t]=ge.useState("open");return{state:e,setState:t,getWidth:r=>{switch(r){case"close":return"105px";case"open":return"230px";case"expanded":return"435px";default:return"230px"}}}},PB=({routes:e})=>{const t=ur(),n=xc();return v.jsxs(B7,{children:[e.map((r,s)=>v.jsx(Em,{path:r.path,element:ge.cloneElement(r.element,{location:t,navigate:n})},s)),v.jsx(Em,{path:"*",element:v.jsx("div",{children:"404 - Page Not Found"})})]})},EB=({username:e,options:t})=>{const[n,r]=ge.useState(!1);return v.jsxs(Ow,{sx:{width:"260px",height:n?"auto":"56px",position:"absolute",top:20,right:20,zIndex:1e3,bgcolor:"white",padding:0,boxShadow:"none",borderRadius:"20px"},children:[v.jsx(kw,{sx:{padding:"8px 20px"},avatar:v.jsx(Fd,{sx:{width:40,height:40,bgcolor:"#9D11F2"},children:e.charAt(0)}),title:e,slotProps:{title:{fontSize:"18px",fontStyle:"normal",fontWeight:"500",lineHeight:"22px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",maxWidth:"150px"}},action:t.length>0&&v.jsx(v.Fragment,{children:v.jsx(Dn,{sx:{color:"black"},children:n?v.jsx(YV,{color:"black",size:30,onClick:()=>r(!1)}):v.jsx(qV,{color:"black",size:30,onClick:()=>r(!0)})})})}),n&&v.jsx(Mw,{sx:{paddingY:"0px"},children:v.jsx(es,{children:t.map((s,i)=>v.jsxs(mi,{sx:{borderRadius:"20px"},onClick:s.onClick,children:[v.jsx(bi,{children:s.icon}),v.jsx(Vr,{primary:s.label,slotProps:{primary:{fontSize:"18px",fontStyle:"normal",fontWeight:"400",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"170px"}}})]},i))})})]})},TB=({getWidth:e,state:t,routes:n,account:r})=>v.jsxs(Gn,{sx:{width:`calc(100vw - ${e(t)} - 60px)`,height:"calc(100vh - 40px)"},children:[v.jsx(Gn,{sx:{height:"10%"},children:v.jsx(EB,{username:r.username,avatarUrl:r.avatarUrl,options:r.options})}),v.jsx(Gn,{sx:{height:"90%"},children:v.jsx(PB,{routes:n})})]}),IB=({logout:e,sidebarItems:t,routes:n,account:r})=>{const{state:s,setState:i,getWidth:a}=xB();return v.jsxs(Gn,{sx:{p:"20px",display:"grid",gridTemplateColumns:"auto 1fr",gap:"20px"},children:[v.jsx(SB,{items:t,logout:e,state:s,setState:i,getWidth:a}),v.jsx(TB,{state:s,getWidth:a,routes:n,account:r})]})};function P2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P2(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function xi(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P2(e))&&(r&&(r+=" "),r+=t);return r}let OB={data:""},MB=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||OB,kB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,DB=/\/\*[^]*?\*\/| +/g,E2=/\n+/g,Pi=(e,t)=>{let n="",r="",s="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+a+";":r+=i[1]=="f"?Pi(a,i):i+"{"+Pi(a,i[1]=="k"?"":t)+"}":typeof a=="object"?r+=Pi(a,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Pi.p?Pi.p(i,a):i+":"+a+";")}return n+(t&&s?t+"{"+s+"}":s)+r},ss={},T2=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+T2(e[n]);return t}return e},FB=(e,t,n,r,s)=>{let i=T2(e),a=ss[i]||(ss[i]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(i));if(!ss[a]){let c=i!==e?e:(u=>{let d,p,h=[{}];for(;d=kB.exec(u.replace(DB,""));)d[4]?h.shift():d[3]?(p=d[3].replace(E2," ").trim(),h.unshift(h[0][p]=h[0][p]||{})):h[0][d[1]]=d[2].replace(E2," ").trim();return h[0]})(e);ss[a]=Pi(s?{["@keyframes "+a]:c}:c,n?"":"."+a)}let l=n&&ss.g?ss.g:null;return n&&(ss.g=ss[a]),((c,u,d,p)=>{p?u.data=u.data.replace(p,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(ss[a],t,r,l),a},NB=(e,t,n)=>e.reduce((r,s,i)=>{let a=t[i];if(a&&a.call){let l=a(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;a=c?"."+c:l&&typeof l=="object"?l.props?"":Pi(l,""):l===!1?"":l}return r+s+(a??"")},"");function km(e){let t=this||{},n=e.call?e(t.p):e;return FB(n.unshift?n.raw?NB(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,MB(t.target),t.g,t.o,t.k)}km.bind({g:1}),km.bind({k:1});function $B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I2(e,t,n){return t&&$B(e.prototype,t),e}function tn(){return tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}function O2(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Tc(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function M2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var k2=function(){return""},D2=ge.createContext({enqueueSnackbar:k2,closeSnackbar:k2}),Ei={downXs:"@media (max-width:599.95px)",upSm:"@media (min-width:600px)"},F2=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Dm=function(t){return""+F2(t.vertical)+F2(t.horizontal)},Cp=function(t){return!!t||t===0},wp="unmounted",La="exited",Aa="entering",Ic="entered",N2="exiting",Fm=function(e){O2(t,e);function t(r){var s;s=e.call(this,r)||this;var i=r.appear,a;return s.appearStatus=null,r.in?i?(a=La,s.appearStatus=Aa):a=Ic:r.unmountOnExit||r.mountOnEnter?a=wp:a=La,s.state={status:a},s.nextCallback=null,s}t.getDerivedStateFromProps=function(s,i){var a=s.in;return a&&i.status===wp?{status:La}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(s){var i=null;if(s!==this.props){var a=this.state.status;this.props.in?a!==Aa&&a!==Ic&&(i=Aa):(a===Aa||a===Ic)&&(i=N2)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var s=this.props.timeout,i=s,a=s;return s!=null&&typeof s!="number"&&typeof s!="string"&&(a=s.exit,i=s.enter),{exit:a,enter:i}},n.updateStatus=function(s,i){s===void 0&&(s=!1),i!==null?(this.cancelNextCallback(),i===Aa?this.performEnter(s):this.performExit()):this.props.unmountOnExit&&this.state.status===La&&this.setState({status:wp})},n.performEnter=function(s){var i=this,a=this.props.enter,l=s,c=this.getTimeouts();if(!s&&!a){this.safeSetState({status:Ic},function(){i.props.onEntered&&i.props.onEntered(i.node,l)});return}this.props.onEnter&&this.props.onEnter(this.node,l),this.safeSetState({status:Aa},function(){i.props.onEntering&&i.props.onEntering(i.node,l),i.onTransitionEnd(c.enter,function(){i.safeSetState({status:Ic},function(){i.props.onEntered&&i.props.onEntered(i.node,l)})})})},n.performExit=function(){var s=this,i=this.props.exit,a=this.getTimeouts();if(!i){this.safeSetState({status:La},function(){s.props.onExited&&s.props.onExited(s.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:N2},function(){s.props.onExiting&&s.props.onExiting(s.node),s.onTransitionEnd(a.exit,function(){s.safeSetState({status:La},function(){s.props.onExited&&s.props.onExited(s.node)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(s,i){i=this.setNextCallback(i),this.setState(s,i)},n.setNextCallback=function(s){var i=this,a=!0;return this.nextCallback=function(){a&&(a=!1,i.nextCallback=null,s())},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(s,i){this.setNextCallback(i);var a=s==null&&!this.props.addEndListener;if(!this.node||a){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),s!=null&&setTimeout(this.nextCallback,s)},n.render=function(){var s=this.state.status;if(s===wp)return null;var i=this.props,a=i.children,l=Tc(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return a(s,l)},I2(t,[{key:"node",get:function(){var s,i=(s=this.props.nodeRef)===null||s===void 0?void 0:s.current;if(!i)throw new Error("notistack - Custom snackbar is not refForwarding");return i}}]),t}(ge.Component);function Va(){}Fm.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Va,onEntering:Va,onEntered:Va,onExit:Va,onExiting:Va,onExited:Va};function $2(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Nm(e,t){return ge.useMemo(function(){return e==null&&t==null?null:function(n){$2(e,n),$2(t,n)}},[e,t])}function Sp(e){var t=e.timeout,n=e.style,r=n===void 0?{}:n,s=e.mode;return{duration:typeof t=="object"?t[s]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}var $m={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},R2=function(t){t.scrollTop=t.scrollTop},L2=function(t){return Math.round(t)+"ms"};function Ba(e,t){e===void 0&&(e=["all"]);var n=t||{},r=n.duration,s=r===void 0?300:r,i=n.easing,a=i===void 0?$m.easeInOut:i,l=n.delay,c=l===void 0?0:l,u=Array.isArray(e)?e:[e];return u.map(function(d){var p=typeof s=="string"?s:L2(s),h=typeof c=="string"?c:L2(c);return d+" "+p+" "+a+" "+h}).join(",")}function RB(e){return e&&e.ownerDocument||document}function A2(e){var t=RB(e);return t.defaultView||window}function LB(e,t){t===void 0&&(t=166);var n;function r(){for(var s=this,i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var c=function(){e.apply(s,a)};clearTimeout(n),n=setTimeout(c,t)}return r.clear=function(){clearTimeout(n)},r}function AB(e,t){var n=t.getBoundingClientRect(),r=A2(t),s;if(t.fakeTransform)s=t.fakeTransform;else{var i=r.getComputedStyle(t);s=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){var c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+a-n.left)+"px)";case"right":return"translateX(-"+(n.left+n.width-a)+"px)";case"up":return"translateY("+(r.innerHeight+l-n.top)+"px)";default:return"translateY(-"+(n.top+n.height-l)+"px)"}}function xp(e,t){if(t){var n=AB(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var V2=ge.forwardRef(function(e,t){var n=e.children,r=e.direction,s=r===void 0?"down":r,i=e.in,a=e.style,l=e.timeout,c=l===void 0?0:l,u=e.onEnter,d=e.onEntered,p=e.onExit,h=e.onExited,g=Tc(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),y=ge.useRef(null),m=Nm(n.ref,y),b=Nm(m,t),C=function(M,I){xp(s,M),R2(M),u&&u(M,I)},w=function(M){var I=a?.transitionTimingFunction||$m.easeOut,O=Sp({timeout:c,mode:"enter",style:tn({},a,{transitionTimingFunction:I})});M.style.webkitTransition=Ba("-webkit-transform",O),M.style.transition=Ba("transform",O),M.style.webkitTransform="none",M.style.transform="none"},S=function(M){var I=a?.transitionTimingFunction||$m.sharp,O=Sp({timeout:c,mode:"exit",style:tn({},a,{transitionTimingFunction:I})});M.style.webkitTransition=Ba("-webkit-transform",O),M.style.transition=Ba("transform",O),xp(s,M),p&&p(M)},E=function(M){M.style.webkitTransition="",M.style.transition="",h&&h(M)},P=ge.useCallback(function(){y.current&&xp(s,y.current)},[s]);return ge.useEffect(function(){if(!(i||s==="down"||s==="right")){var k=LB(function(){y.current&&xp(s,y.current)}),M=A2(y.current);return M.addEventListener("resize",k),function(){k.clear(),M.removeEventListener("resize",k)}}},[s,i]),ge.useEffect(function(){i||P()},[i,P]),ge.createElement(Fm,Object.assign({appear:!0,nodeRef:y,onEnter:C,onEntered:d,onEntering:w,onExit:S,onExited:E,in:i,timeout:c},g),function(k,M){return ge.cloneElement(n,tn({ref:b,style:tn({visibility:k==="exited"&&!i?"hidden":void 0},a,{},n.props.style)},M))})});V2.displayName="Slide";var Pp=function(t){return ge.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},t))},VB=function(){return ge.createElement(Pp,null,ge.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
366
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let h=ur(),g;if(t){let w=typeof t=="string"?$a(t):t;bn(d==="/"||w.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=h;let y=g.pathname||"/",m=y;if(d!=="/"){let w=d.replace(/^\//,"").split("/");m="/"+y.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=o2(e,{pathname:m});_r(p||b!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),_r(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=k7(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:os([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:os([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),a,n,r,s);return t&&C?f.createElement(wc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},C):C}function T7(){let e=R7(),t=v7(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)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:s},n):null,a)}var I7=f.createElement(T7,null),O7=class extends f.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?f.createElement(rs.Provider,{value:this.props.routeContext},f.createElement(Sm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function M7({routeContext:e,match:t,children:n}){let r=f.useContext(Ra);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(rs.Provider,{value:e},n)}function k7(e,t=[],n=null,r=null,s=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 i=e,a=n?.errors;if(a!=null){let u=i.findIndex(d=>d.route.id&&a?.[d.route.id]!==void 0);bn(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let l=!1,c=-1;if(n)for(let u=0;u<i.length;u++){let d=i[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:p,errors:h}=n,g=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||g){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((u,d,p)=>{let h,g=!1,y=null,m=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||I7,l&&(c<0&&p===0?(g2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,m=null):c===p&&(g=!0,m=d.route.hydrateFallbackElement||null)));let b=t.concat(i.slice(0,p+1)),C=()=>{let w;return h?w=y:g?w=m:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,f.createElement(M7,{match:d,routeContext:{outlet:u,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?f.createElement(O7,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:C(),routeContext:{outlet:null,matches:b,isDataRoute:!0},unstable_onError:r}):C()},null)}function xm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function D7(e){let t=f.useContext(Ra);return bn(t,xm(e)),t}function F7(e){let t=f.useContext(gp);return bn(t,xm(e)),t}function N7(e){let t=f.useContext(rs);return bn(t,xm(e)),t}function Pm(e){let t=N7(e),n=t.matches[t.matches.length-1];return bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $7(){return Pm("useRouteId")}function R7(){let e=f.useContext(Sm),t=F7("useRouteError"),n=Pm("useRouteError");return e!==void 0?e:t.errors?.[n]}function L7(){let{router:e}=D7("useNavigate"),t=Pm("useNavigate"),n=f.useRef(!1);return p2(()=>{n.current=!0}),f.useCallback(async(s,i={})=>{_r(n.current,d2),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var h2={};function g2(e,t,n){!t&&!h2[e]&&(h2[e]=!0,_r(!1,n))}f.memo(A7);function A7({routes:e,future:t,state:n,unstable_onError:r}){return f2(e,void 0,n,r,t)}function Em(e){bn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function V7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1}){bn(!Sc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=f.useMemo(()=>({basename:a,navigator:s,static:i,future:{}}),[a,s,i]);typeof n=="string"&&(n=$a(n));let{pathname:c="/",search:u="",hash:d="",state:p=null,key:h="default"}=n,g=f.useMemo(()=>{let y=ns(c,a);return y==null?null:{location:{pathname:y,search:u,hash:d,state:p,key:h},navigationType:r}},[a,c,u,d,p,h,r]);return _r(g!=null,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:f.createElement(Hr.Provider,{value:l},f.createElement(wc.Provider,{children:t,value:g}))}function B7({children:e,location:t}){return E7(Tm(e),t)}function Tm(e,t=[]){let n=[];return f.Children.forEach(e,(r,s)=>{if(!f.isValidElement(r))return;let i=[...t,s];if(r.type===f.Fragment){n.push.apply(n,Tm(r.props.children,i));return}bn(r.type===Em,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.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&&(a.children=Tm(r.props.children,i)),n.push(a)}),n}var mp="get",bp="application/x-www-form-urlencoded";function yp(e){return e!=null&&typeof e.tagName=="string"}function _7(e){return yp(e)&&e.tagName.toLowerCase()==="button"}function H7(e){return yp(e)&&e.tagName.toLowerCase()==="form"}function z7(e){return yp(e)&&e.tagName.toLowerCase()==="input"}function j7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function G7(e,t){return e.button===0&&(!t||t==="_self")&&!j7(e)}var vp=null;function W7(){if(vp===null)try{new FormData(document.createElement("form"),0),vp=!1}catch{vp=!0}return vp}var U7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Im(e){return e!=null&&!U7.has(e)?(_r(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${bp}"`),null):e}function q7(e,t){let n,r,s,i,a;if(H7(e)){let l=e.getAttribute("action");r=l?ns(l,t):null,n=e.getAttribute("method")||mp,s=Im(e.getAttribute("enctype"))||bp,i=new FormData(e)}else if(_7(e)||z7(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?ns(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||mp,s=Im(e.getAttribute("formenctype"))||Im(l.getAttribute("enctype"))||bp,i=new FormData(l,e),!W7()){let{name:u,type:d,value:p}=e;if(d==="image"){let h=u?`${u}.`:"";i.append(`${h}x`,"0"),i.append(`${h}y`,"0")}else u&&i.append(u,p)}}else{if(yp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mp,r=null,s=bp,a=e}return i&&s==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Om(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Y7(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ns(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function K7(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function X7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Z7(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let a=await K7(i,n);return a.links?a.links():[]}return[]}));return tB(r.flat(1).filter(X7).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function m2(e,t,n,r,s,i){let a=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,l=(c,u)=>n[u].pathname!==c.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==c.params["*"];return i==="assets"?t.filter((c,u)=>a(c,u)||l(c,u)):i==="data"?t.filter((c,u)=>{let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(a(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Q7(e,t,{includeHydrateFallback:n}={}){return J7(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function J7(e){return[...new Set(e)]}function eB(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function tB(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(eB(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function b2(){let e=f.useContext(Ra);return Om(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nB(){let e=f.useContext(gp);return Om(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Mm=f.createContext(void 0);Mm.displayName="FrameworkContext";function y2(){let e=f.useContext(Mm);return Om(e,"You must render this element inside a <HydratedRouter> element"),e}function oB(e,t){let n=f.useContext(Mm),[r,s]=f.useState(!1),[i,a]=f.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=t,h=f.useRef(null);f.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let m=C=>{C.forEach(w=>{a(w.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return h.current&&b.observe(h.current),()=>{b.disconnect()}}},[e]),f.useEffect(()=>{if(r){let m=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(m)}}},[r]);let g=()=>{s(!0)},y=()=>{s(!1),a(!1)};return n?e!=="intent"?[i,h,{}]:[i,h,{onFocus:Ec(l,g),onBlur:Ec(c,y),onMouseEnter:Ec(u,g),onMouseLeave:Ec(d,y),onTouchStart:Ec(p,g)}]:[!1,h,{}]}function Ec(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rB({page:e,...t}){let{router:n}=b2(),r=f.useMemo(()=>o2(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?f.createElement(iB,{page:e,matches:r,...t}):null}function sB(e){let{manifest:t,routeModules:n}=y2(),[r,s]=f.useState([]);return f.useEffect(()=>{let i=!1;return Z7(e,t,n).then(a=>{i||s(a)}),()=>{i=!0}},[e,t,n]),r}function iB({page:e,matches:t,...n}){let r=ur(),{manifest:s,routeModules:i}=y2(),{basename:a}=b2(),{loaderData:l,matches:c}=nB(),u=f.useMemo(()=>m2(e,t,c,s,r,"data"),[e,t,c,s,r]),d=f.useMemo(()=>m2(e,t,c,s,r,"assets"),[e,t,c,s,r]),p=f.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,m=!1;if(t.forEach(C=>{let w=s.routes[C.route.id];!w||!w.hasLoader||(!u.some(S=>S.route.id===C.route.id)&&C.route.id in l&&i[C.route.id]?.shouldRevalidate||w.hasClientLoader?m=!0:y.add(C.route.id))}),y.size===0)return[];let b=Y7(e,a,"data");return m&&y.size>0&&b.searchParams.set("_routes",t.filter(C=>y.has(C.route.id)).map(C=>C.route.id).join(",")),[b.pathname+b.search]},[a,l,r,s,u,t,e,i]),h=f.useMemo(()=>Q7(d,s),[d,s]),g=sB(d);return f.createElement(f.Fragment,null,p.map(y=>f.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),h.map(y=>f.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),g.map(({key:y,link:m})=>f.createElement("link",{key:y,nonce:n.nonce,...m})))}function aB(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var v2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{v2&&(window.__reactRouterVersion="7.9.4")}catch{}function lB({basename:e,children:t,window:n}){let r=f.useRef();r.current==null&&(r.current=XV({window:n,v5Compat:!0}));let s=r.current,[i,a]=f.useState({action:s.action,location:s.location}),l=f.useCallback(c=>{f.startTransition(()=>a(c))},[a]);return f.useLayoutEffect(()=>s.listen(l),[s,l]),f.createElement(V7,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:s})}var C2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w2=f.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:a,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p,...h},g){let{basename:y}=f.useContext(Hr),m=typeof u=="string"&&C2.test(u),b,C=!1;if(typeof u=="string"&&m&&(b=u,v2))try{let O=new URL(window.location.href),F=u.startsWith("//")?new URL(O.protocol+u):new URL(u),D=ns(F.pathname,y);F.origin===O.origin&&D!=null?u=D+F.search+F.hash:C=!0}catch{_r(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=x7(u,{relative:s}),[S,E,P]=oB(r,h),k=pB(u,{replace:a,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:p});function M(O){t&&t(O),O.defaultPrevented||k(O)}let I=f.createElement("a",{...h,...P,href:b||w,onClick:C||i?t:M,ref:aB(g,E),target:c,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?f.createElement(f.Fragment,null,I,f.createElement(rB,{page:w})):I});w2.displayName="Link";var cB=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:a,viewTransition:l,children:c,...u},d){let p=Pc(a,{relative:u.relative}),h=ur(),g=f.useContext(gp),{navigator:y,basename:m}=f.useContext(Hr),b=g!=null&&bB(p)&&l===!0,C=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(w=w.toLowerCase(),S=S?S.toLowerCase():null,C=C.toLowerCase()),S&&m&&(S=ns(S,m)||S);const E=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=w===C||!s&&w.startsWith(C)&&w.charAt(E)==="/",k=S!=null&&(S===C||!s&&S.startsWith(C)&&S.charAt(C.length)==="/"),M={isActive:P,isPending:k,isTransitioning:b},I=P?t:void 0,O;typeof r=="function"?O=r(M):O=[r,P?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let F=typeof i=="function"?i(M):i;return f.createElement(w2,{...u,"aria-current":I,className:O,ref:d,style:F,to:a,viewTransition:l},typeof c=="function"?c(M):c)});cB.displayName="NavLink";var uB=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:a=mp,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,...h},g)=>{let y=gB(),m=mB(l,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",C=typeof l=="string"&&C2.test(l),w=S=>{if(c&&c(S),S.defaultPrevented)return;S.preventDefault();let E=S.nativeEvent.submitter,P=E?.getAttribute("formmethod")||a;y(E||S.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:s,state:i,relative:u,preventScrollReset:d,viewTransition:p})};return f.createElement("form",{ref:g,method:b,action:m,onSubmit:r?c:w,...h,"data-discover":!C&&e==="render"?"true":void 0})});uB.displayName="Form";function dB(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S2(e){let t=f.useContext(Ra);return bn(t,dB(e)),t}function pB(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:a}={}){let l=xc(),c=ur(),u=Pc(e,{relative:i});return f.useCallback(d=>{if(G7(d,t)){d.preventDefault();let p=n!==void 0?n:Cc(c)===Cc(u);l(e,{replace:p,state:r,preventScrollReset:s,relative:i,viewTransition:a})}},[c,l,u,n,r,t,e,s,i,a])}var fB=0,hB=()=>`__${String(++fB)}__`;function gB(){let{router:e}=S2("useSubmit"),{basename:t}=f.useContext(Hr),n=$7();return f.useCallback(async(r,s={})=>{let{action:i,method:a,encType:l,formData:c,body:u}=q7(r,t);if(s.navigate===!1){let d=s.fetcherKey||hB();await e.fetch(d,n,s.action||i,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||a,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||i,{preventScrollReset:s.preventScrollReset,formData:c,body:u,formMethod:s.method||a,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function mB(e,{relative:t}={}){let{basename:n}=f.useContext(Hr),r=f.useContext(rs);bn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...Pc(e||".",{relative:t})},a=ur();if(e==null){i.search=a.search;let l=new URLSearchParams(i.search),c=l.getAll("index");if(c.some(d=>d==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let d=l.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:os([n,i.pathname])),Cc(i)}function bB(e,{relative:t}={}){let n=f.useContext(u2);bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=S2("useViewTransitionState"),s=Pc(e,{relative:t});if(!n.isTransitioning)return!1;let i=ns(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=ns(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hp(s.pathname,a)!=null||hp(s.pathname,i)!=null}const x2=({name:e,items:t,setState:n})=>{const r=xc(),s=ur(),i=new URLSearchParams(s.search);return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",subheader:e&&v.jsx(sc,{sx:{bgcolor:"transparent"},component:"div",id:"nested-list-subheader",children:e.toUpperCase()}),children:t.map((a,l)=>v.jsxs(mi,{sx:{borderRadius:"20px",minHeight:"56px",color:"#FFFFFF","& .MuiListItemText-primary":{color:"#FFFFFF"}},onClick:()=>{a.subgroups.length>0?(n("expanded"),r(a.path)):(n("open"),r(`${a.path}&view=${a.view}`))},selected:`${s.pathname}?module=${i.get("module")}`===a.path,children:[v.jsx(bi,{children:a.icon}),v.jsx(Vr,{primary:a.title,slotProps:{primary:{sx:{color:"#FFFFFF"}}}}),a.subgroups.length>0&&v.jsx(WV,{})]},l))})})},yB=({items:e,setState:t})=>{const n=xc(),r=ur(),s=new URLSearchParams(r.search);return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",children:e.map((i,a)=>v.jsx(mi,{sx:{borderRadius:"20px",minHeight:"56px"},onClick:()=>{i.subgroups.length>0?t("expanded"):n(`${i.path}&view=${i.view}`)},selected:`${r.pathname}?module=${s.get("module")}`===i.path,children:v.jsx(bi,{children:i.icon})},a))})})},vB=({items:e})=>{const t=ur(),n=xc(),r=new URLSearchParams(t.search);return v.jsx(ot,{size:12,children:v.jsx(es,{dense:!0,sx:{width:"100%","& .Mui-selected":{bgcolor:"#5B5157 !important"},"& .hover":{bgcolor:"#513D42 !important"}},component:"nav",children:e.map((s,i)=>v.jsx(mi,{sx:{borderRadius:"20px"},onClick:()=>{n(`${t.pathname}?module=${r.get("module")}${s.path}`)},selected:`&view=${r.get("view")}`===s.path,children:v.jsx(Vr,{slotProps:{primary:{sx:{color:"#FFFFFF"}}},primary:s.title})},i))})})},CB=({state:e,setState:t,groups:n})=>{const r=n.map(a=>a.items.map(l=>({title:l.title,color:l.color,icon:l.icon,path:l.path,view:l.view,subgroups:l.subgroups}))).flat(),s=ur(),i=new URLSearchParams(s.search);switch(e){case"close":return v.jsx(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:v.jsx(yB,{items:r,setState:t})});case"open":return v.jsx(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:v.jsx(ot,{size:12,children:n.map((a,l)=>v.jsx(x2,{name:a.name,items:a.items,setState:t},l))})});case"expanded":return v.jsxs(ot,{sx:{height:"calc(100vh - 160px)"},container:!0,spacing:2,children:[v.jsx(ot,{size:6,children:n.map((a,l)=>v.jsx(x2,{name:a.name,items:a.items,setState:t},l))}),v.jsx(ot,{size:6,children:v.jsx(vB,{items:r.find(a=>a.path===`${s.pathname}?module=${i.get("module")}`)?.subgroups||[]})})]})}},wB=({state:e,logout:t})=>{switch(e){case"close":return v.jsx(ot,{container:!0,spacing:2,children:v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:12,children:v.jsx(Dn,{sx:{height:"56px",borderRadius:"20px",bottom:"20px","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},onClick:t,children:v.jsx(vm,{size:28,color:"#9a28e6"})})})});case"open":return v.jsx(ot,{container:!0,spacing:2,children:v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:12,children:v.jsx(Vn,{sx:{width:"100%",height:"56px",borderRadius:"20px",bottom:"20px",color:"#FFFFFF","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},size:"small",startIcon:v.jsx(vm,{size:28,color:"#9a28e6"}),onClick:t,children:"Cerrar sesión"})})});case"expanded":return v.jsxs(ot,{container:!0,spacing:2,children:[v.jsx(ot,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},size:6,children:v.jsx(Vn,{sx:{width:"100%",height:"56px",borderRadius:"20px",bottom:"20px",color:"#FFFFFF","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"}},color:"inherit",size:"small",startIcon:v.jsx(vm,{size:28,color:"#9D11F2"}),onClick:t,children:v.jsx("span",{style:{textTransform:"none"},children:"Cerrar sesión"})})}),v.jsx(ot,{size:6})]})}},SB=({items:e,logout:t,state:n,setState:r,getWidth:s})=>v.jsxs(Gn,{sx:{padding:"20px",height:"calc(100vh - 40px)",width:s(n),bgcolor:i=>i.palette.background.paper,borderRadius:5,border:i=>`1px solid ${i.palette.background.default}`,overflow:"hidden"},children:[v.jsx(KV,{state:n,setState:r}),v.jsx(CB,{state:n,setState:r,groups:e}),v.jsx(wB,{state:n,logout:t})]}),xB=()=>{const[e,t]=ge.useState("open");return{state:e,setState:t,getWidth:r=>{switch(r){case"close":return"105px";case"open":return"230px";case"expanded":return"435px";default:return"230px"}}}},PB=({routes:e})=>{const t=ur(),n=xc();return v.jsxs(B7,{children:[e.map((r,s)=>v.jsx(Em,{path:r.path,element:ge.cloneElement(r.element,{location:t,navigate:n})},s)),v.jsx(Em,{path:"*",element:v.jsx("div",{children:"404 - Page Not Found"})})]})},EB=({username:e,options:t})=>{const[n,r]=ge.useState(!1);return v.jsxs(Ow,{sx:{width:"260px",height:n?"auto":"56px",position:"absolute",top:20,right:20,zIndex:1e3,bgcolor:"white",padding:0,boxShadow:"none",borderRadius:"20px"},children:[v.jsx(kw,{sx:{padding:"8px 20px"},avatar:v.jsx(Fd,{sx:{width:40,height:40,bgcolor:"#9D11F2"},children:e.charAt(0)}),title:e,slotProps:{title:{fontSize:"18px",fontStyle:"normal",fontWeight:"500",lineHeight:"22px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",maxWidth:"150px"}},action:t.length>0&&v.jsx(v.Fragment,{children:v.jsx(Dn,{sx:{color:"black"},children:n?v.jsx(YV,{color:"black",size:30,onClick:()=>r(!1)}):v.jsx(qV,{color:"black",size:30,onClick:()=>r(!0)})})})}),n&&v.jsx(Mw,{sx:{paddingY:"0px"},children:v.jsx(es,{children:t.map((s,i)=>v.jsxs(mi,{sx:{borderRadius:"20px"},onClick:s.onClick,children:[v.jsx(bi,{children:s.icon}),v.jsx(Vr,{primary:s.label,slotProps:{primary:{fontSize:"18px",fontStyle:"normal",fontWeight:"400",lineHeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"170px"}}})]},i))})})]})},TB=({getWidth:e,state:t,routes:n,account:r})=>v.jsxs(Gn,{sx:{width:`calc(100vw - ${e(t)} - 60px)`,height:"calc(100vh - 40px)"},children:[v.jsx(Gn,{sx:{height:"10%"},children:v.jsx(EB,{username:r.username,avatarUrl:r.avatarUrl,options:r.options})}),v.jsx(Gn,{sx:{height:"90%"},children:v.jsx(PB,{routes:n})})]}),IB=({logout:e,sidebarItems:t,routes:n,account:r})=>{const{state:s,setState:i,getWidth:a}=xB();return v.jsxs(Gn,{sx:{p:"20px",display:"grid",gridTemplateColumns:"auto 1fr",gap:"20px"},children:[v.jsx(SB,{items:t,logout:e,state:s,setState:i,getWidth:a}),v.jsx(TB,{state:s,getWidth:a,routes:n,account:r})]})};function P2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P2(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function xi(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P2(e))&&(r&&(r+=" "),r+=t);return r}let OB={data:""},MB=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||OB,kB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,DB=/\/\*[^]*?\*\/| +/g,E2=/\n+/g,Pi=(e,t)=>{let n="",r="",s="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+a+";":r+=i[1]=="f"?Pi(a,i):i+"{"+Pi(a,i[1]=="k"?"":t)+"}":typeof a=="object"?r+=Pi(a,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Pi.p?Pi.p(i,a):i+":"+a+";")}return n+(t&&s?t+"{"+s+"}":s)+r},ss={},T2=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+T2(e[n]);return t}return e},FB=(e,t,n,r,s)=>{let i=T2(e),a=ss[i]||(ss[i]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(i));if(!ss[a]){let c=i!==e?e:(u=>{let d,p,h=[{}];for(;d=kB.exec(u.replace(DB,""));)d[4]?h.shift():d[3]?(p=d[3].replace(E2," ").trim(),h.unshift(h[0][p]=h[0][p]||{})):h[0][d[1]]=d[2].replace(E2," ").trim();return h[0]})(e);ss[a]=Pi(s?{["@keyframes "+a]:c}:c,n?"":"."+a)}let l=n&&ss.g?ss.g:null;return n&&(ss.g=ss[a]),((c,u,d,p)=>{p?u.data=u.data.replace(p,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(ss[a],t,r,l),a},NB=(e,t,n)=>e.reduce((r,s,i)=>{let a=t[i];if(a&&a.call){let l=a(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;a=c?"."+c:l&&typeof l=="object"?l.props?"":Pi(l,""):l===!1?"":l}return r+s+(a??"")},"");function km(e){let t=this||{},n=e.call?e(t.p):e;return FB(n.unshift?n.raw?NB(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,MB(t.target),t.g,t.o,t.k)}km.bind({g:1}),km.bind({k:1});function $B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I2(e,t,n){return t&&$B(e.prototype,t),e}function tn(){return tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}function O2(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Tc(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function M2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var k2=function(){return""},D2=ge.createContext({enqueueSnackbar:k2,closeSnackbar:k2}),Ei={downXs:"@media (max-width:599.95px)",upSm:"@media (min-width:600px)"},F2=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Dm=function(t){return""+F2(t.vertical)+F2(t.horizontal)},Cp=function(t){return!!t||t===0},wp="unmounted",La="exited",Aa="entering",Ic="entered",N2="exiting",Fm=function(e){O2(t,e);function t(r){var s;s=e.call(this,r)||this;var i=r.appear,a;return s.appearStatus=null,r.in?i?(a=La,s.appearStatus=Aa):a=Ic:r.unmountOnExit||r.mountOnEnter?a=wp:a=La,s.state={status:a},s.nextCallback=null,s}t.getDerivedStateFromProps=function(s,i){var a=s.in;return a&&i.status===wp?{status:La}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(s){var i=null;if(s!==this.props){var a=this.state.status;this.props.in?a!==Aa&&a!==Ic&&(i=Aa):(a===Aa||a===Ic)&&(i=N2)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var s=this.props.timeout,i=s,a=s;return s!=null&&typeof s!="number"&&typeof s!="string"&&(a=s.exit,i=s.enter),{exit:a,enter:i}},n.updateStatus=function(s,i){s===void 0&&(s=!1),i!==null?(this.cancelNextCallback(),i===Aa?this.performEnter(s):this.performExit()):this.props.unmountOnExit&&this.state.status===La&&this.setState({status:wp})},n.performEnter=function(s){var i=this,a=this.props.enter,l=s,c=this.getTimeouts();if(!s&&!a){this.safeSetState({status:Ic},function(){i.props.onEntered&&i.props.onEntered(i.node,l)});return}this.props.onEnter&&this.props.onEnter(this.node,l),this.safeSetState({status:Aa},function(){i.props.onEntering&&i.props.onEntering(i.node,l),i.onTransitionEnd(c.enter,function(){i.safeSetState({status:Ic},function(){i.props.onEntered&&i.props.onEntered(i.node,l)})})})},n.performExit=function(){var s=this,i=this.props.exit,a=this.getTimeouts();if(!i){this.safeSetState({status:La},function(){s.props.onExited&&s.props.onExited(s.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:N2},function(){s.props.onExiting&&s.props.onExiting(s.node),s.onTransitionEnd(a.exit,function(){s.safeSetState({status:La},function(){s.props.onExited&&s.props.onExited(s.node)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(s,i){i=this.setNextCallback(i),this.setState(s,i)},n.setNextCallback=function(s){var i=this,a=!0;return this.nextCallback=function(){a&&(a=!1,i.nextCallback=null,s())},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(s,i){this.setNextCallback(i);var a=s==null&&!this.props.addEndListener;if(!this.node||a){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),s!=null&&setTimeout(this.nextCallback,s)},n.render=function(){var s=this.state.status;if(s===wp)return null;var i=this.props,a=i.children,l=Tc(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return a(s,l)},I2(t,[{key:"node",get:function(){var s,i=(s=this.props.nodeRef)===null||s===void 0?void 0:s.current;if(!i)throw new Error("notistack - Custom snackbar is not refForwarding");return i}}]),t}(ge.Component);function Va(){}Fm.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Va,onEntering:Va,onEntered:Va,onExit:Va,onExiting:Va,onExited:Va};function $2(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Nm(e,t){return ge.useMemo(function(){return e==null&&t==null?null:function(n){$2(e,n),$2(t,n)}},[e,t])}function Sp(e){var t=e.timeout,n=e.style,r=n===void 0?{}:n,s=e.mode;return{duration:typeof t=="object"?t[s]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}var $m={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},R2=function(t){t.scrollTop=t.scrollTop},L2=function(t){return Math.round(t)+"ms"};function Ba(e,t){e===void 0&&(e=["all"]);var n=t||{},r=n.duration,s=r===void 0?300:r,i=n.easing,a=i===void 0?$m.easeInOut:i,l=n.delay,c=l===void 0?0:l,u=Array.isArray(e)?e:[e];return u.map(function(d){var p=typeof s=="string"?s:L2(s),h=typeof c=="string"?c:L2(c);return d+" "+p+" "+a+" "+h}).join(",")}function RB(e){return e&&e.ownerDocument||document}function A2(e){var t=RB(e);return t.defaultView||window}function LB(e,t){t===void 0&&(t=166);var n;function r(){for(var s=this,i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var c=function(){e.apply(s,a)};clearTimeout(n),n=setTimeout(c,t)}return r.clear=function(){clearTimeout(n)},r}function AB(e,t){var n=t.getBoundingClientRect(),r=A2(t),s;if(t.fakeTransform)s=t.fakeTransform;else{var i=r.getComputedStyle(t);s=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){var c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+a-n.left)+"px)";case"right":return"translateX(-"+(n.left+n.width-a)+"px)";case"up":return"translateY("+(r.innerHeight+l-n.top)+"px)";default:return"translateY(-"+(n.top+n.height-l)+"px)"}}function xp(e,t){if(t){var n=AB(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var V2=ge.forwardRef(function(e,t){var n=e.children,r=e.direction,s=r===void 0?"down":r,i=e.in,a=e.style,l=e.timeout,c=l===void 0?0:l,u=e.onEnter,d=e.onEntered,p=e.onExit,h=e.onExited,g=Tc(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),y=ge.useRef(null),m=Nm(n.ref,y),b=Nm(m,t),C=function(M,I){xp(s,M),R2(M),u&&u(M,I)},w=function(M){var I=a?.transitionTimingFunction||$m.easeOut,O=Sp({timeout:c,mode:"enter",style:tn({},a,{transitionTimingFunction:I})});M.style.webkitTransition=Ba("-webkit-transform",O),M.style.transition=Ba("transform",O),M.style.webkitTransform="none",M.style.transform="none"},S=function(M){var I=a?.transitionTimingFunction||$m.sharp,O=Sp({timeout:c,mode:"exit",style:tn({},a,{transitionTimingFunction:I})});M.style.webkitTransition=Ba("-webkit-transform",O),M.style.transition=Ba("transform",O),xp(s,M),p&&p(M)},E=function(M){M.style.webkitTransition="",M.style.transition="",h&&h(M)},P=ge.useCallback(function(){y.current&&xp(s,y.current)},[s]);return ge.useEffect(function(){if(!(i||s==="down"||s==="right")){var k=LB(function(){y.current&&xp(s,y.current)}),M=A2(y.current);return M.addEventListener("resize",k),function(){k.clear(),M.removeEventListener("resize",k)}}},[s,i]),ge.useEffect(function(){i||P()},[i,P]),ge.createElement(Fm,Object.assign({appear:!0,nodeRef:y,onEnter:C,onEntered:d,onEntering:w,onExit:S,onExited:E,in:i,timeout:c},g),function(k,M){return ge.cloneElement(n,tn({ref:b,style:tn({visibility:k==="exited"&&!i?"hidden":void 0},a,{},n.props.style)},M))})});V2.displayName="Slide";var Pp=function(t){return ge.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},t))},VB=function(){return ge.createElement(Pp,null,ge.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
367
367
|
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},BB=function(){return ge.createElement(Pp,null,ge.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},_B=function(){return ge.createElement(Pp,null,ge.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
368
368
|
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
369
369
|
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},HB=function(){return ge.createElement(Pp,null,ge.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|