functionsetActiveToc(e){returne.reverse(),[...e].find(e=>e.getBoundingRect().y<0)}functionfindCorrespondingTocTitle(t){return[...document.querySelectorAll("#toc li a")].find(e=>e.href.substring(e.href.indexOf("#"))==="#"+t.id)}functionsetActive(e,t){null!==t&&(findCorrespondingTocTitle(t.target),t.parentElement.classList.remove("bg-blue-800"));letn=findCorrespondingTocTitle(e.target);n.parentElement.classList.add("bg-blue-800")}functionsetNextActive(e){lett=findCorrespondingTocTitle(e.target);console.log(t),t.parentElement.classList.remove("bg-blue-800"),t.parentElement.nextElementSibling.classList.add("bg-blue-800")}functionsetPreviousActive(e){lett=findCorrespondingTocTitle(e.target);t.parentElement.classList.remove("bg-blue-800"),t.parentElement.previousElementSibling.classList.add("bg-blue-800")}document.addEventListener("DOMContentLoaded",function(){document.getElementById("navbar").clientHeight,document.getElementById("toc");conste=document.querySelectorAll("#toc li a");document.getElementById("page-content");lett=!1,n=[];[...e].forEach(e=>{n.push(e.href.substring(e.href.indexOf("#")))});consto=document.querySelectorAll(n.join(","));console.log(o),window.addEventListener("scroll",()=>{!1===t?(e[0].classList.add("bg-blue-800"),t=e[0]):console.log(setActive(o))})});