{"version":3,"file":"StickyPin.DO64jsDS.mjs","names":["useRef","__esmMin","init_ssg_sandbox_shims","window","de","init_jsx_runtime","c","init_npm_react_18_3_1","ce","makePinAtBottom","ref","el","update","maxWidth","top","ro","Component","props","withPinAtBottom","withPinAtBottomPhone","init_StickyPin"],"sources":["https:/framerusercontent.com/modules/urh1s2Vlcb1Jxtsy1BKl/uYR8KkrCk7NjY2cDGNoY/StickyPin.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Pins a sticky section once its bottom edge reaches the bottom of the\n// viewport, so tall sections are fully seen before the next one slides over.\n// Use on a layer that is already set to position: sticky.\nfunction makePinAtBottom(Component,maxWidth){return props=>{const ref=useRef(null);useEffect(()=>{const el=ref.current;if(!el)return;const update=()=>{// Only pin while the layer is actually sticky (phone layouts scroll normally)\nel.style.top=\"\";if(maxWidth&&window.innerWidth>maxWidth)return;if(getComputedStyle(el).position!==\"sticky\")return;const top=Math.min(0,window.innerHeight-el.offsetHeight);el.style.top=top+\"px\";};update();const ro=new ResizeObserver(update);ro.observe(el);window.addEventListener(\"resize\",update);return()=>{ro.disconnect();window.removeEventListener(\"resize\",update);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}export function withPinAtBottom(Component){return makePinAtBottom(Component);}// Same, but only on the phone breakpoint (below 810px), so desktop and\n// tablet keep their own sticky behaviour.\nexport function withPinAtBottomPhone(Component){return makePinAtBottom(Component,809.98);}\nexport const __FramerMetadata__ = {\"exports\":{\"withPinAtBottomPhone\":{\"type\":\"reactHoc\",\"name\":\"withPinAtBottomPhone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPinAtBottom\":{\"type\":\"reactHoc\",\"name\":\"withPinAtBottom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyPin.map"],"mappings":"A,uIAGA,SAASS,EAAgB,EAAU,EAAS,CAAC,MAAO,IAAO,CAAC,IAAMC,EAAIV,EAAO,IAAI,EACsS,OADpSQ,MAAc,CAAC,IAAMG,EAAGD,EAAI,QAAQ,GAAG,CAACC,EAAG,OAAO,IAAMC,MAAW,CACvF,GAA/D,EAAG,MAAM,IAAI,GAAMC,GAAUV,EAAO,WAAWU,GAAmB,iBAAiBF,CAAE,CAAC,CAAC,WAAW,SAAS,OAAO,IAAMG,EAAI,KAAK,IAAI,EAAEX,EAAO,YAAYQ,EAAG,YAAY,EAAE,EAAG,MAAM,IAAIG,EAAI,IAAK,EAAEF,EAAO,EAAE,IAAMG,EAAG,IAAI,eAAeH,CAAM,EAA0D,OAAxDG,EAAG,QAAQJ,CAAE,EAAER,EAAO,iBAAiB,SAASS,CAAM,MAAY,CAACG,EAAG,WAAW,EAAEZ,EAAO,oBAAoB,SAASS,CAAM,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAKI,EAAU,CAAC,GAAGC,EAAU,KAAG,CAAC,CAAE,CAAE,CAAC,SAAgBC,EAAgB,EAAU,CAAC,OAAOT,EAAgBO,CAAS,CAAE,CAE9f,SAAgBG,EAAqB,EAAU,CAAC,OAAOV,EAAgBO,EAAU,MAAM,CAAE,C"}