{"version":3,"file":"ArrayAnimation.min.mjs","names":[],"sources":["../../../../src/util/animation/ArrayAnimation.ts"],"sourcesContent":["import { AnimationBase } from './AnimationBase';\nimport type { ArrayAnimationOptions } from './types';\n\nexport class ArrayAnimation extends AnimationBase<number[]> {\n  constructor({\n    startValue = [0],\n    endValue = [100],\n    ...options\n  }: ArrayAnimationOptions) {\n    super({\n      ...options,\n      startValue,\n      byValue: endValue.map((value, i) => value - startValue[i]),\n    });\n  }\n  protected calculate(timeElapsed: number) {\n    const values = this.startValue.map((value, i) =>\n      this.easing(timeElapsed, value, this.byValue[i], this.duration, i),\n    );\n    return {\n      value: values,\n      valueProgress: Math.abs(\n        (values[0] - this.startValue[0]) / this.byValue[0],\n      ),\n    };\n  }\n}\n"],"mappings":"wDAGA,IAAa,EAAb,cAAoC,CAAA,CAClC,YAAA,CAAY,WACV,EAAa,CAAC,EAAA,CAAE,SAChB,EAAW,CAAC,IAAA,CAAA,GACT,GAAA,CAEH,MAAM,CAAA,GACD,EACH,WAAA,EACA,QAAS,EAAS,KAAK,EAAO,IAAM,EAAQ,EAAW,GAAA,CAAA,CAAA,CAG3D,UAAoB,EAAA,CAClB,IAAM,EAAS,KAAK,WAAW,KAAK,EAAO,IACzC,KAAK,OAAO,EAAa,EAAO,KAAK,QAAQ,GAAI,KAAK,SAAU,EAAA,CAAA,CAElE,MAAO,CACL,MAAO,EACP,cAAe,KAAK,KACjB,EAAO,GAAK,KAAK,WAAW,IAAM,KAAK,QAAQ,GAAA,CAAA,GAAA,OAAA,KAAA"}