{"version":3,"file":"Counter.BK1krwP4.mjs","names":["Counter","_Fragment","_Fragment"],"sources":["https:/framerusercontent.com/modules/42c5EEhTQMNoOnUbGzus/wjQg3V5l3BRxN1vZXDBD/Counter.js","https:/framerusercontent.com/modules/D4LFEeuRdPuZIm5Uso34/rFImeFLsCFi6d6ctDp4c/Counter.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useInView,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter({decimal,value,decimalValue,direction,stiffness,damping,prefix,prefixText,suffix,suffixText,color,fontStyle}){const initialValue=10;const ref=useRef(null);const updatedDecimalValue=decimal===true?decimalValue:value;const motionValue=useMotionValue(direction===\"down\"?updatedDecimalValue:initialValue);const springValue=useSpring(motionValue,{damping:damping,stiffness:stiffness});const isInView=useInView(ref,{once:true,margin:\"-100px\"});useEffect(()=>{if(isInView){motionValue.set(direction===\"down\"?initialValue:updatedDecimalValue);}},[motionValue,isInView]);useEffect(()=>springValue.on(\"change\",latest=>{if(ref.current){ref.current.textContent=Intl.NumberFormat(\"en-US\").format(latest.toFixed(decimal===true?2:0));}}),[springValue]);return /*#__PURE__*/_jsxs(_Fragment,{children:[prefix?/*#__PURE__*/_jsx(\"span\",{style:{...fontStyle,color:color},children:prefixText}):null,/*#__PURE__*/_jsx(\"span\",{ref:ref,style:{...fontStyle,color:color},children:initialValue}),suffix?/*#__PURE__*/_jsx(\"span\",{style:{...fontStyle,color:color},children:suffixText}):null]});}Counter.defaultProps={decimal:false,value:100,decimalValue:100,direction:\"up\",stiffness:200,damping:50,prefix:false,prefixText:\"\",suffix:false,suffixText:\"\",color:\"#000000\",fontStyle:\"\"};addPropertyControls(Counter,{decimal:{title:\"Decimal\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},value:{title:\"Value\",type:ControlType.Number,min:0,max:1e3,hidden(props){return props.decimal===true;}},decimalValue:{title:\"Value\",type:ControlType.Number,min:0,max:1e3,step:.01,hidden(props){return props.decimal===false;}},prefix:{title:\"Prefix\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},prefixText:{title:\"Prefix Value\",type:ControlType.String,hidden(props){return props.prefix===false;}},suffix:{title:\"Suffix\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},suffixText:{title:\"Suffix Value\",type:ControlType.String,hidden(props){return props.suffix===false;}},direction:{title:\"Direction\",type:ControlType.Enum,options:[\"up\",\"down\"]},stiffness:{title:\"Stiffness\",type:ControlType.Number,min:1,max:1e3},damping:{title:\"Damping\",type:ControlType.Number,min:0,max:100},color:{title:\"Color\",type:ControlType.Color},fontStyle:{title:\"Font Style\",type:\"font\",controls:\"extended\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map","// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useInView,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter({decimal,value,decimalValue,direction,stiffness,damping,prefix,prefixText,suffix,suffixText,color,fontStyle}){const initialValue=10;const ref=useRef(null);const updatedDecimalValue=decimal===true?decimalValue:value;const motionValue=useMotionValue(direction===\"down\"?updatedDecimalValue:initialValue);const springValue=useSpring(motionValue,{damping:damping,stiffness:stiffness});const isInView=useInView(ref,{once:true,margin:\"-100px\"});useEffect(()=>{if(isInView){motionValue.set(direction===\"down\"?initialValue:updatedDecimalValue);}},[motionValue,isInView]);useEffect(()=>springValue.on(\"change\",latest=>{if(ref.current){ref.current.textContent=Intl.NumberFormat(\"en-US\").format(latest.toFixed(decimal===true?2:0));}}),[springValue]);return /*#__PURE__*/_jsxs(_Fragment,{children:[prefix?/*#__PURE__*/_jsx(\"span\",{style:{...fontStyle,color:color},children:prefixText}):null,/*#__PURE__*/_jsx(\"span\",{ref:ref,style:{...fontStyle,color:color},children:initialValue}),suffix?/*#__PURE__*/_jsx(\"span\",{style:{...fontStyle,color:color},children:suffixText}):null]});}Counter.defaultProps={decimal:false,value:100,decimalValue:100,direction:\"up\",stiffness:200,damping:50,prefix:false,prefixText:\"\",suffix:false,suffixText:\"\",color:\"#000000\",fontStyle:\"\"};addPropertyControls(Counter,{decimal:{title:\"Decimal\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},value:{title:\"Value\",type:ControlType.Number,min:0,max:1e3,hidden(props){return props.decimal===true;}},decimalValue:{title:\"Value\",type:ControlType.Number,min:0,max:1e3,step:.01,hidden(props){return props.decimal===false;}},prefix:{title:\"Prefix\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},prefixText:{title:\"Prefix Value\",type:ControlType.String,hidden(props){return props.prefix===false;}},suffix:{title:\"Suffix\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},suffixText:{title:\"Suffix Value\",type:ControlType.String,hidden(props){return props.suffix===false;}},direction:{title:\"Direction\",type:ControlType.Enum,options:[\"up\",\"down\"]},stiffness:{title:\"Stiffness\",type:ControlType.Number,min:1,max:1e3},damping:{title:\"Damping\",type:ControlType.Number,min:0,max:100},color:{title:\"Color\",type:ControlType.Color},fontStyle:{title:\"Font Style\",type:\"font\",controls:\"extended\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"8YAQG,SAAwBA,EAAQ,CAAC,UAAQ,QAAM,eAAa,YAAU,YAAU,UAAQ,SAAO,aAAW,SAAO,aAAW,QAAM,YAAU,CAAC,CAAC,IAAM,EAAa,GAAS,EAAI,EAAO,KAAK,CAAO,EAAoB,KAAU,EAAK,EAAa,EAAY,EAAY,EAAe,IAAY,OAAO,EAAoB,EAAa,CAAO,EAAY,EAAU,EAAY,CAAS,UAAkB,WAAU,EAAC,CAAO,EAAS,EAAU,EAAI,CAAC,MAAK,EAAK,OAAO,QAAS,EAAC,CAA6S,MAA5S,GAAU,IAAI,CAAC,AAAG,GAAU,EAAY,IAAI,IAAY,OAAO,EAAa,EAAoB,AAAG,EAAC,CAAC,EAAY,CAAS,EAAC,CAAC,EAAU,IAAI,EAAY,GAAG,SAAS,GAAQ,CAAC,AAAG,EAAI,UAAS,EAAI,QAAQ,YAAY,KAAK,aAAa,QAAQ,CAAC,OAAO,EAAO,QAAQ,KAAU,EAAK,EAAE,EAAE,CAAC,CAAG,EAAC,CAAC,CAAC,CAAY,EAAC,CAAqB,EAAME,EAAU,CAAC,SAAS,CAAC,EAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAgB,OAAM,EAAC,SAAS,CAAW,EAAC,CAAC,KAAkB,EAAK,OAAO,CAAK,MAAI,MAAM,CAAC,GAAG,EAAgB,OAAM,EAAC,SAAS,CAAa,EAAC,CAAC,EAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAgB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