{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/5mcogRyHHBND4ruApZQY/Fa9PyWH5SVt0FIjn0HaO/Count_Up.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withCountUp(Component){return props=>{const[count,setCount]=useState(0);const{text}=props;const transitionTime=300 // 1 second\n;useEffect(()=>{const matches=text.match(/^(\\D*)(\\d*\\.?\\d+)(\\D*)$/);if(matches){const prefix=matches[1];const targetValue=parseFloat(matches[2]);const suffix=matches[3];if(!isNaN(targetValue)&&count<targetValue){const startTime=Date.now();const endTime=startTime+transitionTime;const minIncrement=.01 // Minimum increment value\n;const animate=()=>{const currentTime=Date.now();if(currentTime>=endTime){setCount(targetValue);}else{const elapsed=currentTime-startTime;const duration=endTime-startTime;const progress=elapsed/duration;const easedProgress=1-Math.pow(1-progress,2) // Quadratic easing function\n;const increment=Math.max((targetValue-count)*easedProgress,minIncrement);const newCount=count+increment;setCount(newCount);requestAnimationFrame(animate);}};requestAnimationFrame(animate);}else{setCount(targetValue) // Set the count immediately if it's not less than the target value\n;}return()=>{};}},[count,text,transitionTime]);const matches=text.match(/^(\\D*)(\\d*\\.?\\d+)(\\D*)$/);const prefix=matches?matches[1]:\"\";const suffix=matches?matches[3]:\"\";let formattedCount;if(Number.isInteger(count)){formattedCount=`${prefix}${Math.floor(count)}${suffix}`;}else if(matches&&matches[2].includes(\".\")){const decimalPrecision=matches[2].split(\".\")[1].length;formattedCount=`${prefix}${count.toFixed(decimalPrecision)}${suffix}`;}else{formattedCount=`${prefix}${Math.floor(count)}${suffix}`;}return /*#__PURE__*/ _jsx(Component,{...props,text:formattedCount});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Count_Up.map"],
  "mappings": "uDAAwF,SAAS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E,OAAOe,EAAe,GAAGd,IAASP,EAAM,QAAQsB,CAAgB,IAAIb,SAAeY,EAAe,GAAGd,IAAS,KAAK,MAAMP,CAAK,IAAIS,IAAU,OAAqBc,EAAKzB,EAAU,CAAC,GAAGC,EAAM,KAAKsB,CAAc,CAAC,CAAE,CAAE",
  "names": ["withCountUp", "Component", "props", "count", "setCount", "ye", "text", "transitionTime", "ue", "matches", "prefix", "targetValue", "suffix", "startTime", "endTime", "minIncrement", "animate", "currentTime", "elapsed", "duration", "progress", "easedProgress", "increment", "newCount", "formattedCount", "decimalPrecision", "p"]
}
