{"version":3,"file":"AvoidLayoutJumping_Prod.CAN0Gqmm.mjs","names":["useMemo","useState","useRef","useRef"],"sources":["https:/framerusercontent.com/modules/ptVqQ9rHSBNCHrgrgPxh/tlRCZ24guFUdbGc57D2h/AnimatedCounter.js","https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/aTM6mEMGlM19JjX8exDe/AvoidLayoutJumping_Prod.js"],"sourcesContent":["// Number counter component that animates from start to end value when in view\n// Supports prefix/suffix, font customization, decimals, easing, duration and delay\n// Animation triggers once when component enters viewport\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useInView,animate}from\"framer-motion\";const easingFunctions={linear:[0,0,1,1],easeIn:[.42,0,1,1],easeOut:[0,0,.58,1],easeInOut:[.42,0,.58,1]};/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function AnimatedCounter(props){// Create a key that includes ALL props to force remount on any change\nconst componentKey=useMemo(()=>{const gradientStopsKey=props.gradientStops.map(s=>`${s.color}-${s.position}`).join(\"-\");return`${props.startValue}-${props.endValue}-${props.duration}-${props.delay}-${props.decimals}-${props.hideDecimalsInFinal}-${props.prefix}-${props.suffix}-${props.easing}-${props.color}-${props.gradientAngle}-${props.gradientType}-${gradientStopsKey}-${props.negative}`;},[props]);return /*#__PURE__*/_jsx(CounterInner,{...props},componentKey);}function CounterInner(props){const{startValue,endValue,duration,delay,decimals,hideDecimalsInFinal,prefix,suffix,easing,font,color,gradientAngle,gradientType,gradientStops,negative,style}=props;const[displayValue,setDisplayValue]=useState(startValue);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);const isInView=useInView(ref,{once:true});// Create stable gradient key using useMemo\nconst gradientStopsKey=useMemo(()=>{return gradientStops.map(s=>`${s.color}-${s.position}`).join(\"-\");},[gradientStops]);// Reset animation when gradient properties change\nuseEffect(()=>{startTransition(()=>{setHasAnimated(false);setDisplayValue(startValue);});},[gradientAngle,gradientType,gradientStopsKey,startValue]);useEffect(()=>{if(isInView&&!hasAnimated){const timer=setTimeout(()=>{const controls=animate(startValue,endValue,{duration:duration,ease:easingFunctions[easing],onUpdate:value=>{startTransition(()=>{setDisplayValue(value);});},onComplete:()=>{startTransition(()=>{setHasAnimated(true);});}});return()=>controls.stop();},delay*1e3);return()=>clearTimeout(timer);}},[isInView,hasAnimated,startValue,endValue,duration,delay,easing]);const formattedValue=displayValue.toFixed(decimals);const finalFormattedValue=hideDecimalsInFinal&&hasAnimated?displayValue.toFixed(0):formattedValue;// Check if gradient is enabled\nconst hasGradient=gradientStops&&gradientStops.length>1;// Base container style\nconst containerStyle={...style,position:\"relative\",width:\"max-content\",minWidth:\"max-content\",...font};// Text style with gradient or solid color\nconst textStyle=negative&&hasGradient?{display:\"inline-block\",width:\"fit-content\",whiteSpace:\"nowrap\",background:gradientType===\"radial\"?`radial-gradient(${gradientStops.map(stop=>`${stop.color} ${stop.position}%`).join(\", \")})`:`linear-gradient(${gradientAngle}deg, ${gradientStops.map(stop=>`${stop.color} ${stop.position}%`).join(\", \")})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\"}:negative?{display:\"inline-block\",width:\"fit-content\",whiteSpace:\"nowrap\",color:\"transparent\",WebkitTextStroke:`1px ${color}`}:hasGradient?{display:\"inline-block\",width:\"fit-content\",whiteSpace:\"nowrap\",background:gradientType===\"radial\"?`radial-gradient(${gradientStops.map(stop=>`${stop.color} ${stop.position}%`).join(\", \")})`:`linear-gradient(${gradientAngle}deg, ${gradientStops.map(stop=>`${stop.color} ${stop.position}%`).join(\", \")})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\"}:{color:color,whiteSpace:\"nowrap\"};// Create a key that changes when gradient properties change to force remount\nconst gradientKey=useMemo(()=>{return hasGradient?`${gradientType}-${gradientAngle}-${gradientStopsKey}`:\"solid\";},[hasGradient,gradientType,gradientAngle,gradientStopsKey]);// Create a key that includes ALL props to force remount on any change\nconst componentKey=useMemo(()=>{return`${startValue}-${endValue}-${duration}-${delay}-${decimals}-${hideDecimalsInFinal}-${prefix}-${suffix}-${easing}-${color}-${gradientAngle}-${gradientType}-${gradientStopsKey}-${negative}`;},[startValue,endValue,duration,delay,decimals,hideDecimalsInFinal,prefix,suffix,easing,color,gradientAngle,gradientType,gradientStopsKey,negative]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:containerStyle,children:/*#__PURE__*/_jsxs(\"span\",{style:textStyle,children:[prefix,finalFormattedValue,suffix]})});}addPropertyControls(AnimatedCounter,{startValue:{type:ControlType.Number,title:\"Start Value\",defaultValue:1,step:1},endValue:{type:ControlType.Number,title:\"End Value\",defaultValue:5e3,step:1},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:.1,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:5,step:.1,unit:\"s\"},decimals:{type:ControlType.Number,title:\"Decimals\",defaultValue:0,min:0,max:4,step:1,displayStepper:true},hideDecimalsInFinal:{type:ControlType.Boolean,title:\"Hide Decimals in Final\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"$\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"%\"},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\"],defaultValue:\"easeOut\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},negative:{type:ControlType.Boolean,title:\"Negative\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:90,min:0,max:360,step:1,unit:\"deg\"},gradientType:{type:ControlType.Enum,title:\"Gradient Type\",options:[\"linear\",\"radial\"],optionTitles:[\"Linear\",\"Radial\"],defaultValue:\"linear\"},gradientStops:{type:ControlType.Array,title:\"Gradient Stops\",control:{type:ControlType.Object,controls:{color:{type:ControlType.Color,defaultValue:\"#ff0000\"},position:{type:ControlType.Number,defaultValue:0,min:0,max:100,step:1,unit:\"%\"}}},defaultValue:[{color:\"#ff0000\",position:0},{color:\"#00ff00\",position:100}]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedCounter.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction,style}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const rafId=useRef();const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";useEffect(()=>{if(isCanvas)return;const parent=ref.current?.parentElement?.parentElement;if(!parent)return;const container=parent.parentElement;if(!container)return;const updateSize=()=>{const rect=parent.getBoundingClientRect();if(horizontal){container.style.width=`${rect.width}px`;}if(vertical){container.style.height=`${rect.height}px`;}rafId.current=requestAnimationFrame(updateSize);};// Start the RAF loop\nrafId.current=requestAnimationFrame(updateSize);return()=>{if(rafId.current){cancelAnimationFrame(rafId.current);}if(container){if(horizontal){container.style.width=\"\";}if(vertical){container.style.height=\"\";}}};},[direction]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style}});}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore\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\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AvoidLayoutJumping_Prod.map"],"mappings":"4QAMG,SAAwB,EAAgB,EAAM,CACjD,IAAM,EAAaA,MAAY,CAAC,IAAM,EAAiB,EAAM,cAAc,IAAI,GAAG,GAAG,EAAE,MAAM,GAAG,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,EAAM,WAAW,GAAG,EAAM,SAAS,GAAG,EAAM,SAAS,GAAG,EAAM,MAAM,GAAG,EAAM,SAAS,GAAG,EAAM,oBAAoB,GAAG,EAAM,OAAO,GAAG,EAAM,OAAO,GAAG,EAAM,OAAO,GAAG,EAAM,MAAM,GAAG,EAAM,cAAc,GAAG,EAAM,aAAa,GAAG,EAAiB,GAAG,EAAM,YAAa,CAAC,EAAM,CAAC,CAAC,OAAoB,EAAK,EAAa,CAAC,GAAG,EAAM,CAAC,EAAa,CAAE,SAAS,EAAa,EAAM,CAAC,GAAK,CAAC,aAAW,WAAS,WAAS,QAAM,WAAS,sBAAoB,SAAO,SAAO,SAAO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