import{_ as h,o as n,c,a as _,b as d,t as g,F as p,r as v,i as x,v as m,f as y,d as b,n as C}from"./entry.DPwc-EV0.js";const k={name:"WebExpandableTreeBranch",props:{item:{type:Object},activePath:{type:String}},data(){return{expanded:this.item.active}},methods:{toggle(){const a=this.expanded;this.expanded=!a}}},B={class:m(["ebm-tree-branch__heading"])},D={key:2,class:"ebm-tree-branch__heading__icon"},I=["href"],P={key:0,class:"ebm-tree-branch__children"};function S(a,r,e,i,t,s){const l=y,o=f;return n(),c("div",{class:m(["ebm-tree-branch",t.expanded?"expanded":"",e.item.active?"active":""])},[_("div",B,[!t.expanded&&e.item.children&&e.item.children.length?(n(),d(l,{key:0,icon:"mdi:plus-circle-outline",class:"ebm-tree-branch__heading__icon",onClick:s.toggle},null,8,["onClick"])):t.expanded&&e.item.children&&e.item.children.length?(n(),d(l,{key:1,icon:"mdi:minus-circle-outline",class:"ebm-tree-branch__heading__icon",onClick:s.toggle},null,8,["onClick"])):(n(),c("span",D)),_("a",{href:"/"+e.item.alias},g(e.item.name),9,I)]),e.item.children&&e.item.children.length&&t.expanded?(n(),c("div",P,[(n(!0),c(p,null,v(e.item.children,u=>(n(),d(o,{key:u.alias,item:u,"active-path":e.activePath},null,8,["item","active-path"]))),128))])):x("",!0)],2)}const f=h(k,[["render",S],["__scopeId","data-v-85dd8758"]]),E={props:{items:{type:Array},activePath:{type:String}},data(){return{localData:[...this.setActive(this.items).items]}},computed:{numColumns(){return 3}},methods:{setActive(a){let r=!1;return{items:a.map(i=>{const t={...i};if(this.activePath==="/"+(i==null?void 0:i.alias)&&(t.active=!0,r=!0),t.children){const s=this.setActive(t.children);s.activeChild&&(t.active=!0,r=!0),t.children=s.items}return t}),activeChild:r}},columnContents(a){return this.localData.slice(a*(this.localData.length/this.numColumns),this.localData.length/this.numColumns+a*(this.localData.length/this.numColumns))}}},A={class:"ebm-tree"},F={class:"branches"};function T(a,r,e,i,t,s){const l=f;return n(),c("div",A,[_("div",F,[(n(!0),c(p,null,v(t.localData,o=>(n(),c("div",{key:o.name,class:m(["ebm-tree__parent",o.expanded?"ebm-tree__parent--expanded":""])},[b(l,{item:o,"active-path":e.activePath},null,8,["item","active-path"])],2))),128))])])}const W=h(E,[["render",T],["__scopeId","data-v-4dfbcab6"]]),w={props:{sections:{type:Array,required:!0},currentSection:{type:Number},activePath:{type:String}}};function N(a,r,e,i,t,s){const l=W;return n(),c("div",{class:"ebm-section-tree",style:C({fontFamily:a.$ss.primaryFontFamily})},[b(l,{items:e.sections,"active-path":e.activePath},null,8,["items","active-path"])],4)}const z=h(w,[["render",N],["__scopeId","data-v-52725c89"]]);export{z as default};