import{j as i}from"./Button.BVfR1y85.js";import{r as d}from"./index.eCxJ45ll.js";import{k as l,s as p}from"./index.CAChmxYj.js";import{c as v,b as x,e as b,N as f,d as u}from"./PageSidebarBody.CDWZuFeK.js";/* empty css                        */import"./angle-left-icon.CfKwuSCS.js";import"./divider.BLVh3KnH.js";import"./index.BQFV5hT1.js";import"./page.BTC3Kf3x.js";import"./PageContext.BUbWpNW2.js";const m=t=>t.replace("PatternFly","Patternfly"),c=t=>l(m(t)),j=t=>p(m(t)).replace("Patternfly","PatternFly"),N=({entry:t,isActive:o})=>{const{id:e}=t,{id:r,section:s}=t.data,a=c(r),n=c(s);return i.jsx(v,{itemId:e,to:`/${n}/${a}`,isActive:o,id:`nav-entry-${e}`,"data-astro-reload":!0,children:r})},h=({entries:t,sectionId:o,activeItem:e})=>{const r=window.location.pathname.includes(c(o)),s=t.some(n=>n.id===e),a=t.map(n=>i.jsx(N,{entry:n,isActive:e===n.id||window.location.pathname.includes(c(n.data.id))},n.id));return i.jsx(x,{title:j(o),isActive:s,isExpanded:r,id:`nav-section-${o}`,children:a})},A=({navData:t})=>{const[o,e]=d.useState("");d.useEffect(()=>{e(window.location.pathname.split("/").reverse()[0])},[]);const r=(s,a)=>{e(a.itemId.toString())};return i.jsx(b,{id:"page-sidebar-body",children:i.jsx(f,{onSelect:r,children:i.jsx(u,{children:t.map(s=>{const{section:a}=s[0].data;return i.jsx(h,{entries:s,sectionId:a,activeItem:o},a)})})})})};export{A as Navigation};
