{"version":3,"file":"CountUpStat.De5KA96U.mjs","names":["React.useRef","React.useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","p","ce","de","init_framer_BisrWwwE","RenderTarget","ControlType","addPropertyControls","CountUpStat","props","isCanvas","ref","display","setDisplay","value","started","io","entries","t0","tick","t","eased","numSize","size","align","style","HEAD_FONT","numberColor","prefix","suffix","label","BODY_FONT","labelColor","init_CountUpStat","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/zU98bgEtJBVBuo0xD9ja/ubEPI6yJjGukpwLyLB8i/CountUpStat.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const HEAD_FONT=\"'Montserrat', 'Helvetica Neue', sans-serif\";const BODY_FONT=\"'Archivo', 'Helvetica Neue', sans-serif\";/**\n * A big stat that counts up from 0 when scrolled into view.\n * e.g. \"51%\" — of every dollar given away. Static under\n * prefers-reduced-motion and on the Framer canvas.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 320\n */export default function CountUpStat(props){const{value,prefix,suffix,label,numberColor,labelColor,size,align,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=React.useRef(null);const[display,setDisplay]=React.useState(value);const started=React.useRef(false);React.useEffect(()=>{setDisplay(value);},[value]);React.useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;if(!(\"IntersectionObserver\"in window))return;const io=new IntersectionObserver(entries=>{if(!entries.some(e=>e.isIntersecting)||started.current)return;started.current=true;io.disconnect();const t0=performance.now();const dur=1400;const tick=t=>{const p=Math.min(1,(t-t0)/dur);// ease-out cubic\nconst eased=1-Math.pow(1-p,3);setDisplay(Math.round(value*eased));if(p<1)requestAnimationFrame(tick);};setDisplay(0);requestAnimationFrame(tick);},{threshold:.5});if(ref.current)io.observe(ref.current);return()=>io.disconnect();},[isCanvas,value]);const numSize=size===\"xl\"?\"clamp(64px, 10vw, 120px)\":\"clamp(44px, 6vw, 72px)\";return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{display:\"flex\",flexDirection:\"column\",alignItems:align===\"center\"?\"center\":\"flex-start\",gap:8,...style},children:[/*#__PURE__*/_jsxs(\"div\",{style:{fontFamily:HEAD_FONT,fontWeight:800,fontSize:numSize,lineHeight:1,letterSpacing:\"-0.03em\",color:numberColor,fontVariantNumeric:\"tabular-nums\"},children:[prefix,display.toLocaleString(\"en-US\"),suffix]}),label?/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:BODY_FONT,fontWeight:400,fontSize:16,lineHeight:1.45,color:labelColor,maxWidth:360,textAlign:align===\"center\"?\"center\":\"left\"},children:label}):null]});}addPropertyControls(CountUpStat,{value:{type:ControlType.Number,title:\"Value\",defaultValue:51,min:0,max:1e5,step:1},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"%\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"of every dollar given is given away\",displayTextArea:true},numberColor:{type:ControlType.Color,title:\"Number\",defaultValue:\"#4d9ee9\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"lg\",\"xl\"],optionTitles:[\"Large\",\"XL\"],defaultValue:\"xl\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\"],optionTitles:[\"Left\",\"Center\"],defaultValue:\"left\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUpStat\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"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