{"version":3,"file":"Scroll.VUsTGkwh.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/oB5piBJHCpHkIjltPwY5/zABEZzKCuscqyKKtq9Bd/Scroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";export function withProgress(Component){return props=>{const[progress,setProgress]=useState(0);const[isScrolling,setIsScrolling]=useState(false);const prevScrollY=useRef(0);useEffect(()=>{const calculateProgress=()=>{const startEl=document.getElementById(\"start\");const endEl=document.getElementById(\"end\");if(startEl&&endEl){const sectionHeight=endEl.offsetTop-startEl.offsetTop;const scrollDistance=window.pageYOffset||document.documentElement.scrollTop;const sectionScrollDistance=scrollDistance-startEl.offsetTop;const sectionProgress=sectionScrollDistance/sectionHeight*100;setProgress(sectionProgress);}};const handleScroll=()=>{const scrollY=window.pageYOffset||document.documentElement.scrollTop;if(scrollY!==prevScrollY.current){prevScrollY.current=scrollY;calculateProgress();setIsScrolling(true);}};const handleScrollEnd=()=>{setIsScrolling(false);};calculateProgress();window.addEventListener(\"scroll\",handleScroll);window.addEventListener(\"scrollend\",handleScrollEnd);return()=>{window.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"scrollend\",handleScrollEnd);};},[]);return /*#__PURE__*/_jsx(Component,{...props,style:{width:`${progress}%`,transition:isScrolling?\"none\":\"width 0.5s ease-in-out\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withProgress\":{\"type\":\"reactHoc\",\"name\":\"withProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll.map"],"mappings":"mNAAwF,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAO,EAAYC,EAAO,EAAE,CAAs6B,OAAr6B,MAAc,CAAC,IAAM,MAAsB,CAAC,IAAM,EAAQ,SAAS,eAAe,QAAQ,CAAO,EAAM,SAAS,eAAe,MAAM,CAAC,GAAG,GAAS,EAAM,CAAC,IAAM,EAAc,EAAM,UAAU,EAAQ,UAAyJ,IAA1H,EAAO,aAAa,SAAS,gBAAgB,WAAqD,EAAQ,WAAsD,EAAc,IAAI,EAAY,EAAgB,GAAU,MAAiB,CAAC,IAAM,EAAQ,EAAO,aAAa,SAAS,gBAAgB,UAAa,IAAU,EAAY,UAAS,EAAY,QAAQ,EAAQ,GAAmB,CAAC,EAAe,GAAK,GAAU,MAAoB,CAAC,EAAe,GAAM,EAA2H,OAAxH,GAAmB,CAAC,EAAO,iBAAiB,SAAS,EAAa,CAAC,EAAO,iBAAiB,YAAY,EAAgB,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAa,CAAC,EAAO,oBAAoB,YAAY,EAAgB,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,MAAM,GAAG,EAAS,GAAG,WAAW,EAAY,OAAO,yBAAyB,CAAC,CAAC,uBAAjwC,IAA6C"}