import{B as te,s as M,d as F,f as g,m as c,R,p as E,q as ne,o as u,c as d,W as K,X as z,y as v,x as O,u as I,A as w,C as p,z as y,O as H,K as S,v as L,D as q,T as W,aF as ae,ak as P,a3 as A,bi as V,af as T,ai as x,ap as D,j as ie,E as re,a as oe,w as se,L as b,S as j}from"./CVN9mXi8.js";import{U as N}from"./Cnr6hwyY.js";import{s as X}from"./BzjqEU2Y.js";import{s as J}from"./CeHl1rk9.js";import{u as le,m as B}from"./-gLlQWsu.js";var ue=function(e){var t=e.dt;return`
.p-panelmenu {
    display: flex;
    flex-direction: column;
    gap: `.concat(t("panelmenu.gap"),`;
}

.p-panelmenu-panel {
    background: `).concat(t("panelmenu.panel.background"),`;
    border-width: `).concat(t("panelmenu.panel.border.width"),`;
    border-style: solid;
    border-color: `).concat(t("panelmenu.panel.border.color"),`;
    color: `).concat(t("panelmenu.panel.color"),`;
    border-radius: `).concat(t("panelmenu.panel.border.radius"),`;
    padding: `).concat(t("panelmenu.panel.padding"),`;
}

.p-panelmenu-panel:first-child {
    border-width: `).concat(t("panelmenu.panel.first.border.width"),`;
    border-start-start-radius: `).concat(t("panelmenu.panel.first.top.border.radius"),`;
    border-start-end-radius: `).concat(t("panelmenu.panel.first.top.border.radius"),`;
}

.p-panelmenu-panel:last-child {
    border-width: `).concat(t("panelmenu.panel.last.border.width"),`;
    border-end-start-radius: `).concat(t("panelmenu.panel.last.bottom.border.radius"),`;
    border-end-end-radius: `).concat(t("panelmenu.panel.last.bottom.border.radius"),`;
}

.p-panelmenu-header {
    outline: 0 none;
}

.p-panelmenu-header-content {
    border-radius: `).concat(t("panelmenu.item.border.radius"),`;
    transition: background `).concat(t("panelmenu.transition.duration"),", color ").concat(t("panelmenu.transition.duration"),", outline-color ").concat(t("panelmenu.transition.duration"),", box-shadow ").concat(t("panelmenu.transition.duration"),`;
    outline-color: transparent;
    color: `).concat(t("panelmenu.item.color"),`;
}

.p-panelmenu-header-link {
    display: flex;
    gap: `).concat(t("panelmenu.item.gap"),`;
    padding: `).concat(t("panelmenu.item.padding"),`;
    align-items: center;
    user-select: none;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.p-panelmenu-header-icon,
.p-panelmenu-item-icon {
    color: `).concat(t("panelmenu.item.icon.color"),`;
}

.p-panelmenu-submenu-icon {
    color: `).concat(t("panelmenu.submenu.icon.color"),`;
}

.p-panelmenu-submenu-icon:dir(rtl) {
    transform: rotate(180deg);
}

.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content {
    background: `).concat(t("panelmenu.item.focus.background"),`;
    color: `).concat(t("panelmenu.item.focus.color"),`;
}

.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-header-icon {
    color: `).concat(t("panelmenu.item.icon.focus.color"),`;
}

.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-submenu-icon {
    color: `).concat(t("panelmenu.submenu.icon.focus.color"),`;
}

.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover {
    background: `).concat(t("panelmenu.item.focus.background"),`;
    color: `).concat(t("panelmenu.item.focus.color"),`;
}

.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-header-icon {
    color: `).concat(t("panelmenu.item.icon.focus.color"),`;
}

.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-submenu-icon {
    color: `).concat(t("panelmenu.submenu.icon.focus.color"),`;
}

.p-panelmenu-submenu {
    margin: 0;
    padding: 0 0 0 `).concat(t("panelmenu.submenu.indent"),`;
    outline: 0;
    list-style: none;
}

.p-panelmenu-submenu:dir(rtl) {
    padding: 0 `).concat(t("panelmenu.submenu.indent"),` 0 0;
}

.p-panelmenu-item-link {
    display: flex;
    gap: `).concat(t("panelmenu.item.gap"),`;
    padding: `).concat(t("panelmenu.item.padding"),`;
    align-items: center;
    user-select: none;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.p-panelmenu-item-label {
    line-height: 1;
}

.p-panelmenu-item-content {
    border-radius: `).concat(t("panelmenu.item.border.radius"),`;
    transition: background `).concat(t("panelmenu.transition.duration"),", color ").concat(t("panelmenu.transition.duration"),", outline-color ").concat(t("panelmenu.transition.duration"),", box-shadow ").concat(t("panelmenu.transition.duration"),`;
    color: `).concat(t("panelmenu.item.color"),`;
    outline-color: transparent;
}

.p-panelmenu-item.p-focus > .p-panelmenu-item-content {
    background: `).concat(t("panelmenu.item.focus.background"),`;
    color: `).concat(t("panelmenu.item.focus.color"),`;
}

.p-panelmenu-item.p-focus > .p-panelmenu-item-content .p-panelmenu-item-icon {
    color: `).concat(t("panelmenu.item.focus.color"),`;
}

.p-panelmenu-item.p-focus > .p-panelmenu-item-content .p-panelmenu-submenu-icon {
    color: `).concat(t("panelmenu.submenu.icon.focus.color"),`;
}

.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover {
    background: `).concat(t("panelmenu.item.focus.background"),`;
    color: `).concat(t("panelmenu.item.focus.color"),`;
}

.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-item-icon {
    color: `).concat(t("panelmenu.item.icon.focus.color"),`;
}

.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-submenu-icon {
    color: `).concat(t("panelmenu.submenu.icon.focus.color"),`;
}
`)},ce={root:"p-panelmenu p-component",panel:"p-panelmenu-panel",header:function(e){var t=e.instance,i=e.item;return["p-panelmenu-header",{"p-panelmenu-header-active":t.isItemActive(i)&&!!i.items,"p-disabled":t.isItemDisabled(i)}]},headerContent:"p-panelmenu-header-content",headerLink:"p-panelmenu-header-link",headerIcon:"p-panelmenu-header-icon",headerLabel:"p-panelmenu-header-label",contentContainer:"p-panelmenu-content-container",content:"p-panelmenu-content",rootList:"p-panelmenu-root-list",item:function(e){var t=e.instance,i=e.processedItem;return["p-panelmenu-item",{"p-focus":t.isItemFocused(i),"p-disabled":t.isItemDisabled(i)}]},itemContent:"p-panelmenu-item-content",itemLink:"p-panelmenu-item-link",itemIcon:"p-panelmenu-item-icon",itemLabel:"p-panelmenu-item-label",submenuIcon:"p-panelmenu-submenu-icon",submenu:"p-panelmenu-submenu",separator:"p-menuitem-separator"},de=te.extend({name:"panelmenu",theme:ue,classes:ce}),me={name:"BasePanelMenu",extends:M,props:{model:{type:Array,default:null},expandedKeys:{type:Object,default:null},multiple:{type:Boolean,default:!1},tabindex:{type:Number,default:0}},style:de,provide:function(){return{$pcPanelMenu:this,$parentInstance:this}}},Q={name:"PanelMenuSub",hostName:"PanelMenu",extends:M,emits:["item-toggle","item-mousemove"],props:{panelId:{type:String,default:null},focusedItemId:{type:String,default:null},items:{type:Array,default:null},level:{type:Number,default:0},templates:{type:Object,default:null},activeItemPath:{type:Object,default:null},tabindex:{type:Number,default:-1}},methods:{getItemId:function(e){return"".concat(this.panelId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(e,t,i){return e&&e.item?F(e.item[t],i):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,t,i){return this.ptm(e,{context:{item:t.item,index:i,active:this.isItemActive(t),focused:this.isItemFocused(t),disabled:this.isItemDisabled(t)}})},isItemActive:function(e){return this.activeItemPath.some(function(t){return t.key===e.key})},isItemVisible:function(e){return this.getItemProp(e,"visible")!==!1},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(e){return g(e.items)},onItemClick:function(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-toggle",{processedItem:t,expanded:!this.isItemActive(t)})},onItemToggle:function(e){this.$emit("item-toggle",e)},onItemMouseMove:function(e,t){this.$emit("item-mousemove",{originalEvent:e,processedItem:t})},getAriaSetSize:function(){var e=this;return this.items.filter(function(t){return e.isItemVisible(t)&&!e.getItemProp(t,"separator")}).length},getAriaPosInset:function(e){var t=this;return e-this.items.slice(0,e).filter(function(i){return t.isItemVisible(i)&&t.getItemProp(i,"separator")}).length+1},getMenuItemProps:function(e,t){return{action:c({class:this.cx("itemLink"),tabindex:-1},this.getPTOptions("itemLink",e,t)),icon:c({class:[this.cx("itemIcon"),this.getItemProp(e,"icon")]},this.getPTOptions("itemIcon",e,t)),label:c({class:this.cx("itemLabel")},this.getPTOptions("itemLabel",e,t)),submenuicon:c({class:this.cx("submenuIcon")},this.getPTOptions("submenuicon",e,t))}}},components:{ChevronRightIcon:J,ChevronDownIcon:X},directives:{ripple:R}},fe=["tabindex"],pe=["id","aria-label","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-focused","data-p-disabled"],he=["onClick","onMousemove"],Ie=["href","target"];function ge(n,e,t,i,o,a){var l=E("PanelMenuSub",!0),s=ne("ripple");return u(),d("ul",{class:y(n.cx("submenu")),tabindex:t.tabindex},[(u(!0),d(K,null,z(t.items,function(r,m){return u(),d(K,{key:a.getItemKey(r)},[a.isItemVisible(r)&&!a.getItemProp(r,"separator")?(u(),d("li",c({key:0,id:a.getItemId(r),class:[n.cx("item",{processedItem:r}),a.getItemProp(r,"class")],style:a.getItemProp(r,"style"),role:"treeitem","aria-label":a.getItemLabel(r),"aria-expanded":a.isItemGroup(r)?a.isItemActive(r):void 0,"aria-level":t.level+1,"aria-setsize":a.getAriaSetSize(),"aria-posinset":a.getAriaPosInset(m),ref_for:!0},a.getPTOptions("item",r,m),{"data-p-focused":a.isItemFocused(r),"data-p-disabled":a.isItemDisabled(r)}),[v("div",c({class:n.cx("itemContent"),onClick:function(f){return a.onItemClick(f,r)},onMousemove:function(f){return a.onItemMouseMove(f,r)},ref_for:!0},a.getPTOptions("itemContent",r,m)),[t.templates.item?(u(),I(w(t.templates.item),{key:1,item:r.item,root:!1,active:a.isItemActive(r),hasSubmenu:a.isItemGroup(r),label:a.getItemLabel(r),props:a.getMenuItemProps(r,m)},null,8,["item","active","hasSubmenu","label","props"])):O((u(),d("a",c({key:0,href:a.getItemProp(r,"url"),class:n.cx("itemLink"),target:a.getItemProp(r,"target"),tabindex:"-1",ref_for:!0},a.getPTOptions("itemLink",r,m)),[a.isItemGroup(r)?(u(),d(K,{key:0},[t.templates.submenuicon?(u(),I(w(t.templates.submenuicon),c({key:0,class:n.cx("submenuIcon"),active:a.isItemActive(r),ref_for:!0},a.getPTOptions("submenuIcon",r,m)),null,16,["class","active"])):(u(),I(w(a.isItemActive(r)?"ChevronDownIcon":"ChevronRightIcon"),c({key:1,class:n.cx("submenuIcon"),ref_for:!0},a.getPTOptions("submenuIcon",r,m)),null,16,["class"]))],64)):p("",!0),t.templates.itemicon?(u(),I(w(t.templates.itemicon),{key:1,item:r.item,class:y(n.cx("itemIcon"))},null,8,["item","class"])):a.getItemProp(r,"icon")?(u(),d("span",c({key:2,class:[n.cx("itemIcon"),a.getItemProp(r,"icon")],ref_for:!0},a.getPTOptions("itemIcon",r,m)),null,16)):p("",!0),v("span",c({class:n.cx("itemLabel"),ref_for:!0},a.getPTOptions("itemLabel",r,m)),H(a.getItemLabel(r)),17)],16,Ie)),[[s]])],16,he),S(W,c({name:"p-toggleable-content",ref_for:!0},n.ptm("transition")),{default:L(function(){return[O(v("div",c({class:n.cx("contentContainer"),ref_for:!0},n.ptm("contentContainer")),[a.isItemVisible(r)&&a.isItemGroup(r)?(u(),I(l,c({key:0,id:a.getItemId(r)+"_list",role:"group",panelId:t.panelId,focusedItemId:t.focusedItemId,items:r.items,level:t.level+1,templates:t.templates,activeItemPath:t.activeItemPath,onItemToggle:a.onItemToggle,onItemMousemove:e[0]||(e[0]=function(h){return n.$emit("item-mousemove",h)}),pt:n.pt,unstyled:n.unstyled,ref_for:!0},n.ptm("submenu")),null,16,["id","panelId","focusedItemId","items","level","templates","activeItemPath","onItemToggle","pt","unstyled"])):p("",!0)],16),[[q,a.isItemActive(r)]])]}),_:2},1040)],16,pe)):p("",!0),a.isItemVisible(r)&&a.getItemProp(r,"separator")?(u(),d("li",c({key:1,style:a.getItemProp(r,"style"),class:[n.cx("separator"),a.getItemProp(r,"class")],role:"separator",ref_for:!0},n.ptm("separator")),null,16)):p("",!0)],64)}),128))],10,fe)}Q.render=ge;function be(n,e){return ke(n)||Pe(n,e)||ye(n,e)||ve()}function ve(){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 ye(n,e){if(n){if(typeof n=="string")return U(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?U(n,e):void 0}}function U(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t<e;t++)i[t]=n[t];return i}function Pe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,o,a,l,s=[],r=!0,m=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(r=(i=a.call(t)).done)&&(s.push(i.value),s.length!==e);r=!0);}catch(h){m=!0,o=h}finally{try{if(!r&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(m)throw o}}return s}}function ke(n){if(Array.isArray(n))return n}var Y={name:"PanelMenuList",hostName:"PanelMenu",extends:M,emits:["item-toggle","header-focus"],props:{panelId:{type:String,default:null},items:{type:Array,default:null},templates:{type:Object,default:null},expandedKeys:{type:Object,default:null}},searchTimeout:null,searchValue:null,data:function(){return{focused:!1,focusedItem:null,activeItemPath:[]}},watch:{expandedKeys:function(e){this.autoUpdateActiveItemPath(e)}},mounted:function(){this.autoUpdateActiveItemPath(this.expandedKeys)},methods:{getItemProp:function(e,t){return e&&e.item?F(e.item[t]):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},isItemVisible:function(e){return this.getItemProp(e,"visible")!==!1},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemActive:function(e){return this.activeItemPath.some(function(t){return t.key===e.parentKey})},isItemGroup:function(e){return g(e.items)},onFocus:function(e){this.focused=!0,this.focusedItem=this.focusedItem||(this.isElementInPanel(e,e.relatedTarget)?this.findFirstItem():this.findLastItem())},onBlur:function(){this.focused=!1,this.focusedItem=null,this.searchValue=""},onKeyDown:function(e){var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":case"Tab":case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&ae(e.key)&&this.searchItems(e,e.key);break}},onArrowDownKey:function(e){var t=g(this.focusedItem)?this.findNextItem(this.focusedItem):this.findFirstItem();this.changeFocusedItem({originalEvent:e,processedItem:t,focusOnNext:!0}),e.preventDefault()},onArrowUpKey:function(e){var t=g(this.focusedItem)?this.findPrevItem(this.focusedItem):this.findLastItem();this.changeFocusedItem({originalEvent:e,processedItem:t,selfCheck:!0}),e.preventDefault()},onArrowLeftKey:function(e){var t=this;if(g(this.focusedItem)){var i=this.activeItemPath.some(function(o){return o.key===t.focusedItem.key});i?this.activeItemPath=this.activeItemPath.filter(function(o){return o.key!==t.focusedItem.key}):this.focusedItem=g(this.focusedItem.parent)?this.focusedItem.parent:this.focusedItem,e.preventDefault()}},onArrowRightKey:function(e){var t=this;if(g(this.focusedItem)){var i=this.isItemGroup(this.focusedItem);if(i){var o=this.activeItemPath.some(function(a){return a.key===t.focusedItem.key});o?this.onArrowDownKey(e):(this.activeItemPath=this.activeItemPath.filter(function(a){return a.parentKey!==t.focusedItem.parentKey}),this.activeItemPath.push(this.focusedItem))}e.preventDefault()}},onHomeKey:function(e){this.changeFocusedItem({originalEvent:e,processedItem:this.findFirstItem(),allowHeaderFocus:!1}),e.preventDefault()},onEndKey:function(e){this.changeFocusedItem({originalEvent:e,processedItem:this.findLastItem(),focusOnNext:!0,allowHeaderFocus:!1}),e.preventDefault()},onEnterKey:function(e){if(g(this.focusedItem)){var t=P(this.$el,'li[id="'.concat("".concat(this.focusedItemId),'"]')),i=t&&(P(t,'[data-pc-section="itemlink"]')||P(t,"a,button"));i?i.click():t&&t.click()}e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onItemToggle:function(e){var t=e.processedItem,i=e.expanded;this.expandedKeys?this.$emit("item-toggle",{item:t.item,expanded:i}):(this.activeItemPath=this.activeItemPath.filter(function(o){return o.parentKey!==t.parentKey}),i&&this.activeItemPath.push(t)),this.focusedItem=t,A(this.$el)},onItemMouseMove:function(e){this.focused&&(this.focusedItem=e.processedItem)},isElementInPanel:function(e,t){var i=e.currentTarget.closest('[data-pc-section="panel"]');return i&&i.contains(t)},isItemMatched:function(e){var t;return this.isValidItem(e)&&((t=this.getItemLabel(e))===null||t===void 0?void 0:t.toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale)))},isVisibleItem:function(e){return!!e&&(e.level===0||this.isItemActive(e))&&this.isItemVisible(e)},isValidItem:function(e){return!!e&&!this.isItemDisabled(e)&&!this.getItemProp(e,"separator")},findFirstItem:function(){var e=this;return this.visibleItems.find(function(t){return e.isValidItem(t)})},findLastItem:function(){var e=this;return V(this.visibleItems,function(t){return e.isValidItem(t)})},findNextItem:function(e){var t=this,i=this.visibleItems.findIndex(function(a){return a.key===e.key}),o=i<this.visibleItems.length-1?this.visibleItems.slice(i+1).find(function(a){return t.isValidItem(a)}):void 0;return o||e},findPrevItem:function(e){var t=this,i=this.visibleItems.findIndex(function(a){return a.key===e.key}),o=i>0?V(this.visibleItems.slice(0,i),function(a){return t.isValidItem(a)}):void 0;return o||e},searchItems:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var o=null,a=!1;if(g(this.focusedItem)){var l=this.visibleItems.findIndex(function(s){return s.key===i.focusedItem.key});o=this.visibleItems.slice(l).find(function(s){return i.isItemMatched(s)}),o=T(o)?this.visibleItems.slice(0,l).find(function(s){return i.isItemMatched(s)}):o}else o=this.visibleItems.find(function(s){return i.isItemMatched(s)});return g(o)&&(a=!0),T(o)&&T(this.focusedItem)&&(o=this.findFirstItem()),g(o)&&this.changeFocusedItem({originalEvent:e,processedItem:o,allowHeaderFocus:!1}),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(function(){i.searchValue="",i.searchTimeout=null},500),a},changeFocusedItem:function(e){var t=e.originalEvent,i=e.processedItem,o=e.focusOnNext,a=e.selfCheck,l=e.allowHeaderFocus,s=l===void 0?!0:l;g(this.focusedItem)&&this.focusedItem.key!==i.key?(this.focusedItem=i,this.scrollInView()):s&&this.$emit("header-focus",{originalEvent:t,focusOnNext:o,selfCheck:a})},scrollInView:function(){var e=P(this.$el,'li[id="'.concat("".concat(this.focusedItemId),'"]'));e&&e.scrollIntoView&&e.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateActiveItemPath:function(e){var t=this;this.activeItemPath=Object.entries(e||{}).reduce(function(i,o){var a=be(o,2),l=a[0],s=a[1];if(s){var r=t.findProcessedItemByItemKey(l);r&&i.push(r)}return i},[])},findProcessedItemByItemKey:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(t=t||i===0&&this.processedItems,!t)return null;for(var o=0;o<t.length;o++){var a=t[o];if(this.getItemProp(a,"key")===e)return a;var l=this.findProcessedItemByItemKey(e,a.items,i+1);if(l)return l}},createProcessedItems:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",l=[];return e&&e.forEach(function(s,r){var m=(a!==""?a+"_":"")+r,h={item:s,index:r,level:i,key:m,parent:o,parentKey:a};h.items=t.createProcessedItems(s.items,i+1,h,m),l.push(h)}),l},flatItems:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e&&e.forEach(function(o){t.isVisibleItem(o)&&(i.push(o),t.flatItems(o.items,i))}),i}},computed:{processedItems:function(){return this.createProcessedItems(this.items||[])},visibleItems:function(){return this.flatItems(this.processedItems)},focusedItemId:function(){return g(this.focusedItem)?"".concat(this.panelId,"_").concat(this.focusedItem.key):null}},components:{PanelMenuSub:Q}};function we(n,e,t,i,o,a){var l=E("PanelMenuSub");return u(),I(l,c({id:t.panelId+"_list",class:n.cx("rootList"),role:"tree",tabindex:-1,"aria-activedescendant":o.focused?a.focusedItemId:void 0,panelId:t.panelId,focusedItemId:o.focused?a.focusedItemId:void 0,items:a.processedItems,templates:t.templates,activeItemPath:o.activeItemPath,onFocus:a.onFocus,onBlur:a.onBlur,onKeydown:a.onKeyDown,onItemToggle:a.onItemToggle,onItemMousemove:a.onItemMouseMove,pt:n.pt,unstyled:n.unstyled},n.ptm("rootList")),null,16,["id","class","aria-activedescendant","panelId","focusedItemId","items","templates","activeItemPath","onFocus","onBlur","onKeydown","onItemToggle","onItemMousemove","pt","unstyled"])}Y.render=we;function C(n){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(n)}function G(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),t.push.apply(t,i)}return t}function Ke(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?G(Object(t),!0).forEach(function(i){xe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):G(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function xe(n,e,t){return(e=Ae(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ae(n){var e=He(n,"string");return C(e)=="symbol"?e:e+""}function He(n,e){if(C(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(C(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Z={name:"PanelMenu",extends:me,inheritAttrs:!1,emits:["update:expandedKeys","panel-open","panel-close"],data:function(){return{id:this.$attrs.id,activeItem:null,activeItems:[]}},watch:{"$attrs.id":function(e){this.id=e||N()}},mounted:function(){this.id=this.id||N()},methods:{getItemProp:function(e,t){return e?F(e[t]):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,t,i){return this.ptm(e,{context:{index:i,active:this.isItemActive(t),focused:this.isItemFocused(t),disabled:this.isItemDisabled(t)}})},isItemActive:function(e){return this.expandedKeys?this.expandedKeys[this.getItemProp(e,"key")]:this.multiple?this.activeItems.some(function(t){return x(e,t)}):x(e,this.activeItem)},isItemVisible:function(e){return this.getItemProp(e,"visible")!==!1},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return x(e,this.activeItem)},isItemGroup:function(e){return g(e.items)},getPanelId:function(e){return"".concat(this.id,"_").concat(e)},getPanelKey:function(e){return this.getPanelId(e)},getHeaderId:function(e){return"".concat(this.getPanelId(e),"_header")},getContentId:function(e){return"".concat(this.getPanelId(e),"_content")},onHeaderClick:function(e,t){if(this.isItemDisabled(t)){e.preventDefault();return}t.command&&t.command({originalEvent:e,item:t}),this.changeActiveItem(e,t),A(e.currentTarget)},onHeaderKeyDown:function(e,t){switch(e.code){case"ArrowDown":this.onHeaderArrowDownKey(e);break;case"ArrowUp":this.onHeaderArrowUpKey(e);break;case"Home":this.onHeaderHomeKey(e);break;case"End":this.onHeaderEndKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onHeaderEnterKey(e,t);break}},onHeaderArrowDownKey:function(e){var t=D(e.currentTarget,"data-p-active")===!0?P(e.currentTarget.nextElementSibling,'[data-pc-section="rootlist"]'):null;t?A(t):this.updateFocusedHeader({originalEvent:e,focusOnNext:!0}),e.preventDefault()},onHeaderArrowUpKey:function(e){var t=this.findPrevHeader(e.currentTarget.parentElement)||this.findLastHeader(),i=D(t,"data-p-active")===!0?P(t.nextElementSibling,'[data-pc-section="rootlist"]'):null;i?A(i):this.updateFocusedHeader({originalEvent:e,focusOnNext:!1}),e.preventDefault()},onHeaderHomeKey:function(e){this.changeFocusedHeader(e,this.findFirstHeader()),e.preventDefault()},onHeaderEndKey:function(e){this.changeFocusedHeader(e,this.findLastHeader()),e.preventDefault()},onHeaderEnterKey:function(e,t){var i=P(e.currentTarget,'[data-pc-section="headerlink"]');i?i.click():this.onHeaderClick(e,t),e.preventDefault()},findNextHeader:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t?e:e.nextElementSibling,o=P(i,'[data-pc-section="header"]');return o?D(o,"data-p-disabled")?this.findNextHeader(o.parentElement):o:null},findPrevHeader:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t?e:e.previousElementSibling,o=P(i,'[data-pc-section="header"]');return o?D(o,"data-p-disabled")?this.findPrevHeader(o.parentElement):o:null},findFirstHeader:function(){return this.findNextHeader(this.$el.firstElementChild,!0)},findLastHeader:function(){return this.findPrevHeader(this.$el.lastElementChild,!0)},updateFocusedHeader:function(e){var t=e.originalEvent,i=e.focusOnNext,o=e.selfCheck,a=t.currentTarget.closest('[data-pc-section="panel"]'),l=o?P(a,'[data-pc-section="header"]'):i?this.findNextHeader(a):this.findPrevHeader(a);l?this.changeFocusedHeader(t,l):i?this.onHeaderHomeKey(t):this.onHeaderEndKey(t)},changeActiveItem:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isItemDisabled(t)){var o=this.isItemActive(t),a=o?"panel-close":"panel-open";this.activeItem=i?t:this.activeItem&&x(t,this.activeItem)?null:t,this.multiple&&(this.activeItems.some(function(l){return x(t,l)})?this.activeItems=this.activeItems.filter(function(l){return!x(t,l)}):this.activeItems.push(t)),this.changeExpandedKeys({item:t,expanded:!o}),this.$emit(a,{originalEvent:e,item:t})}},changeExpandedKeys:function(e){var t=e.item,i=e.expanded,o=i===void 0?!1:i;if(this.expandedKeys){var a=Ke({},this.expandedKeys);o?a[t.key]=!0:delete a[t.key],this.$emit("update:expandedKeys",a)}},changeFocusedHeader:function(e,t){t&&A(t)},getMenuItemProps:function(e,t){return{icon:c({class:[this.cx("headerIcon"),this.getItemProp(e,"icon")]},this.getPTOptions("headerIcon",e,t)),label:c({class:this.cx("headerLabel")},this.getPTOptions("headerLabel",e,t))}}},components:{PanelMenuList:Y,ChevronRightIcon:J,ChevronDownIcon:X}},Le=["id"],Ee=["id","tabindex","aria-label","aria-expanded","aria-controls","aria-disabled","onClick","onKeydown","data-p-active","data-p-disabled"],Oe=["href"],Ce=["id","aria-labelledby"];function _e(n,e,t,i,o,a){var l=E("PanelMenuList");return u(),d("div",c({id:o.id,class:n.cx("root")},n.ptmi("root")),[(u(!0),d(K,null,z(n.model,function(s,r){return u(),d(K,{key:a.getPanelKey(r)},[a.isItemVisible(s)?(u(),d("div",c({key:0,style:a.getItemProp(s,"style"),class:[n.cx("panel"),a.getItemProp(s,"class")],ref_for:!0},n.ptm("panel")),[v("div",c({id:a.getHeaderId(r),class:[n.cx("header",{item:s}),a.getItemProp(s,"headerClass")],tabindex:a.isItemDisabled(s)?-1:n.tabindex,role:"button","aria-label":a.getItemLabel(s),"aria-expanded":a.isItemActive(s),"aria-controls":a.getContentId(r),"aria-disabled":a.isItemDisabled(s),onClick:function(h){return a.onHeaderClick(h,s)},onKeydown:function(h){return a.onHeaderKeyDown(h,s)},ref_for:!0},a.getPTOptions("header",s,r),{"data-p-active":a.isItemActive(s),"data-p-disabled":a.isItemDisabled(s)}),[v("div",c({class:n.cx("headerContent"),ref_for:!0},a.getPTOptions("headerContent",s,r)),[n.$slots.item?(u(),I(w(n.$slots.item),{key:1,item:s,root:!0,active:a.isItemActive(s),hasSubmenu:a.isItemGroup(s),label:a.getItemLabel(s),props:a.getMenuItemProps(s,r)},null,8,["item","active","hasSubmenu","label","props"])):(u(),d("a",c({key:0,href:a.getItemProp(s,"url"),class:n.cx("headerLink"),tabindex:-1,ref_for:!0},a.getPTOptions("headerLink",s,r)),[a.getItemProp(s,"items")?ie(n.$slots,"submenuicon",{key:0,active:a.isItemActive(s)},function(){return[(u(),I(w(a.isItemActive(s)?"ChevronDownIcon":"ChevronRightIcon"),c({class:n.cx("submenuIcon"),ref_for:!0},a.getPTOptions("submenuIcon",s,r)),null,16,["class"]))]}):p("",!0),n.$slots.headericon?(u(),I(w(n.$slots.headericon),{key:1,item:s,class:y([n.cx("headerIcon"),a.getItemProp(s,"icon")])},null,8,["item","class"])):a.getItemProp(s,"icon")?(u(),d("span",c({key:2,class:[n.cx("headerIcon"),a.getItemProp(s,"icon")],ref_for:!0},a.getPTOptions("headerIcon",s,r)),null,16)):p("",!0),v("span",c({class:n.cx("headerLabel"),ref_for:!0},a.getPTOptions("headerLabel",s,r)),H(a.getItemLabel(s)),17)],16,Oe))],16)],16,Ee),S(W,c({name:"p-toggleable-content",ref_for:!0},n.ptm("transition")),{default:L(function(){return[O(v("div",c({id:a.getContentId(r),class:n.cx("contentContainer"),role:"region","aria-labelledby":a.getHeaderId(r),ref_for:!0},n.ptm("contentContainer")),[a.getItemProp(s,"items")?(u(),d("div",c({key:0,class:n.cx("content"),ref_for:!0},n.ptm("content")),[S(l,{panelId:a.getPanelId(r),items:a.getItemProp(s,"items"),templates:n.$slots,expandedKeys:n.expandedKeys,onItemToggle:a.changeExpandedKeys,onHeaderFocus:a.updateFocusedHeader,pt:n.pt,unstyled:n.unstyled},null,8,["panelId","items","templates","expandedKeys","onItemToggle","onHeaderFocus","pt","unstyled"])],16)):p("",!0)],16,Ce),[[q,a.isItemActive(s)]])]}),_:2},1040)],16)):p("",!0)],64)}),128))],16,Le)}Z.render=_e;const De=["onClick"],Te={class:"text-surface-700 font-medium group-hover:text-emerald-500"},Se=["href","onClick"],Me={class:"flex justify-center w-10"},Fe={class:"flex justify-start"},Ve={class:"ml-4 w-44 group-hover:text-emerald-500"},je={key:0,class:"flex justify-center w-10"},Ne={key:1,class:"flex justify-start"},qe=re({__name:"AppSidebar",setup(n){const e=le(),t={label:"Início",faIcon:["fas","home"],command:()=>{e.setModulo(),j("/")}},i=oe(()=>e.modulo?e.modulo.items||[]:B.map(a=>({...a,command:()=>{console.log("command",a),e.setModulo(a.name)},items:void 0})));function o(a){var r;const l=B.find(m=>m.sigla===a.sigla&&m.items&&m.items.length>0);if(!l)return;const s=(r=l.items)==null?void 0:r.find(m=>m.label==="Dashboard");s&&j(s.to)}return se(()=>e.pinned,a=>{e.toggleOpen(a)}),(a,l)=>{const s=E("fa-icon"),r=Z,m=E("router-link"),h=R;return u(),d("div",{class:"h-full max-w-sm bg-white-700 overflow-y-auto list-none p-4 shadow-md rounded-md transition-all duration-100",onMouseenter:l[2]||(l[2]=()=>b(e).toggleOpen(!0)),onMouseleave:l[3]||(l[3]=()=>b(e).toggleOpen(!1))},[b(e).modulo===void 0?(u(),I(r,{key:0,model:b(i),unstyled:""},{item:L(({item:f})=>[v("div",{class:"group border-b rounded py-4 px-2 flex flex-col items-center justify-center gap-2",onClick:k=>o({sigla:f.sigla})},[f.icon?(u(),d("i",{key:0,class:y([f.icon,"text-5xl","text-surface-700","group-hover:text-emerald-500"])},null,2)):f.faIcon?(u(),I(s,{key:1,icon:f.faIcon,class:"text-3xl text-surface-700 group-hover:text-emerald-500"},null,8,["icon"])):p("",!0),v("p",Te,H(f.label),1)],8,De)]),_:1},8,["model"])):(u(),I(r,{key:1,model:[t,...b(i)],unstyled:""},{item:L(({item:f,root:k,active:_})=>[f.to?(u(),I(m,{key:0,to:f.to,custom:""},{default:L(({href:$,navigate:ee})=>[O((u(),d("a",{class:y(["group flex items-center py-3 px-2 mb-2 cursor-pointer text-surface-700 border-b",{"mb-2":!k,"pl-6":!k,"border-none":!k&&!b(e).open}]),href:$,onClick:ee,onMouseenter:l[0]||(l[0]=()=>b(e).toggleOpen(!0))},[v("div",Me,[b(e).open||k?(u(),d(K,{key:0},[f.icon?(u(),d("i",{key:0,class:y([f.icon,"text-3xl","group-hover:text-emerald-500"])},null,2)):f.faIcon?(u(),I(s,{key:1,icon:f.faIcon,class:"text-3xl group-hover:text-emerald-500"},null,8,["icon"])):p("",!0)],64)):p("",!0)]),v("div",Fe,[b(e).open?(u(),d(K,{key:0},[v("p",Ve,H(f.label),1),f.items?(u(),d("span",{key:0,class:y(["pi text-surface-700 hovgroup-hover:text-emerald-500 ml-auto",[_?"pi-angle-up":"pi-angle-down"]])},null,2)):p("",!0)],64)):p("",!0)])],42,Se)),[[h]])]),_:2},1032,["to"])):O((u(),d("a",{key:1,class:y(["group flex items-center py-3 px-2 mb-2 cursor-pointer text-surface-700 group-hover:text-emerald-500 border-b",{"mb-2":!k,"pl-6":!k,"border-none":_&&b(e).open}]),onMouseenter:l[1]||(l[1]=()=>b(e).toggleOpen(!0))},[b(e).open||k?(u(),d("div",je,[f.icon?(u(),d("i",{key:0,class:y([f.icon,"text-3xl","group-hover:text-emerald-500"])},null,2)):f.faIcon?(u(),I(s,{key:1,icon:f.faIcon,class:"text-3xl group-hover:text-emerald-500"},null,8,["icon"])):p("",!0)])):p("",!0),b(e).open?(u(),d("div",Ne,[v("p",{class:y(["ml-4 w-44 text-surface-700 group-hover:text-emerald-500",[_?"text-emerald-500":""]])},H(f.label),3),f.items?(u(),d("span",{key:0,class:y(["pi group-hover:text-emerald-500",[_?"pi-angle-up":"pi-angle-down"]])},null,2)):p("",!0)])):p("",!0)],34)),[[h]])]),_:1},8,["model"]))],32)}}});export{qe as _};
