@eva/plugin-renderer-spine 1.2.3 → 1.2.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -298,7 +298,7 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
298
298
  this.waitExecuteInfos.push({
299
299
  playType: true,
300
300
  name: name,
301
- loop: loop,
301
+ loop: loop !== null && loop !== void 0 ? loop : this.autoPlay,
302
302
  track: track
303
303
  });
304
304
  } else {
@@ -1 +1 @@
1
- function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var _EVA_IIFE_spine=function(t,e,n,r){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t,e,n,r){var a,i=arguments.length,o=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o}function s(t,e,n,r){return new(n||(n=Promise))((function(a,i){function o(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=e.call(t,o)}catch(t){i=[6,t],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function h(t){return function(e,n){var r=function(t,e){return t.constructor.IDEProps||(t.constructor.IDEProps={}),t.constructor.IDEProps[e]||(t.constructor.IDEProps[e]={}),t.constructor.IDEProps[e]}(e,n);r.key=n,r.type=t}}var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.resource="",e.animationName="",e.autoPlay=!0,e.waitExecuteInfos=[],e}return i(e,t),Object.defineProperty(e.prototype,"armature",{get:function(){return this._armature},set:function(t){var e,n;if(this._armature=t,t){this.autoPlay&&this.play(this.animationName);try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.waitExecuteInfos),a=r.next();!a.done;a=r.next()){var i=a.value;if(i.playType){var o=i.name,s=i.loop,l=i.track;this.play(o,s,l)}else this.stop(i.track)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this.waitExecuteInfos=[]}},enumerable:!1,configurable:!0}),e.prototype.init=function(t){t&&_extends(this,t)},e.prototype.onDestroy=function(){this.destroied=!0},e.prototype.play=function(t,e,n){try{t&&(this.animationName=t),this.armature?(void 0===n&&(n=0),this.armature.state.setAnimation(n,this.animationName,e)):this.waitExecuteInfos.push({playType:!0,name:t,loop:e,track:n})}catch(t){console.log(t)}},e.prototype.stop=function(t){this.armature?(void 0===t&&(t=0),this.armature.state.setEmptyAnimation(t,0)):this.waitExecuteInfos.push({playType:!1,track:t})},e.prototype.addAnimation=function(t,e,n,r){try{this.armature&&(void 0===r&&(r=0),this.armature.state.addAnimation(r,t,n,e))}catch(t){console.log(t)}},e.prototype.setMix=function(t,e,n){this.armature&&this.armature.stateData.setMix(t,e,n)},e.prototype.getAnim=function(t){void 0===t&&(t=0);try{if(this.armature)return this.armature.state.tracks[t].animation.name}catch(t){console.log(t)}},e.prototype.setDefaultMix=function(t){this.armature&&(this.armature.stateData.defaultMix=t)},e.prototype.setAttachment=function(t,e){this.armature&&this.armature.skeleton.setAttachment(t,e)},e.prototype.getBone=function(t){if(this.armature)return this.armature.skeleton.findBone(t)},e.componentName="Spine",o([h("string")],e.prototype,"resource",void 0),o([h("string")],e.prototype,"animationName",void 0),o([h("boolean")],e.prototype,"autoPlay",void 0),e}(n.Component),c={};function p(t){var n=t.image;return{tex:e.Texture.from(n),count:0}}var f={};function d(t,e,n,r){var a=null,i=function(t,e){var n=c[t];return n||(n=p(e),c[t]=n),n.tex}(e.image.src,e);new r.core.TextureAtlas(e.atlas,(function(t,e){e(i.baseTexture)}),(function(t){if(t){var i=new r.core.AtlasAttachmentLoader(t),o=new r.core.SkeletonJson(i);n&&(o.scale=n),a=o.readSkeletonData(e.ske)}}));var o={spineData:a,ref:0,imageSrc:e.image.src};return f[t]=o,o}function m(t,e){return s(this,void 0,void 0,(function(){var n;return l(this,(function(r){if(!(n=f[t.name]))if(t.complete)n=d(t.name,t.data,t.scale,e);else if(!n)return[2];return function(t,e){var n=c[t];n||(n=p(e),c[t]=n),n.count++,n.tex}(t.data.image.src,t.data),n.ref++,[2,n.spineData]}))}))}function g(t,e){var n=f[t];n&&(n.ref--,n.ref<=0&&(!function(t){t&&setTimeout((function(){var e=c[t];e&&(e.count--,e.count<=0&&(e.tex&&(e.tex.destroy(!0),e.tex=null),delete c[t]))}),100)}(e),delete f[t]))}var v,y,x,M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.armatures={},e}return i(e,t),e.prototype.init=function(t){var e=this,a=t.pixiSpine;this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this),this.pixiSpine=a,this.game.canvas.addEventListener("webglcontextrestored",(function(){var t=e.game.gameObjects,r=[];for(var a in e.armatures)for(var i=+a,o=0;o<t.length;++o){var s=t[o];if(s.id===i){var l=s.getComponent(u);l&&(e.remove({type:n.OBSERVER_TYPE.REMOVE,gameObject:s,component:l,componentName:u.componentName}),r.push({type:n.OBSERVER_TYPE.ADD,gameObject:s,component:l,componentName:u.componentName}));break}}setTimeout((function(){r.forEach((function(t){e.add(t)}))}),1e3)}),!1)},e.prototype.update=function(e){for(var n in this.armatures)this.armatures[n].update(.001*e.deltaTime),this.armatures[n].updateTransform();t.prototype.update.call(this)},e.prototype.componentChanged=function(t){return s(this,void 0,void 0,(function(){return l(this,(function(e){if("Spine"===t.componentName)if(t.type===n.OBSERVER_TYPE.ADD)this.add(t);else if(t.type===n.OBSERVER_TYPE.CHANGE)switch(t.prop.prop[0]){case"resource":this.change(t)}else t.type===n.OBSERVER_TYPE.REMOVE&&this.remove(t);return[2]}))}))},e.prototype.add=function(t,e){var r,a;return s(this,void 0,void 0,(function(){var i,o,s,h,u,c=this;return l(this,(function(l){switch(l.label){case 0:return i=t.component,clearTimeout(i.addHandler),[4,n.resource.getResource(i.resource)];case 1:return[4,m(l.sent(),this.pixiSpine)];case 2:return(o=l.sent())?(this.remove(t),(s=null===(a=null===(r=this.renderSystem)||void 0===r?void 0:r.containerManager)||void 0===a?void 0:a.getContainer(t.gameObject.id))?(i.lastResource=i.resource,h=new this.pixiSpine.Spine(o),this.armatures[t.gameObject.id]=h,t.gameObject&&t.gameObject.transform&&(u=t.gameObject.transform,h.x=u.size.width*u.origin.x,h.y=u.size.height*u.origin.y),s.addChildAt(h,0),h.update(),h.updateTransform(),i.armature=h,i.emit("loaded",{resource:i.resource}),h.state.addListener({start:function(t,e){i.emit("start",{track:t,name:t.animation.name})},complete:function(t,e){i.emit("complete",{track:t,name:t.animation.name})},interrupt:function(t,e){i.emit("interrupt",{track:t,name:t.animation.name})},end:function(t,e){i.emit("end",{track:t,name:t.animation.name})},event:function(t,e){i.emit("event",t,e)}}),[2]):[2]):(i.addHandler=setTimeout((function(){i.destroied||(void 0===e&&(e=20),--e>0?c.add(t,e):console.log("retry exceed max times",i.resource))}),1e3),[2])}}))}))},e.prototype.change=function(t){this.remove(t),this.add(t)},e.prototype.remove=function(t){var e,r,a,i;return s(this,void 0,void 0,(function(){var o,s,h,u;return l(this,(function(l){switch(l.label){case 0:return o=t.component,clearTimeout(o.addHandler),s=this.armatures[t.gameObject.id],(h=null===(r=null===(e=this.renderSystem)||void 0===e?void 0:e.containerManager)||void 0===r?void 0:r.getContainer(t.gameObject.id))&&s&&h.removeChild(s),o.armature?(o.armature.destroy({children:!0}),[4,n.resource.getResource(o.lastResource)]):[3,2];case 1:g((u=l.sent()).name,null===(i=null===(a=u.data)||void 0===a?void 0:a.image)||void 0===i?void 0:i.src),l.label=2;case 2:return o.armature=null,delete this.armatures[t.gameObject.id],t.type,n.OBSERVER_TYPE.CHANGE,[2]}}))}))},e.systemName="SpineSystem",e=o([n.decorators.componentObserver({Spine:["resource"]})],e)}(r.Renderer),E=e.loaders.shared,b={Texture:e.Texture,Rectangle:e.Rectangle,Sprite:e.Sprite,Graphics:e.Graphics,mesh:e.mesh,Matrix:e.Matrix,Container:e.Container,VERSION:"4.8.9",loaders:e.loaders,loader:E,SCALE_MODES:e.SCALE_MODES,utils:e.utils,TransformBase:e.TransformBase,TransformStatic:e.TransformStatic,DisplayObject:e.DisplayObject,Polygon:e.Polygon,BaseTexture:e.BaseTexture},w=(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){!function(t){var e,n,r,a=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.duration=n}return t.prototype.apply=function(t,e,n,r,a,i,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var l=this.timelines,h=0,u=l.length;h<u;h++)l[h].apply(t,e,n,a,i,o,s)},t.binarySearch=function(t,e,n){void 0===n&&(n=1);var r=0,a=t.length/n-2;if(0==a)return n;for(var i=a>>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var i=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),l=.006*(3*(n-a)+1),h=.006*(3*(r-i)+1),u=2*o+l,c=2*s+h,p=.3*n+o+.16666667*l,f=.3*r+s+.16666667*h,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var g=p,v=f,y=d+e.BEZIER_SIZE-1;d<y;d+=2)m[d]=g,m[d+1]=v,p+=u,f+=c,u+=l,c+=h,g+=p,v+=f},e.prototype.getCurvePercent=function(n,r){r=t.MathUtils.clamp(r,0,1);var a=this.curves,i=n*e.BEZIER_SIZE,o=a[i];if(o==e.LINEAR)return r;if(o==e.STEPPED)return 0;for(var s=0,l=++i,h=i+e.BEZIER_SIZE-1;i<h;i+=2)if((s=a[i])>=r){var u=void 0,c=void 0;return i==l?(u=0,c=0):(u=a[i-2],c=a[i-1]),c+(a[i+1]-c)*(r-u)/(s-u)}var p=a[i-1];return p+(1-p)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var o=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(r<u[0])switch(l){case e.setup:return void(c.rotation=c.data.rotation);case e.first:var p=c.data.rotation-c.rotation;c.rotation+=(p-360*(16384-(16384.499999999996-p/360|0)))*s}else if(r>=u[u.length-i.ENTRIES]){var f=u[u.length+i.PREV_ROTATION];switch(l){case e.setup:c.rotation=c.data.rotation+f*s;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*s}}else{var d=a.binarySearch(u,r,i.ENTRIES),m=u[d+i.PREV_ROTATION],g=u[d],v=this.getCurvePercent((d>>1)-1,1-(r-g)/(u[d+i.PREV_TIME]-g)),y=u[d+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*v,l){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*s;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*s}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=o;var s=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(r<u[0])switch(l){case e.setup:return c.x=c.data.x,void(c.y=c.data.y);case e.first:c.x+=(c.data.x-c.x)*s,c.y+=(c.data.y-c.y)*s}else{var p=0,f=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var d=a.binarySearch(u,r,i.ENTRIES);p=u[d+i.PREV_X],f=u[d+i.PREV_Y];var m=u[d],g=this.getCurvePercent(d/i.ENTRIES-1,1-(r-m)/(u[d+i.PREV_TIME]-m));p+=(u[d+i.X]-p)*g,f+=(u[d+i.Y]-f)*g}switch(l){case e.setup:c.x=c.data.x+p*s,c.y=c.data.y+f*s;break;case e.first:case e.replace:c.x+=(c.data.x+p-c.x)*s,c.y+=(c.data.y+f-c.y)*s;break;case e.add:c.x+=p*s,c.y+=f*s}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=s;var l=function(i){function o(t){return i.call(this,t)||this}return w(o,i),o.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},o.prototype.apply=function(r,i,s,l,h,u,c){var p=this.frames,f=r.bones[this.boneIndex];if(s<p[0])switch(u){case e.setup:return f.scaleX=f.data.scaleX,void(f.scaleY=f.data.scaleY);case e.first:f.scaleX+=(f.data.scaleX-f.scaleX)*h,f.scaleY+=(f.data.scaleY-f.scaleY)*h}else{var d=0,m=0;if(s>=p[p.length-o.ENTRIES])d=p[p.length+o.PREV_X]*f.data.scaleX,m=p[p.length+o.PREV_Y]*f.data.scaleY;else{var g=a.binarySearch(p,s,o.ENTRIES);d=p[g+o.PREV_X],m=p[g+o.PREV_Y];var v=p[g],y=this.getCurvePercent(g/o.ENTRIES-1,1-(s-v)/(p[g+o.PREV_TIME]-v));d=(d+(p[g+o.X]-d)*y)*f.data.scaleX,m=(m+(p[g+o.Y]-m)*y)*f.data.scaleY}if(1==h)u==e.add?(f.scaleX+=d-f.data.scaleX,f.scaleY+=m-f.data.scaleY):(f.scaleX=d,f.scaleY=m);else{var x=0,M=0;if(c==n.out)switch(u){case e.setup:x=f.data.scaleX,M=f.data.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-M)*h;break;case e.first:case e.replace:x=f.scaleX,M=f.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-M)*h;break;case e.add:x=f.scaleX,M=f.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-f.data.scaleX)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-f.data.scaleY)*h}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(d),M=Math.abs(f.data.scaleY)*t.MathUtils.signum(m),f.scaleX=x+(d-x)*h,f.scaleY=M+(m-M)*h;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(d),M=Math.abs(f.scaleY)*t.MathUtils.signum(m),f.scaleX=x+(d-x)*h,f.scaleY=M+(m-M)*h;break;case e.add:x=t.MathUtils.signum(d),M=t.MathUtils.signum(m),f.scaleX=Math.abs(f.scaleX)*x+(d-Math.abs(f.data.scaleX)*x)*h,f.scaleY=Math.abs(f.scaleY)*M+(m-Math.abs(f.data.scaleY)*M)*h}}}},o}(s);t.ScaleTimeline=l;var h=function(t){function n(e){return t.call(this,e)||this}return w(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(i<u[0])switch(l){case e.setup:return c.shearX=c.data.shearX,void(c.shearY=c.data.shearY);case e.first:c.shearX+=(c.data.shearX-c.shearX)*s,c.shearY+=(c.data.shearY-c.shearY)*s}else{var p=0,f=0;if(i>=u[u.length-n.ENTRIES])p=u[u.length+n.PREV_X],f=u[u.length+n.PREV_Y];else{var d=a.binarySearch(u,i,n.ENTRIES);p=u[d+n.PREV_X],f=u[d+n.PREV_Y];var m=u[d],g=this.getCurvePercent(d/n.ENTRIES-1,1-(i-m)/(u[d+n.PREV_TIME]-m));p+=(u[d+n.X]-p)*g,f+=(u[d+n.Y]-f)*g}switch(l){case e.setup:c.shearX=c.data.shearX+p*s,c.shearY=c.data.shearY+f*s;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+p-c.shearX)*s,c.shearY+=(c.data.shearY+f-c.shearY)*s;break;case e.add:c.shearX+=p*s,c.shearY+=f*s}}},n}(s);t.ShearTimeline=h;var u=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o},i.prototype.apply=function(t,n,r,o,s,l,h){var u=t.slots[this.slotIndex],c=this.frames;if(r<c[0])switch(l){case e.setup:return void u.color.setFromColor(u.data.color);case e.first:var p=u.color,f=u.data.color;p.add((f.r-p.r)*s,(f.g-p.g)*s,(f.b-p.b)*s,(f.a-p.a)*s)}else{var d=0,m=0,g=0,v=0;if(r>=c[c.length-i.ENTRIES]){var y=c.length;d=c[y+i.PREV_R],m=c[y+i.PREV_G],g=c[y+i.PREV_B],v=c[y+i.PREV_A]}else{var x=a.binarySearch(c,r,i.ENTRIES);d=c[x+i.PREV_R],m=c[x+i.PREV_G],g=c[x+i.PREV_B],v=c[x+i.PREV_A];var M=c[x],E=this.getCurvePercent(x/i.ENTRIES-1,1-(r-M)/(c[x+i.PREV_TIME]-M));d+=(c[x+i.R]-d)*E,m+=(c[x+i.G]-m)*E,g+=(c[x+i.B]-g)*E,v+=(c[x+i.A]-v)*E}if(1==s)u.color.set(d,m,g,v);else{p=u.color;l==e.setup&&p.setFromColor(u.data.color),p.add((d-p.r)*s,(m-p.g)*s,(g-p.b)*s,(v-p.a)*s)}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=u;var c=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o,s,l,h){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o,this.frames[t+i.R2]=s,this.frames[t+i.G2]=l,this.frames[t+i.B2]=h},i.prototype.apply=function(t,n,r,o,s,l,h){var u=t.slots[this.slotIndex],c=this.frames;if(r<c[0])switch(l){case e.setup:return u.color.setFromColor(u.data.color),void u.darkColor.setFromColor(u.data.darkColor);case e.first:var p=u.color,f=u.darkColor,d=u.data.color,m=u.data.darkColor;p.add((d.r-p.r)*s,(d.g-p.g)*s,(d.b-p.b)*s,(d.a-p.a)*s),f.add((m.r-f.r)*s,(m.g-f.g)*s,(m.b-f.b)*s,0)}else{var g=0,v=0,y=0,x=0,M=0,E=0,b=0;if(r>=c[c.length-i.ENTRIES]){var w=c.length;g=c[w+i.PREV_R],v=c[w+i.PREV_G],y=c[w+i.PREV_B],x=c[w+i.PREV_A],M=c[w+i.PREV_R2],E=c[w+i.PREV_G2],b=c[w+i.PREV_B2]}else{var T=a.binarySearch(c,r,i.ENTRIES);g=c[T+i.PREV_R],v=c[T+i.PREV_G],y=c[T+i.PREV_B],x=c[T+i.PREV_A],M=c[T+i.PREV_R2],E=c[T+i.PREV_G2],b=c[T+i.PREV_B2];var S=c[T],R=this.getCurvePercent(T/i.ENTRIES-1,1-(r-S)/(c[T+i.PREV_TIME]-S));g+=(c[T+i.R]-g)*R,v+=(c[T+i.G]-v)*R,y+=(c[T+i.B]-y)*R,x+=(c[T+i.A]-x)*R,M+=(c[T+i.R2]-M)*R,E+=(c[T+i.G2]-E)*R,b+=(c[T+i.B2]-b)*R}if(1==s)u.color.set(g,v,y,x),u.darkColor.set(M,E,b,1);else{p=u.color,f=u.darkColor;l==e.setup&&(p.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),p.add((g-p.r)*s,(v-p.g)*s,(y-p.b)*s,(x-p.a)*s),f.add((M-f.r)*s,(E-f.g)*s,(b-f.b)*s,0)}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=c;var p=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,o,s,l,h){var u=t.slots[this.slotIndex];if(h!=n.out||l!=e.setup){var c=this.frames;if(i<c[0]){if(l==e.setup||l==e.first){var p=u.data.attachmentName;u.setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var f=0;f=i>=c[c.length-1]?c.length-1:a.binarySearch(c,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},i}();t.AttachmentTimeline=p;var f=null,d=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==f&&(f=t.Utils.newFloatArray(64)),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,o,s,l,h){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var p=u.attachmentVertices;0==p.length&&(l=e.setup);var f=this.frameVertices,d=f[0].length,m=this.frames;if(i<m[0]){var g=c;switch(l){case e.setup:return void(p.length=0);case e.first:if(1==s){p.length=0;break}var v=t.Utils.setArraySize(p,d);if(null==g.bones)for(var y=g.vertices,x=0;x<d;x++)v[x]+=(y[x]-v[x])*s;else{s=1-s;for(x=0;x<d;x++)v[x]*=s}}}else{var M=t.Utils.setArraySize(p,d);if(i>=m[m.length-1]){var E=f[m.length-1];if(1==s)if(l==e.add)if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++)M[x]+=E[x]-y[x];else for(x=0;x<d;x++)M[x]+=E[x];else t.Utils.arrayCopy(E,0,M,0,d);else switch(l){case e.setup:var b=c;if(null==b.bones)for(y=b.vertices,x=0;x<d;x++){var w=y[x];M[x]=w+(E[x]-w)*s}else for(x=0;x<d;x++)M[x]=E[x]*s;break;case e.first:case e.replace:for(x=0;x<d;x++)M[x]+=(E[x]-M[x])*s;case e.add:if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++)M[x]+=(E[x]-y[x])*s;else for(x=0;x<d;x++)M[x]+=E[x]*s}}else{var T=a.binarySearch(m,i),S=f[T-1],R=f[T],A=m[T],P=this.getCurvePercent(T-1,1-(i-A)/(m[T-1]-A));if(1==s)if(l==e.add)if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++){var I=S[x];M[x]+=I+(R[x]-I)*P-y[x]}else for(x=0;x<d;x++){I=S[x];M[x]+=I+(R[x]-I)*P}else for(x=0;x<d;x++){I=S[x];M[x]=I+(R[x]-I)*P}else switch(l){case e.setup:var C=c;if(null==C.bones)for(y=C.vertices,x=0;x<d;x++){I=S[x],w=y[x];M[x]=w+(I+(R[x]-I)*P-w)*s}else for(x=0;x<d;x++){I=S[x];M[x]=(I+(R[x]-I)*P)*s}break;case e.first:case e.replace:for(x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P-M[x])*s}break;case e.add:if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P-y[x])*s}else for(x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P)*s}}}}}},i}(i);t.DeformTimeline=d;var m=function(){function e(e){this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}return e.prototype.getPropertyId=function(){return r.event<<24},e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,n,r,i,o,s){if(null!=r){var l=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,i,o,s),e=-1;else if(e>=l[h-1])return;if(!(n<l[0])){var u=0;if(e<l[0])u=0;else for(var c=l[u=a.binarySearch(l,e)];u>0&&l[u-1]==c;)u--;for(;u<h&&n>=l[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=m;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,o,s,l,h,u){var c=r.drawOrder,p=r.slots;if(u!=n.out||h!=e.setup){var f=this.frames;if(o<f[0])h!=e.setup&&h!=e.first||t.Utils.arrayCopy(r.slots,0,r.drawOrder,0,r.slots.length);else{var d=0;d=o>=f[f.length-1]?f.length-1:a.binarySearch(f,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(p,0,c,0,p.length);else for(var g=0,v=m.length;g<v;g++)c[g]=p[m[g]]}}else t.Utils.arrayCopy(r.slots,0,r.drawOrder,0,r.slots.length)},i}();t.DrawOrderTimeline=g;var v=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return w(o,i),o.prototype.getPropertyId=function(){return(r.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(t,e,n,r,a,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.MIX]=n,this.frames[t+o.BEND_DIRECTION]=r,this.frames[t+o.COMPRESS]=a?1:0,this.frames[t+o.STRETCH]=i?1:0},o.prototype.apply=function(t,r,i,s,l,h,u){var c=this.frames,p=t.ikConstraints[this.ikConstraintIndex];if(i<c[0])switch(h){case e.setup:return p.mix=p.data.mix,p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,void(p.stretch=p.data.stretch);case e.first:p.mix+=(p.data.mix-p.mix)*l,p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch}else if(i>=c[c.length-o.ENTRIES])h==e.setup?(p.mix=p.data.mix+(c[c.length+o.PREV_MIX]-p.data.mix)*l,u==n.out?(p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch):(p.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],p.compress=0!=c[c.length+o.PREV_COMPRESS],p.stretch=0!=c[c.length+o.PREV_STRETCH])):(p.mix+=(c[c.length+o.PREV_MIX]-p.mix)*l,u==n.in&&(p.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],p.compress=0!=c[c.length+o.PREV_COMPRESS],p.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=a.binarySearch(c,i,o.ENTRIES),d=c[f+o.PREV_MIX],m=c[f],g=this.getCurvePercent(f/o.ENTRIES-1,1-(i-m)/(c[f+o.PREV_TIME]-m));h==e.setup?(p.mix=p.data.mix+(d+(c[f+o.MIX]-d)*g-p.data.mix)*l,u==n.out?(p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch):(p.bendDirection=c[f+o.PREV_BEND_DIRECTION],p.compress=0!=c[f+o.PREV_COMPRESS],p.stretch=0!=c[f+o.PREV_STRETCH])):(p.mix+=(d+(c[f+o.MIX]-d)*g-p.mix)*l,u==n.in&&(p.bendDirection=c[f+o.PREV_BEND_DIRECTION],p.compress=0!=c[f+o.PREV_COMPRESS],p.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_MIX=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.BEND_DIRECTION=2,o.COMPRESS=3,o.STRETCH=4,o}(i);t.IkConstraintTimeline=v;var y=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=o},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r<u[0]){var p=c.data;switch(l){case e.setup:return c.rotateMix=p.rotateMix,c.translateMix=p.translateMix,c.scaleMix=p.scaleMix,void(c.shearMix=p.shearMix);case e.first:c.rotateMix+=(p.rotateMix-c.rotateMix)*s,c.translateMix+=(p.translateMix-c.translateMix)*s,c.scaleMix+=(p.scaleMix-c.scaleMix)*s,c.shearMix+=(p.shearMix-c.shearMix)*s}}else{var f=0,d=0,m=0,g=0;if(r>=u[u.length-i.ENTRIES]){var v=u.length;f=u[v+i.PREV_ROTATE],d=u[v+i.PREV_TRANSLATE],m=u[v+i.PREV_SCALE],g=u[v+i.PREV_SHEAR]}else{var y=a.binarySearch(u,r,i.ENTRIES);f=u[y+i.PREV_ROTATE],d=u[y+i.PREV_TRANSLATE],m=u[y+i.PREV_SCALE],g=u[y+i.PREV_SHEAR];var x=u[y],M=this.getCurvePercent(y/i.ENTRIES-1,1-(r-x)/(u[y+i.PREV_TIME]-x));f+=(u[y+i.ROTATE]-f)*M,d+=(u[y+i.TRANSLATE]-d)*M,m+=(u[y+i.SCALE]-m)*M,g+=(u[y+i.SHEAR]-g)*M}if(l==e.setup){p=c.data;c.rotateMix=p.rotateMix+(f-p.rotateMix)*s,c.translateMix=p.translateMix+(d-p.translateMix)*s,c.scaleMix=p.scaleMix+(m-p.scaleMix)*s,c.shearMix=p.shearMix+(g-p.shearMix)*s}else c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(g-c.shearMix)*s}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=y;var x=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r<u[0])switch(l){case e.setup:return void(c.position=c.data.position);case e.first:c.position+=(c.data.position-c.position)*s}else{var p=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_VALUE];else{var f=a.binarySearch(u,r,i.ENTRIES);p=u[f+i.PREV_VALUE];var d=u[f],m=this.getCurvePercent(f/i.ENTRIES-1,1-(r-d)/(u[f+i.PREV_TIME]-d));p+=(u[f+i.VALUE]-p)*m}l==e.setup?c.position=c.data.position+(p-c.data.position)*s:c.position+=(p-c.position)*s}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=x;var M=function(t){function n(e){return t.call(this,e)||this}return w(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i<u[0])switch(l){case e.setup:return void(c.spacing=c.data.spacing);case e.first:c.spacing+=(c.data.spacing-c.spacing)*s}else{var p=0;if(i>=u[u.length-n.ENTRIES])p=u[u.length+n.PREV_VALUE];else{var f=a.binarySearch(u,i,n.ENTRIES);p=u[f+n.PREV_VALUE];var d=u[f],m=this.getCurvePercent(f/n.ENTRIES-1,1-(i-d)/(u[f+n.PREV_TIME]-d));p+=(u[f+n.VALUE]-p)*m}l==e.setup?c.spacing=c.data.spacing+(p-c.data.spacing)*s:c.spacing+=(p-c.spacing)*s}},n}(x);t.PathConstraintSpacingTimeline=M;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r<u[0])switch(l){case e.setup:return c.rotateMix=c.data.rotateMix,void(c.translateMix=c.data.translateMix);case e.first:c.rotateMix+=(c.data.rotateMix-c.rotateMix)*s,c.translateMix+=(c.data.translateMix-c.translateMix)*s}else{var p=0,f=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_ROTATE],f=u[u.length+i.PREV_TRANSLATE];else{var d=a.binarySearch(u,r,i.ENTRIES);p=u[d+i.PREV_ROTATE],f=u[d+i.PREV_TRANSLATE];var m=u[d],g=this.getCurvePercent(d/i.ENTRIES-1,1-(r-m)/(u[d+i.PREV_TIME]-m));p+=(u[d+i.ROTATE]-p)*g,f+=(u[d+i.TRANSLATE]-f)*g}l==e.setup?(c.rotateMix=c.data.rotateMix+(p-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*s):(c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(f-c.translateMix)*s)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=E}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(){function e(e){this.tracks=[],this.events=[],this.listeners=[],this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n<r;n++){var a=e[n];if(null!=a){a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast;var i=t*a.timeScale;if(a.delay>0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var o=a.next;if(null!=o){var s=a.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=0==a.timeScale?0:(s/a.timeScale+t)*o.timeScale,a.trackTime+=i,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var l=a.mixingFrom;for(a.mixingFrom=null,null!=l&&(l.mixingTo=null);null!=l;)this.queue.end(l),l=l.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,a=this.tracks,i=!1,o=0,s=a.length;o<s;o++){var l=a[o];if(!(null==l||l.delay>0)){i=!0;var h=0==o?t.MixBlend.first:l.mixBlend,u=l.alpha;null!=l.mixingFrom?u*=this.applyMixingFrom(l,n,h):l.trackTime>=l.trackEnd&&null==l.next&&(u=0);var c=l.animationLast,p=l.getAnimationTime(),f=l.animation.timelines.length,d=l.animation.timelines;if(0!=o||1!=u&&h!=t.MixBlend.add){var m=l.timelineMode,g=0==l.timelinesRotation.length;g&&t.Utils.setArraySize(l.timelinesRotation,f<<1,null);var v=l.timelinesRotation;for(M=0;M<f;M++){var y=d[M],x=m[M]==e.SUBSEQUENT?h:t.MixBlend.setup;y instanceof t.RotateTimeline?this.applyRotateTimeline(y,n,p,u,x,v,M<<1,g):(t.Utils.webkit602BugfixHelper(u,h),y.apply(n,c,p,r,u,x,t.MixDirection.in))}}else for(var M=0;M<f;M++)t.Utils.webkit602BugfixHelper(u,h),d[M].apply(n,c,p,r,u,h,t.MixDirection.in);this.queueEvents(l,p),r.length=0,l.nextAnimationLast=p,l.nextTrackLast=l.trackTime}}return this.queue.drain(),i},e.prototype.applyMixingFrom=function(n,r,a){var i=n.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,r,a);var o=0;0==n.mixDuration?(o=1,a==t.MixBlend.first&&(a=t.MixBlend.setup)):((o=n.mixTime/n.mixDuration)>1&&(o=1),a!=t.MixBlend.first&&(a=i.mixBlend));var s=o<i.eventThreshold?this.events:null,l=o<i.attachmentThreshold,h=o<i.drawOrderThreshold,u=i.animationLast,c=i.getAnimationTime(),p=i.animation.timelines.length,f=i.animation.timelines,d=i.alpha*n.interruptAlpha,m=d*(1-o);if(a==t.MixBlend.add)for(var g=0;g<p;g++)f[g].apply(r,u,c,s,m,a,t.MixDirection.out);else{var v=i.timelineMode,y=i.timelineHoldMix,x=0==i.timelinesRotation.length;x&&t.Utils.setArraySize(i.timelinesRotation,p<<1,null);var M=i.timelinesRotation;i.totalAlpha=0;for(g=0;g<p;g++){var E=f[g],b=t.MixDirection.out,w=void 0,T=0;switch(v[g]){case e.SUBSEQUENT:if(!l&&E instanceof t.AttachmentTimeline)continue;if(!h&&E instanceof t.DrawOrderTimeline)continue;w=a,T=m;break;case e.FIRST:w=t.MixBlend.setup,T=m;break;case e.HOLD:w=t.MixBlend.setup,T=d;break;default:w=t.MixBlend.setup;var S=y[g];T=d*Math.max(0,1-S.mixTime/S.mixDuration)}i.totalAlpha+=T,E instanceof t.RotateTimeline?this.applyRotateTimeline(E,r,c,T,w,M,g<<1,x):(t.Utils.webkit602BugfixHelper(T,a),w==t.MixBlend.setup&&(E instanceof t.AttachmentTimeline?l&&(b=t.MixDirection.out):E instanceof t.DrawOrderTimeline&&h&&(b=t.MixDirection.out)),E.apply(r,u,c,s,T,w,b))}}return n.mixDuration>0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,a,i,o,s,l){if(l&&(o[s]=0),1!=a){var h=e,u=h.frames,c=n.bones[h.boneIndex],p=0,f=0;if(r<u[0])switch(i){case t.MixBlend.setup:c.rotation=c.data.rotation;default:return;case t.MixBlend.first:p=c.rotation,f=c.data.rotation}else if(p=i==t.MixBlend.setup?c.data.rotation:c.rotation,r>=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var d=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),m=u[d+t.RotateTimeline.PREV_ROTATION],g=u[d],v=h.getCurvePercent((d>>1)-1,1-(r-g)/(u[d+t.RotateTimeline.PREV_TIME]-g));f=u[d+t.RotateTimeline.ROTATION]-m,f=m+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var y=0,x=f-p;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))y=o[s];else{var M=0,E=0;l?(M=0,E=x):(M=o[s],E=o[s+1]);var b=x>0,w=M>=0;t.MathUtils.signum(E)!=t.MathUtils.signum(x)&&Math.abs(E)<=90&&(Math.abs(M)>180&&(M+=360*t.MathUtils.signum(M)),w=b),y=x+M-M%360,w!=b&&(y+=360*t.MathUtils.signum(M)),o[s]=y}o[s+1]=x,p+=y*a,c.rotation=p-360*(16384-(16384.499999999996-p/360|0))}else e.apply(n,0,r,null,1,i,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,o=this.events,s=0,l=o.length;s<l;s++){var h=o[s];if(h.time<i)break;h.time>r||this.queue.event(t,h)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast<r)&&this.queue.complete(t);s<l;s++){o[s].time<n||this.queue.event(t,o[s])}},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,n=this.tracks.length;e<n;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var o=a.animationEnd-a.animationStart;0!=o?(a.loop?r+=o*(1+(a.trackTime/o|0)):r+=Math.max(o,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n<r;n++){var a=this.tracks[n];null!=a&&this.setEmptyAnimation(a.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e-this.tracks.length+1,null),this.tracks.length=e+1,null)},e.prototype.trackEntry=function(t,e,n,r){var a=this.trackEntryPool.obtain();return a.trackIndex=t,a.animation=e,a.loop=n,a.holdPrevious=!1,a.eventThreshold=0,a.attachmentThreshold=0,a.drawOrderThreshold=0,a.animationStart=0,a.animationEnd=e.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.interruptAlpha=1,a.mixTime=0,a.mixDuration=null==r?0:this.data.getMix(r.animation,e),a},e.prototype.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=0,n=this.tracks.length;e<n;e++){var r=this.tracks[e];if(null!=r){for(;null!=r.mixingFrom;)r=r.mixingFrom;do{null!=r.mixingFrom&&r.mixBlend==t.MixBlend.add||this.setTimelineModes(r),r=r.mixingTo}while(null!=r)}}},e.prototype.setTimelineModes=function(n){var r=n.mixingTo,a=n.animation.timelines,i=n.animation.timelines.length,o=t.Utils.setArraySize(n.timelineMode,i);n.timelineHoldMix.length=0;var s=t.Utils.setArraySize(n.timelineHoldMix,i),l=this.propertyIDs;if(null!=r&&r.holdPrevious)for(var h=0;h<i;h++)l.add(a[h].getPropertyId()),o[h]=e.HOLD;else t:for(h=0;h<i;h++){var u=a[h].getPropertyId();if(l.add(u))if(null!=r&&this.hasTimeline(r,u)){for(var c=r.mixingTo;null!=c;c=c.mixingTo)if(!this.hasTimeline(c,u)){if(n.mixDuration>0){o[h]=e.HOLD_MIX,s[h]=c;continue t}break}o[h]=e.HOLD}else o[h]=e.FIRST;else o[h]=e.SUBSEQUENT}},e.prototype.hasTimeline=function(t,e){for(var n=t.animation.timelines,r=0,a=n.length;r<a;r++)if(n[r].getPropertyId()==e)return!0;return!1},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.prototype.setAnimationByName=function(t,n,r){e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(t,n,r)},e.prototype.addAnimationByName=function(t,n,r,a){e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(t,n,r,a)},e.prototype.hasAnimation=function(t){return null!==this.data.skeletonData.findAnimation(t)},e.prototype.hasAnimationByName=function(t){return e.deprecatedWarning3||(e.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(t)},e.emptyAnimation=new t.Animation("<empty>",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,e.deprecatedWarning1=!1,e.deprecatedWarning2=!1,e.deprecatedWarning3=!1,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=[],this.timelineHoldMix=[],this.timelinesRotation=[]}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},Object.defineProperty(e.prototype,"time",{get:function(){return e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime},set:function(t){e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endTime",{get:function(){return e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime},set:function(t){e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=t},enumerable:!0,configurable:!0}),e.prototype.loopsCount=function(){return Math.floor(this.trackTime/this.trackEnd)},e.deprecatedWarning1=!1,e.deprecatedWarning2=!1,e}();t.TrackEntry=n;var r,a=function(){function e(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return e.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},e.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},e.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},e.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},e.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},e.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},e.prototype.deprecateStuff=function(){return e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0},e.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var e=this.objects,n=this.animState.listeners,a=0;a<e.length;a+=2){var i=e[a],o=e[a+1];switch(i){case r.start:null!=o.listener&&o.listener.start&&o.listener.start(o);for(var s=0;s<n.length;s++)n[s].start&&n[s].start(o);o.onStart&&this.deprecateStuff()&&o.onStart(o.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(o.trackIndex);break;case r.interrupt:null!=o.listener&&o.listener.interrupt&&o.listener.interrupt(o);for(s=0;s<n.length;s++)n[s].interrupt&&n[s].interrupt(o);break;case r.end:null!=o.listener&&o.listener.end&&o.listener.end(o);for(s=0;s<n.length;s++)n[s].end&&n[s].end(o);o.onEnd&&this.deprecateStuff()&&o.onEnd(o.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(o.trackIndex);case r.dispose:null!=o.listener&&o.listener.dispose&&o.listener.dispose(o);for(s=0;s<n.length;s++)n[s].dispose&&n[s].dispose(o);this.animState.trackEntryPool.free(o);break;case r.complete:null!=o.listener&&o.listener.complete&&o.listener.complete(o);for(s=0;s<n.length;s++)n[s].complete&&n[s].complete(o);var l=t.MathUtils.toInt(o.loopsCount());o.onComplete&&this.deprecateStuff()&&o.onComplete(o.trackIndex,l),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(o.trackIndex,l);break;case r.event:var h=e[2+a++];null!=o.listener&&o.listener.event&&o.listener.event(o,h);for(s=0;s<n.length;s++)n[s].event&&n[s].event(o,h);o.onEvent&&this.deprecateStuff()&&o.onEvent(o.trackIndex,h),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(o.trackIndex,h)}}this.clear(),this.drainDisabled=!1}},e.prototype.clear=function(){this.objects.length=0},e.deprecatedWarning1=!1,e}();t.EventQueue=a,function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(r=t.EventType||(t.EventType={}));var i=function(){function t(){}return t.prototype.start=function(t){},t.prototype.interrupt=function(t){},t.prototype.end=function(t){},t.prototype.dispose=function(t){},t.prototype.complete=function(t){},t.prototype.event=function(t,e){},t}();t.AnimationStateAdapter2=i}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(null==r)throw new Error("Animation not found: "+t);var a=this.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);this.setMixWith(r,a,n)},t.prototype.setMixByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(e,n,r)},t.prototype.setMixWith=function(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var r=t.name+"."+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t.deprecatedWarning1=!1,t}(),e.AnimationStateData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){this.atlas=t}return t.prototype.newRegionAttachment=function(t,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");var i=new e.RegionAttachment(n);return i.region=a,i},t.prototype.newMeshAttachment=function(t,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");var i=new e.MeshAttachment(n);return i.region=a,i},t.prototype.newBoundingBoxAttachment=function(t,n){return new e.BoundingBoxAttachment(n)},t.prototype.newPathAttachment=function(t,n){return new e.PathAttachment(n)},t.prototype.newPointAttachment=function(t,n){return new e.PointAttachment(n)},t.prototype.newClippingAttachment=function(t,n){return new e.ClippingAttachment(n)},t}(),e.AtlasAttachmentLoader=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),(n=e.BlendMode||(e.BlendMode={}))[n.Normal=0]="Normal",n[n.Additive=1]="Additive",n[n.Multiply=2]="Multiply",n[n.Screen=3]="Screen"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e,n){if(this.matrix=new b.Matrix,this.children=[],this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return Object.defineProperty(t.prototype,"worldX",{get:function(){return this.matrix.tx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldY",{get:function(){return this.matrix.ty},enumerable:!0,configurable:!0}),t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(n,r,a,i,o,s,l){this.ax=n,this.ay=r,this.arotation=a,this.ascaleX=i,this.ascaleY=o,this.ashearX=s,this.ashearY=l,this.appliedValid=!0;var h=this.parent,u=this.matrix,c=this.skeleton.scaleX,p=t.yDown?-this.skeleton.scaleY:this.skeleton.scaleY;if(null==h){t.yDown&&(a=-a,this.arotation=a);var f=this.skeleton,d=a+90+l;return u.a=e.MathUtils.cosDeg(a+s)*i*c,u.c=e.MathUtils.cosDeg(d)*o*p,u.b=e.MathUtils.sinDeg(a+s)*i*c,u.d=e.MathUtils.sinDeg(d)*o*p,u.tx=n*c+f.x,void(u.ty=r*p+f.y)}var m=h.matrix.a,g=h.matrix.c,v=h.matrix.b,y=h.matrix.d;switch(u.tx=m*n+g*r+h.matrix.tx,u.ty=v*n+y*r+h.matrix.ty,this.data.transformMode){case e.TransformMode.Normal:d=a+90+l;var x=e.MathUtils.cosDeg(a+s)*i,M=e.MathUtils.cosDeg(d)*o,E=e.MathUtils.sinDeg(a+s)*i,b=e.MathUtils.sinDeg(d)*o;return u.a=m*x+g*E,u.c=m*M+g*b,u.b=v*x+y*E,void(u.d=v*M+y*b);case e.TransformMode.OnlyTranslation:d=a+90+l,u.a=e.MathUtils.cosDeg(a+s)*i,u.c=e.MathUtils.cosDeg(d)*o,u.b=e.MathUtils.sinDeg(a+s)*i,u.d=e.MathUtils.sinDeg(d)*o;break;case e.TransformMode.NoRotationOrReflection:var w=0;(R=m*m+v*v)>1e-4?(g=v*(R=Math.abs(m*y-g*v)/R),y=m*R,w=Math.atan2(v,m)*e.MathUtils.radDeg):(m=0,v=0,w=90-Math.atan2(y,g)*e.MathUtils.radDeg);var T=a+s-w,S=a+l-w+90;x=e.MathUtils.cosDeg(T)*i,M=e.MathUtils.cosDeg(S)*o,E=e.MathUtils.sinDeg(T)*i,b=e.MathUtils.sinDeg(S)*o,u.a=m*x-g*E,u.c=m*M-g*b,u.b=v*x+y*E,u.d=v*M+y*b;break;case e.TransformMode.NoScale:case e.TransformMode.NoScaleOrReflection:var R,A=e.MathUtils.cosDeg(a),P=e.MathUtils.sinDeg(a),I=(m*A+g*P)/c,C=(v*A+y*P)/p;(R=Math.sqrt(I*I+C*C))>1e-5&&(R=1/R),I*=R,C*=R,R=Math.sqrt(I*I+C*C),this.data.transformMode==e.TransformMode.NoScale&&m*y-g*v<0!=(t.yDown?this.skeleton.scaleX<0!=this.skeleton.scaleY>0:this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(R=-R);var V=Math.PI/2+Math.atan2(C,I),k=Math.cos(V)*R,N=Math.sin(V)*R;x=e.MathUtils.cosDeg(s)*i,M=e.MathUtils.cosDeg(90+l)*o,E=e.MathUtils.sinDeg(s)*i,b=e.MathUtils.sinDeg(90+l)*o,u.a=I*x+k*E,u.c=I*M+k*b,u.b=C*x+N*E,u.d=C*M+N*b}u.a*=c,u.c*=c,u.b*=p,u.d*=p},t.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},t.prototype.getWorldRotationX=function(){return Math.atan2(this.matrix.b,this.matrix.a)*e.MathUtils.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.matrix.d,this.matrix.c)*e.MathUtils.radDeg},t.prototype.getWorldScaleX=function(){var t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)},t.prototype.getWorldScaleY=function(){var t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)},t.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent,n=this.matrix;if(null==t)return this.ax=n.tx,this.ay=n.ty,this.arotation=Math.atan2(n.b,n.a)*e.MathUtils.radDeg,this.ascaleX=Math.sqrt(n.a*n.a+n.b*n.b),this.ascaleY=Math.sqrt(n.c*n.c+n.d*n.d),this.ashearX=0,void(this.ashearY=Math.atan2(n.a*n.c+n.b*n.d,n.a*n.d-n.b*n.c)*e.MathUtils.radDeg);var r=t.matrix,a=1/(r.a*r.d-r.b*r.c),i=n.tx-r.tx,o=n.ty-r.ty;this.ax=i*r.d*a-o*r.c*a,this.ay=o*r.a*a-i*r.b*a;var s=a*r.d,l=a*r.a,h=a*r.c,u=a*r.b,c=s*n.a-h*n.b,p=s*n.c-h*n.d,f=l*n.b-u*n.a,d=l*n.d-u*n.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(c*c+f*f),this.ascaleX>1e-4){var m=c*d-p*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(c*p+f*d,m)*e.MathUtils.radDeg,this.arotation=Math.atan2(f,c)*e.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+d*d),this.ashearY=0,this.arotation=90-Math.atan2(d,p)*e.MathUtils.radDeg},t.prototype.worldToLocal=function(t){var e=this.matrix,n=e.a,r=e.c,a=e.b,i=e.d,o=1/(n*i-r*a),s=t.x-e.tx,l=t.y-e.ty;return t.x=s*i*o-l*r*o,t.y=l*n*o-s*a*o,t},t.prototype.localToWorld=function(t){var e=this.matrix,n=t.x,r=t.y;return t.x=n*e.a+r*e.c+e.tx,t.y=n*e.b+r*e.d+e.ty,t},t.prototype.worldToLocalRotation=function(t){var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t),a=this.matrix;return Math.atan2(a.a*n-a.b*r,a.d*r-a.c*n)*e.MathUtils.radDeg},t.prototype.localToWorldRotation=function(t){var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t),a=this.matrix;return Math.atan2(r*a.b+n*a.d,r*a.a+n*a.c)*e.MathUtils.radDeg},t.prototype.rotateWorld=function(t){var n=this.matrix,r=n.a,a=n.c,i=n.b,o=n.d,s=e.MathUtils.cosDeg(t),l=e.MathUtils.sinDeg(t);n.a=s*r-l*i,n.c=s*a-l*o,n.b=l*r+s*i,n.d=l*a+s*o,this.appliedValid=!1},t.yDown=!1,t}(),e.Bone=n}(x||(x={})),function(t){var e,n,r;e=t.core||(t.core={}),r=function(t,e,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=n.Normal,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=r},e.BoneData=r,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(n=e.TransformMode||(e.TransformMode={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},e.Event=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){this.name=t},e.EventData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=[];for(var n=0;n<t.bones.length;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)}return t.prototype.getOrder=function(){return this.data.order},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.mix)}},t.prototype.apply1=function(t,n,r,a,i,o,s){t.appliedValid||t.updateAppliedTransform();var l=t.parent.matrix,h=1/(l.a*l.d-l.b*l.c),u=n-l.tx,c=r-l.ty,p=(u*l.d-c*l.c)*h-t.ax,f=(c*l.a-u*l.b)*h-t.ay,d=Math.atan2(f,p)*e.MathUtils.radDeg-t.ashearX-t.arotation;t.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);var m=t.ascaleX,g=t.ascaleY;if(a||i){var v=t.data.length*m,y=Math.sqrt(p*p+f*f);if(a&&y<v||i&&y>v&&v>1e-4){var x=(y/v-1)*s+1;m*=x,o&&(g*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+d*s,m,g,t.ashearX,t.ashearY)},t.prototype.apply2=function(t,n,r,a,i,o,s){if(0!=s){t.appliedValid||t.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=t.ax,h=t.ay,u=t.ascaleX,c=u,p=t.ascaleY,f=n.ascaleX,d=t.matrix,m=0,g=0,v=0;u<0?(u=-u,m=180,v=-1):(m=0,v=1),p<0&&(p=-p,v=-v),f<0?(f=-f,g=180):g=0;var y=n.ax,x=0,M=0,E=0,b=d.a,w=d.c,T=d.b,S=d.d,R=Math.abs(u-p)<=1e-4;R?(M=b*y+w*(x=n.ay)+d.tx,E=T*y+S*x+d.ty):(x=0,M=b*y+d.tx,E=T*y+d.ty);var A=t.parent.matrix;b=A.a,w=A.c,T=A.b;var P=1/(b*(S=A.d)-w*T),I=r-A.tx,C=a-A.ty,V=(I*S-C*w)*P-l,k=(C*b-I*T)*P-h,N=V*V+k*k,D=((I=M-A.tx)*S-(C=E-A.ty)*w)*P-l,O=(C*b-I*T)*P-h,_=Math.sqrt(D*D+O*O),U=n.data.length*f,Y=0,X=0;t:if(R){var F=(N-_*_-(U*=u)*U)/(2*_*U);F<-1?F=-1:F>1&&(F=1,o&&_+U>1e-4&&(c*=(Math.sqrt(N)/(_+U)-1)*s+1)),X=Math.acos(F)*i,b=_+U*F,w=U*Math.sin(X),Y=Math.atan2(k*b-V*w,V*b+k*w)}else{var B=(b=u*U)*b,L=(w=p*U)*w,W=Math.atan2(k,V),j=-2*L*_,q=L-B;if((S=j*j-4*q*(T=L*_*_+B*N-B*L))>=0){var G=Math.sqrt(S);j<0&&(G=-G);var H=(G=-(j+G)/2)/q,z=T/G,Z=Math.abs(H)<Math.abs(z)?H:z;if(Z*Z<=N){C=Math.sqrt(N-Z*Z)*i,Y=W-Math.atan2(C,Z),X=Math.atan2(C/p,(Z-_)/u);break t}}var J=e.MathUtils.PI,Q=_-b,K=Q*Q,$=0,tt=0,et=_+b,nt=et*et,rt=0;(T=-b*_/(B-L))>=-1&&T<=1&&(T=Math.acos(T),(S=(I=b*Math.cos(T)+_)*I+(C=w*Math.sin(T))*C)<K&&(J=T,K=S,Q=I,$=C),S>nt&&(tt=T,nt=S,et=I,rt=C)),N<=(K+nt)/2?(Y=W-Math.atan2($*i,Q),X=J*i):(Y=W-Math.atan2(rt*i,et),X=tt*i)}var at=Math.atan2(x,y)*v,it=t.arotation;(Y=(Y-at)*e.MathUtils.radDeg+m-it)>180?Y-=360:Y<-180&&(Y+=360),t.updateWorldTransformWith(l,h,it+Y*s,c,t.ascaleY,0,0),it=n.arotation,(X=((X+at)*e.MathUtils.radDeg-n.ashearX)*v+g-it)>180?X-=360:X<-180&&(X+=360),n.updateWorldTransformWith(y,x,it+X*s,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},t}(),e.IkConstraint=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){this.order=0,this.bones=[],this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t},e.IkConstraintData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=[],this.positions=[],this.world=[],this.curves=[],this.lengths=[],this.segments=[],null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(var n=0,r=t.bones.length;n<r;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}return t.prototype.apply=function(){this.update()},t.prototype.update=function(){var n=this.target.getAttachment();if(n instanceof e.PathAttachment){var r=this.rotateMix,a=this.translateMix,i=r>0;if(a>0||i){var o=this.data,s=o.spacingMode,l=s==e.SpacingMode.Length,h=o.rotateMode,u=h==e.RotateMode.Tangent,c=h==e.RotateMode.ChainScale,p=this.bones.length,f=u?p:p+1,d=this.bones,m=e.Utils.setArraySize(this.spaces,f),g=null,v=this.spacing;if(c||l){c&&(g=e.Utils.setArraySize(this.lengths,p));for(var y=0,x=f-1;y<x;){var M=(C=d[y]).data.length;if(M<t.epsilon)c&&(g[y]=0),m[++y]=0;else{var E=M*C.matrix.a,b=M*C.matrix.b,w=Math.sqrt(E*E+b*b);c&&(g[y]=w),m[++y]=(l?M+v:v)*w/M}}}else for(y=1;y<f;y++)m[y]=v;var T=this.computeWorldPositions(n,f,u,o.positionMode==e.PositionMode.Percent,s==e.SpacingMode.Percent),S=T[0],R=T[1],A=o.offsetRotation,P=!1;0==A?P=h==e.RotateMode.Chain:(P=!1,A*=(I=this.target.bone.matrix).a*I.d-I.b*I.c>0?e.MathUtils.degRad:-e.MathUtils.degRad),y=0;for(var I=3;y<p;y++,I+=3){var C,V=(C=d[y]).matrix;V.tx+=(S-V.tx)*a,V.ty+=(R-V.ty)*a;var k=(E=T[I])-S,N=(b=T[I+1])-R;if(c){var D=g[y];if(0!=D){var O=(Math.sqrt(k*k+N*N)/D-1)*r+1;V.a*=O,V.b*=O}}if(S=E,R=b,i){var _=V.a,U=V.c,Y=V.b,X=V.d,F=0,B=0,L=0;if(F=u?T[I-1]:0==m[y+1]?T[I+2]:Math.atan2(N,k),F-=Math.atan2(Y,_),P){B=Math.cos(F),L=Math.sin(F);var W=C.data.length;S+=(W*(B*_-L*Y)-k)*r,R+=(W*(L*_+B*Y)-N)*r}else F+=A;F>e.MathUtils.PI?F-=e.MathUtils.PI2:F<-e.MathUtils.PI&&(F+=e.MathUtils.PI2),F*=r,B=Math.cos(F),L=Math.sin(F),V.a=B*_-L*Y,V.c=B*U-L*X,V.b=L*_+B*Y,V.d=L*U+B*X}C.appliedValid=!1}}}},t.prototype.computeWorldPositions=function(n,r,a,i,o){var s=this.target,l=this.position,h=this.spaces,u=e.Utils.setArraySize(this.positions,3*r+2),c=null,p=n.closed,f=n.worldVerticesLength,d=f/6,m=t.NONE;if(!n.constantSpeed){var g=n.lengths,v=g[d-=p?1:2];if(i&&(l*=v),o)for(var y=0;y<r;y++)h[y]*=v;c=e.Utils.setArraySize(this.world,8),y=0;for(var x=0,M=0;y<r;y++,x+=3){var E=l+=q=h[y];if(p)(E%=v)<0&&(E+=v),M=0;else{if(E<0){m!=t.BEFORE&&(m=t.BEFORE,n.computeWorldVertices(s,2,4,c,0,2)),this.addBeforePosition(E,c,0,u,x);continue}if(E>v){m!=t.AFTER&&(m=t.AFTER,n.computeWorldVertices(s,f-6,4,c,0,2)),this.addAfterPosition(E-v,c,0,u,x);continue}}for(;;M++){var b=g[M];if(!(E>b)){0==M?E/=b:E=(E-(Z=g[M-1]))/(b-Z);break}}M!=m&&(m=M,p&&M==d?(n.computeWorldVertices(s,f-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*M+2,8,c,0,2)),this.addCurvePosition(E,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,a||y>0&&0==q)}return u}p?(f+=2,c=e.Utils.setArraySize(this.world,f),n.computeWorldVertices(s,2,f-4,c,0,2),n.computeWorldVertices(s,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(d--,f-=4,c=e.Utils.setArraySize(this.world,f),n.computeWorldVertices(s,2,f,c,0,2));for(var w=e.Utils.setArraySize(this.curves,d),T=0,S=c[0],R=c[1],A=0,P=0,I=0,C=0,V=0,k=0,N=0,D=0,O=0,_=0,U=0,Y=0,X=0,F=0,B=(y=0,2);y<d;y++,B+=6)A=c[B],P=c[B+1],I=c[B+2],C=c[B+3],U=2*(N=.1875*(S-2*A+I))+(O=.09375*(3*(A-I)-S+(V=c[B+4]))),Y=2*(D=.1875*(R-2*P+C))+(_=.09375*(3*(P-C)-R+(k=c[B+5]))),X=.75*(A-S)+N+.16666667*O,F=.75*(P-R)+D+.16666667*_,T+=Math.sqrt(X*X+F*F),X+=U,F+=Y,U+=O,Y+=_,T+=Math.sqrt(X*X+F*F),X+=U,F+=Y,T+=Math.sqrt(X*X+F*F),X+=U+O,F+=Y+_,T+=Math.sqrt(X*X+F*F),w[y]=T,S=V,R=k;if(i&&(l*=T),o)for(y=0;y<r;y++)h[y]*=T;for(var L=this.segments,W=0,j=(y=0,x=0,M=0,0);y<r;y++,x+=3){var q;if(E=l+=q=h[y],p)(E%=T)<0&&(E+=T),M=0;else{if(E<0){this.addBeforePosition(E,c,0,u,x);continue}if(E>T){this.addAfterPosition(E-T,c,f-4,u,x);continue}}for(;;M++){var G=w[M];if(!(E>G)){0==M?E/=G:E=(E-(Z=w[M-1]))/(G-Z);break}}if(M!=m){m=M;var H=6*M;for(S=c[H],R=c[H+1],A=c[H+2],P=c[H+3],I=c[H+4],C=c[H+5],U=2*(N=.03*(S-2*A+I))+(O=.006*(3*(A-I)-S+(V=c[H+6]))),Y=2*(D=.03*(R-2*P+C))+(_=.006*(3*(P-C)-R+(k=c[H+7]))),X=.3*(A-S)+N+.16666667*O,F=.3*(P-R)+D+.16666667*_,W=Math.sqrt(X*X+F*F),L[0]=W,H=1;H<8;H++)X+=U,F+=Y,U+=O,Y+=_,W+=Math.sqrt(X*X+F*F),L[H]=W;X+=U,F+=Y,W+=Math.sqrt(X*X+F*F),L[8]=W,X+=U+O,F+=Y+_,W+=Math.sqrt(X*X+F*F),L[9]=W,j=0}for(E*=W;;j++){var z=L[j];if(!(E>z)){var Z;0==j?E/=z:E=j+(E-(Z=L[j-1]))/(z-Z);break}}this.addCurvePosition(.1*E,S,R,A,P,I,C,V,k,u,x,a||y>0&&0==q)}return u},t.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,l=e[n+3]-o,h=Math.atan2(l,s);r[a]=i+t*Math.cos(h),r[a+1]=o+t*Math.sin(h),r[a+2]=h},t.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],l=o-e[n+1],h=Math.atan2(l,s);r[a]=i+t*Math.cos(h),r[a+1]=o+t*Math.sin(h),r[a+2]=h},t.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,l,h,u,c){(0==t||isNaN(t))&&(t=1e-4);var p=t*t,f=p*t,d=1-t,m=d*d,g=m*d,v=d*t,y=3*v,x=d*y,M=y*t,E=e*g+r*x+i*M+s*f,b=n*g+a*x+o*M+l*f;h[u]=E,h[u+1]=b,c&&(h[u+2]=Math.atan2(b-(n*m+a*v*2+o*p),E-(e*m+r*v*2+i*p)))},t.prototype.getOrder=function(){return this.data.order},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t.epsilon=1e-5,t}(),e.PathConstraint=n}(x||(x={})),function(t){var e,n,r,a,i;e=t.core||(t.core={}),i=function(t){this.order=0,this.bones=[],this.name=t},e.PathConstraintData=i,(n=e.PositionMode||(e.PositionMode={}))[n.Fixed=0]="Fixed",n[n.Percent=1]="Percent",(r=e.SpacingMode||(e.SpacingMode={}))[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",(a=e.RotateMode||(e.RotateMode={}))[a.Tangent=0]="Tangent",a[a.Chain=1]="Chain",a[a.ChainScale=2]="ChainScale"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this._updateCache=[],this.updateCacheReset=[],this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=[];for(var n=0;n<t.bones.length;n++){var r=t.bones[n],a=void 0;if(null==r.parent)a=new e.Bone(r,this,null);else{var i=this.bones[r.parent.index];a=new e.Bone(r,this,i),i.children.push(a)}this.bones.push(a)}for(this.slots=[],this.drawOrder=[],n=0;n<t.slots.length;n++){var o=t.slots[n],s=(a=this.bones[o.boneData.index],new e.Slot(o,a));this.slots.push(s),this.drawOrder.push(s)}for(this.ikConstraints=[],n=0;n<t.ikConstraints.length;n++){var l=t.ikConstraints[n];this.ikConstraints.push(new e.IkConstraint(l,this))}for(this.transformConstraints=[],n=0;n<t.transformConstraints.length;n++){var h=t.transformConstraints[n];this.transformConstraints.push(new e.TransformConstraint(h,this))}for(this.pathConstraints=[],n=0;n<t.pathConstraints.length;n++){var u=t.pathConstraints[n];this.pathConstraints.push(new e.PathConstraint(u,this))}this.color=new e.Color(1,1,1,1),this.updateCache()}return t.prototype.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,n=t.length;e<n;e++)t[e].sorted=!1;var r=this.ikConstraints,a=this.transformConstraints,i=this.pathConstraints,o=r.length,s=a.length,l=i.length,h=o+s+l;t:for(e=0;e<h;e++){for(var u=0;u<o;u++)if((c=r[u]).data.order==e){this.sortIkConstraint(c);continue t}for(u=0;u<s;u++)if((c=a[u]).data.order==e){this.sortTransformConstraint(c);continue t}for(u=0;u<l;u++){var c;if((c=i[u]).data.order==e){this.sortPathConstraint(c);continue t}}}for(e=0,n=t.length;e<n;e++)this.sortBone(t[e])},t.prototype.sortIkConstraint=function(t){var e=t.target;this.sortBone(e);var n=t.bones,r=n[0];if(this.sortBone(r),n.length>1){var a=n[n.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},t.prototype.sortPathConstraint=function(t){var n=t.target,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,o=this.data.skins.length;i<o;i++)this.sortPathConstraintAttachment(this.data.skins[i],r,a);var s=n.getAttachment();s instanceof e.PathAttachment&&this.sortPathConstraintAttachmentWith(s,a);var l=t.bones,h=l.length;for(i=0;i<h;i++)this.sortBone(l[i]);for(this._updateCache.push(t),i=0;i<h;i++)this.sortReset(l[i].children);for(i=0;i<h;i++)l[i].sorted=!0},t.prototype.sortTransformConstraint=function(t){this.sortBone(t.target);var e=t.bones,n=e.length;if(t.data.local)for(var r=0;r<n;r++){var a=e[r];this.sortBone(a.parent),this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}else for(r=0;r<n;r++)this.sortBone(e[r]);this._updateCache.push(t);for(var i=0;i<n;i++)this.sortReset(e[i].children);for(i=0;i<n;i++)e[i].sorted=!0},t.prototype.sortPathConstraintAttachment=function(t,e,n){var r=t.attachments[e];if(r)for(var a in r)this.sortPathConstraintAttachmentWith(r[a],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,n){if(t instanceof e.PathAttachment){var r=t.bones;if(null==r)this.sortBone(n);else for(var a=this.bones,i=0;i<r.length;)for(var o=r[i++],s=i+o;i<s;i++){var l=r[i];this.sortBone(a[l])}}},t.prototype.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},t.prototype.sortReset=function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e];r.sorted&&this.sortReset(r.children),r.sorted=!1}},t.prototype.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,n=t.length;e<n;e++){var r=t[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}var a=this._updateCache;for(e=0,n=a.length;e<n;e++)a[e].update()},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){for(var t=this.bones,e=0,n=t.length;e<n;e++)t[e].setToSetupPose();var r=this.ikConstraints;for(e=0,n=r.length;e<n;e++)(s=r[e]).bendDirection=s.data.bendDirection,s.mix=s.data.mix;var a=this.transformConstraints;for(e=0,n=a.length;e<n;e++){var i=(s=a[e]).data;s.rotateMix=i.rotateMix,s.translateMix=i.translateMix,s.scaleMix=i.scaleMix,s.shearMix=i.shearMix}var o=this.pathConstraints;for(e=0,n=o.length;e<n;e++){var s;i=(s=o[e]).data,s.position=i.position,s.spacing=i.spacing,s.rotateMix=i.rotateMix,s.translateMix=i.translateMix}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;e.Utils.arrayCopy(t,0,this.drawOrder,0,t.length);for(var n=0,r=t.length;n<r;n++)t[n].setToSetupPose()},t.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++)if(e[n].data.name==t)return n;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++)if(e[n].data.name==t)return n;return-1},t.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)},t.prototype.setSkin=function(t){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n],i=a.data.attachmentName;if(null!=i){var o=t.getAttachment(n,i);null!=o&&a.setAttachment(o)}}this.skin=t},t.prototype.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},t.prototype.getAttachment=function(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){var n=this.skin.getAttachment(t,e);if(null!=n)return n}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},t.prototype.setAttachment=function(t,e){if(null==t)throw new Error("slotName cannot be null.");for(var n=this.slots,r=0,a=n.length;r<a;r++){var i=n[r];if(i.data.name==t){var o=null;if(null!=e&&null==(o=this.getAttachment(r,e)))throw new Error("Attachment not found: "+e+", for slot: "+t);return void i.setAttachment(o)}}throw new Error("Slot not found: "+t)},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.getBounds=function(t,n,r){if(null==t)throw new Error("offset cannot be null.");if(null==n)throw new Error("size cannot be null.");for(var a=this.drawOrder,i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=0,u=a.length;h<u;h++){var c=a[h],p=0,f=null,d=c.getAttachment();if(d instanceof e.RegionAttachment)p=8,f=e.Utils.setArraySize(r,p,0),d.computeWorldVertices(c.bone,f,0,2);else if(d instanceof e.MeshAttachment){var m=d;p=m.worldVerticesLength,f=e.Utils.setArraySize(r,p,0),m.computeWorldVertices(c,0,p,f,0,2)}if(null!=f)for(var g=0,v=f.length;g<v;g+=2){var y=f[g],x=f[g+1];i=Math.min(i,y),o=Math.min(o,x),s=Math.max(s,y),l=Math.max(l,x)}}t.set(i,o),n.set(s-i,l-o)},t.prototype.update=function(t){this.time+=t},Object.defineProperty(t.prototype,"flipX",{get:function(){return-1==this.scaleX},set:function(e){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=e?1:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flipY",{get:function(){return-1==this.scaleY},set:function(e){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=e?1:-1},enumerable:!0,configurable:!0}),t.deprecatedWarning1=!1,t}(),e.Skeleton=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=[],this.polygons=[],this.polygonPool=new e.Pool((function(){return e.Utils.newFloatArray(16)}))}return t.prototype.update=function(t,n){if(null==t)throw new Error("skeleton cannot be null.");var r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,o=t.slots,s=o.length;r.length=0,i.freeAll(a),a.length=0;for(var l=0;l<s;l++){var h=o[l],u=h.getAttachment();if(u instanceof e.BoundingBoxAttachment){var c=u;r.push(c);var p=i.obtain();p.length!=c.worldVerticesLength&&(p=e.Utils.newFloatArray(c.worldVerticesLength)),a.push(p),c.computeWorldVertices(h,0,c.worldVerticesLength,p,0,2)}}n?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)},t.prototype.aabbCompute=function(){for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=this.polygons,i=0,o=a.length;i<o;i++)for(var s=a[i],l=s,h=0,u=s.length;h<u;h+=2){var c=l[h],p=l[h+1];t=Math.min(t,c),e=Math.min(e,p),n=Math.max(n,c),r=Math.max(r,p)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=r},t.prototype.aabbContainsPoint=function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},t.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var l=(r-e)/(n-t),h=l*(a-t)+e;if(h>i&&h<s)return!0;if((h=l*(o-t)+e)>i&&h<s)return!0;var u=(i-e)/l+t;return u>a&&u<o||(u=(s-e)/l+t)>a&&u<o},t.prototype.aabbIntersectsSkeleton=function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},t.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r<a;r++)if(this.containsPointPolygon(n[r],t,e))return this.boundingBoxes[r];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var r=t,a=t.length,i=a-2,o=!1,s=0;s<a;s+=2){var l=r[s+1],h=r[i+1];if(l<n&&h>=n||h<n&&l>=n){var u=r[s];u+(n-l)/(h-l)*(r[i]-u)<e&&(o=!o)}i=s}return o},t.prototype.intersectsSegment=function(t,e,n,r){for(var a=this.polygons,i=0,o=a.length;i<o;i++)if(this.intersectsSegmentPolygon(a[i],t,e,n,r))return this.boundingBoxes[i];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,r,a){for(var i=t,o=t.length,s=e-r,l=n-a,h=e*a-n*r,u=i[o-2],c=i[o-1],p=0;p<o;p+=2){var f=i[p],d=i[p+1],m=u*d-c*f,g=u-f,v=c-d,y=s*v-l*g,x=(h*g-s*m)/y;if((x>=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=r||x>=r&&x<=e)){var M=(h*v-l*m)/y;if((M>=c&&M<=d||M>=d&&M<=c)&&(M>=n&&M<=a||M>=a&&M<=n))return!0}u=f,c=d}return!1},t.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t}(),e.SkeletonBounds=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.triangulator=new e.Triangulator,this.clippingPolygon=[],this.clipOutput=[],this.clippedVertices=[],this.clippedTriangles=[],this.scratch=[]}return t.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=e.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var o=this.clippingPolygon;t.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),l=0,h=s.length;l<h;l++){var u=s[l];t.makeClockwise(u),u.push(u[0]),u.push(u[1])}return s.length},t.prototype.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},t.prototype.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},t.prototype.isClipping=function(){return null!=this.clipAttachment},t.prototype.clipTriangles=function(t,n,r,a,i,o,s,l){var h=this.clipOutput,u=this.clippedVertices,c=this.clippedTriangles,p=this.clippingPolygons,f=this.clippingPolygons.length,d=l?12:8,m=0;u.length=0,c.length=0;t:for(var g=0;g<a;g+=3)for(var v=r[g]<<1,y=t[v],x=t[v+1],M=i[v],E=i[v+1],b=t[v=r[g+1]<<1],w=t[v+1],T=i[v],S=i[v+1],R=t[v=r[g+2]<<1],A=t[v+1],P=i[v],I=i[v+1],C=0;C<f;C++){var V=u.length;if(!this.clip(y,x,b,w,R,A,p[C],h)){(F=e.Utils.setArraySize(u,V+3*d))[V]=y,F[V+1]=x,F[V+2]=o.r,F[V+3]=o.g,F[V+4]=o.b,F[V+5]=o.a,l?(F[V+6]=M,F[V+7]=E,F[V+8]=s.r,F[V+9]=s.g,F[V+10]=s.b,F[V+11]=s.a,F[V+12]=b,F[V+13]=w,F[V+14]=o.r,F[V+15]=o.g,F[V+16]=o.b,F[V+17]=o.a,F[V+18]=T,F[V+19]=S,F[V+20]=s.r,F[V+21]=s.g,F[V+22]=s.b,F[V+23]=s.a,F[V+24]=R,F[V+25]=A,F[V+26]=o.r,F[V+27]=o.g,F[V+28]=o.b,F[V+29]=o.a,F[V+30]=P,F[V+31]=I,F[V+32]=s.r,F[V+33]=s.g,F[V+34]=s.b,F[V+35]=s.a):(F[V+6]=M,F[V+7]=E,F[V+8]=b,F[V+9]=w,F[V+10]=o.r,F[V+11]=o.g,F[V+12]=o.b,F[V+13]=o.a,F[V+14]=T,F[V+15]=S,F[V+16]=R,F[V+17]=A,F[V+18]=o.r,F[V+19]=o.g,F[V+20]=o.b,F[V+21]=o.a,F[V+22]=P,F[V+23]=I),V=c.length,(Z=e.Utils.setArraySize(c,V+3))[V]=m,Z[V+1]=m+1,Z[V+2]=m+2,m+=3;continue t}var k=h.length;if(0!=k){for(var N=w-A,D=R-b,O=y-R,_=A-x,U=1/(N*O+D*(x-A)),Y=k>>1,X=this.clipOutput,F=e.Utils.setArraySize(u,V+Y*d),B=0;B<k;B+=2){var L=X[B],W=X[B+1];F[V]=L,F[V+1]=W,F[V+2]=o.r,F[V+3]=o.g,F[V+4]=o.b,F[V+5]=o.a;var j=L-R,q=W-A,G=(N*j+D*q)*U,H=(_*j+O*q)*U,z=1-G-H;F[V+6]=M*G+T*H+P*z,F[V+7]=E*G+S*H+I*z,l&&(F[V+8]=s.r,F[V+9]=s.g,F[V+10]=s.b,F[V+11]=s.a),V+=d}V=c.length;var Z=e.Utils.setArraySize(c,V+3*(Y-2));for(Y--,B=1;B<Y;B++)Z[V]=m,Z[V+1]=m+B,Z[V+2]=m+B+1,V+=3;m+=Y+1}}},t.prototype.clip=function(t,e,n,r,a,i,o,s){var l=s,h=!1,u=null;o.length%4>=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(a),u.push(i),u.push(t),u.push(e),s.length=0;for(var c=o,p=o.length-4,f=0;;f+=2){for(var d=c[f],m=c[f+1],g=c[f+2],v=c[f+3],y=d-g,x=m-v,M=u,E=u.length-2,b=s.length,w=0;w<E;w+=2){var T=M[w],S=M[w+1],R=M[w+2],A=M[w+3],P=y*(A-v)-x*(R-g)>0;if(y*(S-v)-x*(T-g)>0){if(P){s.push(R),s.push(A);continue}var I=((V=R-T)*(m-S)-(C=A-S)*(d-T))/(C*(g-d)-V*(v-m));s.push(d+(g-d)*I),s.push(m+(v-m)*I)}else if(P){var C,V;I=((V=R-T)*(m-S)-(C=A-S)*(d-T))/(C*(g-d)-V*(v-m)),s.push(d+(g-d)*I),s.push(m+(v-m)*I),s.push(R),s.push(A)}h=!0}if(b==s.length)return l.length=0,!0;if(s.push(s[0]),s.push(s[1]),f==p)break;var k=s;(s=u).length=0,u=k}if(l!=s){l.length=0,f=0;for(var N=s.length-2;f<N;f++)l[f]=s[f]}else l.length=l.length-2;return h},t.makeClockwise=function(t){for(var e=t,n=t.length,r=e[n-2]*e[1]-e[0]*e[n-1],a=0,i=0,o=0,s=0,l=n-3;s<l;s+=2)a=e[s],i=e[s+1],o=e[s+2],r+=a*e[s+3]-o*i;if(!(r<0)){s=0;var h=n-2;for(l=n>>1;s<l;s+=2){var u=e[s],c=e[s+1],p=h-s;e[s]=e[p],e[s+1]=e[p+1],e[p]=u,e[p+1]=c}}},t}(),e.SkeletonClipping=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[],this.transformConstraints=[],this.pathConstraints=[],this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t.prototype.findSkin=function(t){if(null==t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findAnimation=function(t){if(null==t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t}(),e.SkeletonData=n}(x||(x={})),function(t){!function(t){var e=function(){function e(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}return e.prototype.readSkeletonData=function(n){var r=this.scale,a=new t.SkeletonData,i="string"==typeof n?JSON.parse(n):n,o=i.skeleton;if(null!=o&&(a.hash=o.hash,a.version=o.spine,a.width=o.width,a.height=o.height,a.fps=o.fps,a.imagesPath=o.images),i.bones)for(var s=0;s<i.bones.length;s++){var l=i.bones[s],h=null,u=this.getValue(l,"parent",null);if(null!=u&&null==(h=a.findBone(u)))throw new Error("Parent bone not found: "+u);(d=new t.BoneData(a.bones.length,l.name,h)).length=this.getValue(l,"length",0)*r,d.x=this.getValue(l,"x",0)*r,d.y=this.getValue(l,"y",0)*r,d.rotation=this.getValue(l,"rotation",0),d.scaleX=this.getValue(l,"scaleX",1),d.scaleY=this.getValue(l,"scaleY",1),d.shearX=this.getValue(l,"shearX",0),d.shearY=this.getValue(l,"shearY",0),d.transformMode=e.transformModeFromString(this.getValue(l,"transform","normal")),a.bones.push(d)}if(i.slots)for(s=0;s<i.slots.length;s++){var c=(S=i.slots[s]).name,p=S.bone,f=a.findBone(p);if(null==f)throw new Error("Slot bone not found: "+p);var d=new t.SlotData(a.slots.length,c,f),m=this.getValue(S,"color",null);null!=m&&d.color.setFromString(m);var g=this.getValue(S,"dark",null);null!=g&&(d.darkColor=new t.Color(1,1,1,1),d.darkColor.setFromString(g)),d.attachmentName=this.getValue(S,"attachment",null),d.blendMode=e.blendModeFromString(this.getValue(S,"blend","normal")),a.slots.push(d)}if(i.ik)for(s=0;s<i.ik.length;s++){var v=i.ik[s];(d=new t.IkConstraintData(v.name)).order=this.getValue(v,"order",0);for(var y=0;y<v.bones.length;y++){p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("IK bone not found: "+p);d.bones.push(M)}var x=v.target;if(d.target=a.findBone(x),null==d.target)throw new Error("IK target bone not found: "+x);d.bendDirection=this.getValue(v,"bendPositive",!0)?1:-1,d.mix=this.getValue(v,"mix",1),a.ikConstraints.push(d)}if(i.transform)for(s=0;s<i.transform.length;s++){v=i.transform[s];(d=new t.TransformConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bones.length;y++){p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("Transform constraint bone not found: "+p);d.bones.push(M)}x=v.target;if(d.target=a.findBone(x),null==d.target)throw new Error("Transform constraint target bone not found: "+x);d.local=this.getValue(v,"local",!1),d.relative=this.getValue(v,"relative",!1),d.offsetRotation=this.getValue(v,"rotation",0),d.offsetX=this.getValue(v,"x",0)*r,d.offsetY=this.getValue(v,"y",0)*r,d.offsetScaleX=this.getValue(v,"scaleX",0),d.offsetScaleY=this.getValue(v,"scaleY",0),d.offsetShearY=this.getValue(v,"shearY",0),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),d.scaleMix=this.getValue(v,"scaleMix",1),d.shearMix=this.getValue(v,"shearMix",1),a.transformConstraints.push(d)}if(i.path)for(s=0;s<i.path.length;s++){v=i.path[s];(d=new t.PathConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bones.length;y++){var M;p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("Transform constraint bone not found: "+p);d.bones.push(M)}x=v.target;if(d.target=a.findSlot(x),null==d.target)throw new Error("Path target slot not found: "+x);d.positionMode=e.positionModeFromString(this.getValue(v,"positionMode","percent")),d.spacingMode=e.spacingModeFromString(this.getValue(v,"spacingMode","length")),d.rotateMode=e.rotateModeFromString(this.getValue(v,"rotateMode","tangent")),d.offsetRotation=this.getValue(v,"rotation",0),d.position=this.getValue(v,"position",0),d.positionMode==t.PositionMode.Fixed&&(d.position*=r),d.spacing=this.getValue(v,"spacing",0),d.spacingMode!=t.SpacingMode.Length&&d.spacingMode!=t.SpacingMode.Fixed||(d.spacing*=r),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),a.pathConstraints.push(d)}if(i.skins)for(var E in i.skins){var b=i.skins[E],w=new t.Skin(E);for(var c in b){var T=a.findSlotIndex(c);if(-1==T)throw new Error("Slot not found: "+c);var S=b[c];for(var R in S){var A=this.readAttachment(S[R],w,T,R,a);null!=A&&w.addAttachment(T,R,A)}}a.skins.push(w),"default"==w.name&&(a.defaultSkin=w)}s=0;for(var P=this.linkedMeshes.length;s<P;s++){var I=this.linkedMeshes[s];if(null==(w=null==I.skin?a.defaultSkin:a.findSkin(I.skin)))throw new Error("Skin not found: "+I.skin);var C=w.getAttachment(I.slotIndex,I.parent);if(null==C)throw new Error("Parent mesh not found: "+I.parent);I.mesh.setParentMesh(C)}if(this.linkedMeshes.length=0,i.events)for(var V in i.events){var k=i.events[V];(d=new t.EventData(V)).intValue=this.getValue(k,"int",0),d.floatValue=this.getValue(k,"float",0),d.stringValue=this.getValue(k,"string",""),d.audioPath=this.getValue(k,"audio",null),null!=d.audioPath&&(d.volume=this.getValue(k,"volume",1),d.balance=this.getValue(k,"balance",0)),a.events.push(d)}if(i.animations)for(var N in i.animations){var D=i.animations[N];this.readAnimation(D,N,a)}return a},e.prototype.readAttachment=function(e,r,a,i,o){var s=this.scale;switch(i=this.getValue(e,"name",i),this.getValue(e,"type","region")){case"region":var l=this.getValue(e,"path",i),h=this.attachmentLoader.newRegionAttachment(r,i,l);return null==h?null:(h.path=l,h.x=this.getValue(e,"x",0)*s,h.y=this.getValue(e,"y",0)*s,h.scaleX=this.getValue(e,"scaleX",1),h.scaleY=this.getValue(e,"scaleY",1),h.rotation=this.getValue(e,"rotation",0),h.width=e.width*s,h.height=e.height*s,null!=(E=this.getValue(e,"color",null))&&h.color.setFromString(E),h);case"boundingbox":var u=this.attachmentLoader.newBoundingBoxAttachment(r,i);return null==u?null:(this.readVertices(e,u,e.vertexCount<<1),null!=(E=this.getValue(e,"color",null))&&u.color.setFromString(E),u);case"mesh":case"linkedmesh":l=this.getValue(e,"path",i);var c=this.attachmentLoader.newMeshAttachment(r,i,l);if(null==c)return null;c.path=l,null!=(E=this.getValue(e,"color",null))&&c.color.setFromString(E);var p=this.getValue(e,"parent",null);if(null!=p)return c.inheritDeform=this.getValue(e,"deform",!0),this.linkedMeshes.push(new n(c,this.getValue(e,"skin",null),a,p)),c;var f=e.uvs;return this.readVertices(e,c,f.length),c.triangles=e.triangles,c.regionUVs=f,c.hullLength=2*this.getValue(e,"hull",0),c;case"path":if(null==(l=this.attachmentLoader.newPathAttachment(r,i)))return null;l.closed=this.getValue(e,"closed",!1),l.constantSpeed=this.getValue(e,"constantSpeed",!0);var d=e.vertexCount;this.readVertices(e,l,d<<1);for(var m=t.Utils.newArray(d/3,0),g=0;g<e.lengths.length;g++)m[g]=e.lengths[g]*s;return l.lengths=m,null!=(E=this.getValue(e,"color",null))&&l.color.setFromString(E),l;case"point":var v=this.attachmentLoader.newPointAttachment(r,i);return null==v?null:(v.x=this.getValue(e,"x",0)*s,v.y=this.getValue(e,"y",0)*s,v.rotation=this.getValue(e,"rotation",0),null!=(E=this.getValue(e,"color",null))&&v.color.setFromString(E),v);case"clipping":var y=this.attachmentLoader.newClippingAttachment(r,i);if(null==y)return null;var x=this.getValue(e,"end",null);if(null!=x){var M=o.findSlot(x);if(null==M)throw new Error("Clipping end slot not found: "+x);y.endSlot=M}var E;d=e.vertexCount;return this.readVertices(e,y,d<<1),null!=(E=this.getValue(e,"color",null))&&y.color.setFromString(E),y}return null},e.prototype.readVertices=function(e,n,r){var a=this.scale;n.worldVerticesLength=r;var i=e.vertices;if(r!=i.length){var o=[],s=[];for(c=0,p=i.length;c<p;){var l=i[c++];s.push(l);for(var h=c+4*l;c<h;c+=4)s.push(i[c]),o.push(i[c+1]*a),o.push(i[c+2]*a),o.push(i[c+3])}n.bones=s,n.vertices=t.Utils.toFloatArray(o)}else{var u=t.Utils.toFloatArray(i);if(1!=a)for(var c=0,p=i.length;c<p;c++)u[c]*=a;n.vertices=u}},e.prototype.readAnimation=function(e,n,r){var a=this.scale,i=[],o=0;if(e.slots)for(var s in e.slots){var l=e.slots[s];if(-1==(Z=r.findSlotIndex(s)))throw new Error("Slot not found: "+s);for(var h in l){var u=l[h];if("attachment"==h){(M=new t.AttachmentTimeline(u.length)).slotIndex=Z;for(var c=0,p=0;p<u.length;p++){var f=u[p];M.setFrame(c++,f.time,f.name)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}else if("color"==h){(M=new t.ColorTimeline(u.length)).slotIndex=Z;for(c=0,p=0;p<u.length;p++){f=u[p];var d=new t.Color;d.setFromString(f.color||"ffffffff"),M.setFrame(c,f.time,d.r,d.g,d.b,d.a),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=h)throw new Error("Invalid timeline type for a slot: "+h+" ("+s+")");(M=new t.TwoColorTimeline(u.length)).slotIndex=Z;for(c=0,p=0;p<u.length;p++){f=u[p];var m=new t.Color,g=new t.Color;m.setFromString(f.light),g.setFromString(f.dark),M.setFrame(c,f.time,m.r,m.g,m.b,m.a,g.r,g.g,g.b),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TwoColorTimeline.ENTRIES])}}}if(e.bones)for(var v in e.bones){var y=e.bones[v],x=r.findBoneIndex(v);if(-1==x)throw new Error("Bone not found: "+v);for(var h in y){u=y[h];if("rotate"===h){(M=new t.RotateTimeline(u.length)).boneIndex=x;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,f.angle),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==h&&"scale"!==h&&"shear"!==h)throw new Error("Invalid timeline type for a bone: "+h+" ("+v+")");var M=null,E=1;"scale"===h?M=new t.ScaleTimeline(u.length):"shear"===h?M=new t.ShearTimeline(u.length):(M=new t.TranslateTimeline(u.length),E=a),M.boneIndex=x;for(c=0,p=0;p<u.length;p++){f=u[p];var b=this.getValue(f,"x",0),w=this.getValue(f,"y",0);M.setFrame(c,f.time,b*E,w*E),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TranslateTimeline.ENTRIES])}}}if(e.ik)for(var T in e.ik){var S=e.ik[T],R=r.findIkConstraint(T);(M=new t.IkConstraintTimeline(S.length)).ikConstraintIndex=r.ikConstraints.indexOf(R);for(c=0,p=0;p<S.length;p++){f=S[p];M.setFrame(c,f.time,this.getValue(f,"mix",1),this.getValue(f,"bendPositive",!0)?1:-1,this.getValue(f,"compress",!1),this.getValue(f,"stretch",!1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(var T in e.transform){S=e.transform[T],R=r.findTransformConstraint(T);(M=new t.TransformConstraintTimeline(S.length)).transformConstraintIndex=r.transformConstraints.indexOf(R);for(c=0,p=0;p<S.length;p++){f=S[p];M.setFrame(c,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"translateMix",1),this.getValue(f,"scaleMix",1),this.getValue(f,"shearMix",1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TransformConstraintTimeline.ENTRIES])}if(e.paths)for(var T in e.paths){S=e.paths[T];var A=r.findPathConstraintIndex(T);if(-1==A)throw new Error("Path constraint not found: "+T);var P=r.pathConstraints[A];for(var h in S){u=S[h];if("position"===h||"spacing"===h){M=null,E=1;"spacing"===h?(M=new t.PathConstraintSpacingTimeline(u.length),P.spacingMode!=t.SpacingMode.Length&&P.spacingMode!=t.SpacingMode.Fixed||(E=a)):(M=new t.PathConstraintPositionTimeline(u.length),P.positionMode==t.PositionMode.Fixed&&(E=a)),M.pathConstraintIndex=A;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,this.getValue(f,h,0)*E),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===h){(M=new t.PathConstraintMixTimeline(u.length)).pathConstraintIndex=A;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"translateMix",1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.PathConstraintMixTimeline.ENTRIES])}}}if(e.deform)for(var I in e.deform){var C=e.deform[I],V=r.findSkin(I);if(null==V)throw new Error("Skin not found: "+I);for(var s in C){l=C[s];if(-1==(Z=r.findSlotIndex(s)))throw new Error("Slot not found: "+l.name);for(var h in l){u=l[h];var k=V.getAttachment(Z,h);if(null==k)throw new Error("Deform attachment not found: "+u.name);var N=null!=k.bones,D=k.vertices,O=N?D.length/3*2:D.length;(M=new t.DeformTimeline(u.length)).slotIndex=Z,M.attachment=k;c=0;for(var _=0;_<u.length;_++){f=u[_];var U=void 0,Y=this.getValue(f,"vertices",null);if(null==Y)U=N?t.Utils.newFloatArray(O):D;else{U=t.Utils.newFloatArray(O);var X=this.getValue(f,"offset",0);if(t.Utils.arrayCopy(Y,0,U,X,Y.length),1!=a)for(var F=(p=X)+Y.length;p<F;p++)U[p]*=a;if(!N)for(p=0;p<O;p++)U[p]+=D[p]}M.setFrame(c,f.time,U),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}}}var B=e.drawOrder;if(null==B&&(B=e.draworder),null!=B){M=new t.DrawOrderTimeline(B.length);var L=r.slots.length;for(c=0,_=0;_<B.length;_++){var W=B[_],j=null,q=this.getValue(W,"offsets",null);if(null!=q){j=t.Utils.newArray(L,-1);var G=t.Utils.newArray(L-q.length,0),H=0,z=0;for(p=0;p<q.length;p++){var Z,J=q[p];if(-1==(Z=r.findSlotIndex(J.slot)))throw new Error("Slot not found: "+J.slot);for(;H!=Z;)G[z++]=H++;j[H+J.offset]=H++}for(;H<L;)G[z++]=H++;for(p=L-1;p>=0;p--)-1==j[p]&&(j[p]=G[--z])}M.setFrame(c++,W.time,j)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}if(e.events){for(M=new t.EventTimeline(e.events.length),c=0,p=0;p<e.events.length;p++){var Q=e.events[p],K=r.findEvent(Q.name);if(null==K)throw new Error("Event not found: "+Q.name);var $=new t.Event(t.Utils.toSinglePrecision(Q.time),K);$.intValue=this.getValue(Q,"int",K.intValue),$.floatValue=this.getValue(Q,"float",K.floatValue),$.stringValue=this.getValue(Q,"string",K.stringValue),null!=$.data.audioPath&&($.volume=this.getValue(Q,"volume",1),$.balance=this.getValue(Q,"balance",0)),M.setFrame(c++,$)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}if(isNaN(o))throw new Error("Error while parsing animation, duration is NaN");r.animations.push(new t.Animation(n,i,o))},e.prototype.readCurve=function(t,e,n){if(t.curve)if("stepped"===t.curve)e.setStepped(n);else if("[object Array]"===Object.prototype.toString.call(t.curve)){var r=t.curve;e.setCurve(n,r[0],r[1],r[2],r[3])}},e.prototype.getValue=function(t,e,n){return void 0!==t[e]?t[e]:n},e.blendModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return t.BlendMode.Additive;if("multiply"==e)return t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new Error("Unknown blend mode: "+e)},e.positionModeFromString=function(e){if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return t.PositionMode.Percent;throw new Error("Unknown position mode: "+e)},e.spacingModeFromString=function(e){if("length"==(e=e.toLowerCase()))return t.SpacingMode.Length;if("fixed"==e)return t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new Error("Unknown position mode: "+e)},e.rotateModeFromString=function(e){if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new Error("Unknown rotate mode: "+e)},e.transformModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.TransformMode.Normal;if("onlytranslation"==e)return t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return t.TransformMode.NoRotationOrReflection;if("noscale"==e)return t.TransformMode.NoScale;if("noscaleorreflection"==e)return t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode: "+e)},e}();t.SkeletonJson=e;var n=function(t,e,n,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r}}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this.attachments=[],null==t)throw new Error("name cannot be null.");this.name=t}return t.prototype.addAttachment=function(t,e,n){if(null==n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r<t.slots.length;r++){var a=t.slots[r],i=a.getAttachment();if(i&&n<e.attachments.length){var o=e.attachments[n];for(var s in o)if(i==o[s]){var l=this.getAttachment(n,s);null!=l&&a.setAttachment(l);break}}n++}},t}(),e.Skin=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,n){if(this.attachmentVertices=[],null==t)throw new Error("data cannot be null.");if(null==n)throw new Error("bone cannot be null.");this.data=t,this.bone=n,this.color=new e.Color,this.darkColor=null==t.darkColor?null:new e.Color,this.setToSetupPose(),this.blendMode=this.data.blendMode}return t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0)},t.prototype.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},t.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t}(),e.Slot=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t,n,r){if(this.color=new e.Color(1,1,1,1),t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=t,this.name=n,this.boneData=r},e.SlotData=n}(x||(x={})),function(t){!function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var a=function(){function t(){this.size=null}return Object.defineProperty(t.prototype,"width",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this.texture._uvs.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v",{get:function(){return this.texture._uvs.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u2",{get:function(){return this.texture._uvs.x2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v2",{get:function(){return this.texture._uvs.y2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){var t=this.texture;return t.trim?t.trim.x:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return console.warn("Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on."),this.spineOffsetY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pixiOffsetY",{get:function(){var t=this.texture;return t.trim?t.trim.y:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spineOffsetY",{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalWidth",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalHeight",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.texture.frame.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.texture.frame.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return 0!==this.texture.rotate},enumerable:!0,configurable:!0}),t}();t.TextureRegion=a}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(){function e(t,e,n){this.pages=[],this.regions=[],t&&this.addSpineAtlas(t,e,n)}return e.prototype.addTexture=function(e,n){for(var i=this.pages,o=null,s=0;s<i.length;s++)if(i[s].baseTexture===n.baseTexture){o=i[s];break}if(null===o){(o=new r).name="texturePage";var l=n.baseTexture;o.width=l.realWidth,o.height=l.realHeight,o.baseTexture=l,o.minFilter=o.magFilter=t.TextureFilter.Nearest,o.uWrap=t.TextureWrap.ClampToEdge,o.vWrap=t.TextureWrap.ClampToEdge,i.push(o)}var h=new a;return h.name=e,h.page=o,h.texture=n,h.index=-1,this.regions.push(h),h},e.prototype.addTextureHash=function(t,e){for(var n in t)t.hasOwnProperty(n)&&this.addTexture(e&&-1!==n.indexOf(".")?n.substr(0,n.lastIndexOf(".")):n,t[n])},e.prototype.addSpineAtlas=function(t,e,n){return this.load(t,e,n)},e.prototype.load=function(e,i,o){var s=this;if(null==i)throw new Error("textureLoader cannot be null.");var l=new n(e),h=new Array(4),u=null;!function e(){for(;;){var n=l.readLine();if(null==n)return o&&o(s);if(0==(n=n.trim()).length)u=null;else{if(!u){(u=new r).name=n,2==l.readTuple(h)&&(u.width=parseInt(h[0]),u.height=parseInt(h[1]),l.readTuple(h)),l.readTuple(h),u.minFilter=t.Texture.filterFromString(h[0]),u.magFilter=t.Texture.filterFromString(h[1]);var c=l.readValue();u.uWrap=t.TextureWrap.ClampToEdge,u.vWrap=t.TextureWrap.ClampToEdge,"x"==c?u.uWrap=t.TextureWrap.Repeat:"y"==c?u.vWrap=t.TextureWrap.Repeat:"xy"==c&&(u.uWrap=u.vWrap=t.TextureWrap.Repeat),i(n,(function(t){if(null===t)return s.pages.splice(s.pages.indexOf(u),1),o&&o(null);u.baseTexture=t,t.hasLoaded||(t.width=u.width,t.height=u.height),s.pages.push(u),u.setFilters(),u.width&&u.height||(u.width=t.realWidth,u.height=t.realHeight,u.width&&u.height||console.log("ERROR spine atlas page "+u.name+": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)")),e()})),s.pages.push(u);break}var p=new a;p.name=n,p.page=u;var f="true"==l.readValue()?6:0;l.readTuple(h);var d=parseInt(h[0]),m=parseInt(h[1]);l.readTuple(h);var g=parseInt(h[0]),v=parseInt(h[1]),y=u.baseTexture.resolution;d/=y,m/=y,g/=y,v/=y;var x=new b.Rectangle(d,m,f?v:g,f?g:v);4==l.readTuple(h)&&4==l.readTuple(h)&&l.readTuple(h);var M=parseInt(h[0])/y,E=parseInt(h[1])/y;l.readTuple(h);var w=parseInt(h[0])/y,T=parseInt(h[1])/y,S=new b.Rectangle(0,0,M,E),R=new b.Rectangle(w,E-v-T,g,v);if("3"!=b.VERSION[0])p.texture=new b.Texture(p.page.baseTexture,x,S,R,f);else{var A=new b.Rectangle(d,m,g,v),P=A.clone();R.width=M,R.height=E,p.texture=new b.Texture(p.page.baseTexture,A,P,R,f)}p.index=parseInt(l.readValue()),p.texture._updateUvs(),s.regions.push(p)}}}()},e.prototype.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.prototype.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].baseTexture.dispose()},e}();t.TextureAtlas=e;var n=function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return t.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){function e(){}return e.prototype.setFilters=function(){var e=this.baseTexture,n=this.minFilter;n==t.TextureFilter.Linear?e.scaleMode=b.SCALE_MODES.LINEAR:this.minFilter==t.TextureFilter.Nearest?e.scaleMode=b.SCALE_MODES.NEAREST:(e.mipmap=!0,n==t.TextureFilter.MipMapNearestNearest?e.scaleMode=b.SCALE_MODES.NEAREST:e.scaleMode=b.SCALE_MODES.LINEAR)},e}();t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new e.Vector2,null==t)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(n.findBone(t.bones[r].name));this.target=n.findBone(t.target.name)}return t.prototype.apply=function(){this.update()},t.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},t.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.matrix,s=o.a,l=o.c,h=o.b,u=o.d,c=s*u-l*h>0?e.MathUtils.degRad:-e.MathUtils.degRad,p=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,m=0,g=d.length;m<g;m++){var v=d[m],y=!1,x=v.matrix;if(0!=t){var M=x.a,E=x.c,b=x.b,w=x.d;(I=Math.atan2(h,s)-Math.atan2(b,M)+p)>e.MathUtils.PI?I-=e.MathUtils.PI2:I<-e.MathUtils.PI&&(I+=e.MathUtils.PI2),I*=t;var T=Math.cos(I),S=Math.sin(I);x.a=T*M-S*b,x.c=T*E-S*w,x.b=S*M+T*b,x.d=S*E+T*w,y=!0}if(0!=n){var R=this.temp;i.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),x.tx+=(R.x-x.tx)*n,x.ty+=(R.y-x.ty)*n,y=!0}if(r>0){var A=Math.sqrt(x.a*x.a+x.b*x.b),P=Math.sqrt(s*s+h*h);A>1e-5&&(A=(A+(P-A+this.data.offsetScaleX)*r)/A),x.a*=A,x.b*=A,A=Math.sqrt(x.c*x.c+x.d*x.d),P=Math.sqrt(l*l+u*u),A>1e-5&&(A=(A+(P-A+this.data.offsetScaleY)*r)/A),x.c*=A,x.d*=A,y=!0}if(a>0){E=x.c,w=x.d;var I,C=Math.atan2(w,E);(I=Math.atan2(u,l)-Math.atan2(h,s)-(C-Math.atan2(x.b,x.a)))>e.MathUtils.PI?I-=e.MathUtils.PI2:I<-e.MathUtils.PI&&(I+=e.MathUtils.PI2),I=C+(I+f)*a,A=Math.sqrt(E*E+w*w),x.c=Math.cos(I)*A,x.d=Math.sin(I)*A,y=!0}y&&(v.appliedValid=!1)}},t.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.matrix,s=o.a,l=o.c,h=o.b,u=o.d,c=s*u-l*h>0?e.MathUtils.degRad:-e.MathUtils.degRad,p=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,m=0,g=d.length;m<g;m++){var v,y=d[m],x=!1,M=y.matrix;if(0!=t){var E=M.a,b=M.c,w=M.b,T=M.d;(v=Math.atan2(h,s)+p)>e.MathUtils.PI?v-=e.MathUtils.PI2:v<-e.MathUtils.PI&&(v+=e.MathUtils.PI2),v*=t;var S=Math.cos(v),R=Math.sin(v);M.a=S*E-R*w,M.c=S*b-R*T,M.b=R*E+S*w,M.d=R*b+S*T,x=!0}if(0!=n){var A=this.temp;i.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),M.tx+=A.x*n,M.ty+=A.y*n,x=!0}if(r>0){var P=(Math.sqrt(s*s+h*h)-1+this.data.offsetScaleX)*r+1;M.a*=P,M.b*=P,P=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1,M.c*=P,M.d*=P,x=!0}if(a>0)(v=Math.atan2(u,l)-Math.atan2(h,s))>e.MathUtils.PI?v-=e.MathUtils.PI2:v<-e.MathUtils.PI&&(v+=e.MathUtils.PI2),b=M.c,T=M.d,v=Math.atan2(T,b)+(v-e.MathUtils.PI/2+f)*a,P=Math.sqrt(b*b+T*T),M.c=Math.cos(v)*P,M.d=Math.sin(v)*P,x=!0;x&&(y.appliedValid=!1)}},t.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o<s;o++){var l=i[o];l.appliedValid||l.updateAppliedTransform();var h=l.arotation;if(0!=t){var u=a.arotation-h+this.data.offsetRotation;h+=(u-=360*(16384-(16384.499999999996-u/360|0)))*t}var c=l.ax,p=l.ay;0!=e&&(c+=(a.ax-c+this.data.offsetX)*e,p+=(a.ay-p+this.data.offsetY)*e);var f=l.ascaleX,d=l.ascaleY;n>0&&(f>1e-5&&(f=(f+(a.ascaleX-f+this.data.offsetScaleX)*n)/f),d>1e-5&&(d=(d+(a.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=l.ashearY;r>0&&(u=a.ashearY-m+this.data.offsetShearY,u-=360*(16384-(16384.499999999996-u/360|0)),l.shearY+=u*r),l.updateWorldTransformWith(c,p,h,f,d,l.ashearX,m)}},t.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o<s;o++){var l=i[o];l.appliedValid||l.updateAppliedTransform();var h=l.arotation;0!=t&&(h+=(a.arotation+this.data.offsetRotation)*t);var u=l.ax,c=l.ay;0!=e&&(u+=(a.ax+this.data.offsetX)*e,c+=(a.ay+this.data.offsetY)*e);var p=l.ascaleX,f=l.ascaleY;n>0&&(p>1e-5&&(p*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),f>1e-5&&(f*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var d=l.ashearY;r>0&&(d+=(a.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(u,c,h,p,f,l.ashearX,d)}},t.prototype.getOrder=function(){return this.data.order},t}(),e.TransformConstraint=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){if(this.order=0,this.bones=[],this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t},e.TransformConstraintData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.convexPolygons=[],this.convexPolygonsIndices=[],this.indicesArray=[],this.isConcaveArray=[],this.triangles=[],this.polygonPool=new e.Pool((function(){return[]})),this.polygonIndicesPool=new e.Pool((function(){return[]}))}return t.prototype.triangulate=function(e){var n=e,r=e.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i<r;i++)a[i]=i;var o=this.isConcaveArray;o.length=0,i=0;for(var s=r;i<s;++i)o[i]=t.isConcave(i,r,n,a);var l=this.triangles;for(l.length=0;r>3;){for(var h=r-1,u=(i=0,1);;){t:if(!o[i]){for(var c=a[h]<<1,p=a[i]<<1,f=a[u]<<1,d=n[c],m=n[c+1],g=n[p],v=n[p+1],y=n[f],x=n[f+1],M=(u+1)%r;M!=h;M=(M+1)%r)if(o[M]){var E=a[M]<<1,b=n[E],w=n[E+1];if(t.positiveArea(y,x,d,m,b,w)&&t.positiveArea(d,m,g,v,b,w)&&t.positiveArea(g,v,y,x,b,w))break t}break}if(0==u){do{if(!o[i])break;i--}while(i>0);break}h=i,i=u,u=(u+1)%r}l.push(a[(r+i-1)%r]),l.push(a[i]),l.push(a[(i+1)%r]),a.splice(i,1),o.splice(i,1);var T=(--r+i-1)%r,S=i==r?0:i;o[T]=t.isConcave(T,r,n,a),o[S]=t.isConcave(S,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l},t.prototype.decompose=function(e,n){var r=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var l=-1,h=0,u=0,c=n.length;u<c;u+=3){var p=n[u]<<1,f=n[u+1]<<1,d=n[u+2]<<1,m=r[p],g=r[p+1],v=r[f],y=r[f+1],x=r[d],M=r[d+1],E=!1;if(l==p){var b=s.length-4,w=t.winding(s[b],s[b+1],s[b+2],s[b+3],x,M),T=t.winding(x,M,s[0],s[1],s[2],s[3]);w==h&&T==h&&(s.push(x),s.push(M),o.push(d),E=!0)}E||(s.length>0?(a.push(s),i.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(g),s.push(v),s.push(y),s.push(x),s.push(M),(o=this.polygonIndicesPool.obtain()).length=0,o.push(p),o.push(f),o.push(d),h=t.winding(m,g,v,y,x,M),l=p)}for(s.length>0&&(a.push(s),i.push(o)),u=0,c=a.length;u<c;u++)if(0!=(o=i[u]).length)for(var S=o[0],R=o[o.length-1],A=(s=a[u])[b=s.length-4],P=s[b+1],I=s[b+2],C=s[b+3],V=s[0],k=s[1],N=s[2],D=s[3],O=t.winding(A,P,I,C,V,k),_=0;_<c;_++)if(_!=u){var U=i[_];if(3==U.length){var Y=U[0],X=U[1],F=U[2],B=a[_];x=B[B.length-2],M=B[B.length-1],Y==S&&X==R&&(w=t.winding(A,P,I,C,x,M),T=t.winding(x,M,V,k,N,D),w==O&&T==O&&(B.length=0,U.length=0,s.push(x),s.push(M),o.push(F),A=I,P=C,I=x,C=M,_=0))}}for(u=a.length-1;u>=0;u--)0==(s=a[u]).length&&(a.splice(u,1),this.polygonPool.free(s),o=i[u],i.splice(u,1),this.polygonIndicesPool.free(o));return a},t.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[o],n[o+1])},t.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},t.winding=function(t,e,n,r,a,i){var o=n-t,s=r-e;return a*s-i*o+o*e-t*s>=0?1:-1},t}(),e.Triangulator=n}(x||(x={})),function(t){!function(t){var e=function(){function t(){this.array=[]}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return w(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(a);t.Pow=i;var o=function(t){function e(e){return t.call(this,e)||this}return w(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=o;var s=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i<e+a;i++,o++)n[o]=t[i]},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var r=t.length;if(r==e)return t;if(t.length=e,r<e)for(var a=r;a<e;a++)t[a]=n;return t},t.ensureArrayCapacity=function(e,n,r){return void 0===r&&(r=0),e.length>=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r<t;r++)n[r]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}();t.Utils=s;var l=function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var n=t.bones[e],r=n.matrix;console.log(n.data.name+", "+r.a+", "+r.b+", "+r.c+", "+r.d+", "+r.tx+", "+r.ty)}},t}();t.DebugUtils=l;var h=function(){function t(t){this.items=[],this.instantiator=t}return t.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;e<t.length;e++)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function(){this.items.length=0},t}();t.Pool=h;var u=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}();t.Vector2=u;var c=function(){function t(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return t.prototype.update=function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=c;var p=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0},t}();t.WindowedMean=p}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(t){if(null==t)throw new Error("name cannot be null.");this.name=t};t.Attachment=e;var n=function(t){function e(n){var r=t.call(this,n)||this;return r.id=(65535&e.nextID++)<<11,r.worldVerticesLength=0,r}return w(e,t),e.prototype.computeWorldVerticesOld=function(t,e){this.computeWorldVertices(t,0,this.worldVerticesLength,e,0,2)},e.prototype.computeWorldVertices=function(t,e,n,r,a,i){n=a+(n>>1)*i;var o=t.bone.skeleton,s=t.attachmentVertices,l=this.vertices,h=this.bones;if(null!=h){for(var u=0,c=0,p=0;p<e;p+=2){u+=(g=h[u])+1,c+=g}var f=o.bones;if(0==s.length)for(P=a,T=3*c;P<n;P+=i){var d=0,m=0,g=h[u++];for(g+=u;u<g;u++,T+=3){M=f[h[u]].matrix,I=l[T],C=l[T+1];var v=l[T+2];d+=(I*M.a+C*M.c+M.tx)*v,m+=(I*M.b+C*M.d+M.ty)*v}r[P]=d,r[P+1]=m}else for(var y=s,x=(P=a,T=3*c,c<<1);P<n;P+=i){d=0,m=0,g=h[u++];for(g+=u;u<g;u++,T+=3,x+=2){M=f[h[u]].matrix,I=l[T]+y[x],C=l[T+1]+y[x+1],v=l[T+2];d+=(I*M.a+C*M.c+M.tx)*v,m+=(I*M.b+C*M.d+M.ty)*v}r[P]=d,r[P+1]=m}}else{s.length>0&&(l=s);for(var M,E=(M=t.bone.matrix).tx,b=M.ty,w=M.a,T=M.c,S=M.b,R=M.d,A=e,P=a;P<n;A+=2,P+=i){var I=l[A],C=l[A+1];r[P]=I*w+C*T+E,r[P+1]=I*S+C*R+b}}},e.prototype.applyDeform=function(t){return this==t},e.nextID=0,e}(e);t.VertexAttachment=n}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),(n=e.AttachmentType||(e.AttachmentType={}))[n.Region=0]="Region",n[n.BoundingBox=1]="BoundingBox",n[n.Mesh=2]="Mesh",n[n.LinkedMesh=3]="LinkedMesh",n[n.Path=4]="Path",n[n.Point=5]="Point"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r}return w(n,t),n}(e.VertexAttachment),e.BoundingBoxAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.2275,.2275,.8078,1),r}return w(n,t),n}(e.VertexAttachment),e.ClippingAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r.inheritDeform=!1,r.tempColor=new e.Color(0,0,0,0),r}return w(n,t),n.prototype.updateUVs=function(t,n){var r=this.regionUVs.length;if(n&&n.length==r||(n=e.Utils.newFloatArray(r)),null!=t){for(var a=t.texture._uvs,i=t.width,o=t.height,s=t.originalWidth,l=t.originalHeight,h=t.offsetX,u=t.pixiOffsetY,c=0;c<r;c+=2){var p=this.regionUVs[c],f=this.regionUVs[c+1];p=(p*s-h)/i,f=(f*l-u)/o,n[c]=(a.x0*(1-p)+a.x1*p)*(1-f)+(a.x3*(1-p)+a.x2*p)*f,n[c+1]=(a.y0*(1-p)+a.y1*p)*(1-f)+(a.y3*(1-p)+a.y2*p)*f}return n}},n.prototype.applyDeform=function(t){return this==t||this.inheritDeform&&this.parentMesh==t},n.prototype.getParentMesh=function(){return this.parentMesh},n.prototype.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},n}(e.VertexAttachment),e.MeshAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.closed=!1,r.constantSpeed=!1,r.color=new e.Color(1,1,1,1),r}return w(n,t),n}(e.VertexAttachment),e.PathAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.38,.94,0,1),r}return w(n,t),n.prototype.computeWorldPosition=function(t,e){var n=t.matrix;return e.x=this.x*n.a+this.y*n.c+t.worldX,e.y=this.x*n.b+this.y*n.d+t.worldY,e},n.prototype.computeWorldRotation=function(t){var n=t.matrix,r=e.MathUtils.cosDeg(this.rotation),a=e.MathUtils.sinDeg(this.rotation),i=r*n.a+a*n.c,o=r*n.b+a*n.d;return Math.atan2(o,i)*e.MathUtils.radDeg},n}(e.VertexAttachment),e.PointAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new e.Color(1,1,1,1),r.offset=e.Utils.newFloatArray(8),r.uvs=e.Utils.newFloatArray(8),r.tempColor=new e.Color(1,1,1,1),r}return w(n,t),n.prototype.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*t,a=-this.height/2*this.scaleY+this.region.offsetY*e,i=r+this.region.width*t,o=a+this.region.height*e,s=this.rotation*Math.PI/180,l=Math.cos(s),h=Math.sin(s),u=r*l+this.x,c=r*h,p=a*l+this.y,f=a*h,d=i*l+this.x,m=i*h,g=o*l+this.y,v=o*h,y=this.offset;y[n.OX1]=u-f,y[n.OY1]=p+c,y[n.OX2]=u-v,y[n.OY2]=g+c,y[n.OX3]=d-v,y[n.OY3]=g+m,y[n.OX4]=d-f,y[n.OY4]=p+m},n.prototype.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},n.prototype.computeWorldVertices=function(t,e,r,a){var i=this.offset,o=t.matrix,s=o.tx,l=o.ty,h=o.a,u=o.c,c=o.b,p=o.d,f=0,d=0;f=i[n.OX1],d=i[n.OY1],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX2],d=i[n.OY2],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX3],d=i[n.OY3],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX4],d=i[n.OY4],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l},n.OX1=0,n.OY1=1,n.OX2=2,n.OY2=3,n.OX3=4,n.OY3=5,n.OX4=6,n.OY4=7,n.X1=0,n.Y1=1,n.C1R=2,n.C1G=3,n.C1B=4,n.C1A=5,n.U1=6,n.V1=7,n.X2=8,n.Y2=9,n.C2R=10,n.C2G=11,n.C2B=12,n.C2A=13,n.U2=14,n.V2=15,n.X3=16,n.Y3=17,n.C3R=18,n.C3G=19,n.C3B=20,n.C3A=21,n.U3=22,n.V3=23,n.X4=24,n.Y4=25,n.C4R=26,n.C4G=27,n.C4B=28,n.C4A=29,n.U4=30,n.V4=31,n}(e.Attachment),e.RegionAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}return t.prototype.begin=function(t){},t.prototype.transform=function(t,n,r,a){t.x+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY),t.y+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY)},t.prototype.end=function(){},t}(),e.JitterEffect=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}return t.prototype.begin=function(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},t.prototype.transform=function(n,r,a,i){var o=this.angle*e.MathUtils.degreesToRadians,s=n.x-this.worldX,l=n.y-this.worldY,h=Math.sqrt(s*s+l*l);if(h<this.radius){var u=t.interpolation.apply(0,o,(this.radius-h)/this.radius),c=Math.cos(u),p=Math.sin(u);n.x=c*s-p*l+this.worldX,n.y=p*s+c*l+this.worldY}},t.prototype.end=function(){},t.interpolation=new e.PowOut(2),t}(),e.SwirlEffect=n}(x||(x={})),Math.fround||(Math.fround=Math.fround=(y=new Float32Array(1),function(t){return y[0]=t,y[0]})),function(t){t.core.Bone.yDown=!0;var e=[0,0,0],n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.region=null,e}return w(e,t),e}(b.Sprite);t.SpineSprite=n;var r=function(t){function e(e,n,r,a,i){return t.call(this,e,n,r,a,i)||this}return w(e,t),e}(b.mesh.Mesh);t.SpineMesh=r;var a=function(a){function o(e){var n=a.call(this)||this;if(!e)throw new Error("The spineData param is required.");if("string"==typeof e)throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');n.spineData=e,n.skeleton=new t.core.Skeleton(e),n.skeleton.updateWorldTransform(),n.stateData=new t.core.AnimationStateData(e),n.state=new t.core.AnimationState(n.stateData),n.slotContainers=[],n.tempClipContainers=[];for(var r=0,i=n.skeleton.slots.length;r<i;r++){var o=n.skeleton.slots[r],s=o.attachment,l=n.newContainer();if(n.slotContainers.push(l),n.addChild(l),n.tempClipContainers.push(null),s instanceof t.core.RegionAttachment){var h=s.region.name,u=n.createSprite(o,s,h);o.currentSprite=u,o.currentSpriteName=h,l.addChild(u)}else if(s instanceof t.core.MeshAttachment){var c=n.createMesh(o,s);o.currentMesh=c,o.currentMeshName=s.name,l.addChild(c)}else{if(!(s instanceof t.core.ClippingAttachment))continue;n.createGraphics(o,s),l.addChild(o.clippingContainer),l.addChild(o.currentGraphics)}}return n.autoUpdate=!1,n.tintRgb=new Float32Array([1,1,1]),n}return w(o,a),Object.defineProperty(o.prototype,"autoUpdate",{get:function(){return this.updateTransform===o.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?o.prototype.autoUpdateTransform:b.Container.prototype.updateTransform},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"tint",{get:function(){return b.utils.rgb2hex(this.tintRgb)},set:function(t){this.tintRgb=b.utils.hex2rgb(t,this.tintRgb)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"delayLimit",{get:function(){return(void 0!==this.localDelayLimit?this.localDelayLimit:o.globalDelayLimit)||Number.MAX_VALUE},enumerable:!0,configurable:!0}),o.prototype.update=function(n){var r=this.delayLimit;if(n>r&&(n=r),this.state.update(n),this.state.apply(this.skeleton),this.skeleton){this.skeleton.updateWorldTransform();var a=this.skeleton.slots,o=this.color,s=null,l=null;o?(s=o.light,l=o.dark):s=this.tintRgb;for(var h=b.TransformBase&&1==this.transformHack(),u=0,c=a.length;u<c;u++){var p=(N=a[u]).attachment,f=this.slotContainers[u];if(p){var d=null,m=p.color;if(p instanceof t.core.RegionAttachment){var g=p.region;if(g){N.currentMesh&&(N.currentMesh.visible=!1,N.currentMesh=null,N.currentMeshName=void 0);var v=g;if(!N.currentSpriteName||N.currentSpriteName!==v.name){var y=v.name;if(N.currentSprite&&(N.currentSprite.visible=!1),N.sprites=N.sprites||{},void 0!==N.sprites[y])N.sprites[y].visible=!0;else{var x=this.createSprite(N,p,y);f.addChild(x)}N.currentSprite=N.sprites[y],N.currentSpriteName=y}}if(f.transform){var M=w=f.transform,E=null;M.matrix2d?(E=M.matrix2d,M._dirtyVersion++,M.version=M._dirtyVersion,M.isStatic=!0,M.operMode=0):h?(M.position&&((w=new b.TransformBase)._parentID=-1,w._worldID=f.transform._worldID,f.transform=w),E=w.localTransform):M.setFromMatrix(N.bone.matrix),E&&N.bone.matrix.copy(E)}else{E=f.localTransform||new b.Matrix;N.bone.matrix.copy(E),f.localTransform=E,f.displayObjectUpdateTransform=i}N.currentSprite.color?d=N.currentSprite.color:(e[0]=s[0]*N.color.r*m.r,e[1]=s[1]*N.color.g*m.g,e[2]=s[2]*N.color.b*m.b,N.currentSprite.tint=b.utils.rgb2hex(e)),N.currentSprite.blendMode=N.blendMode}else if(p instanceof t.core.MeshAttachment){var w;if(N.currentSprite)if(N.currentSprite.visible=!1,N.currentSprite=null,N.currentSpriteName=void 0,f.transform)(w=new b.TransformStatic)._parentID=-1,w._worldID=f.transform._worldID,f.transform=w;else f.localTransform=new b.Matrix,f.displayObjectUpdateTransform=b.DisplayObject.prototype.updateTransform;if(!N.currentMeshName||N.currentMeshName!==p.name){var T=p.name;if(N.currentMesh&&(N.currentMesh.visible=!1),N.meshes=N.meshes||{},void 0!==N.meshes[T])N.meshes[T].visible=!0;else{var S=this.createMesh(N,p);f.addChild(S)}N.currentMesh=N.meshes[T],N.currentMeshName=T}if(p.computeWorldVerticesOld(N,N.currentMesh.vertices),N.currentMesh.color)d=N.currentMesh.color;else if("3"!==b.VERSION[0]){var R=N.currentMesh.tintRgb;R[0]=s[0]*N.color.r*m.r,R[1]=s[1]*N.color.g*m.g,R[2]=s[2]*N.color.b*m.b}N.currentMesh.blendMode=N.blendMode}else{if(!(p instanceof t.core.ClippingAttachment)){f.visible=!1;continue}N.currentGraphics||(this.createGraphics(N,p),f.addChild(N.clippingContainer),f.addChild(N.currentGraphics)),this.updateGraphics(N,p)}if(f.visible=!0,d){var A=N.color.r*m.r,P=N.color.g*m.g,I=N.color.b*m.b;d.setLight(s[0]*A+l[0]*(1-A),s[1]*P+l[1]*(1-P),s[2]*I+l[2]*(1-I)),N.darkColor?(A=N.darkColor.r,P=N.darkColor.g,I=N.darkColor.b):(A=0,P=0,I=0),d.setDark(s[0]*A+l[0]*(1-A),s[1]*P+l[1]*(1-P),s[2]*I+l[2]*(1-I))}f.alpha=N.color.a}else f.visible=!1}var C=this.skeleton.drawOrder,V=null,k=null;for(u=0,c=C.length;u<c;u++){var N=a[C[u].data.index];f=this.slotContainers[C[u].data.index];if(k||null!==f.parent&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),N.currentGraphics&&N.attachment)k=N.clippingContainer,V=N.attachment,k.children.length=0,this.children[u]=f,V.endSlot==N.data&&(V.endSlot=null);else if(k){var D=this.tempClipContainers[u];D||((D=this.tempClipContainers[u]=this.newContainer()).visible=!1),this.children[u]=D,f.parent=null,k.addChild(f),V.endSlot==N.data&&(k.renderable=!0,k=null,V=null)}else this.children[u]=f}}},o.prototype.setSpriteRegion=function(t,e,n){e.region=n,e.texture=n.texture,n.size?(e.scale.x=n.size.width/n.originalWidth,e.scale.y=-n.size.height/n.originalHeight):(e.scale.x=t.scaleX*t.width/n.originalWidth,e.scale.y=-t.scaleY*t.height/n.originalHeight)},o.prototype.setMeshRegion=function(t,e,n){e.region=n,e.texture=n.texture,n.texture._updateUvs(),t.updateUVs(n,e.uvs),e.dirty++},o.prototype.autoUpdateTransform=function(){if(o.globalAutoUpdate){this.lastTime=this.lastTime||Date.now();var t=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(t)}else this.lastTime=0;b.Container.prototype.updateTransform.call(this)},o.prototype.createSprite=function(e,n,r){var a=n.region;e.tempAttachment===n&&(a=e.tempRegion,e.tempAttachment=null,e.tempRegion=null);var i=a.texture,o=this.newSprite(i);return o.rotation=n.rotation*t.core.MathUtils.degRad,o.anchor.x=.5,o.anchor.y=.5,o.position.x=n.x,o.position.y=n.y,o.alpha=n.color.a,o.region=n.region,this.setSpriteRegion(n,o,n.region),e.sprites=e.sprites||{},e.sprites[r]=o,o},o.prototype.createMesh=function(t,e){var n=e.region;t.tempAttachment===e&&(n=t.tempRegion,t.tempAttachment=null,t.tempRegion=null);var r=this.newMesh(n.texture,new Float32Array(e.regionUVs.length),new Float32Array(e.regionUVs.length),new Uint16Array(e.triangles),b.mesh.Mesh.DRAW_MODES.TRIANGLES);return r.canvasPadding=1.5,r.alpha=e.color.a,r.region=e.region,this.setMeshRegion(e,r,n),t.meshes=t.meshes||{},t.meshes[e.name]=r,r},o.prototype.createGraphics=function(t,e){var n=this.newGraphics(),r=new b.Polygon([]);return n.clear(),n.beginFill(16777215,1),n.drawPolygon(r),n.renderable=!1,t.currentGraphics=n,t.clippingContainer=this.newContainer(),t.clippingContainer.mask=t.currentGraphics,n},o.prototype.updateGraphics=function(t,e){var n=t.currentGraphics.graphicsData[0].shape.points,r=e.worldVerticesLength;n.length=r,e.computeWorldVertices(t,0,r,n,0,2),t.currentGraphics.dirty++,t.currentGraphics.clearDirty++},o.prototype.hackTextureBySlotIndex=function(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var a=this.skeleton.slots[e];if(!a)return!1;var i=a.attachment,o=i.region;return n&&((o=new t.core.TextureRegion).texture=n,o.size=r),a.currentSprite&&a.currentSprite.region!=o?(this.setSpriteRegion(i,a.currentSprite,o),a.currentSprite.region=o):a.currentMesh&&a.currentMesh.region!=o?this.setMeshRegion(i,a.currentMesh,o):(a.tempRegion=o,a.tempAttachment=i),!0},o.prototype.hackTextureBySlotName=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null);var r=this.skeleton.findSlotIndex(t);return-1!=r&&this.hackTextureBySlotIndex(r,e,n)},o.prototype.newContainer=function(){return new b.Container},o.prototype.newSprite=function(t){return new n(t)},o.prototype.newGraphics=function(){return new b.Graphics},o.prototype.newMesh=function(t,e,n,a,i){return new r(t,e,n,a,i)},o.prototype.transformHack=function(){return 1},o.prototype.hackAttachmentGroups=function(t,e,n){if(t){for(var r=[],a=[],i=0,o=this.skeleton.slots.length;i<o;i++){var s=this.skeleton.slots[i],l=s.currentSpriteName||s.currentMeshName||"",h=s.currentSprite||s.currentMesh;l.endsWith(t)?(h.parentGroup=e,a.push(h)):n&&h&&(h.parentGroup=n,r.push(h))}return[r,a]}},o.prototype.destroy=function(t){for(var e=0,n=this.skeleton.slots.length;e<n;e++){var r=this.skeleton.slots[e];for(var i in r.meshes)r.meshes[i].destroy(t);for(var o in r.meshes=null,r.sprites)r.sprites[o].destroy(t);r.sprites=null}for(e=0,n=this.slotContainers.length;e<n;e++)this.slotContainers[e].destroy(t);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,a.prototype.destroy.call(this,t)},o.globalAutoUpdate=!1,o.globalDelayLimit=0,o.clippingPolygon=[],o}(b.Container);function i(){var t=this.parent.worldTransform,e=this.worldTransform,n=this.localTransform;e.a=n.a*t.a+n.b*t.c,e.b=n.a*t.b+n.b*t.d,e.c=n.c*t.a+n.d*t.c,e.d=n.c*t.b+n.d*t.d,e.tx=n.tx*t.a+n.ty*t.c+t.tx,e.ty=n.tx*t.b+n.ty*t.d+t.ty,this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null}t.Spine=a}(x||(x={})),function(t){b.spine=t;var e=b.Texture.prototype;e._updateUvs||(e._updateUvs=e.updateUvs)}(x||(x={})),function(t){function e(){return function(e,a){if(!e.data||!function(t){return t.type===b.loaders.Resource.TYPE.JSON}(e)||!e.data.bones)return a();var i=e.metadata||{},o=i?e.metadata.spineSkeletonScale:null,s=i?e.metadata.spineAtlas:null;if(!1===s)return a();if(s&&s.pages){var l=new t.core.SkeletonJson(new t.core.AtlasAttachmentLoader(s));o&&(l.scale=o);var h=l.readSkeletonData(e.data);return e.spineData=h,e.spineAtlas=s,a()}var u=i.spineAtlasSuffix||".atlas",c=e.url,p=c.indexOf("?");p>0&&(c=c.substr(0,p)),c=c.substr(0,c.lastIndexOf("."))+u,e.metadata&&e.metadata.spineAtlasFile&&(c=e.metadata.spineAtlasFile),c=c.replace(this.baseUrl,"");var f={crossOrigin:e.crossOrigin,xhrType:b.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,metadata:i.spineMetadata||null,parentResource:e},d={crossOrigin:e.crossOrigin,metadata:i.imageMetadata||null,parentResource:e},m=e.url.substr(0,e.url.lastIndexOf("/")+1);m=m.replace(this.baseUrl,"");var g=i.imageNamePrefix||e.name+"_atlas_page_",v=i.images?r(i.images):i.image?r({default:i.image}):i.imageLoader?i.imageLoader(this,g,m,d):n(this,g,m,d),y=function(n){new t.core.TextureAtlas(n,v,(function(n){if(n){var r=new t.core.SkeletonJson(new t.core.AtlasAttachmentLoader(n));o&&(r.scale=o),e.spineData=r.readSkeletonData(e.data),e.spineAtlas=n}a()}))};e.metadata&&e.metadata.atlasRawData?y(e.metadata.atlasRawData):this.add(e.name+"_atlas",c,f,(function(t){t.error?a():y(t.data)}))}}function n(t,e,n,r){return n&&n.lastIndexOf("/")!==n.length-1&&(n+="/"),function(a,i){var o=e+a,s=n+a,l=t.resources[o];if(l){var h=function(){i(l.texture.baseTexture)};l.texture?h():l.onAfterMiddleware.add(h)}else t.add(o,s,r,(function(t){t.error?i(null):i(t.texture.baseTexture)}))}}function r(t){return function(e,n){var r=t[e]||t.default;r&&r.baseTexture?n(r.baseTexture):n(r)}}t.atlasParser=e,t.imageLoaderAdapter=n,t.syncImageLoaderAdapter=function(t,e){return t&&t.lastIndexOf("/")!==t.length-1&&(t+="/"),function(t,n){n(b.BaseTexture.fromImage(t,e))}},t.staticImageLoader=r,b.loaders.Loader&&(b.loaders.Loader.addPixiMiddleware(e),b.loader.use(e()))}(x||(x={}));var T=x,S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.init=function(){t.prototype.init.call(this,{pixiSpine:T})},e}(M),R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(u);return t.Spine=R,t.SpineSystem=S,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,EVA,EVA.plugin.renderer);
1
+ function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_spine=function(t,e,n,r){"use strict";var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t,e,n,r){var a,i=arguments.length,o=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o}function s(t,e,n,r){return new(n||(n=Promise))((function(a,i){function o(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=e.call(t,o)}catch(t){i=[6,t],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function h(t){return function(e,n){var r=function(t,e){return t.constructor.IDEProps||(t.constructor.IDEProps={}),t.constructor.IDEProps[e]||(t.constructor.IDEProps[e]={}),t.constructor.IDEProps[e]}(e,n);r.key=n,r.type=t}}var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.resource="",e.animationName="",e.autoPlay=!0,e.waitExecuteInfos=[],e}return i(e,t),Object.defineProperty(e.prototype,"armature",{get:function(){return this._armature},set:function(t){var e,n;if(this._armature=t,t){this.autoPlay&&this.play(this.animationName);try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.waitExecuteInfos),a=r.next();!a.done;a=r.next()){var i=a.value;if(i.playType){var o=i.name,s=i.loop,l=i.track;this.play(o,s,l)}else this.stop(i.track)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this.waitExecuteInfos=[]}},enumerable:!1,configurable:!0}),e.prototype.init=function(t){t&&_extends(this,t)},e.prototype.onDestroy=function(){this.destroied=!0},e.prototype.play=function(t,e,n){try{t&&(this.animationName=t),this.armature?(void 0===n&&(n=0),this.armature.state.setAnimation(n,this.animationName,e)):this.waitExecuteInfos.push({playType:!0,name:t,loop:null!=e?e:this.autoPlay,track:n})}catch(t){console.log(t)}},e.prototype.stop=function(t){this.armature?(void 0===t&&(t=0),this.armature.state.setEmptyAnimation(t,0)):this.waitExecuteInfos.push({playType:!1,track:t})},e.prototype.addAnimation=function(t,e,n,r){try{this.armature&&(void 0===r&&(r=0),this.armature.state.addAnimation(r,t,n,e))}catch(t){console.log(t)}},e.prototype.setMix=function(t,e,n){this.armature&&this.armature.stateData.setMix(t,e,n)},e.prototype.getAnim=function(t){void 0===t&&(t=0);try{if(this.armature)return this.armature.state.tracks[t].animation.name}catch(t){console.log(t)}},e.prototype.setDefaultMix=function(t){this.armature&&(this.armature.stateData.defaultMix=t)},e.prototype.setAttachment=function(t,e){this.armature&&this.armature.skeleton.setAttachment(t,e)},e.prototype.getBone=function(t){if(this.armature)return this.armature.skeleton.findBone(t)},e.componentName="Spine",o([h("string")],e.prototype,"resource",void 0),o([h("string")],e.prototype,"animationName",void 0),o([h("boolean")],e.prototype,"autoPlay",void 0),e}(n.Component),c={};function p(t){var n=t.image;return{tex:e.Texture.from(n),count:0}}var f={};function d(t,e,n,r){var a=null,i=function(t,e){var n=c[t];return n||(n=p(e),c[t]=n),n.tex}(e.image.src,e);new r.core.TextureAtlas(e.atlas,(function(t,e){e(i.baseTexture)}),(function(t){if(t){var i=new r.core.AtlasAttachmentLoader(t),o=new r.core.SkeletonJson(i);n&&(o.scale=n),a=o.readSkeletonData(e.ske)}}));var o={spineData:a,ref:0,imageSrc:e.image.src};return f[t]=o,o}function m(t,e){return s(this,void 0,void 0,(function(){var n;return l(this,(function(r){if(!(n=f[t.name]))if(t.complete)n=d(t.name,t.data,t.scale,e);else if(!n)return[2];return function(t,e){var n=c[t];n||(n=p(e),c[t]=n),n.count++,n.tex}(t.data.image.src,t.data),n.ref++,[2,n.spineData]}))}))}function g(t,e){var n=f[t];n&&(n.ref--,n.ref<=0&&(!function(t){t&&setTimeout((function(){var e=c[t];e&&(e.count--,e.count<=0&&(e.tex&&(e.tex.destroy(!0),e.tex=null),delete c[t]))}),100)}(e),delete f[t]))}var v,y,x,M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.armatures={},e}return i(e,t),e.prototype.init=function(t){var e=this,a=t.pixiSpine;this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this),this.pixiSpine=a,this.game.canvas.addEventListener("webglcontextrestored",(function(){var t=e.game.gameObjects,r=[];for(var a in e.armatures)for(var i=+a,o=0;o<t.length;++o){var s=t[o];if(s.id===i){var l=s.getComponent(u);l&&(e.remove({type:n.OBSERVER_TYPE.REMOVE,gameObject:s,component:l,componentName:u.componentName}),r.push({type:n.OBSERVER_TYPE.ADD,gameObject:s,component:l,componentName:u.componentName}));break}}setTimeout((function(){r.forEach((function(t){e.add(t)}))}),1e3)}),!1)},e.prototype.update=function(e){for(var n in this.armatures)this.armatures[n].update(.001*e.deltaTime),this.armatures[n].updateTransform();t.prototype.update.call(this)},e.prototype.componentChanged=function(t){return s(this,void 0,void 0,(function(){return l(this,(function(e){if("Spine"===t.componentName)if(t.type===n.OBSERVER_TYPE.ADD)this.add(t);else if(t.type===n.OBSERVER_TYPE.CHANGE)switch(t.prop.prop[0]){case"resource":this.change(t)}else t.type===n.OBSERVER_TYPE.REMOVE&&this.remove(t);return[2]}))}))},e.prototype.add=function(t,e){var r,a;return s(this,void 0,void 0,(function(){var i,o,s,h,u,c=this;return l(this,(function(l){switch(l.label){case 0:return i=t.component,clearTimeout(i.addHandler),[4,n.resource.getResource(i.resource)];case 1:return[4,m(l.sent(),this.pixiSpine)];case 2:return(o=l.sent())?(this.remove(t),(s=null===(a=null===(r=this.renderSystem)||void 0===r?void 0:r.containerManager)||void 0===a?void 0:a.getContainer(t.gameObject.id))?(i.lastResource=i.resource,h=new this.pixiSpine.Spine(o),this.armatures[t.gameObject.id]=h,t.gameObject&&t.gameObject.transform&&(u=t.gameObject.transform,h.x=u.size.width*u.origin.x,h.y=u.size.height*u.origin.y),s.addChildAt(h,0),h.update(),h.updateTransform(),i.armature=h,i.emit("loaded",{resource:i.resource}),h.state.addListener({start:function(t,e){i.emit("start",{track:t,name:t.animation.name})},complete:function(t,e){i.emit("complete",{track:t,name:t.animation.name})},interrupt:function(t,e){i.emit("interrupt",{track:t,name:t.animation.name})},end:function(t,e){i.emit("end",{track:t,name:t.animation.name})},event:function(t,e){i.emit("event",t,e)}}),[2]):[2]):(i.addHandler=setTimeout((function(){i.destroied||(void 0===e&&(e=20),--e>0?c.add(t,e):console.log("retry exceed max times",i.resource))}),1e3),[2])}}))}))},e.prototype.change=function(t){this.remove(t),this.add(t)},e.prototype.remove=function(t){var e,r,a,i;return s(this,void 0,void 0,(function(){var o,s,h,u;return l(this,(function(l){switch(l.label){case 0:return o=t.component,clearTimeout(o.addHandler),s=this.armatures[t.gameObject.id],(h=null===(r=null===(e=this.renderSystem)||void 0===e?void 0:e.containerManager)||void 0===r?void 0:r.getContainer(t.gameObject.id))&&s&&h.removeChild(s),o.armature?(o.armature.destroy({children:!0}),[4,n.resource.getResource(o.lastResource)]):[3,2];case 1:g((u=l.sent()).name,null===(i=null===(a=u.data)||void 0===a?void 0:a.image)||void 0===i?void 0:i.src),l.label=2;case 2:return o.armature=null,delete this.armatures[t.gameObject.id],t.type,n.OBSERVER_TYPE.CHANGE,[2]}}))}))},e.systemName="SpineSystem",e=o([n.decorators.componentObserver({Spine:["resource"]})],e)}(r.Renderer),E=e.loaders.shared,b={Texture:e.Texture,Rectangle:e.Rectangle,Sprite:e.Sprite,Graphics:e.Graphics,mesh:e.mesh,Matrix:e.Matrix,Container:e.Container,VERSION:"4.8.9",loaders:e.loaders,loader:E,SCALE_MODES:e.SCALE_MODES,utils:e.utils,TransformBase:e.TransformBase,TransformStatic:e.TransformStatic,DisplayObject:e.DisplayObject,Polygon:e.Polygon,BaseTexture:e.BaseTexture},w=(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){!function(t){var e,n,r,a=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.duration=n}return t.prototype.apply=function(t,e,n,r,a,i,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var l=this.timelines,h=0,u=l.length;h<u;h++)l[h].apply(t,e,n,a,i,o,s)},t.binarySearch=function(t,e,n){void 0===n&&(n=1);var r=0,a=t.length/n-2;if(0==a)return n;for(var i=a>>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var i=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),l=.006*(3*(n-a)+1),h=.006*(3*(r-i)+1),u=2*o+l,c=2*s+h,p=.3*n+o+.16666667*l,f=.3*r+s+.16666667*h,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var g=p,v=f,y=d+e.BEZIER_SIZE-1;d<y;d+=2)m[d]=g,m[d+1]=v,p+=u,f+=c,u+=l,c+=h,g+=p,v+=f},e.prototype.getCurvePercent=function(n,r){r=t.MathUtils.clamp(r,0,1);var a=this.curves,i=n*e.BEZIER_SIZE,o=a[i];if(o==e.LINEAR)return r;if(o==e.STEPPED)return 0;for(var s=0,l=++i,h=i+e.BEZIER_SIZE-1;i<h;i+=2)if((s=a[i])>=r){var u=void 0,c=void 0;return i==l?(u=0,c=0):(u=a[i-2],c=a[i-1]),c+(a[i+1]-c)*(r-u)/(s-u)}var p=a[i-1];return p+(1-p)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var o=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(r<u[0])switch(l){case e.setup:return void(c.rotation=c.data.rotation);case e.first:var p=c.data.rotation-c.rotation;c.rotation+=(p-360*(16384-(16384.499999999996-p/360|0)))*s}else if(r>=u[u.length-i.ENTRIES]){var f=u[u.length+i.PREV_ROTATION];switch(l){case e.setup:c.rotation=c.data.rotation+f*s;break;case e.first:case e.replace:f+=c.data.rotation-c.rotation,f-=360*(16384-(16384.499999999996-f/360|0));case e.add:c.rotation+=f*s}}else{var d=a.binarySearch(u,r,i.ENTRIES),m=u[d+i.PREV_ROTATION],g=u[d],v=this.getCurvePercent((d>>1)-1,1-(r-g)/(u[d+i.PREV_TIME]-g)),y=u[d+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*v,l){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*s;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*s}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=o;var s=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(r<u[0])switch(l){case e.setup:return c.x=c.data.x,void(c.y=c.data.y);case e.first:c.x+=(c.data.x-c.x)*s,c.y+=(c.data.y-c.y)*s}else{var p=0,f=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_X],f=u[u.length+i.PREV_Y];else{var d=a.binarySearch(u,r,i.ENTRIES);p=u[d+i.PREV_X],f=u[d+i.PREV_Y];var m=u[d],g=this.getCurvePercent(d/i.ENTRIES-1,1-(r-m)/(u[d+i.PREV_TIME]-m));p+=(u[d+i.X]-p)*g,f+=(u[d+i.Y]-f)*g}switch(l){case e.setup:c.x=c.data.x+p*s,c.y=c.data.y+f*s;break;case e.first:case e.replace:c.x+=(c.data.x+p-c.x)*s,c.y+=(c.data.y+f-c.y)*s;break;case e.add:c.x+=p*s,c.y+=f*s}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=s;var l=function(i){function o(t){return i.call(this,t)||this}return w(o,i),o.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},o.prototype.apply=function(r,i,s,l,h,u,c){var p=this.frames,f=r.bones[this.boneIndex];if(s<p[0])switch(u){case e.setup:return f.scaleX=f.data.scaleX,void(f.scaleY=f.data.scaleY);case e.first:f.scaleX+=(f.data.scaleX-f.scaleX)*h,f.scaleY+=(f.data.scaleY-f.scaleY)*h}else{var d=0,m=0;if(s>=p[p.length-o.ENTRIES])d=p[p.length+o.PREV_X]*f.data.scaleX,m=p[p.length+o.PREV_Y]*f.data.scaleY;else{var g=a.binarySearch(p,s,o.ENTRIES);d=p[g+o.PREV_X],m=p[g+o.PREV_Y];var v=p[g],y=this.getCurvePercent(g/o.ENTRIES-1,1-(s-v)/(p[g+o.PREV_TIME]-v));d=(d+(p[g+o.X]-d)*y)*f.data.scaleX,m=(m+(p[g+o.Y]-m)*y)*f.data.scaleY}if(1==h)u==e.add?(f.scaleX+=d-f.data.scaleX,f.scaleY+=m-f.data.scaleY):(f.scaleX=d,f.scaleY=m);else{var x=0,M=0;if(c==n.out)switch(u){case e.setup:x=f.data.scaleX,M=f.data.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-M)*h;break;case e.first:case e.replace:x=f.scaleX,M=f.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-x)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-M)*h;break;case e.add:x=f.scaleX,M=f.scaleY,f.scaleX=x+(Math.abs(d)*t.MathUtils.signum(x)-f.data.scaleX)*h,f.scaleY=M+(Math.abs(m)*t.MathUtils.signum(M)-f.data.scaleY)*h}else switch(u){case e.setup:x=Math.abs(f.data.scaleX)*t.MathUtils.signum(d),M=Math.abs(f.data.scaleY)*t.MathUtils.signum(m),f.scaleX=x+(d-x)*h,f.scaleY=M+(m-M)*h;break;case e.first:case e.replace:x=Math.abs(f.scaleX)*t.MathUtils.signum(d),M=Math.abs(f.scaleY)*t.MathUtils.signum(m),f.scaleX=x+(d-x)*h,f.scaleY=M+(m-M)*h;break;case e.add:x=t.MathUtils.signum(d),M=t.MathUtils.signum(m),f.scaleX=Math.abs(f.scaleX)*x+(d-Math.abs(f.data.scaleX)*x)*h,f.scaleY=Math.abs(f.scaleY)*M+(m-Math.abs(f.data.scaleY)*M)*h}}}},o}(s);t.ScaleTimeline=l;var h=function(t){function n(e){return t.call(this,e)||this}return w(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,o,s,l,h){var u=this.frames,c=t.bones[this.boneIndex];if(i<u[0])switch(l){case e.setup:return c.shearX=c.data.shearX,void(c.shearY=c.data.shearY);case e.first:c.shearX+=(c.data.shearX-c.shearX)*s,c.shearY+=(c.data.shearY-c.shearY)*s}else{var p=0,f=0;if(i>=u[u.length-n.ENTRIES])p=u[u.length+n.PREV_X],f=u[u.length+n.PREV_Y];else{var d=a.binarySearch(u,i,n.ENTRIES);p=u[d+n.PREV_X],f=u[d+n.PREV_Y];var m=u[d],g=this.getCurvePercent(d/n.ENTRIES-1,1-(i-m)/(u[d+n.PREV_TIME]-m));p+=(u[d+n.X]-p)*g,f+=(u[d+n.Y]-f)*g}switch(l){case e.setup:c.shearX=c.data.shearX+p*s,c.shearY=c.data.shearY+f*s;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+p-c.shearX)*s,c.shearY+=(c.data.shearY+f-c.shearY)*s;break;case e.add:c.shearX+=p*s,c.shearY+=f*s}}},n}(s);t.ShearTimeline=h;var u=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o},i.prototype.apply=function(t,n,r,o,s,l,h){var u=t.slots[this.slotIndex],c=this.frames;if(r<c[0])switch(l){case e.setup:return void u.color.setFromColor(u.data.color);case e.first:var p=u.color,f=u.data.color;p.add((f.r-p.r)*s,(f.g-p.g)*s,(f.b-p.b)*s,(f.a-p.a)*s)}else{var d=0,m=0,g=0,v=0;if(r>=c[c.length-i.ENTRIES]){var y=c.length;d=c[y+i.PREV_R],m=c[y+i.PREV_G],g=c[y+i.PREV_B],v=c[y+i.PREV_A]}else{var x=a.binarySearch(c,r,i.ENTRIES);d=c[x+i.PREV_R],m=c[x+i.PREV_G],g=c[x+i.PREV_B],v=c[x+i.PREV_A];var M=c[x],E=this.getCurvePercent(x/i.ENTRIES-1,1-(r-M)/(c[x+i.PREV_TIME]-M));d+=(c[x+i.R]-d)*E,m+=(c[x+i.G]-m)*E,g+=(c[x+i.B]-g)*E,v+=(c[x+i.A]-v)*E}if(1==s)u.color.set(d,m,g,v);else{p=u.color;l==e.setup&&p.setFromColor(u.data.color),p.add((d-p.r)*s,(m-p.g)*s,(g-p.b)*s,(v-p.a)*s)}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=u;var c=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o,s,l,h){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o,this.frames[t+i.R2]=s,this.frames[t+i.G2]=l,this.frames[t+i.B2]=h},i.prototype.apply=function(t,n,r,o,s,l,h){var u=t.slots[this.slotIndex],c=this.frames;if(r<c[0])switch(l){case e.setup:return u.color.setFromColor(u.data.color),void u.darkColor.setFromColor(u.data.darkColor);case e.first:var p=u.color,f=u.darkColor,d=u.data.color,m=u.data.darkColor;p.add((d.r-p.r)*s,(d.g-p.g)*s,(d.b-p.b)*s,(d.a-p.a)*s),f.add((m.r-f.r)*s,(m.g-f.g)*s,(m.b-f.b)*s,0)}else{var g=0,v=0,y=0,x=0,M=0,E=0,b=0;if(r>=c[c.length-i.ENTRIES]){var w=c.length;g=c[w+i.PREV_R],v=c[w+i.PREV_G],y=c[w+i.PREV_B],x=c[w+i.PREV_A],M=c[w+i.PREV_R2],E=c[w+i.PREV_G2],b=c[w+i.PREV_B2]}else{var T=a.binarySearch(c,r,i.ENTRIES);g=c[T+i.PREV_R],v=c[T+i.PREV_G],y=c[T+i.PREV_B],x=c[T+i.PREV_A],M=c[T+i.PREV_R2],E=c[T+i.PREV_G2],b=c[T+i.PREV_B2];var S=c[T],R=this.getCurvePercent(T/i.ENTRIES-1,1-(r-S)/(c[T+i.PREV_TIME]-S));g+=(c[T+i.R]-g)*R,v+=(c[T+i.G]-v)*R,y+=(c[T+i.B]-y)*R,x+=(c[T+i.A]-x)*R,M+=(c[T+i.R2]-M)*R,E+=(c[T+i.G2]-E)*R,b+=(c[T+i.B2]-b)*R}if(1==s)u.color.set(g,v,y,x),u.darkColor.set(M,E,b,1);else{p=u.color,f=u.darkColor;l==e.setup&&(p.setFromColor(u.data.color),f.setFromColor(u.data.darkColor)),p.add((g-p.r)*s,(v-p.g)*s,(y-p.b)*s,(x-p.a)*s),f.add((M-f.r)*s,(E-f.g)*s,(b-f.b)*s,0)}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=c;var p=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,o,s,l,h){var u=t.slots[this.slotIndex];if(h!=n.out||l!=e.setup){var c=this.frames;if(i<c[0]){if(l==e.setup||l==e.first){var p=u.data.attachmentName;u.setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var f=0;f=i>=c[c.length-1]?c.length-1:a.binarySearch(c,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},i}();t.AttachmentTimeline=p;var f=null,d=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==f&&(f=t.Utils.newFloatArray(64)),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,o,s,l,h){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var p=u.attachmentVertices;0==p.length&&(l=e.setup);var f=this.frameVertices,d=f[0].length,m=this.frames;if(i<m[0]){var g=c;switch(l){case e.setup:return void(p.length=0);case e.first:if(1==s){p.length=0;break}var v=t.Utils.setArraySize(p,d);if(null==g.bones)for(var y=g.vertices,x=0;x<d;x++)v[x]+=(y[x]-v[x])*s;else{s=1-s;for(x=0;x<d;x++)v[x]*=s}}}else{var M=t.Utils.setArraySize(p,d);if(i>=m[m.length-1]){var E=f[m.length-1];if(1==s)if(l==e.add)if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++)M[x]+=E[x]-y[x];else for(x=0;x<d;x++)M[x]+=E[x];else t.Utils.arrayCopy(E,0,M,0,d);else switch(l){case e.setup:var b=c;if(null==b.bones)for(y=b.vertices,x=0;x<d;x++){var w=y[x];M[x]=w+(E[x]-w)*s}else for(x=0;x<d;x++)M[x]=E[x]*s;break;case e.first:case e.replace:for(x=0;x<d;x++)M[x]+=(E[x]-M[x])*s;case e.add:if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++)M[x]+=(E[x]-y[x])*s;else for(x=0;x<d;x++)M[x]+=E[x]*s}}else{var T=a.binarySearch(m,i),S=f[T-1],R=f[T],A=m[T],P=this.getCurvePercent(T-1,1-(i-A)/(m[T-1]-A));if(1==s)if(l==e.add)if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++){var I=S[x];M[x]+=I+(R[x]-I)*P-y[x]}else for(x=0;x<d;x++){I=S[x];M[x]+=I+(R[x]-I)*P}else for(x=0;x<d;x++){I=S[x];M[x]=I+(R[x]-I)*P}else switch(l){case e.setup:var C=c;if(null==C.bones)for(y=C.vertices,x=0;x<d;x++){I=S[x],w=y[x];M[x]=w+(I+(R[x]-I)*P-w)*s}else for(x=0;x<d;x++){I=S[x];M[x]=(I+(R[x]-I)*P)*s}break;case e.first:case e.replace:for(x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P-M[x])*s}break;case e.add:if(null==(g=c).bones)for(y=g.vertices,x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P-y[x])*s}else for(x=0;x<d;x++){I=S[x];M[x]+=(I+(R[x]-I)*P)*s}}}}}},i}(i);t.DeformTimeline=d;var m=function(){function e(e){this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}return e.prototype.getPropertyId=function(){return r.event<<24},e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,n,r,i,o,s){if(null!=r){var l=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,i,o,s),e=-1;else if(e>=l[h-1])return;if(!(n<l[0])){var u=0;if(e<l[0])u=0;else for(var c=l[u=a.binarySearch(l,e)];u>0&&l[u-1]==c;)u--;for(;u<h&&n>=l[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=m;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,o,s,l,h,u){var c=r.drawOrder,p=r.slots;if(u!=n.out||h!=e.setup){var f=this.frames;if(o<f[0])h!=e.setup&&h!=e.first||t.Utils.arrayCopy(r.slots,0,r.drawOrder,0,r.slots.length);else{var d=0;d=o>=f[f.length-1]?f.length-1:a.binarySearch(f,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(p,0,c,0,p.length);else for(var g=0,v=m.length;g<v;g++)c[g]=p[m[g]]}}else t.Utils.arrayCopy(r.slots,0,r.drawOrder,0,r.slots.length)},i}();t.DrawOrderTimeline=g;var v=function(i){function o(e){var n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return w(o,i),o.prototype.getPropertyId=function(){return(r.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(t,e,n,r,a,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.MIX]=n,this.frames[t+o.BEND_DIRECTION]=r,this.frames[t+o.COMPRESS]=a?1:0,this.frames[t+o.STRETCH]=i?1:0},o.prototype.apply=function(t,r,i,s,l,h,u){var c=this.frames,p=t.ikConstraints[this.ikConstraintIndex];if(i<c[0])switch(h){case e.setup:return p.mix=p.data.mix,p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,void(p.stretch=p.data.stretch);case e.first:p.mix+=(p.data.mix-p.mix)*l,p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch}else if(i>=c[c.length-o.ENTRIES])h==e.setup?(p.mix=p.data.mix+(c[c.length+o.PREV_MIX]-p.data.mix)*l,u==n.out?(p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch):(p.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],p.compress=0!=c[c.length+o.PREV_COMPRESS],p.stretch=0!=c[c.length+o.PREV_STRETCH])):(p.mix+=(c[c.length+o.PREV_MIX]-p.mix)*l,u==n.in&&(p.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],p.compress=0!=c[c.length+o.PREV_COMPRESS],p.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var f=a.binarySearch(c,i,o.ENTRIES),d=c[f+o.PREV_MIX],m=c[f],g=this.getCurvePercent(f/o.ENTRIES-1,1-(i-m)/(c[f+o.PREV_TIME]-m));h==e.setup?(p.mix=p.data.mix+(d+(c[f+o.MIX]-d)*g-p.data.mix)*l,u==n.out?(p.bendDirection=p.data.bendDirection,p.compress=p.data.compress,p.stretch=p.data.stretch):(p.bendDirection=c[f+o.PREV_BEND_DIRECTION],p.compress=0!=c[f+o.PREV_COMPRESS],p.stretch=0!=c[f+o.PREV_STRETCH])):(p.mix+=(d+(c[f+o.MIX]-d)*g-p.mix)*l,u==n.in&&(p.bendDirection=c[f+o.PREV_BEND_DIRECTION],p.compress=0!=c[f+o.PREV_COMPRESS],p.stretch=0!=c[f+o.PREV_STRETCH]))}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_MIX=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.BEND_DIRECTION=2,o.COMPRESS=3,o.STRETCH=4,o}(i);t.IkConstraintTimeline=v;var y=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=o},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r<u[0]){var p=c.data;switch(l){case e.setup:return c.rotateMix=p.rotateMix,c.translateMix=p.translateMix,c.scaleMix=p.scaleMix,void(c.shearMix=p.shearMix);case e.first:c.rotateMix+=(p.rotateMix-c.rotateMix)*s,c.translateMix+=(p.translateMix-c.translateMix)*s,c.scaleMix+=(p.scaleMix-c.scaleMix)*s,c.shearMix+=(p.shearMix-c.shearMix)*s}}else{var f=0,d=0,m=0,g=0;if(r>=u[u.length-i.ENTRIES]){var v=u.length;f=u[v+i.PREV_ROTATE],d=u[v+i.PREV_TRANSLATE],m=u[v+i.PREV_SCALE],g=u[v+i.PREV_SHEAR]}else{var y=a.binarySearch(u,r,i.ENTRIES);f=u[y+i.PREV_ROTATE],d=u[y+i.PREV_TRANSLATE],m=u[y+i.PREV_SCALE],g=u[y+i.PREV_SHEAR];var x=u[y],M=this.getCurvePercent(y/i.ENTRIES-1,1-(r-x)/(u[y+i.PREV_TIME]-x));f+=(u[y+i.ROTATE]-f)*M,d+=(u[y+i.TRANSLATE]-d)*M,m+=(u[y+i.SCALE]-m)*M,g+=(u[y+i.SHEAR]-g)*M}if(l==e.setup){p=c.data;c.rotateMix=p.rotateMix+(f-p.rotateMix)*s,c.translateMix=p.translateMix+(d-p.translateMix)*s,c.scaleMix=p.scaleMix+(m-p.scaleMix)*s,c.shearMix=p.shearMix+(g-p.shearMix)*s}else c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(g-c.shearMix)*s}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=y;var x=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r<u[0])switch(l){case e.setup:return void(c.position=c.data.position);case e.first:c.position+=(c.data.position-c.position)*s}else{var p=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_VALUE];else{var f=a.binarySearch(u,r,i.ENTRIES);p=u[f+i.PREV_VALUE];var d=u[f],m=this.getCurvePercent(f/i.ENTRIES-1,1-(r-d)/(u[f+i.PREV_TIME]-d));p+=(u[f+i.VALUE]-p)*m}l==e.setup?c.position=c.data.position+(p-c.data.position)*s:c.position+=(p-c.position)*s}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=x;var M=function(t){function n(e){return t.call(this,e)||this}return w(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(i<u[0])switch(l){case e.setup:return void(c.spacing=c.data.spacing);case e.first:c.spacing+=(c.data.spacing-c.spacing)*s}else{var p=0;if(i>=u[u.length-n.ENTRIES])p=u[u.length+n.PREV_VALUE];else{var f=a.binarySearch(u,i,n.ENTRIES);p=u[f+n.PREV_VALUE];var d=u[f],m=this.getCurvePercent(f/n.ENTRIES-1,1-(i-d)/(u[f+n.PREV_TIME]-d));p+=(u[f+n.VALUE]-p)*m}l==e.setup?c.spacing=c.data.spacing+(p-c.data.spacing)*s:c.spacing+=(p-c.spacing)*s}},n}(x);t.PathConstraintSpacingTimeline=M;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return w(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,o,s,l,h){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r<u[0])switch(l){case e.setup:return c.rotateMix=c.data.rotateMix,void(c.translateMix=c.data.translateMix);case e.first:c.rotateMix+=(c.data.rotateMix-c.rotateMix)*s,c.translateMix+=(c.data.translateMix-c.translateMix)*s}else{var p=0,f=0;if(r>=u[u.length-i.ENTRIES])p=u[u.length+i.PREV_ROTATE],f=u[u.length+i.PREV_TRANSLATE];else{var d=a.binarySearch(u,r,i.ENTRIES);p=u[d+i.PREV_ROTATE],f=u[d+i.PREV_TRANSLATE];var m=u[d],g=this.getCurvePercent(d/i.ENTRIES-1,1-(r-m)/(u[d+i.PREV_TIME]-m));p+=(u[d+i.ROTATE]-p)*g,f+=(u[d+i.TRANSLATE]-f)*g}l==e.setup?(c.rotateMix=c.data.rotateMix+(p-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(f-c.data.translateMix)*s):(c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(f-c.translateMix)*s)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=E}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(){function e(e){this.tracks=[],this.events=[],this.listeners=[],this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n<r;n++){var a=e[n];if(null!=a){a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast;var i=t*a.timeScale;if(a.delay>0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var o=a.next;if(null!=o){var s=a.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=0==a.timeScale?0:(s/a.timeScale+t)*o.timeScale,a.trackTime+=i,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var l=a.mixingFrom;for(a.mixingFrom=null,null!=l&&(l.mixingTo=null);null!=l;)this.queue.end(l),l=l.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,a=this.tracks,i=!1,o=0,s=a.length;o<s;o++){var l=a[o];if(!(null==l||l.delay>0)){i=!0;var h=0==o?t.MixBlend.first:l.mixBlend,u=l.alpha;null!=l.mixingFrom?u*=this.applyMixingFrom(l,n,h):l.trackTime>=l.trackEnd&&null==l.next&&(u=0);var c=l.animationLast,p=l.getAnimationTime(),f=l.animation.timelines.length,d=l.animation.timelines;if(0!=o||1!=u&&h!=t.MixBlend.add){var m=l.timelineMode,g=0==l.timelinesRotation.length;g&&t.Utils.setArraySize(l.timelinesRotation,f<<1,null);var v=l.timelinesRotation;for(M=0;M<f;M++){var y=d[M],x=m[M]==e.SUBSEQUENT?h:t.MixBlend.setup;y instanceof t.RotateTimeline?this.applyRotateTimeline(y,n,p,u,x,v,M<<1,g):(t.Utils.webkit602BugfixHelper(u,h),y.apply(n,c,p,r,u,x,t.MixDirection.in))}}else for(var M=0;M<f;M++)t.Utils.webkit602BugfixHelper(u,h),d[M].apply(n,c,p,r,u,h,t.MixDirection.in);this.queueEvents(l,p),r.length=0,l.nextAnimationLast=p,l.nextTrackLast=l.trackTime}}return this.queue.drain(),i},e.prototype.applyMixingFrom=function(n,r,a){var i=n.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,r,a);var o=0;0==n.mixDuration?(o=1,a==t.MixBlend.first&&(a=t.MixBlend.setup)):((o=n.mixTime/n.mixDuration)>1&&(o=1),a!=t.MixBlend.first&&(a=i.mixBlend));var s=o<i.eventThreshold?this.events:null,l=o<i.attachmentThreshold,h=o<i.drawOrderThreshold,u=i.animationLast,c=i.getAnimationTime(),p=i.animation.timelines.length,f=i.animation.timelines,d=i.alpha*n.interruptAlpha,m=d*(1-o);if(a==t.MixBlend.add)for(var g=0;g<p;g++)f[g].apply(r,u,c,s,m,a,t.MixDirection.out);else{var v=i.timelineMode,y=i.timelineHoldMix,x=0==i.timelinesRotation.length;x&&t.Utils.setArraySize(i.timelinesRotation,p<<1,null);var M=i.timelinesRotation;i.totalAlpha=0;for(g=0;g<p;g++){var E=f[g],b=t.MixDirection.out,w=void 0,T=0;switch(v[g]){case e.SUBSEQUENT:if(!l&&E instanceof t.AttachmentTimeline)continue;if(!h&&E instanceof t.DrawOrderTimeline)continue;w=a,T=m;break;case e.FIRST:w=t.MixBlend.setup,T=m;break;case e.HOLD:w=t.MixBlend.setup,T=d;break;default:w=t.MixBlend.setup;var S=y[g];T=d*Math.max(0,1-S.mixTime/S.mixDuration)}i.totalAlpha+=T,E instanceof t.RotateTimeline?this.applyRotateTimeline(E,r,c,T,w,M,g<<1,x):(t.Utils.webkit602BugfixHelper(T,a),w==t.MixBlend.setup&&(E instanceof t.AttachmentTimeline?l&&(b=t.MixDirection.out):E instanceof t.DrawOrderTimeline&&h&&(b=t.MixDirection.out)),E.apply(r,u,c,s,T,w,b))}}return n.mixDuration>0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,a,i,o,s,l){if(l&&(o[s]=0),1!=a){var h=e,u=h.frames,c=n.bones[h.boneIndex],p=0,f=0;if(r<u[0])switch(i){case t.MixBlend.setup:c.rotation=c.data.rotation;default:return;case t.MixBlend.first:p=c.rotation,f=c.data.rotation}else if(p=i==t.MixBlend.setup?c.data.rotation:c.rotation,r>=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var d=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),m=u[d+t.RotateTimeline.PREV_ROTATION],g=u[d],v=h.getCurvePercent((d>>1)-1,1-(r-g)/(u[d+t.RotateTimeline.PREV_TIME]-g));f=u[d+t.RotateTimeline.ROTATION]-m,f=m+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var y=0,x=f-p;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))y=o[s];else{var M=0,E=0;l?(M=0,E=x):(M=o[s],E=o[s+1]);var b=x>0,w=M>=0;t.MathUtils.signum(E)!=t.MathUtils.signum(x)&&Math.abs(E)<=90&&(Math.abs(M)>180&&(M+=360*t.MathUtils.signum(M)),w=b),y=x+M-M%360,w!=b&&(y+=360*t.MathUtils.signum(M)),o[s]=y}o[s+1]=x,p+=y*a,c.rotation=p-360*(16384-(16384.499999999996-p/360|0))}else e.apply(n,0,r,null,1,i,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,o=this.events,s=0,l=o.length;s<l;s++){var h=o[s];if(h.time<i)break;h.time>r||this.queue.event(t,h)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast<r)&&this.queue.complete(t);s<l;s++){o[s].time<n||this.queue.event(t,o[s])}},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,n=this.tracks.length;e<n;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var o=a.animationEnd-a.animationStart;0!=o?(a.loop?r+=o*(1+(a.trackTime/o|0)):r+=Math.max(o,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n<r;n++){var a=this.tracks[n];null!=a&&this.setEmptyAnimation(a.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e-this.tracks.length+1,null),this.tracks.length=e+1,null)},e.prototype.trackEntry=function(t,e,n,r){var a=this.trackEntryPool.obtain();return a.trackIndex=t,a.animation=e,a.loop=n,a.holdPrevious=!1,a.eventThreshold=0,a.attachmentThreshold=0,a.drawOrderThreshold=0,a.animationStart=0,a.animationEnd=e.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.interruptAlpha=1,a.mixTime=0,a.mixDuration=null==r?0:this.data.getMix(r.animation,e),a},e.prototype.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=0,n=this.tracks.length;e<n;e++){var r=this.tracks[e];if(null!=r){for(;null!=r.mixingFrom;)r=r.mixingFrom;do{null!=r.mixingFrom&&r.mixBlend==t.MixBlend.add||this.setTimelineModes(r),r=r.mixingTo}while(null!=r)}}},e.prototype.setTimelineModes=function(n){var r=n.mixingTo,a=n.animation.timelines,i=n.animation.timelines.length,o=t.Utils.setArraySize(n.timelineMode,i);n.timelineHoldMix.length=0;var s=t.Utils.setArraySize(n.timelineHoldMix,i),l=this.propertyIDs;if(null!=r&&r.holdPrevious)for(var h=0;h<i;h++)l.add(a[h].getPropertyId()),o[h]=e.HOLD;else t:for(h=0;h<i;h++){var u=a[h].getPropertyId();if(l.add(u))if(null!=r&&this.hasTimeline(r,u)){for(var c=r.mixingTo;null!=c;c=c.mixingTo)if(!this.hasTimeline(c,u)){if(n.mixDuration>0){o[h]=e.HOLD_MIX,s[h]=c;continue t}break}o[h]=e.HOLD}else o[h]=e.FIRST;else o[h]=e.SUBSEQUENT}},e.prototype.hasTimeline=function(t,e){for(var n=t.animation.timelines,r=0,a=n.length;r<a;r++)if(n[r].getPropertyId()==e)return!0;return!1},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.prototype.setAnimationByName=function(t,n,r){e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(t,n,r)},e.prototype.addAnimationByName=function(t,n,r,a){e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(t,n,r,a)},e.prototype.hasAnimation=function(t){return null!==this.data.skeletonData.findAnimation(t)},e.prototype.hasAnimationByName=function(t){return e.deprecatedWarning3||(e.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(t)},e.emptyAnimation=new t.Animation("<empty>",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,e.deprecatedWarning1=!1,e.deprecatedWarning2=!1,e.deprecatedWarning3=!1,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=[],this.timelineHoldMix=[],this.timelinesRotation=[]}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},Object.defineProperty(e.prototype,"time",{get:function(){return e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime},set:function(t){e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endTime",{get:function(){return e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime},set:function(t){e.deprecatedWarning2||(e.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=t},enumerable:!0,configurable:!0}),e.prototype.loopsCount=function(){return Math.floor(this.trackTime/this.trackEnd)},e.deprecatedWarning1=!1,e.deprecatedWarning2=!1,e}();t.TrackEntry=n;var r,a=function(){function e(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return e.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},e.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},e.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},e.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},e.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},e.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},e.prototype.deprecateStuff=function(){return e.deprecatedWarning1||(e.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0},e.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var e=this.objects,n=this.animState.listeners,a=0;a<e.length;a+=2){var i=e[a],o=e[a+1];switch(i){case r.start:null!=o.listener&&o.listener.start&&o.listener.start(o);for(var s=0;s<n.length;s++)n[s].start&&n[s].start(o);o.onStart&&this.deprecateStuff()&&o.onStart(o.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(o.trackIndex);break;case r.interrupt:null!=o.listener&&o.listener.interrupt&&o.listener.interrupt(o);for(s=0;s<n.length;s++)n[s].interrupt&&n[s].interrupt(o);break;case r.end:null!=o.listener&&o.listener.end&&o.listener.end(o);for(s=0;s<n.length;s++)n[s].end&&n[s].end(o);o.onEnd&&this.deprecateStuff()&&o.onEnd(o.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(o.trackIndex);case r.dispose:null!=o.listener&&o.listener.dispose&&o.listener.dispose(o);for(s=0;s<n.length;s++)n[s].dispose&&n[s].dispose(o);this.animState.trackEntryPool.free(o);break;case r.complete:null!=o.listener&&o.listener.complete&&o.listener.complete(o);for(s=0;s<n.length;s++)n[s].complete&&n[s].complete(o);var l=t.MathUtils.toInt(o.loopsCount());o.onComplete&&this.deprecateStuff()&&o.onComplete(o.trackIndex,l),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(o.trackIndex,l);break;case r.event:var h=e[2+a++];null!=o.listener&&o.listener.event&&o.listener.event(o,h);for(s=0;s<n.length;s++)n[s].event&&n[s].event(o,h);o.onEvent&&this.deprecateStuff()&&o.onEvent(o.trackIndex,h),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(o.trackIndex,h)}}this.clear(),this.drainDisabled=!1}},e.prototype.clear=function(){this.objects.length=0},e.deprecatedWarning1=!1,e}();t.EventQueue=a,function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(r=t.EventType||(t.EventType={}));var i=function(){function t(){}return t.prototype.start=function(t){},t.prototype.interrupt=function(t){},t.prototype.end=function(t){},t.prototype.dispose=function(t){},t.prototype.complete=function(t){},t.prototype.event=function(t,e){},t}();t.AnimationStateAdapter2=i}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(null==r)throw new Error("Animation not found: "+t);var a=this.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);this.setMixWith(r,a,n)},t.prototype.setMixByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(e,n,r)},t.prototype.setMixWith=function(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var r=t.name+"."+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t.deprecatedWarning1=!1,t}(),e.AnimationStateData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){this.atlas=t}return t.prototype.newRegionAttachment=function(t,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");var i=new e.RegionAttachment(n);return i.region=a,i},t.prototype.newMeshAttachment=function(t,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");var i=new e.MeshAttachment(n);return i.region=a,i},t.prototype.newBoundingBoxAttachment=function(t,n){return new e.BoundingBoxAttachment(n)},t.prototype.newPathAttachment=function(t,n){return new e.PathAttachment(n)},t.prototype.newPointAttachment=function(t,n){return new e.PointAttachment(n)},t.prototype.newClippingAttachment=function(t,n){return new e.ClippingAttachment(n)},t}(),e.AtlasAttachmentLoader=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),(n=e.BlendMode||(e.BlendMode={}))[n.Normal=0]="Normal",n[n.Additive=1]="Additive",n[n.Multiply=2]="Multiply",n[n.Screen=3]="Screen"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e,n){if(this.matrix=new b.Matrix,this.children=[],this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return Object.defineProperty(t.prototype,"worldX",{get:function(){return this.matrix.tx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldY",{get:function(){return this.matrix.ty},enumerable:!0,configurable:!0}),t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(n,r,a,i,o,s,l){this.ax=n,this.ay=r,this.arotation=a,this.ascaleX=i,this.ascaleY=o,this.ashearX=s,this.ashearY=l,this.appliedValid=!0;var h=this.parent,u=this.matrix,c=this.skeleton.scaleX,p=t.yDown?-this.skeleton.scaleY:this.skeleton.scaleY;if(null==h){t.yDown&&(a=-a,this.arotation=a);var f=this.skeleton,d=a+90+l;return u.a=e.MathUtils.cosDeg(a+s)*i*c,u.c=e.MathUtils.cosDeg(d)*o*p,u.b=e.MathUtils.sinDeg(a+s)*i*c,u.d=e.MathUtils.sinDeg(d)*o*p,u.tx=n*c+f.x,void(u.ty=r*p+f.y)}var m=h.matrix.a,g=h.matrix.c,v=h.matrix.b,y=h.matrix.d;switch(u.tx=m*n+g*r+h.matrix.tx,u.ty=v*n+y*r+h.matrix.ty,this.data.transformMode){case e.TransformMode.Normal:d=a+90+l;var x=e.MathUtils.cosDeg(a+s)*i,M=e.MathUtils.cosDeg(d)*o,E=e.MathUtils.sinDeg(a+s)*i,b=e.MathUtils.sinDeg(d)*o;return u.a=m*x+g*E,u.c=m*M+g*b,u.b=v*x+y*E,void(u.d=v*M+y*b);case e.TransformMode.OnlyTranslation:d=a+90+l,u.a=e.MathUtils.cosDeg(a+s)*i,u.c=e.MathUtils.cosDeg(d)*o,u.b=e.MathUtils.sinDeg(a+s)*i,u.d=e.MathUtils.sinDeg(d)*o;break;case e.TransformMode.NoRotationOrReflection:var w=0;(R=m*m+v*v)>1e-4?(g=v*(R=Math.abs(m*y-g*v)/R),y=m*R,w=Math.atan2(v,m)*e.MathUtils.radDeg):(m=0,v=0,w=90-Math.atan2(y,g)*e.MathUtils.radDeg);var T=a+s-w,S=a+l-w+90;x=e.MathUtils.cosDeg(T)*i,M=e.MathUtils.cosDeg(S)*o,E=e.MathUtils.sinDeg(T)*i,b=e.MathUtils.sinDeg(S)*o,u.a=m*x-g*E,u.c=m*M-g*b,u.b=v*x+y*E,u.d=v*M+y*b;break;case e.TransformMode.NoScale:case e.TransformMode.NoScaleOrReflection:var R,A=e.MathUtils.cosDeg(a),P=e.MathUtils.sinDeg(a),I=(m*A+g*P)/c,C=(v*A+y*P)/p;(R=Math.sqrt(I*I+C*C))>1e-5&&(R=1/R),I*=R,C*=R,R=Math.sqrt(I*I+C*C),this.data.transformMode==e.TransformMode.NoScale&&m*y-g*v<0!=(t.yDown?this.skeleton.scaleX<0!=this.skeleton.scaleY>0:this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(R=-R);var V=Math.PI/2+Math.atan2(C,I),k=Math.cos(V)*R,N=Math.sin(V)*R;x=e.MathUtils.cosDeg(s)*i,M=e.MathUtils.cosDeg(90+l)*o,E=e.MathUtils.sinDeg(s)*i,b=e.MathUtils.sinDeg(90+l)*o,u.a=I*x+k*E,u.c=I*M+k*b,u.b=C*x+N*E,u.d=C*M+N*b}u.a*=c,u.c*=c,u.b*=p,u.d*=p},t.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},t.prototype.getWorldRotationX=function(){return Math.atan2(this.matrix.b,this.matrix.a)*e.MathUtils.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.matrix.d,this.matrix.c)*e.MathUtils.radDeg},t.prototype.getWorldScaleX=function(){var t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)},t.prototype.getWorldScaleY=function(){var t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)},t.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent,n=this.matrix;if(null==t)return this.ax=n.tx,this.ay=n.ty,this.arotation=Math.atan2(n.b,n.a)*e.MathUtils.radDeg,this.ascaleX=Math.sqrt(n.a*n.a+n.b*n.b),this.ascaleY=Math.sqrt(n.c*n.c+n.d*n.d),this.ashearX=0,void(this.ashearY=Math.atan2(n.a*n.c+n.b*n.d,n.a*n.d-n.b*n.c)*e.MathUtils.radDeg);var r=t.matrix,a=1/(r.a*r.d-r.b*r.c),i=n.tx-r.tx,o=n.ty-r.ty;this.ax=i*r.d*a-o*r.c*a,this.ay=o*r.a*a-i*r.b*a;var s=a*r.d,l=a*r.a,h=a*r.c,u=a*r.b,c=s*n.a-h*n.b,p=s*n.c-h*n.d,f=l*n.b-u*n.a,d=l*n.d-u*n.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(c*c+f*f),this.ascaleX>1e-4){var m=c*d-p*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(c*p+f*d,m)*e.MathUtils.radDeg,this.arotation=Math.atan2(f,c)*e.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+d*d),this.ashearY=0,this.arotation=90-Math.atan2(d,p)*e.MathUtils.radDeg},t.prototype.worldToLocal=function(t){var e=this.matrix,n=e.a,r=e.c,a=e.b,i=e.d,o=1/(n*i-r*a),s=t.x-e.tx,l=t.y-e.ty;return t.x=s*i*o-l*r*o,t.y=l*n*o-s*a*o,t},t.prototype.localToWorld=function(t){var e=this.matrix,n=t.x,r=t.y;return t.x=n*e.a+r*e.c+e.tx,t.y=n*e.b+r*e.d+e.ty,t},t.prototype.worldToLocalRotation=function(t){var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t),a=this.matrix;return Math.atan2(a.a*n-a.b*r,a.d*r-a.c*n)*e.MathUtils.radDeg},t.prototype.localToWorldRotation=function(t){var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t),a=this.matrix;return Math.atan2(r*a.b+n*a.d,r*a.a+n*a.c)*e.MathUtils.radDeg},t.prototype.rotateWorld=function(t){var n=this.matrix,r=n.a,a=n.c,i=n.b,o=n.d,s=e.MathUtils.cosDeg(t),l=e.MathUtils.sinDeg(t);n.a=s*r-l*i,n.c=s*a-l*o,n.b=l*r+s*i,n.d=l*a+s*o,this.appliedValid=!1},t.yDown=!1,t}(),e.Bone=n}(x||(x={})),function(t){var e,n,r;e=t.core||(t.core={}),r=function(t,e,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=n.Normal,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=r},e.BoneData=r,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(n=e.TransformMode||(e.TransformMode={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},e.Event=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){this.name=t},e.EventData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=[];for(var n=0;n<t.bones.length;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)}return t.prototype.getOrder=function(){return this.data.order},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.mix)}},t.prototype.apply1=function(t,n,r,a,i,o,s){t.appliedValid||t.updateAppliedTransform();var l=t.parent.matrix,h=1/(l.a*l.d-l.b*l.c),u=n-l.tx,c=r-l.ty,p=(u*l.d-c*l.c)*h-t.ax,f=(c*l.a-u*l.b)*h-t.ay,d=Math.atan2(f,p)*e.MathUtils.radDeg-t.ashearX-t.arotation;t.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);var m=t.ascaleX,g=t.ascaleY;if(a||i){var v=t.data.length*m,y=Math.sqrt(p*p+f*f);if(a&&y<v||i&&y>v&&v>1e-4){var x=(y/v-1)*s+1;m*=x,o&&(g*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+d*s,m,g,t.ashearX,t.ashearY)},t.prototype.apply2=function(t,n,r,a,i,o,s){if(0!=s){t.appliedValid||t.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=t.ax,h=t.ay,u=t.ascaleX,c=u,p=t.ascaleY,f=n.ascaleX,d=t.matrix,m=0,g=0,v=0;u<0?(u=-u,m=180,v=-1):(m=0,v=1),p<0&&(p=-p,v=-v),f<0?(f=-f,g=180):g=0;var y=n.ax,x=0,M=0,E=0,b=d.a,w=d.c,T=d.b,S=d.d,R=Math.abs(u-p)<=1e-4;R?(M=b*y+w*(x=n.ay)+d.tx,E=T*y+S*x+d.ty):(x=0,M=b*y+d.tx,E=T*y+d.ty);var A=t.parent.matrix;b=A.a,w=A.c,T=A.b;var P=1/(b*(S=A.d)-w*T),I=r-A.tx,C=a-A.ty,V=(I*S-C*w)*P-l,k=(C*b-I*T)*P-h,N=V*V+k*k,D=((I=M-A.tx)*S-(C=E-A.ty)*w)*P-l,O=(C*b-I*T)*P-h,_=Math.sqrt(D*D+O*O),U=n.data.length*f,Y=0,X=0;t:if(R){var F=(N-_*_-(U*=u)*U)/(2*_*U);F<-1?F=-1:F>1&&(F=1,o&&_+U>1e-4&&(c*=(Math.sqrt(N)/(_+U)-1)*s+1)),X=Math.acos(F)*i,b=_+U*F,w=U*Math.sin(X),Y=Math.atan2(k*b-V*w,V*b+k*w)}else{var B=(b=u*U)*b,L=(w=p*U)*w,W=Math.atan2(k,V),j=-2*L*_,q=L-B;if((S=j*j-4*q*(T=L*_*_+B*N-B*L))>=0){var G=Math.sqrt(S);j<0&&(G=-G);var H=(G=-(j+G)/2)/q,z=T/G,Z=Math.abs(H)<Math.abs(z)?H:z;if(Z*Z<=N){C=Math.sqrt(N-Z*Z)*i,Y=W-Math.atan2(C,Z),X=Math.atan2(C/p,(Z-_)/u);break t}}var J=e.MathUtils.PI,Q=_-b,K=Q*Q,$=0,tt=0,et=_+b,nt=et*et,rt=0;(T=-b*_/(B-L))>=-1&&T<=1&&(T=Math.acos(T),(S=(I=b*Math.cos(T)+_)*I+(C=w*Math.sin(T))*C)<K&&(J=T,K=S,Q=I,$=C),S>nt&&(tt=T,nt=S,et=I,rt=C)),N<=(K+nt)/2?(Y=W-Math.atan2($*i,Q),X=J*i):(Y=W-Math.atan2(rt*i,et),X=tt*i)}var at=Math.atan2(x,y)*v,it=t.arotation;(Y=(Y-at)*e.MathUtils.radDeg+m-it)>180?Y-=360:Y<-180&&(Y+=360),t.updateWorldTransformWith(l,h,it+Y*s,c,t.ascaleY,0,0),it=n.arotation,(X=((X+at)*e.MathUtils.radDeg-n.ashearX)*v+g-it)>180?X-=360:X<-180&&(X+=360),n.updateWorldTransformWith(y,x,it+X*s,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},t}(),e.IkConstraint=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){this.order=0,this.bones=[],this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.name=t},e.IkConstraintData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=[],this.positions=[],this.world=[],this.curves=[],this.lengths=[],this.segments=[],null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(var n=0,r=t.bones.length;n<r;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}return t.prototype.apply=function(){this.update()},t.prototype.update=function(){var n=this.target.getAttachment();if(n instanceof e.PathAttachment){var r=this.rotateMix,a=this.translateMix,i=r>0;if(a>0||i){var o=this.data,s=o.spacingMode,l=s==e.SpacingMode.Length,h=o.rotateMode,u=h==e.RotateMode.Tangent,c=h==e.RotateMode.ChainScale,p=this.bones.length,f=u?p:p+1,d=this.bones,m=e.Utils.setArraySize(this.spaces,f),g=null,v=this.spacing;if(c||l){c&&(g=e.Utils.setArraySize(this.lengths,p));for(var y=0,x=f-1;y<x;){var M=(C=d[y]).data.length;if(M<t.epsilon)c&&(g[y]=0),m[++y]=0;else{var E=M*C.matrix.a,b=M*C.matrix.b,w=Math.sqrt(E*E+b*b);c&&(g[y]=w),m[++y]=(l?M+v:v)*w/M}}}else for(y=1;y<f;y++)m[y]=v;var T=this.computeWorldPositions(n,f,u,o.positionMode==e.PositionMode.Percent,s==e.SpacingMode.Percent),S=T[0],R=T[1],A=o.offsetRotation,P=!1;0==A?P=h==e.RotateMode.Chain:(P=!1,A*=(I=this.target.bone.matrix).a*I.d-I.b*I.c>0?e.MathUtils.degRad:-e.MathUtils.degRad),y=0;for(var I=3;y<p;y++,I+=3){var C,V=(C=d[y]).matrix;V.tx+=(S-V.tx)*a,V.ty+=(R-V.ty)*a;var k=(E=T[I])-S,N=(b=T[I+1])-R;if(c){var D=g[y];if(0!=D){var O=(Math.sqrt(k*k+N*N)/D-1)*r+1;V.a*=O,V.b*=O}}if(S=E,R=b,i){var _=V.a,U=V.c,Y=V.b,X=V.d,F=0,B=0,L=0;if(F=u?T[I-1]:0==m[y+1]?T[I+2]:Math.atan2(N,k),F-=Math.atan2(Y,_),P){B=Math.cos(F),L=Math.sin(F);var W=C.data.length;S+=(W*(B*_-L*Y)-k)*r,R+=(W*(L*_+B*Y)-N)*r}else F+=A;F>e.MathUtils.PI?F-=e.MathUtils.PI2:F<-e.MathUtils.PI&&(F+=e.MathUtils.PI2),F*=r,B=Math.cos(F),L=Math.sin(F),V.a=B*_-L*Y,V.c=B*U-L*X,V.b=L*_+B*Y,V.d=L*U+B*X}C.appliedValid=!1}}}},t.prototype.computeWorldPositions=function(n,r,a,i,o){var s=this.target,l=this.position,h=this.spaces,u=e.Utils.setArraySize(this.positions,3*r+2),c=null,p=n.closed,f=n.worldVerticesLength,d=f/6,m=t.NONE;if(!n.constantSpeed){var g=n.lengths,v=g[d-=p?1:2];if(i&&(l*=v),o)for(var y=0;y<r;y++)h[y]*=v;c=e.Utils.setArraySize(this.world,8),y=0;for(var x=0,M=0;y<r;y++,x+=3){var E=l+=q=h[y];if(p)(E%=v)<0&&(E+=v),M=0;else{if(E<0){m!=t.BEFORE&&(m=t.BEFORE,n.computeWorldVertices(s,2,4,c,0,2)),this.addBeforePosition(E,c,0,u,x);continue}if(E>v){m!=t.AFTER&&(m=t.AFTER,n.computeWorldVertices(s,f-6,4,c,0,2)),this.addAfterPosition(E-v,c,0,u,x);continue}}for(;;M++){var b=g[M];if(!(E>b)){0==M?E/=b:E=(E-(Z=g[M-1]))/(b-Z);break}}M!=m&&(m=M,p&&M==d?(n.computeWorldVertices(s,f-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*M+2,8,c,0,2)),this.addCurvePosition(E,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,a||y>0&&0==q)}return u}p?(f+=2,c=e.Utils.setArraySize(this.world,f),n.computeWorldVertices(s,2,f-4,c,0,2),n.computeWorldVertices(s,0,2,c,f-4,2),c[f-2]=c[0],c[f-1]=c[1]):(d--,f-=4,c=e.Utils.setArraySize(this.world,f),n.computeWorldVertices(s,2,f,c,0,2));for(var w=e.Utils.setArraySize(this.curves,d),T=0,S=c[0],R=c[1],A=0,P=0,I=0,C=0,V=0,k=0,N=0,D=0,O=0,_=0,U=0,Y=0,X=0,F=0,B=(y=0,2);y<d;y++,B+=6)A=c[B],P=c[B+1],I=c[B+2],C=c[B+3],U=2*(N=.1875*(S-2*A+I))+(O=.09375*(3*(A-I)-S+(V=c[B+4]))),Y=2*(D=.1875*(R-2*P+C))+(_=.09375*(3*(P-C)-R+(k=c[B+5]))),X=.75*(A-S)+N+.16666667*O,F=.75*(P-R)+D+.16666667*_,T+=Math.sqrt(X*X+F*F),X+=U,F+=Y,U+=O,Y+=_,T+=Math.sqrt(X*X+F*F),X+=U,F+=Y,T+=Math.sqrt(X*X+F*F),X+=U+O,F+=Y+_,T+=Math.sqrt(X*X+F*F),w[y]=T,S=V,R=k;if(i&&(l*=T),o)for(y=0;y<r;y++)h[y]*=T;for(var L=this.segments,W=0,j=(y=0,x=0,M=0,0);y<r;y++,x+=3){var q;if(E=l+=q=h[y],p)(E%=T)<0&&(E+=T),M=0;else{if(E<0){this.addBeforePosition(E,c,0,u,x);continue}if(E>T){this.addAfterPosition(E-T,c,f-4,u,x);continue}}for(;;M++){var G=w[M];if(!(E>G)){0==M?E/=G:E=(E-(Z=w[M-1]))/(G-Z);break}}if(M!=m){m=M;var H=6*M;for(S=c[H],R=c[H+1],A=c[H+2],P=c[H+3],I=c[H+4],C=c[H+5],U=2*(N=.03*(S-2*A+I))+(O=.006*(3*(A-I)-S+(V=c[H+6]))),Y=2*(D=.03*(R-2*P+C))+(_=.006*(3*(P-C)-R+(k=c[H+7]))),X=.3*(A-S)+N+.16666667*O,F=.3*(P-R)+D+.16666667*_,W=Math.sqrt(X*X+F*F),L[0]=W,H=1;H<8;H++)X+=U,F+=Y,U+=O,Y+=_,W+=Math.sqrt(X*X+F*F),L[H]=W;X+=U,F+=Y,W+=Math.sqrt(X*X+F*F),L[8]=W,X+=U+O,F+=Y+_,W+=Math.sqrt(X*X+F*F),L[9]=W,j=0}for(E*=W;;j++){var z=L[j];if(!(E>z)){var Z;0==j?E/=z:E=j+(E-(Z=L[j-1]))/(z-Z);break}}this.addCurvePosition(.1*E,S,R,A,P,I,C,V,k,u,x,a||y>0&&0==q)}return u},t.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,l=e[n+3]-o,h=Math.atan2(l,s);r[a]=i+t*Math.cos(h),r[a+1]=o+t*Math.sin(h),r[a+2]=h},t.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],l=o-e[n+1],h=Math.atan2(l,s);r[a]=i+t*Math.cos(h),r[a+1]=o+t*Math.sin(h),r[a+2]=h},t.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,l,h,u,c){(0==t||isNaN(t))&&(t=1e-4);var p=t*t,f=p*t,d=1-t,m=d*d,g=m*d,v=d*t,y=3*v,x=d*y,M=y*t,E=e*g+r*x+i*M+s*f,b=n*g+a*x+o*M+l*f;h[u]=E,h[u+1]=b,c&&(h[u+2]=Math.atan2(b-(n*m+a*v*2+o*p),E-(e*m+r*v*2+i*p)))},t.prototype.getOrder=function(){return this.data.order},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t.epsilon=1e-5,t}(),e.PathConstraint=n}(x||(x={})),function(t){var e,n,r,a,i;e=t.core||(t.core={}),i=function(t){this.order=0,this.bones=[],this.name=t},e.PathConstraintData=i,(n=e.PositionMode||(e.PositionMode={}))[n.Fixed=0]="Fixed",n[n.Percent=1]="Percent",(r=e.SpacingMode||(e.SpacingMode={}))[r.Length=0]="Length",r[r.Fixed=1]="Fixed",r[r.Percent=2]="Percent",(a=e.RotateMode||(e.RotateMode={}))[a.Tangent=0]="Tangent",a[a.Chain=1]="Chain",a[a.ChainScale=2]="ChainScale"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this._updateCache=[],this.updateCacheReset=[],this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=[];for(var n=0;n<t.bones.length;n++){var r=t.bones[n],a=void 0;if(null==r.parent)a=new e.Bone(r,this,null);else{var i=this.bones[r.parent.index];a=new e.Bone(r,this,i),i.children.push(a)}this.bones.push(a)}for(this.slots=[],this.drawOrder=[],n=0;n<t.slots.length;n++){var o=t.slots[n],s=(a=this.bones[o.boneData.index],new e.Slot(o,a));this.slots.push(s),this.drawOrder.push(s)}for(this.ikConstraints=[],n=0;n<t.ikConstraints.length;n++){var l=t.ikConstraints[n];this.ikConstraints.push(new e.IkConstraint(l,this))}for(this.transformConstraints=[],n=0;n<t.transformConstraints.length;n++){var h=t.transformConstraints[n];this.transformConstraints.push(new e.TransformConstraint(h,this))}for(this.pathConstraints=[],n=0;n<t.pathConstraints.length;n++){var u=t.pathConstraints[n];this.pathConstraints.push(new e.PathConstraint(u,this))}this.color=new e.Color(1,1,1,1),this.updateCache()}return t.prototype.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,n=t.length;e<n;e++)t[e].sorted=!1;var r=this.ikConstraints,a=this.transformConstraints,i=this.pathConstraints,o=r.length,s=a.length,l=i.length,h=o+s+l;t:for(e=0;e<h;e++){for(var u=0;u<o;u++)if((c=r[u]).data.order==e){this.sortIkConstraint(c);continue t}for(u=0;u<s;u++)if((c=a[u]).data.order==e){this.sortTransformConstraint(c);continue t}for(u=0;u<l;u++){var c;if((c=i[u]).data.order==e){this.sortPathConstraint(c);continue t}}}for(e=0,n=t.length;e<n;e++)this.sortBone(t[e])},t.prototype.sortIkConstraint=function(t){var e=t.target;this.sortBone(e);var n=t.bones,r=n[0];if(this.sortBone(r),n.length>1){var a=n[n.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},t.prototype.sortPathConstraint=function(t){var n=t.target,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,o=this.data.skins.length;i<o;i++)this.sortPathConstraintAttachment(this.data.skins[i],r,a);var s=n.getAttachment();s instanceof e.PathAttachment&&this.sortPathConstraintAttachmentWith(s,a);var l=t.bones,h=l.length;for(i=0;i<h;i++)this.sortBone(l[i]);for(this._updateCache.push(t),i=0;i<h;i++)this.sortReset(l[i].children);for(i=0;i<h;i++)l[i].sorted=!0},t.prototype.sortTransformConstraint=function(t){this.sortBone(t.target);var e=t.bones,n=e.length;if(t.data.local)for(var r=0;r<n;r++){var a=e[r];this.sortBone(a.parent),this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}else for(r=0;r<n;r++)this.sortBone(e[r]);this._updateCache.push(t);for(var i=0;i<n;i++)this.sortReset(e[i].children);for(i=0;i<n;i++)e[i].sorted=!0},t.prototype.sortPathConstraintAttachment=function(t,e,n){var r=t.attachments[e];if(r)for(var a in r)this.sortPathConstraintAttachmentWith(r[a],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,n){if(t instanceof e.PathAttachment){var r=t.bones;if(null==r)this.sortBone(n);else for(var a=this.bones,i=0;i<r.length;)for(var o=r[i++],s=i+o;i<s;i++){var l=r[i];this.sortBone(a[l])}}},t.prototype.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},t.prototype.sortReset=function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e];r.sorted&&this.sortReset(r.children),r.sorted=!1}},t.prototype.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,n=t.length;e<n;e++){var r=t[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}var a=this._updateCache;for(e=0,n=a.length;e<n;e++)a[e].update()},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){for(var t=this.bones,e=0,n=t.length;e<n;e++)t[e].setToSetupPose();var r=this.ikConstraints;for(e=0,n=r.length;e<n;e++)(s=r[e]).bendDirection=s.data.bendDirection,s.mix=s.data.mix;var a=this.transformConstraints;for(e=0,n=a.length;e<n;e++){var i=(s=a[e]).data;s.rotateMix=i.rotateMix,s.translateMix=i.translateMix,s.scaleMix=i.scaleMix,s.shearMix=i.shearMix}var o=this.pathConstraints;for(e=0,n=o.length;e<n;e++){var s;i=(s=o[e]).data,s.position=i.position,s.spacing=i.spacing,s.rotateMix=i.rotateMix,s.translateMix=i.translateMix}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;e.Utils.arrayCopy(t,0,this.drawOrder,0,t.length);for(var n=0,r=t.length;n<r;n++)t[n].setToSetupPose()},t.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++)if(e[n].data.name==t)return n;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++)if(e[n].data.name==t)return n;return-1},t.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)},t.prototype.setSkin=function(t){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n],i=a.data.attachmentName;if(null!=i){var o=t.getAttachment(n,i);null!=o&&a.setAttachment(o)}}this.skin=t},t.prototype.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},t.prototype.getAttachment=function(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){var n=this.skin.getAttachment(t,e);if(null!=n)return n}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},t.prototype.setAttachment=function(t,e){if(null==t)throw new Error("slotName cannot be null.");for(var n=this.slots,r=0,a=n.length;r<a;r++){var i=n[r];if(i.data.name==t){var o=null;if(null!=e&&null==(o=this.getAttachment(r,e)))throw new Error("Attachment not found: "+e+", for slot: "+t);return void i.setAttachment(o)}}throw new Error("Slot not found: "+t)},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.data.name==t)return a}return null},t.prototype.getBounds=function(t,n,r){if(null==t)throw new Error("offset cannot be null.");if(null==n)throw new Error("size cannot be null.");for(var a=this.drawOrder,i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=0,u=a.length;h<u;h++){var c=a[h],p=0,f=null,d=c.getAttachment();if(d instanceof e.RegionAttachment)p=8,f=e.Utils.setArraySize(r,p,0),d.computeWorldVertices(c.bone,f,0,2);else if(d instanceof e.MeshAttachment){var m=d;p=m.worldVerticesLength,f=e.Utils.setArraySize(r,p,0),m.computeWorldVertices(c,0,p,f,0,2)}if(null!=f)for(var g=0,v=f.length;g<v;g+=2){var y=f[g],x=f[g+1];i=Math.min(i,y),o=Math.min(o,x),s=Math.max(s,y),l=Math.max(l,x)}}t.set(i,o),n.set(s-i,l-o)},t.prototype.update=function(t){this.time+=t},Object.defineProperty(t.prototype,"flipX",{get:function(){return-1==this.scaleX},set:function(e){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=e?1:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flipY",{get:function(){return-1==this.scaleY},set:function(e){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=e?1:-1},enumerable:!0,configurable:!0}),t.deprecatedWarning1=!1,t}(),e.Skeleton=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=[],this.polygons=[],this.polygonPool=new e.Pool((function(){return e.Utils.newFloatArray(16)}))}return t.prototype.update=function(t,n){if(null==t)throw new Error("skeleton cannot be null.");var r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,o=t.slots,s=o.length;r.length=0,i.freeAll(a),a.length=0;for(var l=0;l<s;l++){var h=o[l],u=h.getAttachment();if(u instanceof e.BoundingBoxAttachment){var c=u;r.push(c);var p=i.obtain();p.length!=c.worldVerticesLength&&(p=e.Utils.newFloatArray(c.worldVerticesLength)),a.push(p),c.computeWorldVertices(h,0,c.worldVerticesLength,p,0,2)}}n?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)},t.prototype.aabbCompute=function(){for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=this.polygons,i=0,o=a.length;i<o;i++)for(var s=a[i],l=s,h=0,u=s.length;h<u;h+=2){var c=l[h],p=l[h+1];t=Math.min(t,c),e=Math.min(e,p),n=Math.max(n,c),r=Math.max(r,p)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=r},t.prototype.aabbContainsPoint=function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},t.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var l=(r-e)/(n-t),h=l*(a-t)+e;if(h>i&&h<s)return!0;if((h=l*(o-t)+e)>i&&h<s)return!0;var u=(i-e)/l+t;return u>a&&u<o||(u=(s-e)/l+t)>a&&u<o},t.prototype.aabbIntersectsSkeleton=function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},t.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r<a;r++)if(this.containsPointPolygon(n[r],t,e))return this.boundingBoxes[r];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var r=t,a=t.length,i=a-2,o=!1,s=0;s<a;s+=2){var l=r[s+1],h=r[i+1];if(l<n&&h>=n||h<n&&l>=n){var u=r[s];u+(n-l)/(h-l)*(r[i]-u)<e&&(o=!o)}i=s}return o},t.prototype.intersectsSegment=function(t,e,n,r){for(var a=this.polygons,i=0,o=a.length;i<o;i++)if(this.intersectsSegmentPolygon(a[i],t,e,n,r))return this.boundingBoxes[i];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,r,a){for(var i=t,o=t.length,s=e-r,l=n-a,h=e*a-n*r,u=i[o-2],c=i[o-1],p=0;p<o;p+=2){var f=i[p],d=i[p+1],m=u*d-c*f,g=u-f,v=c-d,y=s*v-l*g,x=(h*g-s*m)/y;if((x>=u&&x<=f||x>=f&&x<=u)&&(x>=e&&x<=r||x>=r&&x<=e)){var M=(h*v-l*m)/y;if((M>=c&&M<=d||M>=d&&M<=c)&&(M>=n&&M<=a||M>=a&&M<=n))return!0}u=f,c=d}return!1},t.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t}(),e.SkeletonBounds=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.triangulator=new e.Triangulator,this.clippingPolygon=[],this.clipOutput=[],this.clippedVertices=[],this.clippedTriangles=[],this.scratch=[]}return t.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=e.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var o=this.clippingPolygon;t.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),l=0,h=s.length;l<h;l++){var u=s[l];t.makeClockwise(u),u.push(u[0]),u.push(u[1])}return s.length},t.prototype.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},t.prototype.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},t.prototype.isClipping=function(){return null!=this.clipAttachment},t.prototype.clipTriangles=function(t,n,r,a,i,o,s,l){var h=this.clipOutput,u=this.clippedVertices,c=this.clippedTriangles,p=this.clippingPolygons,f=this.clippingPolygons.length,d=l?12:8,m=0;u.length=0,c.length=0;t:for(var g=0;g<a;g+=3)for(var v=r[g]<<1,y=t[v],x=t[v+1],M=i[v],E=i[v+1],b=t[v=r[g+1]<<1],w=t[v+1],T=i[v],S=i[v+1],R=t[v=r[g+2]<<1],A=t[v+1],P=i[v],I=i[v+1],C=0;C<f;C++){var V=u.length;if(!this.clip(y,x,b,w,R,A,p[C],h)){(F=e.Utils.setArraySize(u,V+3*d))[V]=y,F[V+1]=x,F[V+2]=o.r,F[V+3]=o.g,F[V+4]=o.b,F[V+5]=o.a,l?(F[V+6]=M,F[V+7]=E,F[V+8]=s.r,F[V+9]=s.g,F[V+10]=s.b,F[V+11]=s.a,F[V+12]=b,F[V+13]=w,F[V+14]=o.r,F[V+15]=o.g,F[V+16]=o.b,F[V+17]=o.a,F[V+18]=T,F[V+19]=S,F[V+20]=s.r,F[V+21]=s.g,F[V+22]=s.b,F[V+23]=s.a,F[V+24]=R,F[V+25]=A,F[V+26]=o.r,F[V+27]=o.g,F[V+28]=o.b,F[V+29]=o.a,F[V+30]=P,F[V+31]=I,F[V+32]=s.r,F[V+33]=s.g,F[V+34]=s.b,F[V+35]=s.a):(F[V+6]=M,F[V+7]=E,F[V+8]=b,F[V+9]=w,F[V+10]=o.r,F[V+11]=o.g,F[V+12]=o.b,F[V+13]=o.a,F[V+14]=T,F[V+15]=S,F[V+16]=R,F[V+17]=A,F[V+18]=o.r,F[V+19]=o.g,F[V+20]=o.b,F[V+21]=o.a,F[V+22]=P,F[V+23]=I),V=c.length,(Z=e.Utils.setArraySize(c,V+3))[V]=m,Z[V+1]=m+1,Z[V+2]=m+2,m+=3;continue t}var k=h.length;if(0!=k){for(var N=w-A,D=R-b,O=y-R,_=A-x,U=1/(N*O+D*(x-A)),Y=k>>1,X=this.clipOutput,F=e.Utils.setArraySize(u,V+Y*d),B=0;B<k;B+=2){var L=X[B],W=X[B+1];F[V]=L,F[V+1]=W,F[V+2]=o.r,F[V+3]=o.g,F[V+4]=o.b,F[V+5]=o.a;var j=L-R,q=W-A,G=(N*j+D*q)*U,H=(_*j+O*q)*U,z=1-G-H;F[V+6]=M*G+T*H+P*z,F[V+7]=E*G+S*H+I*z,l&&(F[V+8]=s.r,F[V+9]=s.g,F[V+10]=s.b,F[V+11]=s.a),V+=d}V=c.length;var Z=e.Utils.setArraySize(c,V+3*(Y-2));for(Y--,B=1;B<Y;B++)Z[V]=m,Z[V+1]=m+B,Z[V+2]=m+B+1,V+=3;m+=Y+1}}},t.prototype.clip=function(t,e,n,r,a,i,o,s){var l=s,h=!1,u=null;o.length%4>=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(a),u.push(i),u.push(t),u.push(e),s.length=0;for(var c=o,p=o.length-4,f=0;;f+=2){for(var d=c[f],m=c[f+1],g=c[f+2],v=c[f+3],y=d-g,x=m-v,M=u,E=u.length-2,b=s.length,w=0;w<E;w+=2){var T=M[w],S=M[w+1],R=M[w+2],A=M[w+3],P=y*(A-v)-x*(R-g)>0;if(y*(S-v)-x*(T-g)>0){if(P){s.push(R),s.push(A);continue}var I=((V=R-T)*(m-S)-(C=A-S)*(d-T))/(C*(g-d)-V*(v-m));s.push(d+(g-d)*I),s.push(m+(v-m)*I)}else if(P){var C,V;I=((V=R-T)*(m-S)-(C=A-S)*(d-T))/(C*(g-d)-V*(v-m)),s.push(d+(g-d)*I),s.push(m+(v-m)*I),s.push(R),s.push(A)}h=!0}if(b==s.length)return l.length=0,!0;if(s.push(s[0]),s.push(s[1]),f==p)break;var k=s;(s=u).length=0,u=k}if(l!=s){l.length=0,f=0;for(var N=s.length-2;f<N;f++)l[f]=s[f]}else l.length=l.length-2;return h},t.makeClockwise=function(t){for(var e=t,n=t.length,r=e[n-2]*e[1]-e[0]*e[n-1],a=0,i=0,o=0,s=0,l=n-3;s<l;s+=2)a=e[s],i=e[s+1],o=e[s+2],r+=a*e[s+3]-o*i;if(!(r<0)){s=0;var h=n-2;for(l=n>>1;s<l;s+=2){var u=e[s],c=e[s+1],p=h-s;e[s]=e[p],e[s+1]=e[p+1],e[p]=u,e[p+1]=c}}},t}(),e.SkeletonClipping=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[],this.transformConstraints=[],this.pathConstraints=[],this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t.prototype.findSkin=function(t){if(null==t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findAnimation=function(t){if(null==t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var a=e[n];if(a.name==t)return a}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++)if(e[n].name==t)return n;return-1},t}(),e.SkeletonData=n}(x||(x={})),function(t){!function(t){var e=function(){function e(t){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=t}return e.prototype.readSkeletonData=function(n){var r=this.scale,a=new t.SkeletonData,i="string"==typeof n?JSON.parse(n):n,o=i.skeleton;if(null!=o&&(a.hash=o.hash,a.version=o.spine,a.width=o.width,a.height=o.height,a.fps=o.fps,a.imagesPath=o.images),i.bones)for(var s=0;s<i.bones.length;s++){var l=i.bones[s],h=null,u=this.getValue(l,"parent",null);if(null!=u&&null==(h=a.findBone(u)))throw new Error("Parent bone not found: "+u);(d=new t.BoneData(a.bones.length,l.name,h)).length=this.getValue(l,"length",0)*r,d.x=this.getValue(l,"x",0)*r,d.y=this.getValue(l,"y",0)*r,d.rotation=this.getValue(l,"rotation",0),d.scaleX=this.getValue(l,"scaleX",1),d.scaleY=this.getValue(l,"scaleY",1),d.shearX=this.getValue(l,"shearX",0),d.shearY=this.getValue(l,"shearY",0),d.transformMode=e.transformModeFromString(this.getValue(l,"transform","normal")),a.bones.push(d)}if(i.slots)for(s=0;s<i.slots.length;s++){var c=(S=i.slots[s]).name,p=S.bone,f=a.findBone(p);if(null==f)throw new Error("Slot bone not found: "+p);var d=new t.SlotData(a.slots.length,c,f),m=this.getValue(S,"color",null);null!=m&&d.color.setFromString(m);var g=this.getValue(S,"dark",null);null!=g&&(d.darkColor=new t.Color(1,1,1,1),d.darkColor.setFromString(g)),d.attachmentName=this.getValue(S,"attachment",null),d.blendMode=e.blendModeFromString(this.getValue(S,"blend","normal")),a.slots.push(d)}if(i.ik)for(s=0;s<i.ik.length;s++){var v=i.ik[s];(d=new t.IkConstraintData(v.name)).order=this.getValue(v,"order",0);for(var y=0;y<v.bones.length;y++){p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("IK bone not found: "+p);d.bones.push(M)}var x=v.target;if(d.target=a.findBone(x),null==d.target)throw new Error("IK target bone not found: "+x);d.bendDirection=this.getValue(v,"bendPositive",!0)?1:-1,d.mix=this.getValue(v,"mix",1),a.ikConstraints.push(d)}if(i.transform)for(s=0;s<i.transform.length;s++){v=i.transform[s];(d=new t.TransformConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bones.length;y++){p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("Transform constraint bone not found: "+p);d.bones.push(M)}x=v.target;if(d.target=a.findBone(x),null==d.target)throw new Error("Transform constraint target bone not found: "+x);d.local=this.getValue(v,"local",!1),d.relative=this.getValue(v,"relative",!1),d.offsetRotation=this.getValue(v,"rotation",0),d.offsetX=this.getValue(v,"x",0)*r,d.offsetY=this.getValue(v,"y",0)*r,d.offsetScaleX=this.getValue(v,"scaleX",0),d.offsetScaleY=this.getValue(v,"scaleY",0),d.offsetShearY=this.getValue(v,"shearY",0),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),d.scaleMix=this.getValue(v,"scaleMix",1),d.shearMix=this.getValue(v,"shearMix",1),a.transformConstraints.push(d)}if(i.path)for(s=0;s<i.path.length;s++){v=i.path[s];(d=new t.PathConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bones.length;y++){var M;p=v.bones[y];if(null==(M=a.findBone(p)))throw new Error("Transform constraint bone not found: "+p);d.bones.push(M)}x=v.target;if(d.target=a.findSlot(x),null==d.target)throw new Error("Path target slot not found: "+x);d.positionMode=e.positionModeFromString(this.getValue(v,"positionMode","percent")),d.spacingMode=e.spacingModeFromString(this.getValue(v,"spacingMode","length")),d.rotateMode=e.rotateModeFromString(this.getValue(v,"rotateMode","tangent")),d.offsetRotation=this.getValue(v,"rotation",0),d.position=this.getValue(v,"position",0),d.positionMode==t.PositionMode.Fixed&&(d.position*=r),d.spacing=this.getValue(v,"spacing",0),d.spacingMode!=t.SpacingMode.Length&&d.spacingMode!=t.SpacingMode.Fixed||(d.spacing*=r),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translateMix",1),a.pathConstraints.push(d)}if(i.skins)for(var E in i.skins){var b=i.skins[E],w=new t.Skin(E);for(var c in b){var T=a.findSlotIndex(c);if(-1==T)throw new Error("Slot not found: "+c);var S=b[c];for(var R in S){var A=this.readAttachment(S[R],w,T,R,a);null!=A&&w.addAttachment(T,R,A)}}a.skins.push(w),"default"==w.name&&(a.defaultSkin=w)}s=0;for(var P=this.linkedMeshes.length;s<P;s++){var I=this.linkedMeshes[s];if(null==(w=null==I.skin?a.defaultSkin:a.findSkin(I.skin)))throw new Error("Skin not found: "+I.skin);var C=w.getAttachment(I.slotIndex,I.parent);if(null==C)throw new Error("Parent mesh not found: "+I.parent);I.mesh.setParentMesh(C)}if(this.linkedMeshes.length=0,i.events)for(var V in i.events){var k=i.events[V];(d=new t.EventData(V)).intValue=this.getValue(k,"int",0),d.floatValue=this.getValue(k,"float",0),d.stringValue=this.getValue(k,"string",""),d.audioPath=this.getValue(k,"audio",null),null!=d.audioPath&&(d.volume=this.getValue(k,"volume",1),d.balance=this.getValue(k,"balance",0)),a.events.push(d)}if(i.animations)for(var N in i.animations){var D=i.animations[N];this.readAnimation(D,N,a)}return a},e.prototype.readAttachment=function(e,r,a,i,o){var s=this.scale;switch(i=this.getValue(e,"name",i),this.getValue(e,"type","region")){case"region":var l=this.getValue(e,"path",i),h=this.attachmentLoader.newRegionAttachment(r,i,l);return null==h?null:(h.path=l,h.x=this.getValue(e,"x",0)*s,h.y=this.getValue(e,"y",0)*s,h.scaleX=this.getValue(e,"scaleX",1),h.scaleY=this.getValue(e,"scaleY",1),h.rotation=this.getValue(e,"rotation",0),h.width=e.width*s,h.height=e.height*s,null!=(E=this.getValue(e,"color",null))&&h.color.setFromString(E),h);case"boundingbox":var u=this.attachmentLoader.newBoundingBoxAttachment(r,i);return null==u?null:(this.readVertices(e,u,e.vertexCount<<1),null!=(E=this.getValue(e,"color",null))&&u.color.setFromString(E),u);case"mesh":case"linkedmesh":l=this.getValue(e,"path",i);var c=this.attachmentLoader.newMeshAttachment(r,i,l);if(null==c)return null;c.path=l,null!=(E=this.getValue(e,"color",null))&&c.color.setFromString(E);var p=this.getValue(e,"parent",null);if(null!=p)return c.inheritDeform=this.getValue(e,"deform",!0),this.linkedMeshes.push(new n(c,this.getValue(e,"skin",null),a,p)),c;var f=e.uvs;return this.readVertices(e,c,f.length),c.triangles=e.triangles,c.regionUVs=f,c.hullLength=2*this.getValue(e,"hull",0),c;case"path":if(null==(l=this.attachmentLoader.newPathAttachment(r,i)))return null;l.closed=this.getValue(e,"closed",!1),l.constantSpeed=this.getValue(e,"constantSpeed",!0);var d=e.vertexCount;this.readVertices(e,l,d<<1);for(var m=t.Utils.newArray(d/3,0),g=0;g<e.lengths.length;g++)m[g]=e.lengths[g]*s;return l.lengths=m,null!=(E=this.getValue(e,"color",null))&&l.color.setFromString(E),l;case"point":var v=this.attachmentLoader.newPointAttachment(r,i);return null==v?null:(v.x=this.getValue(e,"x",0)*s,v.y=this.getValue(e,"y",0)*s,v.rotation=this.getValue(e,"rotation",0),null!=(E=this.getValue(e,"color",null))&&v.color.setFromString(E),v);case"clipping":var y=this.attachmentLoader.newClippingAttachment(r,i);if(null==y)return null;var x=this.getValue(e,"end",null);if(null!=x){var M=o.findSlot(x);if(null==M)throw new Error("Clipping end slot not found: "+x);y.endSlot=M}var E;d=e.vertexCount;return this.readVertices(e,y,d<<1),null!=(E=this.getValue(e,"color",null))&&y.color.setFromString(E),y}return null},e.prototype.readVertices=function(e,n,r){var a=this.scale;n.worldVerticesLength=r;var i=e.vertices;if(r!=i.length){var o=[],s=[];for(c=0,p=i.length;c<p;){var l=i[c++];s.push(l);for(var h=c+4*l;c<h;c+=4)s.push(i[c]),o.push(i[c+1]*a),o.push(i[c+2]*a),o.push(i[c+3])}n.bones=s,n.vertices=t.Utils.toFloatArray(o)}else{var u=t.Utils.toFloatArray(i);if(1!=a)for(var c=0,p=i.length;c<p;c++)u[c]*=a;n.vertices=u}},e.prototype.readAnimation=function(e,n,r){var a=this.scale,i=[],o=0;if(e.slots)for(var s in e.slots){var l=e.slots[s];if(-1==(Z=r.findSlotIndex(s)))throw new Error("Slot not found: "+s);for(var h in l){var u=l[h];if("attachment"==h){(M=new t.AttachmentTimeline(u.length)).slotIndex=Z;for(var c=0,p=0;p<u.length;p++){var f=u[p];M.setFrame(c++,f.time,f.name)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}else if("color"==h){(M=new t.ColorTimeline(u.length)).slotIndex=Z;for(c=0,p=0;p<u.length;p++){f=u[p];var d=new t.Color;d.setFromString(f.color||"ffffffff"),M.setFrame(c,f.time,d.r,d.g,d.b,d.a),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=h)throw new Error("Invalid timeline type for a slot: "+h+" ("+s+")");(M=new t.TwoColorTimeline(u.length)).slotIndex=Z;for(c=0,p=0;p<u.length;p++){f=u[p];var m=new t.Color,g=new t.Color;m.setFromString(f.light),g.setFromString(f.dark),M.setFrame(c,f.time,m.r,m.g,m.b,m.a,g.r,g.g,g.b),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TwoColorTimeline.ENTRIES])}}}if(e.bones)for(var v in e.bones){var y=e.bones[v],x=r.findBoneIndex(v);if(-1==x)throw new Error("Bone not found: "+v);for(var h in y){u=y[h];if("rotate"===h){(M=new t.RotateTimeline(u.length)).boneIndex=x;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,f.angle),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==h&&"scale"!==h&&"shear"!==h)throw new Error("Invalid timeline type for a bone: "+h+" ("+v+")");var M=null,E=1;"scale"===h?M=new t.ScaleTimeline(u.length):"shear"===h?M=new t.ShearTimeline(u.length):(M=new t.TranslateTimeline(u.length),E=a),M.boneIndex=x;for(c=0,p=0;p<u.length;p++){f=u[p];var b=this.getValue(f,"x",0),w=this.getValue(f,"y",0);M.setFrame(c,f.time,b*E,w*E),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TranslateTimeline.ENTRIES])}}}if(e.ik)for(var T in e.ik){var S=e.ik[T],R=r.findIkConstraint(T);(M=new t.IkConstraintTimeline(S.length)).ikConstraintIndex=r.ikConstraints.indexOf(R);for(c=0,p=0;p<S.length;p++){f=S[p];M.setFrame(c,f.time,this.getValue(f,"mix",1),this.getValue(f,"bendPositive",!0)?1:-1,this.getValue(f,"compress",!1),this.getValue(f,"stretch",!1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(var T in e.transform){S=e.transform[T],R=r.findTransformConstraint(T);(M=new t.TransformConstraintTimeline(S.length)).transformConstraintIndex=r.transformConstraints.indexOf(R);for(c=0,p=0;p<S.length;p++){f=S[p];M.setFrame(c,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"translateMix",1),this.getValue(f,"scaleMix",1),this.getValue(f,"shearMix",1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.TransformConstraintTimeline.ENTRIES])}if(e.paths)for(var T in e.paths){S=e.paths[T];var A=r.findPathConstraintIndex(T);if(-1==A)throw new Error("Path constraint not found: "+T);var P=r.pathConstraints[A];for(var h in S){u=S[h];if("position"===h||"spacing"===h){M=null,E=1;"spacing"===h?(M=new t.PathConstraintSpacingTimeline(u.length),P.spacingMode!=t.SpacingMode.Length&&P.spacingMode!=t.SpacingMode.Fixed||(E=a)):(M=new t.PathConstraintPositionTimeline(u.length),P.positionMode==t.PositionMode.Fixed&&(E=a)),M.pathConstraintIndex=A;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,this.getValue(f,h,0)*E),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===h){(M=new t.PathConstraintMixTimeline(u.length)).pathConstraintIndex=A;for(c=0,p=0;p<u.length;p++){f=u[p];M.setFrame(c,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"translateMix",1)),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[(M.getFrameCount()-1)*t.PathConstraintMixTimeline.ENTRIES])}}}if(e.deform)for(var I in e.deform){var C=e.deform[I],V=r.findSkin(I);if(null==V)throw new Error("Skin not found: "+I);for(var s in C){l=C[s];if(-1==(Z=r.findSlotIndex(s)))throw new Error("Slot not found: "+l.name);for(var h in l){u=l[h];var k=V.getAttachment(Z,h);if(null==k)throw new Error("Deform attachment not found: "+u.name);var N=null!=k.bones,D=k.vertices,O=N?D.length/3*2:D.length;(M=new t.DeformTimeline(u.length)).slotIndex=Z,M.attachment=k;c=0;for(var _=0;_<u.length;_++){f=u[_];var U=void 0,Y=this.getValue(f,"vertices",null);if(null==Y)U=N?t.Utils.newFloatArray(O):D;else{U=t.Utils.newFloatArray(O);var X=this.getValue(f,"offset",0);if(t.Utils.arrayCopy(Y,0,U,X,Y.length),1!=a)for(var F=(p=X)+Y.length;p<F;p++)U[p]*=a;if(!N)for(p=0;p<O;p++)U[p]+=D[p]}M.setFrame(c,f.time,U),this.readCurve(f,M,c),c++}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}}}var B=e.drawOrder;if(null==B&&(B=e.draworder),null!=B){M=new t.DrawOrderTimeline(B.length);var L=r.slots.length;for(c=0,_=0;_<B.length;_++){var W=B[_],j=null,q=this.getValue(W,"offsets",null);if(null!=q){j=t.Utils.newArray(L,-1);var G=t.Utils.newArray(L-q.length,0),H=0,z=0;for(p=0;p<q.length;p++){var Z,J=q[p];if(-1==(Z=r.findSlotIndex(J.slot)))throw new Error("Slot not found: "+J.slot);for(;H!=Z;)G[z++]=H++;j[H+J.offset]=H++}for(;H<L;)G[z++]=H++;for(p=L-1;p>=0;p--)-1==j[p]&&(j[p]=G[--z])}M.setFrame(c++,W.time,j)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}if(e.events){for(M=new t.EventTimeline(e.events.length),c=0,p=0;p<e.events.length;p++){var Q=e.events[p],K=r.findEvent(Q.name);if(null==K)throw new Error("Event not found: "+Q.name);var $=new t.Event(t.Utils.toSinglePrecision(Q.time),K);$.intValue=this.getValue(Q,"int",K.intValue),$.floatValue=this.getValue(Q,"float",K.floatValue),$.stringValue=this.getValue(Q,"string",K.stringValue),null!=$.data.audioPath&&($.volume=this.getValue(Q,"volume",1),$.balance=this.getValue(Q,"balance",0)),M.setFrame(c++,$)}i.push(M),o=Math.max(o,M.frames[M.getFrameCount()-1])}if(isNaN(o))throw new Error("Error while parsing animation, duration is NaN");r.animations.push(new t.Animation(n,i,o))},e.prototype.readCurve=function(t,e,n){if(t.curve)if("stepped"===t.curve)e.setStepped(n);else if("[object Array]"===Object.prototype.toString.call(t.curve)){var r=t.curve;e.setCurve(n,r[0],r[1],r[2],r[3])}},e.prototype.getValue=function(t,e,n){return void 0!==t[e]?t[e]:n},e.blendModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return t.BlendMode.Additive;if("multiply"==e)return t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new Error("Unknown blend mode: "+e)},e.positionModeFromString=function(e){if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return t.PositionMode.Percent;throw new Error("Unknown position mode: "+e)},e.spacingModeFromString=function(e){if("length"==(e=e.toLowerCase()))return t.SpacingMode.Length;if("fixed"==e)return t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new Error("Unknown position mode: "+e)},e.rotateModeFromString=function(e){if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new Error("Unknown rotate mode: "+e)},e.transformModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.TransformMode.Normal;if("onlytranslation"==e)return t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return t.TransformMode.NoRotationOrReflection;if("noscale"==e)return t.TransformMode.NoScale;if("noscaleorreflection"==e)return t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode: "+e)},e}();t.SkeletonJson=e;var n=function(t,e,n,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r}}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){if(this.attachments=[],null==t)throw new Error("name cannot be null.");this.name=t}return t.prototype.addAttachment=function(t,e,n){if(null==n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r<t.slots.length;r++){var a=t.slots[r],i=a.getAttachment();if(i&&n<e.attachments.length){var o=e.attachments[n];for(var s in o)if(i==o[s]){var l=this.getAttachment(n,s);null!=l&&a.setAttachment(l);break}}n++}},t}(),e.Skin=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,n){if(this.attachmentVertices=[],null==t)throw new Error("data cannot be null.");if(null==n)throw new Error("bone cannot be null.");this.data=t,this.bone=n,this.color=new e.Color,this.darkColor=null==t.darkColor?null:new e.Color,this.setToSetupPose(),this.blendMode=this.data.blendMode}return t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0)},t.prototype.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},t.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t}(),e.Slot=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t,n,r){if(this.color=new e.Color(1,1,1,1),t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=t,this.name=n,this.boneData=r},e.SlotData=n}(x||(x={})),function(t){!function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var a=function(){function t(){this.size=null}return Object.defineProperty(t.prototype,"width",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this.texture._uvs.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v",{get:function(){return this.texture._uvs.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u2",{get:function(){return this.texture._uvs.x2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v2",{get:function(){return this.texture._uvs.y2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){var t=this.texture;return t.trim?t.trim.x:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return console.warn("Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on."),this.spineOffsetY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pixiOffsetY",{get:function(){var t=this.texture;return t.trim?t.trim.y:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spineOffsetY",{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalWidth",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalHeight",{get:function(){var t=this.texture;return"3"==b.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.texture.frame.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.texture.frame.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return 0!==this.texture.rotate},enumerable:!0,configurable:!0}),t}();t.TextureRegion=a}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(){function e(t,e,n){this.pages=[],this.regions=[],t&&this.addSpineAtlas(t,e,n)}return e.prototype.addTexture=function(e,n){for(var i=this.pages,o=null,s=0;s<i.length;s++)if(i[s].baseTexture===n.baseTexture){o=i[s];break}if(null===o){(o=new r).name="texturePage";var l=n.baseTexture;o.width=l.realWidth,o.height=l.realHeight,o.baseTexture=l,o.minFilter=o.magFilter=t.TextureFilter.Nearest,o.uWrap=t.TextureWrap.ClampToEdge,o.vWrap=t.TextureWrap.ClampToEdge,i.push(o)}var h=new a;return h.name=e,h.page=o,h.texture=n,h.index=-1,this.regions.push(h),h},e.prototype.addTextureHash=function(t,e){for(var n in t)t.hasOwnProperty(n)&&this.addTexture(e&&-1!==n.indexOf(".")?n.substr(0,n.lastIndexOf(".")):n,t[n])},e.prototype.addSpineAtlas=function(t,e,n){return this.load(t,e,n)},e.prototype.load=function(e,i,o){var s=this;if(null==i)throw new Error("textureLoader cannot be null.");var l=new n(e),h=new Array(4),u=null;!function e(){for(;;){var n=l.readLine();if(null==n)return o&&o(s);if(0==(n=n.trim()).length)u=null;else{if(!u){(u=new r).name=n,2==l.readTuple(h)&&(u.width=parseInt(h[0]),u.height=parseInt(h[1]),l.readTuple(h)),l.readTuple(h),u.minFilter=t.Texture.filterFromString(h[0]),u.magFilter=t.Texture.filterFromString(h[1]);var c=l.readValue();u.uWrap=t.TextureWrap.ClampToEdge,u.vWrap=t.TextureWrap.ClampToEdge,"x"==c?u.uWrap=t.TextureWrap.Repeat:"y"==c?u.vWrap=t.TextureWrap.Repeat:"xy"==c&&(u.uWrap=u.vWrap=t.TextureWrap.Repeat),i(n,(function(t){if(null===t)return s.pages.splice(s.pages.indexOf(u),1),o&&o(null);u.baseTexture=t,t.hasLoaded||(t.width=u.width,t.height=u.height),s.pages.push(u),u.setFilters(),u.width&&u.height||(u.width=t.realWidth,u.height=t.realHeight,u.width&&u.height||console.log("ERROR spine atlas page "+u.name+": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)")),e()})),s.pages.push(u);break}var p=new a;p.name=n,p.page=u;var f="true"==l.readValue()?6:0;l.readTuple(h);var d=parseInt(h[0]),m=parseInt(h[1]);l.readTuple(h);var g=parseInt(h[0]),v=parseInt(h[1]),y=u.baseTexture.resolution;d/=y,m/=y,g/=y,v/=y;var x=new b.Rectangle(d,m,f?v:g,f?g:v);4==l.readTuple(h)&&4==l.readTuple(h)&&l.readTuple(h);var M=parseInt(h[0])/y,E=parseInt(h[1])/y;l.readTuple(h);var w=parseInt(h[0])/y,T=parseInt(h[1])/y,S=new b.Rectangle(0,0,M,E),R=new b.Rectangle(w,E-v-T,g,v);if("3"!=b.VERSION[0])p.texture=new b.Texture(p.page.baseTexture,x,S,R,f);else{var A=new b.Rectangle(d,m,g,v),P=A.clone();R.width=M,R.height=E,p.texture=new b.Texture(p.page.baseTexture,A,P,R,f)}p.index=parseInt(l.readValue()),p.texture._updateUvs(),s.regions.push(p)}}}()},e.prototype.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.prototype.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].baseTexture.dispose()},e}();t.TextureAtlas=e;var n=function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return t.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){function e(){}return e.prototype.setFilters=function(){var e=this.baseTexture,n=this.minFilter;n==t.TextureFilter.Linear?e.scaleMode=b.SCALE_MODES.LINEAR:this.minFilter==t.TextureFilter.Nearest?e.scaleMode=b.SCALE_MODES.NEAREST:(e.mipmap=!0,n==t.TextureFilter.MipMapNearestNearest?e.scaleMode=b.SCALE_MODES.NEAREST:e.scaleMode=b.SCALE_MODES.LINEAR)},e}();t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new e.Vector2,null==t)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(n.findBone(t.bones[r].name));this.target=n.findBone(t.target.name)}return t.prototype.apply=function(){this.update()},t.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},t.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.matrix,s=o.a,l=o.c,h=o.b,u=o.d,c=s*u-l*h>0?e.MathUtils.degRad:-e.MathUtils.degRad,p=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,m=0,g=d.length;m<g;m++){var v=d[m],y=!1,x=v.matrix;if(0!=t){var M=x.a,E=x.c,b=x.b,w=x.d;(I=Math.atan2(h,s)-Math.atan2(b,M)+p)>e.MathUtils.PI?I-=e.MathUtils.PI2:I<-e.MathUtils.PI&&(I+=e.MathUtils.PI2),I*=t;var T=Math.cos(I),S=Math.sin(I);x.a=T*M-S*b,x.c=T*E-S*w,x.b=S*M+T*b,x.d=S*E+T*w,y=!0}if(0!=n){var R=this.temp;i.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),x.tx+=(R.x-x.tx)*n,x.ty+=(R.y-x.ty)*n,y=!0}if(r>0){var A=Math.sqrt(x.a*x.a+x.b*x.b),P=Math.sqrt(s*s+h*h);A>1e-5&&(A=(A+(P-A+this.data.offsetScaleX)*r)/A),x.a*=A,x.b*=A,A=Math.sqrt(x.c*x.c+x.d*x.d),P=Math.sqrt(l*l+u*u),A>1e-5&&(A=(A+(P-A+this.data.offsetScaleY)*r)/A),x.c*=A,x.d*=A,y=!0}if(a>0){E=x.c,w=x.d;var I,C=Math.atan2(w,E);(I=Math.atan2(u,l)-Math.atan2(h,s)-(C-Math.atan2(x.b,x.a)))>e.MathUtils.PI?I-=e.MathUtils.PI2:I<-e.MathUtils.PI&&(I+=e.MathUtils.PI2),I=C+(I+f)*a,A=Math.sqrt(E*E+w*w),x.c=Math.cos(I)*A,x.d=Math.sin(I)*A,y=!0}y&&(v.appliedValid=!1)}},t.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.matrix,s=o.a,l=o.c,h=o.b,u=o.d,c=s*u-l*h>0?e.MathUtils.degRad:-e.MathUtils.degRad,p=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,m=0,g=d.length;m<g;m++){var v,y=d[m],x=!1,M=y.matrix;if(0!=t){var E=M.a,b=M.c,w=M.b,T=M.d;(v=Math.atan2(h,s)+p)>e.MathUtils.PI?v-=e.MathUtils.PI2:v<-e.MathUtils.PI&&(v+=e.MathUtils.PI2),v*=t;var S=Math.cos(v),R=Math.sin(v);M.a=S*E-R*w,M.c=S*b-R*T,M.b=R*E+S*w,M.d=R*b+S*T,x=!0}if(0!=n){var A=this.temp;i.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),M.tx+=A.x*n,M.ty+=A.y*n,x=!0}if(r>0){var P=(Math.sqrt(s*s+h*h)-1+this.data.offsetScaleX)*r+1;M.a*=P,M.b*=P,P=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1,M.c*=P,M.d*=P,x=!0}if(a>0)(v=Math.atan2(u,l)-Math.atan2(h,s))>e.MathUtils.PI?v-=e.MathUtils.PI2:v<-e.MathUtils.PI&&(v+=e.MathUtils.PI2),b=M.c,T=M.d,v=Math.atan2(T,b)+(v-e.MathUtils.PI/2+f)*a,P=Math.sqrt(b*b+T*T),M.c=Math.cos(v)*P,M.d=Math.sin(v)*P,x=!0;x&&(y.appliedValid=!1)}},t.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o<s;o++){var l=i[o];l.appliedValid||l.updateAppliedTransform();var h=l.arotation;if(0!=t){var u=a.arotation-h+this.data.offsetRotation;h+=(u-=360*(16384-(16384.499999999996-u/360|0)))*t}var c=l.ax,p=l.ay;0!=e&&(c+=(a.ax-c+this.data.offsetX)*e,p+=(a.ay-p+this.data.offsetY)*e);var f=l.ascaleX,d=l.ascaleY;n>0&&(f>1e-5&&(f=(f+(a.ascaleX-f+this.data.offsetScaleX)*n)/f),d>1e-5&&(d=(d+(a.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=l.ashearY;r>0&&(u=a.ashearY-m+this.data.offsetShearY,u-=360*(16384-(16384.499999999996-u/360|0)),l.shearY+=u*r),l.updateWorldTransformWith(c,p,h,f,d,l.ashearX,m)}},t.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o<s;o++){var l=i[o];l.appliedValid||l.updateAppliedTransform();var h=l.arotation;0!=t&&(h+=(a.arotation+this.data.offsetRotation)*t);var u=l.ax,c=l.ay;0!=e&&(u+=(a.ax+this.data.offsetX)*e,c+=(a.ay+this.data.offsetY)*e);var p=l.ascaleX,f=l.ascaleY;n>0&&(p>1e-5&&(p*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),f>1e-5&&(f*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var d=l.ashearY;r>0&&(d+=(a.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(u,c,h,p,f,l.ashearX,d)}},t.prototype.getOrder=function(){return this.data.order},t}(),e.TransformConstraint=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){if(this.order=0,this.bones=[],this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t},e.TransformConstraintData=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(){this.convexPolygons=[],this.convexPolygonsIndices=[],this.indicesArray=[],this.isConcaveArray=[],this.triangles=[],this.polygonPool=new e.Pool((function(){return[]})),this.polygonIndicesPool=new e.Pool((function(){return[]}))}return t.prototype.triangulate=function(e){var n=e,r=e.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i<r;i++)a[i]=i;var o=this.isConcaveArray;o.length=0,i=0;for(var s=r;i<s;++i)o[i]=t.isConcave(i,r,n,a);var l=this.triangles;for(l.length=0;r>3;){for(var h=r-1,u=(i=0,1);;){t:if(!o[i]){for(var c=a[h]<<1,p=a[i]<<1,f=a[u]<<1,d=n[c],m=n[c+1],g=n[p],v=n[p+1],y=n[f],x=n[f+1],M=(u+1)%r;M!=h;M=(M+1)%r)if(o[M]){var E=a[M]<<1,b=n[E],w=n[E+1];if(t.positiveArea(y,x,d,m,b,w)&&t.positiveArea(d,m,g,v,b,w)&&t.positiveArea(g,v,y,x,b,w))break t}break}if(0==u){do{if(!o[i])break;i--}while(i>0);break}h=i,i=u,u=(u+1)%r}l.push(a[(r+i-1)%r]),l.push(a[i]),l.push(a[(i+1)%r]),a.splice(i,1),o.splice(i,1);var T=(--r+i-1)%r,S=i==r?0:i;o[T]=t.isConcave(T,r,n,a),o[S]=t.isConcave(S,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l},t.prototype.decompose=function(e,n){var r=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var l=-1,h=0,u=0,c=n.length;u<c;u+=3){var p=n[u]<<1,f=n[u+1]<<1,d=n[u+2]<<1,m=r[p],g=r[p+1],v=r[f],y=r[f+1],x=r[d],M=r[d+1],E=!1;if(l==p){var b=s.length-4,w=t.winding(s[b],s[b+1],s[b+2],s[b+3],x,M),T=t.winding(x,M,s[0],s[1],s[2],s[3]);w==h&&T==h&&(s.push(x),s.push(M),o.push(d),E=!0)}E||(s.length>0?(a.push(s),i.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(g),s.push(v),s.push(y),s.push(x),s.push(M),(o=this.polygonIndicesPool.obtain()).length=0,o.push(p),o.push(f),o.push(d),h=t.winding(m,g,v,y,x,M),l=p)}for(s.length>0&&(a.push(s),i.push(o)),u=0,c=a.length;u<c;u++)if(0!=(o=i[u]).length)for(var S=o[0],R=o[o.length-1],A=(s=a[u])[b=s.length-4],P=s[b+1],I=s[b+2],C=s[b+3],V=s[0],k=s[1],N=s[2],D=s[3],O=t.winding(A,P,I,C,V,k),_=0;_<c;_++)if(_!=u){var U=i[_];if(3==U.length){var Y=U[0],X=U[1],F=U[2],B=a[_];x=B[B.length-2],M=B[B.length-1],Y==S&&X==R&&(w=t.winding(A,P,I,C,x,M),T=t.winding(x,M,V,k,N,D),w==O&&T==O&&(B.length=0,U.length=0,s.push(x),s.push(M),o.push(F),A=I,P=C,I=x,C=M,_=0))}}for(u=a.length-1;u>=0;u--)0==(s=a[u]).length&&(a.splice(u,1),this.polygonPool.free(s),o=i[u],i.splice(u,1),this.polygonIndicesPool.free(o));return a},t.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[o],n[o+1])},t.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},t.winding=function(t,e,n,r,a,i){var o=n-t,s=r-e;return a*s-i*o+o*e-t*s>=0?1:-1},t}(),e.Triangulator=n}(x||(x={})),function(t){!function(t){var e=function(){function t(){this.array=[]}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return w(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(a);t.Pow=i;var o=function(t){function e(e){return t.call(this,e)||this}return w(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=o;var s=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i<e+a;i++,o++)n[o]=t[i]},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var r=t.length;if(r==e)return t;if(t.length=e,r<e)for(var a=r;a<e;a++)t[a]=n;return t},t.ensureArrayCapacity=function(e,n,r){return void 0===r&&(r=0),e.length>=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r<t;r++)n[r]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}();t.Utils=s;var l=function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var n=t.bones[e],r=n.matrix;console.log(n.data.name+", "+r.a+", "+r.b+", "+r.c+", "+r.d+", "+r.tx+", "+r.ty)}},t}();t.DebugUtils=l;var h=function(){function t(t){this.items=[],this.instantiator=t}return t.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;e<t.length;e++)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function(){this.items.length=0},t}();t.Pool=h;var u=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}();t.Vector2=u;var c=function(){function t(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return t.prototype.update=function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=c;var p=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0},t}();t.WindowedMean=p}(t.core||(t.core={}))}(x||(x={})),function(t){!function(t){var e=function(t){if(null==t)throw new Error("name cannot be null.");this.name=t};t.Attachment=e;var n=function(t){function e(n){var r=t.call(this,n)||this;return r.id=(65535&e.nextID++)<<11,r.worldVerticesLength=0,r}return w(e,t),e.prototype.computeWorldVerticesOld=function(t,e){this.computeWorldVertices(t,0,this.worldVerticesLength,e,0,2)},e.prototype.computeWorldVertices=function(t,e,n,r,a,i){n=a+(n>>1)*i;var o=t.bone.skeleton,s=t.attachmentVertices,l=this.vertices,h=this.bones;if(null!=h){for(var u=0,c=0,p=0;p<e;p+=2){u+=(g=h[u])+1,c+=g}var f=o.bones;if(0==s.length)for(P=a,T=3*c;P<n;P+=i){var d=0,m=0,g=h[u++];for(g+=u;u<g;u++,T+=3){M=f[h[u]].matrix,I=l[T],C=l[T+1];var v=l[T+2];d+=(I*M.a+C*M.c+M.tx)*v,m+=(I*M.b+C*M.d+M.ty)*v}r[P]=d,r[P+1]=m}else for(var y=s,x=(P=a,T=3*c,c<<1);P<n;P+=i){d=0,m=0,g=h[u++];for(g+=u;u<g;u++,T+=3,x+=2){M=f[h[u]].matrix,I=l[T]+y[x],C=l[T+1]+y[x+1],v=l[T+2];d+=(I*M.a+C*M.c+M.tx)*v,m+=(I*M.b+C*M.d+M.ty)*v}r[P]=d,r[P+1]=m}}else{s.length>0&&(l=s);for(var M,E=(M=t.bone.matrix).tx,b=M.ty,w=M.a,T=M.c,S=M.b,R=M.d,A=e,P=a;P<n;A+=2,P+=i){var I=l[A],C=l[A+1];r[P]=I*w+C*T+E,r[P+1]=I*S+C*R+b}}},e.prototype.applyDeform=function(t){return this==t},e.nextID=0,e}(e);t.VertexAttachment=n}(t.core||(t.core={}))}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),(n=e.AttachmentType||(e.AttachmentType={}))[n.Region=0]="Region",n[n.BoundingBox=1]="BoundingBox",n[n.Mesh=2]="Mesh",n[n.LinkedMesh=3]="LinkedMesh",n[n.Path=4]="Path",n[n.Point=5]="Point"}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r}return w(n,t),n}(e.VertexAttachment),e.BoundingBoxAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.2275,.2275,.8078,1),r}return w(n,t),n}(e.VertexAttachment),e.ClippingAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r.inheritDeform=!1,r.tempColor=new e.Color(0,0,0,0),r}return w(n,t),n.prototype.updateUVs=function(t,n){var r=this.regionUVs.length;if(n&&n.length==r||(n=e.Utils.newFloatArray(r)),null!=t){for(var a=t.texture._uvs,i=t.width,o=t.height,s=t.originalWidth,l=t.originalHeight,h=t.offsetX,u=t.pixiOffsetY,c=0;c<r;c+=2){var p=this.regionUVs[c],f=this.regionUVs[c+1];p=(p*s-h)/i,f=(f*l-u)/o,n[c]=(a.x0*(1-p)+a.x1*p)*(1-f)+(a.x3*(1-p)+a.x2*p)*f,n[c+1]=(a.y0*(1-p)+a.y1*p)*(1-f)+(a.y3*(1-p)+a.y2*p)*f}return n}},n.prototype.applyDeform=function(t){return this==t||this.inheritDeform&&this.parentMesh==t},n.prototype.getParentMesh=function(){return this.parentMesh},n.prototype.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},n}(e.VertexAttachment),e.MeshAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.closed=!1,r.constantSpeed=!1,r.color=new e.Color(1,1,1,1),r}return w(n,t),n}(e.VertexAttachment),e.PathAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.38,.94,0,1),r}return w(n,t),n.prototype.computeWorldPosition=function(t,e){var n=t.matrix;return e.x=this.x*n.a+this.y*n.c+t.worldX,e.y=this.x*n.b+this.y*n.d+t.worldY,e},n.prototype.computeWorldRotation=function(t){var n=t.matrix,r=e.MathUtils.cosDeg(this.rotation),a=e.MathUtils.sinDeg(this.rotation),i=r*n.a+a*n.c,o=r*n.b+a*n.d;return Math.atan2(o,i)*e.MathUtils.radDeg},n}(e.VertexAttachment),e.PointAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(t){function n(n){var r=t.call(this,n)||this;return r.x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new e.Color(1,1,1,1),r.offset=e.Utils.newFloatArray(8),r.uvs=e.Utils.newFloatArray(8),r.tempColor=new e.Color(1,1,1,1),r}return w(n,t),n.prototype.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*t,a=-this.height/2*this.scaleY+this.region.offsetY*e,i=r+this.region.width*t,o=a+this.region.height*e,s=this.rotation*Math.PI/180,l=Math.cos(s),h=Math.sin(s),u=r*l+this.x,c=r*h,p=a*l+this.y,f=a*h,d=i*l+this.x,m=i*h,g=o*l+this.y,v=o*h,y=this.offset;y[n.OX1]=u-f,y[n.OY1]=p+c,y[n.OX2]=u-v,y[n.OY2]=g+c,y[n.OX3]=d-v,y[n.OY3]=g+m,y[n.OX4]=d-f,y[n.OY4]=p+m},n.prototype.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},n.prototype.computeWorldVertices=function(t,e,r,a){var i=this.offset,o=t.matrix,s=o.tx,l=o.ty,h=o.a,u=o.c,c=o.b,p=o.d,f=0,d=0;f=i[n.OX1],d=i[n.OY1],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX2],d=i[n.OY2],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX3],d=i[n.OY3],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l,r+=a,f=i[n.OX4],d=i[n.OY4],e[r]=f*h+d*u+s,e[r+1]=f*c+d*p+l},n.OX1=0,n.OY1=1,n.OX2=2,n.OY2=3,n.OX3=4,n.OY3=5,n.OX4=6,n.OY4=7,n.X1=0,n.Y1=1,n.C1R=2,n.C1G=3,n.C1B=4,n.C1A=5,n.U1=6,n.V1=7,n.X2=8,n.Y2=9,n.C2R=10,n.C2G=11,n.C2B=12,n.C2A=13,n.U2=14,n.V2=15,n.X3=16,n.Y3=17,n.C3R=18,n.C3G=19,n.C3B=20,n.C3A=21,n.U3=22,n.V3=23,n.X4=24,n.Y4=25,n.C4R=26,n.C4G=27,n.C4B=28,n.C4A=29,n.U4=30,n.V4=31,n}(e.Attachment),e.RegionAttachment=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}return t.prototype.begin=function(t){},t.prototype.transform=function(t,n,r,a){t.x+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY),t.y+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY)},t.prototype.end=function(){},t}(),e.JitterEffect=n}(x||(x={})),function(t){var e,n;e=t.core||(t.core={}),n=function(){function t(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}return t.prototype.begin=function(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},t.prototype.transform=function(n,r,a,i){var o=this.angle*e.MathUtils.degreesToRadians,s=n.x-this.worldX,l=n.y-this.worldY,h=Math.sqrt(s*s+l*l);if(h<this.radius){var u=t.interpolation.apply(0,o,(this.radius-h)/this.radius),c=Math.cos(u),p=Math.sin(u);n.x=c*s-p*l+this.worldX,n.y=p*s+c*l+this.worldY}},t.prototype.end=function(){},t.interpolation=new e.PowOut(2),t}(),e.SwirlEffect=n}(x||(x={})),Math.fround||(Math.fround=Math.fround=(y=new Float32Array(1),function(t){return y[0]=t,y[0]})),function(t){t.core.Bone.yDown=!0;var e=[0,0,0],n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.region=null,e}return w(e,t),e}(b.Sprite);t.SpineSprite=n;var r=function(t){function e(e,n,r,a,i){return t.call(this,e,n,r,a,i)||this}return w(e,t),e}(b.mesh.Mesh);t.SpineMesh=r;var a=function(a){function o(e){var n=a.call(this)||this;if(!e)throw new Error("The spineData param is required.");if("string"==typeof e)throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');n.spineData=e,n.skeleton=new t.core.Skeleton(e),n.skeleton.updateWorldTransform(),n.stateData=new t.core.AnimationStateData(e),n.state=new t.core.AnimationState(n.stateData),n.slotContainers=[],n.tempClipContainers=[];for(var r=0,i=n.skeleton.slots.length;r<i;r++){var o=n.skeleton.slots[r],s=o.attachment,l=n.newContainer();if(n.slotContainers.push(l),n.addChild(l),n.tempClipContainers.push(null),s instanceof t.core.RegionAttachment){var h=s.region.name,u=n.createSprite(o,s,h);o.currentSprite=u,o.currentSpriteName=h,l.addChild(u)}else if(s instanceof t.core.MeshAttachment){var c=n.createMesh(o,s);o.currentMesh=c,o.currentMeshName=s.name,l.addChild(c)}else{if(!(s instanceof t.core.ClippingAttachment))continue;n.createGraphics(o,s),l.addChild(o.clippingContainer),l.addChild(o.currentGraphics)}}return n.autoUpdate=!1,n.tintRgb=new Float32Array([1,1,1]),n}return w(o,a),Object.defineProperty(o.prototype,"autoUpdate",{get:function(){return this.updateTransform===o.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?o.prototype.autoUpdateTransform:b.Container.prototype.updateTransform},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"tint",{get:function(){return b.utils.rgb2hex(this.tintRgb)},set:function(t){this.tintRgb=b.utils.hex2rgb(t,this.tintRgb)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"delayLimit",{get:function(){return(void 0!==this.localDelayLimit?this.localDelayLimit:o.globalDelayLimit)||Number.MAX_VALUE},enumerable:!0,configurable:!0}),o.prototype.update=function(n){var r=this.delayLimit;if(n>r&&(n=r),this.state.update(n),this.state.apply(this.skeleton),this.skeleton){this.skeleton.updateWorldTransform();var a=this.skeleton.slots,o=this.color,s=null,l=null;o?(s=o.light,l=o.dark):s=this.tintRgb;for(var h=b.TransformBase&&1==this.transformHack(),u=0,c=a.length;u<c;u++){var p=(N=a[u]).attachment,f=this.slotContainers[u];if(p){var d=null,m=p.color;if(p instanceof t.core.RegionAttachment){var g=p.region;if(g){N.currentMesh&&(N.currentMesh.visible=!1,N.currentMesh=null,N.currentMeshName=void 0);var v=g;if(!N.currentSpriteName||N.currentSpriteName!==v.name){var y=v.name;if(N.currentSprite&&(N.currentSprite.visible=!1),N.sprites=N.sprites||{},void 0!==N.sprites[y])N.sprites[y].visible=!0;else{var x=this.createSprite(N,p,y);f.addChild(x)}N.currentSprite=N.sprites[y],N.currentSpriteName=y}}if(f.transform){var M=w=f.transform,E=null;M.matrix2d?(E=M.matrix2d,M._dirtyVersion++,M.version=M._dirtyVersion,M.isStatic=!0,M.operMode=0):h?(M.position&&((w=new b.TransformBase)._parentID=-1,w._worldID=f.transform._worldID,f.transform=w),E=w.localTransform):M.setFromMatrix(N.bone.matrix),E&&N.bone.matrix.copy(E)}else{E=f.localTransform||new b.Matrix;N.bone.matrix.copy(E),f.localTransform=E,f.displayObjectUpdateTransform=i}N.currentSprite.color?d=N.currentSprite.color:(e[0]=s[0]*N.color.r*m.r,e[1]=s[1]*N.color.g*m.g,e[2]=s[2]*N.color.b*m.b,N.currentSprite.tint=b.utils.rgb2hex(e)),N.currentSprite.blendMode=N.blendMode}else if(p instanceof t.core.MeshAttachment){var w;if(N.currentSprite)if(N.currentSprite.visible=!1,N.currentSprite=null,N.currentSpriteName=void 0,f.transform)(w=new b.TransformStatic)._parentID=-1,w._worldID=f.transform._worldID,f.transform=w;else f.localTransform=new b.Matrix,f.displayObjectUpdateTransform=b.DisplayObject.prototype.updateTransform;if(!N.currentMeshName||N.currentMeshName!==p.name){var T=p.name;if(N.currentMesh&&(N.currentMesh.visible=!1),N.meshes=N.meshes||{},void 0!==N.meshes[T])N.meshes[T].visible=!0;else{var S=this.createMesh(N,p);f.addChild(S)}N.currentMesh=N.meshes[T],N.currentMeshName=T}if(p.computeWorldVerticesOld(N,N.currentMesh.vertices),N.currentMesh.color)d=N.currentMesh.color;else if("3"!==b.VERSION[0]){var R=N.currentMesh.tintRgb;R[0]=s[0]*N.color.r*m.r,R[1]=s[1]*N.color.g*m.g,R[2]=s[2]*N.color.b*m.b}N.currentMesh.blendMode=N.blendMode}else{if(!(p instanceof t.core.ClippingAttachment)){f.visible=!1;continue}N.currentGraphics||(this.createGraphics(N,p),f.addChild(N.clippingContainer),f.addChild(N.currentGraphics)),this.updateGraphics(N,p)}if(f.visible=!0,d){var A=N.color.r*m.r,P=N.color.g*m.g,I=N.color.b*m.b;d.setLight(s[0]*A+l[0]*(1-A),s[1]*P+l[1]*(1-P),s[2]*I+l[2]*(1-I)),N.darkColor?(A=N.darkColor.r,P=N.darkColor.g,I=N.darkColor.b):(A=0,P=0,I=0),d.setDark(s[0]*A+l[0]*(1-A),s[1]*P+l[1]*(1-P),s[2]*I+l[2]*(1-I))}f.alpha=N.color.a}else f.visible=!1}var C=this.skeleton.drawOrder,V=null,k=null;for(u=0,c=C.length;u<c;u++){var N=a[C[u].data.index];f=this.slotContainers[C[u].data.index];if(k||null!==f.parent&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),N.currentGraphics&&N.attachment)k=N.clippingContainer,V=N.attachment,k.children.length=0,this.children[u]=f,V.endSlot==N.data&&(V.endSlot=null);else if(k){var D=this.tempClipContainers[u];D||((D=this.tempClipContainers[u]=this.newContainer()).visible=!1),this.children[u]=D,f.parent=null,k.addChild(f),V.endSlot==N.data&&(k.renderable=!0,k=null,V=null)}else this.children[u]=f}}},o.prototype.setSpriteRegion=function(t,e,n){e.region=n,e.texture=n.texture,n.size?(e.scale.x=n.size.width/n.originalWidth,e.scale.y=-n.size.height/n.originalHeight):(e.scale.x=t.scaleX*t.width/n.originalWidth,e.scale.y=-t.scaleY*t.height/n.originalHeight)},o.prototype.setMeshRegion=function(t,e,n){e.region=n,e.texture=n.texture,n.texture._updateUvs(),t.updateUVs(n,e.uvs),e.dirty++},o.prototype.autoUpdateTransform=function(){if(o.globalAutoUpdate){this.lastTime=this.lastTime||Date.now();var t=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(t)}else this.lastTime=0;b.Container.prototype.updateTransform.call(this)},o.prototype.createSprite=function(e,n,r){var a=n.region;e.tempAttachment===n&&(a=e.tempRegion,e.tempAttachment=null,e.tempRegion=null);var i=a.texture,o=this.newSprite(i);return o.rotation=n.rotation*t.core.MathUtils.degRad,o.anchor.x=.5,o.anchor.y=.5,o.position.x=n.x,o.position.y=n.y,o.alpha=n.color.a,o.region=n.region,this.setSpriteRegion(n,o,n.region),e.sprites=e.sprites||{},e.sprites[r]=o,o},o.prototype.createMesh=function(t,e){var n=e.region;t.tempAttachment===e&&(n=t.tempRegion,t.tempAttachment=null,t.tempRegion=null);var r=this.newMesh(n.texture,new Float32Array(e.regionUVs.length),new Float32Array(e.regionUVs.length),new Uint16Array(e.triangles),b.mesh.Mesh.DRAW_MODES.TRIANGLES);return r.canvasPadding=1.5,r.alpha=e.color.a,r.region=e.region,this.setMeshRegion(e,r,n),t.meshes=t.meshes||{},t.meshes[e.name]=r,r},o.prototype.createGraphics=function(t,e){var n=this.newGraphics(),r=new b.Polygon([]);return n.clear(),n.beginFill(16777215,1),n.drawPolygon(r),n.renderable=!1,t.currentGraphics=n,t.clippingContainer=this.newContainer(),t.clippingContainer.mask=t.currentGraphics,n},o.prototype.updateGraphics=function(t,e){var n=t.currentGraphics.graphicsData[0].shape.points,r=e.worldVerticesLength;n.length=r,e.computeWorldVertices(t,0,r,n,0,2),t.currentGraphics.dirty++,t.currentGraphics.clearDirty++},o.prototype.hackTextureBySlotIndex=function(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var a=this.skeleton.slots[e];if(!a)return!1;var i=a.attachment,o=i.region;return n&&((o=new t.core.TextureRegion).texture=n,o.size=r),a.currentSprite&&a.currentSprite.region!=o?(this.setSpriteRegion(i,a.currentSprite,o),a.currentSprite.region=o):a.currentMesh&&a.currentMesh.region!=o?this.setMeshRegion(i,a.currentMesh,o):(a.tempRegion=o,a.tempAttachment=i),!0},o.prototype.hackTextureBySlotName=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null);var r=this.skeleton.findSlotIndex(t);return-1!=r&&this.hackTextureBySlotIndex(r,e,n)},o.prototype.newContainer=function(){return new b.Container},o.prototype.newSprite=function(t){return new n(t)},o.prototype.newGraphics=function(){return new b.Graphics},o.prototype.newMesh=function(t,e,n,a,i){return new r(t,e,n,a,i)},o.prototype.transformHack=function(){return 1},o.prototype.hackAttachmentGroups=function(t,e,n){if(t){for(var r=[],a=[],i=0,o=this.skeleton.slots.length;i<o;i++){var s=this.skeleton.slots[i],l=s.currentSpriteName||s.currentMeshName||"",h=s.currentSprite||s.currentMesh;l.endsWith(t)?(h.parentGroup=e,a.push(h)):n&&h&&(h.parentGroup=n,r.push(h))}return[r,a]}},o.prototype.destroy=function(t){for(var e=0,n=this.skeleton.slots.length;e<n;e++){var r=this.skeleton.slots[e];for(var i in r.meshes)r.meshes[i].destroy(t);for(var o in r.meshes=null,r.sprites)r.sprites[o].destroy(t);r.sprites=null}for(e=0,n=this.slotContainers.length;e<n;e++)this.slotContainers[e].destroy(t);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,a.prototype.destroy.call(this,t)},o.globalAutoUpdate=!1,o.globalDelayLimit=0,o.clippingPolygon=[],o}(b.Container);function i(){var t=this.parent.worldTransform,e=this.worldTransform,n=this.localTransform;e.a=n.a*t.a+n.b*t.c,e.b=n.a*t.b+n.b*t.d,e.c=n.c*t.a+n.d*t.c,e.d=n.c*t.b+n.d*t.d,e.tx=n.tx*t.a+n.ty*t.c+t.tx,e.ty=n.tx*t.b+n.ty*t.d+t.ty,this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null}t.Spine=a}(x||(x={})),function(t){b.spine=t;var e=b.Texture.prototype;e._updateUvs||(e._updateUvs=e.updateUvs)}(x||(x={})),function(t){function e(){return function(e,a){if(!e.data||!function(t){return t.type===b.loaders.Resource.TYPE.JSON}(e)||!e.data.bones)return a();var i=e.metadata||{},o=i?e.metadata.spineSkeletonScale:null,s=i?e.metadata.spineAtlas:null;if(!1===s)return a();if(s&&s.pages){var l=new t.core.SkeletonJson(new t.core.AtlasAttachmentLoader(s));o&&(l.scale=o);var h=l.readSkeletonData(e.data);return e.spineData=h,e.spineAtlas=s,a()}var u=i.spineAtlasSuffix||".atlas",c=e.url,p=c.indexOf("?");p>0&&(c=c.substr(0,p)),c=c.substr(0,c.lastIndexOf("."))+u,e.metadata&&e.metadata.spineAtlasFile&&(c=e.metadata.spineAtlasFile),c=c.replace(this.baseUrl,"");var f={crossOrigin:e.crossOrigin,xhrType:b.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,metadata:i.spineMetadata||null,parentResource:e},d={crossOrigin:e.crossOrigin,metadata:i.imageMetadata||null,parentResource:e},m=e.url.substr(0,e.url.lastIndexOf("/")+1);m=m.replace(this.baseUrl,"");var g=i.imageNamePrefix||e.name+"_atlas_page_",v=i.images?r(i.images):i.image?r({default:i.image}):i.imageLoader?i.imageLoader(this,g,m,d):n(this,g,m,d),y=function(n){new t.core.TextureAtlas(n,v,(function(n){if(n){var r=new t.core.SkeletonJson(new t.core.AtlasAttachmentLoader(n));o&&(r.scale=o),e.spineData=r.readSkeletonData(e.data),e.spineAtlas=n}a()}))};e.metadata&&e.metadata.atlasRawData?y(e.metadata.atlasRawData):this.add(e.name+"_atlas",c,f,(function(t){t.error?a():y(t.data)}))}}function n(t,e,n,r){return n&&n.lastIndexOf("/")!==n.length-1&&(n+="/"),function(a,i){var o=e+a,s=n+a,l=t.resources[o];if(l){var h=function(){i(l.texture.baseTexture)};l.texture?h():l.onAfterMiddleware.add(h)}else t.add(o,s,r,(function(t){t.error?i(null):i(t.texture.baseTexture)}))}}function r(t){return function(e,n){var r=t[e]||t.default;r&&r.baseTexture?n(r.baseTexture):n(r)}}t.atlasParser=e,t.imageLoaderAdapter=n,t.syncImageLoaderAdapter=function(t,e){return t&&t.lastIndexOf("/")!==t.length-1&&(t+="/"),function(t,n){n(b.BaseTexture.fromImage(t,e))}},t.staticImageLoader=r,b.loaders.Loader&&(b.loaders.Loader.addPixiMiddleware(e),b.loader.use(e()))}(x||(x={}));var T=x,S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.init=function(){t.prototype.init.call(this,{pixiSpine:T})},e}(M),R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(u);return t.Spine=R,t.SpineSystem=S,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,EVA,EVA.plugin.renderer);window.EVA.plugin.renderer.spine=window.EVA.plugin.renderer.spine||_EVA_IIFE_spine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-spine",
3
- "version": "1.2.3",
3
+ "version": "1.2.6-alpha.0",
4
4
  "description": "@eva/plugin-renderer-spine",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-spine.esm.js",
@@ -19,9 +19,9 @@
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
21
  "@eva/inspector-decorator": "^0.0.5",
22
- "@eva/plugin-renderer": "1.2.3",
23
- "@eva/eva.js": "1.2.3",
24
- "@eva/spine-base": "1.2.3",
22
+ "@eva/plugin-renderer": "1.2.6-alpha.0",
23
+ "@eva/eva.js": "1.2.6-alpha.0",
24
+ "@eva/spine-base": "1.2.6-alpha.0",
25
25
  "pixi.js": "^4.8.7"
26
26
  }
27
27
  }