{"version":3,"sources":["webpack://frontendplaceholder/./Src/Scripts/components/sticky-header.js"],"names":["constructor","elm","eventContainer","document","querySelector","sidebar","btn","handleScroll","window","scrollY","offsetTop","classList","add","remove","setSize","style","minWidth","offsetWidth","addEventListener"],"mappings":"gNAAe,MACXA,YAAYC,GACR,MAAMC,EAAiBC,SAASC,cAAc,0BACxCC,EAAUF,SAASC,cAAc,wBACjCE,EAAML,EAAIG,cAAc,QAC9B,SAASG,IACDC,OAAOC,QAAUP,EAAeQ,UAAY,GAC5CT,EAAIU,UAAUC,IAAI,oCAElBX,EAAIU,UAAUE,OAAO,oCAI7B,SAASC,IACLR,EAAIS,MAAMC,SAAY,GAAEX,EAAQY,gBAGpCH,IACAP,IACAC,OAAOU,iBAAiB,SAAUX,GAClCC,OAAOU,iBAAiB,SAAUJ","file":"1378.d6667b46be213e541d51.js","sourcesContent":["export default class StickyHeader {\n constructor(elm) {\n const eventContainer = document.querySelector('[data-event-container]');\n const sidebar = document.querySelector('.event-page__sidebar');\n const btn = elm.querySelector('.btn');\n function handleScroll() {\n if (window.scrollY > eventContainer.offsetTop + 90) {\n elm.classList.add('event-page__sticky-header--shown');\n } else {\n elm.classList.remove('event-page__sticky-header--shown');\n }\n }\n\n function setSize() {\n btn.style.minWidth = `${sidebar.offsetWidth}px`;\n }\n\n setSize();\n handleScroll();\n window.addEventListener('scroll', handleScroll);\n window.addEventListener('resize', setSize);\n }\n}\n"],"sourceRoot":""}