{"version":3,"file":"AvoidLayoutJumping_Prod.D31gkj2n.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","de","useReducedMotion","init_framer_motion_DhsWWWsN","init_framer_B1b760uK","addPropertyControls","useIsStaticRenderer","ControlType","AvoidLayoutJumping","isStatic","reducedMotion","rootRef","rafId","root","target","container","vertical","direction","horizontal","disposed","inView","pageVisible","decided","skipOutOfFlow","lastWidth","lastHeight","cancelFrame","clearSizes","rememberFlow","position","commit","width","height","next","px","active","applyNow","rect","resizeObserver","intersectionObserver","entries","entry","onVisibility","following","stableFrames","readFrame","nextWidth","nextHeight","armFollow","onPointer","node","event","style","value","init_AvoidLayoutJumping_Prod"],"sources":["https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/lSxCCQSg9Z004fOqQjUU/AvoidLayoutJumping_Prod.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useReducedMotion}from\"framer-motion\";import{useEffect,useRef}from\"react\";/**\n * Placement contract: this instance is an absolute, hidden utility inside the\n * frame whose height or width animates. Measure that frame (the grandparent)\n * and copy its border box onto the grandparent's parent so in-flow siblings\n * ease instead of jumping. Never write position, inset, or transform.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction=\"vertical\",style,className}){const isStatic=useIsStaticRenderer();const reducedMotion=useReducedMotion()??false;const rootRef=useRef(null);const rafId=useRef(null);useEffect(()=>{if(isStatic)return;const root=rootRef.current;const target=root?.parentElement?.parentElement;const container=target?.parentElement;if(!root||!target||!container)return;const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";let disposed=false;let inView=true;let pageVisible=document.visibilityState===\"visible\";let decided=false;let skipOutOfFlow=false;let lastWidth=\"\";let lastHeight=\"\";const cancelFrame=()=>{if(rafId.current!=null)cancelAnimationFrame(rafId.current);rafId.current=null;};const clearSizes=()=>{if(horizontal)container.style.width=\"\";if(vertical)container.style.height=\"\";};const rememberFlow=()=>{if(decided)return;const position=getComputedStyle(container).position;// Absolute and fixed containers do not push siblings. Writing a\n// pixel size onto them fights their insets.\nskipOutOfFlow=position===\"absolute\"||position===\"fixed\";decided=true;};const commit=(width,height)=>{if(skipOutOfFlow||!target.isConnected)return;if(width===0&&height===0&&target.offsetParent===null){return;}if(horizontal){const next=px(width);if(next!==lastWidth){container.style.width=next;lastWidth=next;}}if(vertical){const next=px(height);if(next!==lastHeight){container.style.height=next;lastHeight=next;}}};const active=()=>!disposed&&inView&&pageVisible;// Reduced motion still copies the snapped size so surrounding layout\n// does not stay stuck. It does not schedule frames.\nif(reducedMotion){const applyNow=()=>{if(!active())return;rememberFlow();const rect=target.getBoundingClientRect();commit(rect.width,rect.height);};const resizeObserver=new ResizeObserver(()=>applyNow());const intersectionObserver=new IntersectionObserver(entries=>{inView=entries.some(entry=>entry.isIntersecting);if(active())applyNow();});const onVisibility=()=>{pageVisible=document.visibilityState===\"visible\";if(active())applyNow();};resizeObserver.observe(target);intersectionObserver.observe(target);document.addEventListener(\"visibilitychange\",onVisibility);applyNow();return()=>{disposed=true;resizeObserver.disconnect();intersectionObserver.disconnect();document.removeEventListener(\"visibilitychange\",onVisibility);clearSizes();};}let following=false;let stableFrames=0;const readFrame=()=>{rafId.current=null;if(!active()){following=false;return;}rememberFlow();if(skipOutOfFlow){following=false;return;}const rect=target.getBoundingClientRect();const nextWidth=horizontal?px(rect.width):lastWidth;const nextHeight=vertical?px(rect.height):lastHeight;const changed=nextWidth!==lastWidth||nextHeight!==lastHeight;if(changed){// Commit before paint. A second frame would leave the parent\n// one spring step behind the transformed frame.\nstableFrames=0;commit(rect.width,rect.height);}else{stableFrames+=1;}// Framer eases size with transforms ResizeObserver does not see.\n// Keep sampling only while the box is still changing, then stop.\nif(stableFrames<12){rafId.current=requestAnimationFrame(readFrame);return;}following=false;};const armFollow=()=>{if(!active()||following)return;following=true;stableFrames=0;rafId.current=requestAnimationFrame(readFrame);};const resizeObserver=new ResizeObserver(()=>armFollow());const intersectionObserver=new IntersectionObserver(entries=>{inView=entries.some(entry=>entry.isIntersecting);if(active())armFollow();else{following=false;cancelFrame();}});const onVisibility=()=>{pageVisible=document.visibilityState===\"visible\";if(active())armFollow();else{following=false;cancelFrame();}};const onPointer=event=>{const node=event.target;if(node instanceof Node&&target.contains(node))armFollow();};resizeObserver.observe(target);intersectionObserver.observe(target);document.addEventListener(\"visibilitychange\",onVisibility);document.addEventListener(\"pointerdown\",onPointer,true);armFollow();return()=>{disposed=true;following=false;cancelFrame();resizeObserver.disconnect();intersectionObserver.disconnect();document.removeEventListener(\"visibilitychange\",onVisibility);document.removeEventListener(\"pointerdown\",onPointer,true);clearSizes();};},[direction,isStatic,reducedMotion]);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,\"data-build\":\"layout-jump-preventer-prod-20260926-01\",className:className,\"aria-hidden\":\"true\",\"data-layout-jump-preventer\":\"\",style:{position:\"relative\",pointerEvents:\"none\",...style}});}function px(value){const rounded=Math.round(value*100)/100;return`${rounded}px`;}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore Framer ships optionIcons; the installed enum type omits them.\noptionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"\"}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