import{d as f,r as o,h as v,a as _,t as h,u as b,o as y}from"./m2W8DxR4.js";const x=f({__name:"Count",props:{endValue:{type:Number,default:0},duration:{type:Number,default:2e3}},setup(u){const n=u,a=o(n.endValue),r=o(!1),s=o(null),i=()=>{const e=n.endValue,m=performance.now(),c=p=>{const d=p-m,l=Math.min(d/n.duration,1);a.value=Math.floor(l*(e-0)),l<1?requestAnimationFrame(c):a.value=e};requestAnimationFrame(c)};return v(()=>{const t=new IntersectionObserver(([e])=>{e.isIntersecting&&!r.value&&(r.value=!0,i(),t.disconnect())},{threshold:.5});s.value&&t.observe(s.value)}),(t,e)=>(y(),_("span",{ref_key:"el",ref:s,class:"text-accent text-[1.75rem]"},h(b(a).toLocaleString()),513))}});export{x as _};
