{"version":3,"file":"ScrollToTopButton.CBLMritk.mjs","names":["useState","React"],"sources":["https:/framerusercontent.com/modules/VZsw10sworZWy7ZuD9Gc/3sJ4dIeG9FBKeJ2U3oMC/Counter.js","https:/framerusercontent.com/modules/rcQDSZUZ9bgF18XELleH/fqFoInTb1tgP5eIrgB88/ScrollToTopButton.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import React,{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const NumberCounterStyles={display:\"flex\",justifyContent:\"left\",alignItems:\"left\"};export function NumberCounter(props){const{startNumber,endNumber,speed,prefix,suffix,loop,decimalSeparator,fontSize,font,fontColor}=props;const[count,setCount]=useState(startNumber);const[isVisible,setIsVisible]=useState(false);const ref=React.useRef(null);useEffect(()=>{const observer=new IntersectionObserver(entries=>{const entry=entries[0];setIsVisible(entry.isIntersecting);});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[]);useEffect(()=>{if(isVisible&&startNumber!==endNumber){const intervalId=setInterval(()=>{if(count<endNumber){setCount(prevCount=>prevCount+1);}else if(loop){setCount(startNumber);}},speed);return()=>{clearInterval(intervalId);};}},[count,startNumber,endNumber,loop,isVisible]);const formatCount=number=>{if(decimalSeparator===\"comma\"){return number.toLocaleString(\"en-US\");}else if(decimalSeparator===\"period\"){return number.toLocaleString(\"en-US\").replace(/,/g,\".\");}else{return number.toFixed(0);}};return /*#__PURE__*/_jsxs(motion.div,{ref:ref,style:{...NumberCounterStyles,gap:`${fontSize/2}px`,flexDirection:\"row\",alignItems:\"left\",fontSize:`${fontSize}px`,fontFamily:font.fontFamily,fontWeight:font.fontWeight,color:fontColor},children:[prefix,formatCount(count),suffix]});}NumberCounter.defaultProps={startNumber:0,endNumber:10,speed:100,prefix:\"\",suffix:\"\",loop:false,decimalSeparator:\"comma\",fontSize:16,font:{fontFamily:\"Arial\",fontWeight:400,systemFont:true},fontColor:\"#707070\"};addPropertyControls(NumberCounter,{font:{title:\"Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Arial\",fontWeight:400,systemFont:true}},fontSize:{title:\"Font Size\",type:ControlType.Number,min:8,max:200,step:1},fontColor:{type:ControlType.Color,title:\"Font Color\"},startNumber:{type:ControlType.Number,title:\"Start Number\",defaultValue:0,displayStepper:true},endNumber:{type:ControlType.Number,title:\"End Number\",defaultValue:10,displayStepper:true},decimalSeparator:{type:ControlType.Enum,title:\"Decimal Separator\",defaultValue:\"comma\",options:[\"comma\",\"period\",\"none\"],optionTitles:[\"Comma (1,000)\",\"Period (1.000)\",\"None\"]},speed:{type:ControlType.Number,title:\"Speed (ms)\",defaultValue:100,min:0,max:1e3,step:10},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},loop:{type:ControlType.Boolean,title:\"Loop Animation\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"NumberCounter\":{\"type\":\"reactComponent\",\"name\":\"NumberCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{cloneElement}from\"react\";function scrollToTop(){if(window){window.scrollTo({top:0,behavior:\"smooth\"});}}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n */ export default function ScrollToTopButton(props){let button;if(props.buttonType==\"default\"){button=/*#__PURE__*/ _jsx(\"div\",{style:{width:props.buttonWidth,height:props.buttonHeight,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:props.fill,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,...props.style},onClick:scrollToTop,children:/*#__PURE__*/ _jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"none\",viewBox:\"0 0 24 24\",strokeWidth:props.icon.stroke,stroke:props.icon.color,\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",style:{width:props.icon.size,height:props.icon.size},children:[/*#__PURE__*/ _jsx(\"path\",{d:\"M12 5l0 14\"}),/*#__PURE__*/ _jsx(\"path\",{d:\"M18 11l-6 -6\"}),/*#__PURE__*/ _jsx(\"path\",{d:\"M6 11l6 -6\"})]})});}else{var ref,ref1,ref2;let layer=(ref=props.custom)===null||ref===void 0?void 0:ref[0];if(layer&&(((ref1=props.style)===null||ref1===void 0?void 0:ref1.width)||((ref2=props.style)===null||ref2===void 0?void 0:ref2.height))){layer=/*#__PURE__*/ cloneElement(layer,{style:{...layer.props.style,...props.style}});}button=/*#__PURE__*/ _jsx(\"div\",{onClick:scrollToTop,style:props.style,children:layer});}let layer1=button;if(props.effects){layer1=/*#__PURE__*/ _jsx(motion.div,{whileHover:{scale:props.effects.hoverScale},whileTap:{scale:props.effects.pressScale},initial:false,transition:props.effects.transition,style:props.style,children:button});}return layer1;};ScrollToTopButton.displayName=\"Scroll-to-Top Button\";const effectsDefault={hoverScale:1.1,pressScale:.9};addPropertyControls(ScrollToTopButton,{buttonType:{type:ControlType.Enum,defaultValue:\"default\",options:[\"default\",\"custom\"],optionTitles:[\"Default\",\"Custom\"],displaySegmentedControl:true,title:\"Button\"},custom:{type:ControlType.ComponentInstance,title:\"Custom\",description:\"Use a custom button layer.\",hidden(props){return props.buttonType!==\"custom\";}},fill:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true,hidden(props){return props.buttonType!==\"default\";}},icon:{type:ControlType.Object,controls:{color:{type:ControlType.Color,defaultValue:\"black\"},size:{type:ControlType.Number,defaultValue:24,min:1},stroke:{type:ControlType.Number,defaultValue:2,min:1,max:10,step:.1}},hidden(props){return props.buttonType!==\"default\";}},radius:{type:ControlType.FusedNumber,defaultValue:20,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusottomRight\",\"radiusBottomLeft\",],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0,hidden(props){return props.buttonType!==\"default\";}},effects:{type:ControlType.Object,defaultValue:effectsDefault,optional:true,buttonTitle:\"Hover & Press\",icon:\"effect\",controls:{hoverScale:{type:ControlType.Number,defaultValue:effectsDefault.hoverScale,min:0,step:.01,displayStepper:true},pressScale:{type:ControlType.Number,defaultValue:effectsDefault.pressScale,min:0,step:.01,displayStepper:true},transition:{type:ControlType.Transition}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTopButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopButton.map"],"mappings":"gQAAmQ,SAAgB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,YAAU,QAAM,SAAO,SAAO,OAAK,mBAAiB,WAAS,OAAK,aAAW,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAY,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAIC,EAAM,OAAO,KAAK,CAAC,MAAc,CAAC,IAAM,EAAS,IAAI,qBAAqB,GAAS,CAAC,IAAM,EAAM,EAAQ,GAAG,EAAa,EAAM,eAAe,EAAG,CAAgD,OAA5C,EAAI,SAAS,EAAS,QAAQ,EAAI,QAAQ,KAAY,CAAI,EAAI,SAAS,EAAS,UAAU,EAAI,QAAQ,GAAM,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