/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{spritePadding as t}from"../definitions.js";import{createPlayer as i,updateIfNeeded as a}from"./utils.js";class n{constructor(t,a,n,h){this._animation=t,this._frameData=null;const e=t=>{this._frameData=t,a.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playAnimation=n.playAnimation??!1,this._player=i(this._animation,n,h,e)}destroy(){}loadFrame(i){const a=this._frameData;if(null==a)return;const n="width"in a?a.width:a.codedWidth,h="height"in a?a.height:a.codedHeight;i.updateData(0,t,t,n,h,a),this._frameData=null}get hasFrameData(){return null!=this._frameData}update(t){this._playAnimation&&a(t,this._player)}}export{n as AnimatableTextureResource};
