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AoCiD,GAGpCA,GAAkBjD,GAClBiD,EAAiBG,EACjB,CACE,IACIC,EADkBrE,EAAKF,GAAGM,cAAc,6BAA6BsC,aAClCC,EACvC3C,EAAKF,GAAGuB,WAAWC,MAAMC,YAAY,eAAgB8C,EAAmB,MACxEvE,EAAGgC,UAAUiB,IAAI,eACrB,MACI/C,EAAKF,GAAGuB,WAAWC,MAAMgD,eAAe,gBACxCxE,EAAGgC,UAAUC,OAAO,gBAIpB1B,GAEFA,EAAMyD,SAAQ,SAACC,GAAS,IAAAQ,EAClBlB,EAASU,EAAKlB,aAAa,QAC3B2B,EAAkBlE,SAASF,cAAciD,GACzCoB,IACDD,SAAwC,QAAzBD,EAAfC,EAAiBtD,+BAAuB,IAAAqD,OAAA,EAAxCA,EAA0CG,IAAK,GAChDzD,EACA,GACE0D,EAAiBH,EAAgBtD,wBAAwBC,OACzDsD,GAAe,IAAoB,EAAfA,GAAoBE,IAC1CnE,EAAaoE,UAAYb,EAAKa,UAElC,GAEJ,MAEEvE,EAAMyD,SAAQ,SAACC,GAAS,IAAAc,EAClBxB,EAASU,EAAKlB,aAAa,QAC3B2B,EAAkBlE,SAASF,cAAciD,GACzCoB,EACFD,EAAgBtD,wBAAwBwD,EAAIzD,EAC1C0D,GACFH,SAAwC,QAAzBK,EAAfL,EAAiBtD,+BAAuB,IAAA2D,OAAA,EAAxCA,EAA0C1D,SAAU,EAClDsD,GAAe,IAAoB,EAAfA,GAAoBE,IAC1CtE,EAAMyD,SAAQ,SAACgB,GACbA,EAAKhD,UAAUC,OAAO,2BACxB,IACAgC,EAAKjC,UAAUiB,IAAI,4BAIvB,GAEJ,GACF,G","sources":["webpack://@hero-digital/zoom/./src/components/components/StickyNav/StickyNav.js"],"sourcesContent":["class StickyNav {\r\n constructor(el) {\r\n // component global vars\r\n this.el = el\r\n this.linkList = this.el.querySelector('.sticky-nav__list')\r\n const links = document.querySelectorAll('.sticky-nav__link')\r\n const mobileButton = document.querySelector('.sticky-nav__mobile-title')\r\n const listHeightControl = document.querySelector('.sticky-nav__list-wrap')\r\n const header = document.getElementsByTagName('header')[0]\r\n const heightHolder = document.getElementsByClassName('height-holder')[0]\r\n const socialNav = document.getElementsByClassName('social-sharing')[0] || document.getElementsByClassName('social-sharing__blog')[0]\r\n const speakerCard = document.getElementsByClassName('blog-detail-speaker')[0]\r\n let stickyNavOffset = 0\r\n \r\n //header height\r\n const getheaderHeight = header?.getBoundingClientRect().height\r\n const headerHeight = getheaderHeight + 'px'\r\n this.el.parentNode.style.setProperty('--top', headerHeight)\r\n\r\n //Media query vars\r\n const mobileQuery = window?.matchMedia('(max-width: 767px)')\r\n const isMobile = mobileQuery?.matches\r\n window.addEventListener('resize', () => {\r\n el.classList.remove('mobile-stick')\r\n })\r\n\r\n var stickyNavStyle = heightHolder.currentStyle || window.getComputedStyle(heightHolder)\r\n var stickyNavMargin = stickyNavStyle.marginTop\r\n var stickyNavMarginNumber = parseInt(stickyNavMargin)\r\n //Height Space save - prevents scroll jumping when nav becomes sticky\r\n //Adding an extra 60px to account for social media links\r\n let getHeldHeight\r\n if(speakerCard === undefined){\r\n getHeldHeight = (this.el.getBoundingClientRect().height + socialNav?.getBoundingClientRect().height) - stickyNavMarginNumber\r\n }else{\r\n getHeldHeight = (this.el.getBoundingClientRect().height + socialNav?.getBoundingClientRect().height + speakerCard?.getBoundingClientRect().height) - stickyNavMarginNumber\r\n \r\n }\r\n const heldHeight = getHeldHeight + 'px'\r\n heightHolder.style.setProperty('height', heldHeight)\r\n\r\n //expand/collapse height vars\r\n if (this.linkList) {\r\n const getHeight = this.linkList.offsetHeight\r\n const maxHeight = getHeight + 'px'\r\n this.el.parentNode.style.setProperty('--max-height', maxHeight)\r\n var staticNavHeight = this.el.offsetHeight\r\n } \r\n\r\n // mobile expand collapse\r\n mobileButton?.addEventListener('click', collapseExpand)\r\n function collapseExpand() {\r\n if (mobileButton?.getAttribute('aria-expanded') === 'false') {\r\n mobileButton?.setAttribute('aria-expanded', 'true')\r\n mobileButton?.classList.add('isOpen')\r\n listHeightControl.classList.add('isOpen')\r\n } else {\r\n mobileButton?.setAttribute('aria-expanded', 'false')\r\n mobileButton?.classList.remove('isOpen')\r\n listHeightControl.classList.remove('isOpen')\r\n }\r\n }\t\r\n\r\n //subnav location\r\n if (isMobile) {\r\n stickyNavOffset =\r\n this.el.getBoundingClientRect().bottom + getheaderHeight\r\n } else {\r\n stickyNavOffset =\r\n this.el.getBoundingClientRect().top + getheaderHeight + 60\r\n }\r\n\r\n //jumplink scrolling\r\n links.forEach((link) => {\r\n link.addEventListener('click', clickHandler)\r\n })\r\n\r\n function clickHandler(a) {\r\n a.preventDefault()\r\n a.stopPropagation()\r\n var linkId = a.currentTarget.getAttribute('href')\r\n var targetElement = document.querySelector(linkId)\r\n var elementPosition = targetElement.getBoundingClientRect().top\r\n let offsetPosition\r\n if (isMobile) {\r\n offsetPosition =\r\n elementPosition + window.pageYOffset - getheaderHeight - 50\r\n } else {\r\n offsetPosition = elementPosition + window.pageYOffset - getheaderHeight\r\n }\r\n window.scrollTo({\r\n top: offsetPosition,\r\n behavior: 'smooth'\r\n })\r\n if (isMobile && el.classList.contains('mobile-stick')) {\r\n collapseExpand()\r\n }\r\n }\r\n\r\n //sticky scroll tracking\r\n document.addEventListener('scroll', (e) => {\r\n var scrollPosition =\r\n window.pageYOffset || document.documentElement.scrollTop\r\n if (isMobile) {\r\n //used to stop sticky nav once past ebook jumplink content\r\n var content = document.querySelector('.module-ebook-columns')\r\n var contentHeight =\r\n content.getBoundingClientRect().height + getHeldHeight\r\n //adds sticky class and styling\r\n if(scrollPosition <= 0) {\r\n if(el.classList.contains('mobile-stick')) {\r\n el.classList.remove('mobile-stick')\r\n }\r\n }\r\n if(stickyNavOffset < 0) {\r\n stickyNavOffset = stickyNavOffset + scrollPosition\r\n }\r\n if (\r\n scrollPosition >= stickyNavOffset &&\r\n scrollPosition < contentHeight\r\n ) {\r\n var stickyNavHeight = this.el.querySelector('.sticky-nav__mobile-title').offsetHeight\r\n var navigationHeight = stickyNavHeight+staticNavHeight\r\n this.el.parentNode.style.setProperty('--nav-height', navigationHeight + 'px')\r\n el.classList.add('mobile-stick')\r\n } else {\r\n this.el.parentNode.style.removeProperty('--nav-height')\r\n el.classList.remove('mobile-stick')\r\n }\r\n\r\n //manages button text change on scroll\r\n if (links)\r\n {\r\n links.forEach((link) => {\r\n var linkId = link.getAttribute('href')\r\n var matchingSection = document.querySelector(linkId)\r\n var matchingTop =\r\n (matchingSection?.getBoundingClientRect()?.y || 0) -\r\n getheaderHeight -\r\n 50\r\n var matchingHeight = matchingSection.getBoundingClientRect().height\r\n if (matchingTop <= 5 && matchingTop * -1 <= matchingHeight) {\r\n mobileButton.innerHTML = link.innerHTML\r\n }\r\n })\r\n } \r\n } else {\r\n //manages active state on sticky side nav\r\n links.forEach((link) => {\r\n var linkId = link.getAttribute('href')\r\n var matchingSection = document.querySelector(linkId)\r\n var matchingTop =\r\n matchingSection.getBoundingClientRect().y - getheaderHeight\r\n var matchingHeight =\r\n matchingSection?.getBoundingClientRect()?.height || 0\r\n if (matchingTop <= 5 && matchingTop * -1 <= matchingHeight) {\r\n links.forEach((item) => {\r\n item.classList.remove('sticky-nav__link--active')\r\n })\r\n link.classList.add('sticky-nav__link--active')\r\n } else {\r\n // link.classList.remove('sticky-nav__link--active')\t\t\t\r\n }\r\n })\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport default StickyNav\r\n"],"names":["_createClass","StickyNav","el","_window","_this","_classCallCheck","this","linkList","querySelector","links","document","querySelectorAll","mobileButton","listHeightControl","header","getElementsByTagName","heightHolder","getElementsByClassName","socialNav","speakerCard","stickyNavOffset","getheaderHeight","getBoundingClientRect","height","headerHeight","parentNode","style","setProperty","mobileQuery","window","matchMedia","isMobile","matches","addEventListener","classList","remove","getHeldHeight","stickyNavMargin","currentStyle","getComputedStyle","marginTop","stickyNavMarginNumber","parseInt","heldHeight","undefined","maxHeight","offsetHeight","staticNavHeight","collapseExpand","getAttribute","setAttribute","add","clickHandler","a","preventDefault","stopPropagation","offsetPosition","linkId","currentTarget","elementPosition","top","pageYOffset","scrollTo","behavior","contains","bottom","forEach","link","e","scrollPosition","documentElement","scrollTop","contentHeight","navigationHeight","removeProperty","_matchingSection$getB","matchingSection","matchingTop","y","matchingHeight","innerHTML","_matchingSection$getB2","item"],"sourceRoot":""}