(function(a,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue-demi"),require("xiaohe-transition")):typeof define=="function"&&define.amd?define(["exports","vue-demi","xiaohe-transition"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a.XhCountTo={},a.VueDemi,a.XhTransition))})(this,function(a,u,y){"use strict";const x="xh",S=u.defineComponent({name:"CountTo",props:{value:{type:[Number,String],default:0},decimals:{type:[Number,String],default:0},duration:{type:[Number,String],default:2e3},preset:{type:String,default:y.BezierCurvePreset.LINEAR},bezier:{type:Object},delay:{type:[Number,String],default:0},fps:{type:[Number,String],default:-1},decimal:{type:String,default:"."},useGroupValue:{type:Boolean,default:!1},useIndianStyleGroup:{type:Boolean,default:!1},separator:{type:String,default:","},numerals:{type:Array}},emits:["inited","change","started","paused","resumed","stopped","completed"],slots:Object,setup(n,{emit:i,slots:o,expose:s}){const b=u.computed(()=>({duration:Number(n.duration),preset:n.preset,bezier:n.bezier,delay:Number(n.delay),fps:Number(n.fps),started(e){i("started",e)},paused(e){i("paused",e)},resumed(e){i("resumed",e)},stopped(e){i("stopped",e)},completed(e){i("completed",e)}})),g=u.ref(Number(n.value));function N(e){const f=e<0,t={result:"",x1:"",x2:"",x3:""};t.result=String(Math.abs(e).toFixed(Number(n.decimals)));const c=t.result.split(".");if(t.x1=c[0],t.x2=c.length>1?`${n.decimal}${c[1]}`:"",n.useGroupValue){const d=t.x1.length;for(let r=0,m=0,h=3;r0&&(t.x1=t.x1.replace(/[0-9]/g,d=>{const r=n.numerals[+d];return r===void 0?d:r}),t.x2=t.x2.replace(/[0-9]/g,d=>{const r=n.numerals[+d];return r===void 0?d:r})),`${f?"-":""}${t.x1}${t.x2}`}const p=u.computed(()=>N(g.value)),l=new y.Transition(b.value,e=>{g.value=e});return i("inited",l),u.watch(p,e=>{i("change",e,l)}),u.watch(b,e=>{l.options(e)}),u.watch(()=>n.value,(e,f)=>{l.start({start:Number(f),target:Number(e)})}),u.onUnmounted(()=>{l.destroy()}),s==null||s({transition:l}),()=>{var e;return u.h("div",{class:`${x}-count-to`},[(e=o.default)==null?void 0:e.call(o,{value:p.value})])}}});a.CLASS_PREFIX=x,a.CountTo=S,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});