(function () { 'use strict'; if (window.__DBC_SITE_V280__) return; window.__DBC_SITE_V280__ = true; const body = document.body; const html = document.documentElement; const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; function markRelease() { const release = body.dataset.dbcRelease || html.dataset.dbcRelease || 'v3.0.0'; html.dataset.dbcRelease = release; body.dataset.dbcRelease = release; body.classList.add('v280-enhanced'); const footer = document.querySelector('footer.site-footer'); if (footer) footer.dataset.dbcRelease = release; } function markHero() { if (body.dataset.v280Archetype === 'home') return; const hero = document.querySelector('main > :is(section, article):first-child'); if (!hero) return; hero.dataset.v280Hero = ''; } function addMeasuredReveal() { if (body.dataset.v280Archetype === 'home') return; const candidates = Array.from(document.querySelectorAll([ 'main > section:not(:first-child) > :is(.section-head, .home-section-title, .formal-shell > .formal-section-head, .news-list-heading)', 'main > section:not(:first-child) > :is(.v245-shell, .formal-shell) > :is(.v245-section-head, .formal-section-head)', 'main > section:not(:first-child) > :is(.about-hero-copy, .request-intro)' ].join(','))).slice(0, 18); if (!candidates.length) return; candidates.forEach(function (element) { element.dataset.v280Reveal = ''; }); if (reducedMotion || !('IntersectionObserver' in window)) { candidates.forEach(function (element) { element.classList.add('is-v280-visible'); }); return; } html.classList.add('v280-motion-ready'); const observer = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (!entry.isIntersecting) return; entry.target.classList.add('is-v280-visible'); observer.unobserve(entry.target); }); }, { threshold: .12, rootMargin: '0px 0px -8% 0px' }); candidates.forEach(function (element) { if (element.getBoundingClientRect().top < window.innerHeight * .94) { element.classList.add('is-v280-visible'); } else { observer.observe(element); } }); } function enhanceSectionNavigation() { const navs = Array.from(document.querySelectorAll('main + nav, main nav, .about-anchor-nav, .formal-page-nav')); const links = navs.flatMap(function (nav) { return Array.from(nav.querySelectorAll('a[href^="#"]')); }); if (!links.length || !('IntersectionObserver' in window)) return; const map = new Map(); links.forEach(function (link) { const id = decodeURIComponent(link.getAttribute('href').slice(1)); const section = id ? document.getElementById(id) : null; if (section) map.set(section, link); }); if (!map.size) return; const observer = new IntersectionObserver(function (entries) { const visible = entries .filter(function (entry) { return entry.isIntersecting; }) .sort(function (a, b) { return b.intersectionRatio - a.intersectionRatio; }); if (!visible.length) return; links.forEach(function (link) { link.removeAttribute('data-v280-current'); }); const current = map.get(visible[0].target); if (current) current.setAttribute('data-v280-current', 'true'); }, { rootMargin: '-22% 0px -66% 0px', threshold: [0, .1, .3] }); map.forEach(function (_, section) { observer.observe(section); }); } markRelease(); markHero(); addMeasuredReveal(); enhanceSectionNavigation(); })();