{"version":3,"file":"ScrollOverride2.BUfWNs-R.mjs","names":["useState","useCallback","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/nP1Sw6pqA5AE2Ioga8hn/K8uijd7OO0w00RQPCfU7/ScrollOverride2.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useCallback}from\"react\";function useScrollSwitch(threshold=50,debounceMs=0){const[isScrolled,setIsScrolled]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;let timeoutId=null;const handleScroll=()=>{if(timeoutId)clearTimeout(timeoutId);timeoutId=setTimeout(()=>{const isNowScrolled=window.scrollY>threshold;setIsScrolled(isNowScrolled);},debounceMs);};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",handleScroll);if(timeoutId)clearTimeout(timeoutId);};},[threshold,debounceMs]);return isScrolled;}export function NavbarSwitchOnScroll(props){const isScrolled=useScrollSwitch();const defaultBreakpoints={desktop:1440,tablet:810,mobile:390};const breakpoints={...defaultBreakpoints,...props.breakpoints};const getWindowWidth=useCallback(()=>{return typeof window!==\"undefined\"?window.innerWidth:0;},[]);const[windowWidth,setWindowWidth]=useState(getWindowWidth);const getVariant=useCallback(()=>{if(windowWidth>=breakpoints.desktop){return isScrolled?\"Navbar desktop - Primary\":\"Navbar desktop - Transparent\";}else if(windowWidth>=breakpoints.tablet){return isScrolled?\"Tablet closed\":\"Tablet closed Transparent\";}else{return isScrolled?\"Mobile closed\":\"Mobile closed Transparent\";}},[windowWidth,isScrolled,breakpoints]);const[currentVariant,setCurrentVariant]=useState(getVariant());useEffect(()=>{if(typeof window===\"undefined\")return;const handleResize=()=>{setWindowWidth(getWindowWidth());};window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[getWindowWidth]);useEffect(()=>{const newVariant=getVariant();if(newVariant!==currentVariant){setCurrentVariant(newVariant);}},[windowWidth,isScrolled,getVariant,currentVariant]);return{variant:currentVariant};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withNavbarSwitchOnScroll(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...NavbarSwitchOnScroll(props)});};}withNavbarSwitchOnScroll.displayName=\"NavbarSwitchOnScroll\";\nexport const __FramerMetadata__ = {\"exports\":{\"NavbarSwitchOnScroll\":{\"type\":\"override\",\"name\":\"NavbarSwitchOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNavbarSwitchOnScroll\":{\"type\":\"reactHoc\",\"name\":\"withNavbarSwitchOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollOverride2.map"],"mappings":"iTAA6F,SAAS,EAAgB,EAAU,GAAG,EAAW,EAAE,CAAC,GAAK,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAsb,OAArb,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAI,EAAU,KAAW,MAAiB,CAAI,GAAU,aAAa,EAAU,CAAC,EAAU,eAAe,CAAC,IAAM,EAAc,EAAO,QAAQ,EAAU,EAAc,EAAc,EAAG,EAAW,EAAiE,OAA9D,EAAO,iBAAiB,SAAS,EAAa,CAAC,QAAQ,GAAK,CAAC,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAa,CAAI,GAAU,aAAa,EAAU,GAAK,CAAC,EAAU,EAAW,CAAC,CAAQ,EAAY,SAAgB,EAAqB,EAAM,CAAC,IAAM,EAAW,GAAiB,CAAqE,EAAY,CAAtD,QAAQ,KAAK,OAAO,IAAI,OAAO,IAA8C,GAAG,EAAM,YAAY,CAAO,EAAeC,MAA+B,IAAS,OAA8B,EAAlB,EAAO,WAAe,EAAE,CAAC,CAAM,CAAC,EAAY,GAAgBD,EAAS,EAAe,CAAO,EAAWC,MAAoB,GAAa,EAAY,QA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