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ripts/modules/headerScrollObserver.js","scripts/modules/headerHeightVariables.js"],"sourcesContent":["(function () {\n/**\n * Main JS file for Paragon Underscores theme.\n *\n * Will be compiled into dist/scripts/main.js.\n * Loads on every page.\n */ // sectionNavigation.js\nfunction $00e567500e8208cf$export$cc7b51a8fbad279b() {\n const navItems = document.querySelectorAll('.pdm-section-navigation > li.menu-item-has-children');\n $00e567500e8208cf$var$addDisclosureButtons(navItems);\n $00e567500e8208cf$var$addEventListeners(navItems);\n}\nfunction $00e567500e8208cf$var$addDisclosureButtons(navItems) {\n navItems.forEach((item)=>{\n const button = document.createElement('button');\n button.setAttribute('aria-expanded', 'false');\n button.classList.add('sub-menu-toggle');\n button.innerHTML = 'Show submenu';\n item.insertBefore(button, item.querySelector('a').nextSibling);\n });\n}\nfunction $00e567500e8208cf$var$addEventListeners(navItems) {\n navItems.forEach((item)=>{\n const button = item.querySelector('.sub-menu-toggle');\n button.addEventListener('click', (event)=>{\n event.preventDefault();\n $00e567500e8208cf$var$toggleSubMenu(item, navItems);\n });\n });\n}\nfunction $00e567500e8208cf$var$toggleSubMenu(item, navItems) {\n const isExpanded = item.querySelector('.sub-menu-toggle').getAttribute('aria-expanded') === 'true';\n $00e567500e8208cf$var$closeAllSubMenus(navItems);\n if (!isExpanded) {\n item.classList.add('toggled');\n item.querySelector('.sub-menu-toggle').setAttribute('aria-expanded', 'true');\n }\n}\nfunction $00e567500e8208cf$var$closeAllSubMenus(navItems) {\n navItems.forEach((item)=>{\n item.querySelector('.sub-menu-toggle').setAttribute('aria-expanded', 'false');\n item.classList.remove('toggled');\n });\n}\n\n\nfunction $ab75d1d34b5ac5cc$export$dfc4fbbb8e36019b() {\n const stickySidebar = document.querySelector('.table-of-contents');\n if (!stickySidebar) return;\n const observer = new IntersectionObserver(([entry])=>entry.target.classList.toggle('not-sticky', entry.intersectionRatio < 1), {\n threshold: [\n 1\n ]\n });\n observer.observe(stickySidebar);\n}\n\n\n/**\n * Listen for scroll events and add a class to the header when the user scrolls down\n */ function $3c040451fea6b948$var$headerScrollObserver() {\n const siteHeader = document.querySelector('#masthead');\n if (!siteHeader) return;\n window.addEventListener('scroll', function() {\n if (window.scrollY > 10) siteHeader.classList.add('scrolled');\n else if (window.scrollY < 1) siteHeader.classList.remove('scrolled');\n });\n}\n/**\n * Toggle the visibility of the scroll-to-top button by adding a show class.\n *\n * The scroll-to-top element is in footer.php.\n *\n * @return {void}\n */ function $3c040451fea6b948$var$toggleScrollToTop() {\n const scrollToTop = document.querySelector('#scroll-to-top');\n if (!scrollToTop) return;\n const viewportHeight = window.innerHeight;\n if (window.scrollY > viewportHeight) scrollToTop.classList.add('show');\n else scrollToTop.classList.remove('show');\n}\nfunction $3c040451fea6b948$export$3693c8007a977b44() {\n $3c040451fea6b948$var$headerScrollObserver();\n $3c040451fea6b948$var$toggleScrollToTop();\n window.addEventListener('scroll', function() {\n $3c040451fea6b948$var$headerScrollObserver();\n $3c040451fea6b948$var$toggleScrollToTop();\n });\n}\n\n\nfunction $bfd8b0bc6b016bad$export$b1d33e6ebba1c132() {\n const header = document.querySelector('#masthead');\n if (!header) return;\n const headerHeight = header.offsetHeight;\n document.body.style.setProperty('--header-height', headerHeight + 'px');\n const resizeHeaderObserver = new ResizeObserver((entries)=>{\n for (const entry of entries)if (entry.target === header) document.body.style.setProperty('--header-height', entry.contentRect.height + 'px');\n });\n resizeHeaderObserver.observe(header);\n}\nfunction $bfd8b0bc6b016bad$export$582c0681e2ebf54d() {\n const subnav = document.querySelector('.pdm-section-navigation-wrapper');\n if (!subnav) return;\n const subnavHeight = subnav.offsetHeight;\n document.body.style.setProperty('--subnav-height', subnavHeight + 'px');\n const resizeSubnavObserver = new ResizeObserver((entries)=>{\n for (const entry of entries)if (entry.target === subnav) document.body.style.setProperty('--subnav-height', entry.contentRect.height + 'px');\n });\n resizeSubnavObserver.observe(subnav);\n}\n\n\n// Run all functions on page load.\ndocument.addEventListener('DOMContentLoaded', function() {\n (0, $00e567500e8208cf$export$cc7b51a8fbad279b)();\n (0, $3c040451fea6b948$export$3693c8007a977b44)();\n (0, $bfd8b0bc6b016bad$export$b1d33e6ebba1c132)();\n (0, $bfd8b0bc6b016bad$export$582c0681e2ebf54d)();\n (0, $ab75d1d34b5ac5cc$export$dfc4fbbb8e36019b)();\n});\n\n})();\n//# sourceMappingURL=main.js.map\n","/**\n * Main JS file for Paragon Underscores theme.\n *\n * Will be compiled into dist/scripts/main.js.\n * Loads on every page.\n */\n\nimport { initSectionNavigation } from './modules/sectionNavigation';\nimport { findStickySidebar } from './modules/stickySidebar';\nimport { scrollObserver } from './modules/headerScrollObserver';\nimport {\n\tsetHeaderHeightProperty,\n\tsetSubnavHeightProperty,\n} from './modules/headerHeightVariables';\n\n// Run all functions on page load.\ndocument.addEventListener('DOMContentLoaded', function () {\n\tinitSectionNavigation();\n\tscrollObserver();\n\tsetHeaderHeightProperty();\n\tsetSubnavHeightProperty();\n\tfindStickySidebar();\n});\n","// sectionNavigation.js\n\nfunction initSectionNavigation() {\n\tconst navItems = document.querySelectorAll(\n\t\t'.pdm-section-navigation > li.menu-item-has-children'\n\t);\n\taddDisclosureButtons(navItems);\n\taddEventListeners(navItems);\n}\n\nfunction addDisclosureButtons(navItems) {\n\tnavItems.forEach((item) => {\n\t\tconst button = document.createElement('button');\n\t\tbutton.setAttribute('aria-expanded', 'false');\n\t\tbutton.classList.add('sub-menu-toggle');\n\t\tbutton.innerHTML =\n\t\t\t'Show submenu';\n\t\titem.insertBefore(button, item.querySelector('a').nextSibling);\n\t});\n}\n\nfunction addEventListeners(navItems) {\n\tnavItems.forEach((item) => {\n\t\tconst button = item.querySelector('.sub-menu-toggle');\n\t\tbutton.addEventListener('click', (event) => {\n\t\t\tevent.preventDefault();\n\t\t\ttoggleSubMenu(item, navItems);\n\t\t});\n\t});\n}\n\nfunction toggleSubMenu(item, navItems) {\n\tconst isExpanded =\n\t\titem.querySelector('.sub-menu-toggle').getAttribute('aria-expanded') ===\n\t\t'true';\n\tcloseAllSubMenus(navItems);\n\tif (!isExpanded) {\n\t\titem.classList.add('toggled');\n\t\titem.querySelector('.sub-menu-toggle').setAttribute(\n\t\t\t'aria-expanded',\n\t\t\t'true'\n\t\t);\n\t}\n}\n\nfunction closeAllSubMenus(navItems) {\n\tnavItems.forEach((item) => {\n\t\titem.querySelector('.sub-menu-toggle').setAttribute(\n\t\t\t'aria-expanded',\n\t\t\t'false'\n\t\t);\n\t\titem.classList.remove('toggled');\n\t});\n}\n\nexport { initSectionNavigation };\n","function findStickySidebar() {\n\tconst stickySidebar = document.querySelector('.table-of-contents');\n\n\tif (!stickySidebar) {\n\t\treturn;\n\t}\n\n\tconst observer = new IntersectionObserver(\n\t\t([entry]) =>\n\t\t\tentry.target.classList.toggle(\n\t\t\t\t'not-sticky',\n\t\t\t\tentry.intersectionRatio < 1\n\t\t\t),\n\t\t{ threshold: [1] }\n\t);\n\n\tobserver.observe(stickySidebar);\n}\n\nexport { findStickySidebar };\n","/**\n * Listen for scroll events and add a class to the header when the user scrolls down\n */\nfunction headerScrollObserver() {\n\tconst siteHeader = document.querySelector('#masthead');\n\n\tif (!siteHeader) {\n\t\treturn;\n\t}\n\n\twindow.addEventListener('scroll', function () {\n\t\tif (window.scrollY > 10) {\n\t\t\tsiteHeader.classList.add('scrolled');\n\t\t} else if (window.scrollY < 1) {\n\t\t\tsiteHeader.classList.remove('scrolled');\n\t\t}\n\t});\n}\n\n/**\n * Toggle the visibility of the scroll-to-top button by adding a show class.\n *\n * The scroll-to-top element is in footer.php.\n *\n * @return {void}\n */\nfunction toggleScrollToTop() {\n\tconst scrollToTop = document.querySelector('#scroll-to-top');\n\n\tif (!scrollToTop) {\n\t\treturn;\n\t}\n\n\tconst viewportHeight = window.innerHeight;\n\tif (window.scrollY > viewportHeight) {\n\t\tscrollToTop.classList.add('show');\n\t} else {\n\t\tscrollToTop.classList.remove('show');\n\t}\n}\n\nfunction scrollObserver() {\n\theaderScrollObserver();\n\ttoggleScrollToTop();\n\n\twindow.addEventListener('scroll', function () {\n\t\theaderScrollObserver();\n\t\ttoggleScrollToTop();\n\t});\n}\n\nexport { scrollObserver };\n","function setHeaderHeightProperty() {\n\tconst header = document.querySelector('#masthead');\n\n\tif (!header) {\n\t\treturn;\n\t}\n\n\tconst headerHeight = header.offsetHeight;\n\tdocument.body.style.setProperty('--header-height', headerHeight + 'px');\n\n\tconst resizeHeaderObserver = new ResizeObserver((entries) => {\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.target === header) {\n\t\t\t\tdocument.body.style.setProperty(\n\t\t\t\t\t'--header-height',\n\t\t\t\t\tentry.contentRect.height + 'px'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n\n\tresizeHeaderObserver.observe(header);\n}\n\nfunction setSubnavHeightProperty() {\n\tconst subnav = document.querySelector('.pdm-section-navigation-wrapper');\n\n\tif (!subnav) {\n\t\treturn;\n\t}\n\n\tconst subnavHeight = subnav.offsetHeight;\n\tdocument.body.style.setProperty('--subnav-height', subnavHeight + 'px');\n\n\tconst resizeSubnavObserver = new ResizeObserver((entries) => {\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.target === subnav) {\n\t\t\t\tdocument.body.style.setProperty(\n\t\t\t\t\t'--subnav-height',\n\t\t\t\t\tentry.contentRect.height + 'px'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n\n\tresizeSubnavObserver.observe(subnav);\n}\n\nexport { setHeaderHeightProperty, setSubnavHeightProperty };\n"],"names":["$3c040451fea6b948$var$headerScrollObserver","siteHeader","document","querySelector","window","addEventListener","scrollY","classList","add","remove","$3c040451fea6b948$var$toggleScrollToTop","scrollToTop","viewportHeight","innerHeight","navItems","querySelectorAll","$00e567500e8208cf$var$addDisclosureButtons","forEach","item","button","createElement","setAttribute","innerHTML","insertBefore","nextSibling","$00e567500e8208cf$var$addEventListeners","event","preventDefault","$00e567500e8208cf$var$toggleSubMenu","isExpanded","getAttribute","$00e567500e8208cf$var$closeAllSubMenus","header","headerHeight","offsetHeight","body","style","setProperty","resizeHeaderObserver","ResizeObserver","entries","entry","target","contentRect","height","observe","subnav","subnavHeight","resizeSubnavObserver","stickySidebar","observer","IntersectionObserver","toggle","intersectionRatio","threshold"],"version":3,"file":"main.js.map"}