"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.geometry=new t.GeometryData;return a}a.toString=function(){return"[class dragonBones.SurfaceData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return a}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,u,f){if(h===void 0){h=null}if(u===void 0){u=null}if(f===void 0){f=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var u=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(a._onSortSlots);if(this._zIndexDirty){for(var r=0,i=this._slots.length;r0){for(var f=0,_=this._actions;f<_.length;f++){var m=_[f];var p=m.actionData;if(p!==null){if(p.type===0){if(m.slot!==null){var c=m.slot.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}else if(m.bone!==null){for(var d=0,y=this.getSlots();d0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=r){return this.globalTransformMatrix}n=a>this._kX*(t+r)+d;p=((o*l+o+l+l+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=m*(h+2);var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[2]-(l-m)*D;var A=this._hullCache[3]-(l-m)*T;var P=this._vertices;if(n){this._getAffineTransform(-r,d+f,i-r,f,P[g+h+2],P[g+h+3],b+D,A+T,P[g],P[g+1],e._helpTransform,v,true)}else{this._getAffineTransform(-i,d,i-r,f,b,A,P[g],P[g+1],b+D,A+T,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(t>=r){if(a<-r||a>=r){return this.globalTransformMatrix}n=a>this._kX*(t-i)+d;p=((o*l+o+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=(m+1)*(h+2)-2;var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[0]+m*D;var A=this._hullCache[1]+m*T;var P=this._vertices;if(n){this._getAffineTransform(i,d+f,i-r,f,b+D,A+T,P[g+h+2],P[g+h+3],b,A,e._helpTransform,v,true)}else{this._getAffineTransform(r,d,i-r,f,P[g],P[g+1],b,A,P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a<-r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)-i;p=((o*l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,-r,u,i-r,P[g+2],P[g+3],P[g],P[g+1],b+D,A+T,e._helpTransform,v,true)}else{this._getAffineTransform(c,-i,u,i-r,b,A,b+D,A+T,P[g],P[g+1],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a>=r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)+r;p=((o*l+o+l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,i,u,i-r,b+D,A+T,b,A,P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,r,u,i-r,P[g],P[g+1],P[g+2],P[g+3],b,A,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else{n=a>this._k*(t-c-u)+d;p=((o*m+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2+m*(h+2);var P=this._vertices;if(n){this._getAffineTransform(c+u,d+f,u,f,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,d,u,f,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}return v};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n*2;this._deformVertices.length=n*2;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(u)}if(u&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var f=1e3;var _=200;var m=2*this.global.x;var p=2*this.global.y;var c=e._helpPoint;this.globalTransformMatrix.transformPoint(f,-_,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=m-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(_,f,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=m-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.deformVertices=[];return e}e.toString=function(){return"[class dragonBones.DisplayFrame]"};e.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};e.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var o=0,l=n;o=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};r.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};r.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};r.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceDisplay=function(e,a){if(a===void 0){a=-1}if(a<0){a=this._displayIndex<0?0:this._displayIndex}else if(a>=this._displayFrames.length){return}var r=this._displayFrames[a];if(r.display!==e){var i=r.display;r.display=e;if(i!==null&&i!==this._rawDisplay&&i!==this._meshDisplay&&!this._hasDisplay(i)){if(i instanceof t.Armature){}else{this._disposeDisplay(i,true)}}if(e!==null&&e!==this._rawDisplay&&e!==this._meshDisplay&&!this._hasDisplay(i)&&!(e instanceof t.Armature)){this._initDisplay(e,true)}if(a===this._displayIndex){this._displayDirty=true}}};r.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);return this._boundingBoxData.containsPoint(r._helpPoint.x,r._helpPoint.y)};r.prototype.intersectsSegment=function(t,e,a,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);t=r._helpPoint.x;e=r._helpPoint.y;r._helpMatrix.transformPoint(a,i,r._helpPoint);a=r._helpPoint.x;i=r._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,i,n,s,o);if(l>0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),r._helpPoint,true);o.x=Math.atan2(r._helpPoint.y,r._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),r._helpPoint,true);o.y=Math.atan2(r._helpPoint.y,r._helpPoint.x)}}return l};r.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(r.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var r=this._displayFrames.length;if(ra){for(var i=r-1;id){continue}var b=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){b=c/A}else{var P=y[D-1];b=(c-P)/(A-P)}break}if(D!==p){p=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,M=0,I=0,F=0,C=0;var w,N,R,k,j,L,V,Y;for(var v=0,X=2;vd){continue}for(;;D++){var W=S[D];if(z>W)continue;if(D===0)z/=W;else{var K=S[D-1];z=(z-K)/(W-K)}break}if(D!==p){p=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];M=f[Z+4];I=f[Z+5];F=f[Z+6];C=f[Z+7];w=(O-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-O+F)*.006;k=((E-I)*3-x+C)*.006;j=w*2+R;L=N*2+k;V=(B-O)*.3+w+R*.16666667;Y=(E-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);U[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);U[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);U[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);U[9]=G;H=0}z*=G;for(;;H++){var q=U[H];if(z>q)continue;if(H===0)z/=q;else{var K=U[H-1];z=H+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,E,M,I,F,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[u+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var B=this.rotateMix;var E=this.translateMix;for(var c=0,M=3;c0){var N=g.a,R=g.b,k=g.c,j=g.d,L=void 0,V=void 0,Y=void 0;if(u){L=A[M-1]}else{L=Math.atan2(F,I)}L-=Math.atan2(R,N);if(x){V=Math.cos(L);Y=Math.sin(L);var X=y._boneData.length;S+=(X*(V*N-Y*R)-I)*B;O+=(X*(Y*N+V*R)-F)*B}else{L+=P}if(L>t.Transform.PI){L-=t.Transform.PI_D}else if(L<-t.Transform.PI){L+=t.Transform.PI_D}L*=B;V=Math.cos(L);Y=Math.sin(L);g.a=V*N-Y*R;g.b=Y*N+V*R;g.c=V*k-Y*j;g.d=Y*k+V*j}y.global.fromMatrix(g)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,u=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var f=0,_=this._armature.getSlots();f<_.length;f++){var m=_[f];var p=m.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(a)&&p.animation.getState(a)===null){p.animation.fadeIn(a)}}for(var c in r.animationTimelines){var d=this.fadeIn(c,0,1,o.layer,"",5);if(d===null){continue}var y=r.animationTimelines[c];d.actionEnabled=false;d.resetToPose=false;d.stop();o.addState(d,y);var v=this._animationStates.indexOf(o);var g=this._animationStates.indexOf(d);if(g0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getBlendState=function(e,a,r){if(!(e in this._blendStates)){this._blendStates[e]={}}var i=this._blendStates[e];if(!(a in i)){var n=i[a]=t.BaseObject.borrowObject(t.BlendState);n.target=r}return i[a]};a.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return a}(t.BaseObject);t.Animation=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}r.toString=function(){return"[class dragonBones.AnimationState]"};r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(D,1);n.returnToPool()}D=this._boneBlendTimelines.indexOf(n);if(D>=0){this._boneBlendTimelines.splice(D,1);n.returnToPool()}}}}{var T={};var b=[];for(var A=0,P=this._slotTimelines;A=0){this._slotTimelines.splice(D,1);n.returnToPool()}D=this._slotBlendTimelines.indexOf(n);if(D>=0){this._slotBlendTimelines.splice(D,1);n.returnToPool()}}}}};r.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}};r.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additive=r.additive;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.blendType=a.blendType;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;this._weight=r.weight;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var p=m.target;h=p.update(this);u=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};r.prototype.play=function(){this._playheadState=3};r.prototype.stop=function(){this._playheadState&=1};r.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};r.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};r.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(t.BaseObject);t.BlendState=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+1;if(e===1){this._current=a[r];this._difference=a[i]-this._current}else{this._current=a[r]*e;this._difference=a[i]*e-this._current}}else{this._result=a[r]*e}}else{this._result=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return e}(a);t.SingleValueTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+2;if(e===1){this._currentA=a[r];this._currentB=a[r+1];this._differenceA=a[i]-this._currentA;this._differenceB=a[i+1]-this._currentB}else{this._currentA=a[r]*e;this._currentB=a[r+1]*e;this._differenceA=a[i]*e-this._currentA;this._differenceB=a[i+1]*e-this._currentB}}else{this._resultA=a[r]*e;this._resultB=a[r+1]*e}}else{this._resultA=0;this._resultB=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return e}(a);t.DoubleValueTimelineState=i;var n=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._rd=[];return e}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount;var a=this._rd;if(this._timelineData!==null){var r=this._valueScale;var i=this._valueArray;var n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(r===1){for(var o=0;o0){if(s.hasDBEventListener(t.EventObject.COMPLETE)){u=t.BaseObject.borrowObject(t.EventObject);u.type=t.EventObject.COMPLETE;u.armature=this._armature;u.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var _=Math.floor(this.currentTime*this._frameRate);var m=this._frameIndices[f.frameIndicesOffset+_];if(this._frameIndex!==m){var p=this._frameIndex;this._frameIndex=m;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(l){if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];if(this.currentPlayTimes===r){if(p===m){p=-1}}}while(p>=0){var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration){this._onCrossFrame(p)}if(h!==null&&p===0){this._armature._dragonBones.bufferEvent(h);h=null}if(p>0){p--}else{p=this._frameCount-1}if(p===m){break}}}else{if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this.currentPlayTimes===r){if(i<=y){if(p>0){p--}else{p=this._frameCount-1}}else if(p===m){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])};a.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=t.Transform.normalizeRadian(this._differenceA);this._differenceB=t.Transform.normalizeRadian(this._differenceB)}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._resultA=t.Transform.normalizeRadian(this._resultA);this._resultB=t.Transform.normalizeRadian(this._resultB)};a.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=n[s+2];this._deformCount=n[s+1];this._deformOffset=n[s+3];this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=i.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._difference=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.parent.parent;var a=e.colorArray;var r=e.frameIntArray;var i=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var n=r[i];if(n<0){n+=65536}if(this._isTween){this._current[0]=a[n++];this._current[1]=a[n++];this._current[2]=a[n++];this._current[3]=a[n++];this._current[4]=a[n++];this._current[5]=a[n++];this._current[6]=a[n++];this._current[7]=a[n++];if(this._frameIndex===this._frameCount-1){n=r[this._animationData.frameIntOffset+this._frameValueOffset]}else{n=r[i+1]}if(n<0){n+=65536}this._difference[0]=a[n++]-this._current[0];this._difference[1]=a[n++]-this._current[1];this._difference[2]=a[n++]-this._current[2];this._difference[3]=a[n++]-this._current[3];this._difference[4]=a[n++]-this._current[4];this._difference[5]=a[n++]-this._current[5];this._difference[6]=a[n++]-this._current[6];this._difference[7]=a[n++]-this._current[7]}else{this._result[0]=a[n++]*.01;this._result[1]=a[n++]*.01;this._result[2]=a[n++]*.01;this._result[3]=a[n++]*.01;this._result[4]=a[n++];this._result[5]=a[n++];this._result[6]=a[n++];this._result[7]=a[n++]}}else{var s=this.target;var o=s.slotData.color;this._result[0]=o.alphaMultiplier;this._result[1]=o.redMultiplier;this._result[2]=o.greenMultiplier;this._result[3]=o.blueMultiplier;this._result[4]=o.alphaOffset;this._result[5]=o.redOffset;this._result[6]=o.greenOffset;this._result[7]=o.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};e.prototype.fadeOut=function(){this._isTween=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._isTween||this.dirty){var a=this.target;var r=a._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){var i=Math.pow(this._animationState._fadeProgress,4);r.alphaMultiplier+=(this._result[0]-r.alphaMultiplier)*i;r.redMultiplier+=(this._result[1]-r.redMultiplier)*i;r.greenMultiplier+=(this._result[2]-r.greenMultiplier)*i;r.blueMultiplier+=(this._result[3]-r.blueMultiplier)*i;r.alphaOffset+=(this._result[4]-r.alphaOffset)*i;r.redOffset+=(this._result[5]-r.redOffset)*i;r.greenOffset+=(this._result[6]-r.greenOffset)*i;r.blueOffset+=(this._result[7]-r.blueOffset)*i;a._colorDirty=true}}else if(this.dirty){this.dirty=false;if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){r.alphaMultiplier=this._result[0];r.redMultiplier=this._result[1];r.greenMultiplier=this._result[2];r.blueMultiplier=this._result[3];r.alphaOffset=this._result[4];r.redOffset=this._result[5];r.greenOffset=this._result[6];r.blueOffset=this._result[7];a._colorDirty=true}}}};return e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var e=this.target;var a=e.target;this._result=a.slotData.zIndex}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=f;var _=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var n=this._animationData.parent.parent;var s=n.frameIntArray;var o=this.target.target;this.geometryOffset=s[i+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var l=0,h=o.displayFrameCount;l1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;e._weight=this._currentB}else{var a=e._constraintData;e._bendPositive=a.bendPositive;e._weight=a.weight}e.invalidUpdate();this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=m;var p=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.currentTime=this._result*e.totalTime}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=p;var c=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.weight=this._result}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=c;var d=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.parameterX=this._resultA;e.parameterY=this._resultB}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=d})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var a=e!==null&&e.apply(this,arguments)||this;a._rawTextureAtlasIndex=0;a._rawBones=[];a._data=null;a._armature=null;a._bone=null;a._geometry=null;a._slot=null;a._skin=null;a._mesh=null;a._animation=null;a._timeline=null;a._rawTextureAtlases=null;a._frameValueType=0;a._defaultColorOffset=-1;a._prevClockwise=0;a._prevRotation=0;a._frameDefaultValue=0;a._frameValueScale=1;a._helpMatrixA=new t.Matrix;a._helpMatrixB=new t.Matrix;a._helpTransform=new t.Transform;a._helpColorTransform=new t.ColorTransform;a._helpPoint=new t.Point;a._helpArray=[];a._intArray=[];a._floatArray=[];a._frameIntArray=[];a._frameFloatArray=[];a._frameArray=[];a._timelineArray=[];a._colorArray=[];a._cacheRawMeshes=[];a._cacheMeshes=[];a._actionFrames=[];a._weightSlotPose={};a._weightBonePoses={};a._cacheBones={};a._slotChildActions={};return a}r._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};r._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};r._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var p=3*l*f;var c=3*u*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(t,e,r,i,n){var s=this._armature.actions.length;var o=this._parseActionData(t,r,i,n);var l=0;var h=null;for(var u=0,f=o;ue){break}l++}if(h===null){h=new a;h.frameStart=e;this._actionFrames.splice(l,0,h)}for(var d=0;d0){var p=i.getBone(_);if(p!==null){m.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(m)}}if(m.name in this._cacheBones){for(var c=0,d=this._cacheBones[m.name];c0&&a.parent!==null){s.root=a.parent;s.bone=a}else{s.root=a;s.bone=null}return s};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break}case 1:{var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var u=0,f=h;u0?i:a;if(t.DataParser.SHARE in e){d.geometry.data=this._data;this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}break}case 3:{var y=this._parseBoundingBox(e);if(y!==null){var v=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=a;v.path=i.length>0?i:a;v.boundingBox=y}break}case 4:{var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.curveLengths.length=g.length;for(var T=0,b=g.length;Ta.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(r._getString(e,t.DataParser.BLEND_TYPE,""));a.frameCount=r._getNumber(e,t.DataParser.DURATION,0);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(t.DataParser.TIMELINE in e){var h=e[t.DataParser.TIMELINE];for(var S=0,O=h;S0&&n in e){i=e[n]}if(i===null){return null}var f=i.length;if(f===0){return null}var _=this._frameIntArray.length;var m=this._frameFloatArray.length;var p=this._timelineArray.length;if(u===null){u=t.BaseObject.borrowObject(t.TimelineData)}u.type=s;u.offset=p;this._frameValueType=o;this._timeline=u;this._timelineArray.length+=1+1+1+1+1+f;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=f;this._timelineArray[p+3]=l;switch(this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=_-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset;break}if(f===1){u.frameIndicesOffset=-1;this._timelineArray[p+5+0]=h.call(this,i[0],0,0)-this._animation.frameOffset}else{var c=this._animation.frameCount+1;var d=this._data.frameIndices;var y=d.length;d.length+=c;u.frameIndicesOffset=y;for(var v=0,g=0,D=0,T=0;v0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=o?s:-s;for(var l=0;l0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotDeformFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.geometry.offset+0];var u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var f=this._mesh.geometry.weight;var _=0;var m=0;var p=0;var c=0;if(f!==null){var d=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=f.count*2;p=f.offset+2+f.bones.length}else{this._frameFloatArray.length+=h*2}for(var y=0;y=o.length){_=0}else{_=o[y-l]}if(y+1=o.length){m=0}else{m=o[y+1-l]}}if(f!==null){var v=this._weightBonePoses[u];var g=this._intArray[p++];this._helpMatrixA.transformPoint(_,m,this._helpPoint,true);_=this._helpPoint.x;m=this._helpPoint.y;for(var D=0;D=o.length){f=0}else{f=o[m-l]}if(m+1=o.length){_=0}else{_=o[m+1-l]}}else{f=0;_=0}this._frameFloatArray[n+m]=f;this._frameFloatArray[n+m+1]=_}}if(a===0){var p=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[p+0]=this._geometry.offset;this._frameIntArray[p+1]=this._frameFloatArray.length-n;this._frameIntArray[p+2]=this._frameFloatArray.length-n;this._frameIntArray[p+3]=0;this._frameIntArray[p+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=p-this._animation.frameIntOffset}return s};r.prototype._parseTransform=function(e,a,i){a.x=r._getNumber(e,t.DataParser.X,0)*i;a.y=r._getNumber(e,t.DataParser.Y,0)*i;if(t.DataParser.ROTATE in e||t.DataParser.SKEW in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)}else if(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation}a.scaleX=r._getNumber(e,t.DataParser.SCALE_X,1);a.scaleY=r._getNumber(e,t.DataParser.SCALE_Y,1)};r.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=r._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100)*.01;a.redMultiplier=r._getNumber(e,t.DataParser.RED_MULTIPLIER,100)*.01;a.greenMultiplier=r._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100)*.01;a.blueMultiplier=r._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100)*.01;a.alphaOffset=r._getNumber(e,t.DataParser.ALPHA_OFFSET,0);a.redOffset=r._getNumber(e,t.DataParser.RED_OFFSET,0);a.greenOffset=r._getNumber(e,t.DataParser.GREEN_OFFSET,0);a.blueOffset=r._getNumber(e,t.DataParser.BLUE_OFFSET,0)};r.prototype._parseGeometry=function(e,a){var r=e[t.DataParser.VERTICES];var i=Math.floor(r.length/2);var n=0;var s=this._intArray.length;var o=this._floatArray.length;a.offset=s;a.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[s+0]=i;this._intArray[s+2]=o;this._intArray[s+3]=-1;this._floatArray.length+=i*2;for(var l=0,h=i*2;l=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&f>0){_.frame=t.TextureData.createRectangle();_.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);_.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);_.frame.width=u;_.frame.height=f}a.addTexture(_)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;s=l.length;l.length+=o;i.frameIndicesOffset=s;for(var h=0,u=0,f=0,_=0;h=0){var u=t.ObjectDataParser._getNumber(y,t.DataParser.TYPE,0);var v=t.ObjectDataParser._getString(y,t.DataParser.NAME,"");var _=null;if(u===40&&a.blendType!==0){_=t.BaseObject.borrowObject(t.AnimationTimelineData);var g=_;g.x=t.ObjectDataParser._getNumber(y,t.DataParser.X,0);g.y=t.ObjectDataParser._getNumber(y,t.DataParser.Y,0)}_=this._parseBinaryTimeline(u,f,_);switch(u){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(v,_);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(v,_);break;case 30:this._animation.addConstraintTimeline(v,_);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(v,_);break}}}}this._animation=null;return a};a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET];a.data=this._data;var r=this._intArrayBuffer[a.offset+3];if(r>=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o12?a[13]:0;var u=new Int16Array(this._binary,this._binaryOffset+a[0],r/Int16Array.BYTES_PER_ELEMENT);var f=new Float32Array(this._binary,this._binaryOffset+a[2],i/Float32Array.BYTES_PER_ELEMENT);var _=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT);var m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT);var d=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=u;this._data.floatArray=f;this._data.frameIntArray=_;this._data.frameFloatArray=m;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=d};a.prototype.parseDragonBonesData=function(t,a){if(a===void 0){a=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var r=new Uint8Array(t,0,8);if(r[0]!=="D".charCodeAt(0)||r[1]!=="B".charCodeAt(0)||r[2]!=="D".charCodeAt(0)||r[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var i=new Uint32Array(t,8,1)[0];var n=new Uint8Array(t,8+4,i);var s=this._decodeUTF8(n);var o=JSON.parse(s);this._binaryOffset=8+4+i;this._binary=t;return e.prototype.parseDragonBonesData.call(this,o,a)};a.getInstance=function(){if(a._binaryDataParserInstance===null){a._binaryDataParserInstance=new a}return a._binaryDataParserInstance};a._binaryDataParserInstance=null;return a}(t.ObjectDataParser);t.BinaryDataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){if(a===void 0){a=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(e._objectParser===null){e._objectParser=new t.ObjectDataParser}if(e._binaryParser===null){e._binaryParser=new t.BinaryDataParser}this._dataParser=a!==null?a:e._objectParser}e.prototype._isSupportMesh=function(){return true};e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){var c=this._getTextureData(t.textureAtlasName,p.path);f.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};e.prototype._buildConstraints=function(e,a){var r=e.armature.constraints;for(var i in r){var n=r[i];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a);a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a);a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a);a._addConstraint(l);break}}};e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};e.prototype._getSlotDisplay=function(e,a,r){var i=e!==null?e.dataName:a.parent.parent.parent.name;var n=null;switch(a.type){case 0:{var s=a;if(s.texture===null){s.texture=this._getTextureData(i,a.path)}n=r.rawDisplay;break}case 2:{var o=a;if(o.texture===null){o.texture=this._getTextureData(i,o.path)}if(this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 1:{var l=a;var h=this._buildChildArmature(e,r,l);if(h!==null){h.inheritAnimation=l.inheritAnimation;if(!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0){for(var f=0,_=u;f<_.length;f++){var m=_[f];var p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,r.armature);p.slot=r;r.armature._bufferAction(p,false)}}else{h.animation.play()}}l.armature=h.armatureData}n=h;break}case 3:break;default:break}return n};e.prototype.parseDragonBonesData=function(t,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=t instanceof ArrayBuffer?e._binaryParser:this._dataParser;var n=i.parseDragonBonesData(t,r);while(true){var s=this._buildTextureAtlasData(null,null);if(i.parseTextureAtlasData(null,s,r)){this.addTextureAtlasData(s,a)}else{s.returnToPool();break}}if(n!==null){this.addDragonBonesData(n,a)}return n};e.prototype.parseTextureAtlasData=function(t,e,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=this._buildTextureAtlasData(null,null);this._dataParser.parseTextureAtlasData(t,i,r);this._buildTextureAtlasData(i,e||null);this.addTextureAtlasData(i,a);return i};e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(a!==null){for(var r=0,i=a.length;r=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u=0&&this._display!==null&&e!==null){var a=e.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){a=t.BaseObject.borrowObject(t.PixiTextureAtlasData);a.copyFrom(e.parent);a.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=a}else{a=this._armature._replaceTextureAtlasData}e=a.getTexture(e.name)}var r=e.renderTexture;if(r!==null){if(this._geometryData!==null){var i=this._geometryData.data;var n=i.intArray;var s=i.floatArray;var o=n[this._geometryData.offset+0];var l=n[this._geometryData.offset+1];var h=n[this._geometryData.offset+2];if(h<0){h+=65536}var u=h+o*2;var f=this._armature._armatureData.scale;var _=this._renderDisplay;var m=a.width>0?a.width:r.baseTexture.width;var p=a.height>0?a.height:r.baseTexture.height;var c=e.region;_.vertices=new Float32Array(o*2);_.uvs=new Float32Array(o*2);_.indices=new Uint16Array(l*3);for(var d=0,y=o*2;d0&&r.inheritDeform;var s=this._renderDisplay;if(i!==null){var o=r.data;var l=o.intArray;var h=o.floatArray;var u=l[r.offset+0];var f=l[i.offset+1];if(f<0){f+=65536}for(var _=0,m=0,p=i.offset+2+a.length,c=f,d=0;_