@zydon/common-csr 2.1.20 → 2.1.22

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.
@@ -15,6 +15,6 @@ import to from '@mui/material/Paper';
15
15
  import ro from '@mui/material/Popover';
16
16
  import et from '@mui/material/Divider';
17
17
 
18
- var t={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var fe={dark:"#282F37",light:"#EDEFF2"};function re(e,i){let{vars:{palette:o}}=e;return {"--nav-item-color":o.text.secondary,"--nav-item-hover-bg":o.action.hover,"--nav-item-caption-color":o.text.disabled,"--nav-item-root-active-color":o.primary.main,"--nav-item-root-active-color-on-dark":e.palette.primary.contrastText,"--nav-item-root-active-bg":varAlpha(o.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(o.primary.mainChannel,.16),"--nav-item-root-open-color":o.text.primary,"--nav-item-root-open-bg":o.action.hover,"--nav-item-sub-active-color":o.text.primary,"--nav-item-sub-active-bg":o.action.selected,"--nav-item-sub-open-color":o.text.primary,"--nav-item-sub-open-bg":o.action.hover,...i==="vertical"&&{"--nav-item-sub-active-bg":o.action.hover,"--nav-subheader-color":o.text.disabled,"--nav-subheader-hover-color":o.text.primary}}}function _e(e){let{shape:i,spacing:o}=e;return {...re(e,"vertical"),"--nav-item-gap":o(.5),"--nav-item-radius":`${i.borderRadius}px`,"--nav-item-pt":o(.5),"--nav-item-pr":o(1),"--nav-item-pb":o(.5),"--nav-item-pl":o(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":o(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":fe.light,"--nav-bullet-dark-color":fe.dark}}function Ee(e){let{shape:i,spacing:o}=e;return {...re(e,"mini"),"--nav-item-gap":o(.5),"--nav-item-radius":`${i.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":o(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":o(0,0,.75,0),"--nav-icon-sub-margin":o(0,1,0,0)}}function Me(e){let{shape:i,spacing:o}=e;return {...re(e,"horizontal"),"--nav-item-gap":o(.75),"--nav-height":"56px","--nav-item-radius":`${i.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":o(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":o(0,1,0,0),"--nav-icon-root-margin":o(0,1,0,0)}}var k={mini:Ee,vertical:_e,horizontal:Me};function S({open:e,active:i,disabled:o}){let a=t.item.root;return i?a+=` ${t.state.active}`:e?a+=` ${t.state.open}`:o&&(a+=` ${t.state.disabled}`),a}var u={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function Q({sx:e,children:i}){return jsx(Fragment,{children:jsx(We,{component:"div",sx:{gap:1,alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:o=>o.spacing(2,1,1,1.5),fontSize:o=>o.typography.pxToRem(11),transition:o=>o.transitions.create(["color","padding-left"],{duration:o.transitions.duration.standard}),...e},children:i})})}function X({sx:e,depth:i,children:o,...a}){return jsx(Te,{sx:{...i+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${t.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...a,children:o})}function g({sx:e,children:i,disabled:o,...a}){return jsx(q,{component:"li",className:t.li,sx:{display:"flex",flexDirection:"column",...o&&{cursor:"not-allowed"},...e},...a,children:i})}function N({children:e,sx:i,...o}){return jsx(q,{component:"ul",className:t.ul,sx:{display:"flex",flexDirection:"column",...i},...o,children:e})}var be=forwardRef(({href:e,...i},o)=>jsx(Link,{ref:o,to:e,...i}));function M({path:e,icon:i,info:o,depth:a,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n}){let l=a===1,v=!l,p=Number(a)>2,b=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{component:be,href:e},d=null;i&&r?.navIcon&&typeof i=="string"?d=r?.navIcon[i]:d=i;let f=null;if(o&&r?.navInfo&&Array.isArray(o)){let[x,h]=o,y=r.navInfo(h)[x];f=y?cloneElement(y):null;}else f=o;return {subItem:v,rootItem:l,subDeepItem:p,baseProps:b,renderIcon:d,renderInfo:f}}var Y=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(Qe,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),p&&jsx(ge,{icon:h.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:t.item.arrow})]})}));Y.displayName="NavItem";var Qe=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...n.title,whiteSpace:"nowrap"},[`& .${t.item.caption}`]:{...n.caption,marginLeft:r.spacing(.75)},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,flexGrow:1},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var Ne=e=>{let i=e.split("?")[1];return i?new URLSearchParams(i).toString().length>0:!1};function ie(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function xe(e){try{let i=new URL(e,window.location.origin);return ie(i.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function W(e){return e.replace(window.location.origin,"")}function w(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function z(e,i=!0){let o=ie(w()),a=Ne(e);if(e.startsWith("#")||I(e))return !1;if(i||a){let m=o.includes(e),n=xe(e);return m||a&&n===o}return o===e}function ae({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s}){let m=useTheme(),n=w(),l=useRef(null),v=z(e.path,!!e.children),[p,c]=useState(!1);useEffect(()=>{p&&d();},[n]);let b=useCallback(()=>{e.children&&c(!0);},[e.children]),d=useCallback(()=>{c(!1);},[]),f=jsx(Y,{ref:l,render:o,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:i,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:I(e.path),enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:b,onMouseLeave:d});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(ro,{disableScrollLock:!0,open:p,anchorEl:l.current,anchorOrigin:i===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:i===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:b,onMouseLeave:d,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i===1&&{ml:-.75},...p&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(ao,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})}function ao({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(ae,{data:m,render:o,depth:i+1,cssVars:a,slotProps:r,enabledRootRedirect:s},m.title))})}function Yr({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(po,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(mo,{component:"nav",direction:"row",alignItems:"center",className:t.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(co,{render:o,cssVars:n,items:l.items,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function co({items:e,render:i,slotProps:o,enabledRootRedirect:a,cssVars:r}){return jsx(g,{children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ae,{depth:1,data:s,render:i,cssVars:r,slotProps:o,enabledRootRedirect:a},s.title))})})}var Z=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(xo,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,placement:"right",children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&h.subItem&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo})]})}));Z.displayName="NavItem";var xo=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var me=({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})=>{let m=useTheme(),n=w(),l=useRef(null),v=z(e.path,!!e.children),[p,c]=useState(!1);useEffect(()=>{p&&d();},[n]);let b=useCallback(()=>{e.children&&c(!0);},[e.children]),d=useCallback(()=>{c(!1);},[]),f=jsx(Z,{ref:l,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:i,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:I(e.path),enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:b,onMouseLeave:d});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(ro,{disableScrollLock:!0,open:p,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:b,onMouseLeave:d,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i>1&&{mt:-1},...p&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(Po,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})};function Po({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,cssVars:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(me,{data:m,render:i,depth:o+1,cssVars:s,slotProps:a,enabledRootRedirect:r},m.title))})}var Tn=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(mo,{component:"nav",className:t.mini.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(Eo,{render:o,cssVars:n,items:l.items,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},Eo=({items:e,render:i,slotProps:o,enabledRootRedirect:a,cssVars:r})=>jsx(g,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(me,{depth:1,data:s,render:i,cssVars:r,slotProps:o,enabledRootRedirect:a},s.title))})});function j({path:e,icon:i,info:o,depth:a,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n,onNavigate:l}){let v=a===1,p=!v,c=Number(a)>2,d=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:h=>l(h,e)},f=null;i&&r?.navIcon&&typeof i=="string"?f=r?.navIcon[i]:f=i;let x=null;if(o&&r?.navInfo&&Array.isArray(o)){let[h,y]=o,E=r.navInfo(y)[h];x=E?cloneElement(E):null;}else x=o;return {subItem:p,rootItem:v,subDeepItem:c,baseProps:d,renderIcon:f,renderInfo:x}}var ee=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,onNavigate:f,...x},h)=>{let y=j({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d,onNavigate:f}),K=!(m===1),de=jsxs(Ao,{ref:h,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[i&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),a&&K&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,placement:"right",children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&y.subItem&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo})]});return de}));ee.displayName="NavItem";var Ao=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var pe=({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v=useRef(null),p=I(e.path),c=W(e.path),b=!!matchPath({path:c||"",end:!p},n),d=Array.isArray(e.children)?e.children.some(K=>matchPath({path:W(K.path)||"",end:!p},n)):b,[f,x]=useState(!1);useEffect(()=>{f&&y();},[n]);let h=useCallback(()=>{e.children&&x(!0);},[e.children]),y=useCallback(()=>{x(!1);},[]),E=jsx(ee,{ref:v,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:i,active:d,disabled:e.disabled,hasChild:!!e.children,open:e.children&&f,externalLink:!1,enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:h,onMouseLeave:y,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[E,jsx(ro,{disableScrollLock:!0,open:f,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:h,onMouseLeave:y,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i>1&&{mt:-1},...f&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Yo,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(g,{disabled:e.disabled,children:E})};function Yo({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(pe,{data:l,render:i,depth:o+1,cssVars:s,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n},l.title))})}var yi=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.mini(l),...s};return jsx(mo,{component:"nav",className:t.mini.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)",alignItems:"center",justifyContent:"center"},children:i.filter(p=>"divider"in p?!0:!p.hidden).map((p,c)=>"divider"in p?jsx("li",{children:p.divider},`divider-${c}`):jsxs(Fragment,{children:[p.subheader&&jsx(Fragment,{children:jsx(et,{sx:{my:2},flexItem:!0})}),jsx(rt,{render:o,cssVars:v,items:p.items,renderEmptyView:p.renderEmptyView,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n,hidden:p.hidden})]},p.subheader??p.items[0]?.title??c))})})},rt=({items:e,render:i,renderEmptyView:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.filter(v=>!v.hidden).map(v=>jsx(pe,{depth:1,data:v,render:i,cssVars:s,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n},v.title))});return jsx(g,{children:l})};var oe=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(vt,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.texts}`]:c?.texts,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),p&&jsx(ge,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}));oe.displayName="NavItem";var vt=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ce=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r})=>{let s=w(),m=z(e.path,!!e.children),[n,l]=useState(m);useEffect(()=>{m||p();},[s]);let v=useCallback(()=>{e.children&&l(b=>!b);},[e.children]),p=useCallback(()=>{l(!1);},[]),c=jsx(oe,{render:i,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:m,disabled:e.disabled,hasChild:!!e.children,open:e.children&&n,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?a?.rootItem:a?.subItem,onClick:v});return e.roles&&a?.currentRole&&!e?.roles?.includes(a?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[c,jsx(X,{"data-group":e.title,in:n,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(ft,{data:e.children,render:i,depth:o,slotProps:a,enabledRootRedirect:r})})]}):jsx(g,{disabled:e.disabled,children:c})},ft=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ce,{data:s,render:i,depth:o+1,slotProps:a,enabledRootRedirect:r},s.title))});var ta=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(mo,{component:"nav",className:t.vertical.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(It,{subheader:l.subheader,items:l.items,render:o,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},It=({items:e,render:i,subheader:o,slotProps:a,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(ce,{data:v,render:i,depth:1,slotProps:a,enabledRootRedirect:r},v.title))});return jsx(g,{children:o?jsxs(Fragment,{children:[jsx(Q,{"data-title":o,open:s,onClick:n,sx:a?.subheader,children:o}),jsx(Te,{in:s,children:l})]}):l})};var te=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,onNavigate:f,...x},h)=>{let y=j({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d,onNavigate:f});return jsxs(Bt,{ref:h,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.texts}`]:c?.texts,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[i&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),a&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo}),p&&jsx(ge,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_RIGHT",className:t.item.arrow})]})}));te.displayName="NavItem";var Bt=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ve=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})=>{let n=I(e.path),l=W(e.path),v=!!matchPath({path:l||"",end:!n},m),p=Array.isArray(e.children)?e.children.some(h=>matchPath({path:W(h.path)||"",end:!n},m)):v,[c,b]=useState(p);useEffect(()=>{p||f();},[m]);let d=useCallback(()=>{e.children&&b(h=>!h);},[e.children]),f=useCallback(()=>{b(!1);},[]),x=jsx(te,{render:i,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:p,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:!1,enabledRootRedirect:r,slotProps:o===1?a?.rootItem:a?.subItem,onClick:d,onNavigate:s});return e.roles&&a?.currentRole&&!e?.roles?.includes(a?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[x,jsx(X,{"data-group":e.title,in:c,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Mt,{data:e.children,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(g,{disabled:e.disabled,children:x})},Mt=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(ve,{data:n,render:i,depth:o+1,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m},n.title))});var Wa=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.vertical(l),...s};return jsx(mo,{component:"nav",className:t.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.filter(p=>"divider"in p?!0:!p.hidden).map((p,c)=>"divider"in p?jsx("li",{children:p.divider},`divider-${c}`):jsx(Ht,{subheader:p.subheader,items:p.items,render:o,renderEmptyView:p.renderEmptyView,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n,hidden:p.hidden,hiddenSubheader:p.hiddenSubheader},p.subheader??p.items[0]?.title??c))})})},Ht=({items:e,render:i,renderEmptyView:o,subheader:a,hiddenSubheader:r,slotProps:s,enabledRootRedirect:m,onNavigate:n,pathname:l})=>{let[v,p]=useState(!0),c=useCallback(()=>{p(d=>!d);},[]),b=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.filter(d=>!d.hidden).map(d=>jsx(ve,{data:d,render:i,depth:1,slotProps:s,enabledRootRedirect:m,onNavigate:n,pathname:l},d.title))});return jsx(g,{children:a&&!r?jsxs(Fragment,{children:[jsx(Q,{"data-title":a,open:v,onClick:c,sx:s?.subheader,children:a}),jsx(Te,{in:v,children:b})]}):b})};
18
+ var t={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var fe={dark:"#282F37",light:"#EDEFF2"};function re(e,i){let{vars:{palette:o}}=e;return {"--nav-item-color":o.text.secondary,"--nav-item-hover-bg":o.action.hover,"--nav-item-caption-color":o.text.disabled,"--nav-item-root-active-color":o.primary.main,"--nav-item-root-active-color-on-dark":e.palette.primary.contrastText,"--nav-item-root-active-bg":varAlpha(o.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(o.primary.mainChannel,.16),"--nav-item-root-open-color":o.text.primary,"--nav-item-root-open-bg":o.action.hover,"--nav-item-sub-active-color":o.text.primary,"--nav-item-sub-active-bg":o.action.selected,"--nav-item-sub-open-color":o.text.primary,"--nav-item-sub-open-bg":o.action.hover,...i==="vertical"&&{"--nav-item-sub-active-bg":o.action.hover,"--nav-subheader-color":o.text.disabled,"--nav-subheader-hover-color":o.text.primary}}}function _e(e){let{shape:i,spacing:o}=e;return {...re(e,"vertical"),"--nav-item-gap":o(.5),"--nav-item-radius":`${i.borderRadius}px`,"--nav-item-pt":o(.5),"--nav-item-pr":o(1),"--nav-item-pb":o(.5),"--nav-item-pl":o(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":o(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":fe.light,"--nav-bullet-dark-color":fe.dark}}function Ee(e){let{shape:i,spacing:o}=e;return {...re(e,"mini"),"--nav-item-gap":o(.5),"--nav-item-radius":`${i.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":o(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":o(0,0,.75,0),"--nav-icon-sub-margin":o(0,1,0,0)}}function Me(e){let{shape:i,spacing:o}=e;return {...re(e,"horizontal"),"--nav-item-gap":o(.75),"--nav-height":"56px","--nav-item-radius":`${i.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":o(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":o(0,1,0,0),"--nav-icon-root-margin":o(0,1,0,0)}}var k={mini:Ee,vertical:_e,horizontal:Me};function S({open:e,active:i,disabled:o}){let a=t.item.root;return i?a+=` ${t.state.active}`:e?a+=` ${t.state.open}`:o&&(a+=` ${t.state.disabled}`),a}var u={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function Q({sx:e,children:i}){return jsx(Fragment,{children:jsx(We,{component:"div",sx:{gap:1,alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:o=>o.spacing(2,1,1,1.5),fontSize:o=>o.typography.pxToRem(11),transition:o=>o.transitions.create(["color","padding-left"],{duration:o.transitions.duration.standard}),...e},children:i})})}function X({sx:e,depth:i,children:o,...a}){return jsx(Te,{sx:{...i+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${t.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...a,children:o})}function g({sx:e,children:i,disabled:o,...a}){return jsx(q,{component:"li",className:t.li,sx:{display:"flex",flexDirection:"column",...o&&{cursor:"not-allowed"},...e},...a,children:i})}function N({children:e,sx:i,...o}){return jsx(q,{component:"ul",className:t.ul,sx:{display:"flex",flexDirection:"column",...i},...o,children:e})}var be=forwardRef(({href:e,...i},o)=>jsx(Link,{ref:o,to:e,...i}));function M({path:e,icon:i,info:o,depth:a,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n}){let l=a===1,v=!l,p=Number(a)>2,b=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{component:be,href:e},d=null;i&&r?.navIcon&&typeof i=="string"?d=r?.navIcon[i]:d=i;let f=null;if(o&&r?.navInfo&&Array.isArray(o)){let[x,h]=o,y=r.navInfo(h)[x];f=y?cloneElement(y):null;}else f=o;return {subItem:v,rootItem:l,subDeepItem:p,baseProps:b,renderIcon:d,renderInfo:f}}var Y=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(Qe,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),p&&jsx(ge,{icon:h.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:t.item.arrow})]})}));Y.displayName="NavItem";var Qe=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...n.title,whiteSpace:"nowrap"},[`& .${t.item.caption}`]:{...n.caption,marginLeft:r.spacing(.75)},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,flexGrow:1},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var Ne=e=>{let i=e.split("?")[1];return i?new URLSearchParams(i).toString().length>0:!1};function ie(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function xe(e){try{let i=new URL(e,window.location.origin);return ie(i.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function W(e){return e.replace(window.location.origin,"")}function w(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function z(e,i=!0){let o=ie(w()),a=Ne(e);if(e.startsWith("#")||I(e))return !1;if(i||a){let m=o.includes(e),n=xe(e);return m||a&&n===o}return o===e}function ae({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s}){let m=useTheme(),n=w(),l=useRef(null),v=z(e.path,!!e.children),[p,c]=useState(!1);useEffect(()=>{p&&d();},[n]);let b=useCallback(()=>{e.children&&c(!0);},[e.children]),d=useCallback(()=>{c(!1);},[]),f=jsx(Y,{ref:l,render:o,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:i,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:I(e.path),enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:b,onMouseLeave:d});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(ro,{disableScrollLock:!0,open:p,anchorEl:l.current,anchorOrigin:i===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:i===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:b,onMouseLeave:d,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i===1&&{ml:-.75},...p&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(ao,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})}function ao({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(ae,{data:m,render:o,depth:i+1,cssVars:a,slotProps:r,enabledRootRedirect:s},m.title))})}function Yr({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(po,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(mo,{component:"nav",direction:"row",alignItems:"center",className:t.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(co,{render:o,cssVars:n,items:l.items,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function co({items:e,render:i,slotProps:o,enabledRootRedirect:a,cssVars:r}){return jsx(g,{children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ae,{depth:1,data:s,render:i,cssVars:r,slotProps:o,enabledRootRedirect:a},s.title))})})}var Z=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(xo,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,placement:"right",children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&h.subItem&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo})]})}));Z.displayName="NavItem";var xo=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var me=({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})=>{let m=useTheme(),n=w(),l=useRef(null),v=z(e.path,!!e.children),[p,c]=useState(!1);useEffect(()=>{p&&d();},[n]);let b=useCallback(()=>{e.children&&c(!0);},[e.children]),d=useCallback(()=>{c(!1);},[]),f=jsx(Z,{ref:l,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:i,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:I(e.path),enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:b,onMouseLeave:d});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(ro,{disableScrollLock:!0,open:p,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:b,onMouseLeave:d,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i>1&&{mt:-1},...p&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(Po,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})};function Po({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,cssVars:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(me,{data:m,render:i,depth:o+1,cssVars:s,slotProps:a,enabledRootRedirect:r},m.title))})}var Tn=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(mo,{component:"nav",className:t.mini.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(Eo,{render:o,cssVars:n,items:l.items,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},Eo=({items:e,render:i,slotProps:o,enabledRootRedirect:a,cssVars:r})=>jsx(g,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(me,{depth:1,data:s,render:i,cssVars:r,slotProps:o,enabledRootRedirect:a},s.title))})});function j({path:e,icon:i,info:o,depth:a,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n,onNavigate:l}){let v=a===1,p=!v,c=Number(a)>2,d=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:h=>l(h,e)},f=null;i&&r?.navIcon&&typeof i=="string"?f=r?.navIcon[i]:f=i;let x=null;if(o&&r?.navInfo&&Array.isArray(o)){let[h,y]=o,E=r.navInfo(y)[h];x=E?cloneElement(E):null;}else x=o;return {subItem:p,rootItem:v,subDeepItem:c,baseProps:d,renderIcon:f,renderInfo:x}}var ee=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,onNavigate:f,...x},h)=>{let y=j({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d,onNavigate:f}),K=!(m===1),de=jsxs(Ao,{ref:h,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[i&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),a&&K&&jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,arrow:!0,placement:"right",children:jsx(ge,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&y.subItem&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo})]});return de}));ee.displayName="NavItem";var Ao=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var pe=({data:e,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v=useRef(null),p=I(e.path),c=W(e.path),b=!!matchPath({path:c||"",end:!p},n),d=Array.isArray(e.children)?e.children.some(K=>matchPath({path:W(K.path)||"",end:!p},n)):b,[f,x]=useState(!1);useEffect(()=>{f&&y();},[n]);let h=useCallback(()=>{e.children&&x(!0);},[e.children]),y=useCallback(()=>{x(!1);},[]),E=jsx(ee,{ref:v,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:i,active:d,disabled:e.disabled,hasChild:!!e.children,open:e.children&&f,externalLink:!1,enabledRootRedirect:s,slotProps:i===1?r?.rootItem:r?.subItem,onMouseEnter:h,onMouseLeave:y,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[E,jsx(ro,{disableScrollLock:!0,open:f,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:h,onMouseLeave:y,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...i>1&&{mt:-1},...f&&{pointerEvents:"auto"}}}},sx:{...a,pointerEvents:"none"},children:jsx(to,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Yo,{data:e.children,depth:i,render:o,cssVars:a,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(g,{disabled:e.disabled,children:E})};function Yo({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(pe,{data:l,render:i,depth:o+1,cssVars:s,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n},l.title))})}var yi=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.mini(l),...s};return jsx(mo,{component:"nav",className:t.mini.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)",alignItems:"center",justifyContent:"center"},children:i.filter(p=>"divider"in p?!0:!p.hidden).map((p,c)=>"divider"in p?jsx("li",{children:p.divider},`divider-${c}`):jsxs(Fragment,{children:[p.subheader&&jsx(Fragment,{children:jsx(et,{sx:{my:2},flexItem:!0})}),jsx(rt,{render:o,cssVars:v,items:p.items,renderEmptyView:p.renderEmptyView,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n,hidden:p.hidden})]},p.subheader??p.items[0]?.title??c))})})},rt=({items:e,render:i,renderEmptyView:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.filter(v=>!v.hidden).map(v=>jsx(pe,{depth:1,data:v,render:i,cssVars:s,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n},v.title))});return jsx(g,{children:l})};var oe=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,...f},x)=>{let h=M({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d});return jsxs(vt,{ref:x,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.texts}`]:c?.texts,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[i&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),a&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),p&&jsx(ge,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_RIGHT",className:t.item.arrow})]})}));oe.displayName="NavItem";var vt=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ce=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r})=>{let s=w(),m=z(e.path,!!e.children),[n,l]=useState(m);useEffect(()=>{m||p();},[s]);let v=useCallback(()=>{e.children&&l(b=>!b);},[e.children]),p=useCallback(()=>{l(!1);},[]),c=jsx(oe,{render:i,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:m,disabled:e.disabled,hasChild:!!e.children,open:e.children&&n,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?a?.rootItem:a?.subItem,onClick:v});return e.roles&&a?.currentRole&&!e?.roles?.includes(a?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[c,jsx(X,{"data-group":e.title,in:n,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(ft,{data:e.children,render:i,depth:o,slotProps:a,enabledRootRedirect:r})})]}):jsx(g,{disabled:e.disabled,children:c})},ft=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ce,{data:s,render:i,depth:o+1,slotProps:a,enabledRootRedirect:r},s.title))});var ta=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(mo,{component:"nav",className:t.vertical.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.map(l=>jsx(It,{subheader:l.subheader,items:l.items,render:o,slotProps:a,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},It=({items:e,render:i,subheader:o,slotProps:a,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(ce,{data:v,render:i,depth:1,slotProps:a,enabledRootRedirect:r},v.title))});return jsx(g,{children:o?jsxs(Fragment,{children:[jsx(Q,{"data-title":o,open:s,onClick:n,sx:a?.subheader,children:o}),jsx(Te,{in:s,children:l})]}):l})};var te=memo(forwardRef(({path:e,icon:i,info:o,title:a,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:p,slotProps:c,externalLink:b,enabledRootRedirect:d,onNavigate:f,...x},h)=>{let y=j({path:e,icon:i,info:o,depth:m,render:n,hasChild:p,externalLink:b,enabledRootRedirect:d,onNavigate:f});return jsxs(Bt,{ref:h,"aria-label":a,depth:m,active:l,disabled:v,open:s&&!l,sx:{...c?.sx,[`& .${t.item.icon}`]:c?.icon,[`& .${t.item.texts}`]:c?.texts,[`& .${t.item.title}`]:c?.title,[`& .${t.item.caption}`]:c?.caption,[`& .${t.item.info}`]:c?.info,[`& .${t.item.arrow}`]:c?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[i&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),a&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:a}),r&&jsx(Je,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo}),p&&jsx(ge,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_RIGHT",className:t.item.arrow})]})}));te.displayName="NavItem";var Bt=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:i,disabled:o,depth:a,theme:r})=>{let s=a===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...i&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...i&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ve=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})=>{let n=I(e.path),l=W(e.path),v=!!matchPath({path:l||"",end:!n},m),p=Array.isArray(e.children)?e.children.some(h=>matchPath({path:W(h.path)||"",end:!n},m)):v,[c,b]=useState(p);useEffect(()=>{p||f();},[m]);let d=useCallback(()=>{e.children&&b(h=>!h);},[e.children]),f=useCallback(()=>{b(!1);},[]),x=jsx(te,{render:i,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:p,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:!1,enabledRootRedirect:r,slotProps:o===1?a?.rootItem:a?.subItem,onClick:d,onNavigate:s});return e.roles&&a?.currentRole&&!e?.roles?.includes(a?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[x,jsx(X,{"data-group":e.title,in:c,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Mt,{data:e.children,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(g,{disabled:e.disabled,children:x})},Mt=({data:e,render:i,depth:o,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(ve,{data:n,render:i,depth:o+1,slotProps:a,enabledRootRedirect:r,onNavigate:s,pathname:m},n.title))});var Wa=({sx:e,data:i,render:o,slotProps:a,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.vertical(l),...s};return jsx(mo,{component:"nav",className:t.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:i.filter(p=>"divider"in p?!0:!p.hidden).map((p,c)=>"divider"in p?jsx("li",{children:p.divider},`divider-${c}`):jsx(Ht,{subheader:p.subheader,items:p.items,render:o,renderEmptyView:p.renderEmptyView,slotProps:a,enabledRootRedirect:r,onNavigate:m,pathname:n,hidden:p.hidden,hiddenSubheader:p.hiddenSubheader},p.subheader??p.items[0]?.title??c))})})},Ht=({items:e,render:i,renderEmptyView:o,subheader:a,hiddenSubheader:r,slotProps:s,enabledRootRedirect:m,onNavigate:n,pathname:l})=>{let[v,p]=useState(!0),c=useCallback(()=>{p(d=>!d);},[]),b=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.filter(d=>!d.hidden).map(d=>jsx(ve,{data:d,render:i,depth:1,slotProps:s,enabledRootRedirect:m,onNavigate:n,pathname:l},d.title))});return jsx(g,{children:a&&!r?jsxs(Fragment,{children:[jsx(Q,{"data-title":a,open:v,onClick:c,sx:s?.subheader,children:a}),jsx(Te,{in:v,children:b})]}):b})};
19
19
 
20
20
  export { X as NavCollapse, g as NavLi, Yr as NavSectionHorizontal, Y as NavSectionHorizontalItem, Tn as NavSectionMini, ee as NavSectionMiniButtonItem, Z as NavSectionMiniItem, yi as NavSectionMiniWithButtons, ta as NavSectionVertical, te as NavSectionVerticalButtonItem, oe as NavSectionVerticalItem, Wa as NavSectionVerticalWithButtons, N as NavUl, Q as Subheader, fe as bulletColor, t as navSectionClasses, k as navSectionCssVars, u as sharedStyles, S as stateClasses, M as useNavItem };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.20",
2
+ "version": "2.1.22",
3
3
  "name": "@zydon/common-csr",
4
4
  "description": "Zydon common resources for React projects (only Client-Side Rendering (CSR))",
5
5
  "license": "MIT",
@@ -61,12 +61,11 @@
61
61
  "./styles.css": "./dist/index.css"
62
62
  },
63
63
  "devDependencies": {
64
- "@emotion/react": "^11.14.0",
65
- "@emotion/styled": "^11.14.1",
66
- "@mui/material": "^5.18.0",
67
- "@mui/system": "^5.18.0",
68
- "@mui/x-data-grid-premium": "7.22.0",
69
- "@mui/x-license": "^7.29.1",
64
+ "@emotion/react": "^11.13.3",
65
+ "@emotion/styled": "^11.13.0",
66
+ "@mui/material": "^5.16.7",
67
+ "@mui/x-data-grid-premium": "^7.14.0",
68
+ "@mui/x-license": "^7.14.0",
70
69
  "@testing-library/dom": "10.0.0",
71
70
  "@testing-library/jest-dom": "^6.6.3",
72
71
  "@testing-library/react": "^16.1.0",
@@ -79,7 +78,7 @@
79
78
  "@types/react-lazy-load-image-component": "^1.6.4",
80
79
  "@typescript-eslint/eslint-plugin": "^6.4.1",
81
80
  "@typescript-eslint/parser": "^6.4.1",
82
- "@zydon/common": "2.7.83",
81
+ "@zydon/common": "2.7.85",
83
82
  "eslint": "^8.47.0",
84
83
  "eslint-config-prettier": "^9.0.0",
85
84
  "eslint-plugin-jsx-a11y": "^6.10.2",
@@ -120,10 +119,10 @@
120
119
  "react-lazy-load-image-component": "^1.6.2"
121
120
  },
122
121
  "peerDependencies": {
123
- "@emotion/react": "^11.14.0",
124
- "@emotion/styled": "^11.14.1",
125
- "@mui/material": "^5.18.0",
126
- "@mui/x-data-grid-premium": "7.22.0",
122
+ "@emotion/react": "^11.13.3",
123
+ "@emotion/styled": "^11.13.0",
124
+ "@mui/material": "^5.16.7",
125
+ "@mui/x-data-grid-premium": "^7.14.0",
127
126
  "@zydon/common": ">=2.x",
128
127
  "react": "^18.3.1",
129
128
  "react-dom": "^18.3.1",