import{_ as c,p as o,h as d,e as t}from"./chunks/jsxRuntime.module.0d40c03f.js";import{p as a}from"./chunks/preact.module.8a47de0f.js";const m=({headings:n=[]})=>{const s=c([]),[i,h]=o(void 0);return d(()=>{const e=()=>{const l=document.querySelectorAll("article :is(h1, h2, h3, h4)");s.current=Array.from(l).map(r=>({id:r.id,topOffset:r.getBoundingClientRect().top+window.scrollY}))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),t(a,{children:[t("h2",{class:"heading",children:"On this page"}),t("ul",{children:[t("li",{class:`heading-link depth-2 ${i==="overview"?"active":""}`.trim(),children:t("a",{href:"#overview",children:"Overview"})}),n.filter(({depth:e})=>e>1&&e<4).map(e=>t("li",{class:`heading-link depth-${e.depth} ${i===e.slug?"active":""}`.trim(),children:t("a",{href:`#${e.slug}`,children:e.text})}))]})]})};export{m as default};
