import{a as g}from"./chunk-BSS2F6WH.mjs";import{a as d}from"./chunk-5YOJG3WX.mjs";import{useCallback as P,useEffect as k,useRef as D,useState as N}from"react";import z from"@mui/material/Popover";import C from"@mui/material/Stack";import{usePathname as R}from"next/navigation";import{jsx as m,Fragment as F,jsxs as K}from"react/jsx-runtime";function u(t){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},u(t)}function O(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,n)}return e}function _(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?O(Object(e),!0).forEach(function(n){w(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):O(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function w(t,r,e){return(r=A(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function A(t){var r=L(t,"string");return u(r)=="symbol"?r:r+""}function L(t,r){if(u(t)!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var n=e.call(t,r||"default");if(u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function E(t,r){return I(t)||T(t,r)||M(t,r)||x()}function x(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(t,r){if(t){if(typeof t=="string")return j(t,r);var e={}.toString.call(t).slice(8,-1);return e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set"?Array.from(t):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?j(t,r):void 0}}function j(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function T(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n,o,c,a,l=[],i=!0,s=!1;try{if(c=(e=e.call(t)).next,r===0){if(Object(e)!==e)return;i=!1}else for(;!(i=(n=c.call(e)).done)&&(l.push(n.value),l.length!==r);i=!0);}catch(f){s=!0,o=f}finally{try{if(!i&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function I(t){if(Array.isArray(t))return t}var S=function(r){var e=r.data,n=r.depth,o=r.slotProps,c=r.hasTabLayout,a=D(null),l=R(),i=d(e?.path,!!e.children),s=N(!1),f=E(s,2),p=f[0],b=f[1],y=P(function(){b(!1)},[]);k(function(){p&&y()},[l]);var v=P(function(){e.children&&b(!0)},[e.children]);return K(F,{children:[m(g,{ref:a,open:p,onMouseEnter:v,onMouseLeave:y,itemData:e,depth:n,hasChild:!!e.children,active:i,className:i?"active":"",sx:n===1?o?.rootItem:o?.subItem,hasTabLayout:c}),!!e.children&&m(z,{disableScrollLock:!0,open:p,anchorEl:a.current,anchorOrigin:n===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:n===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:v,onMouseLeave:y,sx:_({minWidth:160},p&&{pointerEvents:"auto"})}},sx:{pointerEvents:"none"},children:m(C,{spacing:.5,children:e.children.map(function(h){return m(S,{data:h,depth:n+1,slotProps:o},h.title)})})})]})},J=S;export{J as a};
//# sourceMappingURL=chunk-UD7T5VNE.mjs.map