// All material copyright ESRI, All Rights Reserved, unless otherwise specified.// See https://js.arcgis.com/4.6/esri/copyright.txt for details.//>>builtdefine("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper ../core/accessorSupport/decorators dojo/Deferred ../core/Accessor ../core/Promise ../core/Scheduler ../core/Error ../core/promiseUtils".split(" "),function(b,n,f,d,c,g,h,k,e,l,m){b=function(b){functiona(a){a=b.call(this)||this;a.state="running";a.target=null;returna}f(a,b);a.prototype.initialize=function(){this._dfd=newg;this.addResolvingPromise(this._dfd.promise)};Object.defineProperty(a.prototype,"done",{get:function(){return"finished"===this.state||"stopped"===this.state},enumerable:!0,configurable:!0});a.prototype.stop=function(){"stopped"!==this.state&&"finished"!==this.state&&(this._set("state","stopped"),e.schedule(this._dfd.reject.bind(this._dfd,newl("ViewAnimation stopped"))))};a.prototype.finish=function(){"stopped"!==this.state&&"finished"!==this.state&&(this._set("state","finished"),e.schedule(this._dfd.resolve))};a.prototype.update=function(a,b){b||(b=m.isThenable(a)?"waiting-for-target":"running");this._set("target",a);this._set("state",b)};d([c.property({readOnly:!0,dependsOn:["state"]})],a.prototype,"done",null);d([c.property({readOnly:!0,type:String})],a.prototype,"state",void0);d([c.property()],a.prototype,"target",void0);returna=d([c.subclass("esri.views.ViewAnimation")],a)}(c.declared(h,k));(b||(b={})).State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"};returnb});