text: var __extends=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},Spriter;!function(t){var e=function(){function t(){this._items=[],this._itemNames=[]}return t.prototype.add=function(t,e,i){void 0===e&&(e=this._items.length),(void 0===i||null===i)&&(i="item_"+e),this._items[e]=t,this._itemNames[i]=e},t.prototype.getById=function(t){return this._items[t]},t.prototype.getByName=function(t){var e=this._itemNames[t];return"number"==typeof e?this._items[e]:null},Object.defineProperty(t.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),t}();t.IdNameMap=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(){this.reset()}return Object.defineProperty(t.prototype,"current",{get:function(){return this._line.at(this._currentIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this._currentIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"next",{get:function(){return this._line.at(this._nextIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextIndex",{get:function(){return this._nextIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastTime",{set:function(t){this._lastTime=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"line",{get:function(){return this._line},set:function(t){this._line=t},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this._lastTime=-1,this._currentIndex=-1,this._nextIndex=0},t.prototype.step=function(t){var e=this._nextIndex,i=this._line.keys[e],n=i.time,r=t<this._lastTime;return!r&&n>this._lastTime&&t>=n||r&&(n>this._lastTime||t>=n)?(this._lastTime=n,this._currentIndex=e,++e>=this._line.keys.length&&(e=0),this._nextIndex=e,i):null},t}();t.LineStepper=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e){this._file=t,this._nodeList=e}return t.prototype.length=function(){return this._nodeList.length},t.prototype.processed=function(){this._file.processed()},t.prototype.getChildNodes=function(t,e){return this._file.getNodesForElement(this._nodeList[t],e)},t.prototype.getFolder=function(t){return this._file.getFolder(this._nodeList[t])},t.prototype.getFile=function(t){return this._file.getFile(this._nodeList[t])},t.prototype.getTag=function(t){return this._file.getTag(this._nodeList[t])},t.prototype.getEntity=function(t){return this._file.getEntity(this._nodeList[t])},t.prototype.getObjectInfo=function(t){return this._file.getObjectInfo(this._nodeList[t],t)},t.prototype.getCharMap=function(t){return this._file.getCharMap(this._nodeList[t])},t.prototype.getCharMapEntry=function(t,e,i){this._file.getCharMapEntry(this._nodeList[t],e,i)},t.prototype.getVariable=function(t){return this._file.getVariable(this._nodeList[t])},t.prototype.getAnimation=function(t){return this._file.getAnimation(this._nodeList[t])},t.prototype.getMainline=function(t){return this._file.getBaseline(this._nodeList[t])},t.prototype.getMainlineKey=function(t){return this._file.getMainlineKey(this._nodeList[t])},t.prototype.getRef=function(t){return this._file.getRef(this._nodeList[t])},t.prototype.getTimeline=function(t){return this._file.getTimeline(this._nodeList[t])},t.prototype.getSoundline=function(t){return this._file.getBaseline(this._nodeList[t])},t.prototype.getEventline=function(t){return this._file.getBaseline(this._nodeList[t])},t.prototype.getTagline=function(t){return this._file.getBaseline(this._nodeList[t])},t.prototype.getVarline=function(t){return this._file.getVarline(this._nodeList[t])},t.prototype.getKey=function(t){return this._file.getKey(this._nodeList[t])},t.prototype.getTagKey=function(t){return this._file.getTagKey(this._nodeList[t])},t.prototype.getVariableKey=function(t,e){return this._file.getVariableKey(this._nodeList[t],e)},t.prototype.getTimelineKey=function(t,e){return this._file.getTimelineKey(this._nodeList[t],t,e)},t.prototype.getTagChanges=function(t){for(var e=0,i=0;i<this.length();i++){var n=this._file.getTagChange(this._nodeList[i]);e|=1<<n}return e},t}();t.NodeListBin=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e){this._file=t,this._nodeList=e,Array.isArray(e)||(e.length=1)}return t.prototype.length=function(){return this._nodeList.length},t.prototype.processed=function(){this._file.processed()},t.prototype.getNode=function(t){return Array.isArray(this._nodeList)?this._nodeList[t]:this._nodeList},t.prototype.getChildNodes=function(t,e){return this._file.getNodesForElement(this.getNode(t),e)},t.prototype.getFolder=function(t){return this._file.getFolder(this.getNode(t))},t.prototype.getFile=function(t){return this._file.getFile(this.getNode(t))},t.prototype.getTag=function(t){return this._file.getTag(this.getNode(t))},t.prototype.getEntity=function(t){return this._file.getEntity(this.getNode(t))},t.prototype.getObjectInfo=function(t){return this._file.getObjectInfo(this.getNode(t),t)},t.prototype.getCharMap=function(t){return this._file.getCharMap(this.getNode(t))},t.prototype.getCharMapEntry=function(t,e,i){this._file.getCharMapEntry(this.getNode(t),e,i)},t.prototype.getVariable=function(t){return this._file.getVariable(this.getNode(t))},t.prototype.getAnimation=function(t){return this._file.getAnimation(this.getNode(t))},t.prototype.getMainline=function(t){return this._file.getBaseline(this.getNode(t))},t.prototype.getMainlineKey=function(t){return this._file.getMainlineKey(this.getNode(t))},t.prototype.getRef=function(t){return this._file.getRef(this.getNode(t))},t.prototype.getTimeline=function(t){return this._file.getTimeline(this.getNode(t))},t.prototype.getSoundline=function(t){return this._file.getBaseline(this.getNode(t))},t.prototype.getEventline=function(t){return this._file.getBaseline(this.getNode(t))},t.prototype.getTagline=function(t){return this._file.getBaseline(this.getNode(t))},t.prototype.getVarline=function(t){return this._file.getVarline(this.getNode(t))},t.prototype.getKey=function(t){return this._file.getKey(this.getNode(t))},t.prototype.getTagKey=function(t){return this._file.getTagKey(this.getNode(t))},t.prototype.getVariableKey=function(t,e){return this._file.getVariableKey(this.getNode(t),e)},t.prototype.getTimelineKey=function(t,e){return this._file.getTimelineKey(this.getNode(t),t,e)},t.prototype.getTagChanges=function(t){for(var e=0,i=0;i<this.length();i++){var n=this._file.getTagChange(this.getNode(i));e|=1<<n}return e},t}();t.NodeListJSON=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e){this._file=t,this._nodeList=e}return t.prototype.length=function(){return this._nodeList.length},t.prototype.processed=function(){this._file.processed()},t.prototype.getChildNodes=function(t,e){return this._file.getNodesForElement(this._nodeList.item(t),e)},t.prototype.getFolder=function(t){return this._file.getFolder(this._nodeList.item(t))},t.prototype.getFile=function(t){return this._file.getFile(this._nodeList.item(t))},t.prototype.getTag=function(t){return this._file.getTag(this._nodeList.item(t))},t.prototype.getEntity=function(t){return this._file.getEntity(this._nodeList.item(t))},t.prototype.getObjectInfo=function(t){return this._file.getObjectInfo(this._nodeList.item(t),t)},t.prototype.getCharMap=function(t){return this._file.getCharMap(this._nodeList.item(t))},t.prototype.getCharMapEntry=function(t,e,i){this._file.getCharMapEntry(this._nodeList.item(t),e,i)},t.prototype.getVariable=function(t){return this._file.getVariable(this._nodeList.item(t))},t.prototype.getAnimation=function(t){return this._file.getAnimation(this._nodeList.item(t))},t.prototype.getMainline=function(t){return this._file.getBaseline(this._nodeList.item(t))},t.prototype.getMainlineKey=function(t){return this._file.getMainlineKey(this._nodeList.item(t))},t.prototype.getRef=function(t){return this._file.getRef(this._nodeList.item(t))},t.prototype.getTimeline=function(t){return this._file.getTimeline(this._nodeList.item(t))},t.prototype.getSoundline=function(t){return this._file.getBaseline(this._nodeList.item(t))},t.prototype.getEventline=function(t){return this._file.getBaseline(this._nodeList.item(t))},t.prototype.getTagline=function(t){return this._file.getBaseline(this._nodeList.item(t))},t.prototype.getVarline=function(t){return this._file.getVarline(this._nodeList.item(t))},t.prototype.getKey=function(t){return this._file.getKey(this._nodeList.item(t))},t.prototype.getTagKey=function(t){return this._file.getTagKey(this._nodeList.item(t))},t.prototype.getVariableKey=function(t,e){return this._file.getVariableKey(this._nodeList.item(t),e)},t.prototype.getTimelineKey=function(t,e){return this._file.getTimelineKey(this._nodeList.item(t),t,e)},t.prototype.getTagChanges=function(t){for(var e=0,i=0;i<this.length();i++){var n=this._file.getTagChange(this._nodeList.item(i));e|=1<<n}return e},t}();t.NodeListXml=e}(Spriter||(Spriter={}));var Spriter;!function(t){!function(t){t[t.XML=0]="XML",t[t.JSON=1]="JSON",t[t.BIN=2]="BIN"}(t.eFileType||(t.eFileType={}));t.eFileType;!function(t){t[t.NAME_ONLY=0]="NAME_ONLY",t[t.NAME_AND_EXTENSION=1]="NAME_AND_EXTENSION",t[t.FULL_PATH_NO_EXTENSION=2]="FULL_PATH_NO_EXTENSION",t[t.FULL_PATH_WITH_EXTENSION=3]="FULL_PATH_WITH_EXTENSION"}(t.eImageNameType||(t.eImageNameType={}));var e=t.eImageNameType,i=function(){function t(t){var i="undefined"!=typeof t&&null!==t;this._imageNameType=i&&"undefined"!=typeof t.imageNameType?t.imageNameType:e.NAME_ONLY,this._minDefs=i&&"undefined"!=typeof t.minDefs?t.minDefs:null}return t.prototype.processed=function(){this.popMinDefsStack()},t.prototype.setMinimized=function(t){this._minimized=t,t&&(this._minDefsStack=[],null===this._minDefs)},t.prototype.getFileName=function(t){var i;switch(this._imageNameType){case e.NAME_ONLY:i=t.split("\\").pop().split("/").pop().split(".")[0];break;case e.NAME_AND_EXTENSION:i=t.split("\\").pop().split("/").pop();break;case e.FULL_PATH_NO_EXTENSION:i=t.split(".")[0];break;case e.FULL_PATH_WITH_EXTENSION:i=t}return i},t.prototype.translateElementName=function(t){if(this._minimized){if(this._minDefs.name!==t)return t;null!==this._minDefs.minName&&(t=this._minDefs.minName)}return t},t.prototype.translateChildElementName=function(t){if(this._minimized&&null!==this._minDefs){var e=this._minDefs.childElements;null!==e&&(t=null===e[t]?t:e[t].minName)}return t},t.prototype.translateAttributeName=function(t){if(this._minimized&&null!==this._minDefs){var e=this._minDefs.attributes;null!==e&&(t=null===e[t]?t:e[t])}return t},t.prototype.setMinDefsToElementName=function(t){if(this._minimized){this._minDefsStack.push(this._minDefs);var e=this._minDefs.childElements[t];this._minDefs=e}},t.prototype.popMinDefsStack=function(){this._minimized&&(this._minDefs=this._minDefsStack.pop())},t}();t.SpriterFile=i}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(t){e.call(this,null),this._elements={spriter_data:1,folder:2,file:3,entity:4,obj_info:5,frames:6,i:7,animation:8,mainline:9,key:10,bone_ref:11,object_ref:12,timeline:13,bone:14,object:15},this._smallOffset=!1,this._bin=new DataView(t),this._smallOffset=1===this._bin.getUint8(0)}return __extends(i,e),i.prototype.getType=function(){return t.eFileType.BIN},i.prototype.readUint8=function(){return this._bin.getUint8(this._tmpPosition++)},i.prototype.readInt8=function(){return this._bin.getInt8(this._tmpPosition++)},i.prototype.readUint16=function(){var t=this._bin.getUint16(this._tmpPosition,!0);return this._tmpPosition+=2,t},i.prototype.readInt16=function(){var t=this._bin.getInt16(this._tmpPosition,!0);return this._tmpPosition+=2,t},i.prototype.readUint32=function(){var t=this._bin.getUint32(this._tmpPosition,!0);return this._tmpPosition+=4,t},i.prototype.readInt32=function(){var t=this._bin.getInt32(this._tmpPosition,!0);return this._tmpPosition+=4,t},i.prototype.readFixed16_16=function(){var t=this._bin.getInt32(this._tmpPosition,!0);return this._tmpPosition+=4,t/65536},i.prototype.readFixed1_7=function(){var t=255&this._bin.getInt8(this._tmpPosition++);return t/128},i.prototype.readString=function(){for(var t=[],e=this._bin.getUint8(this._tmpPosition++)-1;e>=0;e--)t.push(this._bin.getUint8(this._tmpPosition++));return String.fromCharCode.apply(null,t)},i.prototype.getNodes=function(e){return new t.NodeListBin(this,this.getSubNodesOfElementType(1,this._elements[e]))},i.prototype.getNodesForElement=function(e,i){return new t.NodeListBin(this,this.getSubNodesOfElementType(e,this._elements[i]))},i.prototype.getSubNodesOfElementType=function(t,e){var i=[],n=this._bin.getUint8(t+1);t+=2;for(var r=0;n>r;r++){var o=this._smallOffset?this._bin.getUint16(t+2*r,!0):this._bin.getUint32(t+4*r,!0),s=this._bin.getUint8(t+o);s===e&&i.push(t+o)}return i},i.prototype.getAttribsPosition=function(t){var e=this._bin.getUint8(t+1);return t+2+e*(this._smallOffset?2:4)},i.prototype.getFolder=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r="",o=this._bin.getUint8(this._tmpPosition++)-1;o>=0;o--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_FOLDER_ID:n=this.readUint8();break;case i.ATTR_FOLDER_NAME:r=this.readString()}return new t.Folder(n,r)},i.prototype.getFile=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r="",o=0,s=0,a=this._bin.getUint8(this._tmpPosition++)-1;a>=0;a--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_FILE_ID:n=this.readUint8();break;case i.ATTR_FILE_NAME:r=this.readString();break;case i.ATTR_FILE_PIVOT_X:o=this.readFixed16_16();break;case i.ATTR_FILE_PIVOT_Y:s=this.readFixed16_16();break;case i.ATTR_FILE_WIDTH:case i.ATTR_FILE_HEIGHT:this._tmpPosition+=2}return new t.File(n,this.getFileName(r),o,1-s)},i.prototype.getTag=function(t){return null},i.prototype.getEntity=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r="",o=this._bin.getUint8(this._tmpPosition++)-1;o>=0;o--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_ENTITY_ID:n=this.readUint8();break;case i.ATTR_ENTITY_NAME:r=this.readString()}return new t.Entity(n,r)},i.prototype.getObjectInfo=function(e,n){this._tmpPosition=this.getAttribsPosition(e);for(var r="",o=0,s=0,a=0,p=this._bin.getUint8(this._tmpPosition++)-1;p>=0;p--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_OBJ_INFO_NAME:r=this.readString();break;case i.ATTR_OBJ_INFO_TYPE:1===this.readUint8()&&(o=1);break;case i.ATTR_OBJ_INFO_WIDTH:s=this.readFixed16_16();break;case i.ATTR_OBJ_INFO_HEIGHT:a=this.readFixed16_16()}return new t.ObjectInfo(n,r,o,s,a,0,0)},i.prototype.getCharMap=function(t){return null},i.prototype.getCharMapEntry=function(t,e,i){return null},i.prototype.getVariable=function(t){return null},i.prototype.getAnimation=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r="",o=0,s=t.eAnimationLooping.LOOPING,a=this._bin.getUint8(this._tmpPosition++)-1;a>=0;a--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_ANIMATION_ID:n=this.readUint8();break;case i.ATTR_ANIMATION_NAME:r=this.readString();break;case i.ATTR_ANIMATION_LENGTH:o=this.readUint32();break;case i.ATTR_ANIMATION_INTERVAL:this._tmpPosition+=2;break;case i.ATTR_ANIMATION_LOOPING:s=1===this.readUint8()?t.eAnimationLooping.LOOPING:t.eAnimationLooping.NO_LOOPING}return new t.Animation(n,r,o,s)},i.prototype.getMainlineKey=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r=0,o=this._bin.getUint8(this._tmpPosition++)-1;o>=0;o--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_MAINLINE_KEY_ID:n=this.readUint8();break;case i.ATTR_MAINLINE_KEY_TIME:r=this.readUint32()}return new t.KeyMainline(n,r)},i.prototype.getRef=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r=-1,o=0,s=0,a=0,p=this._bin.getUint8(this._tmpPosition++)-1;p>=0;p--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_BONE_REF_ID:case i.ATTR_OBJ_REF_ID:n=this.readUint8();break;case i.ATTR_BONE_REF_PARENT:case i.ATTR_OBJ_REF_PARENT:r=this.readUint8();break;case i.ATTR_BONE_REF_TIMELINE:case i.ATTR_OBJ_REF_TIMELINE:o=this.readUint8();break;case i.ATTR_BONE_REF_KEY:case i.ATTR_OBJ_REF_KEY:s=this.readUint8();break;case i.ATTR_OBJ_REF_Z:a=this.readUint8();break;case i.ATTR_OBJ_REF_NAME:this.readString();break;case i.ATTR_OBJ_REF_FOLDER:case i.ATTR_OBJ_REF_FILE:++this._tmpPosition;break;case i.ATTR_OBJ_REF_ABS_X:case i.ATTR_OBJ_REF_ABS_Y:case i.ATTR_OBJ_REF_ABS_PIVOT_X:case i.ATTR_OBJ_REF_ABS_PIVOT_Y:case i.ATTR_OBJ_REF_ABS_SCALE_X:case i.ATTR_OBJ_REF_ABS_SCALE_Y:case i.ATTR_OBJ_REF_ANGLE:this._tmpPosition+=4;break;case i.ATTR_OBJ_REF_ALPHA:++this._tmpPosition}return new t.Ref(n,r,o,s,a)},i.prototype.getTimeline=function(e){this._tmpPosition=this.getAttribsPosition(e);for(var n=0,r="",o=0,s=0,a=this._bin.getUint8(this._tmpPosition++)-1;a>=0;a--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_TIMELINE_ID:n=this.readUint8();break;case i.ATTR_TIMELINE_NAME:r=this.readString();break;case i.ATTR_TIMELINE_OBJ:o=this.readUint8();break;case i.ATTR_TIMELINE_OBJ_TYPE:1===this.readUint8()&&(s=1)}return new t.Timeline(n,r,s,o)},i.prototype.getBaseline=function(t){return null},i.prototype.getVarline=function(t){return null},i.prototype.getKey=function(t){return null},i.prototype.getTagKey=function(t){return null},i.prototype.getVariableKey=function(t,e){return null},i.prototype.getTimelineKey=function(e,n,r){this._tmpPosition=this.getAttribsPosition(e);for(var o=0,s=1,a=0,p=0,h=0,l=0,_=0,u=this._bin.getUint8(this._tmpPosition++)-1;u>=0;u--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_TIMELINE_KEY_ID:++this._tmpPosition;break;case i.ATTR_TIMELINE_KEY_TIME:o=this.readUint32();break;case i.ATTR_TIMELINE_KEY_SPIN:s=this.readInt8();break;case i.ATTR_TIMELINE_KEY_CURVE:a=this.readUint8();break;case i.ATTR_TIMELINE_KEY_C1:p=this.readFixed1_7();break;case i.ATTR_TIMELINE_KEY_C2:h=this.readFixed1_7()}e+=2;var f=e+(this._smallOffset?this._bin.getUint16(e,!0):this._bin.getUint32(e,!0)),c=this._bin.getUint8(f),d=null,y=!1;14===c?d=new t.KeyBone(n,o,s):15===c&&(d=new t.KeyObject(n,o,s),y=!0),0!==a&&d.setCurve(a,p,h,l,_),this._tmpPosition=this.getAttribsPosition(f);var g=d.info;g.x=0,g.y=0,g.scaleX=1,g.scaleY=1,g.angle=0,g.alpha=1;for(var m=0,T=!1,b=0,I=!1,v=0,N=0,u=this._bin.getUint8(this._tmpPosition++)-1;u>=0;u--)switch(this._bin.getUint8(this._tmpPosition++)){case i.ATTR_BONE_X:case i.ATTR_OBJ_X:g.x=this.readFixed16_16();break;case i.ATTR_BONE_Y:case i.ATTR_OBJ_Y:g.y=-this.readFixed16_16();break;case i.ATTR_BONE_ANGLE:case i.ATTR_OBJ_ANGLE:g.angle=360-this.readFixed16_16();break;case i.ATTR_BONE_SCALE_X:case i.ATTR_OBJ_SCALE_X:g.scaleX=this.readFixed16_16();break;case i.ATTR_BONE_SCALE_Y:case i.ATTR_OBJ_SCALE_Y:g.scaleY=this.readFixed16_16();break;case i.ATTR_OBJ_FOLDER:v=this.readUint8();break;case i.ATTR_OBJ_FILE:N=this.readUint8();break;case i.ATTR_OBJ_PIVOT_X:m=this.readFixed16_16(),T=!0;break;case i.ATTR_OBJ_PIVOT_Y:b=this.readFixed16_16(),I=!0;break;case i.ATTR_OBJ_ALPHA:g.alpha=this.readFixed1_7()}if(y){d.setFolderAndFile(v,N);var E=r.getFolderById(v).getFileById(N);g.pivotX=T?m:E.pivotX,g.pivotY=1-(I?b:1-E.pivotY)}return d},i.prototype.getTagChange=function(t){return null},i.ATTR_VERSION=0,i.ATTR_GENERATOR=1,i.ATTR_GENERATOR_VERSION=2,i.ATTR_FOLDER_ID=0,i.ATTR_FOLDER_NAME=1,i.ATTR_FILE_ID=0,i.ATTR_FILE_NAME=1,i.ATTR_FILE_WIDTH=2,i.ATTR_FILE_HEIGHT=3,i.ATTR_FILE_PIVOT_X=4,i.ATTR_FILE_PIVOT_Y=5,i.ATTR_ENTITY_ID=0,i.ATTR_ENTITY_NAME=1,i.ATTR_OBJ_INFO_NAME=0,i.ATTR_OBJ_INFO_TYPE=1,i.ATTR_OBJ_INFO_WIDTH=2,i.ATTR_OBJ_INFO_HEIGHT=3,i.ATTR_FRAMES_I_FOLDER=0,i.ATTR_FRAMES_I_FILE=1,i.ATTR_ANIMATION_ID=0,i.ATTR_ANIMATION_NAME=1,i.ATTR_ANIMATION_LENGTH=2,i.ATTR_ANIMATION_INTERVAL=3,i.ATTR_ANIMATION_LOOPING=4,i.ATTR_MAINLINE_KEY_ID=0,i.ATTR_MAINLINE_KEY_TIME=1,i.ATTR_BONE_REF_ID=0,i.ATTR_BONE_REF_PARENT=1,i.ATTR_BONE_REF_TIMELINE=2,i.ATTR_BONE_REF_KEY=3,i.ATTR_OBJ_REF_ID=4,i.ATTR_OBJ_REF_PARENT=5,i.ATTR_OBJ_REF_TIMELINE=6,i.ATTR_OBJ_REF_KEY=7,i.ATTR_OBJ_REF_NAME=8,i.ATTR_OBJ_REF_Z=9,i.ATTR_OBJ_REF_FOLDER=10,i.ATTR_OBJ_REF_FILE=11,i.ATTR_OBJ_REF_ABS_X=12,i.ATTR_OBJ_REF_ABS_Y=13,i.ATTR_OBJ_REF_ABS_PIVOT_X=14,i.ATTR_OBJ_REF_ABS_PIVOT_Y=15,i.ATTR_OBJ_REF_ABS_SCALE_X=16,i.ATTR_OBJ_REF_ABS_SCALE_Y=17,i.ATTR_OBJ_REF_ANGLE=18,i.ATTR_OBJ_REF_ALPHA=19,i.ATTR_TIMELINE_ID=0,i.ATTR_TIMELINE_NAME=1,i.ATTR_TIMELINE_OBJ=2,i.ATTR_TIMELINE_OBJ_TYPE=3,i.ATTR_TIMELINE_KEY_ID=0,i.ATTR_TIMELINE_KEY_TIME=1,i.ATTR_TIMELINE_KEY_SPIN=2,i.ATTR_TIMELINE_KEY_CURVE=3,i.ATTR_TIMELINE_KEY_C1=4,i.ATTR_TIMELINE_KEY_C2=5,i.ATTR_BONE_X=0,i.ATTR_BONE_Y=1,i.ATTR_BONE_ANGLE=2,i.ATTR_BONE_SCALE_X=3,i.ATTR_BONE_SCALE_Y=4,i.ATTR_OBJ_FOLDER=5,i.ATTR_OBJ_FILE=6,i.ATTR_OBJ_X=7,i.ATTR_OBJ_Y=8,i.ATTR_OBJ_SCALE_X=9,i.ATTR_OBJ_SCALE_Y=10,i.ATTR_OBJ_PIVOT_X=11,i.ATTR_OBJ_PIVOT_Y=12,i.ATTR_OBJ_ANGLE=13,i.ATTR_OBJ_ALPHA=14,i}(t.SpriterFile);t.SpriterBin=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(t,i){e.call(this,i),this._json=t;var n=void 0!==t.min;this.setMinimized(n)}return __extends(i,e),i.prototype.getType=function(){return t.eFileType.JSON},i.prototype.parseInt=function(t,e,i){void 0===i&&(i=0);var n=t[this.translateAttributeName(e)];return void 0===n?i:"number"==typeof n?n:parseInt(n)},i.prototype.parseFloat=function(t,e,i){void 0===i&&(i=0);var n=t[this.translateAttributeName(e)];return void 0===n?i:"number"==typeof n?n:parseFloat(n)},i.prototype.parseBoolean=function(t,e,i){void 0===i&&(i=!1);var n=t[this.translateAttributeName(e)];return void 0===n?i:"boolean"==typeof n?n:"true"===n},i.prototype.parseString=function(t,e,i){void 0===i&&(i="");var n=t[this.translateAttributeName(e)];return void 0===n?i:n},i.prototype.getNodes=function(e){this.setMinDefsToElementName(e);var i=this.translateElementName(e);return new t.NodeListJSON(this,void 0!==this._json[i]?this._json[i]:[])},i.prototype.getNodesForElement=function(e,i){this.setMinDefsToElementName(i);var n=this.translateElementName(i);return new t.NodeListJSON(this,void 0!==e[n]?e[n]:[])},i.prototype.getFolder=function(e){return new t.Folder(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getFile=function(e){return void 0!==e.type&&"sound"===e.type?null:new t.File(this.parseInt(e,"id"),this.getFileName(this.parseString(e,"name")),this.parseFloat(e,"pivot_x"),1-this.parseFloat(e,"pivot_y"))},i.prototype.getTag=function(e){return new t.Item(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getEntity=function(e){return new t.Entity(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getObjectInfo=function(e,i){return new t.ObjectInfo(i,this.parseString(e,"name"),t.Types.getObjectTypeForName(this.parseString(e,"type")),this.parseFloat(e,"w"),this.parseFloat(e,"h"),this.parseFloat(e,"pivot_x"),this.parseFloat(e,"pivot_y"))},i.prototype.getCharMap=function(e){return new t.CharMap(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getCharMapEntry=function(t,e,i){var n=i.getFolderById(this.parseInt(t,"folder")).getFileById(this.parseInt(t,"file")).name,r=null;void 0!==t.target_folder&&void 0!==t.target_file&&(r=i.getFolderById(this.parseInt(t,"target_folder")).getFileById(this.parseInt(t,"target_file"))),e.put(n,r)},i.prototype.getVariable=function(e){var i=t.Types.getVariableTypeForName(this.parseString(e,"type"));return new t.Variable(this.parseInt(e,"id"),this.parseString(e,"name"),i,2===i?this.parseString(e,"default"):this.parseFloat(e,"default",0))},i.prototype.getAnimation=function(e){return new t.Animation(this.parseInt(e,"id"),this.parseString(e,"name"),this.parseFloat(e,"length"),this.parseBoolean(e,"looping",!0)===!0?t.eAnimationLooping.LOOPING:t.eAnimationLooping.NO_LOOPING)},i.prototype.getMainlineKey=function(e){return new t.KeyMainline(this.parseInt(e,"id"),this.parseFloat(e,"time"))},i.prototype.getRef=function(e){return new t.Ref(this.parseInt(e,"id"),this.parseInt(e,"parent",-1),this.parseInt(e,"timeline"),this.parseInt(e,"key"),this.parseInt(e,"z_index"))},i.prototype.getTimeline=function(e){return new t.Timeline(this.parseInt(e,"id"),this.parseString(e,"name"),t.Types.getObjectTypeForName(this.parseString(e,"object_type","sprite")),this.parseInt(e,"obj",-1))},i.prototype.getBaseline=function(e){return new t.Baseline(this.parseInt(e,"id"),this.parseString(e,"name",null))},i.prototype.getVarline=function(e){return new t.Varline(this.parseInt(e,"id"),this.parseInt(e,"def"))},i.prototype.getKey=function(e){return new t.Key(this.parseInt(e,"id"),this.parseInt(e,"time"))},i.prototype.getTagKey=function(e){return new t.KeyTag(this.parseInt(e,"id"),this.parseInt(e,"time"))},i.prototype.getVariableKey=function(e,i){return new t.KeyVariable(this.parseInt(e,"id"),this.parseInt(e,"time"),2===i?this.parseString(e,"val"):this.parseFloat(e,"val"))},i.prototype.getTimelineKey=function(e,i,n){var r=this.parseInt(e,"time"),o=this.parseInt(e,"spin",1),s=this.parseString(e,"curve_type","linear"),a=this.parseFloat(e,"c1",0),p=this.parseFloat(e,"c2",0),h=this.parseFloat(e,"c3",0),l=this.parseFloat(e,"c4",0),_=this.translateChildElementName("bone"),u=this.translateChildElementName("object"),f=null,c=null,d=!1;void 0!==e[_]?(c=e[_],f=new t.KeyBone(i,r,o),this.setMinDefsToElementName("bone")):void 0!==e[u]&&(c=e[u],f=new t.KeyObject(i,r,o),this.setMinDefsToElementName("object"),d=!0),"linear"!==s&&f.setCurve(t.Types.getCurveTypeForName(s),a,p,h,l);var y=f.info;if(y.x=this.parseFloat(c,"x"),y.y=-this.parseFloat(c,"y"),y.scaleX=this.parseFloat(c,"scale_x",1),y.scaleY=this.parseFloat(c,"scale_y",1),y.angle=360-this.parseFloat(c,"angle"),y.alpha=this.parseFloat(c,"a",1),d){var g=this.parseInt(c,"folder"),m=this.parseInt(c,"file");f.setFolderAndFile(g,m);var T=n.getFolderById(g).getFileById(m);y.pivotX=this.parseFloat(c,"pivot_x",T.pivotX),y.pivotY=1-this.parseFloat(c,"pivot_y",1-T.pivotY)}return this.popMinDefsStack(),f},i.prototype.getTagChange=function(t){return this.parseInt(t,"t")},i}(t.SpriterFile);t.SpriterJSON=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(t,i){e.call(this,i),this._xml=t;var n=t.documentElement.hasAttribute("min");this.setMinimized(n)}return __extends(i,e),i.prototype.getType=function(){return t.eFileType.XML},i.prototype.parseInt=function(t,e,i){void 0===i&&(i=0);var n=t.getAttribute(this.translateAttributeName(e));return null!==n?parseInt(n):i},i.prototype.parseFloat=function(t,e,i){void 0===i&&(i=0);var n=t.getAttribute(this.translateAttributeName(e));return null!==n?parseFloat(n):i},i.prototype.parseString=function(t,e,i){void 0===i&&(i="");var n=t.getAttribute(this.translateAttributeName(e));return null!==n?n:i},i.prototype.getNodes=function(e){this.setMinDefsToElementName(e);var i=this.translateElementName(e);return new t.NodeListXml(this,this._xml.documentElement.getElementsByTagName(i))},i.prototype.getNodesForElement=function(e,i){this.setMinDefsToElementName(i);var n=this.translateElementName(i);return new t.NodeListXml(this,e.getElementsByTagName(n))},i.prototype.getFolder=function(e){return new t.Folder(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getFile=function(e){return e.hasAttribute("type")&&"sound"===e.getAttribute("type")?null:new t.File(this.parseInt(e,"id"),this.getFileName(this.parseString(e,"name")),this.parseFloat(e,"pivot_x"),1-this.parseFloat(e,"pivot_y"))},i.prototype.getTag=function(e){return new t.Item(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getEntity=function(e){return new t.Entity(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getObjectInfo=function(e,i){return new t.ObjectInfo(i,this.parseString(e,"name"),t.Types.getObjectTypeForName(this.parseString(e,"type")),this.parseFloat(e,"w"),this.parseFloat(e,"h"),this.parseFloat(e,"pivot_x"),this.parseFloat(e,"pivot_y"))},i.prototype.getCharMap=function(e){return new t.CharMap(this.parseInt(e,"id"),this.parseString(e,"name"))},i.prototype.getCharMapEntry=function(t,e,i){var n=i.getFolderById(this.parseInt(t,"folder")).getFileById(this.parseInt(t,"file")).name,r=null;t.hasAttribute("target_folder")&&t.hasAttribute("target_file")&&(r=i.getFolderById(this.parseInt(t,"target_folder")).getFileById(this.parseInt(t,"target_file"))),e.put(n,r)},i.prototype.getVariable=function(e){var i=t.Types.getVariableTypeForName(this.parseString(e,"type"));return new t.Variable(this.parseInt(e,"id"),this.parseString(e,"name"),i,2===i?this.parseString(e,"default"):this.parseFloat(e,"default",0))},i.prototype.getAnimation=function(e){return new t.Animation(this.parseInt(e,"id"),this.parseString(e,"name"),this.parseFloat(e,"length"),"true"===this.parseString(e,"looping","true")?t.eAnimationLooping.LOOPING:t.eAnimationLooping.NO_LOOPING)},i.prototype.getMainlineKey=function(e){return new t.KeyMainline(this.parseInt(e,"id"),this.parseFloat(e,"time"))},i.prototype.getRef=function(e){return new t.Ref(this.parseInt(e,"id"),this.parseInt(e,"parent",-1),this.parseInt(e,"timeline"),this.parseInt(e,"key"),this.parseInt(e,"z_index"))},i.prototype.getTimeline=function(e){return new t.Timeline(this.parseInt(e,"id"),this.parseString(e,"name"),t.Types.getObjectTypeForName(this.parseString(e,"object_type","sprite")),this.parseInt(e,"obj",-1))},i.prototype.getBaseline=function(e){return new t.Baseline(this.parseInt(e,"id"),this.parseString(e,"name",null))},i.prototype.getVarline=function(e){return new t.Varline(this.parseInt(e,"id"),this.parseInt(e,"def"))},i.prototype.getKey=function(e){return new t.Key(this.parseInt(e,"id"),this.parseInt(e,"time"))},i.prototype.getTagKey=function(e){return new t.KeyTag(this.parseInt(e,"id"),this.parseInt(e,"time"))},i.prototype.getVariableKey=function(e,i){return new t.KeyVariable(this.parseInt(e,"id"),this.parseInt(e,"time"),2===i?this.parseString(e,"val"):this.parseFloat(e,"val"))},i.prototype.getTimelineKey=function(e,i,n){var r=this.parseInt(e,"time"),o=this.parseInt(e,"spin",1),s=this.parseString(e,"curve_type","linear"),a=this.parseFloat(e,"c1",0),p=this.parseFloat(e,"c2",0),h=this.parseFloat(e,"c3",0),l=this.parseFloat(e,"c4",0),_=this.translateChildElementName("bone"),u=this.translateChildElementName("object"),f=null,c=e.firstElementChild,d=!1;c.tagName===_?(f=new t.KeyBone(i,r,o),this.setMinDefsToElementName("bone")):c.tagName===u&&(this.setMinDefsToElementName("object"),f=new t.KeyObject(i,r,o),d=!0),"linear"!==s&&f.setCurve(t.Types.getCurveTypeForName(s),a,p,h,l);var y=f.info;if(y.x=this.parseFloat(c,"x"),y.y=-this.parseFloat(c,"y"),y.scaleX=this.parseFloat(c,"scale_x",1),y.scaleY=this.parseFloat(c,"scale_y",1),y.angle=360-this.parseFloat(c,"angle"),y.alpha=this.parseFloat(c,"a",1),d){var g=this.parseInt(c,"folder"),m=this.parseInt(c,"file");f.setFolderAndFile(g,m);var T=n.getFolderById(g).getFileById(m);y.pivotX=this.parseFloat(c,"pivot_x",T.pivotX),y.pivotY=1-this.parseFloat(c,"pivot_y",1-T.pivotY)}return this.popMinDefsStack(),f},i.prototype.getTagChange=function(t){return this.parseInt(t,"t")},i}(t.SpriterFile);t.SpriterXml=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e){this._id=t,this._name=e}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t}();t.Item=e}(Spriter||(Spriter={}));var Spriter;!function(t){!function(t){t[t.NO_LOOPING=0]="NO_LOOPING",t[t.LOOPING=1]="LOOPING"}(t.eAnimationLooping||(t.eAnimationLooping={}));var e=(t.eAnimationLooping,function(e){function i(i,n,r,o){e.call(this,i,n),this._length=r,this._loopType=o,this._timelines=new t.IdNameMap,this._lines=new t.IdNameMap}return __extends(i,e),Object.defineProperty(i.prototype,"mainline",{get:function(){return this._mainline},set:function(t){this._mainline=t},enumerable:!0,configurable:!0}),i.prototype.addTimeline=function(t){this._timelines.add(t,t.id,t.name)},i.prototype.getTimelineById=function(t){
  return this._timelines.getById(t)},i.prototype.getTimelineByName=function(t){return this._timelines.getByName(t)},i.prototype.addLine=function(t){this._lines.add(t,this._lines.length,t.name)},i.prototype.getLineById=function(t){return this._lines.getById(t)},i.prototype.getLineByName=function(t){return this._lines.getByName(t)},Object.defineProperty(i.prototype,"linesLength",{get:function(){return this._lines.length},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"loopType",{get:function(){return this._loopType},enumerable:!0,configurable:!0}),i}(t.Item));t.Animation=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n){e.call(this,i,n),this._objectInfos=new t.IdNameMap,this._charMaps=new t.IdNameMap,this._variables=new t.IdNameMap,this._animations=new t.IdNameMap}return __extends(i,e),i.prototype.addObjectInfo=function(t){this._objectInfos.add(t,t.id,t.name)},i.prototype.getObjectInfoById=function(t){return this._objectInfos.getById(t)},i.prototype.getObjectInfoByName=function(t){return this._objectInfos.getByName(t)},i.prototype.addCharMap=function(t){this._charMaps.add(t,t.id,t.name)},i.prototype.getCharMapById=function(t){return this._charMaps.getById(t)},i.prototype.getCharMapByName=function(t){return this._charMaps.getByName(t)},Object.defineProperty(i.prototype,"charMapsLength",{get:function(){return this._charMaps.length},enumerable:!0,configurable:!0}),i.prototype.addVariable=function(t){this._variables.add(t,t.id,t.name)},i.prototype.getVariableById=function(t){return this._variables.getById(t)},i.prototype.getVariableByName=function(t){return this._variables.getByName(t)},Object.defineProperty(i.prototype,"variablesLength",{get:function(){return this._variables.length},enumerable:!0,configurable:!0}),i.prototype.addAnimation=function(t){this._animations.add(t,t.id,t.name)},i.prototype.getAnimationById=function(t){return this._animations.getById(t)},i.prototype.getAnimationByName=function(t){return this._animations.getByName(t)},Object.defineProperty(i.prototype,"animationsLength",{get:function(){return this._animations.length},enumerable:!0,configurable:!0}),i}(t.Item);t.Entity=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(e,i,n,r){t.call(this,e,i),this._pivotX=n,this._pivotY=r}return __extends(e,t),Object.defineProperty(e.prototype,"pivotX",{get:function(){return this._pivotX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivotY",{get:function(){return this._pivotY},enumerable:!0,configurable:!0}),e}(t.Item);t.File=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n){e.call(this,i,n),this._files=new t.IdNameMap}return __extends(i,e),i.prototype.addFile=function(t){this._files.add(t,t.id,t.name)},i.prototype.getFileById=function(t){return this._files.getById(t)},i.prototype.getFileByName=function(t){return this._files.getByName(t)},i}(t.Item);t.Folder=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(){t.apply(this,arguments)}return __extends(e,t),e.prototype.put=function(t,e){void 0===this._map&&(this._map={}),void 0!==this._map[t],this._map[t]=e},e.prototype.value=function(t){return this._map[t]},e}(t.Item);t.CharMap=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t){this._stack=[],this._length=0,this._entity=t}return t.prototype.reset=function(){this._length=0},t.prototype.push=function(t){var e=this.getCharMap(t);this._stack[this._length++]=e},t.prototype.remove=function(t){var e=this.getCharMap(t),i=this.findCharMap(e);if(-1!==i){for(var n=i;n<this._length-2;n++)this._stack[n]=this._stack[n+1];this._stack[--this._length]=null}},t.prototype.getFile=function(t){for(var e=this._length-1;e>=0;e--){var i=this._stack[e].value(t.name);if(void 0!==i)return i}return t},t.prototype.getCharMap=function(t){var e=this._entity.getCharMapByName(t);return e},t.prototype.findCharMap=function(t){for(var e=0;e<this._length;e++)if(this._stack[e]===t)return e;return-1},t}();t.CharMapStack=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e){this._id=t,this._time=e}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},enumerable:!0,configurable:!0}),t}();t.Key=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(){t.apply(this,arguments),this._boneRefs=[],this._objectRefs=[]}return __extends(e,t),Object.defineProperty(e.prototype,"boneRefs",{get:function(){return this._boneRefs},enumerable:!0,configurable:!0}),e.prototype.addBoneRef=function(t){this._boneRefs.push(t)},Object.defineProperty(e.prototype,"objectRefs",{get:function(){return this._objectRefs},enumerable:!0,configurable:!0}),e.prototype.addObjectRef=function(t){this._objectRefs.push(t)},e}(t.Key);t.KeyMainline=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(){t.apply(this,arguments)}return __extends(e,t),Object.defineProperty(e.prototype,"tagsOn",{get:function(){return this._tagsOn},set:function(t){this._tagsOn=t},enumerable:!0,configurable:!0}),e}(t.Key);t.KeyTag=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(e,i,n){t.call(this,e,i),this._value=n}return __extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}(t.Key);t.KeyVariable=e}(Spriter||(Spriter={}));var Spriter;!function(t){!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.MAIN_LINE=1]="MAIN_LINE",t[t.TIME_LINE=2]="TIME_LINE",t[t.SOUND_LINE=3]="SOUND_LINE",t[t.EVENT_LINE=4]="EVENT_LINE",t[t.TAG_LINE=5]="TAG_LINE",t[t.VAR_LINE=6]="VAR_LINE"}(t.eTimelineType||(t.eTimelineType={}));var e=t.eTimelineType,i=function(t){function i(i,n){void 0===n&&(n=null),t.call(this,i,n),this._type=e.UNKNOWN}return __extends(i,t),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"keys",{get:function(){return this._keys},enumerable:!0,configurable:!0}),i.prototype.add=function(t){(null===this._keys||void 0===this._keys)&&(this._keys=[]),this._keys.push(t)},i.prototype.at=function(t,e){if(void 0===e&&(e=!0),0>t)return null;var i=this._keys.length;return t>=i&&(e?t%=i:t=i-1),this._keys[t]},i}(t.Item);t.Baseline=i}(Spriter||(Spriter={}));var Spriter;!function(t){function e(t,e,i){return(e-t)*i+t}function i(t,i,n,r){return e(e(t,i,r),e(i,n,r),r)}function n(t,n,r,o,s){return e(i(t,n,r,s),i(n,r,o,s),s)}function r(t,i,r,o,s,a){return e(n(t,i,r,o,a),n(i,r,o,s,a),a)}function o(t,i,n,o,s,a,p){return e(r(t,i,n,o,s,p),r(i,n,o,s,a,p),p)}function s(t,e,i){var n=1,r=1-i,o=i*i,s=r*r,a=o*i;return 0+3*s*i*t+3*r*o*e+a*n}function a(t,e,i,n,r){for(var o=.001,a=10,p=0,h=1,l=(h+p)/2,_=s(t,i,l),u=0;Math.abs(r-_)>o&&a>u;)r>_?p=l:h=l,l=(h+p)/2,_=s(t,i,l),++u;return s(e,n,l)}function p(t,e,i,n){return 0===i?t:(i>0?e>t&&(e-=360):t>e&&(e+=360),this.linear(t,e,n))}t.linear=e,t.quadratic=i,t.cubic=n,t.quartic=r,t.quintic=o,t.bezier=a,t.angleLinear=p}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(e,i,n,r){t.call(this,e,i),this._type=n,this._default=r,this.reset()}return __extends(e,t),e.prototype.clone=function(){return new e(this.id,this.name,this.type,this._default)},e.prototype.reset=function(){this.value=this._default},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){0===this._type?this._value=Math.floor(t):this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"int",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"float",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"string",{get:function(){return this._value},enumerable:!0,configurable:!0}),e}(t.Item);t.Variable=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n){e.call(this,i,null),this._varDefId=n,this.type=t.eTimelineType.VAR_LINE}return __extends(i,e),Object.defineProperty(i.prototype,"varDefId",{get:function(){return this._varDefId},enumerable:!0,configurable:!0}),i}(t.Baseline);t.Varline=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(e,i,n,r,o,s,a){t.call(this,e,i),this._type=n,this._width=r,this._height=o,this._pivotX=s,this._pivotY=a}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivotX",{get:function(){return this._pivotX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivotY",{get:function(){return this._pivotY},enumerable:!0,configurable:!0}),e}(t.Item);t.ObjectInfo=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(){}return t.getObjectTypeForName=function(e){var i=t.nameToObjectType[e];return i},t.getCurveTypeForName=function(e){var i=t.nameToCurveType[e];return i},t.getVariableTypeForName=function(e){var i=t.nameToVariableType[e];return i},t.nameToObjectType={sprite:0,bone:1,box:2,point:3,sound:4},t.nameToCurveType={instatnt:1,linear:0,quadratic:2,cubic:3,quartic:4,quintic:5,bezier:6},t.nameToVariableType={"int":0,"float":1,string:2},t}();t.Types=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(t,e,i,n,r){void 0===r&&(r=0),this.id=t,this.parent=e,this.timeline=i,this.key=n,this.z=r}return t}();t.Ref=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n,r,o){void 0===r&&(r=0),void 0===o&&(o=-1),e.call(this,i,n),this.type=t.eTimelineType.TIME_LINE,this._objectType=r,this._objectRef=o}return __extends(i,e),Object.defineProperty(i.prototype,"objectType",{get:function(){return this._objectType},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"objectRef",{get:function(){return this._objectRef},enumerable:!0,configurable:!0}),i}(t.Baseline);t.Timeline=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n,r){e.call(this,i,n),this._info=new t.SpatialInfo,this._spin=r,this.setCurve(0)}return __extends(i,e),i.prototype.setCurve=function(t,e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),this._curveType=t,this._c1=e,this._c2=i,this._c3=n,this._c4=r},Object.defineProperty(i.prototype,"spin",{get:function(){return this._spin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"curveType",{get:function(){return this._curveType},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"c1",{get:function(){return this._c1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"c2",{get:function(){return this._c2},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"c3",{get:function(){return this._c3},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"c4",{get:function(){return this._c4},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"info",{get:function(){return this._info},enumerable:!0,configurable:!0}),i}(t.Key);t.KeyTimeline=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function t(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.pivotX=0,this.pivotY=0,this.alpha=1,this.angle=0}return t}();t.SpatialInfo=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(){t.apply(this,arguments)}return __extends(e,t),e.prototype.setFolderAndFile=function(t,e){this._folder=t,this._file=e},Object.defineProperty(e.prototype,"folder",{get:function(){return this._folder},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"file",{get:function(){return this._file},enumerable:!0,configurable:!0}),e}(t.KeyTimeline);t.KeyObject=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(){t.apply(this,arguments)}return __extends(e,t),e}(t.KeyTimeline);t.KeyBone=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function e(){}return e.prototype.load=function(e){this._spriter=new t.Spriter,this._fileType=e.getType();var i=e.getNodes("folder");this.loadFolders(this._spriter,i),i.processed();var n=e.getNodes("tag_list");this.loadTags(this._spriter,n),n.processed();var r=e.getNodes("entity");return this.loadEntities(this._spriter,r),r.processed(),this._spriter},e.prototype.loadFolders=function(t,e){for(var i=0;i<e.length();i++){var n=e.getFolder(i),r=e.getChildNodes(i,"file");this.loadFiles(n,r),r.processed(),t.addFolder(n)}},e.prototype.loadFiles=function(t,e){for(var i=0;i<e.length();i++){var n=e.getFile(i);null!==n&&t.addFile(n)}},e.prototype.loadTags=function(e,i){if(0!==i.length()){var n;n=this._fileType!==t.eFileType.JSON?i.getChildNodes(0,"i"):i;for(var r=0;r<n.length();r++){var o=n.getTag(r);e.addTag(o)}this._fileType!==t.eFileType.JSON&&n.processed()}},e.prototype.loadEntities=function(t,e){for(var i=0;i<e.length();i++){var n=e.getEntity(i),r=e.getChildNodes(i,"obj_info");this.loadObjInfo(n,r),r.processed();var o=e.getChildNodes(i,"character_map");this.loadCharMaps(n,o),o.processed();var s=e.getChildNodes(i,"var_defs");this.loadVariables(n,s),s.processed();var a=e.getChildNodes(i,"animation");this.loadAnimations(n,a),a.processed(),t.addEntity(n)}},e.prototype.loadObjInfo=function(t,e){for(var i=0;i<e.length();i++){var n=e.getObjectInfo(i);t.addObjectInfo(n)}},e.prototype.loadCharMaps=function(t,e){for(var i=0;i<e.length();i++){var n=e.getCharMap(i),r=e.getChildNodes(i,"map");this.loadCharMapEntries(n,r),r.processed(),t.addCharMap(n)}},e.prototype.loadCharMapEntries=function(t,e){for(var i=0;i<e.length();i++)e.getCharMapEntry(i,t,this._spriter)},e.prototype.loadVariables=function(e,i){if(0!==i.length()){var n;n=this._fileType!==t.eFileType.JSON?i.getChildNodes(0,"i"):i;for(var r=0;r<n.length();r++){var o=n.getVariable(r);e.addVariable(o)}this._fileType!==t.eFileType.JSON&&n.processed()}},e.prototype.loadAnimations=function(e,i){for(var n=0;n<i.length();n++){var r=i.getAnimation(n),o=i.getChildNodes(n,"mainline");this.loadMainline(r,o),o.processed();var s=i.getChildNodes(n,"timeline");this.loadTimelines(r,s),s.processed();var a=i.getChildNodes(n,"soundline");this.loadSoundlines(r,a),a.processed();var p=i.getChildNodes(n,"eventline");this.loadEventlines(r,p),p.processed();var h=i.getChildNodes(n,"meta");if(h.length()>0){var l=h.getChildNodes(0,this._fileType!==t.eFileType.JSON?"varline":"valline");this.loadVarlines(e,r,l),l.processed();var _=h.getChildNodes(0,"tagline");this.loadTaglines(r,_),_.processed()}h.processed(),e.addAnimation(r)}},e.prototype.loadMainline=function(e,i){var n=i.getMainline(0);n.type=t.eTimelineType.MAIN_LINE;var r=i.getChildNodes(0,"key");this.loadMainlineKeys(n,r),r.processed(),e.mainline=n},e.prototype.loadMainlineKeys=function(t,e){for(var i=0;i<e.length();i++){for(var n=e.getMainlineKey(i),r=e.getChildNodes(i,"bone_ref"),o=0;o<r.length();o++)n.addBoneRef(r.getRef(o));r.processed();for(var s=e.getChildNodes(i,"object_ref"),a=0;a<s.length();a++)n.addObjectRef(s.getRef(a));s.processed(),t.add(n)}},e.prototype.loadTimelines=function(t,e){for(var i=0;i<e.length();i++){var n=e.getTimeline(i),r=e.getChildNodes(i,"key");this.loadTimelineKeys(n,r),r.processed(),t.addTimeline(n)}},e.prototype.loadTimelineKeys=function(t,e){for(var i=0;i<e.length();i++){var n=e.getTimelineKey(i,this._spriter);t.add(n)}},e.prototype.loadSoundlines=function(e,i){for(var n=0;n<i.length();n++){var r=i.getSoundline(n);r.type=t.eTimelineType.SOUND_LINE;var o=i.getChildNodes(n,"key");this.loadKeys(r,o),o.processed(),e.addLine(r)}},e.prototype.loadKeys=function(t,e){for(var i=0;i<e.length();i++){var n=e.getKey(i);t.add(n)}},e.prototype.loadEventlines=function(e,i){for(var n=0;n<i.length();n++){var r=i.getEventline(n);r.type=t.eTimelineType.EVENT_LINE;var o=i.getChildNodes(n,"key");this.loadKeys(r,o),o.processed(),e.addLine(r)}},e.prototype.loadTaglines=function(e,i){for(var n=0;n<i.length();n++){var r=i.getTagline(n);r.type=t.eTimelineType.TAG_LINE;var o=i.getChildNodes(n,"key");this.loadTagKeys(r,o),o.processed(),e.addLine(r)}},e.prototype.loadTagKeys=function(t,e){for(var i=0;i<e.length();i++){var n=e.getTagKey(i),r=e.getChildNodes(i,"tag"),o=r.getTagChanges(this._spriter);r.processed(),n.tagsOn=o,t.add(n)}},e.prototype.loadVarlines=function(t,e,i){for(var n=0;n<i.length();n++){var r=i.getVarline(n),o=t.getVariableById(r.varDefId).type,s=i.getChildNodes(n,"key");this.loadVariableKeys(r,s,o),s.processed(),e.addLine(r)}},e.prototype.loadVariableKeys=function(t,e,i){for(var n=0;n<e.length();n++){var r=e.getVariableKey(n,i);t.add(r)}},e}();t.Loader=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function e(){this._folders=new t.IdNameMap,this._tags=new t.IdNameMap,this._entities=new t.IdNameMap}return e.prototype.addFolder=function(t){this._folders.add(t,t.id,t.name)},e.prototype.getFolderById=function(t){return this._folders.getById(t)},e.prototype.getFolderByName=function(t){return this._folders.getByName(t)},e.prototype.addEntity=function(t){this._entities.add(t,t.id,t.name)},e.prototype.getEntityById=function(t){return this._entities.getById(t)},e.prototype.getEntityByName=function(t){return this._entities.getByName(t)},e.prototype.addTag=function(t){this._tags.add(t,t.id,t.name)},e.prototype.getTagById=function(t){return this._tags.getById(t)},e.prototype.getTagByName=function(t){return this._tags.getByName(t)},Object.defineProperty(e.prototype,"tagsLength",{get:function(){return this._tags.length},enumerable:!0,configurable:!0}),e}();t.Spriter=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(){function e(){this.timeline=-1,this.timelineKey=-1,this.transformed=new t.SpatialInfo}return e.prototype.setOn=function(t){this._on=t},Object.defineProperty(e.prototype,"on",{get:function(){return this._on},enumerable:!0,configurable:!0}),e.prototype.setKey=function(i,n,r,o){this.timeline=r,this.timelineKey=o;var s=n.getTimelineById(r);this.name=s.name,this.objectInfo=-1===s.objectRef?null:i.getObjectInfoById(s.objectRef);var a=s.at(o),p=s.at(o+1,n.loopType!==t.eAnimationLooping.NO_LOOPING);this.key=a,this.timeFrom=a.time,this.timeTo=p.time,this.timeTo<this.timeFrom&&(this.timeTo=n.length),this.from=a.info,this.to=p.info,this.updateMask=0,Math.abs(this.from.x-this.to.x)>.001&&(this.updateMask+=e.UPDATE_X),Math.abs(this.from.y-this.to.y)>.001&&(this.updateMask+=e.UPDATE_Y),Math.abs(this.from.scaleX-this.to.scaleX)>.001&&(this.updateMask+=e.UPDATE_SCALE_X),Math.abs(this.from.scaleY-this.to.scaleY)>.001&&(this.updateMask+=e.UPDATE_SCALE_Y),Math.abs(this.from.pivotX-this.to.pivotX)>.001&&(this.updateMask+=e.UPDATE_PIVOT_X),Math.abs(this.from.pivotY-this.to.pivotY)>.001&&(this.updateMask+=e.UPDATE_PIVOT_Y),Math.abs(this.from.alpha-this.to.alpha)>.001&&(this.updateMask+=e.UPDATE_ALPHA),Math.abs(this.from.angle-this.to.angle)>.001&&(this.updateMask+=e.UPDATE_ANGLE),this.transformed.x=this.from.x,this.transformed.y=this.from.y,this.transformed.scaleX=this.from.scaleX,this.transformed.scaleY=this.from.scaleY,this.transformed.pivotX=this.from.pivotX,this.transformed.pivotY=this.from.pivotY,this.transformed.angle=this.from.angle,this.transformed.alpha=this.from.alpha},e.prototype.tween=function(i){var n=this.updateMask>0?this.getTweenTime(i):0;this.transformed.x=(this.updateMask&e.UPDATE_X)>0?t.linear(this.from.x,this.to.x,n):this.from.x,this.transformed.y=(this.updateMask&e.UPDATE_Y)>0?t.linear(this.from.y,this.to.y,n):this.from.y,this.transformed.scaleX=(this.updateMask&e.UPDATE_SCALE_X)>0?t.linear(this.from.scaleX,this.to.scaleX,n):this.from.scaleX,this.transformed.scaleY=(this.updateMask&e.UPDATE_SCALE_Y)>0?t.linear(this.from.scaleY,this.to.scaleY,n):this.from.scaleY,this.transformed.pivotX=(this.updateMask&e.UPDATE_PIVOT_X)>0?t.linear(this.from.pivotX,this.to.pivotX,n):this.from.pivotX,this.transformed.pivotY=(this.updateMask&e.UPDATE_PIVOT_Y)>0?t.linear(this.from.pivotY,this.to.pivotY,n):this.from.pivotY,this.transformed.alpha=(this.updateMask&e.UPDATE_ALPHA)>0?t.linear(this.from.alpha,this.to.alpha,n):this.from.alpha,this.transformed.angle=(this.updateMask&e.UPDATE_ANGLE)>0?t.angleLinear(this.from.angle,this.to.angle,this.key.spin,n):this.from.angle},e.prototype.update=function(t){this.transformed.angle*=Phaser.Math.sign(t.scaleX)*Phaser.Math.sign(t.scaleY),this.transformed.angle+=t.angle,this.transformed.scaleX*=t.scaleX,this.transformed.scaleY*=t.scaleY,this.scalePosition(t.scaleX,t.scaleY),this.rotatePosition(t.angle),this.translatePosition(t.x,t.y),this.transformed.alpha*=t.alpha},e.prototype.scalePosition=function(t,e){this.transformed.x*=t,this.transformed.y*=e},e.prototype.rotatePosition=function(t){var e=this.transformed.x,i=this.transformed.y;if(0!==e||0!==i){var n=t*(Math.PI/180),r=Math.cos(n),o=Math.sin(n);this.transformed.x=e*r-i*o,this.transformed.y=e*o+i*r}},e.prototype.translatePosition=function(t,e){this.transformed.x+=t,this.transformed.y+=e},e.prototype.getTweenTime=function(e){if(1===this.key.curveType)return 0;var i=Phaser.Math.clamp((e-this.timeFrom)/(this.timeTo-this.timeFrom),0,1);switch(this.key.curveType){case 0:return i;case 2:return t.quadratic(0,this.key.c1,1,i);case 3:return t.cubic(0,this.key.c1,this.key.c2,1,i);case 4:return t.quartic(0,this.key.c1,this.key.c2,this.key.c3,1,i);case 5:return t.quintic(0,this.key.c1,this.key.c2,this.key.c3,this.key.c4,1,i);case 6:return t.bezier(this.key.c1,this.key.c2,this.key.c3,this.key.c4,i)}return 0},e.UPDATE_X=1,e.UPDATE_Y=2,e.UPDATE_SCALE_X=4,e.UPDATE_SCALE_Y=8,e.UPDATE_PIVOT_X=16,e.UPDATE_PIVOT_Y=32,e.UPDATE_ANGLE=64,e.UPDATE_ALPHA=128,e}();t.SpriterBone=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(e){function i(i,n,r,o,s,a){e.call(this,i,null),this.onLoop=new Phaser.Signal,this.onFinish=new Phaser.Signal,this.onSound=new Phaser.Signal,this.onEvent=new Phaser.Signal,this.onTagChange=new Phaser.Signal,this.onVariableSet=new Phaser.Signal,this._mainlineStepper=new t.LineStepper,this._lineSteppers=[],this._lineSteppersCount=0,this._bones=[],this._objects=[],this._tags=0,this._vars=[],this._paused=!1,this._spriter=n,this._entityName=o,this._entity=n.getEntityByName(o),this._textureKey=r,this._root=new t.SpatialInfo;for(var p=0;p<this._entity.variablesLength;p++)this._vars[p]=this._entity.getVariableById(p).clone();this._charMapStack=new t.CharMapStack(this._entity),void 0===a&&(a=100),this.setAnimationSpeedPercent(a),void 0===s||null===s?this.playAnimationById(0):"number"==typeof s?this.playAnimationById(s):this.playAnimationByName(s)}return __extends(i,e),Object.defineProperty(i.prototype,"spriter",{get:function(){return this._spriter},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"entity",{get:function(){return this._entity},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"charMapStack",{get:function(){return this._charMapStack},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"paused",{get:function(){return this._paused},set:function(t){this.paused=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationsCount",{get:function(){return this._entity.animationsLength},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentAnimationName",{get:function(){return this._animationName},enumerable:!0,configurable:!0}),i.prototype.pushCharMap=function(t){this._charMapStack.push(t),this.resetSprites()},i.prototype.removeCharMap=function(t){this._charMapStack.remove(t),this.resetSprites()},i.prototype.clearCharMaps=function(){this._charMapStack.reset(),this.resetSprites()},i.prototype.resetSprites=function(){for(var t=0;t<this._objects.length;t++)this._objects[t].resetFile()},i.prototype.isTagOn=function(t){return this.isTagOnById(this._spriter.getTagByName(t).id)},i.prototype.isTagOnById=function(t){return(this._tags&1<<t)>0},i.prototype.getVariable=function(t){return this.getVariableById(this._entity.getVariableByName(t).id)},i.prototype.getVariableById=function(t){return this._vars[t]},i.prototype.getObject=function(t){for(var e=0;e<this._objects.length;e++){var i=this._objects[e];if(i.name===t)return i}return null},i.prototype.setAnimationSpeedPercent=function(t){void 0===t&&(t=100),this._animationSpeed=t/100},i.prototype.playAnimationById=function(t){var e=this._entity.getAnimationById(t);void 0!==e&&null!==e&&this.playAnimation(e)},i.prototype.playAnimationByName=function(t){var e=this._entity.getAnimationByName(t);void 0!==e&&null!==e&&this.playAnimation(e)},i.prototype.playAnimation=function(t){this._animationName=t.name,this._animation=t,this._finished=!1,this._mainlineStepper.reset(),this._mainlineStepper.line=this._animation.mainline,this._time=0,this.resetLines(),this._tags=0;for(var e=0;e<this._vars.length;e++)this._vars[e].reset();this.loadKeys(this._animation.mainline.at(0),!0),this.updateCharacter()},i.prototype.resetLines=function(){this._lineSteppersCount=0;for(var e=0;e<this._animation.linesLength;e++){var i=this._animation.getLineById(e);this._lineSteppersCount>=this._lineSteppers.length&&(this._lineSteppers[this._lineSteppersCount]=new t.LineStepper);var n=this._lineSteppers[this._lineSteppersCount++];n.reset(),n.line=i}},i.prototype.setBones=function(e,i){void 0===i&&(i=!1);for(var n=0;n<this._bones.length;n++)void 0!==this._bones[n]&&this._bones[n].setOn(!1);for(var n=0;n<e.length;n++){var r=e[n];if(void 0===this._bones[r.id]){var o=new t.SpriterBone;o.type=1,this._bones[r.id]=o}var s=this._bones[r.id];s.setOn(!0),s.parent=r.parent,(s.timelineKey!==r.key||s.timeline!==r.timeline||i)&&s.setKey(this._entity,this._animation,r.timeline,r.key)}},i.prototype.setObjects=function(e,i){void 0===i&&(i=!1);for(var n=0;n<this._objects.length;n++)void 0!==this._objects[n]&&this._objects[n].setOn(!1);for(var r=!1,n=0;n<e.length;n++){var o=e[n],s=null,a=null;void 0===this._objects[o.id]?(a=new Phaser.Sprite(this.game,0,0,this._textureKey),s=new t.SpriterObject(this,a),this._objects[o.id]=s,this.add(a)):(s=this._objects[o.id],a=s.sprite),s.parent=o.parent,s.type=this._animation.getTimelineById(o.timeline).objectType,0===s.type&&(s.setOn(!0),s.sprite.z!==o.z&&(s.sprite.z=o.z,r=!0)),(s.timelineKey!==o.key||s.timeline!==o.timeline||i)&&s.setKey(this._entity,this._animation,o.timeline,o.key)}r&&this.sort()},i.prototype.loadKeys=function(t,e){void 0===e&&(e=!1),this.setBones(t.boneRefs,e),this.setObjects(t.objectRefs,e)},i.prototype.updateAnimation=function(){if(!this._paused&&!this._finished){var e=this._mainlineStepper;this._time>this._animation.length&&(this._animation.loopType===t.eAnimationLooping.NO_LOOPING?(this._time=this._animation.length,this._finished=!0):(this._time-=this._animation.length,this.onLoop.dispatch(this)));for(var i;null!==(i=e.step(this._time));)this.loadKeys(i),e.lastTime=i.time;this.updateCharacter(),this.updateLines(),this._finished&&this.onFinish.dispatch(this),this._time+=this.game.time.physicsElapsedMS*this._animationSpeed}},i.prototype.updateCharacter=function(){for(var t=0;t<this._bones.length;t++){var e=this._bones[t];if(e.on){var i=-1===e.parent?this._root:this._bones[e.parent].transformed;e.tween(this._time),e.update(i)}}for(var t=0;t<this._objects.length;t++){var n=this._objects[t];if(n.on){var i=-1===n.parent?this._root:this._bones[n.parent].transformed;n.tween(this._time),n.update(i)}}},i.prototype.updateLines=function(){for(var e=this._lineSteppersCount-1;e>=0;e--)for(var i,n=this._lineSteppers[e],r=n.line;null!==(i=n.step(this._time));){switch(r.type){case t.eTimelineType.SOUND_LINE:this.onSound.dispatch(this,r.name);break;case t.eTimelineType.EVENT_LINE:this.onEvent.dispatch(this,r.name);break;case t.eTimelineType.TAG_LINE:var o=i.tagsOn,s=this._tags^o;this._tags=o;for(var a=0;a<this._spriter.tagsLength;a++){var p=1<<a;s&p&&this.onTagChange.dispatch(this,this._spriter.getTagById(a).name,(o&p)>0)}break;case t.eTimelineType.VAR_LINE:var h=i.value,l=this._vars[r.varDefId];l.value=h,this.onVariableSet.dispatch(this,l)}n.lastTime=i.time}},i}(Phaser.Group);t.SpriterGroup=e}(Spriter||(Spriter={}));var Spriter;!function(t){var e=function(t){function e(e,i){t.call(this),this._spriter=e.spriter,this._charMapStack=e.charMapStack,this._sprite=i}return __extends(e,t),Object.defineProperty(e.prototype,"sprite",{get:function(){return this._sprite},enumerable:!0,configurable:!0}),e.prototype.setOn=function(e){t.prototype.setOn.call(this,e),this._sprite.exists=e,this._sprite.visible=e&&!this._hide},e.prototype.setKey=function(e,i,n,r){if(t.prototype.setKey.call(this,e,i,n,r),0===this.type){var o=this.key,s=this._spriter.getFolderById(o.folder).getFileById(o.file);this._file=s,this.setFile(s)}else this._file=null},e.prototype.resetFile=function(){0===this.type&&this.setFile(this._file)},e.prototype.setFile=function(t){t=this._charMapStack.getFile(t),null!==t?(this._hide=!1,this._sprite.frameName=t.name):(this._hide=!0,this._sprite.visible=!1)},e.prototype.update=function(e){t.prototype.update.call(this,e),this.updateSprite()},e.prototype.updateSprite=function(){var t=this.transformed,e=this.sprite;e.position.set(t.x,t.y),e.scale.set(t.scaleX,t.scaleY),e.anchor.set(t.pivotX,t.pivotY),e.alpha=t.alpha,e.angle=t.angle},e}(t.SpriterBone);t.SpriterObject=e}(Spriter||(Spriter={}));