import{j as i}from"./Button.C3z0Huhq.js";import{r as d}from"./index.eCxJ45ll.js";import{k as m,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.XwRDakxy.js";/* empty css                        */import"./angle-left-icon.DWYsUcD9.js";import"./divider.D8VbB8X-.js";import"./index.BQFV5hT1.js";import"./resizeObserver.CS2gTYPb.js";import"./page.CJ6FIbXe.js";import"./PageContext.BHEbb8iu.js";const l=t=>t.replace("PatternFly","Patternfly"),c=t=>m(l(t)),j=t=>p(l(t)).replace("Patternfly","PatternFly"),N=({entry:t,isActive:n})=>{const{id:e}=t,{id:r,section:s}=t.data,a=c(r),o=c(s);return i.jsx(v,{itemId:e,to:`/${o}/${a}`,isActive:n,id:`nav-entry-${e}`,"data-astro-reload":!0,children:r})},h=({entries:t,sectionId:n,activeItem:e})=>{const r=window.location.pathname.includes(c(n)),s=t.some(o=>o.id===e),a=t.map(o=>i.jsx(N,{entry:o,isActive:e===o.id||window.location.pathname.includes(c(o.data.id))},o.id));return i.jsx(x,{title:j(n),isActive:s,isExpanded:r,id:`nav-section-${n}`,children:a})},F=({navData:t})=>{const[n,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",style:{overflowY:"auto"},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:n},a)})})})})};export{F as Navigation};
