"use strict";const t=require("vue"),c=require("../Shared/base-iCmnU-fv.js"),b=require("countup.js");function y(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(o,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}return o.default=n,Object.freeze(o)}const T=y(b),B=t.defineComponent({name:"ClCountup",__name:"Index",props:{value:{},decimal:{},isThousand:{type:Boolean},separator:{},animationTime:{}},setup(n){const o=n,a=t.ref(null),i=t.ref(""),u={lastValue:""},f=e=>{const{animationTime:s=0,decimal:l=0,isThousand:m=!0,separator:p=","}=o;if(s===0){let r="";c.CommonBase.isEmpty(e)||(r=c.CommonBase.getValueByFormat(e.toString(),l===0?"int":"float",{decimalNum:l,isThousands:m}),m&&p!==","&&(r=r.replace(/,/g,p))),i.value=r}else{const r=c.CommonBase.isEmpty(u.lastValue)?0:Number(u.lastValue),g=e&&!c.CommonBase.isEmpty(e)?Number(e):0,C={startVal:r,duration:s,decimalPlaces:l,separator:p,useGrouping:m},d=new T.CountUp(a.value,g,C);d.error||d.start()}},_=()=>{f(o.value)};return t.watch(()=>o.value,(e,s)=>{e!==s&&(u.lastValue=s,f(e))}),t.onMounted(()=>{t.nextTick(()=>{_()})}),(e,s)=>(t.openBlock(),t.createElementBlock("span",{ref_key:"refElText",ref:a},t.toDisplayString(i.value),513))}});module.exports=B;
//# sourceMappingURL=ClCountup.cjs.map
