{"version":3,"file":"Counter.Doa_3PSz.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/ITNi6g59fs4M1mUeWqM6/iMu2A3nWVgT4wkr50QBy/Counter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{animate,motion,useMotionValue,useInView}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export function AnimatedNumber(props){const{initial,end,duration,prefix,suffix,numberFont,affixFont,colorFuente}=props;const ref=React.useRef(null);const isInView=useInView(ref,{amount:.6,once:true});const count=useMotionValue(initial);const[display,setDisplay]=React.useState(initial);React.useEffect(()=>{const unsubscribe=count.on(\"change\",v=>setDisplay(Math.round(v)));return unsubscribe;},[count]);React.useEffect(()=>{if(isInView){animate(count,end,{duration});}},[isInView,end,duration,count]);return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{display:\"inline-flex\",alignItems:\"baseline\",color:colorFuente},children:[prefix&&/*#__PURE__*/_jsx(\"span\",{style:{...affixFont,marginRight:4},children:prefix}),/*#__PURE__*/_jsx(motion.span,{style:{...numberFont},children:display}),suffix&&/*#__PURE__*/_jsx(\"span\",{style:{...affixFont,marginLeft:0},children:suffix})]});}AnimatedNumber.defaultProps={initial:0,end:100,duration:2,prefix:\"\",suffix:\"\",numberFont:{fontFamily:'\"Exposure[-20] Regular\", \"Exposure[-20] Regular Placeholder\", sans-serif',fontSize:48,fontWeight:400,lineHeight:\"1em\",letterSpacing:\"0em\"},affixFont:{fontFamily:'\"Exposure[-20] Regular\", \"Exposure[-20] Regular Placeholder\", sans-serif',fontSize:24,fontWeight:400,lineHeight:\"1em\",letterSpacing:\"0em\"},colorFuente:\"#2B2B2B\"};addPropertyControls(AnimatedNumber,{initial:{type:ControlType.Number,title:\"Inicial\",defaultValue:0},end:{type:ControlType.Number,title:\"Final\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duraci\\xf3n\",defaultValue:2,min:0,step:.1},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},numberFont:{type:ControlType.Font,title:\"Font #\",controls:\"extended\",defaultValue:{fontFamily:'\"Exposure[-20] Regular\", \"Exposure[-20] Regular Placeholder\", sans-serif',fontSize:48,fontWeight:400,lineHeight:\"1em\",letterSpacing:\"0em\"}},affixFont:{type:ControlType.Font,title:\"Font Afijo\",controls:\"extended\",defaultValue:{fontFamily:'\"Exposure[-20] Regular\", \"Exposure[-20] Regular Placeholder\", sans-serif',fontSize:24,fontWeight:400,lineHeight:\"1em\",letterSpacing:\"0em\"}},colorFuente:{type:ControlType.Color,title:\"Color\",defaultValue:\"#2B2B2B\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"AnimatedNumber\":{\"type\":\"reactComponent\",\"name\":\"AnimatedNumber\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"gQAA4M,SAAgB,EAAe,EAAM,CAAC,GAAK,CAAC,UAAQ,MAAI,WAAS,SAAO,SAAO,aAAW,YAAU,eAAa,EAAY,EAAIA,EAAa,IAAI,EAAQ,EAAS,EAAU,EAAI,CAAC,OAAO,GAAG,KAAK,EAAI,CAAC,EAAQ,EAAM,EAAe,CAAO,EAAO,CAAC,EAAQ,GAAYC,EAAe,CAAO,EAAyN,OAAvN,MAAuC,EAAM,GAAG,SAAS,GAAG,EAAW,KAAK,MAAM,CAAC,CAAC,CAAoB,EAAI,CAAC,CAAK,CAAC,EAAE,MAAoB,CAAI,GAAU,EAAQ,EAAM,EAAI,CAAC,UAAQ,CAAC,CAAG,EAAE,CAAC,EAAS,EAAI,EAAS,CAAK,CAAC,EAAsB,EAAM,MAAM,CAAK,MAAI,MAAM,CAAC,QAAQ,cAAc,WAAW,WAAW,MAAM,CAAW,EAAE,SAAS,CAAC,GAAqB,EAAK,OAAO,CAAC,MAAM,CAAC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