{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/g1H4g2g9dEvvQgub2w2k/p1jD6Nom0euk107Psucb/Counter.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export function Counter({start=0,end=100,speed=400,gapSize=4,prefixText=\"\",suffixText=\"\",prefixFont,suffixFont,prefixColor,suffixColor,loop=false,decimalSeparatorType=\"comma\",textSize=36,selectedFont={fontFamily:\"Inter\",fontWeight:500,systemFont:true},textColor=\"#D3D3D3\",startOnViewport=false,restartOnViewport=false,incrementType=\"integer\"}){const[count,setCount]=useState(start);const[isVisible,setIsVisible]=useState(false);const containerRef=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{setIsVisible(entry.isIntersecting);});if(containerRef.current)observer.observe(containerRef.current);return()=>observer.disconnect();},[]);useEffect(()=>{if(!(isVisible||!startOnViewport)||start===end)return;const increment=incrementType===\"integer\"?1:.1;const intervalId=setInterval(()=>{setCount(prev=>prev+increment>=end?end:parseFloat((prev+increment).toFixed(2)));},speed);return()=>clearInterval(intervalId);},[isVisible,start,end,speed,startOnViewport,incrementType]);useEffect(()=>{if(restartOnViewport&&isVisible)setCount(start);},[isVisible,restartOnViewport,start]);const formatNumber=number=>{if(decimalSeparatorType===\"comma\")return number.toLocaleString(\"en-US\");if(decimalSeparatorType===\"period\")return number.toLocaleString(\"en-US\").replace(/,/g,\".\");return number.toFixed(incrementType===\"integer\"?0:1);};return /*#__PURE__*/_jsxs(motion.div,{ref:containerRef,style:{display:\"flex\",gap:`${gapSize}px`,alignItems:\"center\",fontSize:`${textSize}px`,fontFamily:selectedFont.fontFamily,fontWeight:selectedFont.fontWeight,color:textColor,letterSpacing:\"-0.07em\"},children:[prefixText&&/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:prefixFont?.fontFamily,fontWeight:prefixFont?.fontWeight,color:prefixColor},children:prefixText}),/*#__PURE__*/_jsx(\"span\",{children:formatNumber(count)}),suffixText&&/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:suffixFont?.fontFamily,fontWeight:suffixFont?.fontWeight,color:suffixColor},children:suffixText})]});}addPropertyControls(Counter,{startOnViewport:{type:ControlType.Boolean,title:\"Viewport\",defaultValue:false},restartOnViewport:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false},selectedFont:{title:\"Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Inter\",fontWeight:500,systemFont:true}},textSize:{title:\"Font Size\",type:ControlType.Number,min:8,max:240,step:1},textColor:{type:ControlType.Color,title:\"Font Color\"},start:{type:ControlType.Number,title:\"Start Number\",defaultValue:0},end:{type:ControlType.Number,title:\"End Number\",defaultValue:10},decimalSeparatorType:{type:ControlType.Enum,title:\"Separator\",defaultValue:\"comma\",options:[\"comma\",\"period\",\"none\"]},incrementType:{type:ControlType.Enum,title:\"Increment Type\",defaultValue:\"integer\",options:[\"integer\",\"decimal\"]},prefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},prefixFont:{title:\"Prefix Font\",type:ControlType.Font},prefixColor:{type:ControlType.Color,title:\"Prefix Color\"},suffixText:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},suffixFont:{title:\"Suffix Font\",type:ControlType.Font},suffixColor:{type:ControlType.Color,title:\"Suffix Color\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:4,min:0,max:100},speed:{type:ControlType.Number,title:\"Speed (ms)\",defaultValue:100,min:0,max:2e3},loop:{type:ControlType.Boolean,title:\"Loop Animation\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"Counter\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],
  "mappings": "0FAAmM,SAASA,EAAQ,CAAC,MAAAC,EAA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AY,aAAa,QAAQ,QAAQ,CAAC,QAAQ,SAAS,MAAM,CAAC,EAAE,cAAc,CAAC,KAAKA,EAAY,KAAK,MAAM,iBAAiB,aAAa,UAAU,QAAQ,CAAC,UAAU,SAAS,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,SAAS,aAAa,EAAE,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,IAAI,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,SAAS,aAAa,EAAE,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,IAAI,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,MAAM,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,aAAa,IAAI,IAAI,EAAE,IAAI,GAAG,EAAE,KAAK,CAAC,KAAKA,EAAY,QAAQ,MAAM,iBAAiB,aAAa,EAAK,CAAC,CAAC",
  "names": ["Counter", "start", "end", "speed", "gapSize", "prefixText", "suffixText", "prefixFont", "suffixFont", "prefixColor", "suffixColor", "loop", "decimalSeparatorType", "textSize", "selectedFont", "textColor", "startOnViewport", "restartOnViewport", "incrementType", "count", "setCount", "ye", "isVisible", "setIsVisible", "containerRef", "pe", "ue", "observer", "entry", "increment", "intervalId", "prev", "formatNumber", "number", "u", "motion", "p", "addPropertyControls", "ControlType"]
}
