{"version":3,"file":"NumberCounter.CeWmB3L_.mjs","names":["React.forwardRef","useRef","useState"],"sources":["https:/framerusercontent.com/modules/ZdCXP8zCFdPQtxT2ggPs/GpHnJqir5UFFKRRjwhc4/ILqo9lxa5.js","https:/framerusercontent.com/modules/g0T99GlAdGUcqHmxb3G4/DAHakSuXDGwYe1Wo1F8d/NumberCounter.js"],"sourcesContent":["// Generated by Framer (85eaff3)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 9.527 0.295 C 9.616 0.114 9.8 0 10.002 0 C 10.203 0 10.387 0.114 10.477 0.295 L 12.787 4.974 C 13.096 5.599 13.692 6.033 14.382 6.134 L 19.548 6.89 C 19.747 6.919 19.913 7.059 19.976 7.251 C 20.038 7.442 19.986 7.653 19.842 7.794 L 16.106 11.432 C 15.606 11.919 15.377 12.622 15.495 13.31 L 16.377 18.45 C 16.412 18.65 16.33 18.852 16.166 18.971 C 16.002 19.09 15.785 19.105 15.606 19.01 L 10.988 16.582 C 10.37 16.258 9.632 16.258 9.015 16.582 L 4.398 19.01 C 4.219 19.105 4.002 19.089 3.838 18.97 C 3.674 18.851 3.593 18.649 3.628 18.45 L 4.509 13.311 C 4.627 12.622 4.398 11.919 3.898 11.432 L 0.162 7.795 C 0.016 7.654 -0.037 7.443 0.026 7.25 C 0.088 7.057 0.255 6.917 0.456 6.889 L 5.621 6.134 C 6.312 6.033 6.909 5.6 7.218 4.974 Z\" fill=\"transparent\" height=\"19.072069999784322px\" id=\"OelI3erXH\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(1.998 2)\" width=\"20.001834564852647px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"4261812911\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-n8s1h\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-n8s1h { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; 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 {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Star\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-n8s1h\");Icon.displayName=\"Star\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerVector\":\"{\\\"name\\\":\\\"Star\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Number counter component with customizable prefix, suffix, separator, and animation\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";/**\n * Number Counter\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function NumberCounter(props){const{start=0,end=100,separator=\"comma\",incrementType=\"integer\",prefix=\"\",prefixFont,prefixColor=\"#000000\",suffix=\"\",suffixFont,suffixColor=\"#000000\",font,fontColor=\"#000000\",gapSize=0,speed=120,loopAnimation=false,replay=false}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const isInView=useInView(ref,{once:!loopAnimation&&!replay});const[displayValue,setDisplayValue]=useState(start);const rafRef=useRef(null);useEffect(()=>{if(isStatic){setDisplayValue(end);return;}if(rafRef.current)cancelAnimationFrame(rafRef.current);if(!isInView){if(loopAnimation||replay)setDisplayValue(start);return;}// speed range 10–300, mapped to duration 3000ms–100ms\nconst duration=Math.max(100,3200-speed*10);const startTime=performance.now();const range=end-start;const tick=now=>{const elapsed=now-startTime;const progress=Math.min(elapsed/duration,1);const current=start+range*progress;startTransition(()=>setDisplayValue(current));if(progress<1){rafRef.current=requestAnimationFrame(tick);}else{setDisplayValue(end);}};rafRef.current=requestAnimationFrame(tick);return()=>{if(rafRef.current)cancelAnimationFrame(rafRef.current);};},[isInView,end,start,speed,loopAnimation,replay,isStatic]);const formatNumber=value=>{let integerPart;let decimalPart;if(incrementType===\"integer\"){integerPart=Math.floor(value).toString();decimalPart=undefined;}else{// Detect decimal places from end value\nconst endStr=end.toString();const endDecimalPlaces=endStr.includes(\".\")?endStr.split(\".\")[1].length:0;const numStr=value.toFixed(endDecimalPlaces);[integerPart,decimalPart]=numStr.split(\".\");}// Choose separator characters for thousands and decimal parts\nlet thousandSep=\"\";let decimalSep=\".\";switch(separator){case\"comma\":thousandSep=\",\";decimalSep=\".\";break;case\"dot\":// European style: 1.234,56\nthousandSep=\".\";decimalSep=\",\";break;case\"space\":thousandSep=\" \";decimalSep=\".\";break;case\"none\":default:thousandSep=\"\";decimalSep=\".\";break;}const formattedInteger=thousandSep?integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g,thousandSep):integerPart;return decimalPart!==undefined?`${formattedInteger}${decimalSep}${decimalPart}`:formattedInteger;};const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{...props.style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:`${gapSize}px`,...!isFixedWidth&&{width:\"max-content\"},...!isFixedHeight&&{height:\"max-content\"}},children:[prefix&&/*#__PURE__*/_jsx(\"span\",{style:{...prefixFont,color:prefixColor},children:prefix}),/*#__PURE__*/_jsx(motion.span,{style:{...font,color:fontColor},children:formatNumber(displayValue)}),suffix&&/*#__PURE__*/_jsx(\"span\",{style:{...suffixFont,color:suffixColor},children:suffix})]});}addPropertyControls(NumberCounter,{replay:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"40px\",fontWeight:\"700\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},start:{type:ControlType.Number,title:\"Start\",defaultValue:0,step:.01},end:{type:ControlType.Number,title:\"End\",defaultValue:100,step:.01},separator:{type:ControlType.Enum,title:\"Separator\",options:[\"comma\",\"dot\",\"space\",\"none\"],optionTitles:[\"Comma\",\"Dot\",\"Space\",\"None\"],defaultValue:\"comma\"},incrementType:{type:ControlType.Enum,title:\"Increment Type\",options:[\"integer\",\"decimal\"],optionTitles:[\"Integer\",\"Decimal\"],defaultValue:\"integer\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},prefixFont:{type:ControlType.Font,title:\"Prefix Font\",defaultValue:{fontSize:\"40px\",fontWeight:\"700\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\",hidden:({prefix})=>!prefix||prefix.length===0},prefixColor:{type:ControlType.Color,title:\"Prefix Color\",defaultValue:\"#000000\",hidden:({prefix})=>!prefix||prefix.length===0},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},suffixFont:{type:ControlType.Font,title:\"Suffix Font\",defaultValue:{fontSize:\"40px\",fontWeight:\"700\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\",hidden:({suffix})=>!suffix||suffix.length===0},suffixColor:{type:ControlType.Color,title:\"Suffix Color\",defaultValue:\"#000000\",hidden:({suffix})=>!suffix||suffix.length===0},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:0,min:0,max:50,step:1,unit:\"px\"},speed:{type:ControlType.Number,title:\"Speed (%)\",defaultValue:120,min:10,max:300,step:10},loopAnimation:{type:ControlType.Boolean,title:\"Loop Animation\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NumberCounter\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"60\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NumberCounter.map"],"mappings":"kUAC0C,IAAqF,IAA4B,EAAqC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAU,EAAO,OAAO,CAAI,EAAQ,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,UAAQ,CAAC,EAAe,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,UAAQ,CAAC,CAAE,CAAC,EAAQ,EAAI,0lCAAgmC,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,EAAE,UAAU,GAAO,EAAM,WAAW,cAAc,GASt4D,EAAK,EATk6DA,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,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