{"version":3,"file":"AnimatedNumberCounter_Prod.B1DGghXA.mjs","names":["number","useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/bxJ1nzM09ruoC0fpeOy7/kaMBp8j8XGjdSgBeSSfm/ftC2zyy7U.js","https:/framerusercontent.com/modules/qpjhCcDm4G1NbFAlpMKV/OnyZiTlIjOBuSKcKQWFv/AnimatedNumberCounter_Prod.js"],"sourcesContent":["// Generated by Framer (44e0108)\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 32 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 25.411 2.374 C 22.264 2.374 17.819 2.641 15.547 4.949 C 14.564 5.948 14.073 7.578 14.2 9.422 C 14.217 9.666 14.376 9.874 14.605 9.95 C 14.833 10.026 15.083 9.955 15.239 9.769 C 16.503 8.258 18.073 7.048 19.91 6.17 C 20.066 6.095 20.25 6.089 20.418 6.149 C 20.565 6.203 20.681 6.305 20.741 6.436 C 20.866 6.704 20.826 7.058 20.411 7.258 C 20.387 7.27 20.366 7.285 20.342 7.296 C 20.334 7.3 20.324 7.298 20.317 7.302 C 15.791 9.464 13.565 13.237 12.554 17.117 C 11.818 12.259 10.261 9.4 8.791 7.644 C 7.728 6.242 6.682 5.5 6.077 5.08 C 5.965 5.002 5.626 4.766 5.486 4.624 C 5.255 4.39 5.255 4.009 5.486 3.775 C 5.716 3.542 6.091 3.542 6.347 3.802 C 6.41 3.858 6.51 3.93 6.638 4.016 L 6.743 4.088 C 7.598 4.684 9.189 5.789 10.601 8.168 C 10.728 8.381 10.972 8.495 11.21 8.449 C 11.45 8.406 11.639 8.218 11.687 7.974 C 11.995 6.374 11.857 4.001 10.453 2.574 C 8.181 0.268 3.736 0 0.59 0 C 0.264 0 0 0.269 0 0.6 C 0 3.798 0.263 8.316 2.534 10.625 C 3.481 11.587 4.941 12.019 6.392 12.019 C 7.576 12.019 8.737 11.718 9.626 11.196 C 10.839 13.75 11.807 17.564 11.807 23.4 C 11.807 23.731 12.071 24 12.397 24 C 12.723 24 12.988 23.731 12.988 23.4 C 12.988 20.144 13.537 16.237 15.578 13.021 C 16.396 13.834 17.805 14.348 19.366 14.396 C 19.444 14.399 19.52 14.4 19.597 14.4 C 21.183 14.4 22.584 13.895 23.466 12.997 C 25.738 10.688 26 6.17 26 2.972 C 26.001 2.641 25.738 2.374 25.411 2.374 Z\" fill=\"var(--13akixh, var(--token-2e8a2c5a-0ee2-4c52-b875-15f087ba5b2a, rgb(169, 255, 202)))\" height=\"24px\" id=\"DZxOrNIaU\" transform=\"translate(3 5)\" width=\"26px\"/></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,HN2e6vyV0:fill??props.HN2e6vyV0??\"var(--token-2e8a2c5a-0ee2-4c52-b875-15f087ba5b2a, rgb(169, 255, 202))\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,HN2e6vyV0,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-SuqfW\",className),layoutId:layoutId,ref:ref,style:{\"--13akixh\":HN2e6vyV0,...style}});});const css=[`.framer-SuqfW { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--13akixh); mask: ${mask}; width: 32px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 32\n * @framerIntrinsicHeight 32\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"HN2e6vyV0\":\"fill\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"4\",\"color\":{\"type\":\"variable\",\"value\":\"13akixh\"},\"set\":{\"localId\":\"vectorSet/TctKtossK\",\"id\":\"TctKtossK\",\"moduleId\":\"EwUVH6BVyTNjYzGUDxpY\"}}\n */const Icon=withCSS(Component,css,\"framer-SuqfW\");Icon.displayName=\"4\";export default Icon;addPropertyControls(Icon,{HN2e6vyV0:{defaultValue:'var(--token-2e8a2c5a-0ee2-4c52-b875-15f087ba5b2a, rgb(169, 255, 202)) /* {\"name\":\"Lime\"} */',hidden:false,title:\"Fill\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"HN2e6vyV0\\\":\\\"fill\\\"}\",\"framerIntrinsicHeight\":\"32\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"4\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"13akixh\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/TctKtossK\\\",\\\"id\\\":\\\"TctKtossK\\\",\\\"moduleId\\\":\\\"EwUVH6BVyTNjYzGUDxpY\\\"}}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"32\",\"framerContractVersion\":\"1\"}},\"__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":"oUAC2C,IAAsE,IAA4B,CAAoC,EAAK,yvDAAiwD,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAO,IAAI,CAAC,GAAG,EAAc,WAAa,MAAI,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAI,CAAC,EAAG,CAAO,GAAU,CAAC,OAAK,SAAO,KAAG,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAM,EAAM,WAAW,wEAAwE,EASpzE,EAAK,EAT+0E,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,GAAG,GAAW,EAAS,EAAM,CAAC,OAAoB,EAAK,EAAI,CAAC,GAAG,EAAU,UAAU,EAAG,eAAe,EAAU,CAAU,WAAa,MAAI,MAAM,CAAC,YAA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