{"version":3,"file":"Card_Stack.DHjA-pWe.mjs","names":["React.useState","React.useEffect","React.forwardRef","_jsx","React.useRef","React.useCallback","__esmMin","init_npm_react_18_3_1","window","init_ssg_sandbox_shims","ce","init_jsx_runtime","ne","J","_e","de","RenderTarget","init_framer_ChujFWHC","clamp","value","readStyles","card","restoreStyles","styles","useMobileBreakpoint","isMobile","setIsMobile","query","MOBILE_MAX_WIDTH","update","withStickyHeadlineFit","Component","props","ref","mobileHeight","HEADLINE_STICKY_TOP","withStackFade","forwardedRef","rootRef","frameRef","originalsRef","root","mobile","reducedMotion","getCards","child","restoreAll","cards","transitionDistance","TRANSITION_START","index","original","nextCard","nextTop","progress","CARD_STICKY_TOP","fadeProgress","FADE_FINISH","scale","opacity","FADE_TO","schedule","resizeObserver","setRef","node","init_Card_Stack"],"sources":["https:/framerusercontent.com/modules/GqHoE14nf3dkwzTpvs2E/ex0K0sAk1s1QkkC0qO34/Card_Stack.js"],"sourcesContent":["// StickyCardStack.tsx\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{RenderTarget}from\"framer\";/* ---------------------------- Configuration ---------------------------- */const MOBILE_MAX_WIDTH=810;const CARD_STICKY_TOP=0;const HEADLINE_STICKY_TOP=100;const SCALE_TO=.92;const FADE_TO=0;/**\n * Lower = later transition.\n * Higher = earlier transition.\n */const TRANSITION_START=.55;/**\n * Opacity reaches zero after 85% of the transition.\n */const FADE_FINISH=.85;function clamp(value){return Math.max(0,Math.min(1,value));}function readStyles(card){return{zIndex:card.style.zIndex,scale:card.style.scale,opacity:card.style.opacity,transformOrigin:card.style.transformOrigin,willChange:card.style.willChange,pointerEvents:card.style.pointerEvents};}function restoreStyles(card,styles){card.style.zIndex=styles.zIndex;card.style.scale=styles.scale;card.style.opacity=styles.opacity;card.style.transformOrigin=styles.transformOrigin;card.style.willChange=styles.willChange;card.style.pointerEvents=styles.pointerEvents;}function useMobileBreakpoint(){const[isMobile,setIsMobile]=React.useState(false);React.useEffect(()=>{const query=window.matchMedia(`(max-width: ${MOBILE_MAX_WIDTH}px)`);const update=()=>setIsMobile(query.matches);update();query.addEventListener(\"change\",update);return()=>{query.removeEventListener(\"change\",update);};},[]);return isMobile;}/**\n * Apply to the `Headline component`.\n *\n * Mobile:\n * - Keeps the headline inside the visible area below its 100px sticky offset.\n *\n * Desktop and Tablet:\n * - Passes Framer's original height through unchanged.\n */export function withStickyHeadlineFit(Component){return /*#__PURE__*/React.forwardRef(function StickyHeadlineFit(props,ref){const isMobile=useMobileBreakpoint();const supportsDynamicViewport=typeof CSS!==\"undefined\"&&CSS.supports(\"height\",\"100dvh\");const mobileHeight=supportsDynamicViewport?`calc(100dvh - ${HEADLINE_STICKY_TOP}px)`:`calc(100vh - ${HEADLINE_STICKY_TOP}px)`;return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:isMobile?{...props.style,height:mobileHeight}:props.style});});}/**\n * Apply directly to the `Cards` stack.\n *\n * Keep each Phone Card set to:\n * - Position: Sticky\n * - Top: 0\n *\n * This override does not change stack height, padding, Card width, or margins.\n */export function withStackFade(Component){return /*#__PURE__*/React.forwardRef(function StackFade(props,forwardedRef){const rootRef=React.useRef(null);const frameRef=React.useRef(null);const originalsRef=React.useRef(new Map);React.useEffect(()=>{const root=rootRef.current;if(!root||typeof window===\"undefined\"||RenderTarget.current()===RenderTarget.canvas){return;}const mobile=window.matchMedia(`(max-width: ${MOBILE_MAX_WIDTH}px)`);const reducedMotion=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const getCards=()=>Array.from(root.children).filter(child=>child instanceof HTMLElement);const restoreAll=()=>{originalsRef.current.forEach((styles,card)=>{restoreStyles(card,styles);});originalsRef.current.clear();};const update=()=>{frameRef.current=null;// Desktop and Tablet remain unchanged.\nif(!mobile.matches){restoreAll();return;}const cards=getCards();const transitionDistance=Math.max(1,window.innerHeight*TRANSITION_START);cards.forEach((card,index)=>{if(!originalsRef.current.has(card)){originalsRef.current.set(card,readStyles(card));}const original=originalsRef.current.get(card);const nextCard=cards[index+1];// Later Cards pass above earlier Cards.\ncard.style.zIndex=String(index+1);card.style.transformOrigin=\"center top\";card.style.willChange=\"scale, opacity\";// The final Card stays visible and unscaled.\nif(!nextCard){card.style.scale=\"1\";card.style.opacity=\"1\";card.style.pointerEvents=original.pointerEvents;return;}const nextTop=nextCard.getBoundingClientRect().top;const progress=clamp((CARD_STICKY_TOP+transitionDistance-nextTop)/transitionDistance);const fadeProgress=clamp(progress/FADE_FINISH);const scale=reducedMotion.matches?1:1+(SCALE_TO-1)*progress;const opacity=reducedMotion.matches?progress>=1?FADE_TO:1:1+(FADE_TO-1)*fadeProgress;card.style.scale=String(scale);card.style.opacity=String(opacity);card.style.pointerEvents=opacity<=.001?\"none\":original.pointerEvents;});};const schedule=()=>{if(frameRef.current!==null)return;frameRef.current=window.requestAnimationFrame(update);};const resizeObserver=new ResizeObserver(schedule);resizeObserver.observe(root);window.addEventListener(\"scroll\",schedule,{passive:true});window.addEventListener(\"resize\",schedule);mobile.addEventListener(\"change\",schedule);reducedMotion.addEventListener(\"change\",schedule);schedule();return()=>{window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",schedule);mobile.removeEventListener(\"change\",schedule);reducedMotion.removeEventListener(\"change\",schedule);resizeObserver.disconnect();if(frameRef.current!==null){window.cancelAnimationFrame(frameRef.current);}restoreAll();};},[]);const setRef=React.useCallback(node=>{rootRef.current=node;if(typeof forwardedRef===\"function\"){forwardedRef(node);}else if(forwardedRef){forwardedRef.current=node;}},[forwardedRef]);return /*#__PURE__*/_jsx(Component,{ref:setRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withStackFade\":{\"type\":\"reactHoc\",\"name\":\"withStackFade\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStickyHeadlineFit\":{\"type\":\"reactHoc\",\"name\":\"withStickyHeadlineFit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Card_St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