{"version":3,"file":"CountUp.D_MboHPA.mjs","names":["forwardRef","useRef","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","de","c","J","init_jsx_runtime","ce","window","findNumberNode","root","walker","node","withCountUp","Component","props","forwardedRef","localRef","el","textNode","original","match","target","render","v","raf","started","observer","entries","t0","tick","now","p","DURATION","eased","setRef","init_CountUp"],"sources":["https:/framerusercontent.com/modules/32JCAxfAHDBuYdxmGJx0/2Hwwq04jSIMhrTnCVrOV/CountUp.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";// Counts the first number inside a text layer up from 0 when it scrolls into view, then stops on the final value.\nconst DURATION=1800;function findNumberNode(root){const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);let node=walker.nextNode();while(node){if(/\\d/.test(node.nodeValue||\"\"))return node;node=walker.nextNode();}return null;}export function withCountUp(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const localRef=useRef(null);useEffect(()=>{const el=localRef.current;if(!el||typeof window===\"undefined\")return;const textNode=findNumberNode(el);if(!textNode)return;const original=textNode.nodeValue||\"\";const match=original.match(/\\d[\\d,]*/);if(!match)return;const target=parseInt(match[0].replace(/,/g,\"\"),10);const render=v=>{textNode.nodeValue=original.replace(match[0],String(Math.round(v)));};render(0);let raf=0;let started=false;const observer=new IntersectionObserver(entries=>{if(!entries[0].isIntersecting||started)return;started=true;observer.disconnect();const t0=performance.now();const tick=now=>{const p=Math.min(1,(now-t0)/DURATION);const eased=1-Math.pow(1-p,3);render(target*eased);if(p<1)raf=requestAnimationFrame(tick);else textNode.nodeValue=original;};raf=requestAnimationFrame(tick);},{threshold:.4});observer.observe(el);return()=>{observer.disconnect();cancelAnimationFrame(raf);textNode.nodeValue=original;};},[]);const setRef=node=>{localRef.current=node;if(typeof forwardedRef===\"function\")forwardedRef(node);else if(forwardedRef)forwardedRef.current=node;};return /*#__PURE__*/_jsx(Component,{...props,ref:setRef});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"A,8IACoB,SAASa,EAAeC,EAAK,CAAC,IAAMC,EAAO,SAAS,iBAAiBD,EAAK,WAAW,SAAS,EAAME,EAAKD,EAAO,SAAS,EAAE,KAAMC,GAAK,CAAC,GAAG,KAAK,KAAKA,EAAK,WAAW,EAAE,EAAE,OAAOA,EAAKA,EAAKD,EAAO,SAAS,CAAE,CAAC,OAAO,IAAK,CAAC,SAAgBE,EAAYC,EAAU,CAAC,MAAoBlB,iBAAYmB,EAAMC,IAAe,CAAC,IAAMC,EAASpB,EAAO,IAAI,EAAEC,MAAc,CAAC,IAAMoB,EAAGD,EAAS,QAAQ,GAAG,CAACC,GAAWV,IAAS,OAAY,OAAO,IAAMW,EAASV,EAAeS,CAAE,EAAE,GAAG,CAACC,EAAS,OAAO,IAAMC,EAASD,EAAS,WAAW,GAASE,EAAMD,EAAS,MAAM,UAAU,EAAE,GAAG,CAACC,EAAM,OAAO,IAAMC,EAAO,SAASD,EAAM,EAAE,CAAC,QAAQ,KAAK,EAAE,EAAE,EAAE,EAAQE,EAAOC,GAAG,CAACL,EAAS,UAAUC,EAAS,QAAQC,EAAM,GAAG,OAAO,KAAK,MAAMG,CAAC,CAAC,CAAC,CAAE,EAAED,EAAO,CAAC,EAAE,IAAIE,EAAI,EAAMC,EAAQ,GAAYC,EAAS,IAAI,qBAAqBC,GAAS,CAAC,GAAG,CAACA,EAAQ,EAAE,CAAC,gBAAgBF,EAAQ,OAAOA,EAAQ,GAAKC,EAAS,WAAW,EAAE,IAAME,EAAG,YAAY,IAAI,EAAQC,EAAKC,GAAK,CAAC,IAAMC,EAAE,KAAK,IAAI,GAAGD,EAAIF,GAAII,CAAQ,EAAQC,EAAM,GAAW,EAAEF,IAAE,E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