{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/RpvZaxveRJFk6rnaGw6W/oPAV2iLIE5eBiaj5HqYh/CountUp_1.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight}=props;const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[targetNumber,duration,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsx(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:count})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={fontWeight:\"400\",letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:0,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Montaga, serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp_1.map"],
  "mappings": "8GAMkB,SAARA,EAAyBC,EAAM,CAAC,GAAK,CAAC,aAAAC,EAAa,SAAAC,EAAS,KAAAC,EAAK,MAAAC,EAAM,SAAAC,EAAS,WAAAC,CAAU,EAAEN,EAAW,CAACO,EAAMC,CAAQ,EAAEC,EAAS,CAAC,EAAO,CAACC,EAAUC,CAAY,EAAEF,EAAS,EAAK,EAAO,CAACG,EAAYC,CAAc,EAAEJ,EAAS,EAAK,EAAQK,EAAIC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAS,IAAI,qBAAqB,CAAC,CAACC,CAAK,IAAI,CAAC,GAAGA,EAAM,gBAAgB,CAACN,EAAY,CAACD,EAAa,EAAI,EAAEE,EAAe,EAAI,EAAE,IAAIM,EAAM,EAAQC,EAAUnB,GAAcC,EAAS,IAAUmB,EAAc,IAAI,CAACF,GAAOC,EAAaD,EAAMlB,GAAcO,EAAS,KAAK,KAAKW,CAAK,CAAC,EAAE,sBAAsBE,CAAa,GAAQb,EAASP,CAAY,CAAG,EAAEoB,EAAc,CAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,EAAE,OAAGP,EAAI,SAASG,EAAS,QAAQH,EAAI,OAAO,EAAS,IAAI,CAAIA,EAAI,SAASG,EAAS,UAAUH,EAAI,OAAO,CAAG,CAAE,EAAE,CAACb,EAAaC,EAASU,CAAW,CAAC,EAAsBU,EAAK,MAAM,CAAC,MAAMC,EAAe,IAAIT,EAAI,SAAsBQ,EAAK,OAAO,CAAC,MAAM,CAAC,GAAGE,EAAU,WAAWrB,EAAK,MAAMC,EAAM,SAAS,GAAGC,CAAQ,KAAK,WAAW,GAAGC,CAAU,KAAK,QAAQI,EAAU,EAAE,EAAE,WAAW,0BAA0B,EAAE,SAASH,CAAK,CAAC,CAAC,CAAC,CAAE,CAE5jC,IAAMgB,EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,QAAQ,EAAQC,EAAU,CAAC,WAAW,MAAM,cAAc,MAAM,UAAU,SAAS,OAAO,GAAG,EACvLC,EAAoB1B,EAAQ,CAAC,aAAa,CAAC,KAAK2B,EAAY,OAAO,MAAM,gBAAgB,aAAa,GAAG,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,gBAAgB,EAAE,MAAM,CAAC,KAAKA,EAAY,MAAM,MAAM,QAAQ,aAAa,SAAS,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,iBAAiB,aAAa,GAAG,KAAK,IAAI,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,mBAAmB,aAAa,GAAG,KAAK,IAAI,CAAC,CAAC",
  "names": ["CountUp", "props", "targetNumber", "duration", "font", "color", "fontSize", "lineHeight", "count", "setCount", "ye", "isVisible", "setIsVisible", "hasAnimated", "setHasAnimated", "ref", "pe", "ue", "observer", "entry", "start", "increment", "updateCounter", "p", "containerStyle", "textStyle", "addPropertyControls", "ControlType"]
}
