{"version":3,"file":"NumberCounter_2.BZcMminF.mjs","names":["useRef","useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/sQWa0wrgXPPTbnQSaVgt/POorFUI4Zt23kBeFNLek/kQZT5Ce_d.js","https:/framerusercontent.com/modules/45VZC3P9ClZrmXS4c2aE/RiBJiabHMkAgw1UAZIwG/NumberCounter_2.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\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 10.5 5.5 L 5.25 0 L 0 5.5\" fill=\"transparent\" height=\"5.5px\" id=\"nJPnMruC9\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1335ju, 1.5)\" stroke=\"var(--18mrqx2, rgb(0, 0, 0))\" transform=\"translate(6.75 4.75)\" width=\"10.5px\"/><path d=\"M 0 13.5 L 0 0\" fill=\"transparent\" height=\"13.5px\" id=\"ElaVP7FBq\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1335ju, 1.5)\" stroke=\"var(--18mrqx2, rgb(0, 0, 0))\" transform=\"translate(12 5.75)\" width=\"1px\"/></svg>';const getProps=({dots,height,id,stroke,width,width1,...props})=>{return{...props,BKVe8Pgvw:dots??props.BKVe8Pgvw??1,fICyAUQY1:stroke??props.fICyAUQY1??\"rgb(0, 0, 0)\",lKf_CQTz5:width1??props.lKf_CQTz5??1.5};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,fICyAUQY1,lKf_CQTz5,BKVe8Pgvw,...restProps}=getProps(props);const href=useSVGTemplate(\"2021499928\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-qtWV2\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1335ju\":lKf_CQTz5,\"--18mrqx2\":fICyAUQY1,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-qtWV2 { -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 {\"fICyAUQY1\":\"stroke\",\"lKf_CQTz5\":\"width1\",\"BKVe8Pgvw\":\"dots\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Up\",\"color\":{\"type\":\"variable\",\"value\":\"18mrqx2\"},\"set\":{\"localId\":\"vectorSet/SuYHhKUZG\",\"id\":\"SuYHhKUZG\",\"moduleId\":\"EqX8thWQjdZcOB1c6p5N\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-qtWV2\");Icon.displayName=\"Arrow Up\";export default Icon;addPropertyControls(Icon,{fICyAUQY1:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color},lKf_CQTz5:{defaultValue:1.5,displayStepper:true,hidden:false,max:4,min:0,step:.5,title:\"Width\",type:ControlType.Number},BKVe8Pgvw:{defaultValue:1,displayStepper:true,hidden:true,max:4,min:1,title:\"Dots\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"fICyAUQY1\\\":\\\"stroke\\\",\\\"lKf_CQTz5\\\":\\\"width1\\\",\\\"BKVe8Pgvw\\\":\\\"dots\\\"}\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"24\",\"framerDisableUnlink\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Up\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"18mrqx2\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/SuYHhKUZG\\\",\\\"id\\\":\\\"SuYHhKUZG\\\",\\\"moduleId\\\":\\\"EqX8thWQjdZcOB1c6p5N\\\"}}\",\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Number Counter component with animated counting, customizable duration, delay, decimals, easing, font, alignment, color, suffix, auto-start, looping, reset on re-entry, and content-based sizing\nimport{jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,useCallback,useMemo}from\"react\";import{addPropertyControls,ControlType,useInView,useIsStaticRenderer,RenderTarget}from\"framer\";const easings={linear:t=>t,easeIn:t=>t*t,easeOut:t=>t*(2-t),easeInOut:t=>t<.5?2*t*t:-1+(4-2*t)*t};function formatNumber(value,decimals){return value.toLocaleString(undefined,{minimumFractionDigits:decimals,maximumFractionDigits:decimals});}/**\n * Number Counter\n *\n * @framerIntrinsicWidth 180\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function NumberCounter(props){const{start=0,end=100,duration=1.5,delay=0,decimals=0,easing=\"easeOut\",font,color,align,autoStart,loop,resetOnReentry,suffix,style}=props;const isStatic=useIsStaticRenderer();const ref=useRef(null);const inView=useInView(ref,{once:!loop&&!resetOnReentry});const[displayValue,setDisplayValue]=useState(start);const[isCounting,setIsCounting]=useState(false);const[iteration,setIteration]=useState(0);const timeoutRef=useRef(null);const rafRef=useRef(null);const runCount=useCallback(()=>{if(isStatic||RenderTarget.current()===RenderTarget.thumbnail){setDisplayValue(end);return;}let startTime=null;let frameId=null;function animate(ts){if(!startTime)startTime=ts;const elapsed=(ts-startTime)/1e3;let t=Math.min(1,Math.max(0,elapsed/duration));const ease=easings[easing]||easings.easeOut;const value=start+(end-start)*ease(t);setDisplayValue(t<1?value:end);if(t<1){frameId=requestAnimationFrame(animate);rafRef.current=frameId;}else if(loop){timeoutRef.current=setTimeout(()=>{setDisplayValue(start);setIteration(i=>i+1);},300);}}if(delay>0){timeoutRef.current=setTimeout(()=>{setDisplayValue(start);frameId=requestAnimationFrame(animate);rafRef.current=frameId;},delay*1e3);}else{setDisplayValue(start);frameId=requestAnimationFrame(animate);rafRef.current=frameId;}},[start,end,duration,delay,easing,loop,isStatic]);// Start animation on inView\nuseEffect(()=>{if(!autoStart)return;if(inView){setIsCounting(true);}else if(resetOnReentry){setIsCounting(false);setDisplayValue(start);}},[inView,autoStart,resetOnReentry,start]);// Run animation when isCounting or iteration changes\nuseEffect(()=>{if(!isCounting)return;runCount();return()=>{if(rafRef.current)cancelAnimationFrame(rafRef.current);if(timeoutRef.current)clearTimeout(timeoutRef.current);};},[isCounting,iteration,runCount]);// Manual trigger\nconst handleClick=()=>{if(!autoStart){setIsCounting(true);}};// Sizing\nconst containerStyle=useMemo(()=>({...style,display:\"inline-block\",width:style&&style.width===\"100%\"?\"100%\":\"max-content\",height:style&&style.height===\"100%\"?\"100%\":\"max-content\",textAlign:align,color,...font,cursor:autoStart?\"default\":\"pointer\",userSelect:\"none\"}),[style,align,color,font,autoStart]);return /*#__PURE__*/_jsxs(\"span\",{ref:ref,style:containerStyle,\"aria-live\":\"polite\",tabIndex:0,onClick:handleClick,children:[formatNumber(displayValue,decimals),suffix]});}addPropertyControls(NumberCounter,{start:{type:ControlType.Number,title:\"Start\",defaultValue:0},end:{type:ControlType.Number,title:\"End\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1.5,min:.1,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:5,step:.1,unit:\"s\"},decimals:{type:ControlType.Number,title:\"Decimals\",defaultValue:0,min:0,max:6,step:1,displayStepper:true},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\"],defaultValue:\"easeOut\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"%\"},autoStart:{type:ControlType.Boolean,title:\"Auto Start\",defaultValue:true,enabledTitle:\"Auto\",disabledTitle:\"Manual\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"Loop\",disabledTitle:\"Once\"},resetOnReentry:{type:ControlType.Boolean,title:\"Reset on Re-entry\",defaultValue:false,enabledTitle:\"Reset\",disabledTitle:\"No Reset\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NumberCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicWidth\":\"180\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"60\",\"framerContractVersion\":\"1\"}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