{"version":3,"file":"AnimatedNumberCounter_Prod.DoT7_P14.mjs","names":["React.forwardRef","useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/evRSjXQjugi7cvVXPVth/My2lJlNokJ5queD1qDmL/DsvY2Y6oS.js","https:/framerusercontent.com/modules/qpjhCcDm4G1NbFAlpMKV/OnyZiTlIjOBuSKcKQWFv/AnimatedNumberCounter_Prod.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 16 8 L 14.59 6.59 L 9 12.17 L 9 0 L 7 0 L 7 12.17 L 1.42 6.58 L 0 8 L 8 16 Z\" fill=\"var(--esondr, rgb(0,0,0))\" height=\"16px\" id=\"uR80kQ715\" transform=\"translate(4 4)\" width=\"16px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({fill,height,id,width,...props})=>{return{...props,K5AAorpEW:fill??props.K5AAorpEW??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,K5AAorpEW,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-kk8TD\",className),layoutId:layoutId,ref:ref,style:{\"--esondr\":K5AAorpEW,...style}});});const css=[`.framer-kk8TD { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--esondr); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"K5AAorpEW\":\"fill\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Downward\",\"color\":{\"type\":\"variable\",\"value\":\"esondr\"},\"set\":{\"localId\":\"vectorSet/DnLsXE00W\",\"id\":\"DnLsXE00W\",\"moduleId\":\"JIScivAkNLgXrcOUxHXD\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-kk8TD\");Icon.displayName=\"Arrow Downward\";export default Icon;addPropertyControls(Icon,{K5AAorpEW:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Fill\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Downward\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"esondr\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/DnLsXE00W\\\",\\\"id\\\":\\\"DnLsXE00W\\\",\\\"moduleId\\\":\\\"JIScivAkNLgXrcOUxHXD\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerIntrinsicWidth\":\"24\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"K5AAorpEW\\\":\\\"fill\\\"}\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState,useRef}from\"react\";import{motion,useMotionValue,animate,useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n *\n * @framerDisableUnlink\n */export default function AnimatedNumberCounter(props){const{mode,start,end,value,decimals,commas,color,animation}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const Tag=props.tag;const MotionTag=motion[props.tag];const isDefault=mode==\"default\";const initialValue=isDefault?start:value;const transition=isDefault?animation.transition:props.transition;const formatNumber=number=>{let numberString=number.toFixed(decimals);if(commas){numberString=numberString.replace(/\\B(?=(\\d{3})+(?!\\d))/g,\",\");}return numberString;};const[number,setNumber]=useState(initialValue);const[finalValue,setFinalValue]=useState(number);const[currentAnimation,setCurrentAnimation]=useState(null);const ref=useRef(null);const isInView=useInView(ref,{once:!props.animation.replay,amount:\"some\"});const motionValue=useMotionValue(value);const runAnimation=(from,to)=>{if(!isCanvas){if(currentAnimation){currentAnimation.stop();}setFinalValue(to);setCurrentAnimation(animate(from,to,{...transition,onUpdate:latest=>{setNumber(latest);}}));}};useEffect(()=>{if(isDefault&&animation.trigger==\"appear\"){runAnimation(start,end);}},[]);useEffect(()=>{if(isDefault&&animation.trigger==\"layerInView\"){if(isInView){runAnimation(start,end);}else{if(currentAnimation){currentAnimation.stop();}setNumber(start);}}},[isInView]);useEffect(()=>{if(!isDefault){runAnimation(number,value);}},[value]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(Tag,{style:{...props.style,margin:0,opacity:0,pointerEvents:\"none\",userSelect:\"none\",textWrap:props.balance?\"balance\":undefined,fontVariantNumeric:props.monospace?\"tabular-nums\":undefined,textAlign:\"center\",...props.font},children:[props.prefix,formatNumber(isCanvas?initialValue:finalValue),props.suffix]}),/*#__PURE__*/_jsxs(MotionTag,{ref:ref,style:{position:\"absolute\",inset:0,userSelect:props.userSelect?\"auto\":\"none\",fontVariantNumeric:props.monospace?\"tabular-nums\":undefined,margin:0,...color.mode==\"solid\"?{color:color.color}:{WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundImage:`linear-gradient(${color.angle}deg, ${color.startColor}, ${color.endColor})`},textDecoration:props.decoration,textWrap:props.balance?\"balance\":undefined,textAlign:\"center\",...props.font,...props.style},children:[props.prefix,formatNumber(isCanvas?initialValue:number),props.suffix]})]});}AnimatedNumberCounter.displayName=\"Animated Number Counter\";addPropertyControls(AnimatedNumberCounter,{mode:{type:ControlType.Enum,options:[\"default\",\"variants\"],optionTitles:[\"Default\",\"Variants\"],displaySegmentedControl:true},value:{type:ControlType.Number,defaultValue:0,hidden:props=>props.mode!==\"variants\"},start:{type:ControlType.Number,defaultValue:0,hidden:props=>props.mode!==\"default\"},end:{type:ControlType.Number,defaultValue:100,hidden:props=>props.mode!==\"default\"},animation:{type:ControlType.Object,icon:\"effect\",hidden:props=>props.mode!==\"default\",controls:{trigger:{type:ControlType.Enum,defaultValue:\"layerInView\",options:[\"appear\",\"layerInView\"],optionTitles:[\"Appear\",\"Layer in View\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},replay:{type:ControlType.Boolean,defaultValue:true,hidden(props){return props.trigger!==\"layerInView\";}},transition:{type:ControlType.Transition,defaultValue:{type:\"spring\",duration:1,bounce:0}}}},transition:{type:ControlType.Transition,defaultValue:{type:\"spring\",duration:1,bounce:0},hidden:props=>props.mode!==\"variants\"},decimals:{type:ControlType.Enum,defaultValue:0,options:[0,1,2,3],optionTitles:[\"Off\",\"1\",\"2\",\"3\"],displaySegmentedControl:true},commas:{type:ControlType.Boolean,defaultValue:true},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1}},color:{type:ControlType.Object,controls:{mode:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],displaySegmentedControl:true},color:{type:ControlType.Color,defaultValue:\"#000\",hidden:props=>props.mode!==\"solid\"},startColor:{type:ControlType.Color,defaultValue:\"#000\",hidden:props=>props.mode!==\"gradient\"},endColor:{type:ControlType.Color,defaultValue:\"#FFF\",hidden:props=>props.mode!==\"gradient\"},angle:{type:ControlType.Number,defaultValue:180,min:-360,max:360,unit:\"\\xb0\",hidden:props=>props.mode!==\"gradient\"}}},prefix:{type:ControlType.String,placeholder:\"Prefix\"},suffix:{type:ControlType.String,placeholder:\"Suffix\"},decoration:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"underline\",\"line-through\"],optionTitles:[\"None\",\"Underline\",\"Strikethrough\"]},balance:{type:ControlType.Boolean,defaultValue:false},userSelect:{type:ControlType.Boolean,defaultValue:true},tag:{type:ControlType.Enum,defaultValue:\"p\",displaySegmentedControl:true,options:[\"h1\",\"h2\",\"h3\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"P\"]},monospace:{type:ControlType.Boolean,defaultValue:false,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedNumberCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedNumberCounter_Prod.map"],"mappings":"iUAC0C,IAAsE,IAA4B,EAAqC,EAAK,kaAA0a,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAO,IAAI,CAAC,GAAG,EAAc,WAAa,KAAG,CAAC,EAAe,EAAK,MAAM,CAAC,GAAG,EAAS,KAAG,CAAC,CAAE,CAAC,EAAQ,GAAU,CAAC,OAAK,SAAO,KAAG,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAM,EAAM,WAAW,cAAc,GAUn6B,EAAK,EAV+7BA,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,GA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