!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";!function(){const e=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(t.target.classList.add("in"),e.unobserve(t.target))}))}),{threshold:.15,rootMargin:"0px 0px -10% 0px"});document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".reveal").forEach((t=>e.observe(t))),function(){const e=document.querySelector(".progress");if(!e)return;const t=()=>{const t=document.documentElement,n=t.scrollTop,o=t.scrollHeight-t.clientHeight;e.style.width=o>0?n/o*100+"%":"0%"};window.addEventListener("scroll",t,{passive:!0}),t()}(),function(){const e=document.querySelectorAll("[data-parallax]");if(!e.length)return;const t=()=>{e.forEach((e=>{const t=parseFloat(e.dataset.parallax)||.4,n=e.closest(".pinned-text-section");if(n){const t=n.getBoundingClientRect(),o=n.offsetHeight-window.innerHeight;if(o<=0)return;const s=Math.max(0,Math.min(1,-t.top/o));e.style.backgroundPosition=`center ${(100*s).toFixed(2)}%`}else{const n=e.getBoundingClientRect();e.style.transform=`translate3d(0, ${-n.top*t}px, 0)`}}))};window.addEventListener("scroll",t,{passive:!0}),t()}(),function(){const e=document.querySelector("[data-typewriter]");if(!e)return;const t=e.textContent.trim();e.innerHTML='<span class="typed"></span><span class="typed-cursor">&nbsp;</span>';const n=e.querySelector(".typed");let o=0;const s=()=>{o<=t.length?(n.textContent=t.slice(0,o),o++,setTimeout(s,55)):setTimeout((()=>{const t=e.querySelector(".typed-cursor");t&&(t.style.opacity="0")}),1500)};setTimeout(s,600)}(),function(){const e=document.querySelector(".menu-btn"),t=document.querySelector(".menu-overlay"),n=document.querySelector(".menu-close");if(!e||!t)return;const o=()=>{t.classList.remove("open"),document.body.style.overflow=""};e.addEventListener("click",(()=>{t.classList.add("open"),document.body.style.overflow="hidden"})),n&&n.addEventListener("click",o),document.addEventListener("keydown",(e=>{"Escape"===e.key&&o()})),t.addEventListener("click",(e=>{e.target===t&&o()}))}(),function(){const e=document.querySelector(".menu-filter"),t=document.querySelector(".menu-list");if(!e||!t)return;let n=t.querySelector(".menu-empty");n||(n=document.createElement("div"),n.className="menu-empty",n.textContent="No chapters match.",t.appendChild(n)),e.addEventListener("input",(()=>{const n=e.value.trim().toLowerCase();let o=!1;t.querySelectorAll(".menu-chapters li").forEach((e=>{const t=e.textContent.toLowerCase(),s=!n||t.includes(n);e.classList.toggle("hidden",!s),s&&(o=!0)})),t.querySelectorAll(".menu-part").forEach((e=>{const t=e.querySelectorAll(".menu-chapters li:not(.hidden)").length;e.style.display=t?"":"none"})),t.classList.toggle("is-empty",!o)}))}()}))}()}));
//# sourceMappingURL=shared.js.map