{"version":3,"sources":["modules.stickyElements.js"],"names":["app","stickyElements","let","sticky","_stickyElements","document","querySelectorAll","debounceTimer","element","forEach","breakpoint","parseInt","getAttribute","mq","window","matchMedia","setAttribute","matches","update","init","Sticky","addEventListener","passive","clearTimeout","setTimeout","updateElements"],"mappings":"AAIAA,IACEC,eAAA,wBAEAC,IAAIC,EACJ,MAAMC,EAAkBC,SAASC,iBAAiB,yBAiBlDJ,IAIEK,EAKF,SAIIC,IAHFJ,EAIEK,QAAA,SAAAD,GAJF,IAAAE,EAAAC,SAAAH,EAAAI,aAAA,oBAQFC,EAAAC,OAAAC,0BAAAL,QALIF,EAAQQ,aAAa,oBAAqBH,EAAGI,SAC7Cd,EAAOe,WAKX,MAAO,CACLC,KAnCF,WACEhB,EAAS,IAAIiB,OAAO,yBAIpBN,IAIGA,OACDO,iBAAEC,SALJ,WAiBDC,aAAAhB,GAHCA,EAAgBiB,WAAW,WAK7BC,KACErB,MAfE,CAAEkB,SAAS,MAff","file":"../modules.stickyElements.min.js","sourcesContent":["/* ========================================================================\r\n Sticky Elements\r\n ========================================================================== */\r\n\r\napp.stickyElements = (function () {\r\n 'use strict';\r\n\r\n let sticky;\r\n const _stickyElements = document.querySelectorAll('[data-sticky-element]');\r\n\r\n function init() {\r\n sticky = new Sticky('[data-sticky-element]');\r\n\r\n updateElements();\r\n\r\n window.addEventListener(\r\n 'resize',\r\n function () {\r\n debounceUpdate();\r\n },\r\n { passive: true }\r\n );\r\n }\r\n\r\n // debounce\r\n let debounceTimer;\r\n\r\n function debounceUpdate() {\r\n clearTimeout(debounceTimer);\r\n debounceTimer = setTimeout(() => {\r\n updateElements();\r\n }, 250);\r\n }\r\n\r\n function updateElements() {\r\n _stickyElements.forEach((element) => {\r\n const breakpoint = parseInt(element.getAttribute('data-sticky-for'));\r\n const mq = window.matchMedia(`(min-width: ${breakpoint}px)`);\r\n element.setAttribute('data-sticky-style', mq.matches);\r\n sticky.update();\r\n });\r\n }\r\n\r\n // Expose public functions and variables\r\n return {\r\n init: init,\r\n };\r\n})();\r\n"]}