{"version":3,"file":"Counter.BitFfwfn.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/5wTsUDEcTKGJjRMvvjos/tqo9SF8Mqhdw3IF9MlAK/Counter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useInView,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";function Counter({value,direction,style}){const ref=useRef(null);const motionValue=useMotionValue(direction===\"down\"?value:0);const springValue=useSpring(motionValue,{damping:100,stiffness:100});const isInView=useInView(ref,{once:true,margin:\"-10px\"});useEffect(()=>{if(isInView){motionValue.set(direction===\"down\"?0:value);}},[motionValue,isInView]);useEffect(()=>springValue.on(\"change\",latest=>{if(ref.current){ref.current.textContent=Intl.NumberFormat(\"en-US\").format(latest.toFixed(0));}}),[springValue]);return /*#__PURE__*/ _jsx(\"span\",{ref:ref,style:style});}export default function Counter200({value,direction,font}){return /*#__PURE__*/ _jsx(Counter,{value:value,direction:direction,style:{fontSize:font.size,fontWeight:font.weight,color:font.color,fontFamily:`'${font.fontFace}'`}});};addPropertyControls(Counter200,{value:{type:ControlType.Number,defaultValue:200},direction:{type:ControlType.Enum,options:[\"down\",\"up\"],optionTitles:[\"Down\",\"Up\"],defaultValue:\"up\"},font:{type:ControlType.Object,controls:{fontFace:{type:ControlType.String,defaultValue:\"Inter\"},size:{type:ControlType.Number,defaultValue:30},color:{type:ControlType.Color,defaultValue:\"#fff\"},weight:{type:ControlType.Enum,defaultValue:\"bold\",options:[\"normal\",\"bold\",\"bolder\",\"lighter\"]}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter200\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"iPAAiM,SAAS,EAAQ,CAAC,QAAM,YAAU,SAAO,CAAC,IAAM,EAAIA,EAAO,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